query_id
stringlengths
32
32
query
stringlengths
7
4.32k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
99c8a82633974151086776d24dbfd175
List lists all ApiManagementAuthorizationServers in the indexer.
[ { "docid": "4f106133da5da09c97780a5807ae0827", "score": "0.8314728", "text": "func (s *apiManagementAuthorizationServerLister) List(selector labels.Selector) (ret []*v1alpha1.ApiManagementAuthorizationServer, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ApiManagementAuthorizationServer))\n\t})\n\treturn ret, err\n}", "title": "" } ]
[ { "docid": "091a0ddde9bd3953b0d0eb032e3bbdcd", "score": "0.77177304", "text": "func (s apiManagementAuthorizationServerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ApiManagementAuthorizationServer, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ApiManagementAuthorizationServer))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "a59fd2e1e6059c1b38c4fb7419d8855d", "score": "0.76778734", "text": "func (s *apiManagementAuthorizationServerLister) ApiManagementAuthorizationServers(namespace string) ApiManagementAuthorizationServerNamespaceLister {\n\treturn apiManagementAuthorizationServerNamespaceLister{indexer: s.indexer, namespace: namespace}\n}", "title": "" }, { "docid": "b94746df3f19b3a8210e3972ca15b332", "score": "0.6944851", "text": "func NewApiManagementAuthorizationServerLister(indexer cache.Indexer) ApiManagementAuthorizationServerLister {\n\treturn &apiManagementAuthorizationServerLister{indexer: indexer}\n}", "title": "" }, { "docid": "dc6d7bc7ae8a18c7f92d8bec8fefa818", "score": "0.5947941", "text": "func (s expressRouteCircuitAuthorizationNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ExpressRouteCircuitAuthorization, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ExpressRouteCircuitAuthorization))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "e7c8072fda70903b4c90e60a00d53994", "score": "0.591068", "text": "func (s apiManagementAuthorizationServerNamespaceLister) Get(name string) (*v1alpha1.ApiManagementAuthorizationServer, error) {\n\tobj, exists, err := s.indexer.GetByKey(s.namespace + \"/\" + name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !exists {\n\t\treturn nil, errors.NewNotFound(v1alpha1.Resource(\"apimanagementauthorizationserver\"), name)\n\t}\n\treturn obj.(*v1alpha1.ApiManagementAuthorizationServer), nil\n}", "title": "" }, { "docid": "63682b93ab69ed77279dbe487553b9dd", "score": "0.58656436", "text": "func (a *AuthCommand) ListAuthServers(ctx context.Context, clusterAPI auth.ClientI) error {\n\tservers, err := clusterAPI.GetAuthServers()\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\n\tsc := &serverCollection{servers}\n\n\tswitch a.format {\n\tcase teleport.Text:\n\t\t// auth servers don't have labels.\n\t\tverbose := false\n\t\treturn sc.writeText(os.Stdout, verbose)\n\tcase teleport.YAML:\n\t\treturn writeYAML(sc, os.Stdout)\n\tcase teleport.JSON:\n\t\treturn writeJSON(sc, os.Stdout)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7a60f2c00306fb4bdd2c139bdaacd933", "score": "0.5825034", "text": "func (s *expressRouteCircuitAuthorizationLister) List(selector labels.Selector) (ret []*v1alpha1.ExpressRouteCircuitAuthorization, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ExpressRouteCircuitAuthorization))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "a9871dcad2b8820ae488259dc3b0a23b", "score": "0.5800256", "text": "func (a *AuthorizationsService) All() (auths []Authorization, result *Result) {\n\tresult = a.client.get(a.URL, &auths)\n\treturn\n}", "title": "" }, { "docid": "d9c5031482dbb44e69a8e57304ab953e", "score": "0.57313925", "text": "func (v AdminsResource) List(c buffalo.Context) error {\n\t// Get the DB connection from the context\n\ttx, ok := c.Value(\"tx\").(*pop.Connection)\n\tif !ok {\n\t\treturn errors.WithStack(errors.New(\"no transaction found\"))\n\t}\n\n\tadmins := &models.Admins{}\n\n\t// Paginate results. Params \"page\" and \"per_page\" control pagination.\n\t// Default values are \"page=1\" and \"per_page=20\".\n\tq := tx.PaginateFromParams(c.Params())\n\n\t// Retrieve all Admins from the DB\n\tif err := q.All(admins); err != nil {\n\t\treturn errors.WithStack(err)\n\t}\n\n\t// Add the paginator to the context so it can be used in the template.\n\tc.Set(\"pagination\", q.Paginator)\n\n\treturn c.Render(200, r.JSON(admins))\n}", "title": "" }, { "docid": "37956872cf75e8ab5619fa929a5b614a", "score": "0.5729389", "text": "func (i *Influx) ListAuthorization(userID string, user string, orgID string, org string) (auth []*protocol.Authorization, err error) {\n\tres, err := i.HTTPInstance.Get(context.TODO(), i.HTTPClient, i.GetBasicURL()+\"/authorizations\", map[string]string{\n\t\t\"user\": user,\n\t\t\"userID\": userID,\n\t\t\"orgID\": orgID,\n\t\t\"org\": org,\n\t}, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\ttype a struct {\n\t\tAuthorizations []*protocol.Authorization `json:\"authorizations\"`\n\t}\n\tvar resBody a\n\terr = json.Unmarshal(res, &resBody)\n\n\tauth = resBody.Authorizations\n\treturn\n}", "title": "" }, { "docid": "281ec8b5e2a5f1a32a4ff2d8367b64b1", "score": "0.5619904", "text": "func (s *notificationHubAuthorizationRuleLister) List(selector labels.Selector) (ret []*v1alpha1.NotificationHubAuthorizationRule, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.NotificationHubAuthorizationRule))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "4b46e9d0023f1aa2019a1b3e0be0838a", "score": "0.55978197", "text": "func AdminList(w http.ResponseWriter, data interface{}) {\n\trender(tpAdminList, w, data)\n}", "title": "" }, { "docid": "67328f8528bb6889b7d24b75faac747a", "score": "0.5551648", "text": "func (s notificationHubAuthorizationRuleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NotificationHubAuthorizationRule, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.NotificationHubAuthorizationRule))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "877284ee9e9f3df41d4fb73e5686139a", "score": "0.549978", "text": "func (s horusecManagerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.HorusecManager, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.HorusecManager))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "d413cff33b4c261acd652f0de7e31a3f", "score": "0.5454488", "text": "func AdminList(w http.ResponseWriter, data *AdminListData) {\n\trender(tpAdminList, w, data)\n}", "title": "" }, { "docid": "807188e2a5b53b99b8c44d96ecf18dff", "score": "0.5428651", "text": "func (api *credentialsAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.Credentials, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().Credentials().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.Credentials\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Credentials)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "4f5a2faea16ff0ac24361e5dca18693d", "score": "0.54259104", "text": "func (a *Api) List(w http.ResponseWriter, r *http.Request) error {\n\treturn nil\n}", "title": "" }, { "docid": "4291f5b2f5b69e767da62829ed1f19b6", "score": "0.5418108", "text": "func (api *hostAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.Host, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().Host().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.Host\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Host)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "a6c05f1330a9c6b4b93de03f669ef7b3", "score": "0.5412018", "text": "func (s *horusecManagerLister) List(selector labels.Selector) (ret []*v1alpha1.HorusecManager, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.HorusecManager))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "87425b25e0c24b128bbd552a77a27749", "score": "0.5362008", "text": "func (r *Cluster) AdminAPITLS() *AdminAPI {\n\tif r == nil {\n\t\treturn nil\n\t}\n\tfor i, el := range r.Spec.Configuration.AdminAPI {\n\t\tif el.TLS.Enabled {\n\t\t\treturn &r.Spec.Configuration.AdminAPI[i]\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "255bb7cbb216a8ffa970229dd4b8e277", "score": "0.53487533", "text": "func (s baremetalMachineProviderConfigNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BaremetalMachineProviderConfig, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.BaremetalMachineProviderConfig))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "c059d60423665dc95468dcea9c922787", "score": "0.5301967", "text": "func (api *tenantAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.Tenant, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().Tenant().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.Tenant\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Tenant)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "4529c47d7c6a722e187d3002cf636af7", "score": "0.5261044", "text": "func (o SSHAuthorizationPoliciesList) List() elemental.IdentifiablesList {\n\n\tout := make(elemental.IdentifiablesList, len(o))\n\tfor i := 0; i < len(o); i++ {\n\t\tout[i] = o[i]\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "ac2fa7b610ed7f5a3ac9492033568644", "score": "0.52271676", "text": "func (s *adminOrganizations) List(ctx context.Context, options *AdminOrganizationListOptions) (*AdminOrganizationList, error) {\n\tif err := options.valid(); err != nil {\n\t\treturn nil, err\n\t}\n\tu := \"admin/organizations\"\n\treq, err := s.client.NewRequest(\"GET\", u, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\torgl := &AdminOrganizationList{}\n\terr = req.Do(ctx, orgl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn orgl, nil\n}", "title": "" }, { "docid": "5788c0353ea7ee5e71dd87b710a54551", "score": "0.52174497", "text": "func (api *versionAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.Version, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().Version().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.Version\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Version)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "d7c6872c40cd8e5a0200f7915f737125", "score": "0.5190175", "text": "func (api *clusterAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.Cluster, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().Cluster().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.Cluster\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Cluster)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "4143fc09ad0d05027e2c20da944bb4e4", "score": "0.51892877", "text": "func List(w http.ResponseWriter, r *http.Request) {\n\tauthUser, err := auth.GetUserFromJWT(w, r)\n\tif err != nil {\n\t\tresponse.FormatStandardResponse(false, \"error-auth\", \"\", err.Error(), w)\n\t\treturn\n\t}\n\n\tlistHandler(w, authUser, false)\n}", "title": "" }, { "docid": "515b2159f2f15f8dd61fb3d9fe8b5738", "score": "0.5184036", "text": "func (api *bucketAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*objstore.Bucket, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ObjstoreV1().Bucket().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*objstore.Bucket\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Bucket)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "5578cc4dcb4bbe44ddea5a023bcc4c76", "score": "0.5176917", "text": "func (h *HTTPApi) listIndex(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tcollections := h.storageNode.Datasources[ps.ByName(\"datasource\")].GetMeta().Databases[ps.ByName(\"dbname\")].ShardInstances[ps.ByName(\"shardinstance\")].Collections[ps.ByName(\"collectionname\")]\n\n\t// Now we need to return the results\n\tif bytes, err := json.Marshal(collections.Indexes); err != nil {\n\t\t// TODO: log this better?\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t} else {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.Write(bytes)\n\t}\n}", "title": "" }, { "docid": "d60d07c35378b221483012d614e7f6cd", "score": "0.5165391", "text": "func (s *ResourcesService) List(ctx context.Context, realm, clientID string) ([]*Resource, *http.Response, error) {\n\tu := fmt.Sprintf(\"admin/realms/%s/clients/%s/authz/resource-server/resource\", realm, clientID)\n\treq, err := s.keycloak.NewRequest(http.MethodGet, u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resources []*Resource\n\tres, err := s.keycloak.Do(ctx, req, &resources)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn resources, res, nil\n}", "title": "" }, { "docid": "7a426199c4d8b5eee5f5f4d88a528061", "score": "0.5164996", "text": "func (s *HMACAuthService) List(ctx context.Context,\n\topt *ListOpt) ([]*HMACAuth, *ListOpt, error) {\n\tdata, next, err := s.client.list(ctx, \"/hmac-auths\", opt)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar hmacAuths []*HMACAuth\n\tfor _, object := range data {\n\t\tb, err := object.MarshalJSON()\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tvar hmacAuth HMACAuth\n\t\terr = json.Unmarshal(b, &hmacAuth)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\thmacAuths = append(hmacAuths, &hmacAuth)\n\t}\n\n\treturn hmacAuths, next, nil\n}", "title": "" }, { "docid": "10cf7784c880b438d073b0788aa238ed", "score": "0.51648563", "text": "func (a ClustersAPI) List() ([]httpmodels.GetResp, error) {\n\tvar clusterList = struct {\n\t\tClusters []httpmodels.GetResp `json:\"clusters,omitempty\" url:\"clusters,omitempty\"`\n\t}{}\n\n\tresp, err := a.Client.performQuery(http.MethodGet, \"/clusters/list\", nil, nil)\n\tif err != nil {\n\t\treturn clusterList.Clusters, err\n\t}\n\n\terr = json.Unmarshal(resp, &clusterList)\n\treturn clusterList.Clusters, err\n}", "title": "" }, { "docid": "78fdf2bd68d6ed8af074b677b0565fa7", "score": "0.516133", "text": "func (k *Keystone) listDomainsAPI(c echo.Context) error {\n\tclusterID := c.Request().Header.Get(xClusterIDKey)\n\tif ke := getKeystoneEndpoints(clusterID, k.endpointStore); len(ke) > 0 {\n\t\treturn k.proxyRequest(c)\n\t}\n\n\t_, err := k.validateToken(c.Request())\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = k.setAssignment(clusterID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdomains := k.Assignment.ListDomains()\n\tdomainsResponse := &asfkeystone.DomainListResponse{\n\t\tDomains: domains,\n\t}\n\treturn c.JSON(http.StatusOK, domainsResponse)\n}", "title": "" }, { "docid": "15534ee78f071313ee6b71831e0a5234", "score": "0.5160815", "text": "func (s automationAccountNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.AutomationAccount, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.AutomationAccount))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "314146110630b81e37c908a1a9548acf", "score": "0.51579976", "text": "func (s guarddutyThreatintelsetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.GuarddutyThreatintelset, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.GuarddutyThreatintelset))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "40f21a976b7820eb7b685be1a428c2c0", "score": "0.515476", "text": "func (s *StorageClusterAPI) List(w http.ResponseWriter, r *http.Request) {\n\tclusters, err := s.storageClusterService.List()\n\tif err != nil {\n\t\tapi.Error(w, err)\n\t\treturn\n\t}\n\tapi.OK(w, clusters)\n}", "title": "" }, { "docid": "36c85cb9427090b530913e68af139533", "score": "0.5143041", "text": "func (s oIDCProviderConfigNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.OIDCProviderConfig, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.OIDCProviderConfig))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "3fd748deab918284459e987ec644f549", "score": "0.5140607", "text": "func (p *PorterHelper) List() (map[string]string, error) {\n\tentries := p.Cache.List()\n\n\tres := make(map[string]string)\n\n\tfor _, entry := range entries {\n\t\tres[entry.ProxyEndpoint] = entry.AuthorizationToken\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "27b1e317bf8ff08ceb523cb43f40d8e9", "score": "0.5128472", "text": "func ListAllPermissionGroupsController(c *fiber.Ctx) error {\n\n\t// check login\n\tif ok, _ := middleware.ValidateAccessToken(c); !ok {\n\t\tres, _ := models.GetJSONResponse(\"You do not have the permission to perform this\", \"#d41717\", \"ok\", \"None\", 200)\n\t\treturn c.Send(res)\n\t}\n\n\treturn c.JSON(listAllPermissionGroupsResponse{\n\t\t\"Successfully fetched all permission groups\",\n\t\tactions.GetAllPermissions(),\n\t\t\"#1db004\",\n\t})\n}", "title": "" }, { "docid": "631f30d09948459b8f1d073d4ef17ec8", "score": "0.5116319", "text": "func (s dnsManagedZoneNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.DnsManagedZone, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.DnsManagedZone))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "4b8c5318efd1a5387f19efbcb17487cb", "score": "0.511019", "text": "func (s *dnsManagedZoneLister) List(selector labels.Selector) (ret []*v1alpha1.DnsManagedZone, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.DnsManagedZone))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "e7fc4e69a63beb1cf6954cb9ffcb3d16", "score": "0.5104434", "text": "func ExampleAuthorizationServerClient_NewListByServicePager() {\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 := armapimanagement.NewClientFactory(\"<subscription-id>\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\tpager := clientFactory.NewAuthorizationServerClient().NewListByServicePager(\"rg1\", \"apimService1\", &armapimanagement.AuthorizationServerClientListByServiceOptions{Filter: nil,\n\t\tTop: nil,\n\t\tSkip: nil,\n\t})\n\tfor pager.More() {\n\t\tpage, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed to advance page: %v\", err)\n\t\t}\n\t\tfor _, v := range page.Value {\n\t\t\t// You could use page here. We use blank identifier for just demo purposes.\n\t\t\t_ = v\n\t\t}\n\t\t// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.\n\t\t// page.AuthorizationServerCollection = armapimanagement.AuthorizationServerCollection{\n\t\t// \tValue: []*armapimanagement.AuthorizationServerContract{\n\t\t// \t\t{\n\t\t// \t\t\tName: to.Ptr(\"newauthServer\"),\n\t\t// \t\t\tType: to.Ptr(\"Microsoft.ApiManagement/service/authorizationServers\"),\n\t\t// \t\t\tID: to.Ptr(\"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer\"),\n\t\t// \t\t\tProperties: &armapimanagement.AuthorizationServerContractProperties{\n\t\t// \t\t\t\tDescription: to.Ptr(\"test server\"),\n\t\t// \t\t\t\tAuthorizationMethods: []*armapimanagement.AuthorizationMethod{\n\t\t// \t\t\t\t\tto.Ptr(armapimanagement.AuthorizationMethodGET)},\n\t\t// \t\t\t\t\tBearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{\n\t\t// \t\t\t\t\t\tto.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},\n\t\t// \t\t\t\t\t\tDefaultScope: to.Ptr(\"read write\"),\n\t\t// \t\t\t\t\t\tResourceOwnerPassword: to.Ptr(\"pwd\"),\n\t\t// \t\t\t\t\t\tResourceOwnerUsername: to.Ptr(\"un\"),\n\t\t// \t\t\t\t\t\tSupportState: to.Ptr(true),\n\t\t// \t\t\t\t\t\tTokenEndpoint: to.Ptr(\"https://www.contoso.com/oauth2/token\"),\n\t\t// \t\t\t\t\t\tAuthorizationEndpoint: to.Ptr(\"https://www.contoso.com/oauth2/auth\"),\n\t\t// \t\t\t\t\t\tClientID: to.Ptr(\"1\"),\n\t\t// \t\t\t\t\t\tClientRegistrationEndpoint: to.Ptr(\"https://www.contoso.com/apps\"),\n\t\t// \t\t\t\t\t\tDisplayName: to.Ptr(\"test2\"),\n\t\t// \t\t\t\t\t\tGrantTypes: []*armapimanagement.GrantType{\n\t\t// \t\t\t\t\t\t\tto.Ptr(armapimanagement.GrantTypeAuthorizationCode),\n\t\t// \t\t\t\t\t\t\tto.Ptr(armapimanagement.GrantTypeImplicit)},\n\t\t// \t\t\t\t\t\t\tUseInAPIDocumentation: to.Ptr(false),\n\t\t// \t\t\t\t\t\t\tUseInTestConsole: to.Ptr(true),\n\t\t// \t\t\t\t\t\t},\n\t\t// \t\t\t\t\t},\n\t\t// \t\t\t\t\t{\n\t\t// \t\t\t\t\t\tName: to.Ptr(\"newauthServer2\"),\n\t\t// \t\t\t\t\t\tType: to.Ptr(\"Microsoft.ApiManagement/service/authorizationServers\"),\n\t\t// \t\t\t\t\t\tID: to.Ptr(\"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationServers/newauthServer2\"),\n\t\t// \t\t\t\t\t\tProperties: &armapimanagement.AuthorizationServerContractProperties{\n\t\t// \t\t\t\t\t\t\tDescription: to.Ptr(\"test server\"),\n\t\t// \t\t\t\t\t\t\tAuthorizationMethods: []*armapimanagement.AuthorizationMethod{\n\t\t// \t\t\t\t\t\t\t\tto.Ptr(armapimanagement.AuthorizationMethodGET)},\n\t\t// \t\t\t\t\t\t\t\tBearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{\n\t\t// \t\t\t\t\t\t\t\t\tto.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)},\n\t\t// \t\t\t\t\t\t\t\t\tClientAuthenticationMethod: []*armapimanagement.ClientAuthenticationMethod{\n\t\t// \t\t\t\t\t\t\t\t\t\tto.Ptr(armapimanagement.ClientAuthenticationMethodBasic)},\n\t\t// \t\t\t\t\t\t\t\t\t\tDefaultScope: to.Ptr(\"read write\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tResourceOwnerPassword: to.Ptr(\"pwd\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tResourceOwnerUsername: to.Ptr(\"un\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tSupportState: to.Ptr(true),\n\t\t// \t\t\t\t\t\t\t\t\t\tTokenEndpoint: to.Ptr(\"https://www.contoso.com/oauth2/token\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tAuthorizationEndpoint: to.Ptr(\"https://www.contoso.com/oauth2/auth\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tClientID: to.Ptr(\"1\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tClientRegistrationEndpoint: to.Ptr(\"https://www.contoso.com/apps\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tDisplayName: to.Ptr(\"test3\"),\n\t\t// \t\t\t\t\t\t\t\t\t\tGrantTypes: []*armapimanagement.GrantType{\n\t\t// \t\t\t\t\t\t\t\t\t\t\tto.Ptr(armapimanagement.GrantTypeAuthorizationCode),\n\t\t// \t\t\t\t\t\t\t\t\t\t\tto.Ptr(armapimanagement.GrantTypeImplicit)},\n\t\t// \t\t\t\t\t\t\t\t\t\t\tUseInAPIDocumentation: to.Ptr(true),\n\t\t// \t\t\t\t\t\t\t\t\t\t\tUseInTestConsole: to.Ptr(false),\n\t\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}\n}", "title": "" }, { "docid": "3ee0e7d4f43ec638b4a1650434d3ace8", "score": "0.5097257", "text": "func (kc *KongK8sClient) ListAPIs() *KongGetResp {\n\tresponse, err := resty.R().Get(kc.makeKongAPIURL(\"/apis/\"))\n\tif err != nil {\n\t\tlog.Printf(\"Error calling GET on Kong admin: %v\", err)\n\t\treturn nil\n\t}\n\tAPIResult := KongGetResp{}\n\terr = json.Unmarshal(response.Body(), &APIResult)\n\tif err != nil {\n\t\tlog.Printf(\"Error unmarshalling response: %v\", err)\n\t\treturn nil\n\t}\n\treturn &APIResult\n}", "title": "" }, { "docid": "57e4d2764ad83ee2a625c7890ff7d571", "score": "0.50958556", "text": "func (k *Keystone) listDomainsAPI(c echo.Context) error {\n\tclusterID := c.Request().Header.Get(xClusterIDKey)\n\tif ke := getKeystoneEndpoints(clusterID, k.endpointStore); len(ke) > 0 {\n\t\treturn k.proxyRequest(c, ke)\n\t}\n\n\t_, err := k.validateToken(c.Request())\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = k.setAssignment(clusterID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdomains := k.Assignment.ListDomains()\n\tdomainsResponse := &DomainListResponse{\n\t\tDomains: domains,\n\t}\n\treturn c.JSON(http.StatusOK, domainsResponse)\n}", "title": "" }, { "docid": "306e3dd685f2f685f79f8e0b8fa74696", "score": "0.5095286", "text": "func GetAdmins(w http.ResponseWriter, r *http.Request) {\n\tcursor, limit, err := api.ParseCursor(r)\n\tif err != nil {\n\t\trender.Error(w, admin.WrapError(admin.ErrorBadRequestType, err,\n\t\t\t\"error parsing cursor and limit from query params\"))\n\t\treturn\n\t}\n\n\tadmins, nextCursor, err := mustAuthority(r.Context()).GetAdmins(cursor, limit)\n\tif err != nil {\n\t\trender.Error(w, admin.WrapErrorISE(err, \"error retrieving paginated admins\"))\n\t\treturn\n\t}\n\trender.JSON(w, &GetAdminsResponse{\n\t\tAdmins: admins,\n\t\tNextCursor: nextCursor,\n\t})\n}", "title": "" }, { "docid": "35dcd50da986741ce293ab2195fdcd42", "score": "0.50805694", "text": "func (api *licenseAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.License, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().License().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.License\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.License)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "b1c5267b64a870896510c4f3222785fe", "score": "0.5079137", "text": "func (a *Admin) Index(c *gin.Context) {\n\n\tflash := helper.GetFlash(c)\n\n\te, _ := casbin.NewEnforcer(\"config/rbac_model.conf\", \"config/rbac_policy.csv\")\n\troles := e.GetAllRoles()\n\n\tc.HTML(http.StatusOK, \"admin/index\", gin.H{\n\t\t\"title\": \"管理员管理\",\n\t\t\"flash\": flash,\n\t\t\"roles\": roles,\n\t})\n}", "title": "" }, { "docid": "846c78a0ea258ececf0d33fac943b08a", "score": "0.5073442", "text": "func (a SecretAclsAPI) List(scope string) ([]ACLItem, error) {\n\tvar aclItem struct {\n\t\tItems []ACLItem `json:\"items,omitempty\"`\n\t}\n\terr := a.client.Get(\"/secrets/acls/list\", map[string]string{\n\t\t\"scope\": scope,\n\t}, &aclItem)\n\treturn aclItem.Items, err\n}", "title": "" }, { "docid": "e778413ed32e55f472a838403e6c3e75", "score": "0.50629306", "text": "func provisionerList(w http.ResponseWriter, r *http.Request, t auth.Token) (err error) {\n\tallowed := permission.Check(t, permission.PermClusterRead)\n\tif !allowed {\n\t\treturn permission.ErrUnauthorized\n\t}\n\tprovs, err := provision.Registry()\n\tif err != nil {\n\t\treturn err\n\t}\n\tinfo := make([]provisionerInfo, len(provs))\n\tfor i, p := range provs {\n\t\tinfo[i].Name = p.GetName()\n\t\tif clusterProv, ok := p.(cluster.ClusteredProvisioner); ok {\n\t\t\tinfo[i].ClusterHelp = clusterProv.ClusterHelp()\n\t\t}\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\treturn json.NewEncoder(w).Encode(info)\n}", "title": "" }, { "docid": "32bc732cd676904904e1354a321ae0b1", "score": "0.5059273", "text": "func (s *cognitoResourceServerLister) List(selector labels.Selector) (ret []*v1alpha1.CognitoResourceServer, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.CognitoResourceServer))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "f6e21b5cb8c687d10a3ed2451b31b076", "score": "0.5056337", "text": "func (w *wireguardServerConfig) List() ([]api.WireguardServerConfig, error) {\n\tvar wgscList []api.WireguardServerConfig\n\treturn wgscList, w.store.Search(w.prefix, regexp.MustCompile(\".*\"), func(k, v []byte) error {\n\t\tvar obj api.WireguardServerConfig\n\t\tif err := json.Unmarshal(v, &obj); err != nil {\n\t\t\treturn err\n\t\t}\n\t\twgscList = append(wgscList, obj)\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "9a434056a929f2128a9cc1be948756c1", "score": "0.5042187", "text": "func (client UsageDetailsClient) ListByManagementGroupResponder(resp *http.Response) (result UsageDetailsListResult, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "7de8b2d89914bd0681697a01e6d400d7", "score": "0.50409424", "text": "func (s cognitoResourceServerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CognitoResourceServer, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.CognitoResourceServer))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "522ebf873c3396aa5503f32d94c4cbc3", "score": "0.5029734", "text": "func (b *ListBuilder) APIList() (*apisv1alpha1.CStorPoolClusterList, error) {\n\tl, err := b.List()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.ToAPIList(), nil\n}", "title": "" }, { "docid": "84b7feeaa7afbb6e57a825b3a424a2e2", "score": "0.50275534", "text": "func (s *automationAccountLister) List(selector labels.Selector) (ret []*v1alpha1.AutomationAccount, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.AutomationAccount))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "ee740c6313b5a5cfe89de689d75265d9", "score": "0.5019684", "text": "func getAdmins(e echo.Context) error {\n\tdb := e.Get(\"database\").(*mgo.Database)\n\tif db == nil {\n\t\treturn fmt.Errorf(\"Bad database session\")\n\t}\n\n\tuuid, err := uuid.FromString(e.QueryParam(\"siteUuid\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Bad parameters\")\n\t}\n\n\ta := models.Admins{\n\t\tAdmins: []models.Admin{},\n\t}\n\n\terr = db.C(\"Admins\").Find(bson.M{\"adminSiteUuid\": uuid}).All(&a.Admins)\n\tif err != nil {\n\t\treturn e.NoContent(http.StatusNotFound)\n\t}\n\treturn e.JSON(http.StatusOK, a)\n}", "title": "" }, { "docid": "d4b7cdd56d8bbd6163a4f779f28461d3", "score": "0.5006133", "text": "func (n *namespaceClient) List() ([]ns.Metadata, error) {\n\turl := fmt.Sprintf(\"%s%s\", n.url, nsh.GetURL)\n\tresp, err := n.client.DoHTTPRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdata := &admin.NamespaceGetResponse{}\n\tdefer func() {\n\t\tioutil.ReadAll(resp.Body)\n\t\tresp.Body.Close()\n\t}()\n\tif err := jsonpb.Unmarshal(resp.Body, data); err != nil {\n\t\treturn nil, err\n\t}\n\tnsMetas := []ns.Metadata{}\n\tfor nsID, nsOpts := range data.GetRegistry().GetNamespaces() {\n\t\tmd, err := ns.ToMetadata(nsID, nsOpts)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnsMetas = append(nsMetas, md)\n\t}\n\tn.logger.Info(\"namespace retrieved\")\n\treturn nsMetas, nil\n}", "title": "" }, { "docid": "eef76d7f5e6061c11528d6265179a777", "score": "0.5002716", "text": "func (h HTTPHandler) CollectionList(w http.ResponseWriter, r *http.Request) {\n\terr := processJWT(r, false, h.secret)\n\tif err != nil {\n\t\thttp.Error(w, \"{\\\"message\\\": \\\"\"+err.Error()+\"\\\"}\", 401)\n\t\treturn\n\t}\n\n\tvar indexNames []string\n\tfor name := range h.bf.Local.Search.BlockchainIndices {\n\t\tindexNames = append(indexNames, name)\n\t}\n\n\trv := struct {\n\t\tMessage string `json:\"message\"`\n\t\tIndexes []string `json:\"collections\"`\n\t}{\n\t\tMessage: \"ok\",\n\t\tIndexes: indexNames,\n\t}\n\n\tmustEncode(w, rv)\n}", "title": "" }, { "docid": "3d12e9dc4a98a578c70dcaeb4171440c", "score": "0.49974218", "text": "func (c *UsersController) List(ctx *app.ListUsersContext) error {\n\treturn proxy.RouteHTTP(ctx, c.config.GetAuthShortServiceHostName())\n}", "title": "" }, { "docid": "0a1c0c35aec86533a02dc911e1b85be9", "score": "0.4992547", "text": "func (core *Plugin) listAdmins(c cmd.Context) (string, slack.PostMessageParameters) {\n\tnoParams := slack.PostMessageParameters{}\n\tmembers := model.Members{}\n\tif err := core.Bot.DAL.GetAdmins(&members); err != nil {\n\t\tlog.WithError(err).Error(\"failed to get admins\")\n\t\treturn \"Failed to get admins\", noParams\n\t}\n\tnames := \"\"\n\tfor _, member := range members {\n\t\tnames += member.Name + \"\\n\"\n\t}\n\treturn names, noParams\n}", "title": "" }, { "docid": "1ebe015a91f0fca992ce732cf27d7907", "score": "0.49841097", "text": "func (f *FUOTADeploymentAPI) List(ctx context.Context, req *pb.ListFUOTADeploymentRequest) (*pb.ListFUOTADeploymentResponse, error) {\n\tvar err error\n\tvar idFilter bool\n\n\tfilters := FUOTADeploymentFilters{\n\t\tLimit: int(req.Limit),\n\t\tOffset: int(req.Offset),\n\t}\n\n\tif req.ApplicationId != 0 {\n\t\tidFilter = true\n\t\tfilters.ApplicationID = req.ApplicationId\n\n\t\t// validate that the client has access to the given application\n\t\tif valid, err := application.NewValidator(f.st).ValidateApplicationAccess(ctx, auth.Read, req.ApplicationId); !valid || err != nil {\n\t\t\treturn nil, status.Errorf(codes.Unauthenticated, \"authentication failed: %s\", err)\n\t\t}\n\t}\n\n\tif req.DevEui != \"\" {\n\t\tidFilter = true\n\t\tif err := filters.DevEUI.UnmarshalText([]byte(req.DevEui)); err != nil {\n\t\t\treturn nil, status.Errorf(codes.InvalidArgument, \"dev_eui: %s\", err)\n\t\t}\n\n\t\t// validate that the client has access to the given devEUI\n\t\tif valid, err := device.NewValidator(f.st).ValidateNodeAccess(ctx, auth.Read, filters.DevEUI); !valid || err != nil {\n\t\t\treturn nil, status.Errorf(codes.Unauthenticated, \"authentication failed: %s\", err)\n\t\t}\n\t}\n\n\tif !idFilter {\n\t\tuser, err := fuotaCred.NewValidator().GetUser(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, helpers.ErrToRPCError(err)\n\t\t}\n\n\t\tif !user.IsGlobalAdmin {\n\t\t\treturn nil, status.Errorf(codes.Unauthenticated, \"client must be global admin for unfiltered request\")\n\t\t}\n\t}\n\n\tcount, err := f.st.GetFUOTADeploymentCount(ctx, filters)\n\tif err != nil {\n\t\treturn nil, helpers.ErrToRPCError(err)\n\t}\n\n\tdeployments, err := f.st.GetFUOTADeployments(ctx, filters)\n\tif err != nil {\n\t\treturn nil, helpers.ErrToRPCError(err)\n\t}\n\n\treturn f.returnList(count, deployments)\n}", "title": "" }, { "docid": "5a20cb0c06af47b1012e32ed242be277", "score": "0.4981677", "text": "func (h *httpServer) List(c echo.Context) error {\n\tports, err := h.impl.ListExposed(context.Background())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn c.JSON(200, ports)\n}", "title": "" }, { "docid": "516ef67443b6da11952afb23e5d9edeb", "score": "0.49783674", "text": "func jobStatusMgmtList(c *cli.Context) error {\n\tif err := adm.VerifyNoArgument(c); err != nil {\n\t\treturn err\n\t}\n\n\treturn adm.Perform(`get`, `/job/status-mgmt/`, `list`, nil, c)\n}", "title": "" }, { "docid": "ee9f38ea0ec4bb644415fa3bdf6abc89", "score": "0.4975336", "text": "func (client *AvailabilitySetsClient) List(resourceGroupName string, options *AvailabilitySetsListOptions) *AvailabilitySetsListPager {\n\treturn &AvailabilitySetsListPager{\n\t\tclient: client,\n\t\trequester: func(ctx context.Context) (*policy.Request, error) {\n\t\t\treturn client.listCreateRequest(ctx, resourceGroupName, options)\n\t\t},\n\t\tadvancer: func(ctx context.Context, resp AvailabilitySetsListResponse) (*policy.Request, error) {\n\t\t\treturn runtime.NewRequest(ctx, http.MethodGet, *resp.AvailabilitySetListResult.NextLink)\n\t\t},\n\t}\n}", "title": "" }, { "docid": "fa487b7691ba496a95a88513ca05c04f", "score": "0.49681526", "text": "func (api *configurationsnapshotAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.ConfigurationSnapshot, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().ConfigurationSnapshot().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.ConfigurationSnapshot\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.ConfigurationSnapshot)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "9361d6f656eae1b0206be00ab285fd2e", "score": "0.49541092", "text": "func List() {\n\tfmt.Println(\"\")\n\tfor _, app := range Registry() {\n\t\tfmt.Printf(\"[%s]\\n\", app.Meta().Name)\n\t\tfmt.Printf(\" Description : %s\\n\", app.Meta().Description)\n\t\tfmt.Printf(\" Version : %s\\n\", app.Meta().ResourceVersion)\n\t\tapp.Install(nil)\n\t\tfor _, obj := range app.Objects() {\n\t\t\t_, kind := obj.GetObjectKind().GroupVersionKind().ToAPIVersionAndKind()\n\t\t\tfmt.Printf(\" > %s\\n\", kind)\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}", "title": "" }, { "docid": "7bf2639a21fe9c4fbd930a58a028d70e", "score": "0.494303", "text": "func (s *baremetalMachineProviderConfigLister) List(selector labels.Selector) (ret []*v1alpha1.BaremetalMachineProviderConfig, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.BaremetalMachineProviderConfig))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "62fa4e26b0728f7e83192d0a16033aed", "score": "0.4934711", "text": "func (s *AttestorServer) ListBinaryauthorizationAttestor(ctx context.Context, request *binaryauthorizationpb.ListBinaryauthorizationAttestorRequest) (*binaryauthorizationpb.ListBinaryauthorizationAttestorResponse, error) {\n\tcl, err := createConfigAttestor(ctx, request.ServiceAccountFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresources, err := cl.ListAttestor(ctx, request.Project)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar protos []*binaryauthorizationpb.BinaryauthorizationAttestor\n\tfor _, r := range resources.Items {\n\t\trp := AttestorToProto(r)\n\t\tprotos = append(protos, rp)\n\t}\n\treturn &binaryauthorizationpb.ListBinaryauthorizationAttestorResponse{Items: protos}, nil\n}", "title": "" }, { "docid": "73420a7288e48380a8088a1381012465", "score": "0.49341178", "text": "func (s kustoDatabasePrincipalNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.KustoDatabasePrincipal, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.KustoDatabasePrincipal))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "188bba2304f705460de00a33f03eb2a1", "score": "0.49316013", "text": "func GetAdmins() []string {\n\treturn strings.Split(envy.Get(\"ADMINS\", \"\"), \",\")\n}", "title": "" }, { "docid": "cbf26d59f8a809f90bcdb29fc670d935", "score": "0.49277782", "text": "func (proxy *StandAloneProxyConfig) GetManagementServers() []ManagementServer {\n\tvar mgmtServers = make([]ManagementServer, 0)\n\tfor _, v := range proxy.managementServers {\n\t\tmgmtServers = append(mgmtServers, *v)\n\t}\n\treturn mgmtServers\n}", "title": "" }, { "docid": "7a5b52dc445ebde32c27227945607a85", "score": "0.4926965", "text": "func (s *kustoDatabasePrincipalLister) List(selector labels.Selector) (ret []*v1alpha1.KustoDatabasePrincipal, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.KustoDatabasePrincipal))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "0d5b55b4eebad606dadaa420b38f3b61", "score": "0.49263516", "text": "func (s scyllaDBMonitoringNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ScyllaDBMonitoring, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ScyllaDBMonitoring))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "94b55bb07c2568b06c4a912c76bcc8dd", "score": "0.49210647", "text": "func (nsar *NamespacedServiceAccountReflector) List() ([]interface{}, error) {\n\treturn virtualkubelet.List[virtualkubelet.Lister[*corev1.Secret], *corev1.Secret](\n\t\tnsar.remoteSecrets,\n\t)\n}", "title": "" }, { "docid": "21a52789c7f08cfe5da26f983d1844d2", "score": "0.49175683", "text": "func (authorization OAuth2Authorization) All() ([]*OAuth2Authorization, error) {\n\tif authorization.UserID == 0 {\n\t\terr := errors.New(\"All() for OAuth2Authorization requires UserID set\")\n\t\tlog.WithError(err).Error()\n\t\treturn nil, err\n\t}\n\trows, err := db.Query(\"SELECT client_id, user_id, authorized_at, grants FROM oauth_client_authorization WHERE user_id = $1\", authorization.UserID)\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed to get oauth2 authorizations\")\n\t\treturn nil, err\n\t}\n\n\tauthorizations := make([]*OAuth2Authorization, 0)\n\tfor rows.Next() {\n\t\taut := OAuth2Authorization{}\n\t\tvar grants sql.NullString\n\t\tif err := rows.Scan(&aut.ClientID, &aut.UserID, &aut.AuthorizedAt, &grants); err != nil {\n\t\t\tlog.WithError(err).Error(\"Failed to scan oauth2 authorization row\")\n\t\t\treturn nil, err\n\t\t} else {\n\t\t\tif grants.Valid {\n\t\t\t\taut.Grants = oAuthGrants{}.Parse(grants.String)\n\t\t\t}\n\t\t}\n\t\tauthorizations = append(authorizations, &aut)\n\t}\n\treturn authorizations, nil\n}", "title": "" }, { "docid": "6b821469c007df7204e761ae957654fb", "score": "0.49031305", "text": "func (p *Provider) List() ([]string, error) {\n\treturn p.provider.ListClusters()\n}", "title": "" }, { "docid": "5f908ed99be60dc8c8995cdfba2dbb65", "score": "0.49018982", "text": "func (m *DeploymentsClientMock) List(ctx context.Context, resourceGroupName, filter string, top *int32) (result []resources.DeploymentExtended, err error) {\n\tm.mutex.Lock()\n\tdefer m.mutex.Unlock()\n\n\tresult = make([]resources.DeploymentExtended, 0)\n\tfor i := range m.FakeStore {\n\t\tresult = append(result, m.FakeStore[i])\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "9786416c59c7a665f7fe7f393b3f6f40", "score": "0.48947492", "text": "func CmdList() *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"list\",\n\t\tShort: \"List namespace stores\",\n\t\tRun: RunList,\n\t\tArgs: cobra.NoArgs,\n\t}\n\treturn cmd\n}", "title": "" }, { "docid": "2b916643bcf9d0b5644f9bf3fa078187", "score": "0.48942402", "text": "func (s oAuthClientNamespaceLister) List(selector labels.Selector) (ret []*api.OAuthClient, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*api.OAuthClient))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "5a7f35c71cea40e7d0c82062b5507261", "score": "0.48924506", "text": "func (s appsyncDatasourceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.AppsyncDatasource, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.AppsyncDatasource))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "1eda0ad5a591b18532c40ba186c3ed73", "score": "0.48920786", "text": "func (s *HMACAuthService) ListAll(ctx context.Context) ([]*HMACAuth, error) {\n\tvar hmacAuths, data []*HMACAuth\n\tvar err error\n\topt := &ListOpt{Size: pageSize}\n\n\tfor opt != nil {\n\t\tdata, opt, err = s.List(ctx, opt)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thmacAuths = append(hmacAuths, data...)\n\t}\n\treturn hmacAuths, nil\n}", "title": "" }, { "docid": "e18bb78ed2fcb3257706fad06f643ce9", "score": "0.4882274", "text": "func (g genericPlugin) List(gvk schema.GroupVersionKind, namespace string,\n\tclient plugin.KubernetesConnector) ([]helm.KubernetesResource, error) {\n\n\tvar returnData []helm.KubernetesResource\n\treturn returnData, nil\n}", "title": "" }, { "docid": "41779d9038eb5fd46f4cc7423f3c98be", "score": "0.48816004", "text": "func (m *OrganizationManager) List(opts ...RequestOption) (o *OrganizationList, err error) {\n\terr = m.Request(\"GET\", m.URI(\"organizations\"), &o, applyListDefaults(opts))\n\treturn\n}", "title": "" }, { "docid": "01030d22c6a4541f9b37f6c24b5d3bd1", "score": "0.48744792", "text": "func (a *Client) GetAdmins(params *GetAdminsParams, authInfo runtime.ClientAuthInfoWriter) (*GetAdminsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetAdminsParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"getAdmins\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/api/v1/admin\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetAdminsReader{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\tsuccess, ok := result.(*GetAdminsOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*GetAdminsDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "a4b231a3fdfb7b2361d6b905f5d363c0", "score": "0.48720688", "text": "func (s monitorMetricAlertruleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MonitorMetricAlertrule, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.MonitorMetricAlertrule))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "d80427015e711d4bbd8684982ab9f1ae", "score": "0.48712555", "text": "func (s iamOpenidConnectProviderNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.IamOpenidConnectProvider, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.IamOpenidConnectProvider))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "e2a5089072a1fc6b00fc942edf56ab2e", "score": "0.4871116", "text": "func ListHandler(w http.ResponseWriter, r *http.Request) {\n\t_, _, ok := r.BasicAuth()\n\tif !ok {\n\t\tw.Header().Set(\"WWW-Authenticate\", fmt.Sprintf(`Basic realm=\"%s\"`, BasicAuthRealm))\n\t\tw.WriteHeader(http.StatusUnauthorized)\n\t\tw.Write([]byte(http.StatusText(http.StatusUnauthorized) + \"\\n\"))\n\t\treturn\n\t}\n\tif !reqIsAdmin(r) {\n\t\thttp.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized)\n\t\treturn\n\t}\n\toff := 0\n\tlim := 50\n\tvar of string\n\tvar li string\n\tvar err error\n\tif r.FormValue(\"offset\") != \"\" {\n\t\tof = r.FormValue(\"offset\")\n\t\toff, err = strconv.Atoi(of)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t}\n\tif r.FormValue(\"limit\") != \"\" {\n\t\tli = r.FormValue(\"limit\")\n\t\tlim, err = strconv.Atoi(li)\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t}\n\n\tusrs, err := List(off, lim)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tjd, jerr := json.Marshal(&usrs)\n\tif jerr != nil {\n\t\thttp.Error(w, jerr.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tfmt.Fprintf(w, string(jd))\n}", "title": "" }, { "docid": "0d99fc104147b161776667a5a04efe6e", "score": "0.48666182", "text": "func (s *oIDCProviderConfigLister) List(selector labels.Selector) (ret []*v1alpha1.OIDCProviderConfig, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.OIDCProviderConfig))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "d14e966ae9af837c743f6a6f82fa23e2", "score": "0.48547852", "text": "func listNamespaces() string {\n\treq, _ := http.NewRequest(\"GET\", \"/api/metadata\", nil)\n\treq.AddCookie(testData.TokenCookie)\n\tres := httptest.NewRecorder()\n\ttestServer.ServeHTTP(res, req)\n\treturn res.Body.String()\n}", "title": "" }, { "docid": "93434fbb88e0a3e74c5e8a5b63783f79", "score": "0.4850325", "text": "func List(namespace string, c kubernetes.Interface) ([]appsv1.Deployment, error) {\n\tdList, err := c.AppsV1().Deployments(namespace).List(metav1.ListOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn dList.Items, nil\n}", "title": "" }, { "docid": "d6833efb2010d4ce4ee3237f74e7407c", "score": "0.48483", "text": "func (e *AliasExecutor) List(_ context.Context, cmdCtx CommandContext) (interactive.Message, error) {\n\tcmdVerb, cmdRes := parseCmdVerb(cmdCtx.Args)\n\tdefer e.reportCommand(cmdVerb, cmdRes, cmdCtx.Conversation.CommandOrigin, cmdCtx.Platform)\n\te.log.Debug(\"Listing aliases...\")\n\toutMsg := respond(e.getTabularOutput(cmdCtx.Conversation.ExecutorBindings), cmdCtx)\n\toutMsg.Sections = []interactive.Section{\n\t\t{\n\t\t\tBase: outMsg.Base,\n\t\t\tContext: []interactive.ContextItem{\n\t\t\t\t{Text: aliasesForCurrentBindingsMsg},\n\t\t\t},\n\t\t},\n\t}\n\toutMsg.Base = interactive.Base{}\n\n\treturn outMsg, nil\n}", "title": "" }, { "docid": "65904aabbd3ce967b73501b258080f35", "score": "0.48453698", "text": "func (api *dscprofileAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.DSCProfile, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().DSCProfile().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.DSCProfile\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.DSCProfile)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "45907f2fde3b9d5007e0d4b0a8de39d5", "score": "0.48447847", "text": "func (client UsageDetailsClient) ListByManagementGroupSender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req,\n\t\tautorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))\n}", "title": "" }, { "docid": "f165545fe8692a910fc7d4309e29308f", "score": "0.48438737", "text": "func (s *APIsService) ListAPIs() ([]*API, error) {\n\tvar p []*API\n\terr := s.client.GET(\"/apis\", &p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p, nil\n}", "title": "" }, { "docid": "cb8e4492002d0835ff325e4b10a2f033", "score": "0.48355353", "text": "func (s computeRegionInstanceGroupManagerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ComputeRegionInstanceGroupManager, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ComputeRegionInstanceGroupManager))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "bbdc20dc6635fcd62e79b424e0dc2430", "score": "0.48353407", "text": "func (s apiGatewayModelNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ApiGatewayModel, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1alpha1.ApiGatewayModel))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "fe5ce995890e2b2321c5a8e759b9f9bc", "score": "0.48347342", "text": "func (api *nodeAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*cluster.Node, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ClusterV1().Node().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*cluster.Node\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Node)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "59e086ecc366341ef6b6e7ca7af2345e", "score": "0.48325202", "text": "func (s shareManagerNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ShareManager, err error) {\n\terr = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1beta1.ShareManager))\n\t})\n\treturn ret, err\n}", "title": "" }, { "docid": "5bcbac980446cdf08de421817e94aedd", "score": "0.48318458", "text": "func (api *objectAPI) ApisrvList(ctx context.Context, opts *api.ListWatchOptions) ([]*objstore.Object, error) {\n\tif api.ct.resolver != nil {\n\t\tapicl, err := api.ct.apiClient()\n\t\tif err != nil {\n\t\t\tapi.ct.logger.Errorf(\"Error creating API server clent. Err: %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn apicl.ObjstoreV1().Object().List(context.Background(), opts)\n\t}\n\n\t// List from local cache\n\tctkitObjs, err := api.List(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ret []*objstore.Object\n\tfor _, obj := range ctkitObjs {\n\t\tret = append(ret, &obj.Object)\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "82b7efe229a55fe2c41a90cdc5438b96", "score": "0.4819537", "text": "func (s *arangoDeploymentLister) List(selector labels.Selector) (ret []*v1.ArangoDeployment, err error) {\n\terr = cache.ListAll(s.indexer, selector, func(m interface{}) {\n\t\tret = append(ret, m.(*v1.ArangoDeployment))\n\t})\n\treturn ret, err\n}", "title": "" } ]
aface28949e9f12072361a1a03cfabfb
///////////////////// ///////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// ///////////////////// Accessors for const fields. /////////////////////
[ { "docid": "79f4e3f4e55fa21584edc6c53b2a1d31", "score": "0.0", "text": "func (m *_ExtendedFormatStatusReply) GetCr() byte {\n\treturn ExtendedFormatStatusReply_CR\n}", "title": "" } ]
[ { "docid": "8cc826d122228ff3b357836c78fa8916", "score": "0.591329", "text": "func (c RClass) Const(name string, value interface{}) {\n\tc.mrb.DefineConst(c, name, c.mrb.Value(value))\n}", "title": "" }, { "docid": "f57330d4cabb5ef3bc18df1e3390dc45", "score": "0.58093816", "text": "func (c RClass) ConstGet(name string) Value {\n\treturn c.mrb.ConstGet(c, c.mrb.Intern(name))\n}", "title": "" }, { "docid": "d59c954099a3395e7914340314680a12", "score": "0.56433195", "text": "func main() {\n\n\tconst myConst int = 1\n\t// myConst = 23 // --> compiler boss will show you error\n\tfmt.Printf(\"%v , %T\\n\", myConst, myConst)\n\n\tconst myConst1 float32 = 4.26\n\tfmt.Printf(\"%v , %T\\n\", myConst1, myConst1)\n\n\tfmt.Printf(\"%v , %T\\n\", myConst1+float32(myConst), myConst1+float32(myConst))\n\n\t// counter const\n\tconst (\n\t\ta = iota\n\t\tb = iota\n\t\tc\n\t)\n\n\tconst (\n\t\t_ = iota // the '_' is not kept in memory or ignore.\n\t\ttheHomelessGuy\n\t)\n\tfmt.Printf(\"%v , %T\\n\", a, a)\n\tfmt.Printf(\"%v , %T\\n\", b, b)\n\tfmt.Printf(\"%v , %T\\n\", c, c)\n\tfmt.Printf(\"%v , %T\\n\", theHomelessGuy, theHomelessGuy)\n\n\t// look for bit shift ioat algorithme in one byte checkout 1h42 : https://www.youtube.com/watch?v=YS4e4q9oBaU\n\n}", "title": "" }, { "docid": "f6ac17cc9dcc7d3eefde1f7bf4eefb84", "score": "0.55552506", "text": "func (e Small_MessageCValidationError) Field() string { return e.field }", "title": "" }, { "docid": "1bc0afb28ba2e9ccbb85eddc50cd31e5", "score": "0.55501544", "text": "func Constant(src string) Value {\n\treturn NamedConstant(\"\", \"\", src)\n}", "title": "" }, { "docid": "1bf22c10ce3bdb8bfb9d5cf5163f0b6d", "score": "0.5473762", "text": "func (*ExprExtractValue) isConstExpr() {}", "title": "" }, { "docid": "bff4298b443c41357067dfaf4047e319", "score": "0.5421435", "text": "func (e Medium_MessageCValidationError) Field() string { return e.field }", "title": "" }, { "docid": "8d0fc9a9189bb12f05a9b2d99d60ca3a", "score": "0.5420482", "text": "func (l langType) NamedConst(packageName, objectName string, lit ssa.Const, position string) string {\n\ttyp, rhs := l.Const(lit, position+\":\"+packageName+\".\"+objectName)\n\treturn fmt.Sprintf(\"public static var %s:%s = %s;%s\",\n\t\tl.LangName(packageName, objectName), typ, rhs, l.Comment(position))\n}", "title": "" }, { "docid": "5493886a5c5a9c1939e03f8e954fd7d3", "score": "0.541735", "text": "func Const(v *vdl.Value, pkgPath string, imports codegen.Imports) string { //nolint:gocyclo\n\tswitch v.Kind() {\n\tcase vdl.Bool:\n\t\tif v.Bool() {\n\t\t\treturn \"true\"\n\t\t}\n\t\treturn \"false\"\n\tcase vdl.Byte, vdl.Uint16, vdl.Uint32:\n\t\treturn strconv.FormatUint(v.Uint(), 10)\n\tcase vdl.Int8, vdl.Int16, vdl.Int32:\n\t\treturn strconv.FormatInt(v.Int(), 10)\n\tcase vdl.Uint64:\n\t\t// We use strings to avoid loss of precision for languages that use 64-bit\n\t\t// float for handling numbers.\n\t\treturn fmt.Sprintf(`\"%d\"`, v.Uint())\n\tcase vdl.Int64:\n\t\t// We use strings for the same reasons as for vdl.Uint64.\n\t\treturn fmt.Sprintf(`\"%d\"`, v.Int())\n\tcase vdl.Float32, vdl.Float64:\n\t\treturn strconv.FormatFloat(v.Float(), 'g', -1, bitlen(v.Kind()))\n\tcase vdl.String:\n\t\treturn strconv.Quote(v.RawString())\n\tcase vdl.Any:\n\t\tif elem := v.Elem(); elem != nil {\n\t\t\treturn Const(elem, pkgPath, imports)\n\t\t}\n\t\treturn \"null\"\n\tcase vdl.Optional:\n\t\tif elem := v.Elem(); elem != nil {\n\t\t\treturn Const(elem, pkgPath, imports)\n\t\t}\n\t\treturn \"null\"\n\tcase vdl.Enum:\n\t\treturn strconv.Quote(v.EnumLabel())\n\tcase vdl.Array, vdl.List:\n\t\tresult := \"[\"\n\t\tfor ix := 0; ix < v.Len(); ix++ {\n\t\t\tif ix > 0 {\n\t\t\t\tresult += \",\"\n\t\t\t}\n\t\t\tval := Const(v.Index(ix), pkgPath, imports)\n\t\t\tresult += val\n\t\t}\n\t\tresult += \"]\"\n\t\treturn result\n\tcase vdl.Set:\n\t\tresult := \"[\"\n\t\tfor ix, key := range vdl.SortValuesAsString(v.Keys()) {\n\t\t\tif ix > 0 {\n\t\t\t\tresult += \",\"\n\t\t\t}\n\t\t\tresult += Const(key, pkgPath, imports)\n\t\t}\n\t\tresult += \"]\"\n\t\treturn result\n\tcase vdl.Map:\n\t\tresult := \"{\"\n\t\tfor i, key := range vdl.SortValuesAsString(v.Keys()) {\n\t\t\tif i > 0 {\n\t\t\t\tresult += \",\"\n\t\t\t}\n\t\t\t// TODO(razvanm): figure out what to do if the key is not a scalar type.\n\t\t\tresult += fmt.Sprintf(`%s: %s`, quote(Const(key, pkgPath, imports)), Const(v.MapIndex(key), pkgPath, imports))\n\t\t}\n\t\tresult += \"}\"\n\t\treturn result\n\tcase vdl.Struct:\n\t\tresult := \"{\"\n\t\tt := v.Type()\n\t\tfor ix := 0; ix < t.NumField(); ix++ {\n\t\t\tif ix > 0 {\n\t\t\t\tresult += \",\"\n\t\t\t}\n\t\t\tresult += fmt.Sprintf(`\"%s\": %s`, vdlutil.FirstRuneToLower(t.Field(ix).Name), Const(v.StructField(ix), pkgPath, imports))\n\t\t}\n\t\treturn result + \"}\"\n\tcase vdl.Union:\n\t\tix, innerVal := v.UnionField()\n\t\treturn fmt.Sprintf(\"{ %q: %v }\", vdlutil.FirstRuneToLower(v.Type().Field(ix).Name), Const(innerVal, pkgPath, imports))\n\tcase vdl.TypeObject:\n\t\t// TODO(razvanm): check it this is correct.\n\t\treturn vdlgen.Type(v.TypeObject(), pkgPath, imports)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"vdl: Const unhandled type %v %v\", v.Kind(), v.Type()))\n\t}\n}", "title": "" }, { "docid": "7d837cf1d9b65cb4cb259ed130393883", "score": "0.5312837", "text": "func (mrb *MrbState) ConstGet(v MrbValue, id MrbSym) Value {\n\treturn Value{C.mrb_const_get(mrb.p, v.Value().v, C.mrb_sym(id))}\n}", "title": "" }, { "docid": "c3ce3ff2852c9d4875194984a1a3cba3", "score": "0.5310376", "text": "func (c RClass) ConstGetID(id MrbSym) Value {\n\treturn c.mrb.ConstGet(c, id)\n}", "title": "" }, { "docid": "981724f2117f6738f72b7255650ce7b8", "score": "0.5289526", "text": "func (a *Authorizor) GetConstValueByKey(constKey string) (int, bool) {\n\thandler := a.getLicenseHandler()\n\t//fetch const value from local lic file first\n\t//nolint\n\tif value := handler.GetLimit(constKey); value != nil {\n\t\tlog.Infof(\"license: get const value [%s] without const prefix from local lic file success\", constKey)\n\t\treturn convertNumber(value)\n\t}\n\t//nolint\n\tif value := handler.GetLimit(\"const_\" + constKey); value != nil {\n\t\tlog.Infof(\"license: get const value [const_%s] with const prefix from local lic file success\", constKey)\n\t\treturn convertNumber(value)\n\t}\n\n\t//if constKey is fetched before,then return\n\tcvp := a.getCurrentConstPair()\n\tif value, ok := cvp[constKey]; ok && value != nil {\n\t\treturn convertNumber(value)\n\t}\n\treturn 0, false\n}", "title": "" }, { "docid": "9a12dfba0f6691f858edd0540c0f237b", "score": "0.52408737", "text": "func (a *Authorizor) GetConstStringByKey(constKey string) (string, bool) {\n\thandler := a.getLicenseHandler()\n\t//fetch const value from local lic file first\n\t//nolint\n\tif value := handler.GetLimit(constKey); value != nil {\n\t\treturn convertString(value)\n\t}\n\t//nolint\n\tif value := handler.GetLimit(\"const_\" + constKey); value != nil {\n\t\treturn convertString(value)\n\t}\n\t//if constKey is fetched before,then return\n\tcvp := a.getCurrentConstPair()\n\tif value, ok := cvp[constKey]; ok && value != nil {\n\t\treturn convertString(value)\n\t}\n\treturn \"\", false\n}", "title": "" }, { "docid": "b0fe53f09060d304584a50f3c6a68115", "score": "0.52193046", "text": "func constant(ctx phpv.Context, args []*phpv.ZVal) (*phpv.ZVal, error) {\n\tvar name phpv.ZString\n\t_, err := core.Expand(ctx, args, &name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tk, ok := ctx.Global().ConstantGet(name)\n\tif !ok {\n\t\t// TODO trigger notice: constant not found\n\t\treturn phpv.ZNULL.ZVal(), nil\n\t}\n\treturn k.ZVal(), nil\n}", "title": "" }, { "docid": "33e7c8d978e2d72b3249e129170f2994", "score": "0.5198539", "text": "func swiftConstVal(v *vdl.Value, ctx *swiftContext) (ret string) {\n\tret = swiftVal(v, ctx)\n\tif tdef := ctx.env.FindTypeDef(v.Type()); tdef != nil && tdef.File != compile.BuiltInFile { // User-defined type.\n\t\tswitch tdef.Type.Kind() {\n\t\tcase vdl.Union:\n\t\t\tret = fmt.Sprintf(\"%s.%s\", ctx.swiftType(v.Type()), ret)\n\t\tcase vdl.Struct:\n\t\t\tret = fmt.Sprintf(\"%s(%s)\", ctx.swiftType(v.Type()), ret)\n\t\tcase vdl.Enum:\n\t\t\treturn\n\t\tdefault:\n\t\t\tret = fmt.Sprintf(\"%s(rawValue: %s)\", ctx.swiftType(v.Type()), ret)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "548c6b01ce66ebbe8a3385cde0ce3a44", "score": "0.51977575", "text": "func (e Small_MessageDValidationError) Field() string { return e.field }", "title": "" }, { "docid": "dfda77f325f5e44b22b4896c41898f6b", "score": "0.51951104", "text": "func main() {\n var a int = 8\n const b int = 10\n\n fmt.Println(a + b)\n}", "title": "" }, { "docid": "1e30635112341c4c8980de2eb4285f03", "score": "0.5171017", "text": "func constValueString(cnst *ssa.Const) string {\n\tif cnst.Value == nil {\n\t\treturn \"nil\"\n\t}\n\treturn cnst.Value.String()\n}", "title": "" }, { "docid": "d03af13c94d321a37c8cdfdd4649ef8a", "score": "0.515158", "text": "func (p *prom) constBasic(value prometheus.ValueType, name, help string, labelNames []string) {\n\tswitch value {\n\tcase prometheus.CounterValue, prometheus.GaugeValue:\n\tdefault:\n\t\tpanicf(\"metricslite: invalid prom.constBasic metric type: %T\", value)\n\t}\n\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\n\tp.consts[name] = &promConst{\n\t\tdesc: prometheus.NewDesc(name, help, labelNames, nil),\n\t\tvalue: value,\n\t}\n}", "title": "" }, { "docid": "42f7053b8cbfa2e4bdf3604e755773d0", "score": "0.5138337", "text": "func (e RicStyleNameValidationError) Field() string { return e.field }", "title": "" }, { "docid": "1a6cc9d1c324afb91b697039af02df7d", "score": "0.5131262", "text": "func (e ClientConfigValidationError) Field() string { return e.field }", "title": "" }, { "docid": "82356558d62eddce5fde171a0106edce", "score": "0.5102243", "text": "func (fs *EventFormatString) IsConst() bool {\n\treturn fs.formatter.IsConst()\n}", "title": "" }, { "docid": "26a93733a6cc1f569ea5bbda3d4c897c", "score": "0.50893176", "text": "func (e Cluster_RefreshRateValidationError) Field() string { return e.field }", "title": "" }, { "docid": "d0c081b06743a8e35e55020282543a07", "score": "0.50884813", "text": "func (*ExprExtractValue) isConstant() {}", "title": "" }, { "docid": "f4a5c25a8d582a7b30d9c67a22715b7f", "score": "0.5084346", "text": "func RecordUsedAsConstants(node ast.Node, info *types.Info, ignoreObj map[types.Object]bool) {\n\tvisit := func(node ast.Node) bool {\n\t\tident, ok := node.(*ast.Ident)\n\t\tif !ok {\n\t\t\treturn true\n\t\t}\n\n\t\t// Only record *types.Const objects.\n\t\t// Other objects, such as builtins or type names,\n\t\t// must not be recorded as they would be false positives.\n\t\tobj := info.ObjectOf(ident)\n\t\tif _, ok := obj.(*types.Const); ok {\n\t\t\tignoreObj[obj] = true\n\t\t}\n\n\t\treturn true\n\t}\n\n\tswitch x := node.(type) {\n\t// in a slice or array composite literal all explicit keys must be constant representable\n\tcase *ast.CompositeLit:\n\t\tif _, ok := x.Type.(*ast.ArrayType); !ok {\n\t\t\tbreak\n\t\t}\n\t\tfor _, elt := range x.Elts {\n\t\t\tif kv, ok := elt.(*ast.KeyValueExpr); ok {\n\t\t\t\tast.Inspect(kv.Key, visit)\n\t\t\t}\n\t\t}\n\t// in an array type the length must be a constant representable\n\tcase *ast.ArrayType:\n\t\tif x.Len != nil {\n\t\t\tast.Inspect(x.Len, visit)\n\t\t}\n\t// in a const declaration all values must be constant representable\n\tcase *ast.GenDecl:\n\t\tif x.Tok != token.CONST {\n\t\t\tbreak\n\t\t}\n\t\tfor _, spec := range x.Specs {\n\t\t\tspec := spec.(*ast.ValueSpec)\n\n\t\t\tfor _, val := range spec.Values {\n\t\t\t\tast.Inspect(val, visit)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9d31b1cb9f0175b20b6994c404f13bbc", "score": "0.5079464", "text": "func (e ClientStatusRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "5b14d3c2fc92525b243c66d20f1d3b3a", "score": "0.5062699", "text": "func (e GetProjectReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "c9261e2aa4662387c0bfa382d0db0125", "score": "0.5061146", "text": "func (cs *CS) constVar(i1 interface{}) *Constraint {\n\t// parse input\n\tconstant := elementFromInterface(i1)\n\n\t// if constant == 1, we return the ONE_WIRE\n\tone := curve.One()\n\tif constant.Equal(&one) {\n\t\treturn cs.Constraints[0]\n\t}\n\n\treturn newConstraint(cs, &eqConstantExpression{v: constant})\n}", "title": "" }, { "docid": "761b94261ee59942e8433ce31ae6feef", "score": "0.50457895", "text": "func LabelField(payloadCID cid.Cid) (string, error) {\n\tif payloadCID.Version() == 0 {\n\t\treturn payloadCID.StringOfBase(multibase.Base58BTC)\n\t}\n\treturn payloadCID.StringOfBase(multibase.Base64)\n}", "title": "" }, { "docid": "032774065ee4d834415195c5876f77a1", "score": "0.50429577", "text": "func (e ProjectUpdateCancelReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "c3bf35db09939e0c8d7122e59cc1a35a", "score": "0.5004498", "text": "func (e ADRSettings_StaticModeValidationError) Field() string { return e.field }", "title": "" }, { "docid": "c07df98cebf7cf9816bfd435cb660dc5", "score": "0.5003217", "text": "func (e Medium_MessageDValidationError) Field() string { return e.field }", "title": "" }, { "docid": "17870afebcf70c6e9cac96acc519a27b", "score": "0.4993286", "text": "func (df Dirfile) Constants(out interface{}) error {\n\tdType, ptr, arrayLen := array2type(out)\n\tn := df.NFieldsByType(CONSTENTRY)\n\tif arrayLen < int(n) {\n\t\treturn fmt.Errorf(\"Constants was supplied an array of length %d, but needs to be at least %d\",\n\t\t\tarrayLen, n)\n\t}\n\tresult := C.gd_constants(df.d, C.gd_type_t(dType))\n\tif result == C.NULL {\n\t\treturn fmt.Errorf(\"gd_constants returns error\")\n\t}\n\tC.memcpy(ptr, result, C.ulong(n*sizeof(dType)))\n\treturn nil\n}", "title": "" }, { "docid": "f80df91e6a0f390a9a62e0aaa82a68dc", "score": "0.49857557", "text": "func MakeConst(c interface{}) Const {\n\tconstant := new(constant)\n\tswitch c.(type) {\n\tcase Const:\n\t\treturn c.(Const)\n\tcase m.Matrix:\n\t\tconstant.constType = Matrix\n\tcase v.Vector:\n\t\tconstant.constType = Vector\n\tcase gcv.Value:\n\t\tconstant.constType = Value\n\tcase int, int32, int64, float32, float64, complex64, complex128:\n\t\tc = gcv.MakeValue(c)\n\t\tconstant.constType = Value\n\tdefault:\n\t\tc = gcv.Zero()\n\t\tconstant.constType = Value\n\t}\n\tconstant.constant = c\n\treturn constant\n}", "title": "" }, { "docid": "7541477c7aef6d784f9293fbbdad3375", "score": "0.49741024", "text": "func (e GetCourseRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "3ba6f26d41c888cea87907b3d419d3a6", "score": "0.49740434", "text": "func (e Cluster_CommonLbConfigValidationError) Field() string { return e.field }", "title": "" }, { "docid": "329e76b56635c13eea6891456cb807de", "score": "0.49732792", "text": "func (e Small_MessageBValidationError) Field() string { return e.field }", "title": "" }, { "docid": "0be6ed7762d0cf17fb1bd5db33930405", "score": "0.4963134", "text": "func (e FloatRangeConstValidationError) Field() string { return e.field }", "title": "" }, { "docid": "29fc38b1d2736a3a5263fe50542e0909", "score": "0.4961386", "text": "func (vm *VM) readConstant() Value {\n\tindex := vm.readByte()\n\treturn vm.chunk.constants[index]\n}", "title": "" }, { "docid": "2f8e213d591f6ee241a7a30344023493", "score": "0.49546012", "text": "func CreateConstMsg(constants map[string]string) (string){\n var msg string = \"\"\n // Format for the message is input_name const_len const input_name2 const_len2 const2\n for input_name, constant := range constants {\n msg += input_name + \" \" + strconv.FormatInt(int64(len(constant)), 10) + \" \" + constant + \" \"\n }\n return msg\n}", "title": "" }, { "docid": "4d1411f4ce3de07e53fde66af4e5692b", "score": "0.4944069", "text": "func (e GetCommentRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "e6d82c1d6cf00c0f42fa8227a200d9d9", "score": "0.49427715", "text": "func (e Small_MessageFValidationError) Field() string { return e.field }", "title": "" }, { "docid": "66980d7ceb1030a25bfd416ef48bc03e", "score": "0.49382585", "text": "func (e ProjectUpdateCancelRespValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f3aaa8f3b1e0745be78bb5e8e368f324", "score": "0.49350762", "text": "func (e ProjectUpdateStatusReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "edf47f2c8200dd40c7289611ef761125", "score": "0.49342173", "text": "func (e QualityOfServiceValidationError) Field() string { return e.field }", "title": "" }, { "docid": "9da50c9513306f06d372892ef347c2b9", "score": "0.49200907", "text": "func (s *BaseCapnProtoListener) EnterConst_value(ctx *Const_valueContext) {}", "title": "" }, { "docid": "9b74826de9f30bb3647b8c54b043eaf9", "score": "0.49113694", "text": "func (client EnumClient) GetReferencedConstant() (result RefColorConstant, err error) {\n req, err := client.GetReferencedConstantPreparer()\n if err != nil {\n return result, autorest.NewErrorWithError(err, \"stringgroup.EnumClient\", \"GetReferencedConstant\", nil , \"Failure preparing request\")\n }\n\n resp, err := client.GetReferencedConstantSender(req)\n if err != nil {\n result.Response = autorest.Response{Response: resp}\n return result, autorest.NewErrorWithError(err, \"stringgroup.EnumClient\", \"GetReferencedConstant\", resp, \"Failure sending request\")\n }\n\n result, err = client.GetReferencedConstantResponder(resp)\n if err != nil {\n err = autorest.NewErrorWithError(err, \"stringgroup.EnumClient\", \"GetReferencedConstant\", resp, \"Failure responding to request\")\n }\n\n return\n}", "title": "" }, { "docid": "38c2a9a350f927feb5da78a8748cdcfe", "score": "0.4905415", "text": "func (e GetProjectRespValidationError) Field() string { return e.field }", "title": "" }, { "docid": "7a62f566356601ead9cc8e86be90e606", "score": "0.4900313", "text": "func (prog *Program) ConstValue(obj *types.Const) *Const {\n\t// TODO(adonovan): opt: share (don't reallocate)\n\t// Consts for const objects and constant ast.Exprs.\n\n\t// Universal constant? {true,false,nil}\n\tif obj.Parent() == types.Universe {\n\t\treturn NewConst(obj.Val(), obj.Type())\n\t}\n\t// Package-level named constant?\n\tif v := prog.packageLevelMember(obj); v != nil {\n\t\treturn v.(*NamedConst).Value\n\t}\n\treturn NewConst(obj.Val(), obj.Type())\n}", "title": "" }, { "docid": "35f05278e45da57a1ac26a958f559c24", "score": "0.48992702", "text": "func initStaticFinalVar(class *Class, field *Field) {\n\tvars := class.StaticVars() // 获取static变量\n\tcp := class.constantPool // 获取常量池\n\tcpIndex := field.ConstantValueIndex()\n\tslotId := field.slotId\n\n\tif cpIndex > 0 { // private static final int x=1;\n\t\tswitch field.descriptor { // https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html\n\t\tcase \"Z\", \"B\", \"C\", \"S\", \"I\": // boolean byte char short integer\n\t\t\tval := cp.GetConstant(cpIndex).(int32)\n\t\t\tvars.SetInt(slotId, val) // 设置静态变量初始值\n\t\tcase \"J\": // long\n\t\t\tval := cp.GetConstant(cpIndex).(int64)\n\t\t\tvars.SetLong(slotId, val)\n\t\tcase \"F\": // float\n\t\t\tval := cp.GetConstant(cpIndex).(float32)\n\t\t\tvars.SetFloat(slotId, val)\n\t\tcase \"D\": // double\n\t\t\tval := cp.GetConstant(cpIndex).(float64)\n\t\t\tvars.SetDouble(slotId, val)\n\t\tcase \"Ljava/lang/String;\":\n\t\t\tpanic(\"todo\") // todo\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4c813ee5bfc3d6256f004eb8463284fc", "score": "0.48942968", "text": "func (e UpdateProjectReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "0cb456d0129e724e8de9dd4f738ccae2", "score": "0.4890096", "text": "func (e Cluster_EdsClusterConfigValidationError) Field() string { return e.field }", "title": "" }, { "docid": "1f1fe2c7bd890608c70950eb5f663b15", "score": "0.4887589", "text": "func (df Dirfile) GetConstant(fieldcode string, inptr interface{}) error {\n\ttypecode, uptr := pointer2type(inptr)\n\tif typecode == UNKNOWN {\n\t\treturn fmt.Errorf(\"GetConstant called with ptr not a pointer to string or numeric type\")\n\t}\n\n\tfcode := C.CString(fieldcode)\n\tdefer C.free(unsafe.Pointer(fcode))\n\terrcode := C.gd_get_constant(df.d, fcode, C.gd_type_t(typecode), uptr)\n\tif errcode != C.GD_E_OK {\n\t\treturn df.Error()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d2c21ed512ebb1d8ea98d6e3160ec4fb", "score": "0.4884616", "text": "func (e ProjectValidationError) Field() string { return e.field }", "title": "" }, { "docid": "b6d93d6589a01792cf9e4ea47696166a", "score": "0.4874464", "text": "func Const[T any](value T) Value[T] {\n\treturn &constant[T]{value}\n}", "title": "" }, { "docid": "a96e97820facca041c68327ce9d012ad", "score": "0.48723483", "text": "func (e CreateProjectReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "352a6f3dbda7f728e0d022d0798cee81", "score": "0.4871983", "text": "func (e GetCourseResponseValidationError) Field() string { return e.field }", "title": "" }, { "docid": "e7cd13a7ae76f8603ff4556e55900527", "score": "0.48718792", "text": "func (e MetricUCSValidationError) Field() string { return e.field }", "title": "" }, { "docid": "805a8a416382764adcb32364d4c5c026", "score": "0.486547", "text": "func (e TcpProxy_WeightedClusterValidationError) Field() string { return e.field }", "title": "" }, { "docid": "40c0285017498da28f0c001b760cca74", "score": "0.4863335", "text": "func (e CustomerCreditTransferInitiationRsValidationError) Field() string { return e.field }", "title": "" }, { "docid": "9b18c5851fc59a75921095c279398279", "score": "0.48632047", "text": "func (e ProductLicensesForMetricRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "569108e473c88f6bc01189625cf50ac7", "score": "0.486199", "text": "func (e RicControlMessagePriorityValidationError) Field() string { return e.field }", "title": "" }, { "docid": "912579835336407759470ea06baf72e2", "score": "0.48607188", "text": "func (e UpdateCourseRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "bfb1051137e0c37a67db989b3c5fe601", "score": "0.48589343", "text": "func (e ReadEntityResValidationError) Field() string { return e.field }", "title": "" }, { "docid": "4c9ff12f46c6507400009fca0be15ecc", "score": "0.4858823", "text": "func (e Cluster_CustomClusterTypeValidationError) Field() string { return e.field }", "title": "" }, { "docid": "db20d928c77d1d2f0971ec45df8ef2b8", "score": "0.48567328", "text": "func (e GetProjectRulesReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "3c0f3927cf7fa5493230fee08e86f515", "score": "0.48537093", "text": "func (e ReadEntityReqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "7e51ee5fb03049553d7711ee368414af", "score": "0.48518744", "text": "func (e UpdateCommentRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "8fd85861c795149e2b7521d1a0c4e400", "score": "0.48517048", "text": "func (e Small_MessageEValidationError) Field() string { return e.field }", "title": "" }, { "docid": "8d25709da5657ae736dae92080030a55", "score": "0.48498175", "text": "func FieldStr(key FieldKey, term []byte) string {\n\tf := Field{Key: key, Term: term}\n\treturn string(f.Marshal())\n}", "title": "" }, { "docid": "514d7ec33cf90eb0f226ac1a769a5007", "score": "0.48481515", "text": "func (e *Enum) Get() Const {\n\treturn e.val\n}", "title": "" }, { "docid": "3a8a2d15d925ca9a1d163319c453fc41", "score": "0.48452273", "text": "func (e RicStyleTypeValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6460126789ae9c8a2132dce61c12b9f3", "score": "0.4837309", "text": "func (e CreateCommentRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "74aa922dfc4c7fb12538c5340a706f00", "score": "0.48315373", "text": "func (df Dirfile) GetConstantFloat32(fieldcode string) (float32, error) {\n\tvar c float32\n\treturn c, df.GetConstant(fieldcode, &c)\n}", "title": "" }, { "docid": "40e7ce257afac0d57cac1026bbf5e115", "score": "0.48308533", "text": "func (mrb *MrbState) ModConstants(mod MrbValue) RArray {\n\treturn ary(C.mrb_mod_constants(mrb.p, mod.Value().v), mrb)\n}", "title": "" }, { "docid": "9daa28b5d6389a469db4a0f18ae0aed4", "score": "0.48276296", "text": "func (e GetJobRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "078d03f3b487340722f6d12efca0a7c0", "score": "0.4826992", "text": "func (*FieldValue) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_analysis_internal_bugs_monorail_api_proto_issue_objects_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "23675c9e439b9cfdd2fa471da76e2a05", "score": "0.48269206", "text": "func (e E2SmNiControlHeaderValidationError) Field() string { return e.field }", "title": "" }, { "docid": "8df3c67bfa4cf419b61e674052af41d3", "score": "0.48221245", "text": "func (e SmallValidationError) Field() string { return e.field }", "title": "" }, { "docid": "99ca886ee9156cd27f0e68b488509965", "score": "0.48216298", "text": "func (e NiProtocolIeValueValidationError) Field() string { return e.field }", "title": "" }, { "docid": "3e0b15595e7d36f005fcdd1c6353d08b", "score": "0.48183882", "text": "func (f *LiteralField) Description() string {\n\treturn f.description\n}", "title": "" }, { "docid": "b0fb76e340fbae31e222d560becaaf09", "score": "0.4816598", "text": "func (f *LiteralField) Ref() string {\n\treturn f.ref\n}", "title": "" }, { "docid": "ff3d077264ee0f4717815a90e68f03a1", "score": "0.48142925", "text": "func (e CommentValidationError) Field() string { return e.field }", "title": "" }, { "docid": "e8979b1174d55bae0dee5dcfa9e3ca5b", "score": "0.48088598", "text": "func (e BufferFactoryConfigValidationError) Field() string { return e.field }", "title": "" }, { "docid": "2d9b76e8173b272eef5778cac244215e", "score": "0.4807416", "text": "func (e SportsObjects_GetRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f523253e5cab2cd67227a46404711806", "score": "0.4802651", "text": "func (e AccessLogEntryValidationError) Field() string { return e.field }", "title": "" }, { "docid": "7e6833832f238468b36c27dd35e1173f", "score": "0.47977304", "text": "func (e WatchRequest_SRVRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "90ee6442cd781e5941c986aaee614dea", "score": "0.47903356", "text": "func (e ProjectUpdateStatusRespValidationError) Field() string { return e.field }", "title": "" }, { "docid": "934fb4ab7bf5b1954c836ffbfec77ce2", "score": "0.47867098", "text": "func (e MACState_DownlinkMessage_MessageValidationError) Field() string { return e.field }", "title": "" }, { "docid": "a43baf007b4aaaa5b45aa6b8a9247585", "score": "0.4782396", "text": "func (e TcpProxy_WeightedCluster_ClusterWeightValidationError) Field() string { return e.field }", "title": "" }, { "docid": "827b38f33f538ce14b453875e6adab71", "score": "0.47820187", "text": "func (e UpdateJobRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "5fb1692f591de94e8ca6530dcf6898c5", "score": "0.47810018", "text": "func (e Medium_MessageFValidationError) Field() string { return e.field }", "title": "" }, { "docid": "b5f3efd8e8277e198940b38b6fbb9096", "score": "0.47783002", "text": "func (e UpdateProjectRespValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6dbc4a0c3f2279c06953c705bfbf72a8", "score": "0.47777855", "text": "func (e UniqueOrgRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "53d4305a1b940d4b4676630d9ac72ca4", "score": "0.47770494", "text": "func (e CustomerCreditTransferInitiationRqValidationError) Field() string { return e.field }", "title": "" }, { "docid": "f0e417934e15185822dc74dd4951845f", "score": "0.47764865", "text": "func (e Medium_MessageBValidationError) Field() string { return e.field }", "title": "" }, { "docid": "915d1e00e694a14596bd1ec30c979213", "score": "0.4775105", "text": "func (e CreateCourseRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "2f4d1545796c8b14d2989b75d4beeaea", "score": "0.47740188", "text": "func (e GlobalEnGnbIdValidationError) Field() string { return e.field }", "title": "" }, { "docid": "27de20814b4688b3003dd5fe60ef11d6", "score": "0.476854", "text": "func (e ReadConfigRequestValidationError) Field() string { return e.field }", "title": "" }, { "docid": "6e5c9ca57a35c868ae33b424112d3d61", "score": "0.476802", "text": "func Btf__add_const(btf *Struct_btf, ref_type_id int32) int32 {\n\treturn C.btf__add_const()\n}", "title": "" }, { "docid": "6e2b526aaa6fe8baf676984032bd680f", "score": "0.47670722", "text": "func (e ProductLicensesForMetricResponseValidationError) Field() string { return e.field }", "title": "" } ]
beb5af65f3114851f2b9c0d62c5a88a8
CRDForGVK returns the CRD for the given GKV or an error if there is no CRD available (i.e. any GVK outside of .k8c.io was provided).
[ { "docid": "643d2356c5d12307a88b286232225a86", "score": "0.7927443", "text": "func CRDForGVK(gvk schema.GroupVersionKind) (*apiextensionsv1.CustomResourceDefinition, error) {\n\t// as filenames are being generated by controller-gen, use the same pluralization mechanism\n\t// https://github.com/kubernetes-sigs/controller-tools/blob/8cb5ce83c3cca425a4de0af3d2578e31a3cd6a48/pkg/crd/spec.go#L58\n\tkindPlural := strings.ToLower(flect.Pluralize(gvk.Kind))\n\tfilename := gvk.Group + \"_\" + kindPlural + \".yaml\"\n\n\tdir, err := getDirForGroup(gvk.Group)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"no CRD available \\\"%s_%s\\\": %w\", gvk.Group, kindPlural, err)\n\t}\n\n\tcrd, err := loadCRD(dir, filename)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, fmt.Errorf(\"no CRD available for \\\"%s_%s\\\"\", gvk.Group, kindPlural)\n\t\t}\n\n\t\treturn nil, err\n\t}\n\n\treturn crd, nil\n}", "title": "" } ]
[ { "docid": "d13a727099f1c1d57705eb0235396f37", "score": "0.6509111", "text": "func (runner *KubeCommandRunner) GetGVRFromCRD(crd *unstructured.Unstructured) (*schema.GroupVersionResource, error) {\n\t// The name of a CRD is of the form 'resource.group', so that gives us 2/3 of the GVR.\n\tname := crd.GetName()\n\tgroupResource := schema.ParseGroupResource(name)\n\n\t// For the version, use the 'storage' version. See:\n\t// https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#writing-reading-and-updating-versioned-customresourcedefinition-objects\n\tversionList, found, err := unstructured.NestedSlice(crd.Object, \"spec\", \"versions\")\n\tif !found || err != nil {\n\t\treturn nil, errors.New(\"spec.versions not found\")\n\t}\n\tversion := \"\"\n\tfor _, versionItem := range versionList {\n\t\tversionObj := versionItem.(map[string]interface{})\n\t\tisStorageVersion, found, err := unstructured.NestedBool(versionObj, \"storage\")\n\t\tif !found || err != nil {\n\t\t\treturn nil, errors.New(\"spec.versions[].storage not found\")\n\t\t}\n\n\t\tif isStorageVersion {\n\t\t\tversion, found, err = unstructured.NestedString(versionObj, \"name\")\n\t\t\tif !found || err != nil {\n\t\t\t\treturn nil, errors.New(\"spec.versions[].name not found\")\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tif version == \"\" {\n\t\treturn nil, errors.New(\"no storage version found\")\n\t}\n\n\tgvr := groupResource.WithVersion(version)\n\treturn &gvr, nil\n}", "title": "" }, { "docid": "f5fe06e0035d4b286d10eb9be39a53e9", "score": "0.6499037", "text": "func (runner *KubeCommandRunner) GetGVRForCRD(crdName string) (*schema.GroupVersionResource, error) {\n\tfor _, gvr := range crdGvrs {\n\t\tcrd, err := runner.GetUnstructuredItem(&gvr, \"\", crdName)\n\t\tif err != nil {\n\t\t\tif k8sErrors.IsNotFound(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\treturn runner.GetGVRFromCRD(crd)\n\t}\n\treturn nil, fmt.Errorf(\"crd %s not found\", crdName)\n}", "title": "" }, { "docid": "d183f3887b26a1c3a73ae49a7e68c978", "score": "0.62410825", "text": "func (p *Planner) searchCRD(gvk schema.GroupVersionKind) (*unstructured.Unstructured, error) {\n\t// gvr is the plural guessed resource for the given GVK\n\tgvr, _ := meta.UnsafeGuessKindToResource(gvk)\n\t// crdName is the string'fied GroupResource, e.g. \"deployments.apps\"\n\tcrdName := gvr.GroupResource().String()\n\t// delegate the search to the CustomResourceDefinition resource client\n\treturn p.client.Resource(CRDGVR).Get(crdName, metav1.GetOptions{})\n}", "title": "" }, { "docid": "c44edfd2e2e6382863c2f4d06efdffe8", "score": "0.59098995", "text": "func GetCRN(ctx context.Context, resourceID string) (string, error) {\n\tvar org, space string\n\tif ctx.Value(ContextKey(constants.BluemixOrgHeader)) != nil {\n\t\torg = ctx.Value(ContextKey(constants.BluemixOrgHeader)).(string)\n\t}\n\n\tif ctx.Value(ContextKey(constants.BluemixSpaceHeader)) != nil {\n\t\tspace = ctx.Value(ContextKey(constants.BluemixSpaceHeader)).(string)\n\t}\n\n\tcrnTemplate := crngo.Template{\n\t\tCloudName: getCloudName(hostname),\n\t\tCloudType: crngo.PublicCloudType,\n\t\tServiceName: \"kms\",\n\t\tRegion: getRegion(hostname),\n\t\tScope: crngo.BuildScope(crngo.SpaceScopePrefix, space),\n\t\tServiceInstance: getServiceInstance(org, space),\n\t\tResourceType: \"key\",\n\t\tResourceID: resourceID,\n\t}\n\n\tcrnObject, err := crngo.NewCRN(&crnTemplate)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn crnObject.GetRepresentation(), nil\n}", "title": "" }, { "docid": "3954be6667f930ec9a7ca7cbed4f96e1", "score": "0.57145643", "text": "func (GlooInstance) GVK() schema.GroupVersionKind {\n\treturn GlooInstanceGVK\n}", "title": "" }, { "docid": "1644019bd50dd60465624a744b1fe585", "score": "0.5500551", "text": "func (r *Resource) GVKN() types.GroupVersionKindName {\n\tvar emptyZVKN types.GroupVersionKindName\n\tif r.Data == nil {\n\t\treturn emptyZVKN\n\t}\n\tgvk := r.Data.GroupVersionKind()\n\treturn types.GroupVersionKindName{GVK: gvk, Name: r.Data.GetName()}\n}", "title": "" }, { "docid": "3cd2a3e488c7c3a41275458e24d2ec5b", "score": "0.5430695", "text": "func (svr *Server) KvGC(ctx context.Context, req *kvrpcpb.GCRequest) (*kvrpcpb.GCResponse, error) {\n\treqCtx, err := newRequestCtx(svr, req.Context, \"KvGC\")\n\tif err != nil {\n\t\treturn &kvrpcpb.GCResponse{Error: convertToKeyError(err)}, nil\n\t}\n\tdefer reqCtx.finish()\n\tsvr.mvccStore.UpdateSafePoint(req.SafePoint)\n\treturn &kvrpcpb.GCResponse{}, nil\n}", "title": "" }, { "docid": "f20b0e90379cfdb15c01b947c719c432", "score": "0.53778845", "text": "func Gvk2Gvr(gvk schema.GroupVersionKind) schema.GroupVersionResource {\n\treturn schema.GroupVersionResource{\n\t\tGroup: gvk.Group,\n\t\tVersion: gvk.Version,\n\t\tResource: strings.ToLower(gvk.Kind) + \"s\", // TODO need to find the proper way to fetch the resource (e.g. \"configmaps\", not \"ConfigMap\").\n\t}\n}", "title": "" }, { "docid": "a5e6eb118883df6d61fa13fe4358a62c", "score": "0.5362111", "text": "func CRDGVR() schema.GroupVersionResource {\n\treturn schema.GroupVersionResource{\n\t\tGroup: \"apiextensions.k8s.io\",\n\t\tVersion: \"v1beta1\",\n\t\tResource: \"customresourcedefinitions\",\n\t}\n}", "title": "" }, { "docid": "1cf0acfd2bcfe171ea5e04d288dc4e8a", "score": "0.53060097", "text": "func GetGVK() schema.GroupVersionKind {\n\treturn schema.GroupVersionKind{\n\t\tGroup: \"airshipit.org\",\n\t\tVersion: \"v1alpha1\",\n\t\tKind: \"Templater\",\n\t}\n}", "title": "" }, { "docid": "1cf0acfd2bcfe171ea5e04d288dc4e8a", "score": "0.53060097", "text": "func GetGVK() schema.GroupVersionKind {\n\treturn schema.GroupVersionKind{\n\t\tGroup: \"airshipit.org\",\n\t\tVersion: \"v1alpha1\",\n\t\tKind: \"Templater\",\n\t}\n}", "title": "" }, { "docid": "ae613d59103d5a11b1fe5a86a17ae0c5", "score": "0.52998555", "text": "func Cidr(db XODB, v0 string) (pgtypes.Cidr, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT pg_catalog.cidr($1)`\n\n\t// run query\n\tvar ret pgtypes.Cidr\n\tXOLog(sqlstr, v0)\n\terr = db.QueryRow(sqlstr, v0).Scan(&ret)\n\tif err != nil {\n\t\treturn pgtypes.Cidr{}, err\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "c40b6563ec036e5bd2ccea15e56ae825", "score": "0.5297556", "text": "func (c *client) gvr(resource *unstructured.Unstructured) (*schema.GroupVersionResource, error) {\n\tgroupResources, err := restmapper.GetAPIGroupResources(c.static.Discovery())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to run kubernetes resource discovery: %s\", err)\n\t}\n\trestMapper := restmapper.NewDiscoveryRESTMapper(groupResources)\n\n\tgvk := resource.GroupVersionKind()\n\tgk := schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}\n\tmapping, err := restMapper.RESTMapping(gk, gvk.Version)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to discover resource using REST mapper: %s\", err)\n\t}\n\n\treturn &mapping.Resource, nil\n}", "title": "" }, { "docid": "366b098addccad75e9519ee6abc24f7d", "score": "0.5283095", "text": "func GetKgc(name string, prms fun.Prms) KGcalculator {\n\tallocator, ok := kgcfactory[name]\n\tif !ok {\n\t\treturn nil\n\t}\n\to := allocator()\n\terr := o.Init(prms)\n\tif err != nil {\n\t\treturn nil\n\t}\n\treturn o\n}", "title": "" }, { "docid": "0072d2e8e3fad8262cef9def9bba19d4", "score": "0.5232139", "text": "func (zone *PrivateDnsZone) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: zone.Spec.OriginalVersion(),\n\t\tKind: \"PrivateDnsZone\",\n\t}\n}", "title": "" }, { "docid": "fce61a996a026e79cd0dac3c3b2376e0", "score": "0.5149896", "text": "func (schedule *RedisPatchSchedule) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: schedule.Spec.OriginalVersion,\n\t\tKind: \"RedisPatchSchedule\",\n\t}\n}", "title": "" }, { "docid": "0f1a26f727f6d2cd8fd91da951b2d5f9", "score": "0.51240987", "text": "func (f *FakeCfClient) HasGVK(gvk schema.GroupVersionKind) bool {\n\tf.mu.Lock()\n\tdefer f.mu.Unlock()\n\n\tfor k := range f.data {\n\t\tif k.Gvk == gvk {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "eed0001958b059cc8ad0ef5b750b2583", "score": "0.510209", "text": "func RegisterGVK(gvk GroupVersionKind, scopeKind string, resource string) {\n\t// TODO: gvk must not have empty fields\n\n\t// TODO: Resource must not be be empty\n\tif gvkSet[gvk] {\n\t\tpanic(fmt.Sprint(\"Attempt to register duplicate gvk: \", gvk))\n\t}\n\tgvkSet[gvk] = true\n\n\tif sk, ok := scopeKindMap[gvk.GroupKind]; ok && sk != scopeKind {\n\t\tpanic(fmt.Sprintf(\"Attempt to set different scope: %s for gvk: %v. Previously set scope: %s\", sk, gvk, sk))\n\t}\n\n\tscopeKindMap[gvk.GroupKind] = scopeKind\n\n\tif r, ok := resourceMap[gvk.GroupKind]; ok && r != resource {\n\t\tpanic(fmt.Sprintf(\"Attempt to register different resurce: %s for gvk: %v. Previously set resource: %s\", scopeKind, gvk, r))\n\t}\n\n\tresourceMap[gvk.GroupKind] = resource\n}", "title": "" }, { "docid": "d6fa5c052bc68574d93a8c360b7aceb3", "score": "0.5093649", "text": "func (svr *Server) KvGet(ctx context.Context, req *kvrpcpb.GetRequest) (*kvrpcpb.GetResponse, error) {\n\treqCtx, err := newRequestCtx(svr, req.Context, \"KvGet\")\n\tif err != nil {\n\t\treturn &kvrpcpb.GetResponse{Error: convertToKeyError(err)}, nil\n\t}\n\tdefer reqCtx.finish()\n\tif reqCtx.regErr != nil {\n\t\treturn &kvrpcpb.GetResponse{RegionError: reqCtx.regErr}, nil\n\t}\n\tval, err := svr.mvccStore.Get(reqCtx, req.Key, req.Version)\n\treturn &kvrpcpb.GetResponse{\n\t\tValue: val,\n\t\tError: convertToKeyError(err),\n\t}, nil\n}", "title": "" }, { "docid": "6256f8f4043682dacb672de17cb2311b", "score": "0.5091763", "text": "func (link *PrivateDnsZonesVirtualNetworkLink) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: link.Spec.OriginalVersion,\n\t\tKind: \"PrivateDnsZonesVirtualNetworkLink\",\n\t}\n}", "title": "" }, { "docid": "d222b53a03b4129d7f874f35af35ff01", "score": "0.509135", "text": "func (p *Provider) GetCRDPath() string {\n\tif p.CRDPath != \"\" {\n\t\treturn p.CRDPath\n\t}\n\treturn fmt.Sprintf(\"https://github.com/%s/%s/config/default?ref=%s\", p.Organization, p.Name, p.Version)\n}", "title": "" }, { "docid": "a126384fe3aca10624d0eace49baaebd", "score": "0.50296414", "text": "func GetCRDRestClient(cfg *rest.Config) (*rest.RESTClient, error) {\n\treturn utils.GetK8sRestClient(cfg, scheme, &schemeGroupVersion)\n}", "title": "" }, { "docid": "f554fceb4f60948534692c9d64846e19", "score": "0.5009362", "text": "func FindCVG(cvID int, selectCols ...string) (*CV, error) {\n\treturn FindCV(boil.GetDB(), cvID, selectCols...)\n}", "title": "" }, { "docid": "deadfdb26842630e1034da4c86c35dbb", "score": "0.50025386", "text": "func (pool *WorkspacesBigDataPool) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: pool.Spec.OriginalVersion(),\n\t\tKind: \"WorkspacesBigDataPool\",\n\t}\n}", "title": "" }, { "docid": "728ccc64850a88ad671b68b29f73c582", "score": "0.49893326", "text": "func (dkvClnt *DKVClient) Get(rc serverpb.ReadConsistency, key []byte) (*serverpb.GetResponse, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), dkvClnt.opts.Timeout)\n\tdefer cancel()\n\tgetReq := &serverpb.GetRequest{Key: key, ReadConsistency: rc}\n\treturn dkvClnt.dkvCli.Get(ctx, getReq)\n}", "title": "" }, { "docid": "46d66166cf89f858a76576b2e2d64dd6", "score": "0.49725756", "text": "func GetCrdByName(namespace string, gvr schema.GroupVersionResource, resourceName string) (*CustomResourceInstance, error) {\n\tif namespace == \"\" {\n\t\treturn nil, errors.New(\"namespace is required\")\n\t}\n\tdynamicClient := client.GetDynamicClient()\n\n\tnamespaceResInt := dynamicClient.Resource(gvr).Namespace(namespace)\n\tresource, err := namespaceResInt.Get(context.TODO(), resourceName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, errors.New(fmt.Sprintf(\"CRD Resource List error %s\", err.Error()))\n\t}\n\n\tresourceData, err := resource.MarshalJSON()\n\tvar cres = CustomResourceInstance{}\n\tif err == nil {\n\t\tbuff := bytes.NewBuffer(resourceData)\n\t\tjson.NewDecoder(buff).Decode(&cres)\n\t}\n\n\treturn &cres, nil\n}", "title": "" }, { "docid": "ead7275819ad71427c72002d8b927048", "score": "0.4968463", "text": "func getControlPlaneGVKForMachine(cluster *clusterv1.Cluster, machine *clusterv1.Machine) *schema.GroupVersionKind {\n\tif _, ok := machine.GetLabels()[clusterv1.MachineControlPlaneLabel]; ok {\n\t\tif cluster.Spec.ControlPlaneRef != nil {\n\t\t\tgvk := cluster.Spec.ControlPlaneRef.GroupVersionKind()\n\t\t\treturn &gvk\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3126432a75a66810ec20ebfd94486ab8", "score": "0.49616152", "text": "func (machine *VirtualMachine) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: machine.Spec.OriginalVersion,\n\t\tKind: \"VirtualMachine\",\n\t}\n}", "title": "" }, { "docid": "53a9036a50350dfb57c5763c14e191f9", "score": "0.49532768", "text": "func FindCvtermRelationshipG(cvtermRelationshipID int, selectCols ...string) (*CvtermRelationship, error) {\n\treturn FindCvtermRelationship(boil.GetDB(), cvtermRelationshipID, selectCols...)\n}", "title": "" }, { "docid": "e6b2c7b20a2f6431ef21902f3fe53162", "score": "0.4934869", "text": "func (peering *VirtualNetworksVirtualNetworkPeering) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: peering.Spec.OriginalVersion,\n\t\tKind: \"VirtualNetworksVirtualNetworkPeering\",\n\t}\n}", "title": "" }, { "docid": "43d5f3b9b26dc8d1d0e1f5513ddc6eaf", "score": "0.493336", "text": "func bgpConfigurationCRD() *apiextensions.CustomResourceDefinition {\n\treturn &apiextensions.CustomResourceDefinition{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: \"bgpconfigurations.crd.projectcalico.org\",\n\t\t},\n\t\tSpec: apiextensions.CustomResourceDefinitionSpec{\n\t\t\tScope: apiextensions.ClusterScoped,\n\t\t\tGroup: \"crd.projectcalico.org\",\n\t\t\tVersions: []apiextensions.CustomResourceDefinitionVersion{\n\t\t\t\t{\n\t\t\t\t\tName: \"v1\",\n\t\t\t\t\tServed: true,\n\t\t\t\t\tStorage: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tNames: apiextensions.CustomResourceDefinitionNames{\n\t\t\t\tKind: \"BGPConfiguration\",\n\t\t\t\tPlural: \"bgpconfigurations\",\n\t\t\t\tSingular: \"bgpconfiguration\",\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f86fea506160fc7a3b2bea2323069999", "score": "0.4932383", "text": "func (account *StorageAccount) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: account.Spec.OriginalVersion,\n\t\tKind: \"StorageAccount\",\n\t}\n}", "title": "" }, { "docid": "1132881dfe9ee5581ee79b3afdcad5d7", "score": "0.49143383", "text": "func GetGVKForObject(obj runtime.Object) (schema.GroupVersionKind, error) {\n\tgvk, err := apiutil.GVKForObject(obj, scheme.Scheme)\n\tif err != nil {\n\t\treturn gvk, err\n\t}\n\treturn gvk, nil\n}", "title": "" }, { "docid": "dfea9b3713e6f69ea53edf33d3494472", "score": "0.48986384", "text": "func (kb *kubernetesBackupper) backupCRD(log logrus.FieldLogger, gr schema.GroupResource, itemBackupper *itemBackupper) {\n\tcrdGroupResource := kuberesource.CustomResourceDefinitions\n\n\tlog.Debugf(\"Getting server preferred API version for %s\", crdGroupResource)\n\tgvr, apiResource, err := kb.discoveryHelper.ResourceFor(crdGroupResource.WithVersion(\"\"))\n\tif err != nil {\n\t\tlog.WithError(errors.WithStack(err)).Errorf(\"Error getting resolved resource for %s\", crdGroupResource)\n\t\treturn\n\t}\n\tlog.Debugf(\"Got server preferred API version %s for %s\", gvr.Version, crdGroupResource)\n\n\tlog.Debugf(\"Getting dynamic client for %s\", gvr.String())\n\tcrdClient, err := kb.dynamicFactory.ClientForGroupVersionResource(gvr.GroupVersion(), apiResource, \"\")\n\tif err != nil {\n\t\tlog.WithError(errors.WithStack(err)).Errorf(\"Error getting dynamic client for %s\", crdGroupResource)\n\t\treturn\n\t}\n\tlog.Debugf(\"Got dynamic client for %s\", gvr.String())\n\n\t// try to get a CRD whose name matches the provided GroupResource\n\tunstructured, err := crdClient.Get(gr.String(), metav1.GetOptions{})\n\tif apierrors.IsNotFound(err) {\n\t\t// not found: this means the GroupResource provided was not a\n\t\t// custom resource, so there's no CRD to back up.\n\t\tlog.Debugf(\"No CRD found for GroupResource %s\", gr.String())\n\t\treturn\n\t}\n\tif err != nil {\n\t\tlog.WithError(errors.WithStack(err)).Errorf(\"Error getting CRD %s\", gr.String())\n\t\treturn\n\t}\n\n\tlog.Infof(\"Found associated CRD %s to add to backup\", gr.String())\n\n\tkb.backupItem(log, gvr.GroupResource(), itemBackupper, unstructured, gvr)\n}", "title": "" }, { "docid": "5f43ee5f64ba8287ac62d4ba9d889a05", "score": "0.48650414", "text": "func (enterprise *RedisEnterprise) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: enterprise.Spec.OriginalVersion,\n\t\tKind: \"RedisEnterprise\",\n\t}\n}", "title": "" }, { "docid": "363d9dd482cb5b35148808efcfc3c181", "score": "0.4859834", "text": "func (group *ContainerGroup) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: group.Spec.OriginalVersion,\n\t\tKind: \"ContainerGroup\",\n\t}\n}", "title": "" }, { "docid": "ac588fff960db17fe13aa6faa83c0f03", "score": "0.48355526", "text": "func (p *Planner) searchCR(selector v1alpha1.BackingServiceSelector) (*unstructured.Unstructured, error) {\n\t// gvr is the plural guessed resource for the given selector\n\tgvk := schema.GroupVersionKind{\n\t\tGroup: selector.Group,\n\t\tVersion: selector.Version,\n\t\tKind: selector.Kind,\n\t}\n\tgvr, _ := meta.UnsafeGuessKindToResource(gvk)\n\n\tif selector.Namespace == nil {\n\t\treturn nil, errBackingServiceNamespace\n\t}\n\n\t// delegate the search selector's namespaced resource client\n\treturn p.client.Resource(gvr).Namespace(*selector.Namespace).Get(selector.ResourceRef, metav1.GetOptions{})\n}", "title": "" }, { "docid": "379d8bc9e4b6b7113f9fc494b119bd8e", "score": "0.48166627", "text": "func Regrolerecv(db XODB, v0 pgtypes.Internal) (pgtypes.Regrole, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT pg_catalog.regrolerecv($1)`\n\n\t// run query\n\tvar ret pgtypes.Regrole\n\tXOLog(sqlstr, v0)\n\terr = db.QueryRow(sqlstr, v0).Scan(&ret)\n\tif err != nil {\n\t\treturn pgtypes.Regrole{}, err\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "c9f49a2412dd25cf37224d99ef7a16fb", "score": "0.48140013", "text": "func (domain *Domain) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: domain.Spec.OriginalVersion,\n\t\tKind: \"Domain\",\n\t}\n}", "title": "" }, { "docid": "3a06f20dc5f371e82a55078a24dbf863", "score": "0.48036227", "text": "func (monitor *controllerMonitor) getControllerCRD(crdName string) *v1beta1.AntreaControllerInfo {\n\tcontrollerCRD, err := monitor.client.ClusterinformationV1beta1().AntreaControllerInfos().Get(crdName, metav1.GetOptions{})\n\tif err != nil {\n\t\tklog.V(2).Infof(\"Controller monitoring CRD named %s doesn't exist, will create one\", crdName)\n\t\treturn nil\n\t}\n\treturn controllerCRD\n}", "title": "" }, { "docid": "1e1be4929bdc15f7ce2e513ef2023f81", "score": "0.4790776", "text": "func (rule *ServersFirewallRule) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: rule.Spec.OriginalVersion(),\n\t\tKind: \"ServersFirewallRule\",\n\t}\n}", "title": "" }, { "docid": "53aa920cdf61356775057db118321898", "score": "0.47846743", "text": "func (monitor *controllerMonitor) getControllerCRD(crdName string) (*v1beta1.AntreaControllerInfo, error) {\n\treturn monitor.client.CrdV1beta1().AntreaControllerInfos().Get(context.TODO(), crdName, metav1.GetOptions{})\n}", "title": "" }, { "docid": "3056c4d125be75c39e822a918e3da36a", "score": "0.47814414", "text": "func GetCRDGroupKind(u *unstructured.Unstructured) (schema.GroupKind, bool) {\n\temptyGroupKind := schema.GroupKind{Group: \"\", Kind: \"\"}\n\tif u == nil {\n\t\treturn emptyGroupKind, false\n\t}\n\tgroup, found, err := unstructured.NestedString(u.Object, \"spec\", \"group\")\n\tif found && err == nil {\n\t\tkind, found, err := unstructured.NestedString(u.Object, \"spec\", \"names\", \"kind\")\n\t\tif found && err == nil {\n\t\t\treturn schema.GroupKind{Group: group, Kind: kind}, true\n\t\t}\n\t}\n\treturn emptyGroupKind, false\n}", "title": "" }, { "docid": "f1e036caa4bc7cf4bcc4ebb21048a296", "score": "0.4778174", "text": "func (c ServerPreferredResources) GetGVRFromKind(kind string) schema.GroupVersionResource {\n\temptyGVR := schema.GroupVersionResource{}\n\tserverresources, err := c.cachedClient.ServerPreferredResources()\n\tif err != nil {\n\t\tglog.Error(err)\n\t\treturn emptyGVR\n\t}\n\tfor _, serverresource := range serverresources {\n\t\tfor _, resource := range serverresource.APIResources {\n\t\t\tif resource.Kind == kind && !strings.Contains(resource.Name, \"/\") {\n\t\t\t\tgv, err := schema.ParseGroupVersion(serverresource.GroupVersion)\n\t\t\t\tif err != nil {\n\t\t\t\t\tglog.Error(err)\n\t\t\t\t\treturn emptyGVR\n\t\t\t\t}\n\t\t\t\treturn gv.WithResource(resource.Name)\n\t\t\t}\n\t\t}\n\t}\n\treturn emptyGVR\n}", "title": "" }, { "docid": "6f04ab3eb14a9fd027c0678684ea87d7", "score": "0.47734484", "text": "func CheckForCStorVolumeCRD(clientset clientset.Interface) {\n\tfor {\n\t\t// Since this blocking function is restricted to check if CVR CRD is present\n\t\t// or not, we are trying to handle only the error of CVR CR List api indirectly.\n\t\t// CRD has only two types of scope, cluster and namespaced. If CR list api\n\t\t// for default namespace works fine, then CR list api works for all namespaces.\n\t\t_, err := clientset.OpenebsV1alpha1().CStorVolumes(string(DefaultNameSpace)).\n\t\t\tList(context.TODO(), metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"CStorVolume CRD not found. Retrying after %v, err : %v\", CRDRetryInterval, err)\n\t\t\ttime.Sleep(CRDRetryInterval)\n\t\t\tcontinue\n\t\t}\n\t\tklog.Info(\"CStorVolume CRD found\")\n\t\tbreak\n\t}\n}", "title": "" }, { "docid": "e6291781daf8aa47e0c5a7886e580316", "score": "0.4771524", "text": "func (scaleSet *VirtualMachineScaleSet) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: scaleSet.Spec.OriginalVersion,\n\t\tKind: \"VirtualMachineScaleSet\",\n\t}\n}", "title": "" }, { "docid": "82b596039e1c0a9e92e0686c1d459212", "score": "0.4758853", "text": "func FindCVGP(cvID int, selectCols ...string) *CV {\n\tretobj, err := FindCV(boil.GetDB(), cvID, selectCols...)\n\tif err != nil {\n\t\tpanic(boil.WrapErr(err))\n\t}\n\n\treturn retobj\n}", "title": "" }, { "docid": "c3cef81e02265e1f57d734c6aecab7bf", "score": "0.47539157", "text": "func RedisKVGet(rc *RedisCliPool, key string) (string, error) {\n\tconn := rc.GetConn()\n\tif conn == nil {\n\t\treturn \"\", ErrRedisNoConn\n\t}\n\tdefer conn.Close()\n\n\tr, err := conn.Do(\"GET\", key)\n\treturn redis.String(r, err)\n}", "title": "" }, { "docid": "6a36f3ebaf3183c237b34a3eecf41428", "score": "0.47462657", "text": "func CidrRecv(db XODB, v0 pgtypes.Internal) (pgtypes.Cidr, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT pg_catalog.cidr_recv($1)`\n\n\t// run query\n\tvar ret pgtypes.Cidr\n\tXOLog(sqlstr, v0)\n\terr = db.QueryRow(sqlstr, v0).Scan(&ret)\n\tif err != nil {\n\t\treturn pgtypes.Cidr{}, err\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "839bb7a2cce6ba174b65d14a8ed47358", "score": "0.4732342", "text": "func (l *Live) CRDWatcher() CRDWatcher {\n\treturn l.crdWatcher\n}", "title": "" }, { "docid": "4a24e8dfbd37d961eb062e4fb50f4877", "score": "0.47255757", "text": "func (share *StorageAccountsFileServicesShare) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: share.Spec.OriginalVersion,\n\t\tKind: \"StorageAccountsFileServicesShare\",\n\t}\n}", "title": "" }, { "docid": "7184396ebf87bee31a1556791fd55356", "score": "0.4719553", "text": "func (c *Controller) RegisterCRD() error {\n\tk8sVersion, err := k8s.GetVersion()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing Kubernetes version '%s'. %v\", k8sVersion, err)\n\t}\n\n\tk8s1_16, err := version.NewVersion(\"1.16\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing version '1.16': %v\", err)\n\t}\n\n\tif k8sVersion.GreaterThanOrEqual(k8s1_16) {\n\t\treturn c.createOrUpdateCRD()\n\t}\n\treturn c.createOrUpdateDeprecatedCRD()\n}", "title": "" }, { "docid": "e63e5fd9a39e784b59d624860c87621e", "score": "0.4716682", "text": "func CRDClient() (*CRD, error) {\n\tonce.CRD.Do(func() {\n\t\tclient, err := newCRDClient()\n\t\tif err != nil {\n\t\t\tlog.Error(err.Error())\n\t\t\tpanic(err.Error())\n\t\t}\n\t\tinstances.CRD = client\n\t})\n\tif instances.CRD == nil {\n\t\treturn nil, errors.New(\"CRDClient client instance is nil\")\n\t}\n\treturn instances.CRD, nil\n}", "title": "" }, { "docid": "d73027f26f9519ceb63023bdba47de04", "score": "0.47135788", "text": "func GetR(key string) interface{} {\n\tw := internalGetWorker()\n\treturn w.rxxtOptions.Get(w.wrapWithRxxtPrefix(key))\n}", "title": "" }, { "docid": "dc0cb7ec50be3e31ce2b17ef09a1d1ce", "score": "0.4699831", "text": "func (c *BaseClient) RGet(key string) (strVal string) {\n\treturn c.Get(key).Val()\n}", "title": "" }, { "docid": "68c49b8e3a2e509cabe61af378bcd4b8", "score": "0.4692098", "text": "func (a *Aries) GetVDRIController() (api.VDRIController, error) {\n\thandlers, ok := a.handlers[vdri.CommandName]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no handlers found for controller [%s]\", vdri.CommandName)\n\t}\n\n\treturn &VDRI{handlers: handlers}, nil\n}", "title": "" }, { "docid": "c2318a4ca216d8878d45ad12afd04286", "score": "0.468624", "text": "func createCGSearcher(crc *tc.CRConfig) (cgsrch.Ths, error) {\n\tths := cgsrch.NewThs()\n\tcgSearcher, err := cgsrch.Create(crc)\n\tif err != nil {\n\t\treturn ths, errors.New(\"creating searcher: \" + err.Error())\n\t}\n\tths.Set(cgSearcher)\n\treturn ths, nil\n}", "title": "" }, { "docid": "d718e6181b67bba01ea161f86a3f5f3b", "score": "0.46743006", "text": "func getGCKey(k string) string {\n\tsplit := strings.SplitAfter(k, g2.kvPrefix+\"/\"+g2.setName+\"/\"+g2.kvBucket+\"/\")\n\treturn strings.Replace(split[len(split)-1], \"/\", g2.keyDelim, -1)\n}", "title": "" }, { "docid": "68ba7548abf03e884abbcac657b1b0bd", "score": "0.46575445", "text": "func (o OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryAptOutput) GpgKey() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryApt) *string { return v.GpgKey }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "04cf1d900ef3449147441b945ece6871", "score": "0.46551496", "text": "func (k Keeper) GetCDP(ctx sdk.Context, account sdk.AccAddress) types.CDP {\n\tstore := ctx.KVStore(k.storeKey)\n\tif k.HasCDP(ctx, account) {\n\t\tc := store.Get(types.CDPStoreKey(account))\n\t\tvar cdp types.CDP\n\t\tk.cdc.MustUnmarshalBinaryBare(c, &cdp)\n\t\treturn cdp\n\t}\n\n\treturn types.NewCDP(0, 0, account)\n}", "title": "" }, { "docid": "55f49677dd82bc36b2d77780f5433c8c", "score": "0.46551284", "text": "func (table *RouteTable) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: table.Spec.OriginalVersion(),\n\t\tKind: \"RouteTable\",\n\t}\n}", "title": "" }, { "docid": "86cbed912c29b13a28b37e45bbad83ec", "score": "0.4653259", "text": "func (o OSPolicyResourceRepositoryResourceAptRepositoryOutput) GpgKey() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v OSPolicyResourceRepositoryResourceAptRepository) *string { return v.GpgKey }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "d165f6e146a638b6b405adc876aa4822", "score": "0.46464714", "text": "func (alias *Alias) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: alias.Spec.OriginalVersion(),\n\t\tKind: \"Alias\",\n\t}\n}", "title": "" }, { "docid": "5f01f36520cad4e0baf72ea06cc502a0", "score": "0.46435916", "text": "func (to *Session) GetCRConfig(cdn string) ([]byte, CacheHitStatus, error) {\n\turl := fmt.Sprintf(\"/CRConfig-Snapshots/%s/CRConfig.json\", cdn)\n\treturn to.getBytesWithTTL(url, tmPollingInterval)\n}", "title": "" }, { "docid": "97b6d44be963ca6dede27f4eddd9659b", "score": "0.46407697", "text": "func (key SK3Key) RCD() RCD {\n\treturn append([]byte{byte(RCDType01)}, key.PublicKey()[:]...)\n}", "title": "" }, { "docid": "35e8f751a51f50a15c96a3440413effb", "score": "0.4640472", "text": "func (o OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryAptPtrOutput) GpgKey() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *OsPolicyAssignmentOsPolicyResourceGroupResourceRepositoryApt) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.GpgKey\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "f05797da51dd70cf06bec132b323eae6", "score": "0.4629279", "text": "func (table *StorageAccountsTableServicesTable) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: table.Spec.OriginalVersion(),\n\t\tKind: \"StorageAccountsTableServicesTable\",\n\t}\n}", "title": "" }, { "docid": "ee084806ff2c21b80443ba2cc14e576c", "score": "0.46264803", "text": "func (o OSPolicyResourceRepositoryResourceAptRepositoryPtrOutput) GpgKey() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *OSPolicyResourceRepositoryResourceAptRepository) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.GpgKey\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "560aa0c3aa3255f559b82e2ea24e4680", "score": "0.4613087", "text": "func GroupVersionResourceFromGVK(unstructured *unstructured.Unstructured) (gvr schema.GroupVersionResource) {\n\tif unstructured == nil {\n\t\treturn\n\t}\n\n\tgvk := unstructured.GroupVersionKind()\n\n\tgvr.Group = gvk.Group\n\tgvr.Version = gvk.Version\n\t// Resource is assumed as plural of Kind\n\tgvr.Resource = gvk.Kind + \"s\"\n\n\treturn\n}", "title": "" }, { "docid": "f1caa03df9b4197c3ddf8e7fc0062ad6", "score": "0.46109346", "text": "func CVExistsG(cvID int) (bool, error) {\n\treturn CVExists(boil.GetDB(), cvID)\n}", "title": "" }, { "docid": "c149b8317b41db55715ffa0ef896c50e", "score": "0.4608075", "text": "func (key SK4Key) RCD() RCD {\n\treturn append([]byte{byte(RCDType01)}, key.PublicKey()[:]...)\n}", "title": "" }, { "docid": "5590275d0e680c917cfe9d727f75a4ee", "score": "0.45947552", "text": "func CrmGet(key string) (*Crm, error) {\n\tcrm := new(Crm)\n\thas, err := db.Where(\"web_hook_key = ?\", key).Get(crm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !has {\n\t\treturn nil, ErrNotFound\n\t}\n\treturn crm, nil\n}", "title": "" }, { "docid": "3dde12aad75815b7ac36a5be290b7154", "score": "0.45792896", "text": "func getCRD(file crdFile) *apiextensionsv1.CustomResourceDefinition {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\n\tif crd, ok := loaded[file]; ok && crd != nil {\n\t\treturn crd\n\t}\n\n\t// Unmarshal and memoize\n\tcrd := file.mustUnmarshal()\n\tloaded[file] = crd\n\n\treturn crd\n}", "title": "" }, { "docid": "20d2b7e024b932d48209e4099c7db396", "score": "0.45633692", "text": "func GetCRDByName(\n\tt *testing.T,\n\tg *generate.Generator,\n\tname string,\n) *model.CRD {\n\trequire := require.New(t)\n\n\tcrds, err := g.GetCRDs()\n\trequire.Nil(err)\n\n\tfor _, c := range crds {\n\t\tif c.Names.Original == name {\n\t\t\treturn c\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b2709559cc0084306b98939ebd66f960", "score": "0.45624688", "text": "func (fohnhabService) GCMD(ctx context.Context, req GCMDRequest) (string, error) {\n\tvar (\n\t\ts string\n\t\te error\n\t)\n\n\tkey, err := base64.StdEncoding.DecodeString(req.Key)\n\tif err != nil {\n\t\treturn \"\", errBase64DecodeKey\n\t}\n\n\tciphertext, err := base64.StdEncoding.DecodeString(req.CipherText)\n\tif err != nil {\n\t\treturn \"\", errBase64ErrDecodeCipher\n\t}\n\n\tblock, err := aes.NewCipher(key)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(ciphertext) < aes.BlockSize {\n\t\treturn \"\", errBlockError\n\t}\n\n\taesgcm, err := cipher.NewGCM(block)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tnonce := make([]byte, NonceSize)\n\tcopy(nonce, ciphertext)\n\n\tplaintext, err := aesgcm.Open(nil, nonce[:], ciphertext[12:], nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\ts = string(plaintext[:])\n\treturn s, e\n}", "title": "" }, { "docid": "c281232e298891c8face85441eb96cb1", "score": "0.4562023", "text": "func gvk(gk schema.GroupKind, mapper meta.RESTMapper) (schema.GroupVersionKind, error) {\n\tmapping, err := mapper.RESTMapping(gk)\n\tif err != nil {\n\t\treturn schema.GroupVersionKind{}, err\n\t}\n\treturn mapping.GroupVersionKind, nil\n}", "title": "" }, { "docid": "ac976c664d9bd38ca3e25007b368be0c", "score": "0.45553857", "text": "func (s *SuperMicro) GetVDisk(devName string) *RaidDisk {\n\tctrls := s.GetControllers()\n\tvds := s.GetVDs()\n\n\tctrl := 0\n\tvar disk *RaidDisk\n\tfor ctrl < ctrls {\n\t\tctrl++\n\t\tfor _, vd := range vds {\n\t\t\tv := strings.Split(vd, \"/\")\n\t\t\tinputData := GetCommandOutput(s.execPath, fmt.Sprintf(\"/c%v/v%s\", ctrl-1, v[1]), \"show\", \"all\", \"J\")\n\t\t\tif devName == gjson.Get(string(inputData), \"Controllers.0.Response Data.VD* Properties.OS Drive Name\").String() {\n\t\t\t\tdisk = &RaidDisk{\n\t\t\t\t\t// ControllerID: ctrl - 1,\n\t\t\t\t\t// DiskID: vd,\n\t\t\t\t\tRaid: gjson.Get(string(inputData), \"Controllers.0.Response Data./c*v*.#.TYPE\").Array()[0].String(),\n\t\t\t\t\tDevPath: gjson.Get(string(inputData), \"Controllers.0.Response Data.VD* Properties.OS Drive Name\").String(),\n\t\t\t\t\tMediaType: gjson.Get(string(inputData), \"Controllers.0.Response Data.PDs for VD *.#.Med\").Array()[0].String(),\n\t\t\t\t\t// InterfaceType: gjson.Get(string(inputData), \"Controllers.0.Response Data.PDs for VD *.#.Intf\").Array()[0].String(),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn disk\n}", "title": "" }, { "docid": "2f0879634ca9abcc8b84eefb7e3b17fb", "score": "0.4554524", "text": "func (topic *Topic) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: topic.Spec.OriginalVersion(),\n\t\tKind: \"Topic\",\n\t}\n}", "title": "" }, { "docid": "a057964a3b410e4e469bf4c13ea38915", "score": "0.45515138", "text": "func (o *NiaapiReleaseRecommend) GetCrr() string {\n\tif o == nil || o.Crr == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Crr\n}", "title": "" }, { "docid": "afcde2afe78ead718a09c1f4fec6b86f", "score": "0.45476487", "text": "func (o *CV) CvtermG(mods ...qm.QueryMod) cvtermQuery {\n\treturn o.Cvterm(boil.GetDB(), mods...)\n}", "title": "" }, { "docid": "41a5ece3ddae67e85a2cb0b53b894868", "score": "0.45475698", "text": "func Get(key string) (string, error) {\n\treturn rc.Get(key).Result()\n}", "title": "" }, { "docid": "e1227788351aa128a361ba40f5d64689", "score": "0.4544408", "text": "func Dcbrt(db XODB, v0 float64) (float64, error) {\n\tvar err error\n\n\t// sql query\n\tconst sqlstr = `SELECT pg_catalog.dcbrt($1)`\n\n\t// run query\n\tvar ret float64\n\tXOLog(sqlstr, v0)\n\terr = db.QueryRow(sqlstr, v0).Scan(&ret)\n\tif err != nil {\n\t\treturn 0.0, err\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "bf6bb32774fcdb65190faa9f9a6ae605", "score": "0.4536446", "text": "func (r *Retriever) getCRKey(u *unstructured.Unstructured, section string, key string) (string, interface{}, error) {\n\tobj := u.Object\n\tobjName := u.GetName()\n\tlog := r.logger.WithValues(\"CR.Name\", objName, \"CR.section\", section, \"CR.key\", key)\n\tlog.Debug(\"Reading CR attributes...\")\n\n\tsectionMap, exists := obj[section]\n\tif !exists {\n\t\treturn \"\", sectionMap, fmt.Errorf(\"Can't find '%s' section in CR named '%s'\", section, objName)\n\t}\n\n\tlog.WithValues(\"SectionMap\", sectionMap).Debug(\"Getting values from sectionmap\")\n\tv, _, err := r.getNestedValue(key, sectionMap)\n\tfor k, v := range sectionMap.(map[string]interface{}) {\n\t\tif _, ok := r.cache[section]; !ok {\n\t\t\tr.cache[section] = make(map[string]interface{})\n\t\t}\n\t\tr.cache[section].(map[string]interface{})[k] = v\n\t}\n\treturn v, sectionMap, err\n}", "title": "" }, { "docid": "1e2d8dc2076522c891d9f8aa1a6ec5d4", "score": "0.45362183", "text": "func (c *Client) validateCRD() error {\n\t// Check cluster version\n\tserverVersion, err := c.client.Discovery().ServerVersion()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get server version: %s\", err.Error())\n\t}\n\n\trunningVersion, err := version.ParseGeneric(serverVersion.String())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unexpected error parsing running Kubernetes version, %s\", err.Error())\n\t}\n\n\tleastVersion, _ := version.ParseGeneric(\"v1.19.0\")\n\tif !runningVersion.AtLeast(leastVersion) {\n\t\tlog.Info(\"kubernetes version should great then v1.19.0 to use crd\", \"server version\", serverVersion.GitVersion)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6ac38d9d331e870a9f278464164451a3", "score": "0.45346683", "text": "func GetEnableReplaceCRD(ctx *pulumi.Context) bool {\n\treturn config.GetBool(ctx, \"kubernetes:enableReplaceCRD\")\n}", "title": "" }, { "docid": "bf6db5b32c00eff9826f514ac91db193", "score": "0.45325592", "text": "func (c *RegionCache) GetTiKVRPCContext(bo *retry.Backoffer, id RegionVerID, replicaRead kv.ReplicaReadType, followerStoreSeed uint32, opts ...StoreSelectorOption) (*RPCContext, error) {\n\tts := time.Now().Unix()\n\n\tcachedRegion := c.GetCachedRegionWithRLock(id)\n\tif cachedRegion == nil {\n\t\treturn nil, nil\n\t}\n\n\tif cachedRegion.checkNeedReload() {\n\t\treturn nil, nil\n\t}\n\n\tif !cachedRegion.checkRegionCacheTTL(ts) {\n\t\treturn nil, nil\n\t}\n\n\tregionStore := cachedRegion.getStore()\n\tvar (\n\t\tstore *Store\n\t\tpeer *metapb.Peer\n\t\tstoreIdx int\n\t\taccessIdx AccessIndex\n\t)\n\toptions := &storeSelectorOp{}\n\tfor _, op := range opts {\n\t\top(options)\n\t}\n\tisLeaderReq := false\n\tswitch replicaRead {\n\tcase kv.ReplicaReadFollower:\n\t\tstore, peer, accessIdx, storeIdx = cachedRegion.FollowerStorePeer(regionStore, followerStoreSeed, options)\n\tcase kv.ReplicaReadMixed:\n\t\tstore, peer, accessIdx, storeIdx = cachedRegion.AnyStorePeer(regionStore, followerStoreSeed, options)\n\tcase kv.ReplicaReadPreferLeader:\n\t\toptions.preferLeader = true\n\t\tstore, peer, accessIdx, storeIdx = cachedRegion.AnyStorePeer(regionStore, followerStoreSeed, options)\n\tdefault:\n\t\tisLeaderReq = true\n\t\tstore, peer, accessIdx, storeIdx = cachedRegion.WorkStorePeer(regionStore)\n\t}\n\taddr, err := c.getStoreAddr(bo, cachedRegion, store)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// enable by `curl -XPUT -d '1*return(\"[some-addr]\")->return(\"\")' http://host:port/tikvclient/injectWrongStoreAddr`\n\tif val, err := util.EvalFailpoint(\"injectWrongStoreAddr\"); err == nil {\n\t\tif a, ok := val.(string); ok && len(a) > 0 {\n\t\t\taddr = a\n\t\t}\n\t}\n\tif store == nil || len(addr) == 0 {\n\t\t// Store not found, region must be out of date.\n\t\tcachedRegion.invalidate(StoreNotFound)\n\t\treturn nil, nil\n\t}\n\n\tstoreFailEpoch := atomic.LoadUint32(&store.epoch)\n\tif storeFailEpoch != regionStore.storeEpochs[storeIdx] {\n\t\tcachedRegion.invalidate(Other)\n\t\tlogutil.Logger(bo.GetCtx()).Info(\"invalidate current region, because others failed on same store\",\n\t\t\tzap.Uint64(\"region\", id.GetID()),\n\t\t\tzap.String(\"store\", store.addr))\n\t\treturn nil, nil\n\t}\n\n\tvar (\n\t\tproxyStore *Store\n\t\tproxyAddr string\n\t)\n\tif c.enableForwarding && isLeaderReq {\n\t\tif store.getLivenessState() == reachable {\n\t\t\tregionStore.unsetProxyStoreIfNeeded(cachedRegion)\n\t\t} else {\n\t\t\tproxyStore, _, _ = c.getProxyStore(cachedRegion, store, regionStore, accessIdx)\n\t\t\tif proxyStore != nil {\n\t\t\t\tproxyAddr, err = c.getStoreAddr(bo, cachedRegion, proxyStore)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &RPCContext{\n\t\tRegion: id,\n\t\tMeta: cachedRegion.meta,\n\t\tPeer: peer,\n\t\tAccessIdx: accessIdx,\n\t\tStore: store,\n\t\tAddr: addr,\n\t\tAccessMode: tiKVOnly,\n\t\tProxyStore: proxyStore,\n\t\tProxyAddr: proxyAddr,\n\t\tTiKVNum: regionStore.accessStoreNum(tiKVOnly),\n\t}, nil\n}", "title": "" }, { "docid": "6f80cd245a33d72459649fb5662466f5", "score": "0.4531607", "text": "func (s *Sanitizer) GVR() client.GVR { return s.gvr }", "title": "" }, { "docid": "8e3c1d58b7e637fd598c490e8c391b1e", "score": "0.45312724", "text": "func (key SK2Key) RCD() RCD {\n\treturn append([]byte{byte(RCDType01)}, key.PublicKey()[:]...)\n}", "title": "" }, { "docid": "6f7660754010601786777fee844e59cf", "score": "0.452902", "text": "func (key SK1Key) RCD() RCD {\n\treturn append([]byte{byte(RCDType01)}, key.PublicKey()[:]...)\n}", "title": "" }, { "docid": "249d36e1f6242b0e186f12038ca26e2d", "score": "0.45177308", "text": "func (k *K8sClient) GetOEV1alpha1CVR(name string) (*api_oe_v1alpha1.CStorVolumeReplica, error) {\n\tif k.CStorVolume != nil {\n\t\treturn k.CStorVolumeReplica, nil\n\t}\n\n\tcvrOps := k.oeV1alpha1CVROps()\n\treturn cvrOps.Get(context.TODO(), name, mach_apis_meta_v1.GetOptions{})\n}", "title": "" }, { "docid": "d959791c86e95d8deba07ca9be2b7e94", "score": "0.4508829", "text": "func (f *FakeOSClient) GetCRDClient() crdClient.Interface {\n\treturn f.CRDClient\n}", "title": "" }, { "docid": "44567aa331f85f6502b312109848a1ae", "score": "0.4504764", "text": "func (os *FakeOSClient) GetCRDClient() *crdClient.CRDClient {\n\treturn os.CRDClient\n}", "title": "" }, { "docid": "c26a22bae0f182c208e5c830db52ed3b", "score": "0.4503854", "text": "func (v *VRGInstance) getStorageClass(namespacedName types.NamespacedName) (*storagev1.StorageClass, error) {\n\tvar pvc *corev1.PersistentVolumeClaim\n\n\tfor index := range v.pvcList.Items {\n\t\tpvcItem := &v.pvcList.Items[index]\n\n\t\tpvcNamespacedName := types.NamespacedName{Name: pvcItem.Name, Namespace: pvcItem.Namespace}\n\t\tif pvcNamespacedName == namespacedName {\n\t\t\tpvc = pvcItem\n\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif pvc == nil {\n\t\tv.log.Info(\"failed to get the pvc with namespaced name\", namespacedName)\n\n\t\t// Need the storage driver of pvc. If pvc is not found return error.\n\t\treturn nil, fmt.Errorf(\"failed to get the pvc with namespaced name %s\", namespacedName)\n\t}\n\n\tscName := pvc.Spec.StorageClassName\n\n\tstorageClass := &storagev1.StorageClass{}\n\tif err := v.reconciler.Get(v.ctx, types.NamespacedName{Name: *scName}, storageClass); err != nil {\n\t\tv.log.Info(fmt.Sprintf(\"Failed to get the storageclass %s\", *scName))\n\n\t\treturn nil, fmt.Errorf(\"failed to get the storageclass with name %s (%w)\",\n\t\t\t*scName, err)\n\t}\n\n\treturn storageClass, nil\n}", "title": "" }, { "docid": "1f9353e2e7f421bda7a13b2d16a9d746", "score": "0.4495476", "text": "func getCD(config *config.Config) string {\n\tfor _, option := range config.ExecOptions {\n\t\tkey, val, err := parsers.ParseKeyValueOpt(option)\n\t\tif err != nil || !strings.EqualFold(key, \"native.cgroupdriver\") {\n\t\t\tcontinue\n\t\t}\n\t\treturn val\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "f77f9736acef5ed289fc5c41329e35eb", "score": "0.44871885", "text": "func (policy *ServersSecurityAlertPolicy) OriginalGVK() *schema.GroupVersionKind {\n\treturn &schema.GroupVersionKind{\n\t\tGroup: GroupVersion.Group,\n\t\tVersion: policy.Spec.OriginalVersion(),\n\t\tKind: \"ServersSecurityAlertPolicy\",\n\t}\n}", "title": "" }, { "docid": "2136b14a597fa98f6af7a5d6e888396f", "score": "0.4486296", "text": "func SecretGVR() schema.GroupVersionResource {\n\treturn schema.GroupVersionResource{\n\t\tGroup: \"\",\n\t\tVersion: \"v1\",\n\t\tResource: \"secrets\",\n\t}\n}", "title": "" }, { "docid": "094934e7ea8d295f7ca415bc293eaf43", "score": "0.4480773", "text": "func GetPDClientForGC(ctx context.Context, db *sql.DB) (pd.Client, error) {\n\tif ok, _ := dbutil.IsTiDB(ctx, db); ok {\n\t\tpdAddrs, err := GetPDAddrs(ctx, db)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(pdAddrs) > 0 {\n\t\t\tif same, err := checkSameCluster(ctx, db, pdAddrs); err != nil {\n\t\t\t\tlog.Info(\"[automatically GC] check whether fetched pd addr and TiDB belong to one cluster failed\", zap.Strings(\"pd address\", pdAddrs), zap.Error(err))\n\t\t\t} else if same {\n\t\t\t\tpdClient, err := pd.NewClientWithContext(ctx, pdAddrs, pd.SecurityOption{})\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Info(\"[automatically GC] create pd client to control GC failed\", zap.Strings(\"pd address\", pdAddrs), zap.Error(err))\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\treturn pdClient, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "239d7e4aa708efeeb2b1db7f1a09a7b3", "score": "0.4479619", "text": "func KCV(keyType byte, key []byte) ([3]byte, error) {\n\tif keyType != TypeAES && keyType != TypeDES {\n\t\treturn [3]byte{}, errors.Errorf(\"unknown key type - must be either DES '80' or AES '88, got %02X\", keyType)\n\t}\n\n\tif keyType == TypeAES {\n\t\treturn aesKCV(key)\n\t}\n\n\treturn desKCV(key)\n}", "title": "" }, { "docid": "4d2bd92f2cbcb61662345ec6dcaba0f7", "score": "0.44784358", "text": "func getKVDoc(ctx context.Context, domain, project, kvID string) (*model.KVDoc, error) {\n\tresp, err := etcdadpt.Get(ctx, key.KV(domain, project, kvID))\n\tif err != nil {\n\t\topenlog.Error(err.Error())\n\t\treturn nil, err\n\t}\n\tif resp == nil {\n\t\treturn nil, datasource.ErrKeyNotExists\n\t}\n\tcurKV := &model.KVDoc{}\n\terr = json.Unmarshal(resp.Value, curKV)\n\tif err != nil {\n\t\topenlog.Error(\"decode error: \" + err.Error())\n\t\treturn nil, err\n\t}\n\n\tif err := auth.CheckDeleteKV(ctx, curKV); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn curKV, nil\n}", "title": "" }, { "docid": "db12e1103665f2956a5d2b1cb5c14831", "score": "0.4471719", "text": "func (c DefaultCrypto) KdfRK(rk, dhOut Key) (Key, Key, Key) {\n\tvar (\n\t\tr = hkdf.New(sha256.New, dhOut, rk, []byte(\"rsZUpEuXUqqwXBvSy3EcievAh4cMj6QL\"))\n\t\tbuf = make([]byte, 96)\n\t)\n\n\t// The only error here is an entropy limit which won't be reached for such a short buffer.\n\t_, _ = io.ReadFull(r, buf)\n\n\trootKey := make(Key, 32)\n\theaderKey := make(Key, 32)\n\tchainKey := make(Key, 32)\n\n\tcopy(rootKey[:], buf[:32])\n\tcopy(chainKey[:], buf[32:64])\n\tcopy(headerKey[:], buf[64:96])\n\treturn rootKey, chainKey, headerKey\n}", "title": "" } ]
2153e9c13c41dc94a0c2c117cbe944dc
Get takes name of the galeraBackup, and returns the corresponding galeraBackup object, and an error if there is any.
[ { "docid": "2de7e5717ea6383578a989fb7f889b21", "score": "0.7782375", "text": "func (c *FakeGaleraBackups) Get(name string, options v1.GetOptions) (result *v1beta2.GaleraBackup, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(galerabackupsResource, c.ns, name), &v1beta2.GaleraBackup{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta2.GaleraBackup), err\n}", "title": "" } ]
[ { "docid": "2b764a063bb8e555150e92e7aee7cf9e", "score": "0.6891087", "text": "func Get(name string) (Driver, error) {\n\td, ok := backupDrivers[name]\n\tif ok {\n\t\treturn d, nil\n\t}\n\n\treturn nil, &errors.ErrNotFound{\n\t\tID: name,\n\t\tType: \"BackupDriver\",\n\t}\n}", "title": "" }, { "docid": "81ee7b14a654d82b7903b580e1373f9d", "score": "0.6629393", "text": "func GetBackup(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *BackupState, opts ...pulumi.ResourceOption) (*Backup, error) {\n\tvar resource Backup\n\terr := ctx.ReadResource(\"gcp:alloydb/backup:Backup\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "ddec33935199ff68c577a0eee4bfe259", "score": "0.6597322", "text": "func (d *backupsService) Get(ctx context.Context, getReq *GetBackupRequest) (*Backup, error) {\n\tpath := backupAPIPath(getReq.Organization, getReq.Database, getReq.Branch, getReq.Backup)\n\treq, err := d.client.newRequest(http.MethodGet, path, nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"error creating http request\")\n\t}\n\n\tbackup := &Backup{}\n\tif err := d.client.do(ctx, req, &backup); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn backup, nil\n}", "title": "" }, { "docid": "d842dcec32e5f8f0d3f7bfea04399b3c", "score": "0.6376475", "text": "func (c *backupForGKERESTClient) GetBackup(ctx context.Context, req *gkebackuppb.GetBackupRequest, opts ...gax.CallOption) (*gkebackuppb.Backup, 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/%v\", req.GetName())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\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\topts = append((*c.CallOptions).GetBackup[0:len((*c.CallOptions).GetBackup):len((*c.CallOptions).GetBackup)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &gkebackuppb.Backup{}\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 := 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\treturn resp, nil\n}", "title": "" }, { "docid": "0cb59f180a4f6500bc7dfb2041680c42", "score": "0.631966", "text": "func (b *backupEntry) Get(ctx context.Context) (*gardencorev1beta1.BackupEntry, error) {\n\tif err := b.client.Get(ctx, client.ObjectKeyFromObject(b.backupEntry), b.backupEntry); err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.backupEntry, nil\n}", "title": "" }, { "docid": "a4cdd972d8a0097d118fec686075aad8", "score": "0.6263111", "text": "func GetBackup() (backup Backup, err error) {\n\tbackup.Scores, err = GetScores()\n\tif err != nil {\n\t\treturn\n\t}\n\tbackup.Racks, err = GetRacks()\n\treturn\n}", "title": "" }, { "docid": "4e9e003108b59c6d90c134ddc943a29e", "score": "0.6197616", "text": "func (d *Deployment) GetBackup(backup string) (*backupApi.ArangoBackup, error) {\n\treturn d.deps.DatabaseCRCli.BackupV1().ArangoBackups(d.Namespace()).Get(backup, metav1.GetOptions{})\n}", "title": "" }, { "docid": "24d136034736b725a1599bedcbe6b783", "score": "0.61667585", "text": "func (m *Backup) Get(db DB) error {\n\treturn Table{db}.Get(m)\n}", "title": "" }, { "docid": "4d7583b733ac91bf6a1d721e2a90a2d7", "score": "0.61542183", "text": "func (c *FakeBackupVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupVolume, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(backupvolumesResource, c.ns, name), &v1beta1.BackupVolume{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta1.BackupVolume), err\n}", "title": "" }, { "docid": "aec87fef91610a1d6269da9b01f35efd", "score": "0.6035358", "text": "func (c *backupForGKERESTClient) GetVolumeBackup(ctx context.Context, req *gkebackuppb.GetVolumeBackupRequest, opts ...gax.CallOption) (*gkebackuppb.VolumeBackup, 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/%v\", req.GetName())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\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\topts = append((*c.CallOptions).GetVolumeBackup[0:len((*c.CallOptions).GetVolumeBackup):len((*c.CallOptions).GetVolumeBackup)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &gkebackuppb.VolumeBackup{}\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 := 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\treturn resp, nil\n}", "title": "" }, { "docid": "331d6d991d4fc4710b09c05b1a776a70", "score": "0.5932341", "text": "func (c *BackupForGKEClient) GetBackup(ctx context.Context, req *gkebackuppb.GetBackupRequest, opts ...gax.CallOption) (*gkebackuppb.Backup, error) {\n\treturn c.internalClient.GetBackup(ctx, req, opts...)\n}", "title": "" }, { "docid": "18399eae1b4f00fe226a67617193c0f3", "score": "0.5902011", "text": "func (m *PodVolumeBackup) Get(db DB) error {\n\treturn Table{db}.Get(m)\n}", "title": "" }, { "docid": "b23c938165d6ea5c8bf9b8d3013ee47f", "score": "0.580794", "text": "func (c *BigtableTableAdminClient) GetBackup(ctx context.Context, req *adminpb.GetBackupRequest, opts ...gax.CallOption) (*adminpb.Backup, error) {\n\treturn c.internalClient.GetBackup(ctx, req, opts...)\n}", "title": "" }, { "docid": "f383487f3fb29030c556196b85215ab6", "score": "0.5758941", "text": "func (a *Client) GetWalletBackup(params *GetWalletBackupParams, authInfo runtime.ClientAuthInfoWriter) (*GetWalletBackupNoContent, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetWalletBackupParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetWalletBackup\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/wallet/backup\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &GetWalletBackupReader{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\tsuccess, ok := result.(*GetWalletBackupNoContent)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*GetWalletBackupDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "3d077d0434e3eea07f4b3b7131532b45", "score": "0.5673937", "text": "func (bOps *backupAPIOps) get() (interface{}, error) {\n\tbackup := &cstorapis.CStorBackup{}\n\n\terr := decodeBody(bOps.req, backup)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// backup name is expected\n\tif len(strings.TrimSpace(backup.Spec.BackupName)) == 0 {\n\t\treturn nil, CodedError(400, fmt.Sprintf(\"Failed to get backup: missing backup name \"))\n\t}\n\n\t// namespace is expected\n\tif len(strings.TrimSpace(backup.Namespace)) == 0 {\n\t\treturn nil, CodedError(400, fmt.Sprintf(\"Failed to get backup '%v': missing namespace\", backup.Spec.BackupName))\n\t}\n\n\t// volume name is expected\n\tif len(strings.TrimSpace(backup.Spec.VolumeName)) == 0 {\n\t\treturn nil, CodedError(400, fmt.Sprintf(\"Failed to get backup '%v': missing volume name\", backup.Spec.BackupName))\n\t}\n\n\tbackup.Name = backup.Spec.SnapName + \"-\" + backup.Spec.VolumeName\n\n\tbackupInterface, err := bOps.getBackupInterface(backup.Name, backup.Namespace)\n\tif err != nil {\n\t\treturn nil, CodedError(400, fmt.Sprintf(\"failed to get backup interface error: %v\", err))\n\t}\n\n\tif !backupInterface.isBackupCompleted() {\n\t\tcspiName := backupInterface.getCSPIName()\n\t\t// check if node is running or not\n\t\tbackupNodeDown := checkIfPoolManagerNodeDown(bOps.k8sclientset, cspiName, bOps.namespace)\n\t\t// check if cstor-pool-mgmt container is running or not\n\t\tbackupPodDown := checkIfPoolManagerDown(bOps.k8sclientset, cspiName, bOps.namespace)\n\n\t\tif backupNodeDown || backupPodDown {\n\t\t\t// Backup is stalled, let's find last completed-backup status\n\t\t\tlaststat := backupInterface.findLastBackupStat()\n\t\t\t// Update Backup status according to last completed-backup\n\t\t\tbackupInterface = backupInterface.updateBackupStatus(laststat)\n\t\t}\n\t}\n\n\tout, err := json.Marshal(backupInterface.getBackupObject())\n\tif err == nil {\n\t\t_, err = bOps.resp.Write(out)\n\t\tif err != nil {\n\t\t\treturn nil, CodedError(400, fmt.Sprintf(\"Failed to send response data\"))\n\t\t}\n\t\treturn nil, nil\n\t}\n\n\treturn nil, CodedError(400, fmt.Sprintf(\"Failed to encode response data\"))\n}", "title": "" }, { "docid": "ba119005c08e760ee2341b83c35171b6", "score": "0.5641759", "text": "func (m *Client) Get(ctx context.Context, name string) (cloudstorage.Object, error) {\n\tif !m.Exists(name) {\n\t\treturn nil, cloudstorage.ErrObjectNotFound\n\t}\n\tget := Concat(m.bucket, name)\n\t//gou.DebugCtx(m.clientCtx, \"getting file %s\", get)\n\tf, err := m.client.Stat(get)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newObjectFromFile(m, get, f), nil\n}", "title": "" }, { "docid": "19217c197f7aa1892be3d7a36a330589", "score": "0.55473804", "text": "func (d *DynamoDB) GetBackup(backupID threema.BackupID) (*threema.BackupOutput, error) {\n\tsess := session.Must(session.NewSession())\n\tsvc := dynamodb.New(sess)\n\tinput := d.generateGetItemInput(backupID)\n\tresult, err := svc.GetItem(input)\n\n\tdebug.Printf(\"Input: %+v\", input)\n\tdebug.Printf(\"Result: %+v\", result)\n\tdebug.Printf(\"Error: %+v\", err)\n\n\tif err != nil {\n\t\treturn &threema.BackupOutput{}, &storage.BackendError{APIError: err}\n\t}\n\n\tvar resultItem item\n\n\tif err := dynamodbattribute.UnmarshalMap(result.Item, &resultItem); err != nil {\n\t\treturn &threema.BackupOutput{}, &storage.BackendError{APIError: err}\n\t}\n\n\tif len(resultItem.EncryptedBackup) == 0 {\n\t\treturn &threema.BackupOutput{}, &storage.BackupIDNotFoundError{BackupID: backupID}\n\t}\n\n\treturn &threema.BackupOutput{\n\t\tBackupID: backupID,\n\t\tEncryptedBackup: threema.EncryptedBackup(resultItem.EncryptedBackup),\n\t\tCreationTime: time.Unix(int64(resultItem.CreationTime), 0),\n\t\tExpirationTime: time.Unix(int64(resultItem.ExpirationTime), 0),\n\t}, nil\n}", "title": "" }, { "docid": "bf0b5f5c57c7083689e8ae209f57121e", "score": "0.55312335", "text": "func (c *FakeGaleraBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.GaleraBackup, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(galerabackupsResource, c.ns, name, pt, data, subresources...), &v1beta2.GaleraBackup{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta2.GaleraBackup), err\n}", "title": "" }, { "docid": "54b7c3b3ff2eb2f177fa03ab0ab95e2e", "score": "0.55183595", "text": "func NewBackupGetNotFound() *BackupGetNotFound {\n\n\treturn &BackupGetNotFound{}\n}", "title": "" }, { "docid": "c78405c68d18be3a4c6993dc8bfe1c8f", "score": "0.55093926", "text": "func (c *FakeBackupLocations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BackupLocation, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(backuplocationsResource, c.ns, name), &v1alpha1.BackupLocation{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.BackupLocation), err\n}", "title": "" }, { "docid": "075d594bca293a1186e530c86aeddb0d", "score": "0.5476272", "text": "func (b *BackupPolicy) GetBackupPolicy() *BackupPolicy { return b }", "title": "" }, { "docid": "31e88b444afe0f29633d9d3e348adda1", "score": "0.543385", "text": "func (client LongTermRetentionManagedInstanceBackupsClient) Get(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string) (result ManagedInstanceLongTermRetentionBackup, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/LongTermRetentionManagedInstanceBackupsClient.Get\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetPreparer(ctx, locationName, managedInstanceName, databaseName, backupName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsClient\", \"Get\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsClient\", \"Get\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsClient\", \"Get\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "3b6d331ba839caa4f9efd0a685dcc6b3", "score": "0.53959525", "text": "func (k *k8sOps) GetApplicationBackup(name string, namespace string) (*v1alpha1.ApplicationBackup, error) {\n\tif err := k.initK8sClient(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn k.storkClient.Stork().ApplicationBackups(namespace).Get(name, meta_v1.GetOptions{})\n}", "title": "" }, { "docid": "47a5b02cff0b04d8874c324fc86b41c0", "score": "0.53656864", "text": "func (s *ZipSaveSorage) Get(ctx context.Context, name string) (body []byte, err *mft.Error) {\n\tbody, err = s.storage.Get(ctx, s.Path(name))\n\n\t_, body, err = s.compressor.Restore(ctx, s.alghoritm, body, nil)\n\n\treturn body, err\n}", "title": "" }, { "docid": "ac549ffe111c3c72e7762053bcfe9678", "score": "0.5351621", "text": "func NewBackupGetOK() *BackupGetOK {\n\n\treturn &BackupGetOK{}\n}", "title": "" }, { "docid": "cb3c1c16987843f4406fe0dd62c6cfa3", "score": "0.5335574", "text": "func (c RestClient) SnapshotGetByName(ctx context.Context, volumeUUID, snapshotName string) (*models.Snapshot, error) {\n\tresult, err := c.SnapshotListByName(ctx, volumeUUID, snapshotName)\n\tif result.Payload != nil && result.Payload.NumRecords != nil && *result.Payload.NumRecords == 1 && result.Payload.SnapshotResponseInlineRecords != nil {\n\t\treturn result.Payload.SnapshotResponseInlineRecords[0], nil\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "a4d0c32cd60f7a6e9632e3c56b908613", "score": "0.5299321", "text": "func (c *backupForGKERESTClient) GetBackupPlan(ctx context.Context, req *gkebackuppb.GetBackupPlanRequest, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, 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/%v\", req.GetName())\n\n\tparams := url.Values{}\n\tparams.Add(\"$alt\", \"json;enum-encoding=int\")\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\topts = append((*c.CallOptions).GetBackupPlan[0:len((*c.CallOptions).GetBackupPlan):len((*c.CallOptions).GetBackupPlan)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &gkebackuppb.BackupPlan{}\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 := 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\treturn resp, nil\n}", "title": "" }, { "docid": "fb257c2d84812ae9734c918502a4c03f", "score": "0.5291", "text": "func (h *Handler) GetByName(name string) (*unstructured.Unstructured, error) {\n\tvar err error\n\tif h.gvr, err = utilrestmapper.GVKToGVR(h.restMapper, h.gvk); err != nil {\n\t\treturn nil, err\n\t}\n\tif h.isNamespaced, err = utilrestmapper.IsNamespaced(h.restMapper, h.gvk); err != nil {\n\t\treturn nil, err\n\t}\n\tif h.gvk.Kind == types.KindJob || h.gvk.Kind == types.KindCronJob {\n\t\th.SetPropagationPolicy(\"background\")\n\t}\n\n\tif h.isNamespaced {\n\t\treturn h.dynamicClient.Resource(h.gvr).Namespace(h.namespace).Get(h.ctx, name, h.Options.GetOptions)\n\t}\n\treturn h.dynamicClient.Resource(h.gvr).Get(h.ctx, name, h.Options.GetOptions)\n}", "title": "" }, { "docid": "1d0e00e6979b7fa239ae91d4dcfc052b", "score": "0.52709675", "text": "func (c *Client) GetBackupDetail(instanceId string, backupId string) (*Snapshot, error) {\n\tresult := &Snapshot{}\n\terr := bce.NewRequestBuilder(c).\n\t\tWithMethod(http.GET).\n\t\tWithURL(getRdsUriWithInstanceId(instanceId) + \"/backup/\" + backupId).\n\t\tWithResult(result).\n\t\tDo()\n\n\treturn result, err\n}", "title": "" }, { "docid": "9f983b761d2e61b88a96e30b9f4e6a79", "score": "0.5266511", "text": "func (b *Buffer) Get(name string) (*Bucket, error) {\n\tb.Lock()\n\tdefer b.Unlock()\n\n\tif bucket, ok := b.buckets[name]; ok {\n\t\treturn bucket, nil\n\t}\n\n\tbucket := NewBucket(BucketOptions{\n\t\tPath: filepath.Join(b.root, name),\n\t\tFs: b.fs,\n\t})\n\tif err := bucket.Open(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tb.buckets[name] = bucket\n\treturn bucket, nil\n}", "title": "" }, { "docid": "a4a28297ed311be358d4e9829b424062", "score": "0.5264732", "text": "func (p *GcsStorageProvider) Retrieve(key string) (io.ReadCloser, *int64, error) {\n\tlog.Printf(\"Retrieving backup (provider=\\\"Gcs\\\", bucket=%q, key=%q)\", p.spec.Bucket, key)\n\tr, err := p.bucketHandle.GetReadCloser(key)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"error1 retrieving backup (provider='GCS', bucket='%s', key='%s')\", p.spec.Bucket, key)\n\t}\n\n\tattrs, err := p.bucketHandle.GetAttrs(key)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"error2 retrieving backup (provider='GCS', bucket='%s', key='%s')\", p.spec.Bucket, key)\n\t}\n\n\treturn r, &attrs.Size, nil\n}", "title": "" }, { "docid": "4df8625c350f94bdbd902e5eb6acd861", "score": "0.5258145", "text": "func (l *L7s) Get(name string) (*L7, error) {\n\tname = l.namer.LoadBalancer(name)\n\tlb, exists := l.snapshotter.Get(name)\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"loadbalancer %v not in pool\", name)\n\t}\n\treturn lb.(*L7), nil\n}", "title": "" }, { "docid": "f7ea9f776a74f2ab1c50bf38faa0879d", "score": "0.52264553", "text": "func (provider *ContainerStorageProvider) GetSnapshotByName(name string, volumeID string) (*model.Snapshot, error) {\n\n\t// Get all snapshots for the given snapshot name and source volume ID\n\tresponse := make([]*model.Snapshot, 0)\n\tvar errorResponse *ErrorsPayload\n\n\tstatus, err := provider.invoke(\n\t\t&connectivity.Request{\n\t\t\tAction: \"GET\",\n\t\t\tPath: fmt.Sprintf(\"/containers/v1/snapshots?name=%s&volume_id=%s\", name, volumeID),\n\t\t\tPayload: nil,\n\t\t\tResponse: &response,\n\t\t\tResponseError: &errorResponse,\n\t\t},\n\t)\n\n\tif status == http.StatusNotFound {\n\t\treturn nil, nil\n\t}\n\n\tif errorResponse != nil {\n\t\treturn nil, handleError(status, errorResponse)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// There should only be one snapshot\n\tvalues := reflect.ValueOf(response)\n\tif values.Len() == 0 {\n\t\tlog.Errorf(\"Could not find snapshot %s in json response\", name)\n\t\treturn nil, fmt.Errorf(\"Could not find snapshot named %s in json response\", name)\n\t}\n\tlog.Tracef(\"Found %d snapshots\", values.Len())\n\n\tsnapshot := &model.Snapshot{}\n\terr = jsonutil.Decode(values.Index(0).Interface(), snapshot)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error while decoding the snapshot response, err: %s\", err.Error())\n\t}\n\treturn snapshot, nil\n}", "title": "" }, { "docid": "eeeaef218388ed4355fe30943838ccba", "score": "0.52199733", "text": "func (c *Client) GetResourceBackup(name, namespace string) (*kdmpv1alpha1.ResourceBackup, error) {\n\tif err := c.initClient(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.kdmp.KdmpV1alpha1().ResourceBackups(namespace).Get(context.TODO(), name, metav1.GetOptions{})\n}", "title": "" }, { "docid": "78d9e688cf43e801de0a5b29ad95fa6b", "score": "0.5216023", "text": "func getFlavor(deployment string, name string) (models.Flavor, error) {\n\tvar flavor models.Flavor\n\tbucket := DB.From(deployment)\n\tlog.WithFields(log.Fields{\n\t\t\"deployment\": deployment,\n\t}).Info(\"Fetching Inventory Flavor for the deployment\")\n\terr := bucket.One(\"Name\", name, &flavor)\n\tif err != nil {\n\t\tif err == storm.ErrNotFound {\n\t\t\treturn flavor, err\n\t\t}\n\t\tlog.Error(err)\n\t}\n\treturn flavor, nil\n}", "title": "" }, { "docid": "d29e83c72841b6ab974d7af456231c7c", "score": "0.5215571", "text": "func (s *StorageTypes) Get(name string) Storage {\n\treturn (*s)[name]\n}", "title": "" }, { "docid": "efd4db8afbe2a8181573654bfd3deffa", "score": "0.5206312", "text": "func (s *VolumeStore) Get(name string) (volume.Volume, error) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tvc, exists := s.vols[name]\n\tif !exists {\n\t\treturn nil, ErrNoSuchVolume\n\t}\n\treturn vc.Volume, nil\n}", "title": "" }, { "docid": "ce5982ff9970ce16df19bfb8a9d01e76", "score": "0.52037853", "text": "func GetBackupInfo(client *clientv3.Client, pdAddr string) (*BackupInfo, error) {\n\tbackInfo := &BackupInfo{}\n\tresp, err := etcdutil.EtcdKVGet(client, pdClusterIDPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclusterID, err := typeutil.BytesToUint64(resp.Kvs[0].Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbackInfo.ClusterID = clusterID\n\n\trootPath := path.Join(pdRootPath, strconv.FormatUint(clusterID, 10))\n\tallocIDPath := path.Join(rootPath, \"alloc_id\")\n\tresp, err = etcdutil.EtcdKVGet(client, allocIDPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar allocIDMax uint64 = 0\n\tif resp.Count > 0 {\n\t\tallocIDMax, err = typeutil.BytesToUint64(resp.Kvs[0].Value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tbackInfo.AllocIDMax = allocIDMax\n\n\tresp, err = etcdutil.EtcdKVGet(client, endpoint.TimestampPath(rootPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tallocTimestampMax, err := typeutil.BytesToUint64(resp.Kvs[0].Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbackInfo.AllocTimestampMax = allocTimestampMax\n\n\tbackInfo.Config, err = getConfig(pdAddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn backInfo, nil\n}", "title": "" }, { "docid": "75db8906b07f544e8dfe4da68131d2d8", "score": "0.51953894", "text": "func Get(name string) (Driver, error) {\n\td, ok := storageDrivers[name]\n\tif ok {\n\t\treturn d, nil\n\t}\n\treturn nil, &errors.ErrNotFound{\n\t\tID: name,\n\t\tType: \"StorageDriver\",\n\t}\n}", "title": "" }, { "docid": "61375c8f953c06f95e5f33fc04e781f0", "score": "0.5194596", "text": "func GetDataBackup(client client.Client, name, namespace string) (*datav1alpha1.DataBackup, error) {\n\tkey := types.NamespacedName{\n\t\tNamespace: namespace,\n\t\tName: name,\n\t}\n\tvar databackup datav1alpha1.DataBackup\n\tif err := client.Get(context.TODO(), key, &databackup); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &databackup, nil\n}", "title": "" }, { "docid": "61375c8f953c06f95e5f33fc04e781f0", "score": "0.5194596", "text": "func GetDataBackup(client client.Client, name, namespace string) (*datav1alpha1.DataBackup, error) {\n\tkey := types.NamespacedName{\n\t\tNamespace: namespace,\n\t\tName: name,\n\t}\n\tvar databackup datav1alpha1.DataBackup\n\tif err := client.Get(context.TODO(), key, &databackup); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &databackup, nil\n}", "title": "" }, { "docid": "565d69d6921849d70a1a8fcf76de055c", "score": "0.51466125", "text": "func (k *k8sOps) GetBackupLocation(name string, namespace string) (*v1alpha1.BackupLocation, error) {\n\tif err := k.initK8sClient(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tbackupLocation, err := k.storkClient.Stork().BackupLocations(namespace).Get(name, meta_v1.GetOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = backupLocation.UpdateFromSecret(k.client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn backupLocation, nil\n}", "title": "" }, { "docid": "e432b9c6702b62130f1d3ecc48815c79", "score": "0.5146117", "text": "func Get(name string) (snapshots.Driver, error) {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\n\tdriver, ok := driversMap[name]\n\tif !ok || driver == nil {\n\t\treturn nil, fmt.Errorf(\"%q driver: not found\", name)\n\t}\n\n\treturn driver, nil\n}", "title": "" }, { "docid": "e27e5520eb300927e3d2eab2be135903", "score": "0.51455766", "text": "func (c *BackupForGKEClient) GetVolumeBackup(ctx context.Context, req *gkebackuppb.GetVolumeBackupRequest, opts ...gax.CallOption) (*gkebackuppb.VolumeBackup, error) {\n\treturn c.internalClient.GetVolumeBackup(ctx, req, opts...)\n}", "title": "" }, { "docid": "4c0ae05827f41e20cde2d7cf34a448ca", "score": "0.51195306", "text": "func Get(name string) (Backend, error) {\n\tfactory, ok := backends[name]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown backend: %q.\", name)\n\t}\n\tr, err := factory()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "6cd2bfb2a6a4c29c586fa21af2858e75", "score": "0.50884974", "text": "func GetLatestBackup(backupsToBeRetained []*Backup, vol *Volume) error {\n\tvar lastBackupName string\n\tvar lastBackupAt string\n\n\tfor _, backup := range backupsToBeRetained {\n\t\tif lastBackupName == \"\" || lastBackupAt == \"\" {\n\t\t\tlastBackupName = backup.Name\n\t\t\tlastBackupAt = backup.SnapshotCreatedAt\n\t\t}\n\n\t\tbackupTime, err := time.Parse(time.RFC3339, backup.SnapshotCreatedAt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Cannot parse backup %v time %v due to %v\", backup.Name, backup.SnapshotCreatedAt, err)\n\t\t}\n\n\t\tlastBackupTime, err := time.Parse(time.RFC3339, lastBackupAt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Cannot parse last backup %v time %v due to %v\", lastBackupName, lastBackupAt, err)\n\t\t}\n\n\t\tif backupTime.After(lastBackupTime) {\n\t\t\tlastBackupName = backup.Name\n\t\t\tlastBackupAt = backup.SnapshotCreatedAt\n\t\t}\n\t}\n\n\tvol.LastBackupName = lastBackupName\n\tvol.LastBackupAt = lastBackupAt\n\n\treturn nil\n}", "title": "" }, { "docid": "2b1ba51b7c557dd7c5e0623c6ace3aa3", "score": "0.5081143", "text": "func (a *Client) GetVpsServiceNameVeeamRestoredBackup(params *GetVpsServiceNameVeeamRestoredBackupParams, authInfo runtime.ClientAuthInfoWriter) (*GetVpsServiceNameVeeamRestoredBackupOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetVpsServiceNameVeeamRestoredBackupParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetVpsServiceNameVeeamRestoredBackup\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/vps/{serviceName}/veeam/restoredBackup\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetVpsServiceNameVeeamRestoredBackupReader{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.(*GetVpsServiceNameVeeamRestoredBackupOK), nil\n\n}", "title": "" }, { "docid": "8be9fa455a6a0dd4088abccfa2567aba", "score": "0.5067957", "text": "func GetBackupProvider(backupType virtuslabv1alpha1.JenkinsBackup) (Provider, error) {\n\tswitch backupType {\n\tcase virtuslabv1alpha1.JenkinsBackupTypeNoBackup:\n\t\treturn &nobackup.NoBackup{}, nil\n\tcase virtuslabv1alpha1.JenkinsBackupTypeAmazonS3:\n\t\treturn &aws.AmazonS3Backup{}, nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"Invalid BackupManager type '%s'\", backupType)\n\t}\n}", "title": "" }, { "docid": "7c09ba8e2994b93558ba93d9d3223488", "score": "0.50533265", "text": "func getInstance(deployment string, hostname string) (models.Instance, error) {\n\tvar instance models.Instance\n\tbucket := DB.From(deployment)\n\tlog.WithFields(log.Fields{\n\t\t\"deployment\": deployment,\n\t\t\"instance\": hostname,\n\t}).Info(\"Fetching inventory Instance for the deployment\")\n\n\terr := bucket.One(\"Name\", hostname, &instance)\n\tif err != nil {\n\t\tif err == storm.ErrNotFound {\n\t\t\treturn instance, err\n\t\t}\n\t\tlog.Error(err)\n\t}\n\treturn instance, nil\n}", "title": "" }, { "docid": "00d132242b1b6ecc689fca8d629d0e28", "score": "0.50321585", "text": "func (s *Storage) Get(t settings.AuthMethod) (Auther, error) {\n\treturn s.back.Get(t)\n}", "title": "" }, { "docid": "626eb7bafe14fa72213bb02d77626017", "score": "0.5014735", "text": "func GetBackupName(ns, sourceVersion, targetVersion string) string {\n\treturn fmt.Sprintf(\"%s-%s-%s-upgrade\", ns,\n\t\tstrings.Replace(sourceVersion, \".\", \"\", -1),\n\t\tstrings.Replace(targetVersion, \".\", \"\", -1),\n\t)\n}", "title": "" }, { "docid": "8e0a4de84d1371bab3ec7211d1a90f20", "score": "0.49992803", "text": "func (s *ServerConnection) ConfigurationBackupGet() (*ConfigurationBackupConfig, error) {\n\tdata, err := s.CallRaw(\"ConfigurationBackup.get\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig := struct {\n\t\tResult struct {\n\t\t\tConfig ConfigurationBackupConfig `json:\"config\"`\n\t\t} `json:\"result\"`\n\t}{}\n\terr = json.Unmarshal(data, &config)\n\treturn &config.Result.Config, err\n}", "title": "" }, { "docid": "e6198f470451dcb5fabbb399628012aa", "score": "0.499352", "text": "func (r *REST) Get(ctx kapi.Context, name string) (runtime.Object, error) {\n\treturn r.store.Get(ctx, name)\n}", "title": "" }, { "docid": "aabc131421ae47c1c10b73f4008be303", "score": "0.4970402", "text": "func Get(name string) (Manager, bool) {\n\tv, ok := plugins.GetPlugin(plugins.StorageManagerPlugin, strings.ToLower(name))\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn v.(*managerPlugin).instance, true\n}", "title": "" }, { "docid": "ead5630abf4471d38f6c9ca1858d7f02", "score": "0.4933924", "text": "func (h *Handler) GetByName(name string) (*appsv1.ReplicaSet, error) {\n\treturn h.clientset.AppsV1().ReplicaSets(h.namespace).Get(h.ctx, name, h.Options.GetOptions)\n}", "title": "" }, { "docid": "83664d6ad06e85db2fc7ef6dea824119", "score": "0.4929773", "text": "func (r Registry) GetByName(name string) (Account, error) {\n\tinfo, err := r.kr.Key(name)\n\tif errors.Is(err, dkeyring.ErrKeyNotFound) || errors.Is(err, sdkerrors.ErrKeyNotFound) {\n\t\treturn Account{}, &AccountDoesNotExistError{name}\n\t}\n\tif err != nil {\n\t\treturn Account{}, nil\n\t}\n\n\tacc := Account{\n\t\tName: name,\n\t\tInfo: info,\n\t}\n\n\treturn acc, nil\n}", "title": "" }, { "docid": "e3c6259d9320c89b7443694c04cfd0e9", "score": "0.49252567", "text": "func (j *Job) Get(name string) ([]byte, error) {\n\treturn ioutil.ReadFile(path.Join(j.dir, name))\n}", "title": "" }, { "docid": "b4d3679569f7ce27241b56e37f6025c6", "score": "0.49140996", "text": "func (client LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string) (result ManagedInstanceLongTermRetentionBackup, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response.Response != nil {\n\t\t\t\tsc = result.Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\treq, err := client.GetByResourceGroupPreparer(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsClient\", \"GetByResourceGroup\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetByResourceGroupSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsClient\", \"GetByResourceGroup\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetByResourceGroupResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"sql.LongTermRetentionManagedInstanceBackupsClient\", \"GetByResourceGroup\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "15aceb67f34d7af7d7d40f6c7f2a8ae1", "score": "0.49130604", "text": "func (b *PrefixedBucketClient) Get(ctx context.Context, name string) (io.ReadCloser, error) {\n\treturn b.bucket.Get(ctx, b.fullName(name))\n}", "title": "" }, { "docid": "b3d25702ae8f87aa8108ca0ab071da33", "score": "0.49019128", "text": "func Get(name string) ImportBackend {\n\treturn importBackends[name]\n}", "title": "" }, { "docid": "896fe5280647434e252ac17497bb2bcb", "score": "0.49009836", "text": "func (op *CreateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*adminpb.Backup, error) {\n\tvar resp adminpb.Backup\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": "683e36f73d5312c24784c1df5afbc6ce", "score": "0.48987898", "text": "func (client *JobEntryClient) GetByName(name string) (*models.JobEntry, error) {\n\tvar obj *models.JobEntry\n\terr := client.aviSession.GetObjectByName(\"jobentry\", name, &obj)\n\treturn obj, err\n}", "title": "" }, { "docid": "d456cddbe38eb54a42c866ab1faa4095", "score": "0.4875127", "text": "func (c *FakeGaleraBackups) Delete(name string, options *v1.DeleteOptions) error {\n\t_, err := c.Fake.\n\t\tInvokes(testing.NewDeleteAction(galerabackupsResource, c.ns, name), &v1beta2.GaleraBackup{})\n\n\treturn err\n}", "title": "" }, { "docid": "f83859609e354df0e5034ef25a140cc7", "score": "0.48748362", "text": "func (km *Krab) Get(name string) (ci.PrivKey, error) {\n\tif err := validateName(name); err != nil {\n\t\treturn nil, err\n\t}\n\tif has, err := km.Has(name); err != nil {\n\t\treturn nil, err\n\t} else if !has {\n\t\treturn nil, errors.New(ErrNoSuchKey)\n\t}\n\tencryptedPKBytes, err := km.ds.Get(ds.NewKey(name))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treader := bytes.NewReader(encryptedPKBytes)\n\tpkBytes, err := km.em.Decrypt(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ci.UnmarshalPrivateKey(pkBytes)\n}", "title": "" }, { "docid": "5eff0376ee4ce6a7a391951849392203", "score": "0.48637265", "text": "func GetDriver(name string) Driver {\n\tgmba.mutex.Lock()\n\tdefer gmba.mutex.Unlock()\n\n\treturn gmba.drivers[name]\n}", "title": "" }, { "docid": "1f3ea3a5466f5fbd5c76b3b4207ac36b", "score": "0.48601782", "text": "func (store *BoltStorage) Get(imageName string) (*Image, error) {\n\tvar image *Image\n\terr := store.db.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(ImageBucket))\n\t\tc := b.Cursor()\n\t\tprefix := []byte(imageName)\n\t\tfor k, v := c.Seek(prefix); k != nil && bytes.HasPrefix(k, prefix); k, v = c.Next() {\n\t\t\timage = store.extractImage(v, k)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn &Image{}, errors.Wrapf(err, \"Failed to get images for %q from bolt db\", imageName)\n\t}\n\treturn image, nil\n}", "title": "" }, { "docid": "6342b6d68a93e66477038b5625931eba", "score": "0.48536798", "text": "func (q *limitedSizeLocal) Get(ctx context.Context, name string) (amboy.Job, bool) {\n\tq.mu.RLock()\n\tdefer q.mu.RUnlock()\n\n\tj, ok := q.storage[name]\n\n\treturn j, ok\n}", "title": "" }, { "docid": "88870dc117c462a3a2959cbfd17f6d95", "score": "0.4852676", "text": "func (c *FakeBases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Base, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(basesResource, c.ns, name), &v1alpha1.Base{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.Base), err\n}", "title": "" }, { "docid": "17af9c3152e97ee1f07f94adb97c8d1c", "score": "0.484949", "text": "func (l *Limiter) Get(id []byte) (b *Bucket, err error) {\n\treturn GetBucket(l.db, id)\n}", "title": "" }, { "docid": "05247395b80d465a06239d98e69368c9", "score": "0.48447677", "text": "func Get(name string) *Database {\n\treturn dbpool.GetDatabase(name)\n}", "title": "" }, { "docid": "46fa3466f0e4762243ee72f8927b00c6", "score": "0.48217422", "text": "func (op *CreateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Backup, error) {\n\topts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)\n\tvar resp gkebackuppb.Backup\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": "99c259c49a41fc5a554527c5f591ecf9", "score": "0.48211834", "text": "func (client LongTermRetentionManagedInstanceBackupsClient) GetSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, azure.DoRetryWithRegistration(client.Client))\n}", "title": "" }, { "docid": "c6f1190686111218625fe4f19c8edcff", "score": "0.48118442", "text": "func (c *BackupForGKEClient) GetBackupPlan(ctx context.Context, req *gkebackuppb.GetBackupPlanRequest, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error) {\n\treturn c.internalClient.GetBackupPlan(ctx, req, opts...)\n}", "title": "" }, { "docid": "15f6f01f0b4dc28266fd732e9159088e", "score": "0.480395", "text": "func parseBackupName(backupPath string) (time.Time, string, error) {\n\tvar err error\n\tvar createdAt time.Time\n\tvar backupType string\n\n\tfileName := path.Base(backupPath)\n\tpieces := strings.Split(fileName, \".\")\n\n\tif len(pieces) != 3 {\n\t\terr = errors.New(\"Incorrect format for filename: \" + fileName)\n\t} else if !strings.HasPrefix(pieces[0], \"mysql-backup-\") {\n\t\terr = errors.New(\"Incorrect prefix for filename: \" + fileName)\n\t}\n\n\tif err == nil {\n\t\ttimestampString := strings.Replace(pieces[0], \"mysql-backup-\", \"\", 1)\n\t\tcreatedAt, err = parseBackupTimestamp(timestampString)\n\t}\n\n\tif err == nil {\n\t\tbackupTypePiece := pieces[1]\n\t\tif backupTypePiece != backupTypeFull && backupTypePiece != backupTypeIncremental {\n\t\t\terr = errors.New(\"Incorrect backup type: \" + backupTypePiece)\n\t\t} else {\n\t\t\tbackupType = backupTypePiece\n\t\t}\n\t}\n\n\treturn createdAt, backupType, err\n}", "title": "" }, { "docid": "2c1e93f391df4045c3a193a80c2ad7ba", "score": "0.4802872", "text": "func (m *AttachmentBase) GetName()(*string) {\n val, err := m.GetBackingStore().Get(\"name\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "73cabf0e9ba5b4a127012e3de6927df2", "score": "0.47786948", "text": "func GetPlugin(name string) Plugin {\n\treturn plugins[name]\n}", "title": "" }, { "docid": "616264cf4914f40e12e946d19a5ad752", "score": "0.477426", "text": "func GetBackend(name string, h *Host) HostBackend {\n\tb, _ := backends[name]\n\tif b == nil {\n\t\treturn nil\n\t}\n\n\treturn b(h)\n}", "title": "" }, { "docid": "19073adad4329cd31c31611566c3890d", "score": "0.4770404", "text": "func (i InMemoryVolumeDatabase) Get(volumeName string) (*volume.Volume, error) {\n\tvol, exists := i.volumes[volumeName]\n\tif !exists {\n\t\treturn nil, errors.New(\"volume does not exist\")\n\t}\n\n\treturn vol, nil\n}", "title": "" }, { "docid": "0f6efcbd03617382a697827e488821ee", "score": "0.47677717", "text": "func (r *PrefixedRegistry) Get(name string) interface{} {\n\trealName := r.prefix + name\n\treturn r.underlying.Get(realName)\n}", "title": "" }, { "docid": "1693a58bfa3bfbce7c194bab12d461fd", "score": "0.47574586", "text": "func (wb *Wbzr) Get(name string) (engine.Script, error) {\n\tfor _, sc := range wb.Scripts {\n\t\tif sc.GetName() == name {\n\t\t\treturn sc, nil\n\t\t}\n\t}\n\treturn nil, ErrUniqueName\n}", "title": "" }, { "docid": "805d03d76559152ead597eef3f4e5c18", "score": "0.47556219", "text": "func (node *Node) GetBackupKey(ctx context.Context, key *gmajpb.Key) (*gmajpb.Val, error) {\n\tfmt.Printf(\"Received get request for key: %s from backup\\n\", key.Key)\n\tval, err := node.getBackupKey(key.Key)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &gmajpb.Val{Val: val}, nil\n}", "title": "" }, { "docid": "fa9264334e21c614152989ffa45f30ce", "score": "0.47378418", "text": "func (a *Client) GetVpsServiceNameAutomatedBackup(params *GetVpsServiceNameAutomatedBackupParams, authInfo runtime.ClientAuthInfoWriter) (*GetVpsServiceNameAutomatedBackupOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetVpsServiceNameAutomatedBackupParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetVpsServiceNameAutomatedBackup\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/vps/{serviceName}/automatedBackup\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &GetVpsServiceNameAutomatedBackupReader{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.(*GetVpsServiceNameAutomatedBackupOK), nil\n\n}", "title": "" }, { "docid": "3fd58d48d8f5249a6f1fee389630fa26", "score": "0.47363707", "text": "func (r *REST) Get(ctx genericapirequest.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {\n\treturn r.store.Get(ctx, name, options)\n}", "title": "" }, { "docid": "91e92fd5c0e8f3a1e72676522d3600e1", "score": "0.47292608", "text": "func (bk *Backup) GetInstanceName() string {\n\tif bk.Labels != nil {\n\t\tif v, ok := bk.Labels[label.InstanceLabelKey]; ok {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn bk.Name\n}", "title": "" }, { "docid": "c6abf324f378a80074c6a808b9265d31", "score": "0.47282794", "text": "func NewBackup(ctx *pulumi.Context,\n\tname string, args *BackupArgs, opts ...pulumi.ResourceOption) (*Backup, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.BackupId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'BackupId'\")\n\t}\n\tif args.ClusterName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ClusterName'\")\n\t}\n\tif args.Location == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Location'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Backup\n\terr := ctx.RegisterResource(\"gcp:alloydb/backup:Backup\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "d1b3d86196189c4302d676a7f909946a", "score": "0.47261214", "text": "func (b *BackendMgr) Get(addr string) (Backend, error) {\n\tb.Lock()\n\tdefer b.Unlock()\n\n\tindex, err := b.getIndex(addr)\n\tif err == nil {\n\t\treturn b.backends[index], nil\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "d7df0b8e04ec5236f7df42715337b3f0", "score": "0.47174048", "text": "func GetInstance(ctx context.Context, tx *sql.Tx, project string, name string) (*Instance, error) {\n\tfilter := InstanceFilter{}\n\tfilter.Project = &project\n\tfilter.Name = &name\n\n\tobjects, err := GetInstances(ctx, tx, filter)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to fetch from \\\"instances\\\" table: %w\", err)\n\t}\n\n\tswitch len(objects) {\n\tcase 0:\n\t\treturn nil, api.StatusErrorf(http.StatusNotFound, \"Instance not found\")\n\tcase 1:\n\t\treturn &objects[0], nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"More than one \\\"instances\\\" entry matches\")\n\t}\n}", "title": "" }, { "docid": "caa95cbd56d3b2b97621a3a4d1c534f8", "score": "0.47111836", "text": "func (r *Registry) getGauge(name string) *Gauge {\n\tr.Lock()\n\tdefer r.Unlock()\n\titerable := r.findMetricByName(name)\n\tif iterable == nil {\n\t\treturn nil\n\t}\n\tgauge, ok := iterable.(*Gauge)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn gauge\n}", "title": "" }, { "docid": "4077bc78725174c21c85030147b33820", "score": "0.46981883", "text": "func (d *ESeriesStorageDriver) Get(name string) error {\n\terr := d.Storage.VerifyVolumeExists(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to verify existence of volume %v: %v\", name, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "105c90d64c8bd98e4654a76881753ca5", "score": "0.46947682", "text": "func GetResource(name string) *Microgateway {\n\tresourcesMutex.RLock()\n\tdefer resourcesMutex.RUnlock()\n\treturn resources[name]\n\n}", "title": "" }, { "docid": "b233246f22f31d5ddd9f9ca1696cbd93", "score": "0.46936202", "text": "func (it *VolumeBackupIterator) Next() (*gkebackuppb.VolumeBackup, error) {\n\tvar item *gkebackuppb.VolumeBackup\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": "46c81c03bbbcc15b4bf2d564436b06c4", "score": "0.46920985", "text": "func (ac *AdminClient) BackupInfo(ctx context.Context, cluster, backup string) (*BackupInfo, error) {\n\tctx = mergeOutgoingMetadata(ctx, ac.md)\n\tbackupPath := ac.backupPath(cluster, ac.instance, backup)\n\n\treq := &btapb.GetBackupRequest{\n\t\tName: backupPath,\n\t}\n\n\tvar resp *btapb.Backup\n\terr := gax.Invoke(ctx, func(ctx context.Context, _ gax.CallSettings) error {\n\t\tvar err error\n\t\tresp, err = ac.tClient.GetBackup(ctx, req)\n\t\treturn err\n\t}, retryOptions...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newBackupInfo(resp)\n}", "title": "" }, { "docid": "6f04dd1531490a61bca44ccef3596c9d", "score": "0.46879277", "text": "func GetImagebyName(name string) Image {\n\timage := Image{Name: name}\n\tdb := storage.GetDefaultDB()\n\terr := db.FetchOne(&image)\n\tutilities.CheckError(err, \"Cannot fetch image object with name \"+name)\n\treturn image\n}", "title": "" }, { "docid": "1ea0cb3a364be38371ea859a732c8bb5", "score": "0.4685954", "text": "func NewBackupName() string {\n\treturn time.Now().UTC().Format(BackupTimeFormat)\n}", "title": "" }, { "docid": "38d7158d8f99f8001c16b79d3d6a452e", "score": "0.4681759", "text": "func (c *FakeGaleraBackups) Update(galeraBackup *v1beta2.GaleraBackup) (result *v1beta2.GaleraBackup, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewUpdateAction(galerabackupsResource, c.ns, galeraBackup), &v1beta2.GaleraBackup{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta2.GaleraBackup), err\n}", "title": "" }, { "docid": "eeb628d443220a2f96ccbb29c996f54b", "score": "0.4678196", "text": "func (s *Multi) Get(gvk schema.GroupVersionKind, namespace, name string) (obj runtime.Object, exists bool, e error) {\n\tinformer := s.GetInformers()[gvk]\n\tif informer == nil {\n\t\treturn nil, false, fmt.Errorf(\"no informer for %v is registered\", gvk)\n\t}\n\treturn s.getFromIndexer(informer.GetIndexer(), gvk, namespace, name)\n}", "title": "" }, { "docid": "111b8ba973c465de9eeb7460197b1911", "score": "0.4678057", "text": "func (o *AutoBackupOp) Read(ctx context.Context, zone string, id types.ID) (*sacloud.AutoBackup, error) {\n\tvalue := getAutoBackupByID(zone, id)\n\tif value == nil {\n\t\treturn nil, newErrorNotFound(o.key, id)\n\t}\n\tdest := &sacloud.AutoBackup{}\n\tcopySameNameField(value, dest)\n\treturn dest, nil\n}", "title": "" }, { "docid": "6a288ef9f14d5182e185548cc3b84dd0", "score": "0.46717215", "text": "func (p *PostgreSQLProvider) GetBackupDir() string {\n\treturn \"backups\"\n}", "title": "" }, { "docid": "0f1be9140cad8ab99700e76f16f09f91", "score": "0.46528137", "text": "func (ip *instancesProvider) get(name string) *compute.Instance {\n\tip.mu.RLock()\n\tdefer ip.mu.RUnlock()\n\treturn ip.cache[name]\n}", "title": "" }, { "docid": "68962ecfe1707e86db2cc0956be68ff2", "score": "0.46512666", "text": "func (c *FakePostgresDatabases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PostgresDatabase, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewGetAction(postgresdatabasesResource, c.ns, name), &v1alpha1.PostgresDatabase{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.PostgresDatabase), err\n}", "title": "" } ]
5e625aeec16139b69b1850adedcc3b41
ExportDataKey invokes the kms.ExportDataKey API synchronously
[ { "docid": "a405c32dd32becfeda5f4974db738c58", "score": "0.758213", "text": "func (client *Client) ExportDataKey(request *ExportDataKeyRequest) (response *ExportDataKeyResponse, err error) {\n\tresponse = CreateExportDataKeyResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" } ]
[ { "docid": "1071fc9fc98f20bbba6f74b3cc69b353", "score": "0.69459355", "text": "func (client *Client) ExportDataKeyWithCallback(request *ExportDataKeyRequest, callback func(response *ExportDataKeyResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *ExportDataKeyResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.ExportDataKey(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": "84e21f21b97af9685a75c45c89bf8bc1", "score": "0.68505514", "text": "func (service *AvaxAPI) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error {\n\tlog.Info(\"EVM: ExportKey called\")\n\n\taddress, err := ParseEthAddress(args.Address)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't parse %s to address: %s\", args.Address, err)\n\t}\n\n\tdb, err := service.vm.ctx.Keystore.GetDatabase(args.Username, args.Password)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"problem retrieving user '%s': %w\", args.Username, err)\n\t}\n\tdefer db.Close()\n\n\tuser := user{\n\t\tsecpFactory: &service.vm.secpFactory,\n\t\tdb: db,\n\t}\n\tsk, err := user.getKey(address)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"problem retrieving private key: %w\", err)\n\t}\n\tencodedKey, err := formatting.Encode(formatting.CB58, sk.Bytes())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"problem encoding bytes as cb58: %w\", err)\n\t}\n\treply.PrivateKey = constants.SecretKeyPrefix + encodedKey\n\treply.PrivateKeyHex = hexutil.Encode(sk.Bytes())\n\treturn nil\n}", "title": "" }, { "docid": "c51d18cf54c7a154bdff228f7efd398c", "score": "0.6771063", "text": "func (service *Service) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error {\n\tservice.vm.SnowmanVM.Ctx.Log.Info(\"Platform: ExportKey called\")\n\tdb, err := service.vm.SnowmanVM.Ctx.Keystore.GetDatabase(args.Username, args.Password)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"problem retrieving user '%s': %w\", args.Username, err)\n\t}\n\tuser := user{db: db}\n\tif address, err := service.vm.ParseLocalAddress(args.Address); err != nil {\n\t\treturn fmt.Errorf(\"couldn't parse %s to address: %s\", args.Address, err)\n\t} else if sk, err := user.getKey(address); err != nil {\n\t\treturn fmt.Errorf(\"problem retrieving private key: %w\", err)\n\t} else {\n\t\treply.PrivateKey = constants.SecretKeyPrefix + formatting.CB58{Bytes: sk.Bytes()}.String()\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "ca6bd5b7c73c7ba4a039bc4bc937a936", "score": "0.6690001", "text": "func (api PChainApi) ExportKey(username string, password string, address string) (string, error) {\n\tparams := map[string]interface{}{\n\t\t\"username\" : username,\n\t\t\"password\": password,\n\t\t\"address\": address,\n\t}\n\tresponseBodyBytes, err := api.rpcRequester.makeRpcRequest(pchainEndpoint, \"platform.exportKey\", params)\n\n\tif err != nil {\n\t\treturn \"\", stacktrace.Propagate(err, \"Error making request\")\n\t}\n\n\tvar response ExportKeyResponse\n\tif err := json.Unmarshal(responseBodyBytes, &response); err != nil {\n\t\treturn \"\", stacktrace.Propagate(err, \"Error unmarshalling JSON response\")\n\t}\n\treturn response.Result.PrivateKey, nil\n}", "title": "" }, { "docid": "0c7c86d42e5b3403a5abe1bd9da31afe", "score": "0.652932", "text": "func (c *Client) ExportKey(user api.UserPass, address string) (string, error) {\n\tres := &platformvm.ExportKeyReply{}\n\terr := c.requester.SendRequest(\"exportKey\", &platformvm.ExportKeyArgs{\n\t\tUserPass: user,\n\t\tAddress: address,\n\t}, res)\n\treturn res.PrivateKey, err\n}", "title": "" }, { "docid": "0b6f7b3afd1f0e236fe82b019528f7e3", "score": "0.6372941", "text": "func (s *KeyMemoryStore) ExportKey(name string) ([]byte, error) {\n\tkeyBytes, _, err := getRawKey(s, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn keyBytes, nil\n}", "title": "" }, { "docid": "f8e1937bd13d42bdf7243587cc59c51d", "score": "0.6344542", "text": "func Export(password []byte) ([]byte, error) {\n\tslice := sendSlice(password)\n\terrmsg := C.Buffer{}\n\tres, err := C.export_key(slice, &errmsg)\n\tif err != nil {\n\t\treturn nil, errorWithMessage(err, errmsg)\n\t}\n\treturn receiveSlice(res), nil\n}", "title": "" }, { "docid": "3936282bab409f0e903d0f7098288ee8", "score": "0.6329862", "text": "func (s *KeyFileStore) ExportKey(name string) ([]byte, error) {\n\tkeyBytes, _, err := getRawKey(s, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn keyBytes, nil\n}", "title": "" }, { "docid": "f0981df8308e927e08f2287d98db99c9", "score": "0.62700576", "text": "func (client *Client) ExportDataKeyWithChan(request *ExportDataKeyRequest) (<-chan *ExportDataKeyResponse, <-chan error) {\n\tresponseChan := make(chan *ExportDataKeyResponse, 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.ExportDataKey(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": "b5fb1c45619ae5a0c78f65799cc07b46", "score": "0.6164729", "text": "func (w *Wallet) ExportKey(name string) (key keypair.EncryptedSeed, err error) {\n\terr = w.store.Get(seedKey(name), &key)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn key, nil\n}", "title": "" }, { "docid": "e669a02c50672a3cb4f1e5cf458785ec", "score": "0.61511594", "text": "func exportPrivatekey(cmd *cobra.Command, args []string) {\n\tksf := viper.GetString(exportKeystore)\n\tprivateKey := decryptPrivatekey(ksf)\n\n\tif privateKey == \"\" {\n\t\tfmt.Println(\"Empty privateKey!!\")\n\t\treturn\n\t}\n\tfmt.Println(\"\\nPrivate key exported:\", privateKey)\n}", "title": "" }, { "docid": "a990a618dc3cdf6d668dd678cb61c9fc", "score": "0.60856426", "text": "func keysExport(cmd *cobra.Command, args []string) {\n\tif len(args) < 1 {\n\t\tcmd.Usage()\n\t\tfatalf(\"must specify output filename for export\")\n\t}\n\n\texportFilename := args[0]\n\n\tparseConfig()\n\n\tkeyStoreManager, err := keystoremanager.NewKeyStoreManager(trustDir, retriever)\n\tif err != nil {\n\t\tfatalf(\"failed to create a new truststore manager with directory: %s\", trustDir)\n\t}\n\n\texportFile, err := os.Create(exportFilename)\n\tif err != nil {\n\t\tfatalf(\"error creating output file: %v\", err)\n\t}\n\n\t// Must use a different passphrase retriever to avoid caching the\n\t// unlocking passphrase and reusing that.\n\texportRetriever := passphrase.PromptRetriever()\n\tif keysExportGUN != \"\" {\n\t\terr = keyStoreManager.ExportKeysByGUN(exportFile, keysExportGUN, exportRetriever)\n\t} else {\n\t\terr = keyStoreManager.ExportAllKeys(exportFile, exportRetriever)\n\t}\n\n\texportFile.Close()\n\n\tif err != nil {\n\t\tfatalf(\"error exporting keys: %v\", err)\n\t\tos.Remove(exportFilename)\n\t}\n}", "title": "" }, { "docid": "907f328a6124d2a4eece1065bd66ce63", "score": "0.60641986", "text": "func (c *fetchX509Command) writeKey(filename string, data []byte) error {\n\t// key data is PKCS8 encoded\n\tb := &pem.Block{\n\t\tType: \"PRIVATE KEY\",\n\t\tBytes: data,\n\t}\n\n\treturn c.writeFile(filename, pem.EncodeToMemory(b))\n}", "title": "" }, { "docid": "917ba67ff2b85639cce45f7a74c3807d", "score": "0.60160613", "text": "func (s *SyncInfo) ExportKeys(outPath, pw string) error {\n\tsalt, err := gocrypt.SecureBytes(aes.KeyLength)\n\tif err != nil {\n\t\treturn &ErrSync{\"Unable to get salt for export\", err}\n\t}\n\n\texportKeys := generatePbkdf2KeyCombo(pw, salt)\n\n\torigBuf := memstream.New()\n\torigBuf.Write(s.Keys().CryptoKey)\n\torigBuf.Write(s.Keys().AuthKey)\n\torigBuf.Rewind()\n\n\tencryptedBuf := memstream.New()\n\tencryptedBuf.Write(salt)\n\t_, _, err = aes.Encrypt(origBuf, encryptedBuf, exportKeys)\n\tif err != nil {\n\t\treturn &ErrSync{\"Unable to encrypt keys\", err}\n\t}\n\n\tencoded := gocrypt.BytesToB64(encryptedBuf.Bytes())\n\terr = ioutil.WriteFile(outPath, []byte(encoded), 0770)\n\tif err != nil {\n\t\treturn &ErrSync{\"Unable to open key file\", err}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a2f86b93d30a5380ca754b1a0ce6bb08", "score": "0.59312075", "text": "func keysExportRoot(cmd *cobra.Command, args []string) {\n\tif len(args) < 2 {\n\t\tcmd.Usage()\n\t\tfatalf(\"must specify key ID and output filename for export\")\n\t}\n\n\tkeyID := args[0]\n\texportFilename := args[1]\n\n\tif len(keyID) != 64 {\n\t\tfatalf(\"please specify a valid root key ID\")\n\t}\n\n\tparseConfig()\n\n\tkeyStoreManager, err := keystoremanager.NewKeyStoreManager(trustDir, retriever)\n\tif err != nil {\n\t\tfatalf(\"failed to create a new truststore manager with directory: %s\", trustDir)\n\t}\n\n\texportFile, err := os.Create(exportFilename)\n\tif err != nil {\n\t\tfatalf(\"error creating output file: %v\", err)\n\t}\n\tif keysExportRootChangePassphrase {\n\t\t// Must use a different passphrase retriever to avoid caching the\n\t\t// unlocking passphrase and reusing that.\n\t\texportRetriever := passphrase.PromptRetriever()\n\t\terr = keyStoreManager.ExportRootKeyReencrypt(exportFile, keyID, exportRetriever)\n\t} else {\n\t\terr = keyStoreManager.ExportRootKey(exportFile, keyID)\n\t}\n\texportFile.Close()\n\tif err != nil {\n\t\tfatalf(\"error exporting root key: %v\", err)\n\t\tos.Remove(exportFilename)\n\t}\n}", "title": "" }, { "docid": "d6c904cd04d40f72dfe13102aad9e00a", "score": "0.59298503", "text": "func (s *SecretsService) newDataKey(ctx context.Context, name string, scope string, sess *xorm.Session) ([]byte, error) {\n\t// 1. Create new DEK\n\tdataKey, err := newRandomDataKey()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprovider, exists := s.providers[s.currentProviderID]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"could not find encryption provider '%s'\", s.currentProviderID)\n\t}\n\n\t// 2. Encrypt it\n\tencrypted, err := provider.Encrypt(ctx, dataKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 3. Store its encrypted value in db\n\tdek := secrets.DataKey{\n\t\tActive: true, // TODO: right now we never mark a key as deactivated\n\t\tName: name,\n\t\tProvider: s.currentProviderID,\n\t\tEncryptedData: encrypted,\n\t\tScope: scope,\n\t}\n\n\tif sess == nil {\n\t\terr = s.store.CreateDataKey(ctx, dek)\n\t} else {\n\t\terr = s.store.CreateDataKeyWithDBSession(ctx, dek, sess)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 4. Cache its unencrypted value and return it\n\ts.dataKeyCache.add(name, dataKey)\n\n\treturn dataKey, nil\n}", "title": "" }, { "docid": "ab9858d4de8619bdd084787b1cbd7b67", "score": "0.59111464", "text": "func (ks *KeyStore) Export(a accounts.Account, passphrase, newPassphrase string) (keyJSON []byte, err error) {\n\t_, key, err := ks.getDecryptedKey(a, passphrase)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar N, P int\n\tif store, ok := ks.storage.(*keyStorePassphrase); ok {\n\t\tN, P = store.scryptN, store.scryptP\n\t} else {\n\t\tN, P = StandardScryptN, StandardScryptP\n\t}\n\treturn EncryptKey(key, newPassphrase, N, P)\n}", "title": "" }, { "docid": "445ed3e263bf669e6834c84d51f4bce9", "score": "0.59067214", "text": "func (cli *Client) ExportCSAKey(c *cli.Context) (err error) {\n\tif !c.Args().Present() {\n\t\treturn cli.errorOut(errors.New(\"Must pass the ID of the key to export\"))\n\t}\n\n\tnewPasswordFile := c.String(\"newpassword\")\n\tif len(newPasswordFile) == 0 {\n\t\treturn cli.errorOut(errors.New(\"Must specify --newpassword/-p flag\"))\n\t}\n\n\tnewPassword, err := ioutil.ReadFile(newPasswordFile)\n\tif err != nil {\n\t\treturn cli.errorOut(errors.Wrap(err, \"Could not read password file\"))\n\t}\n\n\tfilepath := c.String(\"output\")\n\tif len(filepath) == 0 {\n\t\treturn cli.errorOut(errors.New(\"Must specify --output/-o flag\"))\n\t}\n\n\tID := c.Args().Get(0)\n\texportUrl := url.URL{\n\t\tPath: \"/v2/keys/csa/export/\" + ID,\n\t}\n\n\tquery := exportUrl.Query()\n\tquery.Set(\"newpassword\", normalizePassword(string(newPassword)))\n\n\texportUrl.RawQuery = query.Encode()\n\tresp, err := cli.HTTP.Post(exportUrl.String(), nil)\n\tif err != nil {\n\t\treturn cli.errorOut(errors.Wrap(err, \"Could not make HTTP request\"))\n\t}\n\tdefer func() {\n\t\tif cerr := resp.Body.Close(); cerr != nil {\n\t\t\terr = multierr.Append(err, cerr)\n\t\t}\n\t}()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn cli.errorOut(errors.New(\"Error exporting\"))\n\t}\n\n\tkeyJSON, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn cli.errorOut(errors.Wrap(err, \"Could not read response body\"))\n\t}\n\n\terr = utils.WriteFileWithMaxPerms(filepath, keyJSON, 0600)\n\tif err != nil {\n\t\treturn cli.errorOut(errors.Wrapf(err, \"Could not write %v\", filepath))\n\t}\n\n\t_, err = os.Stderr.WriteString(fmt.Sprintf(\"🔑 Exported P2P key %s to %s\\n\", ID, filepath))\n\tif err != nil {\n\t\treturn cli.errorOut(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a679220700ae0250e97fd2158ec7e952", "score": "0.5867227", "text": "func (f APIFetch) writeKey(filename string, data []byte) error {\n\tb := &pem.Block{\n\t\tType: \"PRIVATE KEY\",\n\t\tBytes: data,\n\t}\n\n\treturn f.writeFile(filename, pem.EncodeToMemory(b))\n}", "title": "" }, { "docid": "e893296914e40e7ad00bd0d17355115f", "score": "0.58594835", "text": "func CreateExportDataKeyRequest() (request *ExportDataKeyRequest) {\n\trequest = &ExportDataKeyRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Kms\", \"2016-01-20\", \"ExportDataKey\", \"kms\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "title": "" }, { "docid": "6cbc30cb1da8271f2b07eb163e30e633", "score": "0.5848455", "text": "func (store *KeyBackuper) Export(exportIDs []keystore.ExportID, mode keystore.ExportMode) (*keystore.KeysBackup, error) {\n\tvar exportedKeys []*keystore.Key\n\tvar err error\n\n\tif len(exportIDs) != 0 {\n\t\tfor _, exportID := range exportIDs {\n\t\t\tswitch exportID.KeyKind {\n\t\t\tcase keystore.KeyPoisonPublic:\n\t\t\t\tkeypair, err := store.keyStore.GetPoisonKeyPair()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Cannot read poison record key pair\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\t// additional verification of public key, there is no need to verify private keys\n\t\t\t\t// as private keys are encrypted and validated during description step\n\t\t\t\tif err := verifyPublicKey(keypair.Public); err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Invalid public key for export\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\texportedKeys = append(exportedKeys, &keystore.Key{\n\t\t\t\t\tName: poisonKeyFilenamePublic,\n\t\t\t\t\tContent: keypair.Public.Value,\n\t\t\t\t})\n\t\t\tcase keystore.KeyPoisonPrivate:\n\t\t\t\tkeypair, err := store.keyStore.GetPoisonKeyPair()\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Cannot read poison record key pair\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\tutils.ZeroizeBytes(keypair.Private.Value)\n\t\t\t\texportedKeys = append(exportedKeys, &keystore.Key{\n\t\t\t\t\tName: PoisonKeyFilename,\n\t\t\t\t\tContent: keypair.Private.Value,\n\t\t\t\t})\n\t\t\tcase keystore.KeyStoragePublic:\n\t\t\t\tkey, err := store.keyStore.GetClientIDEncryptionPublicKey(exportID.ContextID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Cannot read client storage public key\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\t// additional verification of public key, there is no need to verify private keys\n\t\t\t\t// as private keys are encrypted and validated during description step\n\t\t\t\tif err := verifyPublicKey(key); err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Invalid public key for export\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\texportedKeys = append(exportedKeys, &keystore.Key{\n\t\t\t\t\tName: getPublicKeyFilename([]byte(GetServerDecryptionKeyFilename(exportID.ContextID))),\n\t\t\t\t\tContent: key.Value,\n\t\t\t\t})\n\t\t\tcase keystore.KeyStoragePrivate:\n\t\t\t\tkey, err := store.keyStore.GetServerDecryptionPrivateKey(exportID.ContextID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Cannot read client storage private key\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tutils.ZeroizeBytes(key.Value)\n\t\t\t\texportedKeys = append(exportedKeys, &keystore.Key{\n\t\t\t\t\tName: GetServerDecryptionKeyFilename(exportID.ContextID),\n\t\t\t\t\tContent: key.Value,\n\t\t\t\t})\n\t\t\tcase keystore.KeySymmetric:\n\t\t\t\tkey, err := store.keyStore.GetClientIDSymmetricKey(exportID.ContextID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Cannot read client symmetric key\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tutils.ZeroizeBytes(key)\n\t\t\t\texportedKeys = append(exportedKeys, &keystore.Key{\n\t\t\t\t\tName: getClientIDSymmetricKeyName(exportID.ContextID),\n\t\t\t\t\tContent: key,\n\t\t\t\t})\n\t\t\tcase keystore.KeySearch:\n\t\t\t\tkey, err := store.keyStore.GetHMACSecretKey(exportID.ContextID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithError(err).Error(\"Cannot read client symmetric key\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tutils.ZeroizeBytes(key)\n\t\t\t\texportedKeys = append(exportedKeys, &keystore.Key{\n\t\t\t\t\tName: getHmacKeyFilename(exportID.ContextID),\n\t\t\t\t\tContent: key,\n\t\t\t\t})\n\t\t\tdefault:\n\t\t\t\treturn nil, errors.New(\"unexpected ExportID KeyKind\")\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (mode == keystore.ExportAllKeys || mode == keystore.ExportPublicOnly) && store.publicFolder != store.privateFolder {\n\t\t\tpublicFiles, err := ReadDir(store.storage, store.publicFolder)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpublicKeys, err := readFilesAsKeys(publicFiles, store.publicFolder, dummyEncryptor{}, store.storage)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\texportedKeys = append(exportedKeys, publicKeys...)\n\t\t}\n\n\t\tif mode == keystore.ExportPrivateKeys || mode == keystore.ExportAllKeys {\n\t\t\tprivateFiles, err := ReadDir(store.storage, store.privateFolder)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprivateKeys, err := readFilesAsKeys(privateFiles, store.privateFolder, store.currentDecryptor, store.storage)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\texportedKeys = append(exportedKeys, privateKeys...)\n\n\t\t\tdefer func(keys []*keystore.Key) {\n\t\t\t\tfor _, key := range keys {\n\t\t\t\t\tutils.ZeroizeBytes(key.Content)\n\t\t\t\t}\n\t\t\t}(privateKeys)\n\t\t}\n\t}\n\n\tbuf := &bytes.Buffer{}\n\tencoder := gob.NewEncoder(buf)\n\tif err := encoder.Encode(exportedKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func(buf *bytes.Buffer) {\n\t\tutils.ZeroizeBytes(buf.Bytes())\n\t}(buf)\n\tnewMasterKey, err := keystore.GenerateSymmetricKey()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencryptor, err := keystore.NewSCellKeyEncryptor(newMasterKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tencryptedKeys, err := encryptor.Encrypt(context.Background(), buf.Bytes(), keystore.NewEmptyKeyContext(nil))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &keystore.KeysBackup{Data: encryptedKeys, Keys: newMasterKey}, nil\n}", "title": "" }, { "docid": "67b6fddccb094438ed118f50b71f665f", "score": "0.58417416", "text": "func exportKeys(res http.ResponseWriter, req *http.Request, p httprouter.Params) {\n\tencoder := json.NewEncoder(res)\n\taddress := p.ByName(\"address\")\n\tresponse := jsonResponse{Status: \"OK\", Data: map[string]interface{}{}}\n\tkey := map[string]interface{}{}\n\twalletdResponse := walletd.GetViewKey(\n\t\trpcPwd,\n\t\t\"localhost\",\n\t\trpcPort,\n\t)\n\tjson.NewDecoder(walletdResponse).Decode(&key)\n\tresponse.Data[\"viewKey\"] = key[\"result\"].(map[string]interface{})[\"viewSecretKey\"].(string)\n\twalletdResponse = walletd.GetSpendKeys(\n\t\trpcPwd,\n\t\t\"localhost\",\n\t\trpcPort,\n\t\taddress,\n\t)\n\tjson.NewDecoder(walletdResponse).Decode(&key)\n\tresponse.Data[\"spendPublicKey\"] = key[\"result\"].(map[string]interface{})[\"spendPublicKey\"].(string)\n\tresponse.Data[\"spendSecretKey\"] = key[\"result\"].(map[string]interface{})[\"spendSecretKey\"].(string)\n\tencoder.Encode(response)\n}", "title": "" }, { "docid": "ddeb49d7c98d36a96788aae12734db15", "score": "0.5815156", "text": "func ExportPrivateKey(ctx context.Context, c *cli.Context) error {\n\treturn nil\n}", "title": "" }, { "docid": "85fcfbf028af6c1cd354a5caba6240d8", "score": "0.5810518", "text": "func (f FetchCLI) writeKey(filename string, data []byte) error {\n\tb := &pem.Block{\n\t\tType: \"EC PRIVATE KEY\",\n\t\tBytes: data,\n\t}\n\n\treturn f.writeFile(filename, pem.EncodeToMemory(b))\n}", "title": "" }, { "docid": "f10ef3a4253e01f6d1d79c83f020887e", "score": "0.57936096", "text": "func (client *Client) GenerateDataKey(request *GenerateDataKeyRequest) (response *GenerateDataKeyResponse, err error) {\n\tresponse = CreateGenerateDataKeyResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "c7c1c90b97e41f24ed50b18097fe9311", "score": "0.5782757", "text": "func ExportRegKey(reg RegExportImport) {\n\tcmdResult, err := ExecCmd(CmdOptions{\n\t\tCommand: \"reg\",\n\t\tArgs: []string{\"export\", reg.Key, reg.File, \"/y\", fmt.Sprintf(\"/reg:%s\", reg.Arch)},\n\t\tHideWindow: true,\n\t})\n\tif err != nil {\n\t\tLog.Fatalf(\"Cannot export registry key '%s': %v\", reg.Key, err)\n\t}\n\tif cmdResult.ExitCode != 0 {\n\t\tLog.Errorf(fmt.Sprintf(\"%d\", cmdResult.ExitCode))\n\t\tif len(cmdResult.Stderr) > 0 {\n\t\t\tLog.Errorf(fmt.Sprintf(\"%s\\n\", cmdResult.Stderr))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ed309d3b111740712e04238e4aa100ea", "score": "0.5770362", "text": "func (chain *Chain) ExportPEMKey(key rsa.PublicKey) []byte {\n\tans1Bytes, err := asn1.Marshal(key)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tpemKey := &pem.Block{Type: \"PUBLIC KEY\", Bytes: ans1Bytes}\n\treturn pem.EncodeToMemory(pemKey)\n}", "title": "" }, { "docid": "0097c82491f36cc0a81a1aa1d6677185", "score": "0.5747011", "text": "func keysExportCmd(a *appState) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"export chain_name key_name\",\n\t\tAliases: []string{\"e\"},\n\t\tShort: \"Exports a privkey from the keychain associated with a particular chain\",\n\t\tArgs: withUsage(cobra.ExactArgs(2)),\n\t\tExample: strings.TrimSpace(fmt.Sprintf(`\n$ %s keys export ibc-0 testkey\n$ %s k e cosmoshub testkey`, appName, appName)),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tkeyName := args[1]\n\t\t\tchain, ok := a.config.Chains[args[0]]\n\t\t\tif !ok {\n\t\t\t\treturn errChainNotFound(args[0])\n\t\t\t}\n\n\t\t\tif !chain.ChainProvider.KeyExists(keyName) {\n\t\t\t\treturn errKeyDoesntExist(keyName)\n\t\t\t}\n\n\t\t\tinfo, err := chain.ChainProvider.ExportPrivKeyArmor(keyName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfmt.Fprintln(cmd.OutOrStdout(), info)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn cmd\n}", "title": "" }, { "docid": "d8c90843b1319cff0cc515250cb65a17", "score": "0.57238007", "text": "func Export(key, fileName string) string {\n\tif !isConnected {\n\t\treturn AppError(ErrDbDoesNotOpen)\n\t}\n\n\tif key == \"\" {\n\t\treturn AppError(ErrKeyIsEmpty)\n\t}\n\n\tvalue, err := dbh.Get([]byte(key), nil)\n\tif err != nil {\n\t\treturn AppError(ErrKeyNotFound)\n\t}\n\n\tfileErr := ioutil.WriteFile(fileName, value, 0644)\n\tif fileErr != nil {\n\t\treturn AppError(FileWriteErr)\n\t}\n\n\treturn \"Success\"\n}", "title": "" }, { "docid": "af6addd82f58b52c3d41838faa7d8679", "score": "0.57152", "text": "func (m *manager) writeKey(name string, pemPrivateKey string, callback func(err error)) {\n\ti, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64))\n\tif err != nil {\n\t\tcallback(fmt.Errorf(\"failed to generate new ID: %v\", err))\n\t\treturn\n\t}\n\tid := ID(i.String())\n\tstorageKey := fmt.Sprintf(\"%s%s\", keyPrefix, id)\n\tsk := &storedKey{Object: js.Global.Get(\"Object\").New()}\n\tsk.ID = id\n\tsk.Name = name\n\tsk.PEMPrivateKey = pemPrivateKey\n\tdata := map[string]interface{}{\n\t\tstorageKey: sk,\n\t}\n\tm.storage.Set(data, func(err error) {\n\t\tcallback(err)\n\t})\n}", "title": "" }, { "docid": "3cd7ebeec1d95eed630d6cbd6fee5a58", "score": "0.56010395", "text": "func (s *KeyPairsService) ExportKeyPair(input *ExportKeyPairInput) (resp *http.Response, err error) {\n\tpath := \"/keyPairs/{id}/pkcs12\"\n\tpath = strings.Replace(path, \"{id}\", input.Id, -1)\n\n\top := &request.Operation{\n\t\tName: \"ExportKeyPair\",\n\t\tHTTPMethod: \"POST\",\n\t\tHTTPPath: path,\n\t\tQueryParams: map[string]string{},\n\t}\n\n\treq := s.newRequest(op, input.Body, nil)\n\n\tif req.Send() == nil {\n\t\treturn req.HTTPResponse, nil\n\t}\n\treturn req.HTTPResponse, req.Error\n}", "title": "" }, { "docid": "ae3dfb810906fc81019bbf814e4ab961", "score": "0.5595741", "text": "func (c *ContractAccount) GetDataKey() []byte {\n\treturn []byte(\"mavl-\" + c.mdb.ExecutorName + \"-jvmContractInfo: \" + c.Addr)\n}", "title": "" }, { "docid": "37ed7b17260f69ae1a508c05eccf30fe", "score": "0.5542535", "text": "func (h *ExpHandler) SaveData(ctx context.Context, msg core.Message, handler sdk.TxHandler) core.Result {\n\tputkey := &PutKey{}\n\terr := json.Unmarshal(msg.TranData, putkey)\n\tif err != nil {\n\t\treturn core.Result{\n\t\t\tRspCode: common.RspServerError,\n\t\t\tRspData: []byte(err.Error()),\n\t\t\tTranCode: msg.TranCode,\n\t\t}\n\t}\n\treq := sdk.Request{Channel: h.channel, Chaincode: h.chaincode, Fcn: \"keyadd\",\n\t\tArgs: [][]byte{[]byte(putkey.Name), []byte(putkey.KeyCert)}}\n\trspmsg := handler.Excute(req)\n\treturn core.Result{\n\t\tRspCode: rspmsg.Code,\n\t\tRspData: rspmsg.Data,\n\t\tTranCode: msg.TranCode,\n\t\tTxID: rspmsg.TxID,\n\t}\n}", "title": "" }, { "docid": "39f9c37f14e729a55fb0e06963a458f7", "score": "0.5539376", "text": "func (v VaultTransit) GenerateDataKey(key SecretKey) (string, error) {\n\tif _, err := v.client.Write(v.keysPath(key), nil); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvaultSecret, err := v.client.Write(v.generateDataKeyPath(key), nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif vaultSecret.Data == nil {\n\t\treturn \"\", fmt.Errorf(\"secret data is impty\")\n\t}\n\tciphertext, ok := vaultSecret.Data[\"ciphertext\"].(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"ciphertext is not set\")\n\t}\n\n\treturn ciphertext, nil\n}", "title": "" }, { "docid": "a572daabed0a82149dc83496033a4b25", "score": "0.5538893", "text": "func (prv RSAPrivateKey) Export() []byte {\n\treturn x509.MarshalPKCS1PrivateKey(prv.private)\n}", "title": "" }, { "docid": "93d70da226222998bb6157fc3f98ed49", "score": "0.55165577", "text": "func privKeyData(priv *ecdsa.PrivateKey) (*tinkpb.KeyData, error) {\n\tprivKey := testutil.NewECDSAPrivateKey(\n\t\ttestutil.ECDSASignerKeyVersion,\n\t\tecdsaPubKeyPB(&priv.PublicKey),\n\t\tpriv.D.Bytes())\n\tserializedKey, err := proto.Marshal(privKey)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"proto.Marshal(): %v\", err)\n\t}\n\treturn testutil.NewKeyData(testutil.ECDSASignerTypeURL,\n\t\tserializedKey,\n\t\ttinkpb.KeyData_ASYMMETRIC_PRIVATE), nil\n}", "title": "" }, { "docid": "b69bfad1dcb3472b4684cb8ec00802b6", "score": "0.55053514", "text": "func (c *ctx) singularityKeyExport(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\targs []string\n\t\tstdout string\n\t\tconsoleOps []string\n\t}{\n\t\t{\n\t\t\tname: \"export help\",\n\t\t\targs: []string{\"export\", \"--help\"},\n\t\t\tstdout: \"Export a public or private key into a specific file\",\n\t\t},\n\t\t{\n\t\t\tname: \"export public binary\",\n\t\t\targs: []string{\"export\", c.publicExportPath},\n\t\t\tconsoleOps: []string{\n\t\t\t\t\"0\",\n\t\t\t},\n\t\t\tstdout: \"Public key with fingerprint\",\n\t\t},\n\t\t{\n\t\t\tname: \"export private binary\",\n\t\t\targs: []string{\"export\", \"--secret\", c.privateExportPath},\n\t\t\tconsoleOps: []string{\n\t\t\t\t\"0\",\n\t\t\t\t\"e2etests\",\n\t\t\t},\n\t\t\tstdout: \"Private key with fingerprint\",\n\t\t},\n\t\t{\n\t\t\tname: \"export public ascii\",\n\t\t\targs: []string{\"export\", \"--armor\", c.publicExportASCIIPath},\n\t\t\tconsoleOps: []string{\n\t\t\t\t\"0\",\n\t\t\t},\n\t\t\tstdout: \"Public key with fingerprint\",\n\t\t},\n\t\t{\n\t\t\tname: \"export private ascii\",\n\t\t\targs: []string{\"export\", \"--secret\", \"--armor\", c.privateExportASCIIPath},\n\t\t\tconsoleOps: []string{\n\t\t\t\t\"0\",\n\t\t\t\t\"e2etests\",\n\t\t\t},\n\t\t\tstdout: \"Private key with fingerprint\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tc.env.RunSingularity(\n\t\t\tt,\n\t\t\te2e.AsSubtest(tt.name),\n\t\t\te2e.WithProfile(e2e.UserProfile),\n\t\t\te2e.WithCommand(\"key\"),\n\t\t\te2e.WithArgs(tt.args...),\n\t\t\te2e.ConsoleRun(buildConsoleLines(tt.consoleOps...)...),\n\t\t\te2e.ExpectExit(0, e2e.ExpectOutput(e2e.ContainMatch, tt.stdout)),\n\t\t)\n\t}\n}", "title": "" }, { "docid": "a61b26c81977423c650c468f8cd4c1d4", "score": "0.54988015", "text": "func ExportPublicKey(ctx context.Context, c *cli.Context) error {\n\treturn nil\n}", "title": "" }, { "docid": "a8ee460f7d03cf3078fd748d4003001b", "score": "0.54660904", "text": "func (k *APIKey) Run(params APIKeyRunParams) error {\n\tlogging.Debug(\"Execute export API key\")\n\n\tps, err := prepareAPIKeyRunParams(params)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkey, err := k.keyPro.NewAPIKey(ps.Name)\n\tif err != nil {\n\t\treturn locale.WrapError(err, \"err_cannot_obtain_apikey\")\n\t}\n\n\tk.out.Notice(locale.T(\"export_apikey_user_notice\"))\n\tk.out.Print(output.Prepare(\n\t\tkey,\n\t\t&struct {\n\t\t\tValue string `json:\"value\"`\n\t\t}{key},\n\t))\n\treturn nil\n}", "title": "" }, { "docid": "e01ba6cf995d0112c4e4ad015fe24738", "score": "0.5451282", "text": "func (s *SecretsService) dataKey(ctx context.Context, name string) ([]byte, error) {\n\tif dataKey, exists := s.dataKeyCache.get(name); exists {\n\t\treturn dataKey, nil\n\t}\n\n\t// 1. get encrypted data key from database\n\tdataKey, err := s.store.GetDataKey(ctx, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 2. decrypt data key\n\tprovider, exists := s.providers[kmsproviders.NormalizeProviderID(dataKey.Provider)]\n\tif !exists {\n\t\treturn nil, fmt.Errorf(\"could not find encryption provider '%s'\", dataKey.Provider)\n\t}\n\n\tdecrypted, err := provider.Decrypt(ctx, dataKey.EncryptedData)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 3. cache data key\n\ts.dataKeyCache.add(name, decrypted)\n\n\treturn decrypted, nil\n}", "title": "" }, { "docid": "1e6c255eebc3f9de9015948263505439", "score": "0.54428685", "text": "func (a *Client) ExportEncryptionKey(params *ExportEncryptionKeyParams, opts ...ClientOption) (*ExportEncryptionKeyOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewExportEncryptionKeyParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"ExportEncryptionKey\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/config/encryption/export\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\", \"wss\"},\n\t\tParams: params,\n\t\tReader: &ExportEncryptionKeyReader{formats: a.formats},\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, err\n\t}\n\tsuccess, ok := result.(*ExportEncryptionKeyOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for ExportEncryptionKey: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "6302b9129823cf6fa2ca9ecc1f8154e2", "score": "0.54015124", "text": "func (t *Trustee) Export(cn, outPath string) error {\n\thash := sha512.New()\n\tciphertext, err := rsa.EncryptOAEP(hash, rand.Reader, t.PublicKey, t.KeyShare, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif outPath, err = filepath.Abs(outPath); err != nil {\n\t\treturn err\n\t}\n\n\toutFile := filepath.Join(outPath, strings.ToLower(fmt.Sprintf(\"%s_%s.enc.keypart\", t.Name, strcase.ToSnake(cn))))\n\tif err := ioutil.WriteFile(outFile, ciphertext, 0600); err != nil {\n\t\treturn fmt.Errorf(\"failed to write encrypted keypart to %s: %s\", outFile, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "10d112a51d7913415d6782564628efed", "score": "0.5399824", "text": "func (client *Client) GenerateDataKeyWithCallback(request *GenerateDataKeyRequest, callback func(response *GenerateDataKeyResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *GenerateDataKeyResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.GenerateDataKey(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": "912b56467d67c0db9a3d30ef50652c37", "score": "0.53853726", "text": "func (lp *LocalPeer) WriteKey() error {\n\tif len(lp.privateKey) == 0 {\n\t\treturn errors.\n\t\t\tNew(\"LocalPeer does not have a private key, please generate\")\n\t}\n\n\terr := ioutil.WriteFile(\"./data/identity.dat\", lp.privateKey, 0400)\n\n\treturn err\n}", "title": "" }, { "docid": "c24388d0f5c5b42ffeaf6cc1a1802556", "score": "0.5350877", "text": "func TestDelegationKeyImportExport(t *testing.T) {\n\t// -- setup --\n\tsetUp(t)\n\n\ttempDir := tempDirWithConfig(t, \"{}\")\n\tdefer os.RemoveAll(tempDir)\n\n\ttempExportedDir := tempDirWithConfig(t, \"{}\")\n\tdefer os.RemoveAll(tempDir)\n\n\ttempImportingDir := tempDirWithConfig(t, \"{}\")\n\tdefer os.RemoveAll(tempDir)\n\n\t// Setup key in a file for import\n\tkeyFile, err := ioutil.TempFile(\"\", \"pemfile\")\n\trequire.NoError(t, err)\n\tdefer os.Remove(keyFile.Name())\n\tprivKey, err := utils.GenerateRSAKey(rand.Reader, 2048)\n\trequire.NoError(t, err)\n\tpemBytes, err := utils.EncryptPrivateKey(privKey, \"\", \"\", \"\")\n\trequire.NoError(t, err)\n\tnBytes, err := keyFile.Write(pemBytes)\n\trequire.NoError(t, err)\n\tkeyFile.Close()\n\trequire.Equal(t, len(pemBytes), nBytes)\n\n\t// import the key\n\t_, err = runCommand(t, tempDir, \"key\", \"import\", keyFile.Name(), \"-r\", \"user\")\n\trequire.NoError(t, err)\n\n\t// export the key\n\t_, err = runCommand(t, tempDir, \"key\", \"export\", \"-o\", filepath.Join(tempExportedDir, \"exported\"))\n\trequire.NoError(t, err)\n\n\t// re-import the key from the exported store to a new tempDir\n\t_, err = runCommand(t, tempImportingDir, \"key\", \"import\", filepath.Join(tempExportedDir, \"exported\"))\n\trequire.NoError(t, err)\n}", "title": "" }, { "docid": "d141ef2c72a4ed27b91b43ff08f50f09", "score": "0.53397965", "text": "func (self *Task) WriteData(filename string) (err error) {\n _tmp1317 := C.CString(filename)\n if _tmp1318 := C.MSK_writedata(self.ptr(),_tmp1317); _tmp1318 != 0 {\n lastcode,lastmsg := self.getlasterror(_tmp1318)\n err = &MosekError{code:Rescode(lastcode),msg:lastmsg}\n return\n }\n return\n}", "title": "" }, { "docid": "25ef880f60953ecbe60c720d8d6204eb", "score": "0.53311604", "text": "func (c *Client) Export(key, singleKeyExportFormat string, appendMap map[string]string) (string, error) {\n\tvar secrets []*Secret\n\tvar err error\n\t// if we get valid prefix we use ReadGroup method\n\t// else we have 1 key only and we use Read method\n\tif validPrefix(key) {\n\t\tsecrets, err = c.ReadGroup(key)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t} else {\n\t\tsecret, err := c.Read(key)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tsecrets = append(secrets, secret)\n\t}\n\tvar sortedKeys []string\n\tkeySecretMap := make(map[string]*Secret, len(secrets))\n\tfor _, secret := range secrets {\n\t\tsortedKeys = append(sortedKeys, secret.Key)\n\t\tkeySecretMap[secret.Key] = secret\n\t}\n\n\tsort.Strings(sortedKeys)\n\tvar buffer bytes.Buffer\n\tfor _, key := range sortedKeys {\n\t\tsecret := keySecretMap[key]\n\t\tsecret.Value = fmt.Sprintf(\"%s%s\", secret.Value, appendMap[filepath.Base(secret.Key)])\n\t\tbuffer.WriteString(fmt.Sprintf(singleKeyExportFormat, filepath.Base(secret.Key), secret.Value))\n\t}\n\treturn buffer.String(), nil\n}", "title": "" }, { "docid": "7f05eb9deca1180de7fbee5d46e02e4b", "score": "0.53030187", "text": "func (a *Age) ExportPublicKey(ctx context.Context, id string) ([]byte, error) {\n\treturn []byte(id), nil\n}", "title": "" }, { "docid": "4d544ad9097252c73fdc3e7091874477", "score": "0.5299005", "text": "func (pks *PrivateKeyShare) Data() keygen.LocalPartySaveData {\n\treturn pks.data\n}", "title": "" }, { "docid": "61164cf6dd5cd45ae2ca9eda12af54d0", "score": "0.5298", "text": "func GenerateKeysAndExport(filename string) error {\n\tprivateKey, err := GenerateKeys()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif filename == \"\" {\n\t\tfilename = \"keys.pem\"\n\t}\n\tpemfile, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\n\t}\n\t// http://golang.org/pkg/encoding/pem/#Block\n\tvarpemkey := &pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(privateKey)}\n\terr = pem.Encode(pemfile, varpemkey)\n\tif err != nil {\n\t\treturn err\n\n\t}\n\tdefer pemfile.Close()\n\treturn nil\n\n}", "title": "" }, { "docid": "ea9a6dd3cecb3ecfc2c43e6b7e071f61", "score": "0.5282832", "text": "func KMSGenerateDataKey(kmsKeyId string, svc kmsiface.KMSAPI, context map[string]*string) (cipherTextKey []byte, plainTextKey []byte, err error) {\n\tkmsKeySize := KMSKeySizeInBytes\n\tgenerateDataKeyInput := kms.GenerateDataKeyInput{\n\t\tKeyId: &kmsKeyId,\n\t\tNumberOfBytes: &kmsKeySize,\n\t\tEncryptionContext: context,\n\t}\n\n\tvar generateDataKeyOutput *kms.GenerateDataKeyOutput\n\tif generateDataKeyOutput, err = svc.GenerateDataKey(&generateDataKeyInput); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Error calling KMS GenerateDataKey API: %s\", err)\n\t}\n\n\treturn generateDataKeyOutput.CiphertextBlob, generateDataKeyOutput.Plaintext, nil\n}", "title": "" }, { "docid": "7fd951014af3c598cfaa7922c1172993", "score": "0.5269047", "text": "func (c *Client) GenerateDataKeyPair(ctx context.Context, params *GenerateDataKeyPairInput, optFns ...func(*Options)) (*GenerateDataKeyPairOutput, error) {\n\tif params == nil {\n\t\tparams = &GenerateDataKeyPairInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"GenerateDataKeyPair\", params, optFns, c.addOperationGenerateDataKeyPairMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*GenerateDataKeyPairOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "8f392d3d6bfac9ef4687519acac90364", "score": "0.52611506", "text": "func CreateExportDataKeyResponse() (response *ExportDataKeyResponse) {\n\tresponse = &ExportDataKeyResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "992d723a66ca535dad1cdfa8ae864fb3", "score": "0.52606034", "text": "func (k *Key) Export(file string) error {\n\tif !k.Exists() {\n\t\treturn nil\n\t}\n\n\tcmdResult, err := proc.Cmd(proc.CmdOptions{\n\t\tCommand: \"reg\",\n\t\tArgs: []string{\"export\", k.Key, file, \"/y\", fmt.Sprintf(\"/reg:%s\", k.Arch)},\n\t\tHideWindow: true,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot export registry key '%s': %v\", k.Key, err)\n\t}\n\n\tif cmdResult.ExitCode != 0 {\n\t\tif len(cmdResult.Stderr) > 0 {\n\t\t\treturn fmt.Errorf(\"%s, exit code %d\", cmdResult.Stderr, cmdResult.ExitCode)\n\t\t}\n\t\treturn fmt.Errorf(\"exit code %d\", cmdResult.ExitCode)\n\t}\n\n\tvar regFiles []string\n\terr = filepath.Walk(filepath.Dir(file), func(path string, info os.FileInfo, err error) error {\n\t\tif info == nil {\n\t\t\treturn err\n\t\t}\n\t\tif info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tif filepath.Ext(path) == \".reg\" {\n\t\t\treturn nil\n\t\t}\n\t\tregFiles = append(regFiles, path)\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Cannot retrieve files from reg directory\")\n\t}\n\n\tsort.Strings(regFiles)\n\tif len(regFiles) <= maxBackup {\n\t\treturn nil\n\t}\n\n\tfor len(regFiles) > maxBackup {\n\t\tregFilePath := regFiles[0]\n\t\tif err := os.Remove(regFilePath); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tregFiles = append(regFiles[:0], regFiles[1:]...)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9abcf4506bd33fe32c8f1db010422840", "score": "0.525767", "text": "func (_m *EthKeyStoreInterface) ExportKey(address common.Address, newPassword string) ([]byte, error) {\n\tret := _m.Called(address, newPassword)\n\n\tvar r0 []byte\n\tif rf, ok := ret.Get(0).(func(common.Address, string) []byte); ok {\n\t\tr0 = rf(address, newPassword)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).([]byte)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(common.Address, string) error); ok {\n\t\tr1 = rf(address, newPassword)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "350b8ef6a0cc3f7493d8d04f2012baca", "score": "0.5253839", "text": "func exportDSAPublicKey(session *PKCS11Session, pubHandle pkcs11.ObjectHandle) (crypto.PublicKey, error) {\n\ttemplate := []*pkcs11.Attribute{\n\t\tpkcs11.NewAttribute(pkcs11.CKA_PRIME, nil),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_SUBPRIME, nil),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_BASE, nil),\n\t\tpkcs11.NewAttribute(pkcs11.CKA_VALUE, nil),\n\t}\n\texported, err := session.Ctx.GetAttributeValue(session.Handle, pubHandle, template)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar p, q, g, y big.Int\n\tp.SetBytes(exported[0].Value)\n\tq.SetBytes(exported[1].Value)\n\tg.SetBytes(exported[2].Value)\n\ty.SetBytes(exported[3].Value)\n\tresult := dsa.PublicKey{\n\t\tParameters: dsa.Parameters{\n\t\t\tP: &p,\n\t\t\tQ: &q,\n\t\t\tG: &g,\n\t\t},\n\t\tY: &y,\n\t}\n\treturn &result, nil\n}", "title": "" }, { "docid": "12ecc56796928d51f66105db73cc444b", "score": "0.52411175", "text": "func (m *KeyProcessorMock) ExportPrivateKeyPEM(p crypto.PrivateKey) (r []byte, r1 error) {\n\tcounter := atomic.AddUint64(&m.ExportPrivateKeyPEMPreCounter, 1)\n\tdefer atomic.AddUint64(&m.ExportPrivateKeyPEMCounter, 1)\n\n\tif len(m.ExportPrivateKeyPEMMock.expectationSeries) > 0 {\n\t\tif counter > uint64(len(m.ExportPrivateKeyPEMMock.expectationSeries)) {\n\t\t\tm.t.Fatalf(\"Unexpected call to KeyProcessorMock.ExportPrivateKeyPEM. %v\", p)\n\t\t\treturn\n\t\t}\n\n\t\tinput := m.ExportPrivateKeyPEMMock.expectationSeries[counter-1].input\n\t\ttestify_assert.Equal(m.t, *input, KeyProcessorMockExportPrivateKeyPEMInput{p}, \"KeyProcessor.ExportPrivateKeyPEM got unexpected parameters\")\n\n\t\tresult := m.ExportPrivateKeyPEMMock.expectationSeries[counter-1].result\n\t\tif result == nil {\n\t\t\tm.t.Fatal(\"No results are set for the KeyProcessorMock.ExportPrivateKeyPEM\")\n\t\t\treturn\n\t\t}\n\n\t\tr = result.r\n\t\tr1 = result.r1\n\n\t\treturn\n\t}\n\n\tif m.ExportPrivateKeyPEMMock.mainExpectation != nil {\n\n\t\tinput := m.ExportPrivateKeyPEMMock.mainExpectation.input\n\t\tif input != nil {\n\t\t\ttestify_assert.Equal(m.t, *input, KeyProcessorMockExportPrivateKeyPEMInput{p}, \"KeyProcessor.ExportPrivateKeyPEM got unexpected parameters\")\n\t\t}\n\n\t\tresult := m.ExportPrivateKeyPEMMock.mainExpectation.result\n\t\tif result == nil {\n\t\t\tm.t.Fatal(\"No results are set for the KeyProcessorMock.ExportPrivateKeyPEM\")\n\t\t}\n\n\t\tr = result.r\n\t\tr1 = result.r1\n\n\t\treturn\n\t}\n\n\tif m.ExportPrivateKeyPEMFunc == nil {\n\t\tm.t.Fatalf(\"Unexpected call to KeyProcessorMock.ExportPrivateKeyPEM. %v\", p)\n\t\treturn\n\t}\n\n\treturn m.ExportPrivateKeyPEMFunc(p)\n}", "title": "" }, { "docid": "034e44d3f5d17149df8cabcd94106d63", "score": "0.52344525", "text": "func ExportWK(authToken string, urlStart string, de common.DomainEntry,\n\tpfile []byte, sigkeys []string, sigkeySkis []string,\n\tsigkeyTokens []string) ([]byte, error) {\n\n\thtpRequestString, err := ExportWKReq(authToken, urlStart, de, pfile,\n\t\tsigkeys, sigkeySkis, sigkeyTokens)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq := common.CreatePostHsmsRequest(\n\t\tauthToken, urlStart, de.Crypto_instance_id, de.Hsm_id, htpRequestString)\n\n\thtpResponseString, err := common.SubmitHTPRequest(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tadminRspBlk, err := buildAdminRspBlk(htpResponseString, de)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn adminRspBlk.CmdOutput, nil\n}", "title": "" }, { "docid": "4fd19b81f4286dd9c7f9320a79cbf230", "score": "0.522302", "text": "func (o LookupWorkforcePoolKeyResultOutput) KeyData() KeyDataResponseOutput {\n\treturn o.ApplyT(func(v LookupWorkforcePoolKeyResult) KeyDataResponse { return v.KeyData }).(KeyDataResponseOutput)\n}", "title": "" }, { "docid": "90303d185b274d4bd3af57da9244270f", "score": "0.52213097", "text": "func (c *Client) ExportKeyImages() (*ExportKeyImagesResponse, error) {\n\tresp := &ExportKeyImagesResponse{}\n\terr := c.Do(\"export_key_images\", nil, resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "6815d49dc6fcfb04c04bf4743d6fe2d5", "score": "0.5219613", "text": "func keyData() []byte {\n\tb := make([]byte, 64)\n\tif _, err := rand.Read(b); err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "860558fd7fb392d8568e7aad40a402cf", "score": "0.5184669", "text": "func NetServiceDataKey(obj interface{}) (string, error) {\n\tdata, ok := obj.(StorageKey)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"ExportService type Assert failed\")\n\t}\n\treturn data.GetKey(), nil\n}", "title": "" }, { "docid": "26297b01de267823a0e3a7f2ab143290", "score": "0.5182903", "text": "func (ks *KeyStore) ExportPrivateKeyByKeystore(address, password string )(string,error) {\n\n\tkeyJson , err := ks.ExportKeystore(address,password)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tkey, err := keystore.DecryptKey([]byte(keyJson), password)\n\t//seckey := math.PaddedBigBytes(key.PrivateKey.D, key.PrivateKey.Params().BitSize/8)\n\t//fmt.Println(\"seckey=\"+ hex.EncodeToString(seckey))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tprivateKey := crypto.FromECDSA(key.PrivateKey)\n\n\treturn hex.EncodeToString(privateKey), nil\n}", "title": "" }, { "docid": "c46d0fdd3a945baecf40d326d40c505e", "score": "0.515284", "text": "func ExportDERSecretKeyRSA(key *rsa.PrivateKey) ([]byte, error) {\n data := x509.MarshalPKCS1PrivateKey(key)\n if data == nil {\n return nil, errNotRSA\n }\n return data, nil\n}", "title": "" }, { "docid": "e0ee16babd8950ba1db6dcb34f275b32", "score": "0.5148063", "text": "func ExportPendingWK(authToken string, urlStart string, de common.DomainEntry,\n\tpfile []byte, sigkeys []string, sigkeySkis []string,\n\tsigkeyTokens []string) ([]byte, error) {\n\n\thtpRequestString, err := ExportPendingWKReq(authToken, urlStart, de, pfile,\n\t\tsigkeys, sigkeySkis, sigkeyTokens)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq := common.CreatePostHsmsRequest(\n\t\tauthToken, urlStart, de.Crypto_instance_id, de.Hsm_id, htpRequestString)\n\n\thtpResponseString, err := common.SubmitHTPRequest(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tadminRspBlk, err := buildAdminRspBlk(htpResponseString, de)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn adminRspBlk.CmdOutput, nil\n}", "title": "" }, { "docid": "6ddaf6264f7ab07b1d5cc4c8b363975e", "score": "0.5134926", "text": "func ExportPrivateKey() (privateKey *btcec.PrivateKey, publicKey *btcec.PublicKey) {\r\n\treturn peerPrivateKey, peerPublicKey\r\n}", "title": "" }, { "docid": "c7df4cb7f1c71ba9544e397cbfee0e82", "score": "0.5129873", "text": "func pubKeyData(pub *ecdsa.PublicKey) (*tinkpb.KeyData, error) {\n\tserializedKey, err := proto.Marshal(ecdsaPubKeyPB(pub))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"proto.Marshal(): %v\", err)\n\t}\n\treturn testutil.NewKeyData(testutil.ECDSAVerifierTypeURL,\n\t\tserializedKey,\n\t\ttinkpb.KeyData_ASYMMETRIC_PUBLIC), nil\n}", "title": "" }, { "docid": "2c937e087f47c955fd0d823d3e4b0589", "score": "0.51025724", "text": "func (ks *KeyStore) ExportPrivateKeyByMnemonics(){\n\n}", "title": "" }, { "docid": "4986142ca339460ced4e981bc84ba039", "score": "0.5094469", "text": "func ExportPrivateKeyInPem(privateKey string) []byte {\n\tblock := &pem.Block{\n\t\tType: ED25519_PEM_SECRET_KEY_TAG,\n\t\tBytes: []byte(privateKey),\n\t}\n\treturn pem.EncodeToMemory(block)\n}", "title": "" }, { "docid": "4060789b79510905bd0a3941bf23e7f6", "score": "0.50706", "text": "func (k *KeyFile) DataKey(plainHash []byte) []byte {\n\treturn pbkdf2.Key(k.cryptSecret, plainHash, 10000, 32, sha256.New)\n}", "title": "" }, { "docid": "54bc103899265ede3c4621fb0ee6c3f4", "score": "0.5058245", "text": "func exportToDB(ctx sdk.Context, k Keeper, address ethcmn.Address, codeHash []byte) {\n\tif code := k.GetCode(ctx, address); len(code) > 0 {\n\t\t// TODO repeat code\n\t\tif err := evmByteCodeDB.Set(append(types.KeyPrefixCode, codeHash...), code); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tcodeCount++\n\t}\n\n\taddGoroutine()\n\tgo exportStorage(ctx, k, address, evmStateDB)\n}", "title": "" }, { "docid": "06c8c607c78fdb342300c800ad1d5378", "score": "0.5050177", "text": "func (kb dbKeybase) ExportPubKey(name string) (armor string, err error) {\n\tbz := kb.db.Get(infoKey(name))\n\tif bz == nil {\n\t\treturn \"\", fmt.Errorf(\"no key to export with name %s\", name)\n\t}\n\tinfo, err := readInfo(bz)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn armorPubKeyBytes(info.GetPubKey().Bytes()), nil\n}", "title": "" }, { "docid": "2dcecf51452b767d537f49966ae28c00", "score": "0.50375175", "text": "func GetKey() []byte {\n\treturn keyData\n}", "title": "" }, { "docid": "45d2444b65088c1878f4357d2b04b8f5", "score": "0.5012117", "text": "func (pub RSAPublicKey) Export() ([]byte, error) {\n\tasn1, err := x509.MarshalPKIXPublicKey(pub.publicKey)\n\tif err != nil {\n\t\treturn nil, errio.Error(err)\n\t}\n\n\tbytes := pem.EncodeToMemory(&pem.Block{\n\t\tType: \"RSA PUBLIC KEY\",\n\t\tBytes: asn1,\n\t})\n\n\treturn bytes, nil\n}", "title": "" }, { "docid": "081bb10f2da1f2d28e0d2e528ff37501", "score": "0.5012097", "text": "func (d *redisDumperImpl) dataDump(ctx context.Context, wg *sync.WaitGroup) {\n\tdefer wg.Done()\n\nouter:\n\tfor {\n\t\tselect {\n\t\tcase kd, ok := <-d.data:\n\t\t\tif !ok {\n\t\t\t\tbreak outer\n\t\t\t}\n\t\t\td.writer.WriteString(EncodeKeyData(&kd) + \"\\n\")\n\t\tcase <-ctx.Done():\n\t\t\tbreak outer\n\t\t}\n\t}\n}", "title": "" }, { "docid": "209d3afd88a8d239ebef14a35ba44327", "score": "0.4974404", "text": "func (w *wallet) Export(ctx context.Context, passphrase []byte) ([]byte, error) {\n\tw.mutex.Lock()\n\tdefer w.mutex.Unlock()\n\n\ttype walletExt struct {\n\t\tWallet *wallet `json:\"wallet\"`\n\t\tAccounts []*account `json:\"accounts\"`\n\t}\n\n\taccounts := make([]*account, 0)\n\tfor acc := range w.Accounts(ctx) {\n\t\t//nolint:forcetypeassert\n\t\taccounts = append(accounts, acc.(*account))\n\t}\n\n\text := &walletExt{\n\t\tWallet: w,\n\t\tAccounts: accounts,\n\t}\n\n\tdata, err := json.Marshal(ext)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to marshal wallet for export\")\n\t}\n\n\tres, err := ecodec.Encrypt(data, passphrase)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to encrypt export\")\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "d602d438ca4fa7e7c18c7fd0499b2aa3", "score": "0.49698034", "text": "func (m *KeyProcessorMock) ExportPrivateKeyPEMFinished() bool {\n\t// if expectation series were set then invocations count should be equal to expectations count\n\tif len(m.ExportPrivateKeyPEMMock.expectationSeries) > 0 {\n\t\treturn atomic.LoadUint64(&m.ExportPrivateKeyPEMCounter) == uint64(len(m.ExportPrivateKeyPEMMock.expectationSeries))\n\t}\n\n\t// if main expectation was set then invocations count should be greater than zero\n\tif m.ExportPrivateKeyPEMMock.mainExpectation != nil {\n\t\treturn atomic.LoadUint64(&m.ExportPrivateKeyPEMCounter) > 0\n\t}\n\n\t// if func was set then invocations count should be greater than zero\n\tif m.ExportPrivateKeyPEMFunc != nil {\n\t\treturn atomic.LoadUint64(&m.ExportPrivateKeyPEMCounter) > 0\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "ed56637040924dbce951e2898ad65408", "score": "0.4969793", "text": "func TestCreateKeyAndSavePem(t *testing.T) {\n\tadapter := initKMS()\n\tassert.NotNil(t, adapter, \"init failed\")\n\n\terr := adapter.CreateKey()\n\tassert.Nil(t, err, \"kms create key failed\")\n\tpubKey := adapter.PublicKey()\n\n\t// kms key -> pem -> tjfoc key\n\tpubKeyPem, err := pubKey.WriteToPem()\n\tassert.Nil(t, err, \"kms pub key write to pem failed\")\n\ttjPubKey, err := x509.ReadPublicKeyFromPem(pubKeyPem)\n\tassert.Nil(t, err, \"read pem from kms pub key failed\")\n\n\t// tjfoc key -> pem -> new kms key\n\ttjPubKeyPem, err := x509.WritePublicKeyToPem(tjPubKey)\n\tassert.Nil(t, err, \"tjfoc pub key write to pem failed\")\n\ttransformedPubKey, err := pubKey.ReadFromPem(tjPubKeyPem)\n\tassert.Nil(t, err, \"kms pub key read from tjfoc failed\")\n\n\t// compare new kms key with origin\n\ttransformedPubKeyPem, err := transformedPubKey.WriteToPem()\n\tassert.Nil(t, err, \"transformed kms pub key write to pem failed\")\n\tassert.Equal(t, pubKeyPem, transformedPubKeyPem, \"transformed kms should equal the origin one\")\n}", "title": "" }, { "docid": "2c79eed2958aa27315c88bc70c8c21df", "score": "0.49658486", "text": "func Export(data Data) {\n\tcreateCDT(data)\n\tcreateATR(data)\n\tcreateGTR(data)\n}", "title": "" }, { "docid": "5c3c15b92c994e29de09fb638f051560", "score": "0.4965005", "text": "func (c *customCrypt) CreateDataKey(_ context.Context, _ string, _ *mcopts.DataKeyOptions) (bsoncore.Document, error) {\n\tc.numCreateDataKeyCalls++\n\treturn nil, nil\n}", "title": "" }, { "docid": "700d735e586bc42fba07761b258ab183", "score": "0.49510854", "text": "func SaveKeyPair(pubkey string, privkey string, pubfile string, privfile string) error {\n\t// saveKeyPair decodes the keys because PEM base64s them too, and decoding means that the pubkey in duck format is the same as the data in the PEM file. (which is nice but an arbitrary decision)\n\td, _ := base64.StdEncoding.DecodeString(privkey)\n\tb := pem.EncodeToMemory(&pem.Block{\n\t\tType: \"DUCKCOIN (ECDSA) PRIVATE KEY\",\n\t\tBytes: d,\n\t})\n\tif err := ioutil.WriteFile(privfile, b, 0600); err != nil {\n\t\treturn err\n\t}\n\n\td, _ = base64.StdEncoding.DecodeString(pubkey)\n\tb = pem.EncodeToMemory(&pem.Block{\n\t\tType: \"DUCKCOIN (ECDSA) PUBLIC KEY\",\n\t\tBytes: d,\n\t})\n\tif err := ioutil.WriteFile(pubfile, b, 0644); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "014d8fe202431ce512f35c9cbe25c97f", "score": "0.49327397", "text": "func doExport2() {\n\n\topts := &goleveldbOpt.Options{}\n\topts.OpenFilesCacher = goleveldbOpt.NoCacher\n\topts.OpenFilesCacheCapacity = -1\n\topts.ErrorIfMissing = true\n\topts.RecoverDumpChan = make(chan goleveldbOpt.RecoverDumpData, 100)\n\n\t// open dump file\n\tof, err := os.Create(DUMP_FILE)\n\tif err != nil {\n\t\tlog.Fatalf(\"create export file error: %s\", err.Error())\n\t}\n\n\tdefer of.Close()\n\n\tbw := bufio.NewWriter(of)\n\n\tkvs := int64(0)\n\n\tts := time.Now().UnixNano()\n\tts0 := ts\n\ttsSM := ts // 清理keySeqMap的计时器\n\n\tdone := make(chan int, 1)\n\ttype smt struct {\n\t\tseq uint64\n\t\tts int64\n\t}\n\tkeySeqMap := make(map[string]smt, 0)\n\n\tgo func() {\n\n\t\tfor {\n\t\t\tkv, ok := <-opts.RecoverDumpChan\n\t\t\tif !ok {\n\t\t\t\tdone <- 1\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tkey := kv.Key\n\t\t\tvalue := kv.Value\n\n\t\t\tif kv.KeyType != 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tskey := string(key)\n\t\t\tif sm, ok := keySeqMap[skey]; ok {\n\t\t\t\t// 更新的数据已经导出\n\t\t\t\tif sm.seq > kv.Seq {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// NOTE: 因为del数据回跳过,seq只比较有value的数据,因此可能会有部分已删除数据重新变成有效\n\n\t\t\t//log.Printf(\"key: %#v %d %d %s %d %s\", key, kv.Seq, kv.KeyType, string(key), len(value), string(value))\n\t\t\t// kvs++\n\t\t\t// if kvs > 100 {\n\t\t\t// \tos.Exit(0)\n\t\t\t// }\n\t\t\t// continue\n\n\t\t\tbw.WriteString(\"KL:\")\n\t\t\tkl := uint32(len(key))\n\t\t\tbuf := new(bytes.Buffer)\n\t\t\tbinary.Write(buf, binary.BigEndian, kl)\n\t\t\tbw.Write(buf.Bytes())\n\t\t\tbw.Write(key)\n\n\t\t\tbw.WriteString(\"VL:\")\n\t\t\tvl := uint32(len(value))\n\t\t\tbuf = new(bytes.Buffer)\n\t\t\tbinary.Write(buf, binary.BigEndian, vl)\n\t\t\tbw.Write(buf.Bytes())\n\t\t\tbw.Write(value)\n\t\t\tkvs += 1\n\t\t\t//log.Printf(\"%s : %s\", key, value)\n\t\t\tts2 := time.Now().UnixNano()\n\n\t\t\tkeySeqMap[skey] = smt{kv.Seq, ts2}\n\n\t\t\t//每分钟清理一次keySeqMap\n\t\t\tif ts2-tsSM > 60*1e9 {\n\n\t\t\t\tfor k, sm := range keySeqMap {\n\t\t\t\t\tif ts2-sm.ts > 59*1e9 {\n\t\t\t\t\t\tdelete(keySeqMap, k)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttsSM = ts2\n\t\t\t}\n\n\t\t\tif ts2-ts >= 1e9 {\n\t\t\t\tlog.Printf(\"export %d kvs, %d/s\", kvs, kvs/((ts2-ts0)/1e9))\n\t\t\t\tts = ts2\n\t\t\t}\n\n\t\t}\n\n\t}()\n\n\tdb, err := goleveldb.RecoverFile(DB_PATH, opts)\n\n\tif err != nil {\n\t\tlog.Fatalf(\"leveldb open error: %s\", err.Error())\n\t}\n\n\tclose(opts.RecoverDumpChan)\n\n\tdefer db.Close()\n\n\t//等待结束\n\t<-done\n\n\tbw.Flush()\n\n\tlog.Printf(\"export done, %d kvs.\", kvs)\n}", "title": "" }, { "docid": "61f45687527532f2620bfc1c81d819dc", "score": "0.4922596", "text": "func SetKeyData(ctx contextAPI.ChannelProvider, chaincodeID, key string,value string) fabAPI.TransactionID{\n\tchClient, err := channel.New(ctx)\n\tif err != nil {print(err)}\n\n\t// Synchronous transaction\n\trespone, e := chClient.Execute(\n\t\tchannel.Request{\n\t\t\tChaincodeID: chaincodeID,\n\t\t\tFcn: \"invoke\",\n\t\t\tArgs: CCTxSetArgs(key, value),\n\t\t},\n\t\tchannel.WithRetry(retry.DefaultChannelOpts))\n\n\tif e != nil {print(e)}\n\n\treturn respone.TransactionID\n}", "title": "" }, { "docid": "437c53d2eb5eb5985c52640585493610", "score": "0.49154067", "text": "func TestKeyWriteExternal(t *testing.T) {\n\tgmd := CreateTestGraphMetadata()\n\tnewKeyToBeExported := NewCompositeKey(gmd, \"key-1\")\n\tt.Logf(\"New Composite key '%+v' is created from '%+v'\", newKeyToBeExported, gmd)\n\n\t_ = newKeyToBeExported.SetOrCreateAttribute(\"LongDesc\", 1)\n\t_ = newKeyToBeExported.SetOrCreateAttribute(\"StringDesc\", \"2\")\n\t_ = newKeyToBeExported.SetOrCreateAttribute(\"BoolDesc\", true)\n\n\t//var network bytes.Buffer\n\toNetwork := iostream.DefaultProtocolDataOutputStream()\n\n\t_ = newKeyToBeExported.WriteExternal(oNetwork)\n\tt.Logf(\"EntityType WriteExternal exported entity type value '%+v' as '%+v'\", newKeyToBeExported, string(oNetwork.Buf))\n\n\tiNetwork := iostream.DefaultProtocolDataInputStream()\n\t_ = newKeyToBeExported.ReadExternal(iNetwork)\n\tt.Logf(\"EntityType ReadExternal imported entity type as '%+v'\", newKeyToBeExported)\n}", "title": "" }, { "docid": "2b8568987213b276cb40d49f773349cd", "score": "0.4909582", "text": "func (prv RSAPrivateKey) ExportPEM() ([]byte, error) {\n\tprivateASN1 := x509.MarshalPKCS1PrivateKey(prv.private)\n\n\tprivateBytes := pem.EncodeToMemory(&pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tBytes: privateASN1,\n\t})\n\n\treturn privateBytes, nil\n}", "title": "" }, { "docid": "44871d68c1076f03f858732c01bd17ae", "score": "0.49052775", "text": "func (k KeyMakingWrapper) GenerateDataEncryptionKeys(clientID []byte) error {\n\tctx := keystore.KeyContext{\n\t\tClientID: clientID,\n\t\tPurpose: keystore.PurposeStorageClientPrivateKey,\n\t}\n\n\terr := k.createKMSKeyFromContext(ctx, AcraClientKeyDescription)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn k.KeyMaking.GenerateDataEncryptionKeys(clientID)\n}", "title": "" }, { "docid": "78032453fbe3af10674b57893a1aceda", "score": "0.4903018", "text": "func KeyGen(suite abstract.Suite,\n\t\t\tkpath string) {\n\n\tvar kpubpath string = kpath\n\tvar kpripath string = kpath\n\tkpubpath = kpubpath + \".pub\"\n\tkpripath = kpripath + \".pri\"\n\n\tkeypair, err := crypto.SchnorrGenerateKeypair(suite)\n\tif err != nil {\n\t\tfmt.Println(\"Key generation failed\")\n\t\treturn\n\t}\n\tpubkey := crypto.SchnorrExtractPubkey(keypair)\n\n\tr := crypto.SchnorrSaveKeypair(kpripath, suite, keypair)\n\tif r != nil {\n\t\tfmt.Printf(\"Unable to write to %s\\n\", kpripath)\n\t\tfmt.Println(\"Error is\")\n\t\tfmt.Println(r.Error())\n\t\treturn\n\t}\n\tr = crypto.SchnorrSavePubkey(kpubpath, suite, pubkey)\n\tif r != nil {\n\t\tfmt.Printf(\"Unable to write to %s\\n\", kpubpath)\n\t\treturn\n\t}\n\tfmt.Println(\"Written private keypair to : \" + kpripath)\n\tfmt.Println(\"Written public key to : \" + kpubpath)\n}", "title": "" }, { "docid": "03ede6c60ab4312c9761002322443cab", "score": "0.49026775", "text": "func (e NominativeUsersExportRequestValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "61446aec5109a240a147e15d0bf4b2df", "score": "0.48990294", "text": "func export(ctx context.Context, ex *bulk.Export, keys *[]string, printer *printers.ResourcePrinter, client *bulk.BulkClient) {\n\t// create sync definition\n\tsync, err := client.Syncs.Create(ctx, &bulk.Sync{SyncedInstanceURI: ex.Uri})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\t// check sync status and download\n\tif err := waitSyncAndDownload(ctx, sync, keys, printer, client); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n}", "title": "" }, { "docid": "b2a6d64e3a18de96fb6825fa05d7e212", "score": "0.48875576", "text": "func (ks *KeyStore) ExportKeystore(address, password string )(string,error) {\n\n\taccount, err := utils.MakeAddress(ks.keystore, address)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Export the newly created account with a different passphrase. The returned\n\t// data from this method invocation is a JSON encoded, encrypted key-file\n\tkeyJson,err := ks.keystore.Export(account,password,password)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(keyJson),nil\n}", "title": "" }, { "docid": "985f9733650e0cd8f2ad5d5777a2349c", "score": "0.48691702", "text": "func genKey(walletHandle string) error {\n\tgenResponse, err := kmdClient.GenerateKey(walletHandle)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error generating key - %v\", err)\n\t}\n\tfmt.Printf(\"Generated address: %s\\n\", genResponse.Address)\n\n\treturn nil\n}", "title": "" }, { "docid": "d6e93f3a729b85e6d7e8cdbee20a75bd", "score": "0.48529422", "text": "func WriteKey(keyPath string, data []byte) error {\n\tif err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil {\n\t\treturn err\n\t}\n\treturn os.WriteFile(keyPath, data, os.FileMode(0600))\n}", "title": "" }, { "docid": "a041e223072a08e0be11e09151cea853", "score": "0.48446798", "text": "func (g *GnuPG) ExportPrivateKey(fingerprint fingerprint.Fingerprint, password string) (string, error) {\n\n\tstdout, stderr, err := g.runWithStdin(\n\t\tpassword,\n\t\tgetArgsExportPrivateKeyWithPinentry(fingerprint)...,\n\t)\n\n\tif err != nil {\n\t\tif strings.Contains(stderr, invalidOptionPinentryMode) { // TODO: is this really in stderr or in stdout?\n\t\t\tstdout, stderr, err := g.runWithStdin(\n\t\t\t\tpassword,\n\t\t\t\tgetArgsExportPrivateKeyWithoutPinentry(fingerprint)...,\n\t\t\t)\n\n\t\t\tif err != nil {\n\t\t\t\treturn stderr, err\n\t\t\t}\n\n\t\t\treturn checkValidExportPrivateOutput(stdout, stderr)\n\t\t} else if strings.Contains(stderr, loopbackUnsupported) {\n\t\t\tif version, err := g.Version(); err == nil && version == \"2.1.11\" {\n\t\t\t\treturn \"\", fmt.Errorf(\"for gpg-2.1.11, please see https://fluidkeys.com/tweak-gpg-2.1.11/\")\n\t\t\t}\n\t\t} else if strings.Contains(stderr, badPassphrase) || strings.Contains(stderr, noPassphrase) {\n\t\t\treturn stderr, &BadPasswordError{}\n\t\t}\n\n\t\treturn stderr, err\n\t}\n\n\treturn checkValidExportPrivateOutput(stdout, stderr)\n}", "title": "" }, { "docid": "e85771a553f1b26c14de306558b6b8d4", "score": "0.48293248", "text": "func (s *KeyStore) ExportKeyRings(paths []string, cryptosuite *crypto.KeyStoreSuite, mode keystoreV1.ExportMode) ([]byte, error) {\n\tkeyRings, err := s.exportKeyRings(paths, mode)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer zeroizeKeyRings(keyRings)\n\treturn s.encryptAndSignKeyRings(keyRings, cryptosuite)\n}", "title": "" }, { "docid": "e766a87b6a254d22492c6ebbc5635739", "score": "0.48230714", "text": "func generateKeysHelper(key *rsa.PrivateKey, data map[string][]byte) error {\n\tprivateKeyBytes := &bytes.Buffer{}\n\terr := pem.Encode(\n\t\tprivateKeyBytes,\n\t\t&pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(key)})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar publicKeyBytes []byte\n\tpublicKeyBytes, err = SSHPublicKeyForPrivateKey(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdata[SecretFieldPublicKey] = publicKeyBytes\n\tdata[SecretFieldPrivateKey] = privateKeyBytes.Bytes()\n\n\treturn nil\n}", "title": "" }, { "docid": "20a1d7b172bee3d367b4d3193f6e16a3", "score": "0.48206612", "text": "func (p *BasicInputPin) Export() (err error) {\n\tfmt.Printf(\"Exporting pin: %d\\n\", p.pin)\n\tif err := p.file.Write(GPIOPATH+\"/export\", strconv.Itoa(p.pin)); err != nil {\n\t\t// If EBUSY then the pin has already been exported\n\t\tif err.(*os.PathError).Err != syscall.EBUSY {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1a4625b9b85337cf4cf5ea8ebd202b86", "score": "0.4819571", "text": "func (p *policy) ExportResourceData(c cache.Container) map[string]string {\n\tgrant, ok := p.allocations.CPU[c.GetCacheID()]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\tdata := map[string]string{}\n\tshared := grant.SharedCPUs().String()\n\tisolated := grant.ExclusiveCPUs().Intersection(grant.GetNode().GetCPU().IsolatedCPUs())\n\texclusive := grant.ExclusiveCPUs().Difference(isolated).String()\n\n\tif shared != \"\" {\n\t\tdata[policyapi.ExportSharedCPUs] = shared\n\t}\n\tif isolated.String() != \"\" {\n\t\tdata[policyapi.ExportIsolatedCPUs] = isolated.String()\n\t}\n\tif exclusive != \"\" {\n\t\tdata[policyapi.ExportExclusiveCPUs] = exclusive\n\t}\n\n\treturn data\n}", "title": "" }, { "docid": "a63e6732e342378ee8885b9bd719bd30", "score": "0.48183146", "text": "func (im *IntMetric) Export(protocolKey ProtocolKeyType) int {\n\texportValue := 0\n\tim.mutex.RLock()\n\tif _, ok := im.protocolMetrics[protocolKey]; !ok {\n\t\tim.mutex.RUnlock()\n\t\treturn 0\n\t}\n\tim.protocolMetrics[protocolKey].mutex.Lock()\n\texportValue = im.protocolMetrics[protocolKey].value\n\tim.protocolMetrics[protocolKey].mutex.Unlock()\n\tim.mutex.RUnlock()\n\treturn exportValue\n}", "title": "" }, { "docid": "4312cc2915762974ba9fe5c41de05f49", "score": "0.48048514", "text": "func (a *AgentKeyManager) WriteKey(\n\tpriv crypto.PrivateKey,\n\tcert *ssh.Certificate,\n) error {\n\terr := a.agent.Add(agent.AddedKey{\n\t\tPrivateKey: priv,\n\t\tCertificate: cert,\n\t\tComment: a.getComment(cert),\n\t\tLifetimeSecs: getLifetimeSecs(cert),\n\t})\n\treturn errors.Wrap(err, \"could not add keys to agent\")\n}", "title": "" }, { "docid": "e2d1e8e9664d425e158342ebf0289075", "score": "0.4797456", "text": "func (s *SecretProvider) downloadKeys(ctx context.Context) error {\n\tc := httpClient(ctx)\n\n\tr, err := c.Get(s.jwksURL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to fetch %s: %v\", s.jwksURL, err)\n\t}\n\tdefer r.Body.Close()\n\n\tif h := r.Header.Get(\"Content-Type\"); !strings.HasPrefix(h, \"application/json\") {\n\t\treturn gauth0.ErrInvalidContentType\n\t}\n\n\tb, err := ioutil.ReadAll(r.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to read response body: %v\", err)\n\t}\n\n\tvar jwks gauth0.JWKS\n\tif err = json.Unmarshal(b, &jwks); err != nil {\n\t\treturn fmt.Errorf(\"failed to unmarshal %q: %v\", string(b), err)\n\t}\n\n\tif len(jwks.Keys) < 1 {\n\t\treturn gauth0.ErrNoKeyFound\n\t}\n\n\tfor _, key := range jwks.Keys {\n\t\ts.keys[key.KeyID] = key\n\t}\n\n\treturn nil\n}", "title": "" } ]
cc5045b8fe930dc2edb11273fd5e6b67
WithStatisticsComponentsName adds the statisticsComponentsName to the application collection get params
[ { "docid": "ff97c0a1d33575405d9801933d64bf95", "score": "0.7159856", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsName(statisticsComponentsName *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsName(statisticsComponentsName)\n\treturn o\n}", "title": "" } ]
[ { "docid": "be7aab682e3a172d6165831945939f85", "score": "0.6747647", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsName(statisticsComponentsName *string) {\n\to.StatisticsComponentsName = statisticsComponentsName\n}", "title": "" }, { "docid": "71eec9ce185f34adae7ec46e3ea9dd23", "score": "0.582821", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceUsed(statisticsComponentsSpaceUsed *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceUsed(statisticsComponentsSpaceUsed)\n\treturn o\n}", "title": "" }, { "docid": "6aa921833460181fa7ffdaac0a784e23", "score": "0.573137", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceUsedPercent(statisticsComponentsSpaceUsedPercent *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceUsedPercent(statisticsComponentsSpaceUsedPercent)\n\treturn o\n}", "title": "" }, { "docid": "7777746efa908c8155dafe39963b64e1", "score": "0.5694355", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSnapshotUsed(statisticsComponentsSnapshotUsed *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSnapshotUsed(statisticsComponentsSnapshotUsed)\n\treturn o\n}", "title": "" }, { "docid": "88a14e1d879d2d0bc8dee1232c247bc7", "score": "0.54058313", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceUsedExcludingReserves(statisticsComponentsSpaceUsedExcludingReserves *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceUsedExcludingReserves(statisticsComponentsSpaceUsedExcludingReserves)\n\treturn o\n}", "title": "" }, { "docid": "0855c0a83b82923069cf6137c95efddc", "score": "0.5338704", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceLogicalUsed(statisticsComponentsSpaceLogicalUsed *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceLogicalUsed(statisticsComponentsSpaceLogicalUsed)\n\treturn o\n}", "title": "" }, { "docid": "0b323fe5f278fa296e0a975f5eadf37c", "score": "0.5263116", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsLatencyAverage(statisticsComponentsLatencyAverage *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsLatencyAverage(statisticsComponentsLatencyAverage)\n\treturn o\n}", "title": "" }, { "docid": "1f3a9d6c48ebfc4f38cff2334dc85240", "score": "0.52461284", "text": "func (an *PlatformAppAnalytics) GetStatiscticsGroupComponents(GroupName string) (StatsGroupComponents, error) {\n var (\n rawRequest *RawRequest\n response []byte\n err error\n getStatiscticsGroupComponentsResponse StatsGroupComponents\n\t )\n\n \n\n \n\n \n \n \n \n \n \n \n //API call\n rawRequest = NewRequest(\n an.config,\n \"get\",\n fmt.Sprintf(\"/service/platform/analytics/v1.0/company/%s/application/%s/stats/group/%s\",an.CompanyID, an.ApplicationID, GroupName),\n nil,\n nil,\n nil)\n response, err = rawRequest.Execute()\n if err != nil {\n return StatsGroupComponents{}, err\n\t }\n \n err = json.Unmarshal(response, &getStatiscticsGroupComponentsResponse)\n if err != nil {\n return StatsGroupComponents{}, common.NewFDKError(err.Error())\n }\n return getStatiscticsGroupComponentsResponse, nil\n \n }", "title": "" }, { "docid": "eb31ce0f13521fcc9f3b6ee829507a1b", "score": "0.52040607", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsIopsTotal(statisticsComponentsIopsTotal *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsIopsTotal(statisticsComponentsIopsTotal)\n\treturn o\n}", "title": "" }, { "docid": "4befcd33a7b7d2fd3e1df05bf32edede", "score": "0.5196702", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsIopsPerTb(statisticsComponentsIopsPerTb *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsIopsPerTb(statisticsComponentsIopsPerTb)\n\treturn o\n}", "title": "" }, { "docid": "56d4abfcab6f279f0f9c56e6129bf19c", "score": "0.5193023", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSharedStoragePool(statisticsComponentsSharedStoragePool *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSharedStoragePool(statisticsComponentsSharedStoragePool)\n\treturn o\n}", "title": "" }, { "docid": "6ef2cc3a433221c5f90d92a48a32cf20", "score": "0.51892096", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceSavings(statisticsComponentsSpaceSavings *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceSavings(statisticsComponentsSpaceSavings)\n\treturn o\n}", "title": "" }, { "docid": "a39285fb1ca1f6355b7b3fc981a5ab6f", "score": "0.51789606", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsStorageServiceName(statisticsComponentsStorageServiceName *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsStorageServiceName(statisticsComponentsStorageServiceName)\n\treturn o\n}", "title": "" }, { "docid": "1a4f248c706e741de6f0c76feaf4aa38", "score": "0.5033314", "text": "func (an *PlatformAppAnalytics) GetComponentStats(ComponentName string) (StatsRes, error) {\n var (\n rawRequest *RawRequest\n response []byte\n err error\n getComponentStatsResponse StatsRes\n\t )\n\n \n\n \n\n \n \n \n \n \n \n \n //API call\n rawRequest = NewRequest(\n an.config,\n \"get\",\n fmt.Sprintf(\"/service/platform/analytics/v1.0/company/%s/application/%s/stats/component/%s\",an.CompanyID, an.ApplicationID, ComponentName),\n nil,\n nil,\n nil)\n response, err = rawRequest.Execute()\n if err != nil {\n return StatsRes{}, err\n\t }\n \n err = json.Unmarshal(response, &getComponentStatsResponse)\n if err != nil {\n return StatsRes{}, common.NewFDKError(err.Error())\n }\n return getComponentStatsResponse, nil\n \n }", "title": "" }, { "docid": "e809a5a25ac014c1275c8c728c11db5a", "score": "0.5031625", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSpaceUsed(statisticsComponentsSpaceUsed *string) {\n\to.StatisticsComponentsSpaceUsed = statisticsComponentsSpaceUsed\n}", "title": "" }, { "docid": "eac516e00997348cccf95ece2baf2fbe", "score": "0.49725485", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsLatencyAverage(statisticsComponentsLatencyAverage *string) {\n\to.StatisticsComponentsLatencyAverage = statisticsComponentsLatencyAverage\n}", "title": "" }, { "docid": "2df51f97e51319fe289551849659cf0a", "score": "0.4946247", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSnapshotUsed(statisticsComponentsSnapshotUsed *string) {\n\to.StatisticsComponentsSnapshotUsed = statisticsComponentsSnapshotUsed\n}", "title": "" }, { "docid": "dbd23caeee3bdce9abd273a5647ab928", "score": "0.4945208", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsLatencyRaw(statisticsComponentsLatencyRaw *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsLatencyRaw(statisticsComponentsLatencyRaw)\n\treturn o\n}", "title": "" }, { "docid": "ad7c0715a6d2077364d3756fe0a3606b", "score": "0.49167445", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceReservedUnused(statisticsComponentsSpaceReservedUnused *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceReservedUnused(statisticsComponentsSpaceReservedUnused)\n\treturn o\n}", "title": "" }, { "docid": "d208eb9b99baed19bfaab7a08491c108", "score": "0.48673022", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceAvailable(statisticsComponentsSpaceAvailable *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceAvailable(statisticsComponentsSpaceAvailable)\n\treturn o\n}", "title": "" }, { "docid": "92220d064239a29996a20cf13db666c1", "score": "0.48272282", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSnapshotUsed(statisticsSnapshotUsed *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSnapshotUsed(statisticsSnapshotUsed)\n\treturn o\n}", "title": "" }, { "docid": "12a881915dcc63e34859512b8102b8db", "score": "0.48009136", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSpaceUsed(statisticsSpaceUsed *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSpaceUsed(statisticsSpaceUsed)\n\treturn o\n}", "title": "" }, { "docid": "325bf636372043c3402309f15d13c6d5", "score": "0.47665372", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsStatisticsIncomplete(statisticsComponentsStatisticsIncomplete *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsStatisticsIncomplete(statisticsComponentsStatisticsIncomplete)\n\treturn o\n}", "title": "" }, { "docid": "681084f7cd00a7b678a145b469edb605", "score": "0.4742516", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSpaceUsedPercent(statisticsSpaceUsedPercent *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSpaceUsedPercent(statisticsSpaceUsedPercent)\n\treturn o\n}", "title": "" }, { "docid": "5631fa65079866ee3dc5ea9a6d0ff328", "score": "0.47370777", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsUUID(statisticsComponentsUUID *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsUUID(statisticsComponentsUUID)\n\treturn o\n}", "title": "" }, { "docid": "3a6f7756e61c1ab82d7e0ade78e86a1d", "score": "0.46711767", "text": "func (o *ApplicationCollectionGetParams) WithRpoComponentsName(rpoComponentsName *string) *ApplicationCollectionGetParams {\n\to.SetRpoComponentsName(rpoComponentsName)\n\treturn o\n}", "title": "" }, { "docid": "21e68139de3327ffef561bd8b407ea48", "score": "0.466207", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsIopsPerTb(statisticsIopsPerTb *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsIopsPerTb(statisticsIopsPerTb)\n\treturn o\n}", "title": "" }, { "docid": "de67b7079abc5e65488aec9ba901ced3", "score": "0.46595186", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSharedStoragePool(statisticsSharedStoragePool *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSharedStoragePool(statisticsSharedStoragePool)\n\treturn o\n}", "title": "" }, { "docid": "b9d08d548838bb8e299105bc429c2527", "score": "0.45896888", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSpaceUsedPercent(statisticsComponentsSpaceUsedPercent *string) {\n\to.StatisticsComponentsSpaceUsedPercent = statisticsComponentsSpaceUsedPercent\n}", "title": "" }, { "docid": "a5e13c349a60617776ca73e36da712d9", "score": "0.45854235", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSpaceUsedExcludingReserves(statisticsComponentsSpaceUsedExcludingReserves *string) {\n\to.StatisticsComponentsSpaceUsedExcludingReserves = statisticsComponentsSpaceUsedExcludingReserves\n}", "title": "" }, { "docid": "3b6ac635133bc81217da6515c6e316cd", "score": "0.45820808", "text": "func (c *GrpcClient) GetCollectionStatistics(ctx context.Context, collName string) (map[string]string, error) {\n\tif c.Service == nil {\n\t\treturn nil, ErrClientNotReady\n\t}\n\n\tif err := c.checkCollectionExists(ctx, collName); err != nil {\n\t\treturn nil, err\n\t}\n\n\treq := &milvuspb.GetCollectionStatisticsRequest{\n\t\tCollectionName: collName,\n\t}\n\tresp, err := c.Service.GetCollectionStatistics(ctx, req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := handleRespStatus(resp.GetStatus()); err != nil {\n\t\treturn nil, err\n\t}\n\treturn entity.KvPairsMap(resp.GetStats()), nil\n}", "title": "" }, { "docid": "8e87c291358d7bdff52733b73cef068c", "score": "0.45786503", "text": "func (*CountAggregatorConfig) Name() string {\n\treturn \"statcountaggregator\"\n}", "title": "" }, { "docid": "dc07b216fb2f8ee4b5149438344606d9", "score": "0.45713335", "text": "func getClusterStatsName(policy *config.Policy) string {\n\tif policy.EnvoyOpts != nil && policy.EnvoyOpts.Name != \"\" {\n\t\treturn policy.EnvoyOpts.Name\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "4527fdbb4551f67ebe8c23f0490b573d", "score": "0.45684946", "text": "func (o MetricStreamStatisticsConfigurationOutput) AdditionalStatistics() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v MetricStreamStatisticsConfiguration) []string { return v.AdditionalStatistics }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "64c5620567430290606ceb733fdeb5ad", "score": "0.4558348", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsIopsTotal(statisticsIopsTotal *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsIopsTotal(statisticsIopsTotal)\n\treturn o\n}", "title": "" }, { "docid": "d633ae75a9aeb609b7637f6a28f7d1a1", "score": "0.4543827", "text": "func (an *PlatformAppAnalytics) GetComponentStatsCSV(ComponentName string) ([]byte, error) {\n var (\n rawRequest *RawRequest\n response []byte\n err error\n \n\t )\n\n \n\n \n\n \n \n \n \n \n \n \n //API call\n rawRequest = NewRequest(\n an.config,\n \"get\",\n fmt.Sprintf(\"/service/platform/analytics/v1.0/company/%s/application/%s/stats/component/%s.csv\",an.CompanyID, an.ApplicationID, ComponentName),\n nil,\n nil,\n nil)\n response, err = rawRequest.Execute()\n if err != nil {\n return []byte{}, err\n\t }\n \n return response, nil\n \n }", "title": "" }, { "docid": "60eacf14c78fb8ea688e463749aaf232", "score": "0.4535917", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSpaceProvisioned(statisticsComponentsSpaceProvisioned *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSpaceProvisioned(statisticsComponentsSpaceProvisioned)\n\treturn o\n}", "title": "" }, { "docid": "f159ed4245f5fdf2d6d391c832ab21a8", "score": "0.44922125", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSharedStoragePool(statisticsComponentsSharedStoragePool *string) {\n\to.StatisticsComponentsSharedStoragePool = statisticsComponentsSharedStoragePool\n}", "title": "" }, { "docid": "8214555882af685366134765ace674de", "score": "0.44813257", "text": "func statisticName(statFmt StatStringFormat, pkgName string, statsGroupName string, fieldName string) string {\n\n\tswitch statFmt {\n\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"Unknown StatStringFormat '%v'\", statFmt))\n\n\tcase StatFormatParsable1:\n\t\tpkgName = scrubName(pkgName)\n\t\tstatsGroupName = scrubName(statsGroupName)\n\t\tfieldName = scrubName(fieldName)\n\n\t\tif pkgName == \"\" && statsGroupName == \"\" {\n\t\t\treturn fieldName\n\t\t}\n\t\tif pkgName == \"\" {\n\t\t\treturn statsGroupName + \".\" + fieldName\n\t\t}\n\t\tif statsGroupName == \"\" {\n\t\t\treturn pkgName + \".\" + fieldName\n\t\t}\n\t\treturn pkgName + \".\" + statsGroupName + \".\" + fieldName\n\t}\n}", "title": "" }, { "docid": "1e5b65c9af1ba17de88320d84b794b5b", "score": "0.44267598", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSpaceUsedExcludingReserves(statisticsSpaceUsedExcludingReserves *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSpaceUsedExcludingReserves(statisticsSpaceUsedExcludingReserves)\n\treturn o\n}", "title": "" }, { "docid": "3176cae3fff3fccc9d5820ddd113a33c", "score": "0.44003057", "text": "func (c *CloudWatch) GetMetricStatistics(req *GetMetricStatisticsRequest) (result *GetMetricStatisticsResponse, err error) {\n\tstatisticsSet := sets.SSet(req.Statistics...)\n\t// Kick out argument errors\n\tswitch {\n\tcase req.EndTime.IsZero():\n\t\terr = errors.New(\"No endTime specified\")\n\tcase req.StartTime.IsZero():\n\t\terr = errors.New(\"No startTime specified\")\n\tcase req.MetricName == \"\":\n\t\terr = errors.New(\"No metricName specified\")\n\tcase req.Namespace == \"\":\n\t\terr = errors.New(\"No Namespace specified\")\n\tcase req.Period < 60 || req.Period%60 != 0:\n\t\terr = errors.New(\"Period not 60 seconds or a multiple of 60 seconds\")\n\tcase len(req.Statistics) < 1:\n\t\terr = errors.New(\"No statistics supplied\")\n\tcase validMetricStatistics.Union(statisticsSet).Len() != validMetricStatistics.Len():\n\t\terr = errors.New(\"Invalid statistic values supplied\")\n\tcase req.Unit != \"\" && !validUnits.Member(req.Unit):\n\t\terr = errors.New(\"Unit is not a valid value\")\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Serialize all the params\n\tparams := aws.MakeParams(\"GetMetricStatistics\")\n\tparams[\"EndTime\"] = req.EndTime.UTC().Format(time.RFC3339)\n\tparams[\"StartTime\"] = req.StartTime.UTC().Format(time.RFC3339)\n\tparams[\"MetricName\"] = req.MetricName\n\tparams[\"Namespace\"] = req.Namespace\n\tparams[\"Period\"] = strconv.Itoa(req.Period)\n\tif req.Unit != \"\" {\n\t\tparams[\"Unit\"] = req.Unit\n\t}\n\n\t// Serialize the lists of data\n\tfor i, d := range req.Dimensions {\n\t\tprefix := \"Dimensions.member.\" + strconv.Itoa(i+1)\n\t\tparams[prefix+\".Name\"] = d.Name\n\t\tparams[prefix+\".Value\"] = d.Value\n\t}\n\tfor i, d := range req.Statistics {\n\t\tprefix := \"Statistics.member.\" + strconv.Itoa(i+1)\n\t\tparams[prefix] = d\n\t}\n\tresult = new(GetMetricStatisticsResponse)\n\terr = c.query(\"GET\", \"/\", params, result)\n\treturn\n}", "title": "" }, { "docid": "18e996e84d8fba314c187466f0d3daf5", "score": "0.43953422", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsIopsTotal(statisticsComponentsIopsTotal *string) {\n\to.StatisticsComponentsIopsTotal = statisticsComponentsIopsTotal\n}", "title": "" }, { "docid": "4ff0b8f7dd69c5cfa742cb89bc98a7e5", "score": "0.43877655", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsComponentsSnapshotReserve(statisticsComponentsSnapshotReserve *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsComponentsSnapshotReserve(statisticsComponentsSnapshotReserve)\n\treturn o\n}", "title": "" }, { "docid": "4ed036b90ba9c486c7dc756e451e6ad0", "score": "0.43170127", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSpaceLogicalUsed(statisticsComponentsSpaceLogicalUsed *string) {\n\to.StatisticsComponentsSpaceLogicalUsed = statisticsComponentsSpaceLogicalUsed\n}", "title": "" }, { "docid": "db228a9abadbb0f2faa999690233ebfb", "score": "0.43132502", "text": "func (client CampaignsClient) GetStatistics(ctx context.Context, kind CampaignKinds, ID int32, resourceGroupName string, appCollection string, appName string) (result CampaignStatisticsResult, err error) {\n\treq, err := client.GetStatisticsPreparer(ctx, kind, ID, resourceGroupName, appCollection, appName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"mobileengagement.CampaignsClient\", \"GetStatistics\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.GetStatisticsSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\terr = autorest.NewErrorWithError(err, \"mobileengagement.CampaignsClient\", \"GetStatistics\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.GetStatisticsResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"mobileengagement.CampaignsClient\", \"GetStatistics\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "6f3769ae1fef2803d7039a606959739e", "score": "0.43099734", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSpaceSavings(statisticsComponentsSpaceSavings *string) {\n\to.StatisticsComponentsSpaceSavings = statisticsComponentsSpaceSavings\n}", "title": "" }, { "docid": "6bae526578bd1027803968c0830ea3af", "score": "0.43051577", "text": "func (a *Client) GetStatistics(params *GetStatisticsParams, authInfo runtime.ClientAuthInfoWriter) (*GetStatisticsOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewGetStatisticsParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"GetStatistics\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/statistics\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"text/plain\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &GetStatisticsReader{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.(*GetStatisticsOK), nil\n\n}", "title": "" }, { "docid": "2aa126f0b73340ddbddc215c91d20516", "score": "0.4293647", "text": "func (o ApplicationComponentMonitoringSettingOutput) ComponentName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ApplicationComponentMonitoringSetting) *string { return v.ComponentName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9fe98387ac885032d21a16b638f27d85", "score": "0.4276536", "text": "func (o *ApplicationCollectionGetParams) WithName(name *string) *ApplicationCollectionGetParams {\n\to.SetName(name)\n\treturn o\n}", "title": "" }, { "docid": "d1e9206b6a97fe45a354bb88749e4b67", "score": "0.4271712", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsStorageServiceName(statisticsComponentsStorageServiceName *string) {\n\to.StatisticsComponentsStorageServiceName = statisticsComponentsStorageServiceName\n}", "title": "" }, { "docid": "3c5605f891460c5b0184b387d2229324", "score": "0.42671376", "text": "func servStatistics(w http.ResponseWriter, r *http.Request) {\n\tstats := make(map[string]interface{})\n\tresources := map[string]Stats{\"tcp\": tcpServer, \"udp\": udpServer, \"rest\": producer}\n\tfor k, v := range resources {\n\t\tif v == nil { // service is not enabled, skip\n\t\t\tcontinue\n\t\t}\n\n\t\ts, err := v.Statistics()\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"failed to get statistics for %s\", k)\n\t\t\thttp.Error(w, \"failed to get statistics for \"+k, http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tstats[k] = s\n\t}\n\n\tb, err := json.MarshalIndent(stats, \"\", \" \")\n\tif err != nil {\n\t\tlog.Error(\"Failed to JSON marshall statistics map\")\n\t\thttp.Error(w, \"failed to JSON marshall statistics map\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Write(b)\n}", "title": "" }, { "docid": "abacb0e2a9f585fb08394ff662b8bdb4", "score": "0.4261876", "text": "func (s *Service) Statistics(w http.ResponseWriter, r *http.Request) {\n\ts.lock.RLock()\n\tdefer s.lock.RUnlock()\n\n\twrite(w, http.StatusOK, StatisticsResponse{\n\t\tRequest: s.max,\n\t\tTotal: s.maxCounter,\n\t})\n}", "title": "" }, { "docid": "d3dbee3ea9251b157744ba56b4d0a971", "score": "0.4259786", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsLatencyRaw(statisticsComponentsLatencyRaw *string) {\n\to.StatisticsComponentsLatencyRaw = statisticsComponentsLatencyRaw\n}", "title": "" }, { "docid": "e9b70ae457889357c5c6271aa257580c", "score": "0.42563376", "text": "func (a *StatisticsApiService) StatisticsByPrimaryName(ctx _context.Context, localVarOptionals *StatisticsByPrimaryNameOpts) (ByPrimaryFacet, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue ByPrimaryFacet\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/statistics/by_primary_name\"\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Q.IsSet() {\n\t\tlocalVarQueryParams.Add(\"q\", parameterToString(localVarOptionals.Q.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.DateAttr.IsSet() {\n\t\tlocalVarQueryParams.Add(\"date_attr\", parameterToString(localVarOptionals.DateAttr.Value(), \"\"))\n\t}\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\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t}\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\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 ByPrimaryFacet\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = 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 := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "ac0f3e4287ccfec179c5dcd6c9c0fadd", "score": "0.42321107", "text": "func (c *LogsController) GetRequestStatistics() {\n\tc.Data[\"json\"] = toolbox.StatisticsMap.GetMapData()\n\tc.ServeJSON()\n}", "title": "" }, { "docid": "dbe3c5bf5564f33702e97dbc457f61ac", "score": "0.42291608", "text": "func WithStatsInterval(interval time.Duration) OptionFunc {\n\treturn func(c *Component) error {\n\t\tif interval <= 0 {\n\t\t\treturn errors.New(\"stats interval should be a positive number\")\n\t\t}\n\t\tc.statsCfg.interval = interval\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "542f7696f046df25d197aa8a98092727", "score": "0.42242244", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsIopsPerTb(statisticsComponentsIopsPerTb *string) {\n\to.StatisticsComponentsIopsPerTb = statisticsComponentsIopsPerTb\n}", "title": "" }, { "docid": "7549a8469777c3fa31b7c35b6a4eaec1", "score": "0.42153132", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsUUID(statisticsComponentsUUID *string) {\n\to.StatisticsComponentsUUID = statisticsComponentsUUID\n}", "title": "" }, { "docid": "292c0ea2653f96a6105c6a7851e8d966", "score": "0.42122412", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSpaceSavings(statisticsSpaceSavings *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSpaceSavings(statisticsSpaceSavings)\n\treturn o\n}", "title": "" }, { "docid": "c5447e8df220b0bdfae36c6f4914d9a5", "score": "0.41952464", "text": "func (s *Service) Statistics(tags map[string]string) []models.Statistic {\n\treturn []models.Statistic{{\n\t\tName: \"cq\",\n\t\tTags: tags,\n\t\tValues: map[string]interface{}{\n\t\t\tstatQueryOK: atomic.LoadInt64(&s.stats.QueryOK),\n\t\t\tstatQueryFail: atomic.LoadInt64(&s.stats.QueryFail),\n\t\t},\n\t}}\n}", "title": "" }, { "docid": "36370b953209f3d4be4a4ec677231c78", "score": "0.41944718", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsSpaceLogicalUsed(statisticsSpaceLogicalUsed *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsSpaceLogicalUsed(statisticsSpaceLogicalUsed)\n\treturn o\n}", "title": "" }, { "docid": "bc7d3e6f4ab90d0c39c9e71afb798325", "score": "0.41938132", "text": "func AddStatsWithName(b *testing.B, name string, numBuckets int) *Stats {\n\tvar benchName string\n\tfor i := 1; ; i++ {\n\t\tpc, _, _, ok := runtime.Caller(i)\n\t\tif !ok {\n\t\t\tpanic(\"benchmark function not found\")\n\t\t}\n\t\tp := strings.Split(runtime.FuncForPC(pc).Name(), \".\")\n\t\tbenchName = p[len(p)-1]\n\t\tif strings.HasPrefix(benchName, \"run\") {\n\t\t\tbreak\n\t\t}\n\t}\n\tprocs := runtime.GOMAXPROCS(-1)\n\tif procs != 1 {\n\t\tbenchName = fmt.Sprintf(\"%s-%d\", benchName, procs)\n\t}\n\n\tstats := NewStats(numBuckets)\n\n\tif injectCond != nil {\n\t\t// We need to wait until the previous benchmark stats is printed out.\n\t\tinjectCond.L.Lock()\n\t\tfor curB != nil && curBenchName != benchName {\n\t\t\tinjectCond.Wait()\n\t\t}\n\n\t\tcurB = b\n\t\tcurBenchName = benchName\n\t\tcurStats[name] = stats\n\n\t\tinjectCond.L.Unlock()\n\t}\n\n\tb.ResetTimer()\n\treturn stats\n}", "title": "" }, { "docid": "13b259d83e3aad125894a0b1e9da9142", "score": "0.41597587", "text": "func (o ServiceBindingRequestSpecCustomEnvVarValueFromConfigMapKeyRefPtrOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ServiceBindingRequestSpecCustomEnvVarValueFromConfigMapKeyRef) *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": "56c86c275cc19d8c764a2ad486f54de9", "score": "0.41568857", "text": "func (o ServiceBindingRequestSpecCustomEnvVarValueFromConfigMapKeyRefOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ServiceBindingRequestSpecCustomEnvVarValueFromConfigMapKeyRef) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "ec23231c6de58981e1a5933226100b29", "score": "0.41333234", "text": "func (a *StatisticsApiService) StatisticsByGroupOwner(ctx _context.Context, localVarOptionals *StatisticsByGroupOwnerOpts) (ByGroupOwnerFacet, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue ByGroupOwnerFacet\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/statistics/by_group_owner\"\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Q.IsSet() {\n\t\tlocalVarQueryParams.Add(\"q\", parameterToString(localVarOptionals.Q.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.DateAttr.IsSet() {\n\t\tlocalVarQueryParams.Add(\"date_attr\", parameterToString(localVarOptionals.DateAttr.Value(), \"\"))\n\t}\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\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t}\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\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 ByGroupOwnerFacet\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = 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 := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "a9f253da49251d4063452818c1a26ae3", "score": "0.41304445", "text": "func (o *SnmpUsersCollectionGetParams) WithName(name *string) *SnmpUsersCollectionGetParams {\n\to.SetName(name)\n\treturn o\n}", "title": "" }, { "docid": "92648596657ad5cf86b37a4e4ab33b07", "score": "0.41020885", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsLatencyAverage(statisticsLatencyAverage *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsLatencyAverage(statisticsLatencyAverage)\n\treturn o\n}", "title": "" }, { "docid": "1dcb5f49594fdfe6493483d06c8da460", "score": "0.40995952", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsSpaceAvailable(statisticsComponentsSpaceAvailable *string) {\n\to.StatisticsComponentsSpaceAvailable = statisticsComponentsSpaceAvailable\n}", "title": "" }, { "docid": "929f6bc7d77b8979b5b1862707aed01b", "score": "0.40979266", "text": "func ComponentStatisticsHandler(c buffalo.Context) error {\n\tstats, found := stats.GetHistoricalStats(c.Param(\"component_id\"))\n\tif found {\n\t\treturn c.Render(200, r.JSON(stats))\n\t}\n\treturn c.Render(404, r.JSON(\"Not found\"))\n}", "title": "" }, { "docid": "1c6dc858eff7aac37698704b0c3c9d44", "score": "0.40947628", "text": "func (o *ActiveDirectoryCollectionGetParams) WithName(name *string) *ActiveDirectoryCollectionGetParams {\n\to.SetName(name)\n\treturn o\n}", "title": "" }, { "docid": "b4cbd1d75be55127830058d84613fa02", "score": "0.4093071", "text": "func (o *IscsiServiceCollectionGetParams) WithStatisticsStatus(statisticsStatus *string) *IscsiServiceCollectionGetParams {\n\to.SetStatisticsStatus(statisticsStatus)\n\treturn o\n}", "title": "" }, { "docid": "32a3258185bb74ca527feb69bc0732a3", "score": "0.40756267", "text": "func getConfigMapName(m *mobilesecurityservicev1alpha1.MobileSecurityServiceBind) string {\n\treturn m.Spec.AppName + SDK\n}", "title": "" }, { "docid": "71d3cf069f14167478b44c594494b6e7", "score": "0.40661377", "text": "func poolName(endpointsNamespace, endpointsName string) string {\n\treturn fmt.Sprintf(\"openshift_%s_%s\", endpointsNamespace, endpointsName)\n}", "title": "" }, { "docid": "4017d7c4b5faae403b79465573f204cf", "score": "0.40470272", "text": "func apiRequestStats(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"%v\", Statistics)\n}", "title": "" }, { "docid": "d9f7fa10dceff9bf496253d31be2dc82", "score": "0.4036424", "text": "func (o *ApplicationCollectionGetParams) WithStatisticsStatisticsIncomplete(statisticsStatisticsIncomplete *string) *ApplicationCollectionGetParams {\n\to.SetStatisticsStatisticsIncomplete(statisticsStatisticsIncomplete)\n\treturn o\n}", "title": "" }, { "docid": "e99205a17c99d3bbaca8f739729aed5c", "score": "0.40290827", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsComponentsStatisticsIncomplete(statisticsComponentsStatisticsIncomplete *string) {\n\to.StatisticsComponentsStatisticsIncomplete = statisticsComponentsStatisticsIncomplete\n}", "title": "" }, { "docid": "311dc4f59cbbd3ea0bb83ddac93413e3", "score": "0.40266898", "text": "func (o *SnapshotCollectionGetParams) WithName(name *string) *SnapshotCollectionGetParams {\n\to.SetName(name)\n\treturn o\n}", "title": "" }, { "docid": "9cb6f1c88c2d45ef1983967b07d62feb", "score": "0.4024639", "text": "func (o *NSPort) Statistics(info *bambou.FetchingInfo) (StatisticsList, *bambou.Error) {\n\n\tvar list StatisticsList\n\terr := bambou.CurrentSession().FetchChildren(o, StatisticsIdentity, &list, info)\n\treturn list, err\n}", "title": "" }, { "docid": "fd552f9990ce9e93ffef5b87e4452650", "score": "0.40140215", "text": "func (b *GraphServiceRequestBuilder) Activitystatistics() *GraphServiceActivitystatisticsCollectionRequestBuilder {\n\tbb := &GraphServiceActivitystatisticsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}\n\tbb.baseURL += \"/activitystatistics\"\n\treturn bb\n}", "title": "" }, { "docid": "d7fe476ee2462d80550acc615c728238", "score": "0.4007092", "text": "func (p Provider) ComponentName() string {\n\treturn p.cRef.ref\n}", "title": "" }, { "docid": "c006854d3d8406e63b3417d5d5adb0f8", "score": "0.4006784", "text": "func TempStatistics(ctx *gin.Context) {\n\tvar temp template.TemplateVo\n\tvar msg errors.ErrModel\n\tif err := ctx.ShouldBind(&temp); err != nil {\n\t\tmsg = errors.ErrModel{Code: errors.Failed, Err: errors.SYSTEM_ERROR}\n\t}\n\tmsg = template.TempStatistics(temp.AppName)\n\tmsg.RetErr(ctx)\n}", "title": "" }, { "docid": "e9e576c01c08ad388a7edb6c9ed5f0c4", "score": "0.40038082", "text": "func GetEnvVarsConfigMapName(componentName string) string {\n\treturn fmt.Sprintf(\"%s-%s\", envVarsPrefix, componentName)\n}", "title": "" }, { "docid": "e951d0189c0981bf64e2b38ef5bdd768", "score": "0.40031895", "text": "func WithSnapshotCollectionName(snapshotColl string) Option {\n\treturn func(s *EventStore) error {\n\t\tif err := mongoutils.CheckCollectionName(snapshotColl); err != nil {\n\t\t\treturn fmt.Errorf(\"snapshot collection: %w\", err)\n\t\t}\n\n\t\tdb := s.events.Database()\n\t\ts.snapshots = db.Collection(snapshotColl)\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "faa39f94197b2735f02c4cb01df38b2b", "score": "0.3991048", "text": "func (o ApplicationCustomComponentOutput) ComponentName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ApplicationCustomComponent) string { return v.ComponentName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "8d77d6d10668fbad3d57a79f20c64c67", "score": "0.3988913", "text": "func FormatConfigMapVSName(cm *v1.ConfigMap) string {\n\tVSprefix := \"cfgmap\"\n\tif _, err := strconv.Atoi(cm.ObjectMeta.Namespace[0:1]); err == nil {\n\t\treturn fmt.Sprintf(\"%s_%s_%s\", VSprefix, cm.ObjectMeta.Namespace, cm.ObjectMeta.Name)\n\t} else {\n\t\treturn fmt.Sprintf(\"%s_%s\", cm.ObjectMeta.Namespace, cm.ObjectMeta.Name)\n\t}\n}", "title": "" }, { "docid": "a049b81954044f980191f17cbb7793de", "score": "0.39840588", "text": "func GetChannelStatisticsHandler(c *gin.Context) {\n\tf := httputil.NewGinframework(c)\n\tlog.Infof(\"[Channel Resource] Request to GetChannelStatisticsHandler, %s\", c.Request.URL.String())\n\teventFilters := strings.Split(c.Query(\"event\"), \",\")\n\n\tif len(eventFilters) == 1 && eventFilters[0] == \"\" {\n\t\teventFilters = []string{}\n\t}\n\n\tlog.Infof(\"[Channel Resource] Request Detail, AppID : %s, Channel : %s, Granularity : %s, Limit : %s, Start : %s, End : %s, Os : %s\", c.Param(\"appid\"), c.Query(\"channel\"), c.Query(\"gran\"), c.Query(\"limit\"), c.Query(\"start\"), c.Query(\"end\"), c.Query(\"os\"))\n\tlimit, err := deepstats.GetLimit(c)\n\tif err != nil {\n\t\tf.WriteHTTPError(api.ErrDeepstatsGetLimitFailed, err.Error())\n\t\treturn\n\t}\n\tconvertEventFilters := transmit.RequisiteAttrs(eventFilters, c.Query(\"gran\"))\n\n\tresdata := map[string][]map[string]string{}\n\tvar oskeys []string\n\n\tif c.Query(\"groupby\") == \"os\" {\n\t\toskeys = []string{\"\", \"ios\", \"android\"}\n\t} else {\n\t\toskeys = []string{\"\"}\n\t}\n\n\tfor _, osName := range oskeys {\n\t\tcounters, err := deepstats.GetChannelCounters(c.Param(\"appid\"), c.Query(\"channel\"), convertEventFilters, c.Query(\"gran\"), c.Query(\"start\"), c.Query(\"end\"), c.Query(\"limit\"), osName)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"[Channel Resource] Get deepstats channel counts failed! Err Msg=%v\", err)\n\t\t\tf.WriteHTTPError(api.ErrDeepstatsGetCounterFailed, err.Error())\n\t\t\treturn\n\t\t}\n\t\t// make key \"all\" in response\n\t\tif osName == \"\" {\n\t\t\tosName = \"all\"\n\t\t}\n\t\tresdata[osName] = transmit.Calculate(eventFilters, convertEventFilters, counters, c.Query(\"gran\"), limit)\n\t}\n\n\tlog.Debugf(\"[--Result][handler][GetChannelStatisticsHandler] resdata=%v\", resdata)\n\tf.WriteData(http.StatusOK, resdata)\n}", "title": "" }, { "docid": "178a8a194e93f0db765932f3e90f880c", "score": "0.3975227", "text": "func GetMetricsConfigName() string {\n\treturn metrics.ConfigMapName()\n}", "title": "" }, { "docid": "db082c193d18ebbeafba2faa087bd5a2", "score": "0.39682856", "text": "func (o MetricStreamStatisticsMetricOutput) MetricName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v MetricStreamStatisticsMetric) string { return v.MetricName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "2261f0b98030494897ce63e53e3447d6", "score": "0.39652947", "text": "func EncodeByCatalogKindNameRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error {\n\treturn func(req *http.Request, v interface{}) error {\n\t\tp, ok := v.(*resource.ByCatalogKindNamePayload)\n\t\tif !ok {\n\t\t\treturn goahttp.ErrInvalidType(\"resource\", \"ByCatalogKindName\", \"*resource.ByCatalogKindNamePayload\", v)\n\t\t}\n\t\tvalues := req.URL.Query()\n\t\tif p.Pipelinesversion != nil {\n\t\t\tvalues.Add(\"pipelinesversion\", *p.Pipelinesversion)\n\t\t}\n\t\treq.URL.RawQuery = values.Encode()\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "8460e260d31c5fc49c88d45fcc66a4f3", "score": "0.39581382", "text": "func (*BGPCollector) Name() string {\n\treturn bgpSubsystem\n}", "title": "" }, { "docid": "ea7c8833645db7d92bff4110fe72580a", "score": "0.39517483", "text": "func (c *CassandraCollector) Name() string {\n\treturn c.Config.Collector\n}", "title": "" }, { "docid": "11c84cb83da86e4e9d2c9e0d1d90e57a", "score": "0.3948737", "text": "func (hc *SystemInfoCollector) GetName() string {\n\treturn systemInfoCollectorName\n}", "title": "" }, { "docid": "b83f8efd2fbc321e7bfa25de7cb46162", "score": "0.39469844", "text": "func (an *PlatformAppAnalytics) GetStatiscticsGroups() (StatsGroups, error) {\n var (\n rawRequest *RawRequest\n response []byte\n err error\n getStatiscticsGroupsResponse StatsGroups\n\t )\n\n \n\n \n\n \n \n \n \n \n //API call\n rawRequest = NewRequest(\n an.config,\n \"get\",\n fmt.Sprintf(\"/service/platform/analytics/v1.0/company/%s/application/%s/stats/group\",an.CompanyID, an.ApplicationID),\n nil,\n nil,\n nil)\n response, err = rawRequest.Execute()\n if err != nil {\n return StatsGroups{}, err\n\t }\n \n err = json.Unmarshal(response, &getStatiscticsGroupsResponse)\n if err != nil {\n return StatsGroups{}, common.NewFDKError(err.Error())\n }\n return getStatiscticsGroupsResponse, nil\n \n }", "title": "" }, { "docid": "281ec3c20321d7430a60f866317a6e3b", "score": "0.39311445", "text": "func (o *NvmeSubsystemMapCollectionGetParams) WithSubsystemName(subsystemName *string) *NvmeSubsystemMapCollectionGetParams {\n\to.SetSubsystemName(subsystemName)\n\treturn o\n}", "title": "" }, { "docid": "106bf7b4ec2a4ed1fcb41560970954c1", "score": "0.3929198", "text": "func (o *NvmeSubsystemMapCollectionGetParams) WithNamespaceName(namespaceName *string) *NvmeSubsystemMapCollectionGetParams {\n\to.SetNamespaceName(namespaceName)\n\treturn o\n}", "title": "" }, { "docid": "a7466a1e9aa626a837d669ea5bb2b2fe", "score": "0.39229316", "text": "func (o *SwitchPortCollectionGetParams) WithStatisticsTransmitRawPackets(statisticsTransmitRawPackets *int64) *SwitchPortCollectionGetParams {\n\to.SetStatisticsTransmitRawPackets(statisticsTransmitRawPackets)\n\treturn o\n}", "title": "" }, { "docid": "99f27e805b227e6ade5e1dea9e38814a", "score": "0.39119592", "text": "func GetStat(w http.ResponseWriter, r *http.Request) {\n\tname := mux.Vars(r)[\"name\"]\n\n\tstat, err := service.GetAggregatedStats(name)\n\n\tif err != nil {\n\t\terrors.WriteError(w, r, errors.InternalError(err.Error(), \"Failed to get statistics for service \"+name+\".\"))\n\t\treturn\n\t}\n\n\tjson.NewEncoder(w).Encode(stat)\n}", "title": "" }, { "docid": "7b42b14da616964fb7d1df030c6525bb", "score": "0.39105597", "text": "func DBStatsCollection(colName string) (bson.M, error) {\n\tresult := bson.M{}\n\terr := _instance.Session.DB(\"tat\").Run(bson.D{{Name: \"collStats\", Value: colName},\n\t\t{Name: \"scale\", Value: 1024},\n\t\t{Name: \"indexDetails\", Value: true},\n\t}, &result)\n\treturn result, err\n}", "title": "" }, { "docid": "b363f212c65183bd3dd28b4fe3760ae3", "score": "0.39094198", "text": "func CreateDescribeTotalStatisticsRequest() (request *DescribeTotalStatisticsRequest) {\n\trequest = &DescribeTotalStatisticsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"aegis\", \"2016-11-11\", \"DescribeTotalStatistics\", \"vipaegis\", \"openAPI\")\n\treturn\n}", "title": "" }, { "docid": "c3c49b91c1bec9b69b827d1b8312562f", "score": "0.39061853", "text": "func (o *ApplicationCollectionGetParams) SetStatisticsSnapshotUsed(statisticsSnapshotUsed *string) {\n\to.StatisticsSnapshotUsed = statisticsSnapshotUsed\n}", "title": "" } ]
afa1ebeaeb133024a5ca43120d9cac4f
SetIsEnabled sets the isEnabled property value. Indicates whether the permission is enabled.
[ { "docid": "6a3e6a893e997323bb4eda1466e2293f", "score": "0.81128633", "text": "func (m *ResourceSpecificPermission) SetIsEnabled(value *bool)() {\n m.isEnabled = value\n}", "title": "" } ]
[ { "docid": "7e175093f610d95f8d4f27eda5192bab", "score": "0.78203493", "text": "func (o *SensitiveDataScannerGroupAttributes) SetIsEnabled(v bool) {\n\to.IsEnabled = &v\n}", "title": "" }, { "docid": "56c2c84ee3fbd5b9c00235f1ac1c531e", "score": "0.77920675", "text": "func (o *VolumeAutosizeAttributesType) SetIsEnabled(newValue bool) *VolumeAutosizeAttributesType {\n\to.IsEnabledPtr = &newValue\n\treturn o\n}", "title": "" }, { "docid": "1c41a310cfae1326f039f7c88b50d073", "score": "0.7673978", "text": "func (m *PermissionScope) SetIsEnabled(value *bool)() {\n err := m.GetBackingStore().Set(\"isEnabled\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "9d11023df7dc289ff386f83d604fef5c", "score": "0.76140237", "text": "func (o *LogsDateRemapper) SetIsEnabled(v bool) {\n\to.IsEnabled = &v\n}", "title": "" }, { "docid": "bdb197eed1bd7dbc2d79436e801beea1", "score": "0.7590844", "text": "func (o *LogsPipeline) SetIsEnabled(v bool) {\n\to.IsEnabled = &v\n}", "title": "" }, { "docid": "8eb0a1d70a788c5a8d7c096ef7254786", "score": "0.74329126", "text": "func (m *UnifiedRoleManagementPolicyAuthenticationContextRule) SetIsEnabled(value *bool)() {\n m.isEnabled = value\n}", "title": "" }, { "docid": "029f3915672c3e7257f2af3f0739b662", "score": "0.6781824", "text": "func (m *ContinuousAccessEvaluationPolicy) SetIsEnabled(value *bool)() {\n err := m.GetBackingStore().Set(\"isEnabled\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "63575eb03bd0b1f9cb4b7bcabd0a6e71", "score": "0.67646986", "text": "func (m *UserFlowLanguageConfiguration) SetIsEnabled(value *bool)() {\n m.isEnabled = value\n}", "title": "" }, { "docid": "5ea43f85e9b9abeb93aa73567f06af5f", "score": "0.66792923", "text": "func SetIsEnabled(ctx context.Context, enabled bool) context.Context {\n\treturn context.WithValue(ctx, isEnabledFlag, enabled)\n}", "title": "" }, { "docid": "d62a559f4c02629d72fee86f72ff99b5", "score": "0.6512469", "text": "func (o *PayloadDescription) SetEnabled(v bool) {\n\to.Enabled = v\n}", "title": "" }, { "docid": "0eb3e0fd8fbb590d09c25aa4b973ebbc", "score": "0.6355603", "text": "func (o *SensitiveDataScannerGroupAttributes) GetIsEnabled() bool {\n\tif o == nil || o.IsEnabled == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.IsEnabled\n}", "title": "" }, { "docid": "2941a696eef6234797d7af0f5ac1072b", "score": "0.63534486", "text": "func (fc *FeatureCreate) SetEnabled(b bool) *FeatureCreate {\n\tfc.mutation.SetEnabled(b)\n\treturn fc\n}", "title": "" }, { "docid": "dde18063baf303206895bdf0e3c76f23", "score": "0.62999606", "text": "func (o *RumMetric) SetEnabled(v bool) {\n\to.Enabled = v\n}", "title": "" }, { "docid": "9841c3ee0f9054b162608e64137b7da3", "score": "0.6232953", "text": "func (o *CsvPayloadDescription) SetEnabled(v bool) {\n\to.Enabled = v\n}", "title": "" }, { "docid": "a864cd038fb109452900bd00ef15aba3", "score": "0.6202543", "text": "func (o FirewallPolicyInsightsResponseOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v FirewallPolicyInsightsResponse) *bool { return v.IsEnabled }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "04c38864ce7e7be72e8ce68cf6bc3a9b", "score": "0.6194698", "text": "func (o FirewallPolicyInsightsOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v FirewallPolicyInsights) *bool { return v.IsEnabled }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "1e934454401d7dff256a6b5cb5b598b9", "score": "0.61830425", "text": "func (o *CustconfBandwidthRateLimit) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "cb2fc3b27ddeaa6d36a9989e04234386", "score": "0.6165731", "text": "func (m *ResourceSpecificPermission) GetIsEnabled()(*bool) {\n return m.isEnabled\n}", "title": "" }, { "docid": "e9a16a10fe644d64426c5bee8da38a82", "score": "0.6164967", "text": "func (s *EventSubscription) SetEnabled(v bool) *EventSubscription {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "915230dfde0b1ef9ea13f5f36477a9e6", "score": "0.6157265", "text": "func (i *Ios) SetEnabled(enabled bool) {\n\ti.enabled = enabled\n}", "title": "" }, { "docid": "822b5823625350ef9ef3f906dca2235d", "score": "0.61299175", "text": "func (o *CredentialsResponsePUT) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "37480831ac7b874012d0d26255c77b93", "score": "0.6108739", "text": "func (o *LogsDateRemapper) GetIsEnabled() bool {\n\tif o == nil || o.IsEnabled == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.IsEnabled\n}", "title": "" }, { "docid": "7acc0b9af3bb3c8d7e34c9960d9fe327", "score": "0.60710084", "text": "func (o *InlineResponse20039PersonIntegrationsMicrosoftConnector) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "6326a5edb4bcb0b8740b42ec45d23f35", "score": "0.6046393", "text": "func (o *CustomEffect) SetEnabled(v bool) {\n\to.Enabled = v\n}", "title": "" }, { "docid": "d44118fbfb8f7948312fde1fc3c7a29a", "score": "0.6001405", "text": "func (o *OrganizationSettingsSamlAutocreateUsersDomains) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "5ddcb31b44d49aa2d65ecd7426a4b74b", "score": "0.5996829", "text": "func (s *CredentialSummary) SetEnabled(v bool) *CredentialSummary {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "e74770a861b83022d35d2ab349237304", "score": "0.5972338", "text": "func (s *CreateEventSubscriptionInput) SetEnabled(v bool) *CreateEventSubscriptionInput {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "e313a3beda86cfe907a5e6dbc3b2bde6", "score": "0.59654826", "text": "func (s *TrustAnchorDetail) SetEnabled(v bool) *TrustAnchorDetail {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "83240ab594b77e7132c22b944102f3bd", "score": "0.5965111", "text": "func (o *SmtpPolicyAllOf) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "83240ab594b77e7132c22b944102f3bd", "score": "0.5965111", "text": "func (o *SmtpPolicyAllOf) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "9a772fc648b48263f45b99a3f9fdf79b", "score": "0.5938973", "text": "func (s *SubjectSummary) SetEnabled(v bool) *SubjectSummary {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "1121bf9dc138799efef6d6e58d90c195", "score": "0.59378016", "text": "func (s *ModifyEventSubscriptionInput) SetEnabled(v bool) *ModifyEventSubscriptionInput {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "ad15a5a7214c122fb153545ff06a9847", "score": "0.5919574", "text": "func (s *CreateTrustAnchorInput) SetEnabled(v bool) *CreateTrustAnchorInput {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "a08b9a5b9d237e33c5b775931b3d5a10", "score": "0.5909997", "text": "func (s *SubjectDetail) SetEnabled(v bool) *SubjectDetail {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "e46b1141c382d76ce9605561dc0b422d", "score": "0.5908323", "text": "func (e *EventPublisher) SetEnabled(eN bool) {\n\te.Enabled = eN\n}", "title": "" }, { "docid": "28e2dd63c8a0a7d4d3548b27b277458d", "score": "0.59014916", "text": "func (s *NotificationSetting) SetEnabled(v bool) *NotificationSetting {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "1f7f36b00e8ea07ac0e55eb01282e0a9", "score": "0.5892636", "text": "func (c *TrustedClusterV2) SetEnabled(e bool) {\n\tc.Spec.Enabled = e\n}", "title": "" }, { "docid": "8bf182aeafee7b17ea3e22c0903b5111", "score": "0.5881956", "text": "func (m *PermissionScope) GetIsEnabled()(*bool) {\n val, err := m.GetBackingStore().Get(\"isEnabled\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*bool)\n }\n return nil\n}", "title": "" }, { "docid": "6a750b3add95998a7d88a8cc9f2dcba6", "score": "0.58755636", "text": "func (o *LogsPipeline) GetIsEnabled() bool {\n\tif o == nil || o.IsEnabled == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\treturn *o.IsEnabled\n}", "title": "" }, { "docid": "13f1c1e0e02f089030fade5fa8b2d1ac", "score": "0.5843757", "text": "func (o FirewallPolicyInsightsPtrOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *FirewallPolicyInsights) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.IsEnabled\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "9d38b3ef4d22ac56abb7808395c9a79e", "score": "0.5831976", "text": "func (in *ActionVpsFeatureUpdateInput) SetEnabled(value bool) *ActionVpsFeatureUpdateInput {\n\tin.Enabled = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Enabled\"] = nil\n\treturn in\n}", "title": "" }, { "docid": "5e8e7a8ff0560b6c2198c2b24c309fb9", "score": "0.58319396", "text": "func (o *TrafficSpikeDetectionConfig) SetEnabled(v bool) {\n\to.Enabled = v\n}", "title": "" }, { "docid": "503e9d90039b21a6b41f7a1a60308b37", "score": "0.5816013", "text": "func (s *CreateProfileInput) SetEnabled(v bool) *CreateProfileInput {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "f53751b872b939badeadd76f8e849ef0", "score": "0.5801856", "text": "func (s *CloudWatchLogsConfiguration) SetEnabled(v bool) *CloudWatchLogsConfiguration {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "37eb64536a4c24ceb1b8c91d03bfb60e", "score": "0.57967925", "text": "func (s *NotificationSettingDetail) SetEnabled(v bool) *NotificationSettingDetail {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "7cba626b79bc6c7179d2cee1e81ffb3d", "score": "0.57883626", "text": "func (o FirewallPolicyInsightsResponsePtrOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *FirewallPolicyInsightsResponse) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.IsEnabled\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "723fd4068d9dafd1ce0e8f33dc52d75d", "score": "0.5782994", "text": "func (s *AcknowledgeFlow) SetEnabled(v bool) *AcknowledgeFlow {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "ac56628bf8a2eb97a41f323f6d988f57", "score": "0.57620466", "text": "func (s *ProfileDetail) SetEnabled(v bool) *ProfileDetail {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "d321d35ab09108b1bf22ee81e1b8aa13", "score": "0.57557267", "text": "func (o AllowlistCustomAlertRuleResponseOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v AllowlistCustomAlertRuleResponse) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "4294f0262364cd593232cb1ef16edfd1", "score": "0.5739952", "text": "func (o DenylistCustomAlertRuleResponseOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v DenylistCustomAlertRuleResponse) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "66a6a6afca31e01b90e164c74d5357a4", "score": "0.57143044", "text": "func (m *gerritTriggerSpec) SetEnabled(val bool) {\n\tm.enabledField = val\n}", "title": "" }, { "docid": "932004b9f7c1ab5b372b5da338d8f1ae", "score": "0.5702119", "text": "func IsEnabled(ctx context.Context) bool {\n\telem := ctx.Value(isEnabledFlag)\n\tif elem == nil {\n\t\treturn false\n\t}\n\treturn elem.(bool)\n}", "title": "" }, { "docid": "4d3a4b2991aae5158f75067e0af16d91", "score": "0.56898016", "text": "func (o DenylistCustomAlertRuleOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v DenylistCustomAlertRule) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "f4fe252df57490293df8cc25034fcff6", "score": "0.5680378", "text": "func (o SecurityMonitoringFilterOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v *SecurityMonitoringFilter) pulumi.BoolOutput { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "1021988c9ae002901e064a14d142967c", "score": "0.56793076", "text": "func (o AllowlistCustomAlertRuleOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v AllowlistCustomAlertRule) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "6574a981e17aa042c5c32b26b050ff50", "score": "0.5635913", "text": "func (s *ImportCrlInput) SetEnabled(v bool) *ImportCrlInput {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "f849beb8ab232ab29875265b4d758f05", "score": "0.5627984", "text": "func (j JointBase) SetEnabled(isEnabled bool) {\n\tif isEnabled {\n\t\tC.dJointEnable(j.c())\n\t} else {\n\t\tC.dJointDisable(j.c())\n\t}\n}", "title": "" }, { "docid": "8ba202a7b756ad13221e5b1cdde710fb", "score": "0.5615133", "text": "func (o *WorkflowCancelableTypeAllOf) SetEnabled(v bool) {\n\to.Enabled = &v\n}", "title": "" }, { "docid": "587560b25ee71cc11baa2eee757fa372", "score": "0.56127715", "text": "func (o *ContentProvider) SetEnable(v bool) {\n\to.Enable = &v\n}", "title": "" }, { "docid": "72a00638756d03eee074009807fbfadf", "score": "0.5605927", "text": "func (s *CrlDetail) SetEnabled(v bool) *CrlDetail {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "353abf616a17a4dc4f026c705b81f74f", "score": "0.5599083", "text": "func (o RecorderStatusOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v *RecorderStatus) pulumi.BoolOutput { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "facbb89bb40dddd6564e6bb45e411c00", "score": "0.5556214", "text": "func (c *Context) IsEnabled(capability int) bool {\n\treturn c.Call(\"isEnabled\", capability).Bool()\n}", "title": "" }, { "docid": "facbb89bb40dddd6564e6bb45e411c00", "score": "0.5556214", "text": "func (c *Context) IsEnabled(capability int) bool {\n\treturn c.Call(\"isEnabled\", capability).Bool()\n}", "title": "" }, { "docid": "f643fb72a6a8f9611b6564c285d49b72", "score": "0.5553331", "text": "func (o *SensitiveDataScannerGroupAttributes) HasIsEnabled() bool {\n\treturn o != nil && o.IsEnabled != nil\n}", "title": "" }, { "docid": "a80e630cfcc2ee167e0a1afa7fe034f6", "score": "0.5551731", "text": "func (o OptimizedAutoscaleResponseOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v OptimizedAutoscaleResponse) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "0822b685bea29fbabafaa0b61b699756", "score": "0.5531182", "text": "func (o SoftwareUpdateConfigurationScheduleOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v SoftwareUpdateConfigurationSchedule) *bool { return v.IsEnabled }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "39785a731dc766d96bfc04667e835fcd", "score": "0.5524912", "text": "func IsEnabled() bool {\n\treturn instance.IsEnabled()\n}", "title": "" }, { "docid": "3b1d113306768e0e141cb915dcf2dd22", "score": "0.5503598", "text": "func (o *PayloadDescription) GetEnabled() bool {\n\tif o == nil {\n\t\tvar ret bool\n\t\treturn ret\n\t}\n\n\treturn o.Enabled\n}", "title": "" }, { "docid": "efce68518000528f0d8d5136b04a09fb", "score": "0.54936695", "text": "func (o *VolumeAutosizeAttributesType) IsEnabled() bool {\n\tvar r bool\n\tif o.IsEnabledPtr == nil {\n\t\treturn r\n\t}\n\tr = *o.IsEnabledPtr\n\treturn r\n}", "title": "" }, { "docid": "ba0acb198982e761caf403e6739d1026", "score": "0.54800457", "text": "func (sa *SyncAgent) IsEnabled(flagValue Event) bool {\n\tif sa == nil {\n\t\treturn false\n\t}\n\tsa.eventsLock.Lock()\n\tenabled := sa.events.IsEnabled(flagValue)\n\tsa.eventsLock.Unlock()\n\treturn enabled\n}", "title": "" }, { "docid": "6d26d7971bd37b86c060ccbc9675f2ef", "score": "0.5442562", "text": "func (s EnableByLevelStrategy) IsEnabled(settings map[string]interface{}, ctx *unleashcontext.Context) bool {\n\tlog.Debug(nil, map[string]interface{}{\"settings_level\": settings[LevelParameter], \"context_level\": ctx.Properties[LevelParameter]}, \"checking if feature is enabled for user, based on his/her feature level...\")\n\tuserLevel := ctx.Properties[LevelParameter]\n\tfeatureLevel := toFeatureLevel(settings[LevelParameter].(string), unknown)\n\treturn featureLevel.IsEnabled(userLevel)\n\n}", "title": "" }, { "docid": "c473e57e28c61da07c3ed9a7ff5b2aef", "score": "0.5440937", "text": "func (o ElastigroupScheduledTaskOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v ElastigroupScheduledTask) *bool { return v.IsEnabled }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "1c6e0c8411de00cc56df261264ec5f36", "score": "0.5431053", "text": "func (s *LoggingOptions) SetEnabled(v bool) *LoggingOptions {\n\ts.Enabled = &v\n\treturn s\n}", "title": "" }, { "docid": "b7186a44ed30251a10bd327b777ad11b", "score": "0.5380345", "text": "func (f featureToggles) IsEnabled(flag string) bool {\n\t_, ok := f.flags[flag]\n\treturn ok\n}", "title": "" }, { "docid": "f12955e0c8697bb3723895af60ec18f5", "score": "0.5375329", "text": "func (fm *FeatureManager) IsEnabled(flag string) bool {\n\treturn fm.enabled[flag]\n}", "title": "" }, { "docid": "35723bd000d05ddf6ed2d4599f64c7d6", "score": "0.5367252", "text": "func (p *Provider) Enabled() bool {\n\treturn p.IsEnabled\n}", "title": "" }, { "docid": "9b45ec85e8294052bc1801ded8ff1da2", "score": "0.5346412", "text": "func (o OptimizedAutoscaleResponsePtrOutput) IsEnabled() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *OptimizedAutoscaleResponse) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn &v.IsEnabled\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "211bba9f48a625ebbe30ec07816648c7", "score": "0.53388095", "text": "func (m *LicenseUnitsDetail) SetEnabled(value *int32)() {\n m.enabled = value\n}", "title": "" }, { "docid": "6e4bbfd75beb65644cbbe2c4d972ce8c", "score": "0.5338186", "text": "func (b *Base) IsEnabled() bool {\n\treturn b.Enabled\n}", "title": "" }, { "docid": "bd5f32363ce60b0b20245f02b77d6e82", "score": "0.53290826", "text": "func (o TimeWindowCustomAlertRuleResponseOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v TimeWindowCustomAlertRuleResponse) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "0a483b80688d7d22798ed94a67fa0a0c", "score": "0.53198355", "text": "func SetEnabled(enabled bool) func() {\n\torig := enableTracing\n\tenableTracing = enabled\n\treturn func() {\n\t\tenableTracing = orig\n\t}\n}", "title": "" }, { "docid": "e1c8d2981fcdb82e1f67cffcbde5b509", "score": "0.531091", "text": "func (o OptimizedAutoscaleOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v OptimizedAutoscale) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "effac9fd1f6ebfaf193e0d9089f31c71", "score": "0.5295719", "text": "func (o ThresholdCustomAlertRuleResponseOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v ThresholdCustomAlertRuleResponse) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "79d740de2342f1d45678517b75396059", "score": "0.52864516", "text": "func (c *Client) AdtrustIsEnabled(\n reqArgs *AdtrustIsEnabledArgs,\n optArgs *AdtrustIsEnabledOptionalArgs, // can be nil\n) (*AdtrustIsEnabledResult, error) {\n if reqArgs == nil {\n return nil, fmt.Errorf(\"reqArgs cannot be nil\")\n }\n kwp := adtrustIsEnabledKwParams{\n AdtrustIsEnabledArgs: reqArgs,\n AdtrustIsEnabledOptionalArgs: optArgs,\n Version: apiVersion,\n }\n req := request{\n Method: \"adtrust_is_enabled\",\n Params: []interface{}{\n []interface{}{}, &kwp},\n }\n readCloser, e := c.exec(&req)\n if e != nil {\n return nil, e\n }\n defer readCloser.Close()\n var res adtrustIsEnabledResponse\n\tif e := json.NewDecoder(readCloser).Decode(&res); e != nil {\n\t\treturn nil, e\n\t}\n\tif res.Error != nil {\n\t\treturn nil, res.Error\n\t}\n if res.Result == nil {\n return nil, fmt.Errorf(\"missing result in response\")\n }\n return res.Result, nil\n}", "title": "" }, { "docid": "86110019c1c8d16090a4f7c0a97f8463", "score": "0.52826184", "text": "func IsEnabled(cfg config.Config) bool {\n\treturn false\n}", "title": "" }, { "docid": "4a6194cbfe545e1b4a7d5e6427e96381", "score": "0.527591", "text": "func (q *PlanQueue) SetEnabled(enabled bool) {\n\tq.l.Lock()\n\tq.enabled = enabled\n\tq.l.Unlock()\n\tif !enabled {\n\t\tq.Flush()\n\t}\n}", "title": "" }, { "docid": "6c6d13aab250def354ee32a26039f749", "score": "0.5272774", "text": "func (o *UsersTokensListParams) SetWriteEnabled(writeEnabled *string) {\n\to.WriteEnabled = writeEnabled\n}", "title": "" }, { "docid": "0bed38e89b1f730ddac63753589abc88", "score": "0.5272077", "text": "func (this *BufferedLog) SetEnabled(enabled bool) {\n\tctx := context.Background()\n\n\ttrace.WithRegion(ctx, \"SetEnabled().acquireLock\", this.lock.Lock)\n\tdefer this.lock.Unlock()\n\n\tthis.enabled = enabled\n}", "title": "" }, { "docid": "76a93eecdd7209bca3fa9b20455dcc72", "score": "0.5260317", "text": "func (o *LogsDateRemapper) HasIsEnabled() bool {\n\tif o != nil && o.IsEnabled != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7bfff1728295fc9486e3b0766356c7dd", "score": "0.5245544", "text": "func (m *UnifiedRoleManagementPolicyAuthenticationContextRule) GetIsEnabled()(*bool) {\n return m.isEnabled\n}", "title": "" }, { "docid": "cdc4a8852af635b4abe85fbf7fae37b3", "score": "0.5234475", "text": "func (b *BufferedMessageReceiver) SetEnabled(e bool) bool {\n\tb.m.Lock()\n\tdefer b.m.Unlock()\n\n\tif b.enabled == e {\n\t\treturn false\n\t}\n\n\tb.enabled = e\n\tif !e {\n\t\tb.clear()\n\t}\n\treturn true\n}", "title": "" }, { "docid": "296db4dd3e812ed57c084292e86695ab", "score": "0.52308166", "text": "func (e Flags) IsEnabled(featureName string) bool {\n\treturn e != nil && e[featureName] == Enabled\n}", "title": "" }, { "docid": "2440b449ae73acf1b53f9c6b2c1e8196", "score": "0.522979", "text": "func (a *KubernetesAddon) IsEnabled() bool {\n\tif a.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *a.Enabled\n}", "title": "" }, { "docid": "220732a0b152507067e355457e382ec2", "score": "0.5184566", "text": "func (instance *HttpServer) IsEnabled() bool {\n\tif nil != instance {\n\t\treturn instance.enabled\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1cd80f1ca179b7f910ca7817ed1c879d", "score": "0.518178", "text": "func IsEnabled(ctx context.Context, key string) bool {\n\tstate := ctx.Value(experimentCtxKey{key})\n\treturn state != nil && state.(bool)\n}", "title": "" }, { "docid": "6b82ab7ec1fe8947a89d934892b81a4c", "score": "0.5174624", "text": "func (o TimeWindowCustomAlertRuleOutput) IsEnabled() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v TimeWindowCustomAlertRule) bool { return v.IsEnabled }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "c823ad041b6a8f6d63dc4891921e9091", "score": "0.51651275", "text": "func (m *ContinuousAccessEvaluationPolicy) GetIsEnabled()(*bool) {\n val, err := m.GetBackingStore().Get(\"isEnabled\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*bool)\n }\n return nil\n}", "title": "" }, { "docid": "45548bc96adf37bab7812ae91dc32d13", "score": "0.51645535", "text": "func SetEnabled(enabled bool) {\n\t// If they're the same, it does not write the `isGFDebug` but only reading operation.\n\tif isGFDebug != enabled {\n\t\tisGFDebug = enabled\n\t}\n}", "title": "" }, { "docid": "ba170f1e51f42729d8b02deb7ef94aa1", "score": "0.5162705", "text": "func (_options *UpdateAccountSettingsOptions) SetPublicAccessEnabled(publicAccessEnabled bool) *UpdateAccountSettingsOptions {\n\t_options.PublicAccessEnabled = core.BoolPtr(publicAccessEnabled)\n\treturn _options\n}", "title": "" }, { "docid": "f0ab7d0535eea776d5801e0d2f64984b", "score": "0.5162375", "text": "func (r Replacer) SetEnabled(description string, bool string) (map[string]interface{}, error) {\n\tm := map[string]string{\n\t\t\"description\": description,\n\t\t\"bool\": bool,\n\t}\n\treturn r.c.Request(\"replacer/action/setEnabled/\", m)\n}", "title": "" } ]
4f51b111854f26814c5e3c93acf85df5
IsAfternoonAppointment returns whether a time is in the afternoon
[ { "docid": "64fd77c76746a1d22a9eea63bd6518fb", "score": "0.8723072", "text": "func IsAfternoonAppointment(date string) bool {\n\tparsedDate, _ := time.Parse(\"Monday, January 2, 2006 15:04:05\", date)\n\treturn parsedDate.Hour() >= 12 && parsedDate.Hour() < 18\n}", "title": "" } ]
[ { "docid": "bf8ab1a5d85f30a937a66d5a1cd2f93b", "score": "0.8888897", "text": "func IsAfternoonAppointment(date string) bool {\n\tlayout := \"Monday, January 2, 2006 15:04:05\"\n\tt, _ := time.Parse(layout, date)\n\trounded := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())\n\tnoon := rounded.Add(time.Hour * 12)\n\tevening := rounded.Add(time.Hour * 18)\n\treturn t.After(noon) && t.Before(evening)\n}", "title": "" }, { "docid": "b35d63bcfd997648869b9621796edf18", "score": "0.8756456", "text": "func IsAfternoonAppointment(date string) bool {\n\tAppointmentForm := \"Monday, January 2, 2006 15:04:05\"\n\tdateAppointment, _ := time.Parse(AppointmentForm, date)\n\tdateHour := dateAppointment.Hour()\n\tif dateHour >= 12 && dateHour < 18 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "f09b8de0de52359504369eb758277a2e", "score": "0.869027", "text": "func IsAfternoonAppointment(date string) bool {\n parsed, _ := time.Parse(\"Monday, January 1, 2006 15:04:05\", date)\n\treturn parsed.Hour() >= 12 && parsed.Hour() < 18\n}", "title": "" }, { "docid": "25196060518d6e4afd7afb87c3738e75", "score": "0.63899916", "text": "func (e *VDisplayAlarm) IsAlarm() {}", "title": "" }, { "docid": "a78f9ffe72cfa60ceb22bc6a63f47a71", "score": "0.61077005", "text": "func (e *VEmailAlarm) IsAlarm() {}", "title": "" }, { "docid": "12d2d17b697bcf60b1b0e8c32aa5888f", "score": "0.58907413", "text": "func (t TimeWarp) IsChristmas() bool {\n\t_, m, d := t.BeginningOfDay().Time.Date()\n\treturn m == time.December && d == 25\n}", "title": "" }, { "docid": "430443e8c508c512cf94b48119ad9029", "score": "0.5855063", "text": "func (e *VAudioAlarm) IsAlarm() {}", "title": "" }, { "docid": "33a34052c598b5ebd64c353e3cdf2f00", "score": "0.5752872", "text": "func (t TimeWarp) IsFriday() bool {\n\treturn t.Time.Weekday() == time.Friday\n}", "title": "" }, { "docid": "0277e3890ae44010577698dc6623aeed", "score": "0.57437927", "text": "func IsIndependenceDay(input time.Time) bool {\n\treturn input.Month() == time.July && input.Day() == 4\n}", "title": "" }, { "docid": "f4b620efd274bad37049370433ec26f4", "score": "0.5477502", "text": "func (day Day) Contains(at time.Time) bool {\n\treturn day.NextTime(at).Day() == at.Day()\n}", "title": "" }, { "docid": "2717a6067e51a75613a12ea4dba23203", "score": "0.5445536", "text": "func (c *Carbon) IsWeekend() bool {\n return c.Weekday() == time.Saturday || c.Weekday() == time.Sunday\n}", "title": "" }, { "docid": "90fd1c72bd54287af9a42a9222ede1dd", "score": "0.5435875", "text": "func SetAlarm(employed, vacation bool) bool {\n\treturn employed && !vacation\n}", "title": "" }, { "docid": "86faf7971de68aca50147be5b285bead", "score": "0.5433249", "text": "func IsPresidentsDay(input time.Time) bool {\n\treturn input.Month() == time.February && input.Weekday() == time.Monday &&\n\t\tinput.Day() >= 15 && input.Day() <= 21\n}", "title": "" }, { "docid": "808096ad05fd3e276687b9b308d19afd", "score": "0.53738075", "text": "func (a *App) ValidTime() bool {\n\tcurrentTime := a.Clock.Now().In(a.TZ)\n\treturn currentTime.After(a.SunsetTime) || currentTime.Before(a.SunriseTime)\n}", "title": "" }, { "docid": "dc8c6409f287fb02b650f7e87a2e412c", "score": "0.53121406", "text": "func IsVeteransDay(input time.Time) bool {\n\treturn input.Month() == time.November && input.Day() == 11\n}", "title": "" }, { "docid": "d673612a66437e2aeb2042d634e4421f", "score": "0.52964944", "text": "func IsChristmas(input time.Time) bool {\n\treturn input.Month() == time.December && input.Day() == 25\n}", "title": "" }, { "docid": "74e4aff1b8b449bcce7bb957db540f9f", "score": "0.5291509", "text": "func HasAppointment() predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(Table, FieldID),\n\t\t\tsqlgraph.To(AppointmentTable, FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, AppointmentTable, AppointmentColumn),\n\t\t)\n\t\tsqlgraph.HasNeighbors(s, step)\n\t})\n}", "title": "" }, { "docid": "f5e7882ff42fe6d42a9e9ddd888eb1ed", "score": "0.52534264", "text": "func (c *Carbon) isMidday() bool {\n\treturn c.Format(\"3:04:05\") == \"12:00:00\"\n}", "title": "" }, { "docid": "ff20d5914dcaa74966bc4a28563957b9", "score": "0.5197769", "text": "func IsWeekend(t time.Time) bool {\n\tday := t.Weekday()\n\treturn (day == time.Friday && t.Hour() >= closingHour) || day == time.Saturday || day == time.Sunday\n}", "title": "" }, { "docid": "32021fa7b43321964644e708720035ce", "score": "0.51871675", "text": "func TestIsDayTime(t *testing.T) {\n\tt.Parallel()\n\n\ttestCases := []struct {\n\t\tname string\n\t\tpath pathDomain.Path\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\tname: \"When day time is given\",\n\t\t\tpath: pathDomain.Path{Timestamp: 1405594957},\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname: \"When night time is given\",\n\t\t\tpath: pathDomain.Path{Timestamp: 1624754392},\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tgot := tc.path.IsDayTime()\n\n\t\t\tassert.Equal(t, tc.expected, got)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "52a015d24eee3451f91515e40db9e3fe", "score": "0.5182175", "text": "func (sch *Scheduler) isDayOfWeek(dayNow int) bool {\n\tvar dow int\n\tfor _, dow = range sch.dow {\n\t\tif dayNow == dow {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "60d63de0ce0c90e74ba1ff31e1a880f6", "score": "0.51471674", "text": "func IsValentinesDay(input time.Time) bool {\n\treturn input.Month() == time.February && input.Day() == 14\n}", "title": "" }, { "docid": "d512efac8713cc5d67b03043be0e4ec0", "score": "0.5142373", "text": "func HasPassed(date string) bool {\n\tAppointmentForm := \"January 2, 2006 15:04:05\"\n\tdateAppointment, _ := time.Parse(AppointmentForm, date)\n\tdateNow := time.Now()\n\treturn dateNow.After(dateAppointment)\n}", "title": "" }, { "docid": "cd2b84e1769694de0561cd31fe0e86d4", "score": "0.5134605", "text": "func (c *Carbon) IsToday() bool {\n\treturn c.ToDateString() == Today(c.Timezone()).ToDateString()\n}", "title": "" }, { "docid": "e1ed280307d019cdc2a166f580aef00b", "score": "0.5118128", "text": "func IsWeekend(t time.Time) bool {\r\n\treturn t.Weekday() == time.Saturday || t.Weekday() == time.Sunday\r\n}", "title": "" }, { "docid": "d9a12f22002d00e808bd371102e5a105", "score": "0.51021767", "text": "func (b *Booking) IsApptOnly() bool {\n\treturn IsApptOnly(b.ServiceType)\n}", "title": "" }, { "docid": "82bbef7f198caa0fa75ed4c1d3a783df", "score": "0.5095469", "text": "func (duty *DutyInfo) IsInTime(t int64) bool {\n\tif duty.BeginTime == duty.EndTime {\n\t\treturn false\n\t}\n\tnow := time.Unix(t, 0).Format(\"15:04\")\n\tt1 := time.Unix(int64(duty.BeginTime), 0).In(time.UTC).Format(\"15:04:05\")\n\tt2 := time.Unix(int64(duty.EndTime), 0).In(time.UTC).Format(\"15:04:05\")\n\tif duty.EndTime > duty.BeginTime {\n\t\treturn now >= t1 && now <= t2\n\t}\n\treturn !(now >= t2 && now <= t1)\n}", "title": "" }, { "docid": "317a9396459020fe0133fe30985978eb", "score": "0.5092349", "text": "func (c *Calendar) IsWorkday(date time.Time) bool {\n\tday := date.Weekday()\n\n\tvar workday bool\n\tif c.WorkdayFunc == nil {\n\t\tworkday = c.workday[day]\n\t} else {\n\t\tworkday = c.WorkdayFunc(date)\n\t}\n\n\tif !workday || c.IsHoliday(date) {\n\t\treturn false\n\t}\n\n\tif c.Observed == ObservedExact {\n\t\treturn true\n\t}\n\n\tif (c.Observed == ObservedMonday || c.Observed == ObservedMondayTuesday) && day == time.Monday {\n\t\tsun := date.AddDate(0, 0, -1)\n\t\tsat := date.AddDate(0, 0, -2)\n\t\treturn !c.IsHoliday(sat) && !c.IsHoliday(sun)\n\t} else if c.Observed == ObservedMondayTuesday && day == time.Tuesday {\n\t\tmon := date.AddDate(0, 0, -1)\n\t\tsun := date.AddDate(0, 0, -2)\n\t\tsat := date.AddDate(0, 0, -3)\n\t\treturn !(c.IsHoliday(sat) && c.IsHoliday(sun)) && !(c.IsHoliday(sat) && c.IsHoliday(mon)) && !(c.IsHoliday(sun) && c.IsHoliday(mon))\n\t} else if c.Observed == ObservedNearest {\n\t\tif day == time.Friday {\n\t\t\tsat := date.AddDate(0, 0, 1)\n\t\t\treturn !c.IsHoliday(sat)\n\t\t} else if day == time.Monday {\n\t\t\tsun := date.AddDate(0, 0, -1)\n\t\t\treturn !c.IsHoliday(sun)\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "72aca181717a72544d1b7285f7f12852", "score": "0.50766194", "text": "func IsThanksgiving(input time.Time) bool {\n\treturn input.Month() == time.November && input.Weekday() == time.Thursday &&\n\t\tinput.Day() >= 22 && input.Day() <= 28\n}", "title": "" }, { "docid": "e80fecdc96a84a028bbefbf63d7c8836", "score": "0.5067206", "text": "func IsLaborDay(input time.Time) bool {\n\treturn input.Month() == time.September && input.Weekday() == time.Monday &&\n\t\tinput.Day() >= 1 && input.Day() <= 7\n}", "title": "" }, { "docid": "307723d22c877184939d86ef42166023", "score": "0.50135547", "text": "func (c *Carbon) IsDayOfWeek(dayOfWeek time.Weekday) bool {\n\treturn c.Weekday() == dayOfWeek\n}", "title": "" }, { "docid": "1e3282a6e72dd547473b36812ec71642", "score": "0.49865466", "text": "func (c *Carbon) IsStartOfDay(checkMicroseconds bool) bool {\n\tif checkMicroseconds {\n\t\treturn c.Format(MicrosecondTimeFormat) == \"00:00:00.000000\"\n\t} else {\n\t\treturn c.Format(TimeFormat) == \"00:00:00\"\n\t}\n}", "title": "" }, { "docid": "557fe74696f9632804521e113fc30c95", "score": "0.49667963", "text": "func HasPassed(date string) bool {\n\tlayout := \"January 2, 2006 15:04:05\"\n\ttoday := time.Now()\n\tappointment, _ := time.Parse(layout, date)\n\treturn appointment.Before(today)\n}", "title": "" }, { "docid": "c89a36492d27499c7501a09cee869172", "score": "0.49444598", "text": "func (c *Calendar) IsHoliday(date time.Time) bool {\n\tidx := date.Month()\n\tfor i := range c.holidays[idx] {\n\t\tif c.holidays[idx][i].matches(date) {\n\t\t\treturn true\n\t\t}\n\t}\n\tfor i := range c.holidays[0] {\n\t\tif c.holidays[0][i].matches(date) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "17fd9faa52dbc6e940f9887348131129", "score": "0.4920318", "text": "func (h *Holiday) matches(date time.Time) bool {\n\tif h.Month > 0 {\n\t\tif date.Month() != h.Month {\n\t\t\treturn false\n\t\t}\n\t\tif h.Day > 0 {\n\t\t\treturn date.Day() == h.Day\n\t\t}\n\t\tif h.Weekday > 0 && h.Offset != 0 {\n\t\t\treturn IsWeekdayN(date, h.Weekday, h.Offset)\n\t\t}\n\t} else if h.Offset > 0 {\n\t\treturn date.YearDay() == h.Offset\n\t}\n\treturn false\n}", "title": "" }, { "docid": "46536e1835ccb5e866c02971f76e757a", "score": "0.49197957", "text": "func GetAppointmentTime(s string, now time.Time) (time.Time, error) {\n\n\toneYearLater := now.AddDate(1, 0, 0)\n\n\tif strings.Contains(s, \"Sorry, all appointments at this office are currently taken\") || strings.Contains(s, \"no appointment is available\") {\n\t\treturn oneYearLater, nil\n\t}\n\n\tr, _ := regexp.Compile(\"(\\\\w+), (\\\\w+) (\\\\d{1,2}), (\\\\d{4}) at (\\\\d{1,2}:\\\\d{2}) (AM|PM)\")\n\tmatch := r.FindStringSubmatch(s)\n\n\tif len(match) == 0 {\n\t\t_ = logReponse(s, \"debugReponse.html\")\n\t\treturn oneYearLater, errors.New(\"No datetime string found in return\")\n\n\t}\n\tt, err := time.Parse(\"Monday, January 2, 2006 at 15:04 PM -0700\", match[0]+\" -0700\")\n\tif err != nil {\n\t\tlog.Println(\"error:\", err)\n\t\treturn oneYearLater, err\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "3ce73d6a0d5a20fd638b48650a242be2", "score": "0.49187985", "text": "func (c *Carbon) IsEndOfDay(checkMicroseconds bool) bool {\n\tif checkMicroseconds {\n\t\treturn c.Format(MicrosecondTimeFormat) == \"23:59:59.999999\"\n\t} else {\n\t\treturn c.Format(TimeFormat) == \"23:59:59\"\n\t}\n}", "title": "" }, { "docid": "f39e45f9d62135927b02601854541e10", "score": "0.49141866", "text": "func checkExactTime(sub *entity.SubscriberDTO) bool {\n\n\tnow := time.Now().UTC()\n\tif sub.Notify.Minute == now.Minute() {\n\t\tif sub.Notify.Frequency == entity.Day {\n\t\t\tif sub.Notify.Hour == now.Hour() {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tif sub.Notify.Frequency == entity.Week {\n\t\t\tif sub.Notify.Weekday == now.Weekday() && sub.Notify.Hour == now.Hour() {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6818944ced2558793fdf7b400475e45a", "score": "0.4910472", "text": "func IsAfterHours(now time.Time) (closed bool, timeToOpen time.Duration) {\n\tloc := now.Location()\n\tif IsWeekend(now) {\n\t\tdays := DaysToMonday(now.Weekday())\n\t\tmondayOpeningTime := time.Date(now.Year(), now.Month(), now.Day()+days, openingHour, 0, 0, 0, loc)\n\t\ttimeToOpen = mondayOpeningTime.Sub(now)\n\t\treturn true, timeToOpen\n\t}\n\n\tif now.Hour() < openingHour {\n\t\topenToday := time.Date(now.Year(), now.Month(), now.Day(), openingHour, 0, 0, 0, loc)\n\t\ttimeToOpen = openToday.Sub(now)\n\t\treturn true, timeToOpen\n\t}\n\n\tif now.Hour() >= closingHour {\n\t\topenTomorrow := time.Date(now.Year(), now.Month(), now.Day()+1, openingHour, 0, 0, 0, loc)\n\t\ttimeToOpen = openTomorrow.Sub(now)\n\t\treturn true, timeToOpen\n\t}\n\n\treturn false, timeToOpen // 0 time\n}", "title": "" }, { "docid": "7b03368e2e53acfe325df4f5f16b25a7", "score": "0.48951364", "text": "func (a *TeamUserStatus) IsInTime(t int64) bool {\n\tif a.StartTime == 0 || a.EndTime == 0 {\n\t\treturn true\n\t}\n\tnow := time.Unix(t, 0).Format(\"15:04\")\n\tt1 := time.Unix(int64(a.StartTime), 0).In(time.UTC).Format(\"15:04\")\n\tt2 := time.Unix(int64(a.EndTime), 0).In(time.UTC).Format(\"15:04\")\n\tif a.EndTime > a.StartTime {\n\t\treturn now >= t1 && now <= t2\n\t}\n\treturn !(now >= t2 && now <= t1)\n}", "title": "" }, { "docid": "6b1b17fdc3af0ed69cc1d60d60a3d375", "score": "0.4855978", "text": "func (y Year) IsOccurring(t time.Time) bool {\n\treturn t.Year() == int(y)\n}", "title": "" }, { "docid": "af849d1423b45df6699f215878b46d2c", "score": "0.47772926", "text": "func IsColumbusDay(input time.Time) bool {\n\treturn input.Month() == time.October && input.Weekday() == time.Monday &&\n\t\tinput.Day() >= 8 && input.Day() <= 14\n}", "title": "" }, { "docid": "88b74b97ec674216c48d41e2c88cf1ac", "score": "0.47699293", "text": "func (o *V0037Reservation) HasEndTime() bool {\n\tif o != nil && o.EndTime != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b857acc4e2653548e4373a7c52b10485", "score": "0.47333896", "text": "func (p Period) Active(t time.Time, location string, internal bool) (bool, error) {\n\tn, err := naiveTime(t, location)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tstarted := n.timestamp >= p.begin.timestamp\n\texpired := n.timestamp >= p.begin.timestamp+p.duration\n\treturn (started || internal) && !expired, nil\n}", "title": "" }, { "docid": "7aaa959859309d5d579c897493a32f4e", "score": "0.4699476", "text": "func isAbsoluteTime(timeIn string) bool {\n\tpattern := `^\\d{4}\\/\\d{1,2}\\/\\d{1,2}`\n\tmatch, err := regexp.MatchString(pattern, timeIn)\n\tif err != nil { panic(err) }\n\treturn match\n}", "title": "" }, { "docid": "c12163b3b16c910145c8d089c43a8794", "score": "0.4681094", "text": "func AnyOfTime(target []time.Time, predicate PredicateOfTime) bool {\n\tv := reflect.ValueOf(target)\n\n\tfor x := 0; x < v.Len(); x++ {\n\t\tobj := v.Index(x).Interface().(time.Time)\n\t\tif predicate == nil || predicate(obj) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "ea3cbd19a229b7fda271a3a9d84cf72c", "score": "0.46734878", "text": "func (ticker *Ticker) IsTimeSet(t time.Time) bool {\n\treturn ticker.isMinuteSet(t) &&\n\t\tticker.isHourSet(t) &&\n\t\tticker.isMonthSet(t) &&\n\t\tticker.isDayMonthOrDayWeekSet(t)\n}", "title": "" }, { "docid": "e492f9af7ba2a32ea610818a0d078b7d", "score": "0.46639365", "text": "func (m *AppointmentResultsMutation) TimeAppoint() (r time.Time, exists bool) {\n\tv := m.timeAppoint\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "9e41b9e2e11ec6021aa001ec8939a139", "score": "0.46510178", "text": "func (d *Date) HasDay() bool { return d.day != 0 }", "title": "" }, { "docid": "cad5992a64f600fc320dea3ebcbd68cb", "score": "0.46406662", "text": "func IsTime(v interface{}) bool {\n\n\t// TODO(dustin): Add test\n\n\treturn reflect.TypeOf(v) == timeType\n}", "title": "" }, { "docid": "80a983ecb04a29165c3ff529335e1ce4", "score": "0.46326897", "text": "func TimeAppointEQ(v time.Time) predicate.AppointmentResults {\n\treturn predicate.AppointmentResults(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTimeAppoint), v))\n\t})\n}", "title": "" }, { "docid": "c85739825678df514970824be1b7f5f4", "score": "0.46311164", "text": "func (f Says) Commences() bool {\n\treturn f.Time != nil\n}", "title": "" }, { "docid": "44da076cc5568c46c1b4a095bf8cc1a1", "score": "0.4612393", "text": "func (s *scheduler) isActivated() bool {\n\treturn s.after > 0 ||\n\t\t!s.at.IsZero() ||\n\t\ts.every > 0\n}", "title": "" }, { "docid": "44883691d19337a483c2c0d0cc6c726b", "score": "0.4598259", "text": "func IsWeekend(date time.Time) bool {\n\tday := date.Weekday()\n\treturn day == time.Saturday || day == time.Sunday\n}", "title": "" }, { "docid": "44883691d19337a483c2c0d0cc6c726b", "score": "0.4598259", "text": "func IsWeekend(date time.Time) bool {\n\tday := date.Weekday()\n\treturn day == time.Saturday || day == time.Sunday\n}", "title": "" }, { "docid": "44883691d19337a483c2c0d0cc6c726b", "score": "0.4598259", "text": "func IsWeekend(date time.Time) bool {\n\tday := date.Weekday()\n\treturn day == time.Saturday || day == time.Sunday\n}", "title": "" }, { "docid": "e63116035432471fca86bd80639e156b", "score": "0.45951858", "text": "func (b *Booking) FormatTime(timeZone string) string {\n\t//return the appointment time\n\tif b.IsApptOnly() {\n\t\treturn fmt.Sprintf(\"%s - %s\", FormatTimeLocal(b.TimeFrom, timeZone), FormatTimeLocal(b.TimeTo, timeZone))\n\t}\n\treturn FormatTimeLocal(b.TimeFrom, timeZone)\n}", "title": "" }, { "docid": "eea5fbc2380bc7ec5880e280676972ec", "score": "0.45821887", "text": "func withinTimePeriod(start, end, now time.Time) bool {\n\t// Converts to UTC and only keeps the hour and minute info.\n\tstart, end, now = start.UTC(), end.UTC(), now.UTC()\n\tstart = time.Date(0, 0, 0, start.Hour(), start.Minute(), 0, 0, time.UTC)\n\tend = time.Date(0, 0, 0, end.Hour(), end.Minute(), 0, 0, time.UTC)\n\tnow = time.Date(0, 0, 0, now.Hour(), now.Minute(), 0, 0, time.UTC)\n\t// for cases like from 00:00 to 06:00\n\tif end.Sub(start) >= 0 {\n\t\treturn now.Sub(start) >= 0 && now.Sub(end) <= 0\n\t}\n\t// for cases like from 22:00 to 06:00\n\treturn now.Sub(end) <= 0 || now.Sub(start) >= 0\n}", "title": "" }, { "docid": "d9e1930e11d55daec291f82b4c9c00a0", "score": "0.45759162", "text": "func isTimeFormat(t string) bool {\n\tsplitFormat := strings.Split(t, \"-\")\n\tif len(splitFormat) != 3 {\n\t\treturn false\n\t}\n\n\tfor _, v := range splitFormat {\n\t\t_, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "6a8c3cc04b52859043b0395e2f6e1758", "score": "0.4570312", "text": "func (o *InlineResponse2003Events) HasAllDay() bool {\n\tif o != nil && o.AllDay != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "91122169eff0d693e6d9d1926175316e", "score": "0.4568276", "text": "func CheckSchedule(now time.Time, config *Config, schedule *Schedule) bool {\n\t// Get the current weekday\n\tweekday := now.Weekday()\n\n\t// Make sure there's a calss for the weekday and the time is right\n\tfor _, class := range *schedule {\n\t\tif !contains(class.Weekdays, weekday) {\n\t\t\tcontinue\n\t\t}\n\n\t\tjtH, jtM, _ := class.JoinTime.Clock()\n\t\tnH, nM, _ := now.Clock()\n\n\t\tif jtH == nH && nM-jtM <= config.Skip && nM-jtM >= 0 {\n\t\t\twg.Add(1)\n\t\t\tgo StartMeet(class, config)\n\t\t\twg.Wait()\n\t\t}\n\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3af5c645fbd61662a2b10ba96f6d171e", "score": "0.45664233", "text": "func (c *Carbon) IsTomorrow() bool {\n return c.ToDateString() == Tomorrow(c.Timezone()).ToDateString()\n}", "title": "" }, { "docid": "0ed40235e2c1d8d6adc49ca5274ab6dc", "score": "0.45601866", "text": "func HasAppointmentWith(preds ...predicate.Appointment) predicate.Patient {\n\treturn predicate.Patient(func(s *sql.Selector) {\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(Table, FieldID),\n\t\t\tsqlgraph.To(AppointmentInverseTable, FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, AppointmentTable, AppointmentColumn),\n\t\t)\n\t\tsqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {\n\t\t\tfor _, p := range preds {\n\t\t\t\tp(s)\n\t\t\t}\n\t\t})\n\t})\n}", "title": "" }, { "docid": "bbd3811e91bb69d0bdd7a93ea924a239", "score": "0.45365968", "text": "func (o *ApplianceCertRenewalPhase) HasEndTime() bool {\n\tif o != nil && o.EndTime != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a7257fb1b9709930fa17f0e4dd4a1a29", "score": "0.4530814", "text": "func (c *Carbon) IsSameHour(v interface{}) bool {\n\treturn c.IsSameUnit(\"hour\", v)\n}", "title": "" }, { "docid": "8071209178a7bfb3f1c0352f859d812a", "score": "0.45234963", "text": "func (a *Agenda) IsDefined() bool {\n\treturn a.Status == \"defined\"\n}", "title": "" }, { "docid": "8c8b2e50037a568656dc61ee5aff662a", "score": "0.45234478", "text": "func isRoundedToNearestHour(ms int64) bool {\n\treturn FloorToNearestHour(ms) == ms\n}", "title": "" }, { "docid": "6607197dcba626aab1cd28998494802b", "score": "0.4517158", "text": "func (f *Facility) Alive(built, t int) bool {\n\tif built > t {\n\t\treturn false\n\t}\n\treturn built+f.Life >= t || f.Life <= 0\n}", "title": "" }, { "docid": "1f5544e32ce7a615436e39efc0ba0aea", "score": "0.45085365", "text": "func checkIsAlarm(operator int32, warnValue float64, critValue float64, getValue float64) int {\n\tif operator == 1 {\n\t\tif getValue > warnValue && getValue < critValue {\n\t\t\treturn WarnAlarm\n\t\t} else if getValue > critValue {\n\t\t\treturn CritAlarm\n\t\t}\n\t} else if operator == 2 {\n\t\tif getValue == warnValue {\n\t\t\treturn WarnAlarm\n\t\t} else if getValue == critValue {\n\t\t\treturn CritAlarm\n\t\t}\n\t} else if operator == 3 {\n\t\tif getValue < warnValue {\n\t\t\treturn WarnAlarm\n\t\t} else if getValue > warnValue && getValue < critValue {\n\t\t\treturn CritAlarm\n\t\t}\n\t}\n\treturn NoAlarm\n}", "title": "" }, { "docid": "8d58932aa1bb4bd3261874a4b3e8b418", "score": "0.4507278", "text": "func (*DTimeTZ) AmbiguousFormat() bool { return true }", "title": "" }, { "docid": "99629abbba7d6fdd9a365b7ea227f7ba", "score": "0.45037687", "text": "func CheckTimeFormatHHMM(timeStr string) bool {\n\t_, err := time.ParseInLocation(TFhhmm, timeStr, time.UTC)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "29c6353d9bf07aacbb9196a138a3170f", "score": "0.45022032", "text": "func (c *Country) IsFIFA() bool {\n\treturn c.FIFA != \"\"\n}", "title": "" }, { "docid": "e1fa7dfb2b640e0e913423875b192674", "score": "0.44976655", "text": "func addTimeOfDay(w *wordStruct, t *timeStruct) {\n\tif t.hour < 6 { // add at night\n\t\taddWordToString(w.words[10], w, true)\n\t} else if t.hour < 12 { // add in the morning\n\t\taddWordToString(w.words[5], w, true)\n\t\taddWordToString(w.words[9], w, true)\n\t} else if t.hour < 18 { // add in the afternoon\n\t\taddWordToString(w.words[5], w, true)\n\t\taddWordToString(w.words[6], w, true)\n\t} else { // add at night (again, hmmm)\n\t\taddWordToString(w.words[10], w, true)\n\t}\n}", "title": "" }, { "docid": "8136545c599975cd569970f169206fd3", "score": "0.44965282", "text": "func inCallHours() bool {\n\t// Checking to see if within call hours?\n\t// - no check (send texts at any time of day)\n\t// - yes check (proceed and check time against call/text time window)\n\tif !cfg.WorkerMsgCheckIfInCallHours {\n\t\t// Call hour check disabled - send the message regardless of time (return true)\n\t\treturn true\n\t}\n\n\t// Get the current time in the Pacific timezone\n\tcrt := time.Now().In(timePT).Format(time.RFC3339Nano)\n\tcrtHour := crt[11:13]\n\n\t// Is the current hour before the window start hour or after the window end hour?\n\t// before the start hour - don't send text\n\t// after the end hour - don't send text\n\tif crtHour < cfg.WorkerMsgStartHour || crtHour >= cfg.WorkerMsgEndHour {\n\t\t// current hour is outside the call time window\n\t\tappLog(\"INFO: %v - current hour is outside the call time window\\n\", utils.FileLine())\n\t\treturn false\n\t}\n\n\t// Inside the call window\n\treturn true\n}", "title": "" }, { "docid": "5426f371742e922d24755efe6648a6a1", "score": "0.44916388", "text": "func IsTime(obj interface{}) bool {\n\t_, ok := obj.(time.Time)\n\treturn ok\n}", "title": "" }, { "docid": "bcfd930d02d1961c92acf177aedfd734", "score": "0.44873258", "text": "func (n *NetworkInstance_Protocol_Isis_InterfacePathAny) Af(AfiName E_IsisTypes_AFI_TYPE, SafiName E_IsisTypes_SAFI_TYPE) *NetworkInstance_Protocol_Isis_Interface_AfPathAny {\n\treturn &NetworkInstance_Protocol_Isis_Interface_AfPathAny{\n\t\tNodePath: ygot.NewNodePath(\n\t\t\t[]string{\"afi-safi\", \"af\"},\n\t\t\tmap[string]interface{}{\"afi-name\": AfiName, \"safi-name\": SafiName},\n\t\t\tn,\n\t\t),\n\t}\n}", "title": "" }, { "docid": "173465c436bcf8bc7b46730417ec4e39", "score": "0.4484365", "text": "func (c *Cruncher) isOver(t time.Time, hour bool) bool {\n var plusOne time.Time\n if hour {\n // Wait the end of the hour.\n plusOne = t.Add(time.Duration(1)*time.Hour)\n plusOne = time.Date(plusOne.Year(), plusOne.Month(), plusOne.Day(), plusOne.Hour(), 0, 0, 0, t.Location())\n } else {\n // Wait 3 minutes to be sure that twitter returned us every tweets.\n plusOne = t.Add(time.Duration(3)*time.Minute)\n plusOne = time.Date(plusOne.Year(), plusOne.Month(), plusOne.Day(), plusOne.Hour(), plusOne.Minute(), 0, 0, t.Location())\n }\n\n // Test that it's time to compute it\n if plusOne.Before(time.Now()) {\n return true\n }\n return false\n}", "title": "" }, { "docid": "00f0fa03af5b8634cfab7930f9ae9d14", "score": "0.44805413", "text": "func (f *Flight) ArrivalTime() time.Time { return servicesTimeToTime(f.Arrival) }", "title": "" }, { "docid": "016f1cfd4ef163a3f32c8b09b1fb540e", "score": "0.44726506", "text": "func (s *Season) isScheduled() bool {\n\treturn s.FirstTimeRaw != \"Not Scheduled\"\n}", "title": "" }, { "docid": "b7cfaeb8fc21f1d61672a3bd8fb2f9b3", "score": "0.4464087", "text": "func (plugin *AFPacketConfigurator) IsPendingAfPacket(iface *intf.Interfaces_Interface) (pending bool) {\n\tafpacket, found := plugin.afPacketByName[iface.Name]\n\treturn found && afpacket.pending\n}", "title": "" }, { "docid": "15fb9c4dfae6744dd1f5ca79df7c0065", "score": "0.4462847", "text": "func IsWeekday() bool {\n\tswitch time.Now().Weekday() {\n\tcase time.Saturday, time.Sunday:\n\t\treturn false\n\tdefault:\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "b26162ce73204eeeee24c05c7914750f", "score": "0.4458758", "text": "func (f *FieldInfo) IsTime() bool {\n\ttypeName, err := ExprToBaseTypeName(f.Type)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn typeName == \"time.Time\"\n}", "title": "" }, { "docid": "10a4f488dc1351fd1d3f2a3aded129df", "score": "0.44571924", "text": "func (o *AssetDeploymentDeviceAllOf) HasAlarmInfo() bool {\n\tif o != nil && o.AlarmInfo.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5adbf02a1ea61e40c9e1f0b67df8e5c2", "score": "0.445289", "text": "func (c *BitCal) IsWorkDay(date time.Time) (ret bool) {\n\n\tc.init_year(date.Year())\n\n\tarr_ind, bit_ind := date2index(date)\n\n\treturn c.index2work(date.Year(), arr_ind, bit_ind)\n}", "title": "" }, { "docid": "54bcec2daf891afe836f1e1340442415", "score": "0.44453996", "text": "func (E_SrlNokiaNtp_TzdataTimezone) IsYANGGoEnum() {}", "title": "" }, { "docid": "26e8c2d9227d7b35960e470561758876", "score": "0.44417915", "text": "func IsWeekend() bool {\n\tswitch time.Now().Weekday() {\n\tcase time.Saturday, time.Sunday:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "07c8f6e8617b92d67af6dcacb62e8ac9", "score": "0.44131362", "text": "func (b *Booking) IsWithin(startTime time.Time, endTime time.Time) bool {\n\treturn (b.Start.Equal(startTime) || b.Start.After(startTime)) && b.Start.Before(endTime)\n}", "title": "" }, { "docid": "c59f64cc81c41dfc893c8f5f3323247d", "score": "0.4411689", "text": "func (o *WorkflowTaskNotification) HasEndTime() bool {\n\tif o != nil && o.EndTime != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9ca823ffb8d07771f88eda829239fafb", "score": "0.44041273", "text": "func (a *Acuity) AvailablityCheckTime(body AvailabilityCheckTimeBody) (AvailabilityCheckTime, error) {\n\t// Build the Request\n\treq := Request{\n\t\tMethod: \"POST\",\n\t\tURL: \"availability/check-times\",\n\t\tBody: body,\n\t}\n\t// Check the Appointment Time\n\tout := AvailabilityCheckTime{}\n\terr := a.request(req, &out)\n\treturn out, err\n}", "title": "" }, { "docid": "ad61df855a4329cd5d3116593f60327c", "score": "0.44035503", "text": "func (E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_TYPE_ID) IsYANGGoEnum() {}", "title": "" }, { "docid": "ad61df855a4329cd5d3116593f60327c", "score": "0.44035503", "text": "func (E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_TYPE_ID) IsYANGGoEnum() {}", "title": "" }, { "docid": "fd9363081fc61df44b3cb5c527130944", "score": "0.44031563", "text": "func Timeinday() {\n\tWEEKDAYS := []structs.WHEN{\n\t\t{D: []int{1}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t\t{D: []int{2}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t\t{D: []int{3}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t\t{D: []int{4}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t\t{D: []int{5}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t}\n\tfmt.Println(WEEKDAYS)\n\tWEEKEND := []structs.WHEN{\n\t\t{D: []int{6}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t\t{D: []int{7}, M: \"morning\", A: \"arvo\", E: \"evening\"},\n\t}\n\tfmt.Println(WEEKEND)\n\n\tvar m = map[string]structs.WHEN{\n\t\t\"MONDAY\": WEEKDAYS[0],\n\t\t\"TUESDAY\": WEEKDAYS[1],\n\t\t\"WEDNESDAY\": WEEKDAYS[2],\n\t\t\"THURSDAY\": WEEKDAYS[3],\n\t\t\"FRIDAY\": WEEKDAYS[4],\n\t}\n\tfmt.Println(m)\n\tw := structs.WHEN{D: []int{29, 30, 31}, M: \"morning\", A: \"arvo\", E: \"evening\"}\n\tpw := &w\n\tt := time.Now()\n\tswitch {\n\tcase t.Hour() < 12:\n\t\tfmt.Println(pw.M)\n\t\tfmt.Printf(\"%v\", pw.D)\n\t\tfmt.Println(pw.D)\n\tcase t.Hour() < 17:\n\t\tfmt.Println(pw.A)\n\t\tfmt.Printf(\"%v\", pw.D)\n\t\tfmt.Println(pw.D)\n\tdefault:\n\t\tfmt.Println(pw.E)\n\t\tfmt.Printf(\"%v\", pw.D)\n\t\tfmt.Println(pw.D)\n\t}\n}", "title": "" }, { "docid": "e55bde047be5020f0dd5f179972cc196", "score": "0.43988353", "text": "func (o *DailySchedule) GetHoursOk() (*[]bool, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.Hours, true\n}", "title": "" }, { "docid": "690eae82cb5ee9f6be9927156d288b93", "score": "0.43976566", "text": "func validateNoConflicts(parts []string, start, end time.Time) bool {\n\tfor _, part := range parts {\n\t\tfor _, ms := range AllMeetings.onesMeetings[part] {\n\t\t\tif !(end.Before(ms.StartTime) || end.Equal(ms.StartTime) ||\n\t\t\t\tstart.After(ms.EndTime) || start.Equal(ms.EndTime)) {\n\t\t\t\terrors.ErrorMsg(GetCurrentUser().UserName, \"participator \"+part+\" has meeting time conflict.\")\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "36ccc4112b1c9f73bbf4ed69557667cb", "score": "0.43884048", "text": "func (m IndicationofInterest) HasValidUntilTime() bool {\n\treturn m.Has(tag.ValidUntilTime)\n}", "title": "" }, { "docid": "36ccc4112b1c9f73bbf4ed69557667cb", "score": "0.43884048", "text": "func (m IndicationofInterest) HasValidUntilTime() bool {\n\treturn m.Has(tag.ValidUntilTime)\n}", "title": "" }, { "docid": "0de4958b0d71a1e4a53026c8d40726a1", "score": "0.4383535", "text": "func (t *ticker) isOnTick(tp PeerTick) bool {\n\tsched := &t.schedules[int(tp)]\n\treturn sched.runAt == t.tick\n}", "title": "" }, { "docid": "1bfb044ff1083fb4c7f5ef016db94ac7", "score": "0.4383309", "text": "func TimeAppoint(v time.Time) predicate.AppointmentResults {\n\treturn predicate.AppointmentResults(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldTimeAppoint), v))\n\t})\n}", "title": "" }, { "docid": "ad060f0a1f26451a8dfafd6c8e1a10e3", "score": "0.43829265", "text": "func ReturnsTrueOfTime() PredicateOfTime {\n\treturn func(_ time.Time) bool {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "742ee752f326717e2ce37ad2ec090544", "score": "0.43821508", "text": "func IsTime(in interface{}) bool {\n\treturn VV(in).IsTime()\n}", "title": "" } ]
90f2b9b689d736c2966e45b989407f40
RenewLicence extends a licence and may optionally revoke it if it is granted to someone, expired and the assignee switched to autorenewal subscription.
[ { "docid": "534fe197d553a29f680cb33a63a9b400", "score": "0.7556506", "text": "func (tx TxRepo) RenewLicence(lic licence.Licence) error {\n\t_, err := tx.NamedExec(checkout.StmtRenewLicence, lic)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "17200d60a2b980caf341456c12609988", "score": "0.61803675", "text": "func (b *base) AuthorizeRenew(context.Context, *x509.Certificate) error {\n\treturn errs.Unauthorized(\"provisioner.AuthorizeRenew not implemented\")\n}", "title": "" }, { "docid": "8aa605d6ce69b5763c65901973a5e417", "score": "0.61245304", "text": "func (p *AWS) AuthorizeRenew(ctx context.Context, cert *x509.Certificate) error {\n\treturn p.ctl.AuthorizeRenew(ctx, cert)\n}", "title": "" }, { "docid": "46385ff28f0701b6d70f9b69b96388af", "score": "0.6099853", "text": "func (c *Client) UpdateLicence(ctx context.Context, licence []byte, params *UpdateLicenceRequestParams) (*model.License, error) {\n\tif params == nil || params.CASVersion == \"\" {\n\t\tl, err := c.Transport.GetLicence(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparams = &UpdateLicenceRequestParams{\n\t\t\tCASVersion: l.Version,\n\t\t}\n\t}\n\n\treturn c.Transport.UpdateLicence(ctx, licence, params)\n}", "title": "" }, { "docid": "177fb7836e2e07422988f1f377d51ade", "score": "0.6006088", "text": "func (a *Authority) authorizeRenew(ctx context.Context, cert *x509.Certificate) error {\n\tserial := cert.SerialNumber.String()\n\tvar opts = []interface{}{errs.WithKeyVal(\"serialNumber\", serial)}\n\n\tisRevoked, err := a.IsRevoked(serial)\n\tif err != nil {\n\t\treturn errs.Wrap(http.StatusInternalServerError, err, \"authority.authorizeRenew\", opts...)\n\t}\n\tif isRevoked {\n\t\treturn errs.Unauthorized(\"authority.authorizeRenew: certificate has been revoked\", opts...)\n\t}\n\tp, err := a.LoadProvisionerByCertificate(cert)\n\tif err != nil {\n\t\tvar ok bool\n\t\t// For backward compatibility this method will also succeed if the\n\t\t// certificate does not have a provisioner extension. LoadByCertificate\n\t\t// returns the noop provisioner if this happens, and it allows\n\t\t// certificate renewals.\n\t\tif p, ok = a.provisioners.LoadByCertificate(cert); !ok {\n\t\t\treturn errs.Unauthorized(\"authority.authorizeRenew: provisioner not found\", opts...)\n\t\t}\n\t}\n\tif err := p.AuthorizeRenew(ctx, cert); err != nil {\n\t\treturn errs.Wrap(http.StatusInternalServerError, err, \"authority.authorizeRenew\", opts...)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "39605daaf9e67f36f5ec348424b86c26", "score": "0.59275466", "text": "func (p *Azure) AuthorizeRenew(ctx context.Context, cert *x509.Certificate) error {\n\treturn p.ctl.AuthorizeRenew(ctx, cert)\n}", "title": "" }, { "docid": "b81742dd4287b1913cd79fd0a1e0772e", "score": "0.57494956", "text": "func (d *Displayer) UpdateLicence(ctx context.Context, w io.Writer, licence *output.Licence) error {\n\treturn d.encode(w, licence)\n}", "title": "" }, { "docid": "388a63f036d38b89f7f047b508500d13", "score": "0.57122576", "text": "func (tx TxRepo) UpsertLicence(k enum.OrderKind, lic licence.Licence) error {\n\tswitch k {\n\tcase enum.OrderKindCreate:\n\t\treturn tx.CreateLicence(lic)\n\n\tcase enum.OrderKindRenew:\n\t\treturn tx.RenewLicence(lic)\n\t}\n\n\treturn errors.New(\"licence upsert only support create or renew kind\")\n}", "title": "" }, { "docid": "2a4181a8d5f15fa5129f6862492e3546", "score": "0.57055324", "text": "func (tx TxRepo) LockLicence(r admin.AccessRight) (licence.Licence, error) {\n\tvar bl licence.Licence\n\terr := tx.Get(\n\t\t&bl,\n\t\tlicence.StmtLockLicence,\n\t\tr.RowID,\n\t\tr.TeamID)\n\n\tif err != nil {\n\t\treturn licence.Licence{}, err\n\t}\n\n\treturn bl, nil\n}", "title": "" }, { "docid": "f46aa1dfc1170bab8c25b782c916d24a", "score": "0.5695202", "text": "func (a *LicensesApiService) UpdateLicense(ctx _context.Context, id string) ApiUpdateLicenseRequest {\n\treturn ApiUpdateLicenseRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tid: id,\n\t}\n}", "title": "" }, { "docid": "aff01cbfed40699ed4108d2883e64e52", "score": "0.5675624", "text": "func (l *Lease) Renew(ctx context.Context, exp time.Time) error {\n\tconst updQFmt = `UPDATE %s SET %s = $1 WHERE %s = $2 AND %s = $3 AND %s > $4`\n\tupdQ := fmt.Sprintf(\n\t\tupdQFmt,\n\t\tl.Lessor.tableName(),\n\t\tl.Lessor.expName(),\n\t\tl.Lessor.nameName(),\n\t\tl.Lessor.keyName(),\n\t\tl.Lessor.expName(),\n\t)\n\tres, err := l.Lessor.db.ExecContext(ctx, updQ, exp, l.Name, l.Key, time.Now())\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"updating database\")\n\t}\n\taff, err := res.RowsAffected()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"counting affected rows\")\n\t}\n\tif aff == 0 {\n\t\treturn errors.New(\"could not renew\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f07a58eef23b290ee731626bd32b84d0", "score": "0.56478673", "text": "func (c *Connector) RenewCertificate(revReq *certificate.RenewalRequest) (requestID string, err error) {\n\treturn \"\", fmt.Errorf(\"renew is not supported in -test-mode\")\n}", "title": "" }, { "docid": "491a5631275e2ddf166d9137b289f2f4", "score": "0.56087536", "text": "func Renew(w http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\n\t// Get the leaf certificate from the peer or the token.\n\tcert, token, err := getPeerCertificate(r)\n\tif err != nil {\n\t\trender.Error(w, err)\n\t\treturn\n\t}\n\n\t// The token can be used by RAs to renew a certificate.\n\tif token != \"\" {\n\t\tctx = authority.NewTokenContext(ctx, token)\n\t}\n\n\ta := mustAuthority(ctx)\n\tcertChain, err := a.RenewContext(ctx, cert, nil)\n\tif err != nil {\n\t\trender.Error(w, errs.Wrap(http.StatusInternalServerError, err, \"cahandler.Renew\"))\n\t\treturn\n\t}\n\tcertChainPEM := certChainToPEM(certChain)\n\tvar caPEM Certificate\n\tif len(certChainPEM) > 1 {\n\t\tcaPEM = certChainPEM[1]\n\t}\n\n\tLogCertificate(w, certChain[0])\n\trender.JSONStatus(w, &SignResponse{\n\t\tServerPEM: certChainPEM[0],\n\t\tCaPEM: caPEM,\n\t\tCertChainPEM: certChainPEM,\n\t\tTLSOptions: a.GetTLSOptions(),\n\t}, http.StatusCreated)\n}", "title": "" }, { "docid": "8ef22acb0f8f30c13be1b9d0f180da00", "score": "0.5603409", "text": "func (o *OIDC) AuthorizeRenewal(cert *x509.Certificate) error {\n\tif o.claimer.IsDisableRenewal() {\n\t\treturn errors.Errorf(\"renew is disabled for provisioner %s\", o.GetID())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ff15e12f5bffeebfc2587e2f1d7541ce", "score": "0.5591812", "text": "func (c *CertProcure) Renew() (err error) {\n\tvar u *User\n\t// Create a new user\n\tif u, err = newUser(c.o.Email); err != nil {\n\t\t// Error creating new user, return\n\t\terr = fmt.Errorf(\"error creating user: %v\", err)\n\t\treturn\n\t}\n\n\t// Create a new configuration\n\tconfig := lego.NewConfig(u)\n\tconfig.Certificate.KeyType = certcrypto.RSA2048\n\n\tvar client *lego.Client\n\t// Initialize a new client\n\tif client, err = newClient(c.o, config); err != nil {\n\t\t// Error initializing new client, return\n\t\terr = fmt.Errorf(\"error initializing client: %v\", err)\n\t\treturn\n\t}\n\n\tout.Success(\"Client created\")\n\n\t// Register user using Client\n\tif err = u.Register(client); err != nil {\n\t\t// Error registering user, return\n\t\terr = fmt.Errorf(\"error registering user \\\"%s\\\": %v\", u.Email, err)\n\t\treturn\n\t}\n\n\tout.Success(\"User registered\")\n\n\t// Make request\n\trequest := makeRequest(c.o.Domain)\n\n\tvar certificates *certificate.Resource\n\t// Obtain certificates\n\tif certificates, err = client.Certificate.Obtain(request); err != nil {\n\t\t// Error obtaining certificates, return\n\t\terr = fmt.Errorf(\"error obtaining certificates: %v\", err)\n\t\treturn\n\t}\n\n\tout.Success(\"Certificates obtained\")\n\n\t// Save certificates to file\n\tif err = saveCertificates(c.o.Directory, certificates); err != nil {\n\t\t// Error saving certificates, return\n\t\terr = fmt.Errorf(\"error saving certificates: %v\", err)\n\t\treturn\n\t}\n\n\tout.Success(\"Certificate renewal process complete\")\n\treturn\n}", "title": "" }, { "docid": "0a08b6a2462945652f923df95c5b1891", "score": "0.53904617", "text": "func (a *LicensesApiService) DowngradeLicense(ctx _context.Context) ApiDowngradeLicenseRequest {\n\treturn ApiDowngradeLicenseRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "3abf43176cc044ce32ee79da87d031fd", "score": "0.5379855", "text": "func OpenapiLicence(name, url string) OpenapiOption {\n\treturn \"implementation not generated, run swipe\"\n}", "title": "" }, { "docid": "365e005363decc082d25cc5cb3e10bef", "score": "0.5345284", "text": "func (d *DisLocker) Renew() {\n\td.ConsulClient.Session().Renew(d.SessionID, nil)\n}", "title": "" }, { "docid": "0bb9cfef5f57510dd9fe8b16595ca3ab", "score": "0.533585", "text": "func (v *vaultClient) renew() error {\n\t// Attempt to renew the token\n\tsecret, err := v.auth.RenewSelf(v.tokenData.CreationTTL)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tauth := secret.Auth\n\tif auth == nil {\n\t\treturn fmt.Errorf(\"renewal successful but not auth information returned\")\n\t} else if auth.LeaseDuration == 0 {\n\t\treturn fmt.Errorf(\"renewal successful but no lease duration returned\")\n\t}\n\n\tv.lastRenewed = time.Now()\n\tv.logger.Printf(\"[DEBUG] vault: successfully renewed server token\")\n\treturn nil\n}", "title": "" }, { "docid": "2400b6c57f8865965db846fcca136ddd", "score": "0.5322451", "text": "func (i *Identity) Reenroll(req *api.ReenrollmentRequest) (*EnrollmentResponse, error) {\n\tlog.Debugf(\"Reenrolling %s\", util.StructToString(req))\n\n\tcsrPEM, key, err := i.client.GenCSR(req.CSR, i.GetName())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treqNet := &api.ReenrollmentRequestNet{\n\t\tCAName: req.CAName,\n\t\tAttrReqs: req.AttrReqs,\n\t}\n\n\t// Get the body of the request\n\tif req.CSR != nil {\n\t\treqNet.SignRequest.Hosts = req.CSR.Hosts\n\t}\n\treqNet.SignRequest.Request = string(csrPEM)\n\treqNet.SignRequest.Profile = req.Profile\n\treqNet.SignRequest.Label = req.Label\n\n\tbody, err := util.Marshal(reqNet, \"SignRequest\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar result api.EnrollmentResponseNet\n\terr = i.Post(\"reenroll\", body, &result, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn i.client.newEnrollmentResponse(&result, i.GetName(), key)\n}", "title": "" }, { "docid": "ae082ecaa70995faa4c96a9edb13cf8c", "score": "0.5281851", "text": "func (b *backend) pathAuthRenew(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {\n\t// Verify we received auth\n\tif req.Auth == nil {\n\t\treturn nil, errors.New(\"request auth was nil\")\n\t}\n\n\t// Grab the token\n\ttokenRaw, ok := req.Auth.InternalData[\"slack_token\"]\n\tif !ok {\n\t\treturn nil, errors.New(\"no internal token found in the store\")\n\t}\n\ttoken, ok := tokenRaw.(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"stored access token is not a string\")\n\t}\n\n\t// Verify the credentails\n\tcreds, err := b.verifyCreds(ctx, req, token)\n\tif err != nil {\n\t\tif err, ok := err.(logical.HTTPCodedError); ok {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn nil, logical.ErrPermissionDenied\n\t}\n\n\t// Make sure the policies haven't changed. If they have, inform the user to\n\t// re-authenticate.\n\tif !policyutil.EquivalentPolicies(creds.policies, req.Auth.Policies) {\n\t\treturn nil, errors.New(\"policies no longer match\")\n\t}\n\n\t// Extend the lease\n\treturn framework.LeaseExtend(creds.ttl, creds.maxTTL, b.System())(ctx, req, d)\n}", "title": "" }, { "docid": "9f22230a986afa197f6739367344d8ea", "score": "0.5272604", "text": "func (self *Env) ResetExpiryLicenses() (err error) {\n if _tmp1366 := C.MSK_resetexpirylicenses(self.ptr()); _tmp1366 != 0 {\n lastcode,lastmsg := self.getlasterror(_tmp1366)\n err = &MosekError{code:Rescode(lastcode),msg:lastmsg}\n return\n }\n return\n}", "title": "" }, { "docid": "da3f62685fc34f7502811ba42a3de2ce", "score": "0.5195133", "text": "func (client DomainsClient) Renew(ctx context.Context, resourceGroupName string, domainName string) (result autorest.Response, err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/DomainsClient.Renew\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif result.Response != nil {\n\t\t\t\tsc = result.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tif err := validation.Validate([]validation.Validation{\n\t\t{TargetValue: resourceGroupName,\n\t\t\tConstraints: []validation.Constraint{{Target: \"resourceGroupName\", Name: validation.MaxLength, Rule: 90, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.MinLength, Rule: 1, Chain: nil},\n\t\t\t\t{Target: \"resourceGroupName\", Name: validation.Pattern, Rule: `^[-\\w\\._\\(\\)]+[^\\.]$`, Chain: nil}}}}); err != nil {\n\t\treturn result, validation.NewError(\"web.DomainsClient\", \"Renew\", err.Error())\n\t}\n\n\treq, err := client.RenewPreparer(ctx, resourceGroupName, domainName)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.DomainsClient\", \"Renew\", nil, \"Failure preparing request\")\n\t\treturn\n\t}\n\n\tresp, err := client.RenewSender(req)\n\tif err != nil {\n\t\tresult.Response = resp\n\t\terr = autorest.NewErrorWithError(err, \"web.DomainsClient\", \"Renew\", resp, \"Failure sending request\")\n\t\treturn\n\t}\n\n\tresult, err = client.RenewResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"web.DomainsClient\", \"Renew\", resp, \"Failure responding to request\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c5076adf187b91ee976d7a44e113b739", "score": "0.51829135", "text": "func (licensedbclient *LicenseDBClient) createNewLicenceForTenant(tenantID string, orgName string) (string, error) {\n\n\t// Create a new License Request\n\tnewLicenseRequest := &licenseprotos.LicenseRequest{\n\t\tTenantID: tenantID,\n\t\tOrganizationName: orgName,\n\t}\n\n\t// use grpc client to get a new license\n\tnewlicense, err := licensedbclient.grpcClient.NewLicense(context.Background(), newLicenseRequest)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// return new license\n\treturn newlicense.License, err\n}", "title": "" }, { "docid": "3b3d0e5c617160895b8d847031bf5807", "score": "0.5177618", "text": "func ExpireInOneYear(c *mycert) error {\n\tc.cert.NotAfter = time.Now().AddDate(1, 0, 0)\n\treturn nil\n}", "title": "" }, { "docid": "c3b13c72a6366a8417c657f202decd22", "score": "0.51681656", "text": "func (c ContainerURL) RenewLease(ctx context.Context, leaseID string, ac HTTPAccessConditions) (*ContainerLeaseResponse, error) {\n\tifModifiedSince, ifUnmodifiedSince, _, _ := ac.pointers()\n\treturn c.client.Lease(ctx, LeaseActionRenew, nil, &leaseID, nil, nil, nil, ifModifiedSince, ifUnmodifiedSince, nil)\n}", "title": "" }, { "docid": "f50b4e8d25c9d58153385b457e56800e", "score": "0.51544726", "text": "func RenewUserCertificate(c *gin.Context) {\n\tvar input RequesterRenewing\n\tc.ShouldBindJSON(&input)\n\n\tif len(input.UserID) == 0 {\n\t\tc.Abort()\n\t\tc.JSON(http.StatusBadRequest,\n\t\t\tgin.H{\"message\": \"target user id needed\"})\n\t\treturn\n\t}\n\n\tdbInstance := db.GetDb()\n\tvar userDb db.User\n\tvar oldCertificate db.Certificate\n\n\tdbInstance.Where(\"id = ?\", input.UserID).First(&userDb)\n\tif len(userDb.ID) == 0 {\n\t\tc.Abort()\n\t\tc.JSON(http.StatusBadRequest,\n\t\t\tgin.H{\"message\": \"target user id needed\"})\n\t\treturn\n\t}\n\toldCertificate = userDb.Certificate\n\n\tnewCertificate, newPrivateKey, err := createCertificateForUser(dbInstance, &userDb)\n\tif err != nil {\n\t\tc.Abort()\n\t\tc.JSON(http.StatusInternalServerError,\n\t\t\tgin.H{\"message\": err.Error()})\n\t\treturn\n\t}\n\tdbInstance.Delete(oldCertificate)\n\n\tvar pemPrivateBlock = pem.Block{\n\t\tType: \"RSA PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PublicKey(&newPrivateKey.PublicKey),\n\t}\n\tprivateKeyEncoded := pem.EncodeToMemory(&pemPrivateBlock)\n\n\tresponseReturn := ResponseCertificateCreation{\n\t\tPrivateKey: string(privateKeyEncoded),\n\t\tCertificate: string(newCertificate),\n\t}\n\n\tc.JSON(http.StatusOK, responseReturn)\n}", "title": "" }, { "docid": "d9465a1791ed64b866247a9c9d5b54b2", "score": "0.51491505", "text": "func (vp *Operator) renewCertificate(vc *ViceCertificate) error {\n\tif vp.isRateLimitForHostExceeded(vc) {\n\t\treturn nil\n\t}\n\tif err := vc.renew(vp.viceClient, vp.VicePresidentConfig); err != nil {\n\t\tLogError(\"Couldn't renew certificate for host %s: %s\", vc.Host, err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "821fddbcf05c15c5d1ee0bd1fab68320", "score": "0.51308686", "text": "func (m *UserItemRequestBuilder) ReprocessLicenseAssignment()(*ItemReprocessLicenseAssignmentRequestBuilder) {\n return NewItemReprocessLicenseAssignmentRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)\n}", "title": "" }, { "docid": "8cecc17fb81320e39c57504acc131954", "score": "0.50973153", "text": "func (b *BigIP) AutoLicense(regKey string, addOnKeys []string, timeout time.Duration) error {\n\tdeadline := time.Now().Add(timeout)\n\tactreq := Activation{BaseRegKey: regKey, AddOnKeys: addOnKeys, IsAutomaticActivation: true}\n\n\tif err := b.Activate(actreq); err != nil {\n\t\treturn err\n\t}\n\nloop:\n\tfor time.Now().Before(deadline) {\n\t\tactresp, err := b.GetActivationStatus()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif actresp.Status == activationInProgress {\n\t\t\ttime.Sleep(1 * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch actresp.Status {\n\t\tcase activationComplete:\n\t\t\treturn b.InstallLicense(*actresp.LicenseText)\n\t\tcase activationFailed:\n\t\t\treturn fmt.Errorf(\"Licensing failed: %s\", *actresp.ErrorText)\n\t\tcase activationNeedEula:\n\t\t\teula := *actresp.EulaText\n\t\t\tactreq.EulaText = &eula\n\t\t\tbreak loop\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Unknown licensing status: %s\", actresp.Status)\n\t\t}\n\t}\n\n\tif actreq.EulaText == nil {\n\t\treturn fmt.Errorf(\"Timed out after %s\", timeout)\n\t}\n\n\t// Proceed with EULA acceptance\n\tif err := b.Activate(actreq); err != nil {\n\t\treturn err\n\t}\n\n\tfor time.Now().Before(deadline) {\n\t\tactresp, err := b.GetActivationStatus()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif actresp.Status == activationInProgress {\n\t\t\ttime.Sleep(1 * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch actresp.Status {\n\t\tcase activationComplete:\n\t\t\treturn b.InstallLicense(*actresp.LicenseText)\n\t\tcase activationNeedEula:\n\t\t\treturn fmt.Errorf(\"Tried to accept EULA, but status is: %s\", *actresp.ErrorText)\n\t\tcase activationFailed:\n\t\t\treturn fmt.Errorf(\"Licensing failed: %s\", *actresp.ErrorText)\n\t\t}\n\t\treturn fmt.Errorf(\"Unknown licensing status: %s\", actresp.Status)\n\t}\n\n\treturn fmt.Errorf(\"Timed out after %s\", timeout)\n}", "title": "" }, { "docid": "455f5cb48894331d3cb7211bdbebe74c", "score": "0.5091634", "text": "func (tx TxRepo) CreateLicence(lic licence.Licence) error {\n\t_, err := tx.NamedExec(checkout.StmtCreateLicence, lic)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d1359ce8f1832ec547fc28beca1ce787", "score": "0.50848216", "text": "func (e *Extension) RequireReenroll(ctx context.Context) {\n\te.enrollMutex.Lock()\n\tdefer e.enrollMutex.Unlock()\n\t// Clear the node key such that reenrollment is required.\n\te.NodeKey = \"\"\n\te.knapsack.ConfigStore().Delete([]byte(nodeKeyKey))\n}", "title": "" }, { "docid": "6e5fd8828df2cbd798f60f475355f8fb", "score": "0.5080239", "text": "func (a *Authority) AuthorizeRenewToken(_ context.Context, ott string) (*x509.Certificate, error) {\n\tvar claims jose.Claims\n\tjwt, chain, err := jose.ParseX5cInsecure(ott, a.rootX509Certs)\n\tif err != nil {\n\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token\"))\n\t}\n\tleaf := chain[0][0]\n\tif err := jwt.Claims(leaf.PublicKey, &claims); err != nil {\n\t\treturn nil, errs.InternalServerErr(err, errs.WithMessage(\"error validating renew token\"))\n\t}\n\n\tp, err := a.LoadProvisionerByCertificate(leaf)\n\tif err != nil {\n\t\treturn nil, errs.Unauthorized(\"error validating renew token: cannot get provisioner from certificate\")\n\t}\n\tif err := a.UseToken(ott, p); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := claims.ValidateWithLeeway(jose.Expected{\n\t\tSubject: leaf.Subject.CommonName,\n\t\tTime: time.Now().UTC(),\n\t}, time.Minute); err != nil {\n\t\tswitch {\n\t\tcase errors.Is(err, jose.ErrInvalidIssuer):\n\t\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token: invalid issuer claim (iss)\"))\n\t\tcase errors.Is(err, jose.ErrInvalidSubject):\n\t\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token: invalid subject claim (sub)\"))\n\t\tcase errors.Is(err, jose.ErrNotValidYet):\n\t\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token: token not valid yet (nbf)\"))\n\t\tcase errors.Is(err, jose.ErrExpired):\n\t\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token: token is expired (exp)\"))\n\t\tcase errors.Is(err, jose.ErrIssuedInTheFuture):\n\t\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token: token issued in the future (iat)\"))\n\t\tdefault:\n\t\t\treturn nil, errs.UnauthorizedErr(err, errs.WithMessage(\"error validating renew token\"))\n\t\t}\n\t}\n\n\taudiences := a.config.GetAudiences().Renew\n\tif !matchesAudience(claims.Audience, audiences) && !isRAProvisioner(p) {\n\t\treturn nil, errs.InternalServerErr(jose.ErrInvalidAudience, errs.WithMessage(\"error validating renew token: invalid audience claim (aud)\"))\n\t}\n\n\t// validate issuer: old versions used the provisioner name, new version uses\n\t// 'step-ca-client/1.0'\n\tif claims.Issuer != \"step-ca-client/1.0\" && claims.Issuer != p.GetName() {\n\t\treturn nil, admin.NewError(admin.ErrorUnauthorizedType, \"error validating renew token: invalid issuer claim (iss)\")\n\t}\n\n\treturn leaf, nil\n}", "title": "" }, { "docid": "de7fb627e3bf2e6f95805f101c7a494e", "score": "0.50575316", "text": "func (s Session) Renew(domain string, period string) (response.Extend, error) {\n\tresp := response.Extend{}\n\n\tsld, tld := ParseDomain(domain)\n\n\tcmd := s.CreateCommand(\"Extend\")\n\tcmd.AddParam(\"sld\", sld)\n\tcmd.AddParam(\"tld\", tld)\n\tcmd.AddParam(\"NumYears\", period)\n\n\tclient := Client{&s}\n\tdata, err := client.DoRequest(cmd)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\tif err = xml.Unmarshal(data, &resp); err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "ddfbd91d4892a6837559c821b6aa9f7c", "score": "0.50373465", "text": "func (e *Extension) RequireReenroll(ctx context.Context) {\n\te.enrollMutex.Lock()\n\tdefer e.enrollMutex.Unlock()\n\t// Clear the node key such that reenrollment is required.\n\te.NodeKey = \"\"\n\te.db.Update(func(tx *bolt.Tx) error {\n\t\ttx.Bucket([]byte(configBucket)).Delete([]byte(nodeKeyKey))\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "a14d99ffad4ddb99023dad68bb995b53", "score": "0.5031134", "text": "func (s *Server) Reenroll(ctx context.Context, in *pb.ReenrollReq) (*pb.ReenrollResp, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "9d32ca6cd77f6822a8df87993c553ce0", "score": "0.5007524", "text": "func (c *MockClient) UpdateLicense(license interface{}) error {\n\targs := c.Called(license)\n\treturn args.Error(0)\n}", "title": "" }, { "docid": "6ece5701870a8735b935bea08792da6d", "score": "0.5002594", "text": "func ActivateLicense(key, siteId string) (*ActivationResponse, *model.ApiError) {\n\tlicenseReq := map[string]string{\n\t\t\"key\": key,\n\t\t\"siteId\": siteId,\n\t}\n\n\treqString, _ := json.Marshal(licenseReq)\n\thttpResponse, err := http.Post(C.Prefix+\"/licenses/activate\", APPLICATION_JSON, bytes.NewBuffer(reqString))\n\n\tif err != nil {\n\t\tzap.S().Errorf(\"failed to connect to license.signoz.io\", err)\n\t\treturn nil, model.BadRequest(fmt.Errorf(\"unable to connect with license.signoz.io, please check your network connection\"))\n\t}\n\n\thttpBody, err := ioutil.ReadAll(httpResponse.Body)\n\tif err != nil {\n\t\tzap.S().Errorf(\"failed to read activation response from license.signoz.io\", err)\n\t\treturn nil, model.BadRequest(fmt.Errorf(\"failed to read activation response from license.signoz.io\"))\n\t}\n\n\tdefer httpResponse.Body.Close()\n\n\t// read api request result\n\tresult := ActivationResult{}\n\terr = json.Unmarshal(httpBody, &result)\n\tif err != nil {\n\t\tzap.S().Errorf(\"failed to marshal activation response from license.signoz.io\", err)\n\t\treturn nil, model.InternalError(errors.Wrap(err, \"failed to marshal license activation response\"))\n\t}\n\n\tswitch httpResponse.StatusCode {\n\tcase 200, 201:\n\t\treturn result.Data, nil\n\tcase 400, 401:\n\t\treturn nil, model.BadRequest(fmt.Errorf(fmt.Sprintf(\"failed to activate: %s\", result.Error)))\n\tdefault:\n\t\treturn nil, model.InternalError(fmt.Errorf(fmt.Sprintf(\"failed to activate: %s\", result.Error)))\n\t}\n\n}", "title": "" }, { "docid": "68821df0b240ebd2d33a86f2a61b3d9a", "score": "0.4979806", "text": "func AllowRenewal(duration int) ServiceOption {\n\treturn func(s *service) error {\n\t\ts.allowRenewal = duration\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "fdb365ce6074a3b5f2d0c170dd40f521", "score": "0.49782833", "text": "func (s *System) LeasesRenewLease(ctx context.Context, request schema.LeasesRenewLeaseRequest, options ...RequestOption) (*Response[map[string]interface{}], error) {\n\trequestModifiers, err := requestOptionsToRequestModifiers(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trequestPath := \"/v1/sys/leases/renew\"\n\n\trequestQueryParameters := requestModifiers.customQueryParametersOrDefault()\n\n\treturn sendStructuredRequestParseResponse[map[string]interface{}](\n\t\tctx,\n\t\ts.client,\n\t\thttp.MethodPost,\n\t\trequestPath,\n\t\trequest,\n\t\trequestQueryParameters,\n\t\trequestModifiers,\n\t)\n}", "title": "" }, { "docid": "f2ae09843c772156a7a454df05a22aa9", "score": "0.49755776", "text": "func (s session) Renew() error {\n\tentry, _, err := s.client.Session().Renew(s.session, nil)\n\tif err != nil {\n\t\treturn util.Errorf(\"Could not renew lock\")\n\t}\n\n\tif entry == nil {\n\t\treturn util.Errorf(\"Could not renew because session was destroyed\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "21f2caac5c4376cd90b2bc6d0c023b5d", "score": "0.49740592", "text": "func (rb *Buildlet) Renew(ctx context.Context, rbs *Buildlets) {\n\trbs.Lock()\n\tdefer rbs.Unlock()\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn\n\tdefault:\n\t}\n\tif got := rbs.M[rb.Name]; got == rb {\n\t\trb.Expires = time.Now().Add(remoteBuildletIdleTimeout)\n\t\ttime.AfterFunc(time.Minute, func() { rb.Renew(ctx, rbs) })\n\t}\n}", "title": "" }, { "docid": "1851045de2266f3a037cf977c4a6f886", "score": "0.49705318", "text": "func (h *caHandler) SSHRenew(w http.ResponseWriter, r *http.Request) {\n\tvar body SSHRenewRequest\n\tif err := ReadJSON(r.Body, &body); err != nil {\n\t\tWriteError(w, errs.Wrap(http.StatusBadRequest, err, \"error reading request body\"))\n\t\treturn\n\t}\n\n\tlogOtt(w, body.OTT)\n\tif err := body.Validate(); err != nil {\n\t\tWriteError(w, errs.BadRequestErr(err))\n\t\treturn\n\t}\n\n\tctx := provisioner.NewContextWithMethod(r.Context(), provisioner.SSHRenewMethod)\n\t_, err := h.Authority.Authorize(ctx, body.OTT)\n\tif err != nil {\n\t\tWriteError(w, errs.UnauthorizedErr(err))\n\t\treturn\n\t}\n\toldCert, _, err := provisioner.ExtractSSHPOPCert(body.OTT)\n\tif err != nil {\n\t\tWriteError(w, errs.InternalServerErr(err))\n\t}\n\n\tnewCert, err := h.Authority.RenewSSH(ctx, oldCert)\n\tif err != nil {\n\t\tWriteError(w, errs.ForbiddenErr(err))\n\t\treturn\n\t}\n\n\tidentity, err := h.renewIdentityCertificate(r)\n\tif err != nil {\n\t\tWriteError(w, errs.ForbiddenErr(err))\n\t\treturn\n\t}\n\n\tJSONStatus(w, &SSHSignResponse{\n\t\tCertificate: SSHCertificate{newCert},\n\t\tIdentityCertificate: identity,\n\t}, http.StatusCreated)\n}", "title": "" }, { "docid": "8712a154ef25ff390fa751921100a11f", "score": "0.4966646", "text": "func (c *Client) Renew() (tokenString string, err error) {\n\tc.Lock()\n\n\ttoken, err := c.obtainer.RenewToken(c.token, c.clientID)\n\tif err != nil {\n\t\t// could not renew, try to obtain a new one\n\t\tc.Unlock()\n\t\treturn c.Obtain() // this acquires the lock on its own\n\t}\n\tc.token = token\n\n\tdefer c.Unlock()\n\treturn c.obtainer.TokenString(c.token)\n}", "title": "" }, { "docid": "62e5297c02d78895397ffcc91837eba2", "score": "0.4950436", "text": "func (c *Contract) Redeem(ctx TransactionContextInterface, issuer string, paperNumber string, redeemingOwner string, redeenDateTime string) (*CommercialPaper, error) {\n\tpaper, err := ctx.GetPaperList().GetPaper(issuer, paperNumber)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif paper.Owner != redeemingOwner {\n\t\treturn nil, fmt.Errorf(\"Paper %s:%s is not owned by %s\", issuer, paperNumber, redeemingOwner)\n\t}\n\n\tif paper.IsRedeemed() {\n\t\treturn nil, fmt.Errorf(\"Paper %s:%s is already redeemed\", issuer, paperNumber)\n\t}\n\n\tpaper.Owner = paper.Issuer\n\tpaper.SetRedeemed()\n\n\terr = ctx.GetPaperList().UpdatePaper(paper)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn paper, nil\n}", "title": "" }, { "docid": "f1aea524ad9f4ab4229ddf18617f0abe", "score": "0.4941942", "text": "func (tx TxRepo) UpdateLicenceStatus(lic licence.Licence) error {\n\t_, err := tx.NamedExec(licence.StmtUpdateLicenceStatus, lic)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "07dd306bf2709551ecf11782c9bef368", "score": "0.49410427", "text": "func (f *fetcher) RequestLicense(ctx context.Context, customerName string) (*TrialLicense, error) {\n\tlicReq := newLicenseRequest(customerName, f.trialDays)\n\tpostReq, err := f.makeHTTPRequest(ctx, licReq)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := http.DefaultClient.Do(postReq)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close() // nolint: errcheck\n\n\tcode := resp.StatusCode\n\tswitch { // Do we care? I'm not sure. Seems like 5xx might be retryable...\n\tcase code >= 400 && code < 500:\n\t\treturn nil, &ClientError{httpError: httpError{code: code}}\n\tcase code >= 500 && code < 600:\n\t\treturn nil, &ServerError{httpError: httpError{code: code}}\n\t}\n\n\tlic, err := processLicGenResult(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &TrialLicense{\n\t\tLicense: lic,\n\t\tCustomerID: licReq.CustomerID,\n\t}, nil\n}", "title": "" }, { "docid": "255a016ee8e67cdd4396804e8ab258bd", "score": "0.49302146", "text": "func (dc *DomainCertificate) RenewCertificate(acmeCert *Certificate, domain *Domain) error {\n\tif reflect.DeepEqual(domain, dc.Domain) {\n\t\tdc.Certificate = acmeCert\n\t\tif err := dc.Init(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\treturn errors.New(\"Certificate to renew not found for domain \" + domain.Main)\n}", "title": "" }, { "docid": "baf56e524d9974728a95068fd388dadc", "score": "0.4907244", "text": "func (s Secret) Renew() error {\n\treturn errors.New(\"Can't renew a static token\")\n}", "title": "" }, { "docid": "91bc703cceb8d116142f08297da28088", "score": "0.48921642", "text": "func (s *RegistryServer) Renew(ctx context.Context, request *pb.RenewRequest) (*pb.RenewResponse, error) {\n\n\tin, err := s.r.Renew(request.Segment, request.ServiceName, request.Ip, request.Port)\n\tif err != nil {\n\t\te := err.(registry.RegistryError)\n\t\treturn &pb.RenewResponse{\n\t\t\tCode: e.Code,\n\t\t\tMessage: e.Message,\n\t\t\tInstance: nil,\n\t\t}, nil\n\t}\n\n\t// sync other peer\n\tif request.SyncType == pb.SyncTypeEnum_Yes {\n\t\ts.pool.PushMsg(&p2p.SyncMsg{\n\t\t\tType: p2p.SyncMsgRenewType,\n\t\t\tContent: registry.NewRenewRequest(in.Segment, in.ServiceName, in.Ip, in.Port),\n\t\t})\n\t}\n\n\treturn &pb.RenewResponse{\n\t\tCode: 0,\n\t\tMessage: \"\",\n\t\tInstance: registry.NewServiceInstance(in),\n\t}, nil\n}", "title": "" }, { "docid": "6ee9d33b8a95ecacdc03f054151fe924", "score": "0.48842767", "text": "func (ca *Issuer) CrlRenewal() time.Duration {\n\treturn ca.crlRenewal\n}", "title": "" }, { "docid": "98973cd421d61d19c9b539901203d018", "score": "0.4880104", "text": "func GenerateLicense(w http.ResponseWriter, r *http.Request, s Server) {\n\n\tvars := mux.Vars(r)\n\t// get the content id from the request URL\n\tcontentID := vars[\"content_id\"]\n\n\t// get the input body\n\t// note: no need to create licIn / licOut here, as the input body contains\n\t// info that we want to keep in the full license.\n\tvar lic license.License\n\terr := DecodeJSONLicense(r, &lic)\n\tif err != nil {\n\t\tproblem.Error(w, r, problem.Problem{Detail: err.Error()}, http.StatusBadRequest)\n\t\treturn\n\t}\n\t// check mandatory information in the input body\n\terr = checkGenerateLicenseInput(&lic)\n\tif err != nil {\n\t\tproblem.Error(w, r, problem.Problem{Detail: err.Error()}, http.StatusBadRequest)\n\t\treturn\n\t}\n\t// init the license with an id and issue date\n\tlicense.Initialize(contentID, &lic)\n\n\t// normalize the start and end date, UTC, no milliseconds\n\tsetRights(&lic)\n\n\t// build the license\n\terr = buildLicense(&lic, s, false)\n\tif err != nil {\n\t\tproblem.Error(w, r, problem.Problem{Detail: err.Error()}, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// store the license in the db\n\terr = s.Licenses().Add(lic)\n\tif err != nil {\n\t\tproblem.Error(w, r, problem.Problem{Detail: err.Error()}, http.StatusInternalServerError)\n\t\t//problem.Error(w, r, problem.Problem{Detail: err.Error(), Instance: contentID}, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tlog.Println(\"New License:\", lic.ID, \". Content:\", contentID, \"User:\", lic.User.ID)\n\n\t// set http headers\n\tw.Header().Add(\"Content-Type\", api.ContentType_LCP_JSON)\n\tw.Header().Add(\"Content-Disposition\", `attachment; filename=\"license.lcpl\"`)\n\tw.WriteHeader(http.StatusCreated)\n\t// send back the license\n\t// do not escape characters\n\tenc := json.NewEncoder(w)\n\tenc.SetEscapeHTML(false)\n\tenc.Encode(lic)\n\n\t// notify the lsd server of the creation of the license.\n\t// this is an asynchronous call.\n\tgo notifyLsdServer(lic, s)\n}", "title": "" }, { "docid": "7f3e91ee9cdb7cd35c038478fe3a0e75", "score": "0.48669273", "text": "func (tx TxRepo) LockLicenceTxn(id string) (checkout.LicenceTransaction, error) {\n\tvar lq checkout.LicenceTransaction\n\terr := tx.Get(&lq, checkout.StmtLockLicenceTxn, id)\n\tif err != nil {\n\t\treturn checkout.LicenceTransaction{}, err\n\t}\n\n\treturn lq, nil\n}", "title": "" }, { "docid": "3a23c6353949ef12ef0f456449b982da", "score": "0.4860635", "text": "func (ec *SparrowClient) RenewAuth() (err error) {\n\trr := ec.Post(map[string]string{\n\t\t\"entityID\": ec.EntityID,\n\t\t\"owner\": ec.User.ID,\n\t}, vsec.Public, \"entity\", \"auth\")\n\tvar token string\n\terr = rr.Read(&token)\n\tif err == nil {\n\t\tec.Client.Token = token\n\t}\n\treturn vlog.LogError(\"Sprw:Client\", err)\n}", "title": "" }, { "docid": "717c86fe36d67b8d1c271f8c3aacb670", "score": "0.4854892", "text": "func (c *EtcdClient) RenewReservation(ctx context.Context, key string) error {\n\t// Get the leaseid using the key\n\tvar ok bool\n\tvar leaseID *v3Client.LeaseID\n\tc.keyReservationsLock.RLock()\n\tleaseID, ok = c.keyReservations[key]\n\tc.keyReservationsLock.RUnlock()\n\n\tif !ok {\n\t\treturn errors.New(\"key-not-reserved\")\n\t}\n\n\tif leaseID != nil {\n\t\t_, err := c.ectdAPI.KeepAliveOnce(ctx, *leaseID)\n\t\tif err != nil {\n\t\t\tlogger.Errorw(\"lease-may-have-expired\", log.Fields{\"error\": err})\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\treturn errors.New(\"lease-expired\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "35330f4444e1507f87650e4fe0a72c6d", "score": "0.48463225", "text": "func (con *Controller) Renew(vera Vera) error {\n\tcon.Kill <- true\n\tcon.Vera = &vera\n\n\terr := con.GetSessionToken(vera)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcon.Polling()\n\n\treturn nil\n}", "title": "" }, { "docid": "00381ca8e8f7b10bf0cf956708db7116", "score": "0.48456088", "text": "func NewAssignedLicense()(*AssignedLicense) {\n m := &AssignedLicense{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "11487f124616bb1e8e9328e00a5935e3", "score": "0.48418728", "text": "func TestCore_RenewSameLease(t *testing.T) {\n\tc, _, root := TestCoreUnsealed(t)\n\n\t// Create a leasable secret\n\treq := &logical.Request{\n\t\tOperation: logical.UpdateOperation,\n\t\tPath: \"secret/test\",\n\t\tData: map[string]interface{}{\n\t\t\t\"foo\": \"bar\",\n\t\t\t\"lease\": \"1h\",\n\t\t},\n\t\tClientToken: root,\n\t}\n\tresp, err := c.HandleRequest(namespace.RootContext(nil), req)\n\tif err != nil {\n\t\tt.Fatalf(\"err: %v\", err)\n\t}\n\tif resp != nil {\n\t\tt.Fatalf(\"bad: %#v\", resp)\n\t}\n\n\t// Read the key\n\treq.Operation = logical.ReadOperation\n\treq.Data = nil\n\treq.SetTokenEntry(&logical.TokenEntry{ID: root, NamespaceID: \"root\", Policies: []string{\"root\"}})\n\tresp, err = c.HandleRequest(namespace.RootContext(nil), req)\n\tif err != nil {\n\t\tt.Fatalf(\"err: %v\", err)\n\t}\n\tif resp == nil || resp.Secret == nil || resp.Secret.LeaseID == \"\" {\n\t\tt.Fatalf(\"bad: %#v\", resp.Secret)\n\t}\n\toriginal := resp.Secret.LeaseID\n\n\t// Renew the lease\n\treq = logical.TestRequest(t, logical.UpdateOperation, \"sys/renew/\"+resp.Secret.LeaseID)\n\treq.ClientToken = root\n\tresp, err = c.HandleRequest(namespace.RootContext(nil), req)\n\tif err != nil {\n\t\tt.Fatalf(\"err: %v\", err)\n\t}\n\n\t// Verify the lease did not change\n\tif resp.Secret.LeaseID != original {\n\t\tt.Fatalf(\"lease id changed: %s %s\", original, resp.Secret.LeaseID)\n\t}\n\n\t// Renew the lease (alternate path)\n\treq = logical.TestRequest(t, logical.UpdateOperation, \"sys/leases/renew/\"+resp.Secret.LeaseID)\n\treq.ClientToken = root\n\tresp, err = c.HandleRequest(namespace.RootContext(nil), req)\n\tif err != nil {\n\t\tt.Fatalf(\"err: %v\", err)\n\t}\n\n\t// Verify the lease did not change\n\tif resp.Secret.LeaseID != original {\n\t\tt.Fatalf(\"lease id changed: %s %s\", original, resp.Secret.LeaseID)\n\t}\n}", "title": "" }, { "docid": "f281da0518ff4f79f3c9ed8a64908c8f", "score": "0.48397294", "text": "func (c *Connector) RenewCertificate(renewReq *certificate.RenewalRequest) (requestID string, err error) {\n\n\tif renewReq.Thumbprint != \"\" && renewReq.CertificateDN == \"\" {\n\t\t// search by Thumbprint and fill *renewReq.CertificateDN\n\t\tsearchResult, err := c.searchCertificatesByFingerprint(renewReq.Thumbprint)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"Failed to create renewal request: %s\", err)\n\t\t}\n\t\tif len(searchResult.Certificates) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"No certifiate found using fingerprint %s\", renewReq.Thumbprint)\n\t\t}\n\t\tif len(searchResult.Certificates) > 1 {\n\t\t\treturn \"\", fmt.Errorf(\"Error: more than one CertificateRequestId was found with the same thumbprint\")\n\t\t}\n\n\t\trenewReq.CertificateDN = searchResult.Certificates[0].CertificateRequestId\n\t}\n\tif renewReq.CertificateDN == \"\" {\n\t\treturn \"\", fmt.Errorf(\"failed to create renewal request: CertificateDN or Thumbprint required\")\n\t}\n\n\tvar r = certificateRenewRequest{}\n\tr.CertificateDN = renewReq.CertificateDN\n\tif renewReq.CertificateRequest != nil && len(renewReq.CertificateRequest.GetCSR()) != 0 {\n\t\tr.PKCS10 = string(renewReq.CertificateRequest.GetCSR())\n\t}\n\tstatusCode, status, body, err := c.request(\"POST\", urlResourceCertificateRenew, r)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tresponse, err := parseRenewResult(statusCode, status, body)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif !response.Success {\n\t\treturn \"\", fmt.Errorf(\"Certificate Renewal error: %s\", response.Error)\n\t}\n\treturn renewReq.CertificateDN, nil\n}", "title": "" }, { "docid": "e47c6abcbc2c7343e0b47f066005cbb3", "score": "0.4835563", "text": "func (l Licence) Grant(to Assignee, curMmb reader.Membership) (MemberModified, error) {\n\tsubsKind, err := l.SubsKind(curMmb)\n\tif err != nil {\n\t\treturn MemberModified{}, err\n\t}\n\n\t// Optional carry-over invoice.\n\tvar inv reader.Invoice\n\tif subsKind == subs.KindOverrideOneTime {\n\t\tinv = curMmb.CarryOverInvoice().\n\t\t\tWithLicTxID(l.LatestTransactionID)\n\t}\n\n\t// Build new membership.\n\tmemberVersioned := l.NewMembership(\n\t\treader.UserIDs{\n\t\t\tCompoundID: to.FtcID.String,\n\t\t\tFtcID: to.FtcID,\n\t\t\tUnionID: to.UnionID,\n\t\t},\n\t\tcurMmb.AddOn.Plus(addon.New(inv.Tier, inv.TotalDays())),\n\t).\n\t\tVersion(reader.B2BArchiver(reader.ArchiveActionGrant)).\n\t\tWithPriorVersion(curMmb).\n\t\tWithB2BTxnID(l.LatestTransactionID.String)\n\n\treturn MemberModified{\n\t\tMembershipVersion: memberVersioned,\n\t\tCarryOverInvoice: inv,\n\t\tIsSwitchingLicence: subsKind == subs.KindB2BSwitchLicence,\n\t}, nil\n}", "title": "" }, { "docid": "06bbd7fcfe09d3d324522dbb3370c61e", "score": "0.4835141", "text": "func UA_Client_manuallyRenewSecureChannel(client []UA_Client) UA_StatusCode {\n\tvar retval UA_StatusCode = openSecureChannel(client, 1)\n\tif retval != UA_StatusCode((uint32_t((uint32((0)))))) {\n\t\tUA_Client_close(client)\n\t}\n\treturn UA_StatusCode(retval)\n}", "title": "" }, { "docid": "1897b64770f8852882741f3798950e5f", "score": "0.48305213", "text": "func TestRegisterRenew(t *testing.T) {\n\tuser := entities.NewUser()\n\tuser.Email = \"renew@renew.renew\"\n\tuser.Registration = time.Now().AddDate(0, 0, -2)\n\tuser.Expiration = time.Now().Add(-1 * time.Hour)\n\n\t_, err = repository.Collection.Insert(*user)\n\tassert.Nil(t, err)\n\n\tclient := clientTest(t, ValidServ)\n\n\trequest := &api.RegisterRequest{Email: \"renew@renew.renew\", Request: string(csr)}\n\terrCode, err := client.Register(context.Background(), request)\n\tassert.Equal(t, err, nil)\n\tassert.Equal(t, errCode.Code, api.ErrorCode_SUCCESS)\n}", "title": "" }, { "docid": "ed2f32294a7f6454cee02591d192eea8", "score": "0.4829288", "text": "func (c *Client) CancelSubscriptionRenewal(ctx context.Context, purchaseToken, subscriptionID string, accountFlag int64) (success bool, responseMessage string, err error) {\n\tbodyMap := map[string]string{\n\t\t\"subscriptionId\": subscriptionID,\n\t\t\"purchaseToken\": purchaseToken,\n\t}\n\tvar resp ModifySubscriptionResponse\n\tsuccess, resp, err = c.modifySubscriptionQuery(ctx, bodyMap, accountFlag, \"/sub/applications/v2/purchases/stop\")\n\tresponseMessage = resp.ResponseMessage\n\treturn\n}", "title": "" }, { "docid": "ab88ada09595771bf726c39588dca4e9", "score": "0.48264563", "text": "func ExampleDomainsClient_Renew() {\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\tclient, err := armappservice.NewDomainsClient(\"3dddfa4f-cedf-4dc0-ba29-b6d1a69ab545\", cred, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create client: %v\", err)\n\t}\n\t_, err = client.Renew(ctx,\n\t\t\"RG\",\n\t\t\"example.com\",\n\t\tnil)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to finish the request: %v\", err)\n\t}\n}", "title": "" }, { "docid": "da9f7a1de3f9409b79ed2f38064b60a6", "score": "0.47832537", "text": "func License(license core.LicenseService) {\n\t// track days until expires\n\t// track user limit\n\t// track repo limit\n}", "title": "" }, { "docid": "c8674ee07570fe77b2aaa04f924b92c3", "score": "0.47808474", "text": "func GetCmdRenewAgreement(cdc *codec.LegacyAmino) *cobra.Command {\r\n\treturn &cobra.Command{\r\n\t\tUse: \"renew [agreement-id]\",\r\n\t\tShort: \"renew agreement by id\",\r\n\t\tExample: fmt.Sprintf(\"%s tx %s amend 6682c03cc3856879c8fb98c9733c6b0c30758299138166b6523fe94628b1d3af --from accA\", version.ClientName, types.ModuleName),\r\n\t\tArgs: cobra.ExactArgs(2),\r\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\r\n\t\t\tinBuf := bufio.NewReader(cmd.InOrStdin())\r\n\t\t\tcliCtx := context.NewCLIContext().WithCodec(cdc)\r\n\t\t\ttxBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc))\r\n\r\n\t\t\tfrom := cliCtx.GetFromAddress()\r\n\r\n\t\t\tagreementID, err := hex.DecodeString(args[0])\r\n\t\t\tif err != nil {\r\n\t\t\t\treturn err\r\n\t\t\t}\r\n\r\n\t\t\tmsg := types.NewMsgRenewAgreement(from, agreementID)\r\n\r\n\t\t\terr = msg.ValidateBasic()\r\n\t\t\tif err != nil {\r\n\t\t\t\treturn err\r\n\t\t\t}\r\n\r\n\t\t\treturn utils.GenerateOrBroadcastMsgs(cliCtx, txBldr, []sdk.Msg{msg})\r\n\t\t},\r\n\t}\r\n}", "title": "" }, { "docid": "84b0016b452617e1bfe0898293493896", "score": "0.47799933", "text": "func (r *DynamoDbRepository) Renew(itemLock *ItemLock) (*ItemLock, error) {\n\n\titemLock.ExpiresAt = r.newLockExpiration()\n\tinput := r.newPutItemInputForRenew(itemLock)\n\tif _, err := r.dynamoDb().PutItem(input); err == nil {\n\t\treturn itemLock, nil\n\t} else {\n\t\treturn nil, err\n\t}\n}", "title": "" }, { "docid": "bddd25d5101f4d55a8d41b238b3b056d", "score": "0.47707915", "text": "func (t *SimpleChaincode) updateRenewal(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\tif len(args) != 7 {\r\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 7\")\r\n\t}\r\n\r\n\t// ==== Input sanitation ====\r\n\tfmt.Println(\"- start udpate renewal\")\r\n\tif len(args[0]) <= 0 {\r\n\t\treturn shim.Error(\"1st argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[1]) <= 0 {\r\n\t\treturn shim.Error(\"2nd argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[2]) <= 0 {\r\n\t\treturn shim.Error(\"3rd argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[3]) <= 0 {\r\n\t\treturn shim.Error(\"4th argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[4]) <= 0 {\r\n\t\treturn shim.Error(\"5th argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[5]) <= 0 {\r\n\t\treturn shim.Error(\"6th argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[6]) <= 0 {\r\n\t\treturn shim.Error(\"7th argument must be a non-empty string\")\r\n\t}\r\n\r\n\tobjectType := \"renewal\"\r\n\trenewalId := args[0]\r\n\tcurPrice := args[1]\r\n\tpiPercent := args[2]\r\n\tpiCap := args[3]\r\n\tpiPeriod := args[4]\r\n\tnewPrice := args[5]\r\n\tstate := args[6]\r\n\r\n\t// ==== Check if renewal already exists ====\r\n\trenewalTestAsBytes, err := stub.GetState(renewalId)\r\n\tif err != nil {\r\n\t\treturn shim.Error(\"Failed to get renewal: \" + err.Error())\r\n\t} else if renewalTestAsBytes == nil {\r\n\t\tfmt.Println(\"This renewal does not exists: \" + renewalId)\r\n\t\treturn shim.Error(\"This renewal does not exists: \" + renewalId)\r\n\t}\r\n\r\n\t// ============= Create renewal object and marshal to JSON ====================\r\n\trenewal := &renewal{objectType, renewalId, curPrice, piPercent, piCap, piPeriod, newPrice, state}\r\n\trenewalAsBytes, err := json.Marshal(renewal)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\t// === Update renewal ===\r\n\terr = stub.PutState(renewalId, renewalAsBytes)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\tfmt.Println(\"- end update renewal \")\r\n\treturn shim.Success(renewalAsBytes)\r\n\r\n}", "title": "" }, { "docid": "e5ab438654f3725558add45db2425aa7", "score": "0.47614616", "text": "func (s *LicenseStub) Update(ctx context.Context, id types.ID, param *sacloud.LicenseUpdateRequest) (*sacloud.License, error) {\n\tif s.UpdateStubResult == nil {\n\t\tlog.Fatal(\"LicenseStub.UpdateStubResult is not set\")\n\t}\n\treturn s.UpdateStubResult.License, s.UpdateStubResult.Err\n}", "title": "" }, { "docid": "a9ac47b2a211c648d6ed51ac1c4a5ab4", "score": "0.47419575", "text": "func (r *Registry) Renew(arg *model.ArgRenew) (i *model.Instance, ok bool) {\n\ta, _, _ := r.apps(arg.AppID, arg.Env, arg.Zone)\n\tif len(a) == 0 {\n\t\treturn\n\t}\n\tif i, ok = a[0].Renew(arg.Hostname); !ok {\n\t\treturn\n\t}\n\tr.gd.incrFac()\n\treturn\n}", "title": "" }, { "docid": "cd231acb11bcfc18f2cc40857ae15e7e", "score": "0.4731213", "text": "func (s *API) RenewDeviceCertificate(req *RenewDeviceCertificateRequest, opts ...scw.RequestOption) (*RenewDeviceCertificateResponse, error) {\n\tvar err error\n\n\tif req.Region == \"\" {\n\t\tdefaultRegion, _ := s.client.GetDefaultRegion()\n\t\treq.Region = defaultRegion\n\t}\n\n\tif fmt.Sprint(req.Region) == \"\" {\n\t\treturn nil, errors.New(\"field Region cannot be empty in request\")\n\t}\n\n\tif fmt.Sprint(req.DeviceID) == \"\" {\n\t\treturn nil, errors.New(\"field DeviceID cannot be empty in request\")\n\t}\n\n\tscwReq := &scw.ScalewayRequest{\n\t\tMethod: \"POST\",\n\t\tPath: \"/iot/v1/regions/\" + fmt.Sprint(req.Region) + \"/devices/\" + fmt.Sprint(req.DeviceID) + \"/renew-certificate\",\n\t\tHeaders: http.Header{},\n\t}\n\n\terr = scwReq.SetBody(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resp RenewDeviceCertificateResponse\n\n\terr = s.client.Do(scwReq, &resp, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resp, nil\n}", "title": "" }, { "docid": "2a2d98a9f97ad0c01b275ad7f5a0b481", "score": "0.47189605", "text": "func (cr *CertRenewal) renewOneCertNow(rawRestOfChain []byte) error {\n\n\tif len(cr.cert.OCSPServer) < 1 {\n\t\treturn ErrNoOCSPInCert\n\t}\n\n\tif time.Now().After(cr.cert.NotAfter) {\n\t\treturn ErrCertAlreadyExpired\n\t}\n\n\tif cr.issuer == nil {\n\t\tcr.issuer = cr.tryIssuerInRest(rawRestOfChain)\n\t}\n\tif cr.issuer == nil {\n\t\tcr.issuer = cr.findIssuer()\n\t}\n\tif cr.issuer == nil {\n\t\treturn ErrNoIssuer\n\t}\n\n\tcr.CertLogAtf(1, \"issuer is %q\", certLabel(cr.issuer))\n\n\tif !cr.Renewer.permitRemoteComms {\n\t\tcr.CertLogf(\"remote OCSP renewal inhibited, blocking renew\")\n\t\treturn nil\n\t}\n\n\treq, err := ocsp.CreateRequest(cr.cert, cr.issuer, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstaple, rawStaple, err := cr.fetchOCSPviaHTTP(req)\n\tif err != nil {\n\t\tif re, ok := err.(ocsp.ResponseError); ok {\n\t\t\tswitch re.Status {\n\t\t\tcase ocsp.Success:\n\t\t\t\tcr.CertLogf(\"OCSP: got an error which claims success, We Are Now Confused: %s\", re)\n\t\t\tcase ocsp.TryLater:\n\t\t\t\tcr.CertLogf(\"OCSP: explicitly told to try later in response\")\n\t\t\tdefault:\n\t\t\t\t// Do nothing, let it be handled by the caller.\n\t\t\t\t// Could isolate malformedRequest and use level-logging\n\t\t\t\t// to report as a critical lack of support? Blocked on\n\t\t\t\t// future improved logging.\n\t\t\t}\n\t\t}\n\t\t// We _always_ set retry timers, rather than forget about the cert\n\t\tcr.setRetryTimersFromStaple(nil)\n\t\treturn err\n\t}\n\tif staple == nil {\n\t\tcr.CertLogf(\"BUG: have nil OCSP staple but fetch returned success\")\n\t\treturn ErrOCSPProblem\n\t}\n\n\tswitch staple.Status {\n\tcase ocsp.Good:\n\t\tcr.CertLogf(\"OCSP: status=%v sn=%v producedAt=(%s) thisUpdate=(%s) nextUpdate=(%s)\",\n\t\t\tstaple.Status, staple.SerialNumber, staple.ProducedAt, staple.ThisUpdate, staple.NextUpdate)\n\t\t// no return\n\tcase ocsp.Revoked:\n\t\treturn RevokedError{Cert: cr.cert, RevokedAt: staple.RevokedAt}\n\tcase ocsp.Unknown:\n\t\treturn UnknownAtCAError{Cert: cr.cert, URL: cr.cert.OCSPServer[0]}\n\tdefault:\n\t\tcr.CertLogf(\"OCSP: unhandled staple status %v\", staple.Status)\n\t\treturn ErrOCSPProblem\n\t}\n\n\tcr.setRetryTimersFromStaple(staple)\n\n\treturn cr.writeStaple(staple, rawStaple) // handles permit check itself\n}", "title": "" }, { "docid": "7b2cb99e2205bb520d71455d2c8f21b5", "score": "0.47110948", "text": "func (a *LicensesApiService) DowngradeLicenseExecute(r ApiDowngradeLicenseRequest) (*_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodPost\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"LicensesApiService.DowngradeLicense\")\n\tif err != nil {\n\t\treturn nil, GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/api/licenses/downgrade\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.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{}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\tif r.ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {\n\t\t\tif apiKey, ok := auth[\"ApiKeyAuth\"]; ok {\n\t\t\t\tvar key string\n\t\t\t\tif apiKey.Prefix != \"\" {\n\t\t\t\t\tkey = apiKey.Prefix + \" \" + apiKey.Key\n\t\t\t\t} else {\n\t\t\t\t\tkey = apiKey.Key\n\t\t\t\t}\n\t\t\t\tlocalVarHeaderParams[\"X-Seq-ApiKey\"] = key\n\t\t\t}\n\t\t}\n\t}\n\treq, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(req)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tlocalVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody))\n\tif err != nil {\n\t\treturn localVarHTTPResponse, err\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\treturn localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "449234114e4735b887fa8bc913b149c1", "score": "0.46986473", "text": "func Renew(eurekaURL string, appName string) error {\n\t// url := \"http://20.26.33.122:32010/eureka/apps/com.automationrhapsody.eureka.app/WKS-SOF-L011\"\n\n\turl := eurekaURL + \"/eureka/apps/\" + appName + \"/\" + nic.GetHostName()\n\tlog.I(\"renew:\", url)\n\n\tclient := &http.Client{}\n\trequest, e := http.NewRequest(\"PUT\", url, nil)\n\n\tif e != nil {\n\t\tlog.E(e)\n\t\treturn e\n\t}\n\n\tresp, e := client.Do(request)\n\tif e != nil {\n\t\treturn e\n\t}\n\tdefer resp.Body.Close()\n\n\tlog.I(\"resp: \", resp.Status)\n\n\tbody, e := ioutil.ReadAll(resp.Body)\n\tif e != nil {\n\t\treturn e\n\t}\n\tif len(body) != 0 {\n\t\tlog.E(string(body))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "65ec698f0d4f2a723b74a3fa407d7db3", "score": "0.46957192", "text": "func (t *SimpleChaincode) respondRenewal(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\tvar err error\r\n\r\n\tif len(args) != 2 {\r\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 2\")\r\n\t}\r\n\trenewalID := args[0]\r\n\tstate := args[1]\r\n\r\n\t// ==== Check if renewal already exists ====\r\n\trenewalAsBytes, err := stub.GetState(renewalID)\r\n\tif err != nil {\r\n\t\treturn shim.Error(\"Failed to get renewal: \" + err.Error())\r\n\t} else if renewalAsBytes == nil {\r\n\t\tfmt.Println(\"This renewal does not exists: \" + renewalID)\r\n\t\treturn shim.Error(\"This renewal does not exists: \" + renewalID)\r\n\t}\r\n\r\n\t//Get data from blockchain and populate it\r\n\trenewalData := renewal{}\r\n\terr2 := json.Unmarshal(renewalAsBytes, &renewalData)\r\n\tif err2 != nil {\r\n\t\tfmt.Println(\"Unable to unmarshal modify Received PO json::\", err)\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\trenewalData.State = state\r\n\r\n\trenewalJSONasBytes, err := json.Marshal(renewalData)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\t// === Save Renewal to state ===\r\n\terr = stub.PutState(renewalID, renewalJSONasBytes)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\t// ==== renewal saved and indexed. Return success ====\r\n\tfmt.Println(\"- end init user\")\r\n\treturn shim.Success(renewalJSONasBytes)\r\n}", "title": "" }, { "docid": "06780e8a49b56f8d03dcbd676f1d132c", "score": "0.46945515", "text": "func (srv *Server) RenewLease(ctx context.Context, req *databroker.RenewLeaseRequest) (*emptypb.Empty, error) {\n\tctx, span := trace.StartSpan(ctx, \"databroker.grpc.RenewLease\")\n\tdefer span.End()\n\tlog.Debug(ctx).\n\t\tStr(\"name\", req.GetName()).\n\t\tStr(\"id\", req.GetId()).\n\t\tDur(\"duration\", req.GetDuration().AsDuration()).\n\t\tMsg(\"renew lease\")\n\n\tdb, err := srv.getBackend()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tacquired, err := db.Lease(ctx, req.GetName(), req.GetId(), req.GetDuration().AsDuration())\n\tif err != nil {\n\t\treturn nil, err\n\t} else if !acquired {\n\t\treturn nil, status.Error(codes.AlreadyExists, \"lease no longer held\")\n\t}\n\n\treturn new(emptypb.Empty), nil\n}", "title": "" }, { "docid": "acb36af7a4960dc23fb3e9a160d3a1b9", "score": "0.46944544", "text": "func initKeyRenewal(ctx context.Context, registry *KeyRegistry, period, validFor time.Duration, cutoffTime time.Time, cn string, privateKeyAnnotations string, privateKeyLabels string) (func(), error) {\n\t// Create a new key if it's the first key,\n\t// or if it's older than cutoff time.\n\tif len(registry.keys) == 0 || registry.mostRecentKey.orderingTime.Before(cutoffTime) {\n\t\tif _, err := registry.generateKey(ctx, validFor, cn, privateKeyAnnotations, privateKeyLabels); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// wrapper function to log error thrown by generateKey function\n\tkeyGenFunc := func() {\n\t\tif _, err := registry.generateKey(ctx, validFor, cn, privateKeyAnnotations, privateKeyLabels); err != nil {\n\t\t\tlog.Errorf(\"Failed to generate new key : %v\\n\", err)\n\t\t}\n\t}\n\tif period == 0 {\n\t\treturn keyGenFunc, nil\n\t}\n\n\t// If key rotation is enabled, we'll rotate the key when the most recent\n\t// key becomes stale (older than period).\n\tmostRecentKeyAge := time.Since(registry.mostRecentKey.orderingTime)\n\tinitialDelay := period - mostRecentKeyAge\n\tif initialDelay < 0 {\n\t\tinitialDelay = 0\n\t}\n\treturn ScheduleJobWithTrigger(initialDelay, period, keyGenFunc), nil\n}", "title": "" }, { "docid": "6af1818654a314c29d459193866ea2a9", "score": "0.46846154", "text": "func shouldRenew(connection *v1alpha1.CentralConnection, minimalSyncTime time.Duration) bool {\n\tif connection.Spec.RenewNow {\n\t\treturn true\n\t}\n\n\tnotBefore := connection.Status.CertificateStatus.NotBefore.Unix()\n\tnotAfter := connection.Status.CertificateStatus.NotAfter.Unix()\n\n\tcertValidity := notAfter - notBefore\n\n\ttimeLeft := float64(notAfter - time.Now().Unix())\n\n\treturn timeLeft < float64(certValidity)*certValidityRenewalThreshold || timeLeft < 2*minimalSyncTime.Seconds()\n}", "title": "" }, { "docid": "92117b9f18de65ee2c78cf046417df15", "score": "0.46845606", "text": "func (c *Client) Release(ctx context.Context, subject lease.Subject) (response transport.ReleaseResponse, err error) {\n\tc.mutex.RLock()\n\tendpoint := c.endpoint\n\tc.mutex.RUnlock()\n\n\tresponse, err = endpoint.Release(ctx, subject)\n\tif err != nil {\n\t\tif isContextErr(err) {\n\t\t\treturn response, err\n\t\t}\n\t\tfailover, err2 := c.failover(ctx, true)\n\t\tif err2 != nil {\n\t\t\treturn response, err\n\t\t}\n\t\treturn failover.Release(ctx, subject)\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "756e5f521a4dcd85533db4ef7405f00a", "score": "0.4684051", "text": "func buildLicense(lic *license.License, s Server, updatefix bool) error {\n\n\t// set the LCP profile\n\tlicense.SetLicenseProfile(lic)\n\n\t// force the algorithm to the one defined by the basic and 1.0 profiles\n\tlic.Encryption.UserKey.Algorithm = \"http://www.w3.org/2001/04/xmlenc#sha256\"\n\n\t// get content info from the db\n\tcontent, err := s.Index().Get(lic.ContentID)\n\tif err != nil {\n\t\tlog.Println(\"No content with id\", lic.ContentID)\n\t\treturn err\n\t}\n\n\t// set links\n\terr = license.SetLicenseLinks(lic, content)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// encrypt the content key, user fieds, set the key check\n\terr = license.EncryptLicenseFields(lic, content)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// fix an issue with clients which test that the date of last update of the license\n\t// is after the date of creation of the X509 certificate.\n\t// Because of this, when a cert is replaced, fresh licenses are not accepted by such clients\n\t// when they have been created / updated before the cert update.\n\tif updatefix && config.Config.LcpServer.CertDate != \"\" {\n\t\tcertDate, err := time.Parse(\"2006-01-02\", config.Config.LcpServer.CertDate)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif lic.Issued.Before(certDate) && (lic.Updated == nil || lic.Updated.Before(certDate)) {\n\t\t\tlic.Updated = &certDate\n\t\t}\n\t}\n\n\t// sign the license\n\terr = license.SignLicense(lic, s.Certificate())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "06c4eb1faf1894db0c10aba4b27b640c", "score": "0.46802506", "text": "func (CertManager *CertManager) Renew(site fetcher.SiteCertProber) error {\n\t// Find the DNS Server of the site given.\n\tDNSServer, err := CertManager.GetDNSProviderForSite(site.GetConfig().URL)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Set the DNS Provider, let's encrypt challenge.\n\tif err := CertManager.LetsEncrypt.SetDNSProvider(dns.DNSProvider{DNSServer: DNSServer}); err != nil {\n\t\treturn err\n\t}\n\tif err := CertManager.LetsEncrypt.AskCertificate(site.GetConfig().URL); err != nil {\n\t\treturn err\n\t}\n\t// Use the certificate for the correct server.\n\tfor _, CertificateUpdater := range CertManager.CertificateUpdaters {\n\t\tif CertificateUpdater.GetName() == site.GetConfig().Server {\n\t\t\tif err := CertificateUpdater.UpdateCertificate(site); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := CertificateUpdater.ReloadHTTPServer(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif err := CertManager.sendToRecipientsByCategories(\n\t\t\"[\"+site.GetConfig().URL+\"] \"+\"New certificate upload;\",\n\t\t\"RENEW\"); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e41ad06c979fd8a3ca6f61c031d67b62", "score": "0.4659187", "text": "func (c *Licen) Activate(auth string) error {\n\ttype auth_req struct {\n\t\tXMLName xml.Name `xml:\"request\"`\n\t\tCode string `xml:\"license>fetch>auth-code\"`\n\t}\n\n\tc.con.LogOp(\"(op) request license fetch auth-code \\\"********\\\"\")\n\tbody, err := c.con.Op(auth_req{Code: auth}, \"\", nil, nil)\n\tif err != nil {\n\t\tif string(body) == \"VM Device License installed. Restarting pan services.\" {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "bcd8b3793dab96150c70afc787da8b56", "score": "0.4656143", "text": "func VerifyLicense(productPermalink, licenseKey string, incrementUsesCount bool) error {\n\tvar (\n\t\tresponse LicenseResponse\n\t)\n\n\tresp, err := http.PostForm(\"https://api.gumroad.com/v2/licenses/verify\",\n\t\turl.Values{\n\t\t\t\"product_permalink\": {productPermalink},\n\t\t\t\"license_key\": {licenseKey},\n\t\t\t\"increment_uses_count\": {strconv.FormatBool(incrementUsesCount)},\n\t\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tjson.Unmarshal(body, &response)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp.StatusCode == 404 {\n\t\treturn errors.New(\"gumroad: \" + response.Message)\n\t}\n\n\tif !response.Success {\n\t\treturn errors.New(\"gumroad: not a successful response\")\n\t}\n\n\tif response.Purchase.Refunded {\n\t\treturn errors.New(\"gumroad: product was refunded\")\n\t}\n\n\tif response.Purchase.Chargebacked {\n\t\treturn errors.New(\"gumroad: product was chargebacked\")\n\t}\n\n\tif response.Purchase.SubscriptionCancelledAt != nil {\n\t\treturn errors.New(\"gumroad: subscription cancelled\")\n\t}\n\n\tif response.Purchase.SubscriptionFailedAt != nil {\n\t\treturn errors.New(\"gumroad: subscription failed\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b85a282c35f169cddfd82bc78e73fc28", "score": "0.46505958", "text": "func (m *UserItemRequestBuilder) AssignLicense()(*ItemAssignLicenseRequestBuilder) {\n return NewItemAssignLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)\n}", "title": "" }, { "docid": "c8e658585b2d1bfddd9123f47d7776d9", "score": "0.46498466", "text": "func (m *EducationUser) SetAssignedLicenses(value []AssignedLicenseable)() {\n m.assignedLicenses = value\n}", "title": "" }, { "docid": "b24c5854cf291381e29df8d1686d6c69", "score": "0.4632249", "text": "func UpdateDeviceLicenseLicenseRecPath(licenseID int) string {\n\treturn fmt.Sprintf(\"/api/licenses/post/%v\", licenseID)\n}", "title": "" }, { "docid": "6dd93f42ff46ef0faf07d41c3ed53c68", "score": "0.4628835", "text": "func (b *BaseConsumerProtocolHandler) CancelAgreement(ag persistence.Agreement, reason string, cph ConsumerProtocolHandler, policyMatches bool) {\n\tif glog.V(5) {\n\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"Canceling Agreement: %v, reason: %v\", ag, reason)))\n\t}\n\t// Remove any workload usage records (non-HA) or mark for pending upgrade (HA). There might not be a workload usage record\n\t// if the consumer policy does not specify the workload priority section.\n\tif wlUsage, err := b.db.FindSingleWorkloadUsageByDeviceAndPolicyName(ag.DeviceId, ag.PolicyName); err != nil {\n\t\tglog.Warningf(BCPHlogstring(b.Name(), fmt.Sprintf(\"error retreiving workload usage for %v using policy %v, error: %v\", ag.DeviceId, ag.PolicyName, err)))\n\t} else if wlUsage != nil && policyMatches {\n\t\ttheDev, err := GetDevice(b.config.Collaborators.HTTPClientFactory.NewHTTPClient(nil), ag.DeviceId, b.config.AgreementBot.ExchangeURL, cph.GetExchangeId(), cph.GetExchangeToken())\n\t\tif err != nil {\n\t\t\tglog.Errorf(BCPHlogstring(b.Name(), fmt.Sprintf(\"error getting device %v, error: %v\", ag.DeviceId, err)))\n\t\t\treturn\n\t\t}\n\n\t\tif theDev != nil && theDev.HAGroup != \"\" {\n\t\t\t// update pending upgrade for itself. So that governerHA won't think this device has finish upgrade\n\t\t\tif glog.V(5) {\n\t\t\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"setting workloadusage pending for %v using policy %v\", ag.DeviceId, ag.PolicyName)))\n\t\t\t}\n\t\t\tif _, err := b.db.UpdatePendingUpgrade(ag.DeviceId, ag.PolicyName); err != nil {\n\t\t\t\tglog.Warningf(BCPHlogstring(b.Name(), fmt.Sprintf(\"unable to set workloadusage pending for %v using policy %v, error: %v\", ag.DeviceId, ag.PolicyName, err)))\n\t\t\t}\n\n\t\t\tdeviceAndGroupOrg := exchange.GetOrg(ag.DeviceId)\n\t\t\tif upgradingWorkload, err := b.db.GetHAUpgradingWorkload(deviceAndGroupOrg, theDev.HAGroup, ag.PolicyName); err != nil {\n\t\t\t\tglog.Errorf(BCPHlogstring(b.Name(), fmt.Sprintf(\"error get HA upgrading workload with hagroup %v, org: %v, policyName: %v, error: %v\", theDev.HAGroup, ag.Org, ag.PolicyName, err)))\n\t\t\t\treturn\n\t\t\t} else if upgradingWorkload != nil {\n\t\t\t\t// there is a upgrading workload, let the govenance handle the status and order\n\t\t\t\tif glog.V(5) {\n\t\t\t\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"upgrading workload: %v\", upgradingWorkload)))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// put this workload in HA workload upgrading table\n\t\t\tif glog.V(5) {\n\t\t\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"inserting HA upgrading workloads with hagroup %v, org: %v, policyName: %v deviceId: %v\", theDev.HAGroup, ag.Org, ag.PolicyName, ag.DeviceId)))\n\t\t\t}\n\t\t\tif currentNodeId, err := b.db.InsertHAUpgradingWorkloadForGroupAndPolicy(deviceAndGroupOrg, theDev.HAGroup, ag.PolicyName, ag.DeviceId); err != nil {\n\t\t\t\tglog.Errorf(BCPHlogstring(b.Name(), fmt.Sprintf(\"unable to insert HA upgrading workloads with hagroup %v, org: %v, policyName: %v deviceId: %v, error: %v\", theDev.HAGroup, ag.Org, ag.PolicyName, ag.DeviceId, err)))\n\t\t\t\treturn\n\t\t\t} else if currentNodeId == ag.DeviceId {\n\t\t\t\tif glog.V(5) {\n\t\t\t\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"delete workloadusage and cancel agreement for: org: %v, hagroup: %v, policyName: %v deviceId: %v\", ag.Org, theDev.HAGroup, ag.PolicyName, ag.DeviceId)))\n\t\t\t\t}\n\t\t\t\tif err := b.db.DeleteWorkloadUsage(ag.DeviceId, ag.PolicyName); err != nil {\n\t\t\t\t\tglog.Warningf(BCPHlogstring(b.Name(), fmt.Sprintf(\"error deleting workload usage for %v using policy %v, error: %v\", ag.DeviceId, ag.PolicyName, err)))\n\t\t\t\t}\n\t\t\t\tagreementWork := NewCancelAgreement(ag.CurrentAgreementId, ag.AgreementProtocol, cph.GetTerminationCode(reason), 0)\n\t\t\t\tcph.WorkQueue().InboundHigh() <- &agreementWork\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"unable to insert HA upgrading workloads with hagroup %v, org: %v, policyName: %v deviceId: %v because there is another node %v exists already in the table.\", theDev.HAGroup, ag.Org, ag.PolicyName, ag.DeviceId, currentNodeId)))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tif glog.V(5) {\n\t\tglog.Infof(BCPHlogstring(b.Name(), fmt.Sprintf(\"delete non-HA workloadusage and cancel agreement for: org: %v, policyName: %v deviceId: %v\", ag.Org, ag.PolicyName, ag.DeviceId)))\n\t}\n\t// reach here when it is a non-HA workload:\n\t// 1) wlUsage == nil\n\t// 2) theDev == nil || theDev.HAGroup == \"\"\n\t// Non-HA device or agreement without workload priority in the policy, re-make the agreement.\n\t// Delete this workload usage record so that a new agreement will be made starting from the highest priority workload\n\tif err := b.db.DeleteWorkloadUsage(ag.DeviceId, ag.PolicyName); err != nil {\n\t\tglog.Warningf(BCPHlogstring(b.Name(), fmt.Sprintf(\"error deleting workload usage for %v using policy %v, error: %v\", ag.DeviceId, ag.PolicyName, err)))\n\t}\n\tagreementWork := NewCancelAgreement(ag.CurrentAgreementId, ag.AgreementProtocol, cph.GetTerminationCode(reason), 0)\n\tcph.WorkQueue().InboundHigh() <- &agreementWork\n}", "title": "" }, { "docid": "bfdb25ab91a577379070e99d4594e782", "score": "0.4624841", "text": "func ValidateLicense(activationId string) (*ActivationResponse, *model.ApiError) {\n\tvalidReq := map[string]string{\n\t\t\"activationId\": activationId,\n\t}\n\n\treqString, _ := json.Marshal(validReq)\n\tresponse, err := http.Post(C.Prefix+\"/licenses/validate\", APPLICATION_JSON, bytes.NewBuffer(reqString))\n\n\tif err != nil {\n\t\treturn nil, model.BadRequest(errors.Wrap(err, \"unable to connect with license.signoz.io, please check your network connection\"))\n\t}\n\n\tbody, err := ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn nil, model.BadRequest(errors.Wrap(err, \"failed to read validation response from license.signoz.io\"))\n\t}\n\n\tdefer response.Body.Close()\n\n\tswitch response.StatusCode {\n\tcase 200, 201:\n\t\ta := ActivationResult{}\n\t\terr = json.Unmarshal(body, &a)\n\t\tif err != nil {\n\t\t\treturn nil, model.BadRequest(errors.Wrap(err, \"failed to marshal license validation response\"))\n\t\t}\n\t\treturn a.Data, nil\n\tcase 400, 401:\n\t\treturn nil, model.BadRequest(errors.Wrap(fmt.Errorf(string(body)),\n\t\t\t\"bad request error received from license.signoz.io\"))\n\tdefault:\n\t\treturn nil, model.InternalError(errors.Wrap(fmt.Errorf(string(body)),\n\t\t\t\"internal error received from license.signoz.io\"))\n\t}\n\n}", "title": "" }, { "docid": "a68e84e9000412505dadab07b9276f0c", "score": "0.46187192", "text": "func (p *Provider) revoke() error {\n\n\t_, err := p.client.Revoke(context.Background(), p.leaseId)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "a398a1774673873ebedbfb07eeaa54b8", "score": "0.46160585", "text": "func (n *Node) Renew(c context.Context, i *model.Instance) (err error) {\n\tvar res *model.Instance\n\terr = n.call(c, model.Renew, i, n.renewURL, &res)\n\tif err == errors.ServerErr {\n\t\tlog.Warningf(\"node be called(%s) instance(%v) error(%v)\", n.renewURL, i, err)\n\t\tn.status = model.NodeStatusLost\n\t\treturn\n\t}\n\tn.status = model.NodeStatusUP\n\tif err == errors.NothingFound {\n\t\tlog.Warningf(\"node be called(%s) instance(%v) error(%v)\", n.renewURL, i, err)\n\t\terr = n.call(c, model.Register, i, n.registerURL, nil)\n\t\treturn\n\t}\n\t// NOTE: register response instance whitch in conflict with peer node\n\tif err == errors.Conflict && res != nil {\n\t\terr = n.call(c, model.Register, res, n.pRegisterURL, nil)\n\t}\n\treturn\n}", "title": "" }, { "docid": "9e63554db8749fd2faa8b9e7166196d9", "score": "0.46150926", "text": "func (l *License) Update() *LicenseUpdateOne {\n\treturn NewLicenseClient(l.config).UpdateOne(l)\n}", "title": "" }, { "docid": "482484acb659a1a398c8fc00d947ada0", "score": "0.45979604", "text": "func (o LicenseAssociationOutput) LicenseExpiration() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *LicenseAssociation) pulumi.StringOutput { return v.LicenseExpiration }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9773d9c2bfb7475984fa66409d0c4727", "score": "0.45900744", "text": "func UA_SecureChannelManager_renew(cm []UA_SecureChannelManager, channel []UA_SecureChannel, request []UA_OpenSecureChannelRequest, response []UA_OpenSecureChannelResponse) UA_StatusCode {\n\tif uint32(channel[0].state) != uint32(UA_SECURECHANNELSTATE_OPEN) {\n\t\tUA_LOG_ERROR(UA_Logger(cm[0].server[0].config.logger), UA_LOGCATEGORY_SECURECHANNEL, []byte(\"Connection %i | SecureChannel %i | Called renew on channel which is not open%.0s\\x00\"), (func() int {\n\t\t\tif (channel)[0].connection != nil {\n\t\t\t\treturn int((__int32_t((int32_t((UA_Int32((channel)[0].connection[0].sockfd)))))))\n\t\t\t}\n\t\t\treturn 0\n\t\t}()), UA_UInt32((channel)[0].securityToken.channelId), []byte(\"\\x00\"))\n\t\treturn UA_StatusCode((uint32_t((uint32((uint32(2147614720)))))))\n\t}\n\tif UA_UInt32(channel[0].nextSecurityToken.tokenId) == UA_UInt32((uint32_t((uint32((0)))))) {\n\t\t// If no security token is already issued\n\t\tchannel[0].nextSecurityToken.channelId = UA_UInt32(channel[0].securityToken.channelId)\n\t\tchannel[0].nextSecurityToken.tokenId = func() UA_UInt32 {\n\t\t\ttempVar := &cm[0].lastTokenId\n\t\t\tdefer func() {\n\t\t\t\t*tempVar ++\n\t\t\t}()\n\t\t\treturn *tempVar\n\t\t}()\n\t\tchannel[0].nextSecurityToken.createdAt = UA_DateTime_now()\n\t\tchannel[0].nextSecurityToken.revisedLifetime = UA_UInt32((uint32_t((uint32((func() uint32 {\n\t\t\tif UA_UInt32(request[0].requestedLifetime) > UA_UInt32(cm[0].server[0].config.maxSecurityTokenLifetime) {\n\t\t\t\treturn uint32((uint32((uint32_t((UA_UInt32(cm[0].server[0].config.maxSecurityTokenLifetime)))))))\n\t\t\t}\n\t\t\treturn uint32((uint32((uint32_t((UA_UInt32(request[0].requestedLifetime)))))))\n\t\t}()))))))\n\t\tif UA_UInt32(channel[0].nextSecurityToken.revisedLifetime) == UA_UInt32((uint32_t((uint32((0)))))) {\n\t\t\t// lifetime 0 -> return the max lifetime\n\t\t\tchannel[0].nextSecurityToken.revisedLifetime = UA_UInt32(cm[0].server[0].config.maxSecurityTokenLifetime)\n\t\t}\n\t}\n\t// Replace the nonces\n\tUA_ByteString_deleteMembers((*[100000000]UA_ByteString)(unsafe.Pointer(&channel[0].remoteNonce))[:])\n\tvar retval UA_StatusCode = UA_ByteString_copy((*[100000000]UA_ByteString)(unsafe.Pointer(&request[0].clientNonce))[:], (*[100000000]UA_ByteString)(unsafe.Pointer(&channel[0].remoteNonce))[:])\n\tretval |= UA_SecureChannel_generateLocalNonce(channel)\n\tif retval != UA_StatusCode((uint32_t((uint32((0)))))) {\n\t\treturn UA_StatusCode(retval)\n\t}\n\t// Set the response\n\tresponse[0].responseHeader.requestHandle = UA_UInt32(request[0].requestHeader.requestHandle)\n\tretval = UA_ByteString_copy((*[100000000]UA_ByteString)(unsafe.Pointer(&channel[0].localNonce))[:], (*[100000000]UA_ByteString)(unsafe.Pointer(&response[0].serverNonce))[:])\n\tretval |= UA_ChannelSecurityToken_copy((*[100000000]UA_ChannelSecurityToken)(unsafe.Pointer(&channel[0].nextSecurityToken))[:], (*[100000000]UA_ChannelSecurityToken)(unsafe.Pointer(&response[0].securityToken))[:])\n\tif retval != UA_StatusCode((uint32_t((uint32((0)))))) {\n\t\treturn UA_StatusCode(retval)\n\t}\n\t// Reset the internal creation date to the monotonic clock\n\tchannel[0].nextSecurityToken.createdAt = UA_DateTime_nowMonotonic()\n\treturn 0\n}", "title": "" }, { "docid": "8e43b4eb5f0d355e5de18d26689f13c4", "score": "0.45893952", "text": "func (service SubscriptionsService) Reactivate(uuid string) (*Response, Subscription, error) {\n\taction := fmt.Sprintf(\"subscriptions/%s/reactivate\", uuid)\n\treq, err := service.client.newRequest(\"PUT\", action, nil, nil)\n\tif err != nil {\n\t\treturn nil, Subscription{}, err\n\t}\n\n\tvar dest Subscription\n\tres, err := service.client.do(req, &dest)\n\n\treturn res, dest, err\n}", "title": "" }, { "docid": "2d0161e1ce8412224ecb9d84e78feaf5", "score": "0.45834193", "text": "func (m *MockRenewer) Renew(arg0 context.Context, arg1 *core.User, arg2 bool) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Renew\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "65a1ec17ee262bd701a13898fde14243", "score": "0.4580117", "text": "func (client DomainsClient) RenewPreparer(ctx context.Context, resourceGroupName string, domainName string) (*http.Request, error) {\n\tpathParameters := map[string]interface{}{\n\t\t\"domainName\": autorest.Encode(\"path\", domainName),\n\t\t\"resourceGroupName\": autorest.Encode(\"path\", resourceGroupName),\n\t\t\"subscriptionId\": autorest.Encode(\"path\", client.SubscriptionID),\n\t}\n\n\tconst APIVersion = \"2021-02-01\"\n\tqueryParameters := map[string]interface{}{\n\t\t\"api-version\": APIVersion,\n\t}\n\n\tpreparer := autorest.CreatePreparer(\n\t\tautorest.AsPost(),\n\t\tautorest.WithBaseURL(client.BaseURI),\n\t\tautorest.WithPathParameters(\"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew\", pathParameters),\n\t\tautorest.WithQueryParameters(queryParameters))\n\treturn preparer.Prepare((&http.Request{}).WithContext(ctx))\n}", "title": "" }, { "docid": "51e4169f011f252797fd1453c0c2e07d", "score": "0.45705286", "text": "func (r *MacOsVppAppAssignedLicensesCollectionRequest) Add(ctx context.Context, reqObj *MacOsVppAppAssignedLicense) (resObj *MacOsVppAppAssignedLicense, err error) {\n\terr = r.JSONRequest(ctx, \"POST\", \"\", reqObj, &resObj)\n\treturn\n}", "title": "" }, { "docid": "8a3f193c766dcdc23ebe610d347c819f", "score": "0.45672852", "text": "func TestAuthApplierV3_LeaseRevoke(t *testing.T) {\n\tauthApplier := defaultAuthApplierV3(t)\n\tmustCreateRolesAndEnableAuth(t, authApplier)\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\n\t_, err := authApplier.LeaseGrant(&pb.LeaseGrantRequest{\n\t\tTTL: lease.MaxLeaseTTL,\n\t\tID: LeaseId,\n\t})\n\trequire.NoError(t, err)\n\n\t// The user should be able to revoke the lease\n\tsetAuthInfo(authApplier, userWriteOnly)\n\t_, err = authApplier.LeaseRevoke(&pb.LeaseRevokeRequest{\n\t\tID: LeaseId,\n\t})\n\trequire.NoError(t, err)\n\n\t_, err = authApplier.LeaseGrant(&pb.LeaseGrantRequest{\n\t\tTTL: lease.MaxLeaseTTL,\n\t\tID: LeaseId,\n\t})\n\trequire.NoError(t, err)\n\n\t// Put a key under the lease outside user's key range\n\tsetAuthInfo(authApplier, userRoot)\n\t_, _, err = authApplier.Put(ctx, &pb.PutRequest{\n\t\tKey: []byte(keyOutsideRange),\n\t\tValue: []byte(\"1\"),\n\t\tLease: LeaseId,\n\t})\n\trequire.NoError(t, err)\n\n\t// The user should not be able to revoke the lease anymore\n\tsetAuthInfo(authApplier, userWriteOnly)\n\t_, err = authApplier.LeaseRevoke(&pb.LeaseRevokeRequest{\n\t\tID: LeaseId,\n\t})\n\trequire.Equal(t, err, auth.ErrPermissionDenied)\n}", "title": "" }, { "docid": "855f8bce59b5ccc41e64d5cc22c9907d", "score": "0.45602688", "text": "func (t *SimpleChaincode) sendRenewal(stub shim.ChaincodeStubInterface, args []string) pb.Response {\r\n\tif len(args) != 7 {\r\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 7\")\r\n\t}\r\n\r\n\t// ==== Input sanitation ====\r\n\tfmt.Println(\"- start udpate renewal\")\r\n\tif len(args[0]) <= 0 {\r\n\t\treturn shim.Error(\"1st argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[1]) <= 0 {\r\n\t\treturn shim.Error(\"2nd argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[2]) <= 0 {\r\n\t\treturn shim.Error(\"3rd argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[3]) <= 0 {\r\n\t\treturn shim.Error(\"4th argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[4]) <= 0 {\r\n\t\treturn shim.Error(\"5th argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[5]) <= 0 {\r\n\t\treturn shim.Error(\"6th argument must be a non-empty string\")\r\n\t}\r\n\tif len(args[6]) <= 0 {\r\n\t\treturn shim.Error(\"7th argument must be a non-empty string\")\r\n\t}\r\n\r\n\tobjectType := \"renewal\"\r\n\trenewalId := args[0]\r\n\tcurPrice := args[1]\r\n\tpiPercent := args[2]\r\n\tpiCap := args[3]\r\n\tpiPeriod := args[4]\r\n\tnewPrice := args[5]\r\n\tstate := args[6]\r\n\r\n\t// ==== Check if renewal already exists ====\r\n\trenewalTestAsBytes, err := stub.GetState(renewalId)\r\n\tif err != nil {\r\n\t\treturn shim.Error(\"Failed to get renewal: \" + err.Error())\r\n\t} else if renewalTestAsBytes != nil {\r\n\t\tfmt.Println(\"This renewal already exists: \" + renewalId)\r\n\t\treturn shim.Error(\"This renewal already exists: \" + renewalId)\r\n\t}\r\n\r\n\t// ============= Create renewal object and marshal to JSON ====================\r\n\trenewal := &renewal{objectType, renewalId, curPrice, piPercent, piCap, piPeriod, newPrice, state}\r\n\trenewalAsBytes, err := json.Marshal(renewal)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\t// === Save renewal to state ===\r\n\terr = stub.PutState(renewalId, renewalAsBytes)\r\n\tif err != nil {\r\n\t\treturn shim.Error(err.Error())\r\n\t}\r\n\r\n\tfmt.Println(\"- end send renewal \")\r\n\r\n\tvar sendRenewalEventValue []byte\r\n\tsendRenewalEventValue = []byte(\"send renewal with renewal id \"+ renewalId)\r\n\tstub.SetEvent(\"sendRenewal\", sendRenewalEventValue)\r\n\r\n\treturn shim.Success(renewalAsBytes)\r\n\r\n}", "title": "" }, { "docid": "156b3e36ef489c526dcbc8f523dabcd3", "score": "0.45477355", "text": "func (v *vaultService) renewToken() {\n\tretryDelay := v.leaseDuration / 2\n\tgo func() {\n\t\tfor {\n\t\t\tif v.secret == nil {\n\t\t\t\tif err := v.authenticate(); err != nil {\n\t\t\t\t\ttime.Sleep(retryDelay)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\ts, err := v.client.Auth().Token().RenewSelf(int(v.leaseDuration))\n\t\t\tif err != nil || s == nil {\n\t\t\t\tv.secret = nil\n\t\t\t\ttime.Sleep(retryDelay)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ok, err := s.TokenIsRenewable(); !ok || err != nil {\n\t\t\t\tv.secret = nil\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tttl, err := s.TokenTTL()\n\t\t\tif err != nil {\n\t\t\t\tv.secret = nil\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tv.secret = s\n\t\t\tretryDelay = ttl / 2\n\t\t\ttime.Sleep(retryDelay)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "b1865b3dcd8bb4e4f7eef5fe907f0e0b", "score": "0.4544359", "text": "func (t *LicenseTracer) Update(ctx context.Context, id types.ID, param *sacloud.LicenseUpdateRequest) (*sacloud.License, error) {\n\tlog.Println(\"[TRACE] LicenseAPI.Update start\")\n\ttargetArguments := struct {\n\t\tArgid types.ID `json:\"id\"`\n\t\tArgparam *sacloud.LicenseUpdateRequest `json:\"param\"`\n\t}{\n\t\tArgid: id,\n\t\tArgparam: param,\n\t}\n\tif d, err := json.Marshal(targetArguments); err == nil {\n\t\tlog.Printf(\"[TRACE] \\targs: %s\\n\", string(d))\n\t}\n\n\tdefer func() {\n\t\tlog.Println(\"[TRACE] LicenseAPI.Update end\")\n\t}()\n\n\tresultLicense, err := t.Internal.Update(ctx, id, param)\n\ttargetResults := struct {\n\t\tLicense *sacloud.License\n\t\tError error\n\t}{\n\t\tLicense: resultLicense,\n\t\tError: err,\n\t}\n\tif d, err := json.Marshal(targetResults); err == nil {\n\t\tlog.Printf(\"[TRACE] \\tresults: %s\\n\", string(d))\n\t}\n\n\treturn resultLicense, err\n}", "title": "" } ]
e1adaf9fcf6e02dc9a29df1f656b6ff6
SetObjectNodeElem set kv pair
[ { "docid": "a1dca55bb7fa8facb8effc661029b351", "score": "0.71992064", "text": "func (n *Node) SetObjectNodeElem(key string, value *Node) *Node {\n\tfor _, elem := range n.ObjectValues {\n\t\tif elem.Key.AsString() == key {\n\t\t\telem.Value = value\n\t\t\treturn n\n\t\t}\n\t}\n\telem := CreateObjectElem()\n\telem.Key = CreateStringNode()\n\telem.Key.Value = bytesToString(stdMarshalString([]byte(key)))\n\telem.Value = value\n\tn.ObjectValues = append(n.ObjectValues, elem)\n\treturn n\n}", "title": "" } ]
[ { "docid": "35c979332eb545620c3279ef5fc834cc", "score": "0.6630248", "text": "func (n *Node) SetObjectStringElem(key, value string) *Node {\n\tfor _, elem := range n.ObjectValues {\n\t\tif elem.Key.AsString() == key {\n\t\t\telem.Value.Type = String\n\t\t\telem.Value.Value = bytesToString(stdMarshalString([]byte(value)))\n\t\t\treturn n\n\t\t}\n\t}\n\telem := CreateObjectElem()\n\telem.Key = CreateStringNode()\n\telem.Key.Value = bytesToString(stdMarshalString([]byte(key)))\n\telem.Value = CreateStringNode()\n\telem.Value.Value = bytesToString(stdMarshalString([]byte(value)))\n\tn.ObjectValues = append(n.ObjectValues, elem)\n\treturn n\n}", "title": "" }, { "docid": "176c70bf7d05d9bddd38f32f89d73383", "score": "0.63776493", "text": "func (n *Node) SetObjectIntElem(key string, value int64) *Node {\n\tfor _, elem := range n.ObjectValues {\n\t\tif elem.Key.AsString() == key {\n\t\t\telem.Value.Type = Integer\n\t\t\telem.Value.Value = strconv.FormatInt(value, 10)\n\t\t\treturn n\n\t\t}\n\t}\n\telem := CreateObjectElem()\n\telem.Key = CreateStringNode()\n\telem.Key.Value = bytesToString(stdMarshalString([]byte(key)))\n\telem.Value = CreateIntegerNode()\n\telem.Value.Value = strconv.FormatInt(value, 10)\n\tn.ObjectValues = append(n.ObjectValues, elem)\n\treturn n\n}", "title": "" }, { "docid": "5979feee141c8d5188bf004bf8a73bee", "score": "0.62255955", "text": "func (obj Object) Set(key string, v interface{}) { obj.o.Set(key, v) }", "title": "" }, { "docid": "eaf87f6677db5df3f9f5f2896de0ef65", "score": "0.61079764", "text": "func (obj Link) Set(key string, v interface{}) { obj.o.Set(key, v) }", "title": "" }, { "docid": "bc7b293c1ef0917927056a5311bca77c", "score": "0.59488416", "text": "func (n *Node) SetObjectBoolElem(key string, value bool) *Node {\n\tval := falseVal\n\tif value {\n\t\tval = trueVal\n\t}\n\tfor _, elem := range n.ObjectValues {\n\t\tif elem.Key.AsString() == key {\n\t\t\telem.Value.Type = Bool\n\t\t\telem.Value.Value = val\n\t\t\treturn n\n\t\t}\n\t}\n\telem := CreateObjectElem()\n\telem.Key = CreateStringNode()\n\telem.Key.Value = bytesToString(stdMarshalString([]byte(key)))\n\telem.Value = CreateBoolNode()\n\telem.Value.Value = val\n\tn.ObjectValues = append(n.ObjectValues, elem)\n\treturn n\n}", "title": "" }, { "docid": "a982ea053f1a7f1ef49166744c72d9ce", "score": "0.58657575", "text": "func (obj OrderedItems) Set(key string, v interface{}) { obj.o.Set(key, v) }", "title": "" }, { "docid": "7d9409f166c806bf99ddcef8235846da", "score": "0.58002716", "text": "func (n *Node) SetObjectUintElem(key string, value uint64) *Node {\n\tfor _, elem := range n.ObjectValues {\n\t\tif elem.Key.AsString() == key {\n\t\t\telem.Value.Type = Integer\n\t\t\telem.Value.Value = strconv.FormatUint(value, 10)\n\t\t\treturn n\n\t\t}\n\t}\n\telem := CreateObjectElem()\n\telem.Key = CreateStringNode()\n\telem.Key.Value = bytesToString(stdMarshalString([]byte(key)))\n\telem.Value = CreateIntegerNode()\n\telem.Value.Value = strconv.FormatUint(value, 10)\n\tn.ObjectValues = append(n.ObjectValues, elem)\n\treturn n\n}", "title": "" }, { "docid": "d350e55159c27a57979621c5dc892268", "score": "0.57932144", "text": "func (kvStore *kvStore) set(ctx context.Context, k, v string) error {\n\tkv := kvpb.KV{K: k, V: v}\n\tdata, err := kv.Marshal()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _, err = kvStore.node.Propose(ctx, data)\n\treturn err\n}", "title": "" }, { "docid": "78fb694809c1d9e934e37063543f06ac", "score": "0.56823945", "text": "func (kvs *KeyValues) SetValue(obj, field ident.Id, value interface{}) (err error) {\n\tinst, ok := kvs.objects[obj]\n\tif !ok {\n\t\tinst, err = kvs.Cache(obj)\n\t}\n\tif err != nil {\n\t\tpanic(err)\n\t} else {\n\t\terr = inst.SetValue(field, value)\n\t}\n\treturn\n}", "title": "" }, { "docid": "5863e598b04596e6122cf474b913866f", "score": "0.5675598", "text": "func (node *Node) putValue(key string, val string) {\n node.Dir[key] = NewNode()\n node.Dir[key].Value = val\n}", "title": "" }, { "docid": "87058d28af51d5b3a78a74b993ba6174", "score": "0.56245184", "text": "func (bld *EventMeasurementSetBuilder) SetAdditionalObject(vmID, objectName, objectInstance string, timestamp time.Time, value float64, keys MeasKeys) error {\n\tif len(vmID) == 0 || len(objectName) == 0 || len(objectInstance) == 0 {\n\t\treturn errors.New(\"SetAdditionalObject() - Arguments cannot be empty\")\n\t}\n\tmetric, err := bld.find(vmID, timestamp)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar additionalObject *govel.JSONObject\n\tfor i, obj := range metric.AdditionalObjects {\n\t\tif obj.ObjectName == objectName {\n\t\t\tadditionalObject = &metric.AdditionalObjects[i]\n\t\t\tbreak\n\t\t}\n\t}\n\tif additionalObject == nil {\n\t\tmetric.AdditionalObjects = append(metric.AdditionalObjects, govel.JSONObject{ObjectName: objectName})\n\t\tadditionalObject = &metric.AdditionalObjects[len(metric.AdditionalObjects)-1]\n\t}\n\tvar instance *govel.JSONObjectInstance\n\tfor i, inst := range additionalObject.ObjectInstances {\n\t\tif keys.MatchJSONObjectKeys(inst.ObjectKeys) {\n\t\t\tinstance = &additionalObject.ObjectInstances[i]\n\t\t\tbreak\n\t\t}\n\t}\n\tif instance == nil {\n\t\tinst := govel.JSONObjectInstance{\n\t\t\tObjectKeys: keys.JSONObjectKeys(),\n\t\t\tObjectInstance: make(map[string]interface{}),\n\t\t}\n\t\tadditionalObject.ObjectInstances = append(additionalObject.ObjectInstances, inst)\n\t\tinstance = &additionalObject.ObjectInstances[len(additionalObject.ObjectInstances)-1]\n\t}\n\tinstance.ObjectInstance[objectInstance] = value\n\treturn nil\n}", "title": "" }, { "docid": "12bdf5ab5d8805dcc338270fea89ff3c", "score": "0.5599052", "text": "func (o *Opi) Set(key []byte, value []byte) {\n}", "title": "" }, { "docid": "3632456bdaabe0fd52459693d7c5564a", "score": "0.5545208", "text": "func (obj OrderedCollection) Set(key string, v interface{}) { obj.o.Set(key, v) }", "title": "" }, { "docid": "4beb849689b9e2db9b40fbcf1aba3b10", "score": "0.5423714", "text": "func (kv KeyValuePair) setKey(obj interface{}) {\n\tkv[\"key\"] = obj\n}", "title": "" }, { "docid": "9793a24b5e276e69b9a596d496aaad91", "score": "0.54213154", "text": "func (self *State) SetKeyA(member string) {\n self.Object.Set(\"key\", member)\n}", "title": "" }, { "docid": "cfac8cb42a416e5f87bb7791e60e6062", "score": "0.537979", "text": "func put(currentNode *node, key []byte, value string, keyIndex int) *node {\n\tif currentNode == nil {\n\t\t// if given node is nil, create a new node\n\t\tcurrentNode = &node{}\n\t}\n\tif keyIndex == len(key) {\n\t\t// if we're at the end of the key bytes, set\n\t\t// the current node's value to the given value\n\t\t// and return it.\n\t\tcurrentNode.value = value\n\t\treturn currentNode\n\t}\n\t// we still got bytes left in the key.\n\t// pick the next byte from the key\n\tc := key[keyIndex]\n\t// Set the next node at position c\n\tcurrentNode.next[c] = put(currentNode.next[c], key, value, keyIndex+1)\n\treturn currentNode\n}", "title": "" }, { "docid": "1124b2a23731788e2fe3cd5e4b6f1026", "score": "0.53731537", "text": "func setNode(ctx context.Context, txn *dgo.Txn, b builder,\n\tidentifier string, dat *DupleNode) (map[string]string, error) {\n\t// loop through the duples to write the triples into the builder.\n\tfor _, d := range dat.Duples {\n\t\t// get any optional XML datatype knowledge based on the value.\n\t\td.dataType = checkType(d.Object)\n\t\tif uid, ok := d.Object.(UID); ok {\n\t\t\t// Use the UID format instead of the regular object.\n\t\t\tfmt.Fprintf(b, rdfReference+d.dataType+rdfEnd, identifier, d.Predicate, uid.Value())\n\t\t} else if slice, ok := d.Object.([]byte); ok {\n\t\t\t// Write a string casted byte slice into the builder.\n\t\t\tfmt.Fprintf(b, rdfBase+d.dataType+rdfEnd, identifier, d.Predicate, string(slice))\n\t\t} else {\n\t\t\t// Write the triplet into the builder.\n\t\t\tfmt.Fprintf(b, rdfBase+d.dataType+rdfEnd, identifier, d.Predicate, d.Object)\n\t\t}\n\t}\n\n\t// Use our transaction to execute a mutation to insert or update our node.\n\t// Renamed assigned to response to match dgo major version change.\n\t// See Issue #17 for more info.\n\tresponse, err := txn.Mutate(ctx, &api.Mutation{SetNquads: []byte(b.String())})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// return the full map of UIDs back.\n\t// Note: The key being the node's identifier.\n\treturn response.GetUids(), nil\n}", "title": "" }, { "docid": "f62c67a9a0e71dba498c3f1a85c8bf60", "score": "0.53622526", "text": "func (kv *KeyValue) SetObject(obj interface{}) error {\n\tif bytes, err := json.Marshal(obj); err == nil {\n\t\treturn kv.Set(string(bytes))\n\t} else {\n\t\treturn err\n\t}\n}", "title": "" }, { "docid": "271cc532e292b45505f6d699b81fe717", "score": "0.53532", "text": "func (list *SkipList) Set(key, value interface{}) *Element {\n var element *Element\n\n score := getScore(key, list.reversed)\n prevs := list.getPrevElementNodes(key, score)\n\n // found an element with the same key, replace its value\n if element = prevs[0].next[0]; element != nil && !list.keyFunc.Compare(element.key, key) {\n element.Value = value\n return element\n }\n\n element = &Element{\n elementNode: elementNode{\n next: make([]*Element, list.randLevel()),\n },\n key: key,\n score: score,\n Value: value,\n }\n\n for i := range element.next {\n element.next[i] = prevs[i].next[i]\n prevs[i].next[i] = element\n }\n\n list.length++\n return element\n}", "title": "" }, { "docid": "b20ceecfc9fd9396b121645dad29297e", "score": "0.5352912", "text": "func (e *Element) Set(key string, value string) {\n\te.Attrib[key] = value\n}", "title": "" }, { "docid": "3cf9dc337df94ad48bbbc87c2fb10ec5", "score": "0.53509", "text": "func (n *node) Set(path []key.Key, v interface{}) {\n\tfor _, element := range path {\n\t\tif element.Equal(Wildcard) {\n\t\t\tif n.wildcard == nil {\n\t\t\t\tn.wildcard = &node{}\n\t\t\t}\n\t\t\tn = n.wildcard\n\t\t\tcontinue\n\t\t}\n\t\tif n.children == nil {\n\t\t\tn.children = map[key.Key]*node{}\n\t\t}\n\t\tnext, ok := n.children[element]\n\t\tif !ok {\n\t\t\tnext = &node{}\n\t\t\tn.children[element] = next\n\t\t}\n\t\tn = next\n\t}\n\tn.val = v\n}", "title": "" }, { "docid": "0d0142ffc3119f646ceaaa3304a85a4c", "score": "0.5343777", "text": "func (self *Rope) SetKeyA(member interface{}) {\n self.Object.Set(\"key\", member)\n}", "title": "" }, { "docid": "3aa447d5ec0e37f62aeec9db1a3b0d64", "score": "0.5299379", "text": "func (o Object) Set(attributeType uint, value []byte) error {\n\to.session.Lock()\n\tdefer o.session.Unlock()\n\n\terr := o.session.ctx.SetAttributeValue(o.session.handle, o.objectHandle,\n\t\t[]*pkcs11.Attribute{pkcs11.NewAttribute(attributeType, value)})\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c3334df3139e4996c8da61918e2228d6", "score": "0.52776563", "text": "func (chain *NodeChain) Set(args *api.SetArgs, reply *api.ValReply) error {\n\trpcClient, err := chain.connectToFirstLiveNode()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer rpcClient.Close()\n\treturn rpcClient.Call(\"KeyValService.Set\", args, reply)\n}", "title": "" }, { "docid": "51fb9545310ac65a9d82ef4feea88ada", "score": "0.5267835", "text": "func (treap *MutableTreap) Set(key int, value interface{}) {\n\ttreap.root = treap.root.setUnsafe(key, value, rand.Int())\n}", "title": "" }, { "docid": "91c3dbe8fee9f7459d4f2a106d22957b", "score": "0.5267285", "text": "func SetObj(w http.ResponseWriter, key string, obj interface{}) error {\n\tvalue, err := json.Marshal(obj)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tset(w, key, string(value))\n\treturn nil\n}", "title": "" }, { "docid": "b2dfbca25fc14c6d03a923aaa6accd8e", "score": "0.5259345", "text": "func SetAttr(n *xmlquery.Node, key, val string) {\n\tvar attr xml.Attr\n\tif i := strings.Index(key, \":\"); i > 0 {\n\t\tattr = xml.Attr{\n\t\t\tName: xml.Name{Space: key[:i], Local: key[i+1:]},\n\t\t\tValue: val,\n\t\t}\n\t} else {\n\t\tattr = xml.Attr{\n\t\t\tName: xml.Name{Local: key},\n\t\t\tValue: val,\n\t\t}\n\t}\n\n\tfor i := range n.Attr {\n\t\tif n.Attr[i].Name.Local == attr.Name.Local && n.Attr[i].Name.Space == attr.Name.Space {\n\t\t\tn.Attr[i].Value = attr.Value\n\t\t\treturn\n\t\t}\n\t}\n\n\tn.Attr = append(n.Attr, attr)\n}", "title": "" }, { "docid": "16b57bb43db668dfca180dc9a90c3b3e", "score": "0.52497417", "text": "func (h *Hivex) NodeSetValue(node int64, value HiveValue) (int, error) {\n\tn := (C.hive_node_h)(node)\n\tvar val C.hive_set_value\n\tvar newVal *C.hive_set_value = (*C.hive_set_value)(\n\t\tC.malloc(\n\t\t\tC.size_t(unsafe.Sizeof(val)),\n\t\t),\n\t)\n\tdefer C.free(unsafe.Pointer(newVal))\n\n\tconverted := C.hive_set_value{\n\t\tkey: C.CString(value.Key),\n\t\tt: (C.hive_type)(value.Type),\n\t\tlen: (C.size_t)(len(value.Value)),\n\t\tvalue: (*C.char)(unsafe.Pointer(&value.Value[0])),\n\t}\n\tsetValRet := C.set_values(newVal, C.int(0), C.int(1), converted)\n\tif int(setValRet) != 0 {\n\t\treturn 0, fmt.Errorf(\"failed to set value for nodes\")\n\t}\n\tret, err := C.hivex_node_set_value(h.han, n, newVal, 0)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn int(ret), nil\n}", "title": "" }, { "docid": "410ec78e64212c2853576d408bb0d294", "score": "0.52459073", "text": "func SetStruct(pool *redis.Pool, key string, data interface{}) error {\n\tif data == nil {\n\t\treturn fmt.Errorf(\"data cannot be nil\")\n\t}\n\n\tb, err := json.Marshal(data)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error marshaling data %v: %v\", data, err)\n\t}\n\n\treturn Set(pool, key, string(b))\n}", "title": "" }, { "docid": "f9cd66b538f6caba8f4e6ce67bc7f242", "score": "0.5239309", "text": "func SetAttribute(o *js.Object, key string, value string) {\n\to.Call(\"setAttribute\", key, value)\n}", "title": "" }, { "docid": "f94cf488b662c95c10b2fee5539b8117", "score": "0.5229619", "text": "func setRNode(k json.Unmarshaler, node *yaml.RNode) error {\n\ts, err := node.String()\n\tif err != nil {\n\t\treturn err\n\t}\n\tm := map[string]interface{}{}\n\tif err := yaml.Unmarshal([]byte(s), &m); err != nil {\n\t\treturn err\n\t}\n\n\tb, err := json.Marshal(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn k.UnmarshalJSON(b)\n}", "title": "" }, { "docid": "6c7bab794c19cebb345298bd1d81bc66", "score": "0.51842284", "text": "func (o *Object) Set(name string, val interface{}) {\n\to.data[name] = val\n}", "title": "" }, { "docid": "f6b8a5f83dafb42080c8447db820b97b", "score": "0.51778644", "text": "func (t *TCPTransport) Set(target *Vnode, key string, version uint, value []byte) error {\n\tresp := tcpBodyError{}\n\terr := t.networkCall(target.Host, tcpSet, tcpBodySet{Vnode: target, Key: key, Version: version, Value: value}, &resp)\n\n\tif err != nil {\n\t\treturn err\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "6fb8fb5e050e32845a06d1cc249a4ca4", "score": "0.5175483", "text": "func (obj *Object) Set(prop string, value interface{}) {\n\tn := len(obj.content)\n\tfor i := 0; i < n; i++ {\n\t\tif obj.content[i].prop == prop {\n\t\t\tobj.content[i].value = value\n\t\t}\n\t}\n\tobj.content = append(obj.content, unit{prop, value})\n}", "title": "" }, { "docid": "589cad22c1d135c5f8526ed8dea93e78", "score": "0.5169328", "text": "func (p *parser) set(key string, val interface{}, typ tomlType, pos Position) {\n\tp.setValue(key, val)\n\tp.setType(key, typ, pos)\n}", "title": "" }, { "docid": "a49342a626f333a3f9201516b4724d0e", "score": "0.516025", "text": "func Put(node *Node, key string, value string) error {\n\n\t//TODO students should implement this method\n\tremoteNode, err := node.locate(key)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn err\n\t}\n\t//Debug.Println(\"key:%s locate\")\n\treturn remoteNode.PutRPC(key, value)\n}", "title": "" }, { "docid": "0ead5cb1c336f25f1e0f8c5b230b33d6", "score": "0.5149856", "text": "func (t *Tree) Set(key string, value interface{}) {\n\tt.SetWithComment(key, \"\", false, value)\n}", "title": "" }, { "docid": "1c418b3c77491babefb662075df22347", "score": "0.51452786", "text": "func (o *GenericObject) Set(key, val string) error {\n\to.fields[tu(key)] = val\n\treturn nil\n}", "title": "" }, { "docid": "b8308ae707073456c443f52a1daf3e45", "score": "0.51025623", "text": "func (p *Memory) Set(key, value string, ttl time.Duration) error {\n\texpire := time.Now().Add(ttl)\n\tif ttl == 0 {\n\t\texpire = zeroTime\n\t}\n\tp.Lock()\n\tp.kvs[key] = &node{\n\t\tk: key,\n\t\tv: value,\n\t\texpire: expire,\n\t}\n\tp.Unlock()\n\tp.event <- &backend.WatchEvent{\n\t\tType: backend.Put,\n\t\tKVPair: backend.KVPair{\n\t\t\tKey: key,\n\t\t\tValue: value,\n\t\t},\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b1c7b432e4a1057996a0c519fad931c7", "score": "0.51021177", "text": "func (n *mapHashArrayNode) set(key, value interface{}, shift uint, keyHash uint32, h Hasher, mutable bool, resized *bool) mapNode {\n\tidx := (keyHash >> shift) & mapNodeMask\n\tnode := n.nodes[idx]\n\n\t// If node at index doesn't exist, create a simple value leaf node.\n\t// Otherwise delegate set to child node.\n\tvar newNode mapNode\n\tif node == nil {\n\t\t*resized = true\n\t\tnewNode = newMapValueNode(keyHash, key, value)\n\t} else {\n\t\tnewNode = node.set(key, value, shift+mapNodeBits, keyHash, h, mutable, resized)\n\t}\n\n\t// Generate copy, if necessary.\n\tother := n\n\tif !mutable {\n\t\tother = n.clone()\n\t}\n\n\t// Update child node (and update size, if new).\n\tif node == nil {\n\t\tother.count++\n\t}\n\tother.nodes[idx] = newNode\n\treturn other\n}", "title": "" }, { "docid": "9c708ed9bcb4e50286f225428f5e7407", "score": "0.5091754", "text": "func (b *bucket) set(k string, v interface{}, d time.Duration) {\n\tvar expiration int64\n\tif d > 0 {\n\t\texpiration = time.Now().Add(d).UnixNano()\n\t}\n\tb.Lock()\n\tb.elements[k] = element{v, expiration}\n\tb.Unlock()\n}", "title": "" }, { "docid": "5eb9c61ffcfd73fa363d70d05cc5ff9e", "score": "0.5090921", "text": "func (p *List_node) SetValue(v interface{}) error {\n //----------------------//\n // List_node::SetValue //\n //----------------------//\n /*------------------------------------------------------------------------------\n Apparently Go-language does a copy-on-assign here, or something like that.\n So you end up with two distinct unlinked objects, your original value\n and the value which you copy into the \"value\" field.\n ------------------------------------------------------------------------------*/\n if p == nil {\n return elist.New(\"List_node::SetValue: p == nil\")\n }\n p.value = v\n return nil\n}", "title": "" }, { "docid": "a25b12db3f0deed5e70f29fed57e4e30", "score": "0.5072964", "text": "func (ptr Pointer) Set(root *interface{}, value interface{}) (err error) {\n\ttokens := ptr.Split()\n\tnewRoot, err := setValueInternal(*root, tokens, value)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*root = newRoot\n\treturn nil\n}", "title": "" }, { "docid": "c21b53420c306ff1f3bb7b7478a4cef4", "score": "0.5067343", "text": "func (r *Resource) SetPath(branch []string, val interface{}) {\n\tif len(branch) == 0 {\n\t\tr.data = val\n\t\treturn\n\t}\n\n\t// in order to insert our branch, we need map[string]interface{}\n\tif _, ok := (r.data).(map[string]interface{}); !ok {\n\t\t// have to replace with something suitable\n\t\tr.data = make(map[string]interface{})\n\t}\n\tcurr := r.data.(map[string]interface{})\n\n\tfor i := 0; i < len(branch)-1; i++ {\n\t\tb := branch[i]\n\t\t// key exists?\n\t\tif _, ok := curr[b]; !ok {\n\t\t\tn := make(map[string]interface{})\n\t\t\tcurr[b] = n\n\t\t\tcurr = n\n\t\t\tcontinue\n\t\t}\n\n\t\t// make sure the value is the right sort of thing\n\t\tif _, ok := curr[b].(map[string]interface{}); !ok {\n\t\t\t// have to replace with something suitable\n\t\t\tn := make(map[string]interface{})\n\t\t\tcurr[b] = n\n\t\t}\n\n\t\tcurr = curr[b].(map[string]interface{})\n\t}\n\n\t// add remaining k/v\n\tcurr[branch[len(branch)-1]] = val\n}", "title": "" }, { "docid": "2d094ab905e0fdf9641a5994bb048865", "score": "0.5058928", "text": "func (rm *RedisMap) Set(key string, object interface{}) error {\n\tstr, err := rm.serializer(object)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn rm.client.HSet(rm.hash, key, str)\n}", "title": "" }, { "docid": "d9cdfceba2036fb7e071ae2f9994d17a", "score": "0.5058179", "text": "func (it *chainIter[K, V, H]) set(meta metaData, key K, val V) {\n\tit.b.meta[it.ib] = meta\n\tit.b.key[it.ib] = key\n\tit.b.val[it.ib] = val\n}", "title": "" }, { "docid": "52f047f8d78347cbbf08085993f1a2e3", "score": "0.5056937", "text": "func (dq *LIFO) SetKey(id int64, k float64) {}", "title": "" }, { "docid": "4fc7cd1ac2dc2c448420d05114321c5e", "score": "0.5048505", "text": "func updateObject(stub shim.ChaincodeStubInterface, objectType string, keys []string, objectData []byte) error {\n\t// Check number of keys\n\terr := verifyAtLeastOneKeyIsPresent(keys)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Convert keys to compound key\n\tcompositeKey, _ := stub.CreateCompositeKey(objectType, keys)\n\n\t// Add Object JSON to state\n\terr = stub.PutState(compositeKey, objectData)\n\tif err != nil {\n\t\tlogger.Errorf(\"updateObject() : Error inserting Object into State Database %s\", err)\n\t\treturn err\n\t}\n\tlogger.Debugf(\"updateObject() : Successfully updated record of type %s\", objectType)\n\n\treturn nil\n}", "title": "" }, { "docid": "3d0dab9e9943499428c56bc64621f0ea", "score": "0.5046681", "text": "func wpksettag(ls *lua.LState) int {\n\tvar pack = CheckPack(ls, 1)\n\tvar key = wpk.Normalize(ls.CheckString(2))\n\tvar k = ls.Get(3)\n\tvar v = ls.Get(4)\n\n\tvar err error\n\tif func() {\n\t\tvar tid wpk.TID\n\t\tif tid, err = ValueToAid(k); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif tid < wpk.TIDsys {\n\t\t\terr = &ErrProtected{key, tid}\n\t\t\treturn\n\t\t}\n\n\t\tvar tag wpk.Tag\n\t\tif tag, err = ValueToTag(v); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tvar tags, ok = pack.Tags[key]\n\t\tif !ok {\n\t\t\terr = &fs.PathError{Op: \"settag\", Path: key, Err: fs.ErrNotExist}\n\t\t\treturn\n\t\t}\n\t\ttags[tid] = tag\n\t}(); err != nil {\n\t\tls.RaiseError(err.Error())\n\t\treturn 0\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "6e5070bf9482c3326042431b7821d047", "score": "0.50189334", "text": "func (ds *Store) PutObjectAtomic(kvObject KVObject) error {\n\tvar (\n\t\tprevious *store.KVPair\n\t\tpair *store.KVPair\n\t\terr error\n\t)\n\tds.mu.Lock()\n\tdefer ds.mu.Unlock()\n\n\tif kvObject == nil {\n\t\treturn types.InvalidParameterErrorf(\"invalid KV Object : nil\")\n\t}\n\n\tkvObjValue := kvObject.Value()\n\n\tif kvObjValue == nil {\n\t\treturn types.InvalidParameterErrorf(\"invalid KV Object with a nil Value for key %s\", Key(kvObject.Key()...))\n\t}\n\n\tif kvObject.Skip() {\n\t\tgoto add_cache\n\t}\n\n\tif kvObject.Exists() {\n\t\tprevious = &store.KVPair{Key: Key(kvObject.Key()...), LastIndex: kvObject.Index()}\n\t} else {\n\t\tprevious = nil\n\t}\n\n\tpair, err = ds.store.AtomicPut(Key(kvObject.Key()...), kvObjValue, previous)\n\tif err != nil {\n\t\tif err == store.ErrKeyExists {\n\t\t\treturn ErrKeyModified\n\t\t}\n\t\treturn err\n\t}\n\n\tkvObject.SetIndex(pair.LastIndex)\n\nadd_cache:\n\tif ds.cache != nil {\n\t\t// If persistent store is skipped, sequencing needs to\n\t\t// happen in cache.\n\t\treturn ds.cache.add(kvObject, kvObject.Skip())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0755b616666a433b965fd65aad6df10f", "score": "0.5016937", "text": "func (t *Tree[Key, Value]) Set(key Key, val Value) {\n\tt.root, _ = t.set(t.root, newNode(key, val), true)\n}", "title": "" }, { "docid": "205ffbe4e14f11b7780bc465fc40256c", "score": "0.50045013", "text": "func (rr *RedisKV) Set(conn redcon.Conn, cmd redcon.Command) {\n\tif len(cmd.Args) != 3 {\n\t\tconn.WriteError(\"ERR wrong number of arguments for '\" + string(cmd.Args[0]) + \"' command\")\n\t\treturn\n\t}\n\n\terr := rr.ns.Set(cmd.Args[1], cmd.Args[2])\n\tif err != nil {\n\t\tconn.WriteError(err.Error())\n\t\treturn\n\t}\n\tconn.WriteString(\"OK\")\n}", "title": "" }, { "docid": "7a7c2cd907aa326ee43ebde2c0b0288a", "score": "0.5004489", "text": "func (r *ConnectionValues) Set(key string, value interface{}) {\n\targs := *r\n\tn := len(args)\n\tfor i := 0; i < n; i++ {\n\t\tkv := &args[i]\n\t\tif string(kv.key) == key {\n\t\t\tkv.value = value\n\t\t\treturn\n\t\t}\n\t}\n\n\tc := cap(args)\n\tif c > n {\n\t\targs = args[:n+1]\n\t\tkv := &args[n]\n\t\tkv.key = append(kv.key[:0], key...)\n\t\tkv.value = value\n\t\t*r = args\n\t\treturn\n\t}\n\n\tkv := connectionValue{}\n\tkv.key = append(kv.key[:0], key...)\n\tkv.value = value\n\t*r = append(args, kv)\n}", "title": "" }, { "docid": "f57ecc5e6cdd61e96a4bd9637070d84c", "score": "0.5002035", "text": "func (v Values) Set(key, value string)", "title": "" }, { "docid": "f57ecc5e6cdd61e96a4bd9637070d84c", "score": "0.5002035", "text": "func (v Values) Set(key, value string)", "title": "" }, { "docid": "440c8fd2702e31b7f067d3dae7e52ca2", "score": "0.49868152", "text": "func (n *Node) Set(val interface{}) bool {\n\tswitch val.(type) {\n\tcase float32, float64, int, int8, int16, int32, int64,\n\t\tuint, uint8, uint16, uint32, uint64, uintptr:\n\n\t\tn.Type = Num\n\tcase bool:\n\t\tn.Type = Bool\n\tcase string:\n\t\tn.Type = Str\n\tdefault:\n\t\treturn false\n\t}\n\tn.Value = val\n\tn.Content = fmt.Sprint(val)\n\tn.Kids = []*Node{} // not a list, so drop kids\n\treturn true\n}", "title": "" }, { "docid": "fcf32564032cfbb627a6e11c88003ae0", "score": "0.49843147", "text": "func (cache *TreeCache) setEntry(key string, val *skymsg.Service, fqdn string, path ...string) {\n\t// TODO: Consolidate setEntry and setSubCache into a single method with a\n\t// type switch.\n\t// TODO: Insted of passing the fqdn as an argument, we can reconstruct\n\t// it from the path, provided callers always pass the full path to the\n\t// object. This is currently *not* the case, since callers first create\n\t// a new, empty node, populate it, then parent it under the right path.\n\t// So we don't know the full key till the final parenting operation.\n\tnode := cache.ensureChildNode(path...)\n\n\t// This key is used to construct the \"target\" for SRV record lookups.\n\t// For normal service/endpoint lookups, this will result in a key like:\n\t// /skydns/local/cluster/svc/svcNS/svcName/record-hash\n\t// but for headless services that govern pods requesting a specific\n\t// hostname (as used by petset), this will end up being:\n\t// /skydns/local/cluster/svc/svcNS/svcName/pod-hostname\n\tval.Key = skymsg.Path(fqdn)\n\tnode.Entries[key] = val\n}", "title": "" }, { "docid": "fde93593abe14da42c40953b26de09c9", "score": "0.49823764", "text": "func addElementToMap(parameter *map[string]interface{}, key string, value interface{}) {\n\t(*parameter)[key] = map[string]interface{}{\n\t\t\"value\": value,\n\t}\n}", "title": "" }, { "docid": "e3730ba578f2e1ea550e5acafe1da430", "score": "0.498217", "text": "func (c *Client) setFinalValue(currentType ast.Type, index int, obj ast.Object, arr ast.Array) {\n\tif currentType == ast.ObjectType {\n\t\tr := c.parsedQuery[index].key\n\t\tfor _, v := range obj.Children {\n\t\t\tif r == v.Key.Value {\n\t\t\t\tc.setResultFromValue(v.Value)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\tind := c.parsedQuery[index].index\n\tc.setResultFromValue(arr.Children[ind])\n}", "title": "" }, { "docid": "d22bbdbfb204b030b827b809898f3255", "score": "0.4982084", "text": "func (rnode *radixNode) setChild(key uint64, child radixTrieNode) {\n\tslot := radixSlot(key, rnode.level)\n\trnode.children[slot] = child\n}", "title": "" }, { "docid": "91db86f6c75bbe80b24032bdb06bc274", "score": "0.496994", "text": "func Set(data []byte, setValue []byte, keys ...string) (value []byte, err error) {\n\t// ensure keys are set\n\tif len(keys) == 0 {\n\t\treturn nil, KeyPathNotFoundError\n\t}\n\n\t_, _, startOffset, endOffset, err := internalGet(data, keys...)\n\tif err != nil {\n\t\tif err != KeyPathNotFoundError {\n\t\t\t// problem parsing the data\n\t\t\treturn nil, err\n\t\t}\n\t\t// full path doesnt exist\n\t\t// does any subpath exist?\n\t\tvar depth int\n\t\tfor i := range keys {\n\t\t\t_, _, start, end, sErr := internalGet(data, keys[:i+1]...)\n\t\t\tif sErr != nil {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tendOffset = end\n\t\t\t\tstartOffset = start\n\t\t\t\tdepth++\n\t\t\t}\n\t\t}\n\t\tcomma := true\n\t\tobject := false\n\t\tif endOffset == -1 {\n\t\t\tfirstToken := nextToken(data)\n\t\t\t// We can't set a top-level key if data isn't an object\n\t\t\tif firstToken < 0 || data[firstToken] != '{' {\n\t\t\t\treturn nil, KeyPathNotFoundError\n\t\t\t}\n\t\t\t// Don't need a comma if the input is an empty object\n\t\t\tsecondToken := firstToken + 1 + nextToken(data[firstToken+1:])\n\t\t\tif data[secondToken] == '}' {\n\t\t\t\tcomma = false\n\t\t\t}\n\t\t\t// Set the top level key at the end (accounting for any trailing whitespace)\n\t\t\t// This assumes last token is valid like '}', could check and return error\n\t\t\tendOffset = lastToken(data)\n\t\t}\n\t\tdepthOffset := endOffset\n\t\tif depth != 0 {\n\t\t\t// if subpath is a non-empty object, add to it\n\t\t\t// or if subpath is a non-empty array, add to it\n\t\t\tif (data[startOffset] == '{' && data[startOffset+1+nextToken(data[startOffset+1:])] != '}') ||\n\t\t\t\t(data[startOffset] == '[' && data[startOffset+1+nextToken(data[startOffset+1:])] == '{') && keys[depth:][0][0] == 91 {\n\t\t\t\tdepthOffset--\n\t\t\t\tstartOffset = depthOffset\n\t\t\t\t// otherwise, over-write it with a new object\n\t\t\t} else {\n\t\t\t\tcomma = false\n\t\t\t\tobject = true\n\t\t\t}\n\t\t} else {\n\t\t\tstartOffset = depthOffset\n\t\t}\n\t\tvalue = append(data[:startOffset], append(createInsertComponent(keys[depth:], setValue, comma, object), data[depthOffset:]...)...)\n\t} else {\n\t\t// path currently exists\n\t\tstartComponent := data[:startOffset]\n\t\tendComponent := data[endOffset:]\n\n\t\tvalue = make([]byte, len(startComponent)+len(endComponent)+len(setValue))\n\t\tnewEndOffset := startOffset + len(setValue)\n\t\tcopy(value[0:startOffset], startComponent)\n\t\tcopy(value[startOffset:newEndOffset], setValue)\n\t\tcopy(value[newEndOffset:], endComponent)\n\t}\n\treturn value, nil\n}", "title": "" }, { "docid": "81166501ccbbb435c03bf841f959a522", "score": "0.49691096", "text": "func (c *Cache) set(key string, i Item) {\n\tn := &Node{\n\t\tkey: key,\n\t\titem: i,\n\t}\n\tif c.IsEmpty() {\n\t\tc.first = n\n\t\tc.last = n\n\t\tc.hash[key] = n\n\t\tc.n++\n\t\treturn\n\t}\n\tif c.IsFull() {\n\t\tc.Remove()\n\t}\n\tc.attach(n)\n\tc.hash[key] = n\n\tc.n++\n}", "title": "" }, { "docid": "34a38bb9299d2d41b3f48ab4c7fe3d3b", "score": "0.49611795", "text": "func (tm *TagList) Set(k, v string) {\n\tif _, exists := tm.m[k]; !exists {\n\t\ttm.keyOrder = append(tm.keyOrder, k)\n\t}\n\ttm.m[k] = v\n}", "title": "" }, { "docid": "1d7fa5f0f8ddb70e06fed227eaa5a586", "score": "0.4954359", "text": "func (m *TransactionManager) set(ctx context.Context, key, value []byte) error {\n\tm.txupdates[string(key)] = keyval{k: key, v: value}\n\treturn nil\n}", "title": "" }, { "docid": "d0b4cebcd786770ede3160a2e5db42c6", "score": "0.4949156", "text": "func (n *mapHashArrayNode[K, V]) set(key K, value V, shift uint, keyHash uint32, h Hasher[K], mutable bool, resized *bool) mapNode[K, V] {\n\tidx := (keyHash >> shift) & mapNodeMask\n\tnode := n.nodes[idx]\n\n\t// If node at index doesn't exist, create a simple value leaf node.\n\t// Otherwise delegate set to child node.\n\tvar newNode mapNode[K, V]\n\tif node == nil {\n\t\t*resized = true\n\t\tnewNode = newMapValueNode(keyHash, key, value)\n\t} else {\n\t\tnewNode = node.set(key, value, shift+mapNodeBits, keyHash, h, mutable, resized)\n\t}\n\n\t// Generate copy, if necessary.\n\tother := n\n\tif !mutable {\n\t\tother = n.clone()\n\t}\n\n\t// Update child node (and update size, if new).\n\tif node == nil {\n\t\tother.count++\n\t}\n\tother.nodes[idx] = newNode\n\treturn other\n}", "title": "" }, { "docid": "ef786dd1ac786d9eb4208254676a4a41", "score": "0.4945867", "text": "func (m *ListMap) Set(key interface{}, value interface{}) {\n\tm.mu.Lock()\n\tif e, ok := m.data[key]; !ok {\n\t\tm.data[key] = m.list.PushBack(&gListMapNode{key, value})\n\t} else {\n\t\te.Value = &gListMapNode{key, value}\n\t}\n\tm.mu.Unlock()\n}", "title": "" }, { "docid": "30122ff328f64bb845d0025a24572aef", "score": "0.4945379", "text": "func setTomlTreeKeyVal(tree *toml.Tree, key string, val interface{}) error {\n\t// before setting the value, we need to check if the type of this key is an integer\n\t// because if the key is an integer value, when we are provided the interface{}, the\n\t// value we go to assign might actually be a float, because when we parse the values\n\t// from snapd, all numbers are interpreted as floats, so we have to convert the float\n\t// inside the interface{} to an int before assigning\n\n\t// get an instance of the key in the tree so we can check what type it is\n\t// destVal := tree.Get(key)\n\t// if destVal == nil {\n\t// \treturn fmt.Errorf(\"key %s not found\", key)\n\t// }\n\t// destType := reflect.TypeOf(val).Kind()\n\tsrcType := reflect.TypeOf(val).Kind()\n\n\t// first check if the destination type is a number type\n\n\tif srcType == reflect.Float32 || srcType == reflect.Float64 {\n\t\t// the source value is a float, check if the destination type is a\n\t\t// integer, in which case we should attempt to cast it before assigning\n\t\t// if any of these panic, that's fine because then the user provided an invalid value\n\t\t// for this field\n\t\tdstType := reflect.TypeOf(tree.Get(key)).Kind()\n\t\tfloatVal := reflect.ValueOf(val).Float()\n\t\tswitch dstType {\n\t\tcase reflect.Int:\n\t\t\ttree.Set(key, int(floatVal))\n\t\tcase reflect.Int8:\n\t\t\ttree.Set(key, int8(floatVal))\n\t\tcase reflect.Int16:\n\t\t\ttree.Set(key, int16(floatVal))\n\t\tcase reflect.Int32:\n\t\t\ttree.Set(key, int32(floatVal))\n\t\tcase reflect.Int64:\n\t\t\ttree.Set(key, int64(floatVal))\n\t\tcase reflect.Uint:\n\t\t\ttree.Set(key, uint(floatVal))\n\t\tcase reflect.Uint8:\n\t\t\ttree.Set(key, uint8(floatVal))\n\t\tcase reflect.Uint16:\n\t\t\ttree.Set(key, uint16(floatVal))\n\t\tcase reflect.Uint32:\n\t\t\ttree.Set(key, uint32(floatVal))\n\t\tcase reflect.Uint64:\n\t\t\ttree.Set(key, uint64(floatVal))\n\t\tdefault:\n\t\t\t// not an integer type, so just assign as is\n\t\t\ttree.Set(key, val)\n\t\t}\n\t} else {\n\t\ttree.Set(key, val)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a41e4f05be7c2f1aa206bf2f85d4fcfe", "score": "0.49377477", "text": "func (a *attrs) Set(key, val string) {\n\t(*a)[key] = val\n}", "title": "" }, { "docid": "5ba01a804f87e35f778cc240f6b633a3", "score": "0.4922683", "text": "func (table HashTable) SetItem(key int, value interface{}) {\n\thash := table.hash(key)\n\tbucket := table[hash]\n\n\t// First, delete any existing item in the hash bucket.\n\tfor el := bucket.Front(); el != nil; el = el.Next() {\n\t\tnode := el.Value.(HashTableNode)\n\t\tif node.key == key {\n\t\t\tbucket.Remove(el)\n\t\t\tbreak\n\t\t}\n\t}\n\n\tnewNode := HashTableNode{key: key, value: value}\n\ttable[hash].PushFront(newNode)\n}", "title": "" }, { "docid": "5777b8faeade412c638546c75aaf11d8", "score": "0.49192053", "text": "func (p *Parser) Set(k PropertyType, v interface{}) error {\n\treturn p.p.Set(k, v)\n}", "title": "" }, { "docid": "1d9067747ad02f9dcf490bc641edceb2", "score": "0.49181145", "text": "func (p *Parser) Set(newVal []byte, path ...string) error {\n\tlenp := len(path)\n\tlenv := len(newVal)\n\tvar curr *node\n\tvar err error\n\tif lenp == 0 {\n\t\treturn ErrNullPath()\n\t}\n\tif lenv == 0 {\n\t\treturn ErrNullNewValue()\n\t}\n\tcurr, err = p.core.walk(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif lenv >= 2 {\n\t\tif newVal[0] == 91 || newVal[0] == 123 {\n\t\t\tnewCore := createNode(nil)\n\t\t\tpCore(newVal, newCore)\n\t\t\tnewCore.label = curr.label\n\t\t\tnewCore.up = curr.up\n\t\t\tindex := curr.getIndex()\n\t\t\tcurr.up.down[index] = newCore\n\t\t\tnewCore.value = newVal\n\t\t\tp.json, _ = Set(p.json, newVal, path...)\n\t\t\tfor i := 0; i < lenp-1; i++ {\n\t\t\t\tnewCore = newCore.up\n\t\t\t\tnewCore.value, err = Get(p.json, path[:lenp-1-i]...)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n\tcurr.value = newVal\n\tp.json, _ = Set(p.json, newVal, path...)\n\tfor i := 0; i < lenp-1; i++ {\n\t\tcurr = curr.up\n\t\tcurr.value, err = Get(p.json, path[:lenp-1-i]...)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "442d612f0ac027bf8cdf807f2d37e3da", "score": "0.49135038", "text": "func (r *RedisObject) Set(key, value string) error {\n\tconn := r.pool.Get()\n\tdefer conn.Close()\n\n\t_, err := conn.Do(\"SET\", key, value)\n\n\treturn err\n}", "title": "" }, { "docid": "80fca2079ebcefa1018fbf7eb89dcb50", "score": "0.49085653", "text": "func (c *Consul) Set(ctx context.Context, req *state.SetRequest) error {\n\tvar reqValByte []byte\n\tb, ok := req.Value.([]byte)\n\tif ok {\n\t\treqValByte = b\n\t} else {\n\t\treqValByte, _ = json.Marshal(req.Value)\n\t}\n\n\tkeyWithPath := c.keyPrefixPath + \"/\" + req.Key\n\n\twriteOptions := new(api.WriteOptions)\n\twriteOptions = writeOptions.WithContext(ctx)\n\t_, err := c.client.KV().Put(&api.KVPair{\n\t\tKey: keyWithPath,\n\t\tValue: reqValByte,\n\t}, writeOptions)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't set key %s: %s\", keyWithPath, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "77747ef49e403e11ad24b348e67cdc6c", "score": "0.4903729", "text": "func (t *Tree) Set(key []byte, value interface{}) {\n\tn := &t.root\n\tif len(key) == 0 {\n\t\tn.value = value\n\t\treturn\n\t}\n\tprefix := key\n\tfor len(prefix) > 0 {\n\t\ti := n.indexForPrefix(prefix)\n\t\tif i == len(n.children) {\n\t\t\tn.children = append(n.children, newNode(prefix, value, nil))\n\t\t\treturn\n\t\t}\n\t\tchild := n.children[i]\n\t\tchildLabel := child.label\n\t\tl := commonPrefixLength(prefix, childLabel)\n\t\tif l == 0 {\n\t\t\t// Insert new node at i'th children\n\t\t\tn.children = append(n.children, nil)\n\t\t\tcopy(n.children[i+1:], n.children[i:])\n\t\t\tn.children[i] = newNode(prefix, value, nil)\n\t\t\treturn\n\t\t}\n\t\tif l < len(prefix) {\n\t\t\tif l < len(childLabel) {\n\t\t\t\tmyRestLabel := prefix[l:]\n\t\t\t\tchild.label = childLabel[l:]\n\t\t\t\tvar children []*node\n\t\t\t\tif bytes.Compare(myRestLabel, child.label) < 0 {\n\t\t\t\t\tchildren = []*node{newNode(myRestLabel, value, nil), child}\n\t\t\t\t} else {\n\t\t\t\t\tchildren = []*node{child, newNode(myRestLabel, value, nil)}\n\t\t\t\t}\n\t\t\t\tn.children[i] = newNode(prefix[:l], noValue, children)\n\t\t\t\treturn\n\t\t\t}\n\t\t} else { // l == len(prefix)\n\t\t\tif l < len(childLabel) {\n\t\t\t\tchild.label = childLabel[l:]\n\t\t\t\tn.children[i] = newNode(prefix, value, []*node{child})\n\t\t\t} else { // l == len(childLabel)\n\t\t\t\tn.children[i].value = value\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tprefix = prefix[len(childLabel):]\n\t\tn = child\n\t}\n}", "title": "" }, { "docid": "5dc828904c447509b4de80c1237f0e55", "score": "0.49031997", "text": "func (metadata *ObjectMetadata) Set(k, v string) error {\n\tkey := strings.ToLower(k)\n\t_, ok := predefinedMetadata[key]\n\tif ok || strings.HasPrefix(key, XiaomiMetaPrefix) {\n\t\tmetadata.metadata[key] = v\n\t\treturn nil\n\t} else {\n\t\treturn errors.New(\"Invalid metadata: \" + k)\n\t}\n}", "title": "" }, { "docid": "f068d921127d98f5ad699c8cf657d953", "score": "0.49003196", "text": "func (c *client) Set(key, value interface{}) { c.data.Store(key, value) }", "title": "" }, { "docid": "fc98da698be70f3bb60777de57dc5b64", "score": "0.49002334", "text": "func (tag *FastTag) Set(key string, value interface{}) {\n\ttag.Key = key\n\ttag.StringValue = TagValueToString(value)\n\tif intV, ok := toInt64(value); ok {\n\t\ttag.intValue = intV\n\t\ttag.intValueIsSet = true\n\t}\n}", "title": "" }, { "docid": "28a1d4bd15ca3c9fbe2ddbf9babf854a", "score": "0.48974344", "text": "func put(apiUrl, group, node, attribute string, value int) error {\n\turl := fmt.Sprintf(\"%s/node_group/%s/node/%s/attribute/%s\", apiUrl, group, node, attribute)\n\tv, err := json.Marshal(&valueUpdate{value})\n\tif err != nil {\n\t\treturn err\n\t}\n\treq, err := http.NewRequest(\"PUT\", url, bytes.NewBuffer(v))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tclient := &http.Client{}\n\tresponse, err := client.Do(req)\n\tif err == nil {\n\t\tdefer response.Body.Close()\n\t\tif response.StatusCode < 200 || response.StatusCode > 399 {\n\t\t\treturn valueUpdateError{code:response.StatusCode}\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "01b9bbe8ce480a48a9af94c400099b3b", "score": "0.48951232", "text": "func (b *backend) Set(name string, node *mesh.Node) error {\n\told, err := b.lister.Get(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to find node: %v\", err)\n\t}\n\tn := old.DeepCopy()\n\tn.ObjectMeta.Annotations[externalIPAnnotationKey] = node.ExternalIP.String()\n\tn.ObjectMeta.Annotations[internalIPAnnotationKey] = node.InternalIP.String()\n\tn.ObjectMeta.Annotations[keyAnnotationKey] = string(node.Key)\n\tn.ObjectMeta.Annotations[lastSeenAnnotationKey] = strconv.FormatInt(node.LastSeen, 10)\n\toldData, err := json.Marshal(old)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnewData, err := json.Marshal(n)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpatch, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, v1.Node{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create patch for node %q: %v\", n.Name, err)\n\t}\n\tif _, err = b.client.CoreV1().Nodes().Patch(name, types.StrategicMergePatchType, patch); err != nil {\n\t\treturn fmt.Errorf(\"failed to patch node: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7003a65487824ebf58d393fa9b655914", "score": "0.4894988", "text": "func setNestedStringMapKey(obj map[string]interface{}, key, value string, fields ...string) error {\n\tm, found, err := unstructured.NestedStringMap(obj, fields...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !found {\n\t\tm = make(map[string]string)\n\t}\n\n\tm[key] = value\n\n\treturn unstructured.SetNestedStringMap(obj, m, fields...)\n}", "title": "" }, { "docid": "acd835308f77dbf453496dcf30b7bf33", "score": "0.4892738", "text": "func (m *TransactionManager) set(ctx context.Context, key, value []byte) error {\n\tinslogger.FromContext(ctx).Debugf(\"set key %v\", bytes2hex(key))\n\n\tm.txupdates[string(key)] = keyval{k: key, v: value}\n\treturn nil\n}", "title": "" }, { "docid": "09f2535a0eed5ca357f81e2e6ed110bb", "score": "0.4876309", "text": "func setAtFieldPath(m map[string]interface{}, fp []string, val interface{}) error {\n\tm2, err := getParentMap(m, fp, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tm2[fp[len(fp)-1]] = val\n\treturn nil\n}", "title": "" }, { "docid": "89a9ab4afd741e9b65eea9816c68603a", "score": "0.48744717", "text": "func (p *Doc) Set(key, value string) {\n\tif e, ok := p.props[key]; ok {\n\t\te.Value.(*line).value = value\n\t} else {\n\t\tp.props[key] = p.lines.PushBack(&line{typo: '=', key: key, value: value})\n\t}\n}", "title": "" }, { "docid": "ca577104f671c09ca767eb3e62a91096", "score": "0.48741487", "text": "func (t *transaction) Set(k kv.Key, v []byte) error {\n\tt.kvPairs = append(t.kvPairs, kvec.KvPair{\n\t\tKey: k.Clone(),\n\t\tVal: append([]byte{}, v...),\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "97793973ea579c5ce014a2420b3ea526", "score": "0.48512667", "text": "func Set(key string, root ygot.GoStruct, stfn schemaTreeFunc, ufn unmarshalFunc) error {\n\tmu.Lock()\n\tdefer mu.Unlock()\n\tif _, ok := goStructs[key]; ok {\n\t\treturn fmt.Errorf(\"another schema is registered with the key %v\", key)\n\t}\n\tgoStructs[key] = goStruct{\n\t\troot: root,\n\t\tschemaTreeFn: stfn,\n\t\tunmarshal: ufn,\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d4d65f1afa42086b86ac8499c9de6aef", "score": "0.48491886", "text": "func (f *File) setObject(o fs.Object) {\n\tf.mu.Lock()\n\tdefer f.mu.Unlock()\n\tf.o = o\n\tf.d.addObject(o, f)\n}", "title": "" }, { "docid": "62761a78e3599d6acb022ffe580b0d12", "score": "0.48472884", "text": "func (s *BaseASNListener) EnterObjectSetFieldSpec(ctx *asn.ObjectSetFieldSpecContext) {}", "title": "" }, { "docid": "7f0701366c394ee0c80f9db305e93928", "score": "0.48388425", "text": "func (t *Octree) Set(entity interface{}, x, y, z float64) error {\n\t// Figure out where to put the entity\n\t// We do this before locking the whole thing so writing can still be reasonably parallel\n\tleaf := t.getOrCreateLeaf(x, y, z)\n\n\t// (Re)add the entity, we do this while having the leafMapLock locked\n\t// this way we can prevent a potential deadlock situation where two Set calls\n\t// have eachother's leaf locked\n\tt.leafMapLock.Lock()\n\tdefer t.leafMapLock.Unlock()\n\n\tif err := t.remove(entity); err != nil && err != ErrNotFound {\n\t\treturn err\n\t}\n\n\tleaf.lock.Lock()\n\tdefer leaf.lock.Unlock()\n\tleaf.children[entity] = [3]float64{x, y, z}\n\tt.leafMap[entity] = leaf\n\n\treturn nil\n}", "title": "" }, { "docid": "77c405e6b2b70466729c89213c353815", "score": "0.48350903", "text": "func (c *lruCache) set(k string, value interface{}) bool {\n\tc._bufNodePtr = c.m[k]\n\tif c._bufNodePtr == nil { // This means the k not in the map\n\t\tk = sbconv.DeepCopyString(k)\n\t\tif len(c.m) < c.maxSize-1 {\n\t\t\t// Cache is not full, insert a new node\n\t\t\t_node := &node{}\n\t\t\t_node.key = k\n\t\t\t_node.value = value\n\t\t\t_node.next = c.root\n\t\t\t_node.prev = c.root.prev\n\t\t\tc.m[k] = _node\n\n\t\t\tc.root.prev.next = _node\n\t\t\tc.root.prev = _node\n\t\t} else {\n\t\t\t// Cache is full, replace the oldest one with the new node,\n\t\t\t// in this case, we just replace the original root with the\n\t\t\t// new root, and make the original root.next become the new root.\n\t\t\tdelete(c.m, c.root.key)\n\t\t\tc.root.key = k\n\t\t\tc.root.value = value\n\t\t\tc.m[k] = c.root\n\t\t\tc.root = c.root.next\n\n\t\t\treturn true\n\t\t}\n\t} else {\n\t\t// Hits a key, we just update its value.\n\t\tc._bufNodePtr.value = value\n\t}\n\treturn false\n}", "title": "" }, { "docid": "70deb6f92abf093b8c076f007a6b4cee", "score": "0.48272875", "text": "func Set(key string, value interface{}) error {\n\tDelete(key)\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tstmt, err := tx.Prepare(fmt.Sprintf(\"INSERT INTO meta (key,value) VALUES (?,?)\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer stmt.Close()\n\n\tv, err := json.Marshal(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = stmt.Exec(key, string(v))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn tx.Commit()\n}", "title": "" }, { "docid": "f1a47ac9e2b963c774fd0e38da7b917c", "score": "0.48241952", "text": "func (dq *FIFO) SetKey(id int64, k float64) {}", "title": "" }, { "docid": "50269ccc25622f5154d47f7303be71bb", "score": "0.4816505", "text": "func (m Map) SetE(key string, input interface{}) (Map, error) {\n\tcurrentKey, rest := splitKey(key)\n\tvalue := NewValue(input)\n\n\t// If we have a dot notation we want to set the value deeper\n\tif key != currentKey {\n\t\tcurrentValue := m[currentKey]\n\t\tnestedValue, err := currentValue.SetE(joinRest(rest), value)\n\t\tif err != nil {\n\t\t\treturn m, err\n\t\t}\n\t\tm[currentKey] = nestedValue\n\t} else {\n\t\tm[currentKey] = NewValue(input)\n\t}\n\n\treturn m, nil\n}", "title": "" }, { "docid": "e46bc6fa048d7b56c0e78d1923f283cb", "score": "0.48162863", "text": "func (tikv *Tikv) Set(txn interface{}, key, value []byte) (err error) {\n\tvar (\n\t\ttikv_txn kv.Transaction\n\t\tok bool\n\t)\n\tif txn != nil {\n\t\ttikv_txn, ok = txn.(kv.Transaction)\n\t\tif !ok {\n\t\t\terr = qkverror.ErrorServerInternal\n\t\t\treturn\n\t\t}\n\t\terr = tikv_txn.Set(key, value)\n\t} else {\n\t\ttxn, err = tikv.NewTxn()\n\t\tif err != nil {\n\t\t\terr = qkverror.ErrorServerInternal\n\t\t\treturn\n\t\t}\n\t\ttikv_txn, ok = txn.(kv.Transaction)\n\t\tif !ok {\n\t\t\terr = qkverror.ErrorServerInternal\n\t\t\treturn\n\t\t}\n\t\tdefer tikv_txn.Rollback()\n\t\terr = tikv_txn.Set(key, value)\n\t\tif err == nil {\n\t\t\terr = tikv_txn.Commit(context.Background())\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "cc694b2df6864fc7add7039de36a9a36", "score": "0.48131034", "text": "func (e *Instance) SetChild(nth int, child opt.Expr) { panic(\"not implemented\") }", "title": "" }, { "docid": "862b271a1b913cb28080b534b4cb9640", "score": "0.48125115", "text": "func (n *Node) putKVLocal(key, value string) error {\n\tif n.getState() < Joined {\n\t\t// need to join dht first to stabilize and update predecessor\n\t\treturn fmt.Errorf(\"request failed, node not ready yet\")\n\t}\n\t// if n.CanStore(key) {\n\treturn n.storage.PutKV(key, value)\n\t// }\n\t// return fmt.Errorf(\"Put request failed, key %s does not belong to this group\", key)\n}", "title": "" }, { "docid": "b4f5f2d626233cbcdc2d3a4f95a1fb8e", "score": "0.48121333", "text": "func (c *Context) Set(key string, value interface{}) {\n if c.Keys == nil {\n c.Keys = make(map[string]interface{})\n }\n c.Keys[key] = value\n}", "title": "" }, { "docid": "2afa63734af2323e82cf57ff6583d821", "score": "0.4806897", "text": "func (m OptionsMap) SetObject(key string, value interface{}) (bool, error) {\n\tif s, isStr := value.(string); isStr {\n\t\treturn m.SetString(key, s)\n\t}\n\treturn false, core.ErrInvalidType\n}", "title": "" }, { "docid": "86221bc41ba1d6ee034d7234c32633ee", "score": "0.48054677", "text": "func (self *ArraySet) SetPositionA(member int) {\n self.Object.Set(\"position\", member)\n}", "title": "" }, { "docid": "0bfa9d8465147c1bb24158348570ee9a", "score": "0.47943032", "text": "func (r *Redis) SetBoletoJSON(b, mID, pk string, lg *log.Log) error {\n\terr := r.openConnection()\n\n\tif err != nil {\n\t\tlg.Warn(err, fmt.Sprintf(\"OpenConnection [SetBoletoJSON] - Could not connection to Redis Database \"))\n\t\treturn err\n\t}\n\n\tkey := fmt.Sprintf(\"%s:%s:%s\", \"JSON\", mID, pk)\n\tret, err := r.conn.Do(\"SET\", key, b)\n\tr.closeConnection()\n\n\tres := fmt.Sprintf(\"%s\", ret)\n\n\tif res != \"OK\" {\n\t\tlg.Warn(err, fmt.Sprintf(\"SetBoletoHTML [SetBoletoJSON] - Could not record HTML in Redis Database: %s\", err.Error()))\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c5ad0dca0bd2983af70c8dbbd73d4132", "score": "0.47892576", "text": "func (start *Node) Store(key Key, value string) {\n node := start.Find(key)\n node.data[key] = value\n}", "title": "" } ]
ce3e3add672449d7fcd955193c91cd65
GetMediaQueries Returns all media queries parsed by the rendering engine. Returns medias
[ { "docid": "52d26c178d1ba8ad6f32ae70691f1107", "score": "0.7673178", "text": "func (c *CSS) GetMediaQueries(ctx context.Context) ([]*CSSCSSMedia, error) {\n\tresp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: \"CSS.getMediaQueries\"})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar chromeData struct {\n\t\tResult struct {\n\t\t\tMedias []*CSSCSSMedia\n\t\t}\n\t}\n\n\tif resp == nil {\n\t\treturn nil, &gcdmessage.ChromeEmptyResponseErr{}\n\t}\n\n\t// test if error first\n\tcerr := &gcdmessage.ChromeErrorResponse{}\n\tjson.Unmarshal(resp.Data, cerr)\n\tif cerr != nil && cerr.Error != nil {\n\t\treturn nil, &gcdmessage.ChromeRequestErr{Resp: cerr}\n\t}\n\n\tif err := json.Unmarshal(resp.Data, &chromeData); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn chromeData.Result.Medias, nil\n}", "title": "" } ]
[ { "docid": "0b8bb41a0c6b76e5109fd64b6fb20df1", "score": "0.7665802", "text": "func (d *Client) GetMediaQueries() *GetMediaQueriesRequest {\n\treturn &GetMediaQueriesRequest{opts: make(map[string]interface{}), client: d.Client}\n}", "title": "" }, { "docid": "9a3da6ea18fbf469c89b27fc1adb2f57", "score": "0.765296", "text": "func GetMediaQueries() *GetMediaQueriesParams {\n\treturn &GetMediaQueriesParams{}\n}", "title": "" }, { "docid": "df456453e89e283342b0a12926b639a6", "score": "0.74301505", "text": "func (c *ChromeCSS) GetMediaQueries() ([]*types.ChromeCSSCSSMedia, error) {\n\trecvCh, _ := sendCustomReturn(c.target.sendCh, &ParamRequest{Id: c.target.getId(), Method: \"CSS.getMediaQueries\"})\n\tresp := <-recvCh\n\n\tvar chromeData struct {\n\t\tResult struct { \n\t\t\tMedias []*types.ChromeCSSCSSMedia \n\t\t}\n\t}\n\t\t\n\terr := json.Unmarshal(resp.Data, &chromeData)\n\tif err != nil {\n\t\tcerr := &ChromeErrorResponse{}\n\t\tchromeError := json.Unmarshal(resp.Data, cerr)\n\t\tif chromeError == nil {\n\t\t\treturn nil, &ChromeRequestErr{Resp: cerr}\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn chromeData.Result.Medias, nil\n}", "title": "" }, { "docid": "03c2f040bf13bc6297fb406974e0b130", "score": "0.57248515", "text": "func (p *GetMediaQueriesParams) Do(ctx context.Context) (medias []*Media, err error) {\n\t// execute\n\tvar res GetMediaQueriesReturns\n\terr = cdp.Execute(ctx, CommandGetMediaQueries, nil, &res)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res.Medias, nil\n}", "title": "" }, { "docid": "1b2f670e60ddd1d4fc750c5b8e8e1939", "score": "0.5431182", "text": "func (s *Storage) GetQueries() []model.Query {\n\tqueries := make([]model.Query, 0, 0)\n\terr := s.db.Find(&queries).Error\n\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"could not get queries\")\n\t\treturn queries\n\t}\n\n\treturn queries\n}", "title": "" }, { "docid": "5de9adaa3b445fd81d0e678af7e82853", "score": "0.5341004", "text": "func (_this *CSSMediaRule) Media() *cssom.MediaList {\n\tvar ret *cssom.MediaList\n\tvalue := _this.Value_JS.Get(\"media\")\n\tret = cssom.MediaListFromJS(value)\n\treturn ret\n}", "title": "" }, { "docid": "765916445cccfa4a4a7b4a149ab3b842", "score": "0.52691066", "text": "func GetMediaList() *MediaList {\n\treturn mediaListPool.Get().(*MediaList)\n}", "title": "" }, { "docid": "59189ad28fafe02b469879b7ce8827ab", "score": "0.4988871", "text": "func GetMediaDatabasePublications(c context.Context, r *http.Request) (interface{}, interface{}, int, int, error) {\n\tqueryField := gcontext.Get(r, \"q\").(string)\n\tif queryField != \"\" {\n\t\tpublications, total, err := search.SearchPublicationInESMediaDatabase(c, r, queryField)\n\t\tif err != nil {\n\t\t\treturn []pitchModels.Publication{}, nil, 0, 0, err\n\t\t}\n\t\treturn publications, nil, len(publications), total, nil\n\t}\n\n\tcontacts, hits, total, err := search.SearchESMediaDatabasePublications(c, r)\n\tif err != nil {\n\t\tlog.Errorf(c, \"%v\", err)\n\t\treturn contacts, nil, 0, 0, err\n\t}\n\n\treturn contacts, nil, hits, total, nil\n}", "title": "" }, { "docid": "b1e6f676757d42d2aff846f5eae0b1c0", "score": "0.48761806", "text": "func (o *MediaObject) GetDims() []int32 {\n\tif o == nil {\n\t\tvar ret []int32\n\t\treturn ret\n\t}\n\n\treturn o.Dims\n}", "title": "" }, { "docid": "de849ead922c5ea0fe630041825965a0", "score": "0.48574147", "text": "func (o DynamicGroupMetadataOutput) Queries() DynamicGroupQueryArrayOutput {\n\treturn o.ApplyT(func(v DynamicGroupMetadata) []DynamicGroupQuery { return v.Queries }).(DynamicGroupQueryArrayOutput)\n}", "title": "" }, { "docid": "1c9a99e96f67394931cf4fbbf49a9ea7", "score": "0.48543277", "text": "func (s *Storage) Medias(userID int64) (model.Medias, error) {\n\tdefer timer.ExecutionTime(time.Now(), fmt.Sprintf(\"[Storage:Medias] userID=%d\", userID))\n\tquery := `\n\t\tSELECT\n\t\tm.id, m.url_hash, m.mime_type, m.content\n\t\tFROM medias m\n\t\tLEFT JOIN entry_medias em ON em.media_id=medias.id\n\t\tLEFT JOIN entries e ON e.id=em.entry_id\n\t\tWHERE m.cached='t' AND e.user_id=$1\n\t`\n\n\trows, err := s.db.Query(query, userID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to fetch medias: %v\", err)\n\t}\n\tdefer rows.Close()\n\n\tvar medias model.Medias\n\tfor rows.Next() {\n\t\tvar media model.Media\n\t\terr := rows.Scan(&media.ID, &media.URLHash, &media.MimeType, &media.Content)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to fetch medias row: %v\", err)\n\t\t}\n\t\tmedias = append(medias, &media)\n\t}\n\n\treturn medias, nil\n}", "title": "" }, { "docid": "119c49cf103bb171551e8a04f02eb324", "score": "0.4777188", "text": "func (ds *Datastore) GetQueries() *db.Queries {\n\treturn db.New(ds.DB)\n}", "title": "" }, { "docid": "ac4938ecd2ce4bb3f6eb5c4bf0cfad51", "score": "0.47676525", "text": "func (m *Marshaler) MediaTypesFor(rt reflect.Type) []string {\n\treturn m.types[rt].mediaTypes\n}", "title": "" }, { "docid": "0ea991455094949699541fb91da48d5d", "score": "0.47472313", "text": "func DBMediaGetAll(payload *models.MediaPayload) ([]models.Media, error) {\n\tctx := context.Background()\n\n\tvar limit int64 = 6\n\n\tvar medias []models.Media\n\n\trows, err := payload.DB.QueryContext(\n\t\tctx,\n\t\t\"SELECT medias.ID, medias.ImageURL, medias.USER_REF from medias WHERE USER_REF=$1 AND medias.ID > $2 ORDER BY medias.ID ASC LIMIT $3\",\n\t\tpayload.ID, payload.LastID, limit,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor rows.Next() {\n\t\tvar tmp models.Media\n\t\terr = rows.Scan(&tmp.ID, &tmp.ImageURL, &tmp.UserRef) //THIS IS WEIRD, IF NO RESULT WILL NOT RETURN ERROR\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmedias = append(medias, tmp)\n\t}\n\n\tif len(medias) == 0 {\n\t\treturn nil, errors.New(\"NO RESULT\")\n\t}\n\n\treturn medias, nil\n}", "title": "" }, { "docid": "1cf0fd4a66b6cc700a28ef2be0bb715e", "score": "0.46645278", "text": "func (o DynamicGroupMetadataPtrOutput) Queries() DynamicGroupQueryArrayOutput {\n\treturn o.ApplyT(func(v *DynamicGroupMetadata) []DynamicGroupQuery {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Queries\n\t}).(DynamicGroupQueryArrayOutput)\n}", "title": "" }, { "docid": "c74edec04c24b3fd991d03903a647d79", "score": "0.45636922", "text": "func (o DynamicGroupMetadataResponseOutput) Queries() DynamicGroupQueryResponseArrayOutput {\n\treturn o.ApplyT(func(v DynamicGroupMetadataResponse) []DynamicGroupQueryResponse { return v.Queries }).(DynamicGroupQueryResponseArrayOutput)\n}", "title": "" }, { "docid": "1581c310957ad27ab7c8accf4a4b5ea3", "score": "0.44936812", "text": "func (f CodecFactory) SupportedMediaTypes() []runtime.SerializerInfo {\n\treturn f.accepts\n}", "title": "" }, { "docid": "843ca97a9186111e6873837d8eb321e1", "score": "0.44294614", "text": "func (o ChannelDestinationOutput) MediaPackageSettings() ChannelDestinationMediaPackageSettingArrayOutput {\n\treturn o.ApplyT(func(v ChannelDestination) []ChannelDestinationMediaPackageSetting { return v.MediaPackageSettings }).(ChannelDestinationMediaPackageSettingArrayOutput)\n}", "title": "" }, { "docid": "c7be8175d021a00eda64a8338425787d", "score": "0.43915933", "text": "func GetMonsters() []string {\n\tmonsterLock.RLock()\n\tdefer monsterLock.RUnlock()\n\treturn cachedMonsterList\n}", "title": "" }, { "docid": "ba55c885dbcd935bf7f5bbbc9ae90888", "score": "0.43881065", "text": "func GetRequestQueries(r *http.Request) url.Values {\n\targs := r.URL.Query()\n\treturn args\n}", "title": "" }, { "docid": "0c69240c4462ebcd7f22dcbeb356b63b", "score": "0.43645504", "text": "func (o *Workspace) WorkspaceDevices(mods ...qm.QueryMod) workspaceDeviceQuery {\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(\"`workspace_devices`.`workspace_id`=?\", o.ID),\n\t)\n\n\tquery := WorkspaceDevices(queryMods...)\n\tqueries.SetFrom(query.Query, \"`workspace_devices`\")\n\n\tif len(queries.GetSelect(query.Query)) == 0 {\n\t\tqueries.SetSelect(query.Query, []string{\"`workspace_devices`.*\"})\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "2b5b2cdac50025d87325c0614fb5a46a", "score": "0.43608075", "text": "func (s *MediaService) getAll(w http.ResponseWriter, r *http.Request) {\n\n\tdata, err := s.getAllMediaFromDB()\n\tif err != nil {\n\t\trender.Status(r, http.StatusInternalServerError)\n\t\trender.JSON(w, r, &Exception{\n\t\t\tCode: \"internal.error\",\n\t\t\tMessage: \"Could not retrieve data\",\n\t\t})\n\t}\n\n\trender.JSON(w, r, data)\n\treturn\n}", "title": "" }, { "docid": "959f8e08def65b7650ff70a513a0064f", "score": "0.43590075", "text": "func (me *MediaStream) GetTracks() []av.IMediaTrack {\n\ttracks := make([]av.IMediaTrack, 0)\n\n\tme.mtx.RLock()\n\tdefer me.mtx.RUnlock()\n\n\tfor _, t := range me.tracks {\n\t\ttracks = append(tracks, t)\n\t}\n\n\treturn tracks\n}", "title": "" }, { "docid": "8d8b608fc022ebea9293a660ffea76bf", "score": "0.43458757", "text": "func (l *LookerSDK) AllRunningQueries(\n options *rtl.ApiSettings) ([]RunningQueries, error) {\n var result []RunningQueries\n err := l.session.Do(&result, \"GET\", \"/4.0\", \"/running_queries\", nil, nil, options)\n return result, err\n\n}", "title": "" }, { "docid": "b5efe23b49b7c652eed3dec446f8ee4f", "score": "0.43114433", "text": "func GetMedia() *Media {\n\treturn mediaPool.Get().(*Media)\n}", "title": "" }, { "docid": "254d3ca61634e96c19d436f85fa4256f", "score": "0.4282217", "text": "func (c *Config) Queries() []string {\n\tvar queries []string\n\tdata, err := ioutil.ReadFile(c.File)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\t_ = json.Unmarshal(data, &queries)\n\treturn queries\n}", "title": "" }, { "docid": "6da62077fa19f03980f58406ae057c25", "score": "0.42474726", "text": "func (d *database) Measurements(filters []*TagFilter) []*Measurement {\n\tmeasurements := make([]*Measurement, 0, len(d.measurements))\n\tfor _, idx := range d.measurements {\n\t\tmeasurements = append(measurements, idx.measurement)\n\t}\n\treturn measurements\n}", "title": "" }, { "docid": "c09ad7a18500fa23452cb02192c38a1b", "score": "0.42384106", "text": "func (n *Movie) GetMediaInfo() *MediaInfo {\n\treturn &n.MediaInfo\n}", "title": "" }, { "docid": "c8a5781cc1ae640949788df6e4810fa7", "score": "0.4226961", "text": "func (rc *V1) SearchMedia(w http.ResponseWriter, r *http.Request) {\n\tlat := r.URL.Query().Get(\"lat\")\n\tlng := r.URL.Query().Get(\"lng\")\n\tdistance := r.URL.Query().Get(\"distance\")\n\tif len(distance) == 0 {\n\t\tdistance = \"5000\"\n\t}\n\n\tif len(lat) == 0 || len(lng) == 0 {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\turl := \"https://api.instagram.com/v1/media/search\"\n\turl += \"?lat=\" + lat + \"?lng=\" + lng + \"?distance=\" + distance\n\turl += \"?access_token=\" + rc.AccessToken\n\n\tres, err := http.Get(url)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tvar data interface{}\n\terr = json.NewDecoder(res.Body).Decode(&data)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\tdefer res.Body.Close()\n\n\t//construct json data model\n\t//convert to data stream\n\tjsonData, err := json.Marshal(data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(jsonData)\n}", "title": "" }, { "docid": "c7a08696160c2c9dd3bdfcedb3cfc594", "score": "0.42139092", "text": "func GetMonitors() []*Monitor {\n\tvar length int\n\n\tmC := C.glfwGetMonitors((*C.int)(unsafe.Pointer(&length)))\n\tpanicError()\n\tif mC == nil {\n\t\treturn nil\n\t}\n\n\tm := make([]*Monitor, length)\n\n\tfor i := 0; i < length; i++ {\n\t\tm[i] = &Monitor{C.GetMonitorAtIndex(mC, C.int(i))}\n\t}\n\n\treturn m\n}", "title": "" }, { "docid": "5bca38fa9f38d75f6adc2490e9ec4a80", "score": "0.4209056", "text": "func NewMediaHandler(db *sql.DB) *MediaHandler {\n\treturn &MediaHandler{db}\n}", "title": "" }, { "docid": "3e1f81fce48768bca8de1033c413317b", "score": "0.4200934", "text": "func (c *Context) Queries() url.Values {\n\tif c.query == nil {\n\t\tc.query = c.req.URL.Query()\n\t}\n\treturn c.query\n}", "title": "" }, { "docid": "4d612bf9d83e64970a2f9fab6a56e340", "score": "0.41777036", "text": "func GetMediaInfo(filePath string, timeout time.Duration, arg ...string) (mediaInfo *MediaInfo, err error) {\n\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\tdefer cancel()\n\n\treturn GetMediaInfoContext(ctx, filePath, arg...)\n}", "title": "" }, { "docid": "febf8e3cfc01d2a1cca8288d8591917f", "score": "0.41720557", "text": "func (d Domain) Media() Media {\n\treturn Media{d.ctxWithExecutor}\n}", "title": "" }, { "docid": "1b1ca1f7bc4c71e60f30e4543f070d46", "score": "0.4167631", "text": "func MediaTypes(mediaTypes ...string) Matcher {\n\tmts := map[string]bool{}\n\tfor _, media := range mediaTypes {\n\t\tmts[media] = true\n\t}\n\treturn func(desc v1.Descriptor) bool {\n\t\tif desc.MediaType == \"\" {\n\t\t\treturn false\n\t\t}\n\t\tif _, ok := mts[string(desc.MediaType)]; ok {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "70da073df89b67816b2a93d2807b4f06", "score": "0.41663733", "text": "func GpuDevices() ([]string, error) {\n\tvar devices []string\n\trenderDs, err := filepath.Glob(\"/sys/class/drm/renderD*\")\n\tif err != nil {\n\t\treturn devices, errors.Wrap(err, \"unable to locate render devices\")\n\t}\n\tvar firstErr error\n\tvar errCnt int\n\tfor _, entryTree := range renderDs {\n\t\tdeviceReal, err := filepath.EvalSymlinks(filepath.Join(entryTree, \"device\"))\n\t\tif err != nil {\n\t\t\tif firstErr != nil {\n\t\t\t\tfirstErr = errors.Wrap(err, \"unable to resolve absolute deviceReal\")\n\t\t\t}\n\t\t\terrCnt++\n\t\t\tcontinue\n\t\t}\n\t\t// entryTree may link to something looks like\n\t\t// ../../devices/pci0000:00/0000:00:02.0/virtio0/drm/renderD128\n\t\t// We only want the real device path.\n\t\tdeviceReal = strings.SplitN(deviceReal, \"/virtio\", 2)[0]\n\t\tdevices = append(devices, deviceReal)\n\t}\n\tif firstErr == nil {\n\t\treturn devices, nil\n\t}\n\treturn devices, errors.Wrapf(firstErr, \"%d errors have occurred, first error is:\", errCnt)\n}", "title": "" }, { "docid": "b0fd6475367f11c541ff05ee8413df18", "score": "0.413181", "text": "func (e *MessagesEditInlineBotMessageRequest) GetMedia() (value InputMediaClass, ok bool) {\n\tif e == nil {\n\t\treturn\n\t}\n\tif !e.Flags.Has(14) {\n\t\treturn value, false\n\t}\n\treturn e.Media, true\n}", "title": "" }, { "docid": "7b40c79867011c9dc201bfaf050c60b7", "score": "0.4131267", "text": "func GetMetrics() *Metrics {\n\treturn gm\n}", "title": "" }, { "docid": "21fe90f221a24fda8b12efe325b57126", "score": "0.4129001", "text": "func (session *Session) Properties() []prop.Media {\n\tvar cPropertiesPtr C.PAVBindMediaProperty\n\tvar cPropertiesLen C.int\n\n\tstatus := C.AVBindSessionProperties(session.cSession, &cPropertiesPtr, &cPropertiesLen)\n\tif status != nil {\n\t\treturn nil\n\t}\n\n\t// https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices\n\tcProperties := (*[1 << 28]C.AVBindMediaProperty)(unsafe.Pointer(cPropertiesPtr))[:cPropertiesLen:cPropertiesLen]\n\tvar properties []prop.Media\n\tfor _, cProperty := range cProperties {\n\t\tframeFormat, ok := frameFormatFromAVBind(cProperty.frameFormat)\n\t\tif ok {\n\t\t\tproperties = append(properties, prop.Media{\n\t\t\t\tVideo: prop.Video{\n\t\t\t\t\tWidth: int(cProperty.width),\n\t\t\t\t\tHeight: int(cProperty.height),\n\t\t\t\t\tFrameFormat: frameFormat,\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t}\n\treturn properties\n}", "title": "" }, { "docid": "19d08a91396ae35f09709d26522fdc92", "score": "0.41286027", "text": "func (m *MessageExtendedMedia) GetMedia() (value MessageMediaClass) {\n\tif m == nil {\n\t\treturn\n\t}\n\treturn m.Media\n}", "title": "" }, { "docid": "0d2f19d43d5c0c9c54e983a39f6ca1ee", "score": "0.41261822", "text": "func getMdNames(sdp *sdp.SessionDescription) []string {\n\tmdNames := make([]string, 0, len(sdp.MediaDescriptions))\n\tfor _, media := range sdp.MediaDescriptions {\n\t\tmdNames = append(mdNames, media.MediaName.Media)\n\t}\n\treturn mdNames\n}", "title": "" }, { "docid": "50992ab945710cdcba617f0a012574ae", "score": "0.4121349", "text": "func (accept accept) ParseMediaRanges() []weightedValue {\n\tvar retVals []weightedValue\n\tmrs := strings.Split(string(accept), \",\")\n\n\tfor _, mr := range mrs {\n\t\tmrAndAcceptParam := strings.Split(mr, \";\")\n\t\t//if no accept-param\n\t\tif len(mrAndAcceptParam) == 1 {\n\t\t\tretVals = append(retVals, handleMediaRangeNoAcceptParams(mrAndAcceptParam[0]))\n\t\t\tcontinue\n\t\t}\n\n\t\tretVals = append(retVals, handleMediaRangeWithAcceptParams(mrAndAcceptParam[0], mrAndAcceptParam[1:]))\n\t}\n\n\t//If no Accept header field is present, then it is assumed that the client\n\t//accepts all media types. If an Accept header field is present, and if the\n\t//server cannot send a response which is acceptable according to the combined\n\t//Accept field value, then the server SHOULD send a 406 (not acceptable)\n\t//response.\n\tsort.Sort(byWeight(retVals))\n\n\treturn retVals\n}", "title": "" }, { "docid": "bcc1265d8bf3d59df9819b152c5ef6ea", "score": "0.40912262", "text": "func (o *SecurityMonitoringSignalRuleResponseQuery) GetMetrics() []string {\n\tif o == nil || o.Metrics == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn o.Metrics\n}", "title": "" }, { "docid": "45e616efa2cca39ef297903903fcb4bd", "score": "0.40911582", "text": "func (de *DefaultEngine) getDevices() []string {\n\treturn de.devices\n}", "title": "" }, { "docid": "7834db0be9f0a8ab1ffefd333e848a8c", "score": "0.40896636", "text": "func (qs *QueriesStorage) GetQueries(ctx context.Context, eType int64) ([]byte, error) {\n\tpostData := []byte(fmt.Sprintf(`{\"eType\": %d}`, eType))\n\trequest, err := http.NewRequest(\"POST\", qs.client.Server+\"/api/v1.0/QueriesStorage.GetQueries\", bytes.NewBuffer(postData))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\traw, err := qs.client.Do(ctx, request, nil)\n\treturn raw, err\n}", "title": "" }, { "docid": "b57f33c09ff2e5b02358ca819abbcdf9", "score": "0.40789083", "text": "func GetQLs() ([]QuickLink, error) {\n\tstoreData, err := readStore()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar store QuickLinks\n\n\terr = json.Unmarshal(storeData, &store)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn store.Links, nil\n}", "title": "" }, { "docid": "3d7923849ffccd9e4c40eab93d659268", "score": "0.4077308", "text": "func (s *Setting) GetWebAppMediaPath() string { return s.Webapp.MediaPath }", "title": "" }, { "docid": "c1b7e61678f71504786919d753f74aea", "score": "0.40698797", "text": "func (c *Client) GetRunningQueries() ([]LSQLRunningQuery, error) {\n\tresp, err := c.do(http.MethodGet, queriesPath, \"\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar queries []LSQLRunningQuery\n\terr = c.readJSON(resp, &queries)\n\treturn queries, err\n}", "title": "" }, { "docid": "a3eaf354daba4cb1ad21e40aef8b0e8e", "score": "0.40638304", "text": "func GetNotesForMedia(tx *gorm.DB, mediaID string) ([]*models.Note, error) {\n\tvar notes []*models.Note\n\n\terr := tx.Where(\"media_id = ?\", mediaID).Find(&notes).Error\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn notes, nil\n}", "title": "" }, { "docid": "790a1c11dfd27510d3605e9bebfc2881", "score": "0.404094", "text": "func GetDeviceManagers() []DeviceManager {\n\treturn []DeviceManager{\n\t\t&memory.DeviceManager{},\n\t\t&redis.DeviceManager{},\n\t\t&file.DeviceManager{}, // this needs to be the last catch-all one\n\t}\n}", "title": "" }, { "docid": "200764c46e7fca6dd9ef7071679ecb7d", "score": "0.40292862", "text": "func GetDevices() (devices []Device, err error) {\n\terr = engine.Find(&devices)\n\tfor i := range devices {\n\t\tdevices[i].UpdateFromPlugin()\n\t}\n\treturn\n}", "title": "" }, { "docid": "9285513dd398d9d70bd92cabf7914ebf", "score": "0.40185168", "text": "func parseQueries(pkg *packages.Package) []*Query {\n\tres := make([]*Query, 0)\n\tfor _, file := range pkg.Syntax {\n\t\tfor _, decl := range file.Decls {\n\t\t\tif q := parseFuncQuery(decl, pkg.TypesInfo); q != nil {\n\t\t\t\tres = append(res, q)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "f6789fdf5f50f4ffe52d870f026d63a9", "score": "0.40138513", "text": "func (Media) Fields() []ent.Field {\n\treturn []ent.Field{\n\t\tfield.String(\"source\").\n\t\t\tOptional(),\n\t\tfield.String(\"source_uri\").\n\t\t\tOptional().\n\t\t\tComment(\"source_ui text\").\n\t\t\tAnnotations(entsql.WithComments(false)),\n\t\tfield.Text(\"text\").\n\t\t\tOptional().\n\t\t\tComment(\"media text\"),\n\t}\n}", "title": "" }, { "docid": "901b95eab87b9a3656b6086c586defb9", "score": "0.40085357", "text": "func (o *MultipleDeviceMonitoring) GetMonitorings() []DeviceMonitoring {\n\tif o == nil {\n\t\tvar ret []DeviceMonitoring\n\t\treturn ret\n\t}\n\n\treturn o.Monitorings\n}", "title": "" }, { "docid": "68e61e5640f9b5136609b7d7eb11963b", "score": "0.399385", "text": "func (self *AudioStream) Fragments() float32 {\n return float32(C.al_get_audio_stream_fragments(self.handle))\n}", "title": "" }, { "docid": "a234268c559fcceb13add13d80a8f087", "score": "0.39908", "text": "func (q *ChunkQuerier) Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error) {\n\t// Get chunks for all matching series from ChunkStore.\n\tchunks, err := q.Store.Get(ctx, from, to, matchers...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Group chunks by series, sort and dedupe samples.\n\tsampleStreams := map[model.Fingerprint]*model.SampleStream{}\n\n\tfor _, c := range chunks {\n\t\tfp := c.Metric.Fingerprint()\n\t\tss, ok := sampleStreams[fp]\n\t\tif !ok {\n\t\t\tss = &model.SampleStream{\n\t\t\t\tMetric: c.Metric,\n\t\t\t}\n\t\t\tsampleStreams[fp] = ss\n\t\t}\n\t\tss.Values = append(ss.Values, local.DecodeDoubleDeltaChunk(c.Data)...)\n\t}\n\n\tfor _, ss := range sampleStreams {\n\t\tsort.Sort(timeSortableSamplePairs(ss.Values))\n\t\t// TODO: should we also dedupe samples here or leave that to the upper layers?\n\t}\n\n\tmatrix := make(model.Matrix, 0, len(sampleStreams))\n\tfor _, ss := range sampleStreams {\n\t\tmatrix = append(matrix, ss)\n\t}\n\n\treturn matrix, nil\n}", "title": "" }, { "docid": "3b7346b28ebda2c19fb5234020d075a4", "score": "0.3978788", "text": "func (n *EpisodeDetails) GetMediaInfo() *MediaInfo {\n\treturn &n.MediaInfo\n}", "title": "" }, { "docid": "21eef57440da763c3f1c3edeea8b9c75", "score": "0.3977385", "text": "func CachedMediaCount() int {\n\treturn len(cachedMedia)\n}", "title": "" }, { "docid": "08cfad7164261026d07358552e4ec983", "score": "0.39652526", "text": "func (a *App) GetPromotions(limit, offset int) ([]*model.Promotion, *model.AppErr) {\n\treturn a.Srv().Store.Promotion().GetAll(limit, offset)\n}", "title": "" }, { "docid": "d7d73567b42721eedbdf6ad24a98e349", "score": "0.39609882", "text": "func (act Account) GetMobileNumbers(l MobileSearchFilter, iso string) (NumberList, error) {\n\tvar nl NumberList\n\tif !validateIsoCountry(iso) {\n\t\treturn nl, errors.New(\"Invalid country ISO\")\n\t}\n\terr := common.SendGetRequest(fmt.Sprintf(numbers.mobile, act.AccountSid, iso)+l.getQueryString(), act, &nl)\n\tnl.act = &act\n\treturn nl, err\n}", "title": "" }, { "docid": "e72f52f988059b81052e49901bf4a670", "score": "0.3954032", "text": "func (r *Response) GetQueryMetrics() (*Metrics, error) {\n\t// x-ms-documentdb-query-metrics: totalExecutionTimeInMs=33.67;queryCompileTimeInMs=0.06;queryLogicalPlanBuildTimeInMs=0.02;queryPhysicalPlanBuildTimeInMs=0.10;queryOptimizationTimeInMs=0.00;VMExecutionTimeInMs=32.56;indexLookupTimeInMs=0.36;documentLoadTimeInMs=9.58;systemFunctionExecuteTimeInMs=0.00;userFunctionExecuteTimeInMs=0.00;retrievedDocumentCount=2000;retrievedDocumentSize=1125600;outputDocumentCount=2000;writeOutputTimeInMs=18.10;indexUtilizationRatio=1.00\n\t// x-ms-request-charge: 604.42\n\n\tmetrics := &Metrics{}\n\tmetricsStrSlice := strings.Split(r.Header.Get(HeaderQueryMetrics), \";\")\n\tif len(metricsStrSlice) == 1 {\n\t\treturn nil, fmt.Errorf(\"no metrics in response\")\n\t}\n\tfor _, metricStr := range metricsStrSlice {\n\t\tmetricSlice := strings.Split(metricStr, \"=\")\n\t\tif len(metricSlice) == 2 {\n\t\t\tmetricKey, metricVal, err := getMetricKeyVal(metricSlice)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tswitch metricKey {\n\t\t\tcase \"totalExecutionTimeInMs\":\n\t\t\t\tmetrics.TotalExecutionTimeInMs = metricVal\n\t\t\tcase \"queryCompileTimeInMs\":\n\t\t\t\tmetrics.QueryCompileTimeInMs = metricVal\n\t\t\tcase \"queryLogicalPlanBuildTimeInMs\":\n\t\t\t\tmetrics.QueryLogicalPlanBuildTimeInMs = metricVal\n\t\t\tcase \"queryPhysicalPlanBuildTimeInMs\":\n\t\t\t\tmetrics.QueryPhysicalPlanBuildTimeInMs = metricVal\n\t\t\tcase \"queryOptimizationTimeInMs\":\n\t\t\t\tmetrics.QueryOptimizationTimeInMs = metricVal\n\t\t\tcase \"VMExecutionTimeInMs\":\n\t\t\t\tmetrics.VMExecutionTimeInMs = metricVal\n\t\t\tcase \"indexLookupTimeInMs\":\n\t\t\t\tmetrics.IndexLookupTimeInMs = metricVal\n\t\t\tcase \"documentLoadTimeInMs\":\n\t\t\t\tmetrics.DocumentLoadTimeInMs = metricVal\n\t\t\tcase \"systemFunctionExecuteTimeInMs\":\n\t\t\t\tmetrics.SystemFunctionExecuteTimeInMs = metricVal\n\t\t\tcase \"userFunctionExecuteTimeInMs\":\n\t\t\t\tmetrics.UserFunctionExecuteTimeInMs = metricVal\n\t\t\tcase \"retrievedDocumentCount\":\n\t\t\t\tmetrics.RetrievedDocumentCount = int(metricVal)\n\t\t\tcase \"retrievedDocumentSize\":\n\t\t\t\tmetrics.RetrievedDocumentSize = int(metricVal)\n\t\t\tcase \"outputDocumentCount\":\n\t\t\t\tmetrics.OutputDocumentCount = int(metricVal)\n\t\t\tcase \"writeOutputTimeInMs\":\n\t\t\t\tmetrics.WriteOutputTimeInMs = metricVal\n\t\t\tcase \"indexUtilizationRatio\":\n\t\t\t\tmetrics.IndexUtilizationRatio = metricVal\n\t\t\t}\n\n\t\t}\n\t}\n\n\tvar requestVal float64\n\t_, err := fmt.Sscanf(r.Header.Get(HeaderRequestCharge), \"%f\", &requestVal)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing request charge header: %v\", err)\n\n\t}\n\tmetrics.RequestCharge = requestVal\n\n\treturn metrics, nil\n}", "title": "" }, { "docid": "99e8e0db33580af584a2c1780dc023be", "score": "0.3951513", "text": "func (x *MediaHandler) Media() http.HandlerFunc {\n\treturn func(res http.ResponseWriter, req *http.Request) {\n\n\t\tws, err := upgrader.Upgrade(res, req, res.Header())\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn\n\t\t}\n\n\t\tctx, cancel := context.WithCancel(context.Background())\n\n\t\tgo readAndSend(cancel, ws, x.db)\n\t\tgo receiveAndHandle(ctx)\n\t}\n}", "title": "" }, { "docid": "daec14c8ce71d9b68cd78df06ddfc0f9", "score": "0.3945855", "text": "func (o *MeasurementSchemaList) GetMeasurementSchemas() []MeasurementSchema {\n\tif o == nil {\n\t\tvar ret []MeasurementSchema\n\t\treturn ret\n\t}\n\n\treturn o.MeasurementSchemas\n}", "title": "" }, { "docid": "5a98118a90f39e3806a9af586a061f33", "score": "0.39428958", "text": "func (n *NvidiaGPUManager) GetDevices() []*ecs.PlatformDevice {\n\tn.lock.RLock()\n\tdefer n.lock.RUnlock()\n\treturn n.GPUDevices\n}", "title": "" }, { "docid": "e3bad5169ac2d21da4d659f9f0941467", "score": "0.39325827", "text": "func apiGetQueryMediaItemCollection(w http.ResponseWriter, r *http.Request, id string) {\n\n\tdb := getDB()\n\n\tvar (\n\t\tname string\n\t\tentities []string\n\t\tfeedGroups []string\n\t\tfeeds []string\n\t)\n\n\tvar err error\n\n\tqs := r.URL.Query()\n\n\toffset := 0\n\tif values := qs[\"offset\"]; len(values) > 0 {\n\t\tvalue, err := strconv.Atoi(values[len(values)-1])\n\t\tif err == nil {\n\t\t\toffset = value\n\t\t}\n\t}\n\n\tlimit := 10\n\tif values := qs[\"limit\"]; len(values) > 0 {\n\t\tvalue, err := strconv.Atoi(values[len(values)-1])\n\t\tif err == nil {\n\t\t\tlimit = value\n\t\t}\n\t}\n\n\t// ?epochTimeSecs=1510531199&pastHourString=-5&namedEntity=United+States\n\tepochTimeSecs := 0\n\tif values := qs[\"epochTimeSecs\"]; len(values) > 0 {\n\t\tvalue, err := strconv.Atoi(values[len(values)-1])\n\t\tif err == nil {\n\t\t\tepochTimeSecs = value\n\t\t}\n\t} else if len(values) == 0 {\n\t\tapiLogf(r, \"error: bad request: epochTimeSecs not defined\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// ?epochTimeSecs=1510531199&pastHourString=-5&namedEntity=United+States\n\tpastHour := 0\n\tif values := qs[\"pastHourString\"]; len(values) > 0 {\n\t\tvalue, err := strconv.Atoi(strings.TrimPrefix(values[len(values)-1], \"-\"))\n\t\tif err == nil {\n\t\t\tpastHour = value\n\t\t}\n\t} else if len(values) == 0 {\n\t\tapiLogf(r, \"error: bad request: pastHourString not defined\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif values := qs[\"namedEntity\"]; len(values) > 0 {\n\t\tfor _, value := range values {\n\t\t\tentities = append(entities, value)\n\t\t}\n\t}\n\n\tbinCount := 0\n\tif values := qs[\"bins\"]; len(values) > 0 {\n\t\tvalue, err := strconv.Atoi(values[len(values)-1])\n\t\tif err == nil {\n\t\t\tbinCount = value\n\t\t}\n\t}\n\n\tbinSize := int64(0)\n\tif values := qs[\"binsize\"]; len(values) > 0 {\n\t\tvalue, err := strconv.Atoi(values[len(values)-1])\n\t\tif err == nil {\n\t\t\tbinSize = int64(value)\n\t\t}\n\t}\n\n\t// TODO: extra default value logic\n\tif binCount == 0 {\n\t\tbinCount = 24\n\t}\n\tif binSize == int64(0) {\n\t\tbinSize = int64(3600)\n\t}\n\n\tif id == \"all\" {\n\t\tname = \"All\"\n\t} else {\n\t\terr := db.QueryRow(`\n\t\t\tSELECT name, entities, feed_groups\n\t\t\tFROM queries WHERE id = $1;\n\t\t`, id).Scan(&name, &entities, &feedGroups)\n\t\tif err != nil {\n\t\t\tif err == ErrNoRows {\n\t\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tapiLogf(r, \"error getting query from db: %v\", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif len(feedGroups) > 0 {\n\t\terr := db.QueryRow(`\n\t\t\tSELECT DISTINCT feed\n\t\t\tFROM feed_group_feeds WHERE feed_group = ANY($1);\n\t\t`, feedGroups).Scan(&feeds)\n\t\tif err != nil && err != ErrNoRows {\n\t\t\tapiLogf(r, \"error getting feed group feeds from db: %v\", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// now := time.Date(2017, 11, 12, 23, 59, 59, 0, time.UTC)\n\n\t// var from *time.Time = nil\n\t// var till *time.Time = nil\n\n\tnow := time.Unix(int64(epochTimeSecs), 0)\n\ttill := now.Add(-time.Duration(pastHour) * time.Hour)\n\tfrom := till.Add(-time.Hour)\n\n\t// till = now.Add(-time.Duration(pastHour) * time.Duration(binSize) * time.Second)\n\t// from = till.Add(-time.Duration(binSize) * time.Second)\n\n\tfrom = from.UTC()\n\ttill = till.UTC()\n\n\tfmt.Println(\"epoch:\", epochTimeSecs)\n\tfmt.Println(\"from:\", from)\n\tfmt.Println(\"till:\", till)\n\t// layout := \"2006-01-02 15:04:05 -0700 MST 2006\"\n\tlayout := \"2006-01-02 15:04:05\"\n\tfmt.Println(\"from:\", from.UTC().Format(layout))\n\tfmt.Println(\"till:\", till.UTC().Format(layout))\n\n\t// binEnd := now.Unix()\n\t// binStart := binEnd - binSize*int64(binCount)\n\n\trows, err := getMediaItemsCollectionData(db, &from, &till, &feeds, &entities, limit, offset)\n\tif err != nil {\n\t\tapiLogf(r, \"error getting media items from db: %v\", err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\n\tmediaItems := make([]interface{}, 0, 100)\n\tfor rows.Next() {\n\t\tvar (\n\t\t\titemID string\n\t\t\tdata interface{}\n\t\t)\n\t\terr = rows.Scan(&itemID, &data)\n\t\tif err != nil {\n\t\t\tapiLogf(r, \"error getting row values: %v\", err)\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tmediaItem := data.(map[string]interface{})\n\t\tout := map[string]interface{}{}\n\t\tout[\"id\"] = itemID\n\t\ttitles := mediaItem[\"title\"].(map[string]interface{})\n\t\ttitle, prs := titles[\"english\"]\n\t\tif !prs || title == nil {\n\t\t\ttitle = titles[\"original\"]\n\t\t}\n\t\tout[\"title\"] = title\n\t\t// out[\"title\"] = mediaItem[\"title\"].(map[string]interface{})[\"english\"]\n\t\tout[\"detectedLangCode\"] = mediaItem[\"detectedLangCode\"]\n\t\tout[\"detectedTopics\"] = mediaItem[\"detectedTopics\"]\n\t\tout[\"mediaItemType\"] = mediaItem[\"mediaItemType\"]\n\t\tout[\"sentiment\"] = mediaItem[\"sentiment\"]\n\t\tout[\"timeAdded\"] = mediaItem[\"timeAdded\"]\n\t\tout[\"source\"] = mediaItem[\"source\"]\n\t\t// data.(map[string]interface{})[\"id\"] = itemID\n\t\tmediaItems = append(mediaItems, out)\n\t}\n\n\tresult := struct {\n\t\tID string `json:\"id\"`\n\t\tName string `json:\"name\"`\n\t\t// Now int64 `json:\"epochTimeSecs\"`\n\t\tMediaItems []interface{} `json:\"mediaItems\"`\n\t}{ID: id, Name: name /* Now: now.Unix(), */, MediaItems: mediaItems}\n\n\tw.Header()[\"Content-Type\"] = []string{\"application/json\"}\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(result)\n}", "title": "" }, { "docid": "eb5094ac43e8376f93d51bb01610b715", "score": "0.39269772", "text": "func (mock *DeviceMock) GetMigDevicesCalls() []struct {\n} {\n\tvar calls []struct {\n\t}\n\tmock.lockGetMigDevices.RLock()\n\tcalls = mock.calls.GetMigDevices\n\tmock.lockGetMigDevices.RUnlock()\n\treturn calls\n}", "title": "" }, { "docid": "b6d22514cad4a68efbc46e91d20142fd", "score": "0.39230025", "text": "func (n Window) MatchesMedia(criteria string) bool {\n\treturn n.val.Call(\"matchMedia\", criteria).Get(\"matches\").Bool()\n}", "title": "" }, { "docid": "7e6cd824970da6367415e8cc7da39985", "score": "0.3916551", "text": "func GetEncryptedMedia(params models.ViewContent) (*models.EnryptedMedia, error) {\n\trow := db.QueryRow(_VIEW_CONTENT_MYSQL, params.ContentID, params.Device)\n\tdata := new(models.EnryptedMedia)\n\terr := row.Scan(&data.EncryptionMode, &data.ContentKey, &data.Payload)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "0547e7515ec38206b16d8d4a3015c5b0", "score": "0.39123216", "text": "func (a *ComputeApiService) GetComputeVmediaList(ctx context.Context) ApiGetComputeVmediaListRequest {\n\treturn ApiGetComputeVmediaListRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "a01aa0433a25941a647e8afbf681638a", "score": "0.39106452", "text": "func GetUserMedia(ctx context.Context, s *testing.State) {\n\tduration := 3 * time.Second\n\t// Since we use vivid on VM and it's slower than real cameras,\n\t// we use a longer time limit: https://crbug.com/929537\n\tif vm.IsRunningOnVM() {\n\t\tduration = 10 * time.Second\n\t}\n\n\tvar ci getusermedia.ChromeInterface\n\tif s.Param().(browser.Type) == browser.TypeLacros {\n\t\ttconn, err := s.FixtValue().(chrome.HasChrome).Chrome().TestAPIConn(ctx)\n\t\tif err != nil {\n\t\t\ts.Fatal(\"Failed to connect to test API: \", err)\n\t\t}\n\n\t\tci, err = lacros.Launch(ctx, tconn)\n\t\tif err != nil {\n\t\t\ts.Fatal(\"Failed to launch lacros-chrome: \", err)\n\t\t}\n\t\tdefer ci.Close(ctx)\n\t} else {\n\t\tci = s.PreValue().(*chrome.Chrome)\n\t}\n\t// Run tests for 480p and 720p.\n\tgetusermedia.RunGetUserMedia(ctx, s, ci, duration, getusermedia.VerboseLogging)\n}", "title": "" }, { "docid": "4752e4347b981e34d2600aac86858f9b", "score": "0.39073747", "text": "func (service *MediaService) List(param MediaListParams) (response *BaseListMediaResponse, err error) {\n\treq, err := service.client.NewRequest(\"GET\", param, \"Media\")\n\tif err != nil {\n\t\treturn\n\t}\n\tresp := &BaseListMediaResponse{}\n\terr = service.client.ExecuteRequest(req, resp)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "81fe2f8036118a0ea702644486120030", "score": "0.3907172", "text": "func (m *Manager) QueryManagers() *OrderproductQuery {\n\treturn (&ManagerClient{config: m.config}).QueryManagers(m)\n}", "title": "" }, { "docid": "60af83759af7bcb698b62a125e1b88e5", "score": "0.38993743", "text": "func (m *StorageMock) GetAllMonitors(pageSize int64, pageIndex int64, contains string) ([]types.Monitor, error) {\n\treturn m.GetAllMonitorsResult, m.GetAllMonitorsError\n}", "title": "" }, { "docid": "dea20f33fea5fe2eaef0aca7ca14636e", "score": "0.3897276", "text": "func (r *RoleV6) GetDesktopGroups(rct RoleConditionType) []string {\n\tif rct == Allow {\n\t\treturn r.Spec.Allow.DesktopGroups\n\t}\n\treturn r.Spec.Deny.DesktopGroups\n}", "title": "" }, { "docid": "e61ae5c174854306e9e1de25c806f40d", "score": "0.3887484", "text": "func (c Client) Query() ([]QueryMetric, error) {\n\tvar metrics []QueryMetric\n\n\turl, err := c.withPath(\"query\")\n\tif err != nil {\n\t\treturn metrics, errors.Wrap(err, \"failed to get query path\")\n\t}\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn metrics, errors.Wrap(err, \"failed to get query metrics\")\n\t}\n\n\tbts, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn metrics, errors.Wrap(err, \"failed to read query response body\")\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn metrics, fmt.Errorf(\"failed to get metrics: %s %d\", string(bts), resp.StatusCode)\n\t}\n\n\tif err := json.Unmarshal(bts, &metrics); err != nil {\n\t\treturn metrics, errors.Wrapf(err, \"failed to unmarshall query metrics output: %s\", string(bts))\n\t}\n\treturn metrics, nil\n}", "title": "" }, { "docid": "4752de4793898eb1aa3baf6a9dbe8e80", "score": "0.3885372", "text": "func (s *Setting) GetWebAppMediaURL() string { return s.Webapp.MediaURL }", "title": "" }, { "docid": "233aedbaf0c51533b235db129ef7d179", "score": "0.3883855", "text": "func RecognizeMedia(typ MediaType, width MediaWidth) Media {\n\tswitch typ {\n\tcase LaminatedTape, NonlaminatedTape:\n\t\tswitch width {\n\t\tcase MediaWidth3_5:\n\t\t\treturn MediaTZeTape3_5\n\t\tcase MediaWidth6:\n\t\t\treturn MediaTZeTape6\n\t\tcase MediaWidth9:\n\t\t\treturn MediaTZeTape9\n\t\tcase MediaWidth12:\n\t\t\treturn MediaTZeTape12\n\t\tcase MediaWidth18:\n\t\t\treturn MediaTZeTape18\n\t\tcase MediaWidth24:\n\t\t\treturn MediaTZeTape24\n\t\t}\n\tcase HeatShrinkTube:\n\t\tswitch width {\n\t\tcase MediaWidth6:\n\t\t\treturn MediaHeatShrinkTube6\n\t\tcase MediaWidth9:\n\t\t\treturn MediaHeatShrinkTube9\n\t\tcase MediaWidth12:\n\t\t\treturn MediaHeatShrinkTube12\n\t\tcase MediaWidth18:\n\t\t\treturn MediaHeatShrinkTube18\n\t\tcase MediaWidth24:\n\t\t\treturn MediaHeatShrinkTube24\n\t\t}\n\t}\n\treturn UnknownMedia\n}", "title": "" }, { "docid": "5a2827b92f816081064988012dffdd34", "score": "0.38643137", "text": "func NewMedia() *Media {\n\tthis := Media{}\n\treturn &this\n}", "title": "" }, { "docid": "113fe308c76dc8feddf31111bbdcfc46", "score": "0.3860777", "text": "func ScanMedia() {\n\terrch := make(chan error, 0)\n\n\tfor _, root := range MediaRoots {\n\t\tlog.Printf(\"Scan: %q\", root.Name)\n\t\tgo scanMedia(errch, root.Path, \".go\")\n\t}\n\n\tfor err := range errch {\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tlog.Printf(\"Scan: %v\", err)\n\t\terrch <- err\n\t}\n\n\tlog.Print(\"Scan: complete\")\n}", "title": "" }, { "docid": "013db8c1dba4c3bb8df1da9d29c6b731", "score": "0.38569123", "text": "func (n EpisodeDetails) GetMediaPathMatcher(showPath string) string {\n\tcleanTitle := FileNameCleaner(n.Title)\n\tcleanShow := FileNameCleaner(n.Showtitle)\n\treturn filepath.Join(showPath, \"*\", cleanShow+\" - * - \"+cleanTitle+\".mp4\")\n\n}", "title": "" }, { "docid": "251cf4caefd825c63da2ef28ecaf79f1", "score": "0.38552496", "text": "func (sp SimpleProduct) Media() ProductMedia {\n\treturn ProductMedia{All: sp.product.TeaserData().Media}\n}", "title": "" }, { "docid": "085a0e0d268c4aec63154e0aa6046f18", "score": "0.3852615", "text": "func (qc *QueryContext) GetRewrittenQuery() common.AQLQuery {\n\tnewQuery := *qc.AQLQuery\n\tfor i, measure := range newQuery.Measures {\n\t\tif measure.ExprParsed != nil {\n\t\t\tmeasure.Expr = measure.ExprParsed.String()\n\t\t\tnewQuery.Measures[i] = measure\n\t\t}\n\t}\n\n\tfor i, join := range newQuery.Joins {\n\t\tfor j := range join.Conditions {\n\t\t\tif j < len(join.ConditionsParsed) && join.ConditionsParsed[j] != nil {\n\t\t\t\tjoin.Conditions[j] = join.ConditionsParsed[j].String()\n\t\t\t}\n\t\t}\n\t\tnewQuery.Joins[i] = join\n\t}\n\n\tfor i, dim := range newQuery.Dimensions {\n\t\tif dim.ExprParsed != nil {\n\t\t\tdim.Expr = dim.ExprParsed.String()\n\t\t\tnewQuery.Dimensions[i] = dim\n\t\t}\n\t}\n\n\tfor i := range newQuery.Filters {\n\t\tif i < len(newQuery.FiltersParsed) && newQuery.FiltersParsed[i] != nil {\n\t\t\tnewQuery.Filters[i] = newQuery.FiltersParsed[i].String()\n\t\t}\n\t}\n\n\tfor i, measure := range newQuery.SupportingMeasures {\n\t\tif measure.ExprParsed != nil {\n\t\t\tmeasure.Expr = measure.ExprParsed.String()\n\t\t\tnewQuery.SupportingMeasures[i] = measure\n\t\t}\n\t}\n\n\tfor i, dim := range newQuery.SupportingDimensions {\n\t\tif dim.ExprParsed != nil {\n\t\t\tdim.Expr = dim.ExprParsed.String()\n\t\t\tnewQuery.SupportingDimensions[i] = dim\n\t\t}\n\t}\n\treturn newQuery\n}", "title": "" }, { "docid": "784caff0781fd92418fb29740d812664", "score": "0.38525084", "text": "func (c *WatermarksSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *WatermarksSetCall {\n\tc.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)\n\treturn c\n}", "title": "" }, { "docid": "8f99a65580f387dbeda5f7eb7f92f4e7", "score": "0.38500994", "text": "func (Media) Indexes() []ent.Index {\n\treturn []ent.Index{\n\t\tindex.Fields(\"source\", \"source_uri\").\n\t\t\tAnnotations(entsql.PrefixColumn(\"source\", 100)).\n\t\t\tUnique(),\n\t\t// MySQL allow indexing text column prefix.\n\t\tindex.Fields(\"text\").\n\t\t\tAnnotations(entsql.Prefix(100)),\n\t}\n}", "title": "" }, { "docid": "0eba3f38c9b9060e43c72fe8bc37f77c", "score": "0.3846023", "text": "func (l *null) GetDevices() ([]Device, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "97bd9a078dd33d87990e7dcadd6c3a02", "score": "0.38459355", "text": "func (o *ListStreamWidgetRequest) GetQuery() ListStreamQuery {\n\tif o == nil {\n\t\tvar ret ListStreamQuery\n\t\treturn ret\n\t}\n\treturn o.Query\n}", "title": "" }, { "docid": "1135806a7aaece3b8c0fc38786e453bc", "score": "0.38438237", "text": "func (m *Monitor) GetVideoModes() []*VidMode {\n\tvar length int\n\n\tvC := C.glfwGetVideoModes(m.data, (*C.int)(unsafe.Pointer(&length)))\n\tpanicError()\n\tif vC == nil {\n\t\treturn nil\n\t}\n\n\tv := make([]*VidMode, length)\n\n\tfor i := 0; i < length; i++ {\n\t\tt := C.GetVidmodeAtIndex(vC, C.int(i))\n\t\tv[i] = &VidMode{int(t.width), int(t.height), int(t.redBits), int(t.greenBits), int(t.blueBits), int(t.refreshRate)}\n\t}\n\n\treturn v\n}", "title": "" }, { "docid": "9ed72e5b5543d33b348341b648a3351b", "score": "0.38409778", "text": "func (m *UserExperienceAnalyticsWorkFromAnywhereMetricsUserExperienceAnalyticsWorkFromAnywhereMetricItemRequestBuilder) MetricDevices()(*UserExperienceAnalyticsWorkFromAnywhereMetricsItemMetricDevicesRequestBuilder) {\n return NewUserExperienceAnalyticsWorkFromAnywhereMetricsItemMetricDevicesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter)\n}", "title": "" }, { "docid": "a55cd9ed1e71b18382943579ed867503", "score": "0.38327518", "text": "func (c *MusicClient) Query() *MusicQuery {\n\treturn &MusicQuery{config: c.config}\n}", "title": "" }, { "docid": "c81c5345737af51d8f261ee67c31c946", "score": "0.3830252", "text": "func GetMediaInfo(filename string) (info *SimpleMediaInfo, err error) {\n\tmi := NewMediaInfo()\n\terr = mi.OpenFile(filename)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer mi.Close()\n\tinfo = &SimpleMediaInfo{}\n\tg := &info.General\n\tg.Codec = mi.Get(MediaInfo_Stream_General, \"CodecID\")\n\tg.Format = mi.Get(MediaInfo_Stream_General, \"Format\")\n\tg.DurationStr = mi.Get(MediaInfo_Stream_General, \"Duration/String3\")\n\tg.Duration = mi.GetInt(MediaInfo_Stream_General, \"Duration\")\n\tg.Start = mi.GetInt(MediaInfo_Stream_General, \"Start\")\n\tg.BitRate = mi.GetInt(MediaInfo_Stream_General, \"OverallBitRate\")\n\tg.FrameRate = mi.GetInt(MediaInfo_Stream_General, \"FrameRate\")\n\tg.FileSize = mi.GetInt(MediaInfo_Stream_General, \"FileSize\")\n\n\tg.GeneralCount = int(mi.GetInt(MediaInfo_Stream_General, \"GeneralCount\"))\n\tg.VideoCount = int(mi.GetInt(MediaInfo_Stream_General, \"VideoCount\"))\n\tg.AudioCount = int(mi.GetInt(MediaInfo_Stream_General, \"AudioCount\"))\n\tg.TextCount = int(mi.GetInt(MediaInfo_Stream_General, \"TextCount\"))\n\tg.OtherCount = int(mi.GetInt(MediaInfo_Stream_General, \"OtherCount\"))\n\tg.ImageCount = int(mi.GetInt(MediaInfo_Stream_General, \"ImageCount\"))\n\tg.MenuCount = int(mi.GetInt(MediaInfo_Stream_General, \"MenuCount\"))\n\n\tvar StreamIDOffSet int64\n\tif \"RealMedia\" == g.Format {\n\t\tStreamIDOffSet = 0\n\t} else {\n\t\tStreamIDOffSet = 1\n\t}\n\tglog.Infof(\"GetMediaInfo g.VideoCount:%d, g.AudioCount:%d, g.TextCount, StreamIDOffSet:%d\\n\", g.VideoCount, g.AudioCount, g.TextCount, StreamIDOffSet)\n\t//v := &info.Video\n\tfor i := 0; i < g.VideoCount; i++ {\n\tvinfo := VideoInfo{}\n\tvinfo.StreamID = mi.GetIntIdx(MediaInfo_Stream_Video, i, \"ID\") - StreamIDOffSet\n\tvinfo.CodecID \t= mi.GetIdx(MediaInfo_Stream_Video, i, \"CodecID\")\n\tvinfo.BitRate \t= mi.GetIntIdx(MediaInfo_Stream_Video, i, \"BitRate\")\n\tvinfo.FrameRate = mi.GetFloatIdx(MediaInfo_Stream_Video, i, \"FrameRate\")\n\tvinfo.Width \t= mi.GetIntIdx(MediaInfo_Stream_Video, i, \"Width\")\n\tvinfo.Height \t= mi.GetIntIdx(MediaInfo_Stream_Video, i, \"Height\")\n\tvinfo.Resolution = fmt.Sprintf(\"%dx%d\", vinfo.Width, vinfo.Height)\n\tvinfo.Default \t= mi.GetIdx(MediaInfo_Stream_Video, i, \"Default\")\n\tvinfo.DAR \t\t= mi.GetIdx(MediaInfo_Stream_Video, i, \"DisplayAspectRatio/String\")\n\tglog.Infof(\"GetMediaInfo vinfo.StreamID:%d vinfo.CodecID:%s, BitRate:%d, FrameRate:%f, Width:%d, Height:%d, Resolution:%s, Default:%s\\n\", vinfo.StreamID, vinfo.CodecID, vinfo.BitRate, vinfo.FrameRate, vinfo.Width, vinfo.Height, vinfo.Resolution, vinfo.Default)\n\tinfo.Video \t\t= append(info.Video, vinfo)\n\t}\n\n\t//a := &info.Audio\n\tfor i := 0; i < g.AudioCount; i++ {\n\tainfo := AudioInfo{}\n\tainfo.StreamID = mi.GetIntIdx(MediaInfo_Stream_Audio, i, \"ID\") - StreamIDOffSet\n\tainfo.CodecID = mi.GetIdx(MediaInfo_Stream_Audio, i, \"CodecID\")\n\tainfo.channel = mi.GetIntIdx(MediaInfo_Stream_Audio, i, \"Channel\")\n\tainfo.SamplingRate = mi.GetIntIdx(MediaInfo_Stream_Audio, i, \"SamplingRate\")\n\tainfo.BitRate = mi.GetIntIdx(MediaInfo_Stream_Audio, i, \"BitRate\")\n\tainfo.Title = mi.GetIdx(MediaInfo_Stream_Audio, i, \"Title\")\n\tainfo.Language = mi.GetIdx(MediaInfo_Stream_Audio, i, \"Language\")\n\tainfo.Default = mi.GetIdx(MediaInfo_Stream_Audio, i, \"Default\")\n\tinfo.Audio = append(info.Audio, ainfo)\n\n\tglog.Infof(\"GetMediaInfo ainfo.StreamID:%d, ainfo.CodecID:%s, ainfo.channel:%d, ainfo.SamplingRate:%d, ainfo.BitRate:%d, ainfo.Title:%s, ainfo.Language:%s, ainfo.Default:%s\\n\", ainfo.StreamID, ainfo.CodecID, ainfo.channel, ainfo.SamplingRate, ainfo.BitRate, ainfo.Title, ainfo.Language, ainfo.Default)\n\t}\n\n\tinfo.SubtitlesCnt = int(mi.GetInt(MediaInfo_Stream_Text, \"StreamCount\"))\n\tglog.Infof(\"GetMediaInfo info.SubtitlesCnt:%d, g.TextCount:%d\\n\", info.SubtitlesCnt, g.TextCount)\n\tfor i := 0; i < g.TextCount; i++ {\n\t\tsubtitles := SubtitlesInfo{}\n\t\tsubtitles.StreamID = mi.GetIntIdx(MediaInfo_Stream_Text, i, \"ID\") - StreamIDOffSet\n\t\tsubtitles.Format = mi.GetIdx(MediaInfo_Stream_Text, i, \"Format\")\n\t\tsubtitles.CodecID = mi.GetIdx(MediaInfo_Stream_Text, i, \"CodecID\")\n\t\tsubtitles.Title = mi.GetIdx(MediaInfo_Stream_Text, i, \"Title\")\n\t\tsubtitles.Language = mi.GetIdx(MediaInfo_Stream_Text, i, \"Language\")\n\t\tsubtitles.Default = mi.GetIdx(MediaInfo_Stream_Text, i, \"Default\")\n\t\t//subtitles := SubtitlesInfo{Format: Format, CodecID: CodecID, Title: Title}\n\t\tglog.Infof(\"GetMediaInfo subtitles.StreamID:%d, subtitles.Format:%s, subtitles.CodecID:%s, subtitles.Title:%s, subtitles.Language:%s, subtitles.Default:%s\\n\", subtitles.StreamID, subtitles.Format, subtitles.CodecID, subtitles.Title, subtitles.Language, subtitles.Default)\n\t\tinfo.Subtitles = append(info.Subtitles, subtitles)\n\t\t//subtitles := SubtitlesInfo{Format: Format, CodecID: CodecID, Title: Title}\n\t\t//info.Subtitles = append(info.Subtitles, subtitles)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "7212865d2901924f503522ae5b16740b", "score": "0.3828119", "text": "func (a *Activities) GetMediaURLsActivity(ctx context.Context, deviceID string) ([]string, error) {\n\tlogger := activity.GetLogger(ctx)\n\tVendorAPIMediaURLsPath := fmt.Sprintf(a.VendorAPIMediaURLsTemplate, deviceID)\n\tresp, err := http.Get(VendorAPIMediaURLsPath)\n\tif err != nil {\n\t\tlogger.Error(\"http err calling vendor API for status\", \"endpoint\", VendorAPIMediaURLsPath)\n\t\treturn []string{}, err\n\t}\n\tdefer resp.Body.Close()\n\n\tbodyBytes, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlogger.Error(\"ioutil err reading mediastatus response\", \"endpoint\", VendorAPIMediaURLsPath)\n\t\treturn []string{}, err\n\t}\n\tvar urls MediaURLs\n\tjson.Unmarshal(bodyBytes, &urls)\n\n\treturn urls.Links, nil\n}", "title": "" }, { "docid": "752220988c061a8eaf894e3535d718d0", "score": "0.38243103", "text": "func ConvertQueries(request *http.Request, queries []query.Query) []*app.Query {\n\tvar ls = []*app.Query{}\n\tfor _, q := range queries {\n\t\tls = append(ls, ConvertQuery(request, q))\n\t}\n\treturn ls\n}", "title": "" }, { "docid": "dcd0ae09befbb53f59542f23ae59ec0c", "score": "0.3820076", "text": "func GetSupportedLocales() map[string]*i18n.Localizer {\n\treturn localizers\n}", "title": "" }, { "docid": "664b11c0932c64fb07afaf9a667e5f6c", "score": "0.38175863", "text": "func (m *Room) GetDevices() (val []*def.Header, set bool) {\n\tif m.Devices == nil {\n\t\treturn\n\t}\n\n\treturn m.Devices, true\n}", "title": "" }, { "docid": "6ba0e03518e259f4bf5dd17ecbbae628", "score": "0.38157746", "text": "func GetMiddlewares(name string) []gin.HandlerFunc {\n\treturn middlewarelist[name]\n}", "title": "" }, { "docid": "18514c61a0f7ce26d6ee09e2d7e89bf9", "score": "0.380679", "text": "func (c *Context) GetAttachedShaders(program *js.Value) []*js.Value {\n\tobjs := c.Object.Call(\"getAttachedShaders\", program)\n\tshaders := make([]*js.Value, objs.Length())\n\tfor i := 0; i < objs.Length(); i++ {\n\t\tz := objs.Index(i)\n\t\tshaders[i] = &z\n\t}\n\treturn shaders\n}", "title": "" }, { "docid": "fe0c57aad4072f9b3793248dbd360b5c", "score": "0.38056186", "text": "func (api InstagramAPI) Media(mediaId string) Image {\n\tparams := getEmptyMap()\n\tresponse := api.DoRequest(\"media/\" + mediaId, params)\n\treturn ImageFromAPI(response.Object(\"data\"))\n}", "title": "" }, { "docid": "b12d16e1406e4a2efa45691eaf6ac307", "score": "0.38048717", "text": "func (mp *memPlugin) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error) {\n\terr := mp.setProcPath(cfg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmetricTypes := []plugin.MetricType{}\n\tmetrics := &MemMetrics{}\n\tnamespaces := []string{}\n\tns.FromCompositionTags(metrics, strings.Join([]string{pluginVendor, fs, pluginName}, \"/\"), &namespaces)\n\tfor _, namespace := range namespaces {\n\t\tmetric := plugin.MetricType{\n\t\t\tNamespace_: core.NewNamespace(strings.Split(namespace, \"/\")...),\n\t\t\tConfig_: cfg.ConfigDataNode,\n\t\t}\n\t\tmetricTypes = append(metricTypes, metric)\n\t}\n\treturn metricTypes, nil\n}", "title": "" }, { "docid": "a2d38952a8e89813c49bbeccedcc443d", "score": "0.38038358", "text": "func (service *MediaService) Get(media_id string) (response *Media, err error) {\n\treq, err := service.client.NewRequest(\"GET\", nil, \"Media/%s\", media_id)\n\tif err != nil {\n\t\treturn\n\t}\n\tresp := &Media{}\n\terr = service.client.ExecuteRequest(req, resp)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "d40596d44c54cceecd37e12573a4989a", "score": "0.38028285", "text": "func (dc *DecodeContext) GetMetrics() []telegraf.Metric {\n\treturn dc.metrics\n}", "title": "" } ]
ccc20dabf9a02f24125c3e6862c92a3f
TableName overrides the default tablename generated by GORM
[ { "docid": "a9d8dcd5c13158da313b62b19b6217d3", "score": "0.686324", "text": "func (ServiceApplicationFileORM) TableName() string {\n\treturn \"service_application_files\"\n}", "title": "" } ]
[ { "docid": "e59e33ec79bd84af58a21bd07c424a97", "score": "0.7525928", "text": "func gormTableName(s string) string {\n\tvar tableName string\n\n\ttableName = strings.ToLower(s)\n\ttableName = inflector.Singularize(tableName)\n\ttableName = snaker.SnakeToCamel(tableName)\n\n\treturn strings.Title(tableName)\n}", "title": "" }, { "docid": "fe338205ae7dfd7fddc492bf3a74186b", "score": "0.7336395", "text": "func (ServiceORM) TableName() string {\n\treturn \"services\"\n}", "title": "" }, { "docid": "1980804f541734cc3e7046af43c6ed1c", "score": "0.7258787", "text": "func (i *CustomDbNamingStrategy) TableName(str string) string {\n\tvar tableName string\n\tif i.SingularTable {\n\t\ttableName = i.TablePrefix + i.toDBName(str)\n\t} else {\n\t\ttableName = i.TablePrefix + inflection.Plural(i.toDBName(str))\n\t}\n\t// 去掉表名中的_entity,然后转成大写\n\treturn strings.ToUpper(strings.ReplaceAll(tableName, \"_entity\", \"\"))\n}", "title": "" }, { "docid": "b12e92fced3127358a4b2d6e70ea3db8", "score": "0.7223055", "text": "func (ServiceDetailsORM) TableName() string {\n\treturn \"service_details\"\n}", "title": "" }, { "docid": "1e5daf494ddfdfa4b00f4372159848aa", "score": "0.72118676", "text": "func (u *Account) TableName() string {\n\tconst ormTableName = \"accounts\"\n\treturn ormTableName\n}", "title": "" }, { "docid": "7d1d2fd5e9975aade6e38cb5765df657", "score": "0.7144124", "text": "func (ServiceProviderORM) TableName() string {\n\treturn \"service_providers\"\n}", "title": "" }, { "docid": "0e55b0f71626c7b43a9dabce160b58e7", "score": "0.71437764", "text": "func (receiver *Base) GenerateTableName(model extension.Model, db *gorm.DB) string {\n\treturn db.NewScope(model).TableName()\n}", "title": "" }, { "docid": "6aa4124a9c0a67e46133766919e9b043", "score": "0.7108728", "text": "func (ServiceApplicationORM) TableName() string {\n\treturn \"service_applications\"\n}", "title": "" }, { "docid": "17adeba994a86e55aa98a249b83ec558", "score": "0.7104075", "text": "func (ServiceEmploymentORM) TableName() string {\n\treturn \"service_employments\"\n}", "title": "" }, { "docid": "65fad904be329a837e3c27d05fe7ac3e", "score": "0.7103837", "text": "func (entity *CustomizedTablenameAndSchema) TableName() string {\n\treturn \"my_custom_name\"\n}", "title": "" }, { "docid": "23f61d12aa64f6ac70d2ca431d720605", "score": "0.70965093", "text": "func (ExampleORM) TableName() string {\n\treturn \"examples\"\n}", "title": "" }, { "docid": "eb91eb7a67e39338ad0181a89c333300", "score": "0.706665", "text": "func (r *Rule) TableName() string {\n\tconst ormTableName = \"rules\"\n\treturn ormTableName\n}", "title": "" }, { "docid": "378b71559168ed730cf2281108237447", "score": "0.7044231", "text": "func (a *Application) TableName() string {\n\treturn tableNamePrefix + \"application\"\n}", "title": "" }, { "docid": "c0c1049f00811f45e7495c0dfbd25f4f", "score": "0.7032144", "text": "func DefaultTableName(i interface{}) string {\n\treturn strings.ToLower(reflect.TypeOf(reflect.Indirect(reflect.ValueOf(i)).Interface()).Name())\n}", "title": "" }, { "docid": "34a02434a7013a6d8c331b6e1d97837a", "score": "0.7025915", "text": "func (ServiceSessionORM) TableName() string {\n\treturn \"service_sessions\"\n}", "title": "" }, { "docid": "d5336b26a7134c4288dcad0332bb99db", "score": "0.7001318", "text": "func (ServiceTagORM) TableName() string {\n\treturn \"service_tags\"\n}", "title": "" }, { "docid": "ca203f632d10bbefcc6e146cb9e37d43", "score": "0.6972014", "text": "func (m Model) DefaultTableName() string {\n\treturn fwStrings.CamelToSnake(fwStrings.Plural(m.modelName(false)))\n}", "title": "" }, { "docid": "f01ec21d4c63f88df130a796f7ddd984", "score": "0.6953567", "text": "func (u User) TableName() string {\n\treturn \"xx_user_h\"\n}", "title": "" }, { "docid": "54830f3e778ad86ae2f235f6f2b54e7b", "score": "0.69386286", "text": "func (ServiceOfferORM) TableName() string {\n\treturn \"service_offers\"\n}", "title": "" }, { "docid": "b0d9af0382c69cddb71e8c8a55af59c0", "score": "0.6922991", "text": "func (CommentORM) TableName() string {\n\treturn \"comments\"\n}", "title": "" }, { "docid": "386a32384a9273b6983ecac827769857", "score": "0.6916603", "text": "func (ServiceSessionNoteORM) TableName() string {\n\treturn \"service_session_notes\"\n}", "title": "" }, { "docid": "19a10109fc853d88d25256b568e338f2", "score": "0.68990594", "text": "func (a *PaisesGorm) TableName() string {\n\treturn \"app_paises\"\n}", "title": "" }, { "docid": "fd9df8a3b404316383e299df3e629bad", "score": "0.6896193", "text": "func (ProfileORM) TableName() string {\n\treturn \"profiles\"\n}", "title": "" }, { "docid": "2eaea528fa48f402ec58f4d7b1461935", "score": "0.68695873", "text": "func (z *ZonasGorm) TableName() string {\n\treturn \"zonas\"\n}", "title": "" }, { "docid": "28ffc8a93745a3cd5eccc7f7d8af886d", "score": "0.6865421", "text": "func (TagORM) TableName() string {\n\treturn \"tags\"\n}", "title": "" }, { "docid": "2ccd621137561a040b370825d667b50f", "score": "0.68613094", "text": "func (mig Migration) TableName() string {\n\n\treturn \"$migrations\"\n\n}", "title": "" }, { "docid": "d952a8b2fd5a07279320a52d9c561fab", "score": "0.6842365", "text": "func (User) TableName() string {\n\treturn \"user\"\n}", "title": "" }, { "docid": "6f832f2d1e2de2d56ee00246a97a702e", "score": "0.6839735", "text": "func (u User) TableName() string {\n\treturn \"user\"\n}", "title": "" }, { "docid": "6f832f2d1e2de2d56ee00246a97a702e", "score": "0.6839735", "text": "func (u User) TableName() string {\n\treturn \"user\"\n}", "title": "" }, { "docid": "3d1a800ea6afb6c351e3e77cde424aeb", "score": "0.683753", "text": "func SQLTableNameOf(any interface{}) string {\n\tif customTableName, ok := lookupCustomTableName(any); ok {\n\t\treturn customTableName\n\t}\n\n\treturn snakecase.SnakeCase(inflection.Plural(meta.TypeNameOf(any)))\n}", "title": "" }, { "docid": "b08e420ae12ac32a0d06f0ba00564001", "score": "0.6834944", "text": "func (EmailORM) TableName() string {\n\treturn \"emails\"\n}", "title": "" }, { "docid": "f4a43095591603048ce82d3309442d40", "score": "0.68207246", "text": "func (RegionORM) TableName() string {\n\treturn \"regions\"\n}", "title": "" }, { "docid": "20fb295182c65cdd8c788063b983386d", "score": "0.6798879", "text": "func (u User) TableName() string {\n return \"cc_users\"\n}", "title": "" }, { "docid": "61d429ceba7117a83b314d021734b1f8", "score": "0.6792092", "text": "func (Dashboard) TableName() string {\n\treturn TABLE_PREFIX + \"dashboard\"\n}", "title": "" }, { "docid": "10fa330a217e4b0074f475eefd7ae600", "score": "0.67831695", "text": "func (t *Todo) TableName() string {\n\treturn todoTable\n}", "title": "" }, { "docid": "30c7aac8b2c779218bc8ec73bcb93127", "score": "0.6780671", "text": "func (PostORM) TableName() string {\n\treturn \"posts\"\n}", "title": "" }, { "docid": "7995423cf825d5c198556eb8e11cb33f", "score": "0.6779147", "text": "func (td *TodoModel) TableName() string {\n\treturn \"todo\"\n}", "title": "" }, { "docid": "a000eee7906d4f204851d0349e7c461e", "score": "0.6772465", "text": "func (u ApplicationMenu) TableName() string {\n\treturn tablenameApplicationMenu\n}", "title": "" }, { "docid": "562d9a919a5879e22aca3f89db79bc42", "score": "0.6771004", "text": "func (AddressORM) TableName() string {\n\treturn \"addresses\"\n}", "title": "" }, { "docid": "bebf82d99fd601c04e3221f2f7457a13", "score": "0.67678714", "text": "func (model *Actor) TableName() string {\n\treturn ActorTableName\n}", "title": "" }, { "docid": "fab361844ff811a6e74513df54549a13", "score": "0.6763521", "text": "func (m User) TableName() string {\n\treturn \"users\"\n\n}", "title": "" }, { "docid": "421cf3ad3b1c484c83db0534ea66d07a", "score": "0.67569876", "text": "func (u *UsersGorm) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "26b10451cfea2edbadd1c1c2be1044cd", "score": "0.67445916", "text": "func (GroupORM) TableName() string {\n\treturn \"groups\"\n}", "title": "" }, { "docid": "1b440b1b1a4af90efcc70b6faf5ffffe", "score": "0.6717726", "text": "func (ToolORM) TableName() string {\n\treturn \"tools\"\n}", "title": "" }, { "docid": "f4a3d4c0a8dd0435021707778baa49da", "score": "0.671201", "text": "func (s *defaultTweetDummyStore) TableName(num int) string {\n\treturn fmt.Sprintf(\"Tweet%d\", num)\n}", "title": "" }, { "docid": "20098bd2d373369baba00f0726110f09", "score": "0.67018837", "text": "func (t TableName) Table() string {\n\treturn t.Name\n}", "title": "" }, { "docid": "91b20aca26a26811325341ee74beb1f2", "score": "0.67002994", "text": "func (*User) TableName() string {\n\treturn \"user\"\n}", "title": "" }, { "docid": "3a503c897d4ff63fe8b4def112f77aa9", "score": "0.6695974", "text": "func (ChatRoomORM) TableName() string {\n\treturn \"chat_rooms\"\n}", "title": "" }, { "docid": "2e03cc9ae90b7a9dd5b495126ac03aac", "score": "0.66904265", "text": "func (self *Article) TableName() string {\n\treturn \"article\"\n\t//if t := reflect.TypeOf(self); t.Kind() == reflect.Ptr {\n\t//\treturn strings.ToLower(t.Elem().Name())\n\t//} else {\n\t//\treturn strings.ToLower(t.Name())\n\t//}\n}", "title": "" }, { "docid": "288360ad9dc569239872350dacc0d057", "score": "0.66824704", "text": "func (m MineInvitepowadd) TableName() string", "title": "" }, { "docid": "854530f326cc47379812f5655bc9ea0b", "score": "0.6670578", "text": "func (set *DBSet) TableName() string {\n\treturn set.tableName\n}", "title": "" }, { "docid": "2341b63eef1fa3d3f9f1b834e5d1874d", "score": "0.6668117", "text": "func (p *User) TableName() string {\n\treturn UserTableName\n}", "title": "" }, { "docid": "f1348f146e42c047364d49652ce57649", "score": "0.66648245", "text": "func (dao *DaoSymbol) getTableName() string {\n\tif TestMode {\n\t\treturn TblNameSymbol + \"_test\"\n\t}\n\treturn TblNameSymbol\n}", "title": "" }, { "docid": "382b592107d8ea19a7698092a61fc172", "score": "0.6650783", "text": "func (m User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "215ecffe6582c48f093020637cc2e71a", "score": "0.6649872", "text": "func (g GormPrivateKey) TableName() string {\n\treturn \"private_keys\"\n}", "title": "" }, { "docid": "a99d1161011a4b57c7ec8c0f23588035", "score": "0.6648487", "text": "func (a *ActorDAL) TableName() string {\n\treturn \"actor\"\n}", "title": "" }, { "docid": "cacbda04453df962e7d8a5cb042e827f", "score": "0.66392404", "text": "func (ContactORM) TableName() string {\n\treturn \"contacts\"\n}", "title": "" }, { "docid": "f1525de5a56aa34eb065d5eb4dd6381e", "score": "0.6636246", "text": "func (ServiceSessionEvaluationORM) TableName() string {\n\treturn \"service_session_evaluations\"\n}", "title": "" }, { "docid": "61c5f8c5371d2d75611fe813c5ef4d3a", "score": "0.66294813", "text": "func (t *SonarqubeProject) TableName() string {\n\treturn SonarqubeProjectTableName\n}", "title": "" }, { "docid": "b7edd8e17062dbd92756f75b09d36ed3", "score": "0.66278815", "text": "func (model *Product) TableName() string {\n\treturn ProductTableName\n}", "title": "" }, { "docid": "8c4fed1d72df75aef018c87f09f0422d", "score": "0.6624362", "text": "func (u *User) TableName() string {\n\treturn \"tbl_user\"\n}", "title": "" }, { "docid": "188aa8961f5439f8c4dd2a821098016c", "score": "0.6622033", "text": "func (Audit) TableName() string {\n\treturn \"audit\"\n}", "title": "" }, { "docid": "1a9cb4be8ad1d2bf37342aed4270311e", "score": "0.66167325", "text": "func (user *User) TableName() string {\n\treturn \"user\"\n}", "title": "" }, { "docid": "33e30bd740c3874a164aed8ed970be6d", "score": "0.66010815", "text": "func (IntPointORM) TableName() string {\n\treturn \"int_points\"\n}", "title": "" }, { "docid": "17c52fcd1948452ca607399e5cc38cbc", "score": "0.6592989", "text": "func (l *LanguageDAL) TableName() string {\n\treturn \"language\"\n}", "title": "" }, { "docid": "6313a36f137fa3f5f67ceb6810b00fe4", "score": "0.6584762", "text": "func (notificationModel) TableName() string {\n\treturn notificationTableName\n}", "title": "" }, { "docid": "5118bb3b02f4b496e533773530c3f9f9", "score": "0.656427", "text": "func (s Server) TableName() string {\n\treturn \"server\"\n}", "title": "" }, { "docid": "321fc094aca16ad59c9693516cd45820", "score": "0.6560468", "text": "func (s *SancionesEquiposGorm) TableName() string {\n\treturn \"sanciones_equipos\"\n}", "title": "" }, { "docid": "d038f499d4fdcaf3783f7a2432fc95b8", "score": "0.6560284", "text": "func (*UserModel) TableName() string {\n\treturn UsersTable\n}", "title": "" }, { "docid": "f6f9dd1f8764ef04ba246b55c783c639", "score": "0.65602744", "text": "func (u User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "f6f9dd1f8764ef04ba246b55c783c639", "score": "0.65602744", "text": "func (u User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "5fbf49877eeaec3268317a91db8670df", "score": "0.6556634", "text": "func (ChatMessageORM) TableName() string {\n\treturn \"chat_messages\"\n}", "title": "" }, { "docid": "f5b2eb11f4bafaa42e9bcbfa82dff31b", "score": "0.65546805", "text": "func (Video) TableName() string {\n\treturn VideoTable\n}", "title": "" }, { "docid": "11d01de2cf703240836dfecea76dc786", "score": "0.65507364", "text": "func (g Key) TableName() string {\n\treturn \"timestamp_keys\"\n}", "title": "" }, { "docid": "92ad2a1ec60670696ceade7a24a1f371", "score": "0.65424836", "text": "func (e Entity) TableName() string {\n\treturn \"tour_spot\"\n}", "title": "" }, { "docid": "ae5a311365314277cce94df3c2be01c5", "score": "0.6541419", "text": "func (pm PeopleManga) TableName() string {\n\treturn \"people_manga\"\n}", "title": "" }, { "docid": "4eb0620bb4c205421a2a36b3687e3832", "score": "0.65410846", "text": "func (u Box) TableName() string {\n return \"mika_boxes\"\n}", "title": "" }, { "docid": "14aa1cea17c00d4b65c763f0065d5e59", "score": "0.6521352", "text": "func (ModelEmployee) TableName() string {\n\treturn \"tbl_employee\"\n}", "title": "" }, { "docid": "edd423c401707cf5af770df81ed8b14e", "score": "0.65208614", "text": "func (User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "edd423c401707cf5af770df81ed8b14e", "score": "0.65208614", "text": "func (User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "edd423c401707cf5af770df81ed8b14e", "score": "0.65208614", "text": "func (User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "edd423c401707cf5af770df81ed8b14e", "score": "0.65208614", "text": "func (User) TableName() string {\n\treturn \"users\"\n}", "title": "" }, { "docid": "7687a4174a629c0e865e9221010a1b71", "score": "0.6517684", "text": "func (p *Person) TableName() string {\n\treturn \"person\"\n}", "title": "" }, { "docid": "b17a9a65ab4702b2613649e2ba2d2613", "score": "0.6514782", "text": "func (NotificationModel) TableName() string {\n\treturn notificationTableName\n}", "title": "" }, { "docid": "e0e0846db3d4c661bccd521f8fc3bff2", "score": "0.651468", "text": "func (dao *DaoStockData) getTableName() string {\n\tif TestMode {\n\t\treturn TblNameStockData + \"_test\"\n\t}\n\treturn TblNameStockData\n}", "title": "" }, { "docid": "77efe0e24431e6071b8a81290b8225c8", "score": "0.65138966", "text": "func (ChatRoomParticipantORM) TableName() string {\n\treturn \"chat_room_participants\"\n}", "title": "" }, { "docid": "114b36a3d56d846f364335f248173ca0", "score": "0.65059334", "text": "func (a *ApplicationComponent) TableName() string {\n\treturn tableNamePrefix + \"application_component\"\n}", "title": "" }, { "docid": "400a3dd0957ee2a273dc842e596a4e82", "score": "0.65030825", "text": "func (GkLang) TableName() string {\n\treturn \"gk_lang\"\n}", "title": "" }, { "docid": "9b7b7d2a4d7d3774f1a451cdb26f1878", "score": "0.64769185", "text": "func (Entity) TableName() string {\n\treturn \"profile\"\n}", "title": "" }, { "docid": "381ed044a842957ecb15d1112daed296", "score": "0.64734626", "text": "func (t *Test) TableName() string {\n\treturn \"tests\"\n}", "title": "" }, { "docid": "a2ea2495e225dde1dfd3b2f0e4258452", "score": "0.6472696", "text": "func (m *GormResourceTypeRepository) TableName() string {\n\treturn \"resource_type\"\n}", "title": "" }, { "docid": "6eae4d8d1e148fc203c57fe51c254732", "score": "0.64699036", "text": "func (*LocationModel) TableName() string {\n\treturn LocationsTable\n}", "title": "" }, { "docid": "0456b5e08042520df255e345499c9f02", "score": "0.64695835", "text": "func (p *Project) TableName() string {\n\treturn \"project\"\n}", "title": "" }, { "docid": "546841abb74f34d463b8f382373c4aed", "score": "0.646694", "text": "func (recordFile) TableName() string {\n\treturn tableNameRecordFile\n}", "title": "" }, { "docid": "21bb69f3dd44eb5d1234b673233fa3d7", "score": "0.6461262", "text": "func (m *ExternalPlace) TableName() string {\n\treturn \"external_place\"\n}", "title": "" }, { "docid": "183e694b41e6ba3875681500e654f823", "score": "0.6459748", "text": "func (*EEmployee) TableName() string {\n\treturn TableNameEEmployee\n}", "title": "" }, { "docid": "81a0463ff712a77318625b5bad5d664a", "score": "0.64500475", "text": "func (rulesetup *Rulesetup) TableName() string {\n\treturn \"ljl_rulesetup\"\n}", "title": "" }, { "docid": "9c6f458c96564141f1e28a7f41fc30f6", "score": "0.64494526", "text": "func (People) TableName() string {\n\treturn \"people\"\n}", "title": "" }, { "docid": "0bc32b3d53561133ff41cf6c7b587a91", "score": "0.6446293", "text": "func (c *comment) TableName() string {\n return \"party_comment\"\n}", "title": "" }, { "docid": "1d66304b1ec97630dff025a5f269be9e", "score": "0.6444923", "text": "func (m *UserDB) TableName() string {\n\treturn \"users\"\n\n}", "title": "" } ]
0793f27a11b4fe6cdfb201e52d96b0eb
WithTx creates a new DBQuerier that uses the transaction to run all queries.
[ { "docid": "c288ddcc1c87018a8fe0d0941421ee2c", "score": "0.86526424", "text": "func (q *DBQuerier) WithTx(tx pgx.Tx) (*DBQuerier, error) {\n\treturn &DBQuerier{conn: tx}, nil\n}", "title": "" } ]
[ { "docid": "f88f586f2f44555146bf03b75f71b0da", "score": "0.78428674", "text": "func (r *tx) withTx(sqlTx *sql.Tx) Tx {\n\treturn &tx{\n\t\tdb: sqlTx,\n\t}\n}", "title": "" }, { "docid": "2458982064aeb4e9e2750b388c943bd2", "score": "0.75945425", "text": "func WithTx(f func(ctx DBContext) error) error {\n\tsess := x.NewSession()\n\tif err := sess.Begin(); err != nil {\n\t\tsess.Close()\n\t\treturn err\n\t}\n\n\tif err := f(DBContext{sess}); err != nil {\n\t\tsess.Close()\n\t\treturn err\n\t}\n\n\terr := sess.Commit()\n\tsess.Close()\n\treturn err\n}", "title": "" }, { "docid": "43ac863be3a0a5ce6184d6db495a5348", "score": "0.7376345", "text": "func WithTx(f func(db *gorm.DB) error) error {\n\ttx := DB().Begin()\n\tif tx.Error != nil {\n\t\treturn tx.Error\n\t}\n\n\tif err := f(tx); err != nil {\n\t\tif err := tx.Rollback().Error; err != nil {\n\t\t\tlogrus.Errorf(\"Failed to rollback DB transaction: %v\", err)\n\t\t}\n\n\t\treturn err\n\t}\n\n\treturn tx.Commit().Error\n}", "title": "" }, { "docid": "f665775339fa2f5c8894788eadb82d99", "score": "0.7226246", "text": "func WithTx(ctx context.Context, db *pachsql.DB, cb func(cbCtx context.Context, tx *pachsql.Tx) error, opts ...WithTxOption) error {\n\tbackoffStrategy := backoff.NewExponentialBackOff()\n\tbackoffStrategy.InitialInterval = 1 * time.Millisecond\n\tbackoffStrategy.MaxElapsedTime = 0\n\tbackoffStrategy.Multiplier = 1.05\n\tc := &withTxConfig{\n\t\tTxOptions: sql.TxOptions{\n\t\t\tIsolation: sql.LevelSerializable,\n\t\t},\n\t\tBackOff: backoffStrategy,\n\t}\n\tfor _, opt := range opts {\n\t\topt(c)\n\t}\n\n\tvar attempts int\n\tvar outcome string\n\tstart := time.Now()\n\tdefer func() {\n\t\ttxFinishedMetric.WithLabelValues(outcome).Inc()\n\t\ttxDurationMetric.WithLabelValues(outcome).Observe(time.Since(start).Seconds())\n\t\ttriesPerTxMetric.WithLabelValues(outcome).Observe(float64(attempts))\n\t}()\n\n\ttxStartedMetric.Inc()\n\terr := backoff.RetryUntilCancel(ctx, func() error {\n\t\tctx, cf := pctx.WithCancel(ctx)\n\t\tdefer cf()\n\t\tunderlyingTxStartedMetric.Inc()\n\t\tattempts++\n\t\ttx, err := db.BeginTxx(ctx, &c.TxOptions)\n\t\tif err != nil {\n\t\t\tunderlyingTxFinishMetric.WithLabelValues(\"failed_start\").Inc()\n\t\t\treturn errors.EnsureStack(err)\n\t\t}\n\t\treturn tryTxFunc(ctx, tx, cb)\n\t}, c.BackOff, func(err error, _ time.Duration) error {\n\t\tif errutil.IsDatabaseDisconnect(err) {\n\t\t\tlog.Info(ctx, \"retrying transaction following retryable error\", zap.Error(err))\n\t\t\treturn nil\n\t\t}\n\t\tif isTransactionError(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t})\n\tif err != nil {\n\t\t// Inspecting err could yield a better outcome type than \"error\", but some care is\n\t\t// needed. For example, `cb` could return \"context deadline exceeded\" because it\n\t\t// created a sub-context that expires, and that's a different error than 'commit'\n\t\t// failing because the deadline expired during commit. But we can't know that here\n\t\t// without extra annotations on the error.\n\t\toutcome = \"error\"\n\t\tif errors.Is(err, sql.ErrTxDone) {\n\t\t\toutcome += \"_txdone\"\n\t\t}\n\t\treturn err\n\t}\n\toutcome = \"ok\"\n\treturn nil\n}", "title": "" }, { "docid": "5c29d7ae9041a09c4351ff6f231fa500", "score": "0.68129", "text": "func withTx(dbOrTx interface{}, f txFunc) (err error) {\n\tvar tx *sql.Tx\n\n\tswitch t := dbOrTx.(type) {\n\tcase *sql.Tx:\n\t\ttx = t\n\tcase *sql.DB:\n\t\ttx, err = t.Begin()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif p := recover(); p != nil {\n\t\t\t\tif rollBackError := tx.Rollback(); rollBackError != nil {\n\t\t\t\t\tlog.Error(\"failed to rollback tx on panic - \", rollBackError)\n\t\t\t\t}\n\t\t\t\tpanic(p)\n\t\t\t} else if err != nil {\n\t\t\t\tif rollBackError := tx.Rollback(); rollBackError != nil {\n\t\t\t\t\tlog.Error(\"failed to rollback tx on panic - \", rollBackError)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terr = errors.Err(tx.Commit())\n\t\t\t}\n\t\t}()\n\tdefault:\n\t\treturn errors.Err(\"db or tx required\")\n\t}\n\n\treturn f(tx)\n}", "title": "" }, { "docid": "94e71ad2c5b0276a59cef177284869bb", "score": "0.67817914", "text": "func NewTx(t *testing.T) *sql.Tx {\n\tt.Helper()\n\n\tif testing.Short() {\n\t\tt.Skip(\"sqltest: no DB in short mode\")\n\t}\n\n\ttx, err := getDB(t).Begin()\n\tif err != nil {\n\t\tt.Fatal(\"sqltest: transaction launch:\", err)\n\t}\n\tt.Cleanup(func() {\n\t\tif err := tx.Rollback(); err != nil {\n\t\t\tt.Error(\"sqltest: automatic rollback:\", err)\n\t\t}\n\t})\n\treturn tx\n}", "title": "" }, { "docid": "2839ecb3607d807a064817e89679e33a", "score": "0.66643375", "text": "func NewTx(sqlTx *sql.Tx) (sqlbuilder.Tx, error) {\r\n\td := newDatabase(nil)\r\n\r\n\t// Binding with sqladapter's logic.\r\n\td.BaseDatabase = sqladapter.NewBaseDatabase(d)\r\n\r\n\t// Binding with sqlbuilder.\r\n\td.SQLBuilder = sqlbuilder.WithSession(d.BaseDatabase, template)\r\n\r\n\tif err := d.BaseDatabase.BindTx(d.Context(), sqlTx); err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\tnewTx := sqladapter.NewDatabaseTx(d)\r\n\treturn &tx{DatabaseTx: newTx}, nil\r\n}", "title": "" }, { "docid": "bb2b66b5c64c49d01d3fc1b621ecbb93", "score": "0.6656854", "text": "func WithTransaction(ctx context.Context, trx TransactionDB, trxFunc func(dbCtx context.Context) error) error {\n\tdbCtx, err := trx.BeginTransaction(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\tif p := recover(); p != nil {\n\t\t\terr = trx.RollbackTransaction(dbCtx)\n\t\t\tpanic(p)\n\n\t\t} else if err != nil {\n\t\t\terr = trx.RollbackTransaction(dbCtx)\n\n\t\t} else {\n\t\t\terr = trx.CommitTransaction(dbCtx)\n\n\t\t}\n\t}()\n\n\terr = trxFunc(dbCtx)\n\treturn err\n}", "title": "" }, { "docid": "c16cc025ac2bf9584d584de1e08fb50a", "score": "0.6629054", "text": "func WithTransaction(ctx context.Context, opt *sql.TxOptions, db TxxI, fn ...TxFn) error {\n\ttx, err := db.BeginTxx(ctx, opt)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"[WithTransaction] %w\", err)\n\t}\n\n\t// function used for panic control (defer inside)\n\tfunc() {\n\t\tdefer func() {\n\t\t\tif p := recover(); p != nil {\n\t\t\t\tif tx.Tx == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// a library panic occurred, rollback and repanic\n\t\t\t\terrR := tx.Rollback()\n\t\t\t\terr = fmt.Errorf(\"panic [WithTransaction]: %v. --> Rollback error: %v, %w\", p, errR, err)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// something went wrong when, rollback\n\t\t\t// err!=nil when ctx is canceled\n\t\t\tif err != nil {\n\t\t\t\tif tx.Tx == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\terrR := tx.Rollback()\n\t\t\t\terr = fmt.Errorf(\"err while Rollback. error: %v, %w\", errR, err)\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// all good, commit\n\t\t\terr = tx.Commit()\n\t\t}()\n\n\t\tfor _, f := range fn {\n\t\t\terr = f(tx)\n\t\t\tif err != nil {\n\t\t\t\tbreak // break loop, rollback in defer @see up\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn err\n}", "title": "" }, { "docid": "25cbc9a9cb89174b0331fac562b3b53e", "score": "0.66014004", "text": "func (wrap *Wrapper) BeginTx() *pg.Tx {\n\ttx, err := wrap.db.Begin()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn tx\n}", "title": "" }, { "docid": "848bcdcff9df7d12e7b9a6b5ae7513bb", "score": "0.6597502", "text": "func (d *database) Tx(ctx context.Context, fn func(tx sqlbuilder.Tx) error) error {\r\n\treturn sqladapter.RunTx(d, ctx, fn)\r\n}", "title": "" }, { "docid": "44d60db2fca9a92ec8c11514a5d74155", "score": "0.6517589", "text": "func WithTransaction(db *sql.DB, fn func(txn *sql.Tx) error) (err error) {\n\ttxn, err := db.Begin()\n\tif err != nil {\n\t\treturn\n\t}\n\tsucceeded := false\n\tdefer EndTransaction(txn, &succeeded)\n\n\terr = fn(txn)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tsucceeded = true\n\treturn\n}", "title": "" }, { "docid": "4fc63c5b232ca532876226cfa0d20bda", "score": "0.6514899", "text": "func (tx *txDriver) Tx(context.Context) (dialect.Tx, error) { return tx, nil }", "title": "" }, { "docid": "6e0192c80473956312190cebe1370c7f", "score": "0.64765626", "text": "func (db *DB) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error) {}", "title": "" }, { "docid": "c4922ed42ba8431bd61aeab3d3910888", "score": "0.64070016", "text": "func (store *SQLStore) execTx(ctx context.Context, fn func(*Queries) error) error {\n\ttx, err := store.db.BeginTx(ctx, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tq := New(tx)\n\terr = fn(q)\n\tif err != nil {\n\t\tif rbErr := tx.Rollback(); rbErr != nil {\n\t\t\treturn fmt.Errorf(\"tx err: %v, rb err: %v\", err, rbErr)\n\t\t}\n\t\treturn err\n\t}\n\treturn tx.Commit()\n}", "title": "" }, { "docid": "18c6081a83752866c197c4f515b53c4f", "score": "0.63914746", "text": "func (db *DB) With(fn func(*Transaction) error) error {\n\tt, err := db.Transaction()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer t.Close()\n\n\t// If an error is returned from the function then pass it through.\n\treturn fn(t)\n}", "title": "" }, { "docid": "1c1131cf55bc78228f9e8db019181d56", "score": "0.6342494", "text": "func (s *RouteStore) WithTx(tx *dataprovider.Tx) dataprovider.RouteStore {\n\treturn &RouteStore{\n\t\tdb: tx,\n\t\ttableName: s.tableName,\n\t}\n}", "title": "" }, { "docid": "1fba5b804f70be58311fbe7666bc4b8f", "score": "0.6339765", "text": "func (d *database) NewTx(ctx context.Context) (sqlbuilder.Tx, error) {\r\n\tif ctx == nil {\r\n\t\tctx = d.Context()\r\n\t}\r\n\tnTx, err := d.NewDatabaseTx(ctx)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &tx{DatabaseTx: nTx}, nil\r\n}", "title": "" }, { "docid": "fd819d0c5c2545167bd10ca8ac056788", "score": "0.6334818", "text": "func Tx() (*sql.Tx, error) {\n\treturn DB.Begin()\n}", "title": "" }, { "docid": "3e11d895d17165bfd3219f5515e275fb", "score": "0.63097036", "text": "func (s *Store) Transaction(ctx context.Context, txOpts *sql.TxOptions) (_ *sql.Tx, err error) {\n\tif s.txn == nil {\n\t\ts.txn, err = s.SQLiteDB.BeginTx(ctx, txOpts)\n\t}\n\treturn s.txn, err\n}", "title": "" }, { "docid": "6264afeffb12ba467a974e573748102c", "score": "0.6291192", "text": "func (m *DbMap) WithTX(fn func(tx *Transaction, dq *utils.DeferQueue) error) error {\n\tvar dq utils.DeferQueue\n\ttx, err := m.Begin(10 * time.Second)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\trecoverErr := recover()\n\t\tif recoverErr != nil {\n\t\t\ttx.Rollback()\n\t\t\tpanic(recoverErr)\n\t\t}\n\t}()\n\n\terr = fn(tx, &dq)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn err\n\t}\n\tdq.Fire()\n\n\treturn nil\n}", "title": "" }, { "docid": "4f986ee11588cd409925f92d0568c08c", "score": "0.6280094", "text": "func (pg *PostgresRepository) Tx(ctx context.Context) (nero.Tx, error) {\n\treturn pg.db.BeginTx(ctx, nil)\n}", "title": "" }, { "docid": "10cde16065f31b68f0bcb688704a2074", "score": "0.62685174", "text": "func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\ttx, err := db.sqlDB.BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Tx{db.newBuilder(tx), tx}, nil\n}", "title": "" }, { "docid": "0ecee342636c01f2cc69a9febbb08127", "score": "0.6222568", "text": "func NewTx(db *sql.DB, timeout time.Duration) (*sql.Tx, error) {\n\t// The channels has size of 1 (buffered) to avoid keeping an unnecessary goroutine blocked in\n\t// memory. For example: a goroutine is spawn, and it returns via channel a new transaction or\n\t// an error. After spawning a goroutine the program blocks in the select statement waiting\n\t// until the first channel message. In case of a timeout message, the spawned goroutine will\n\t// put a message in one of this two channels (ch and chErr) and simply returns (die), the\n\t// program don't care about the messages, because it has already timed out. If the channels\n\t// were not buffered the goroutine would be blocked trying to put a message into the channel\n\t// until the program dies.\n\tch := make(chan *sql.Tx, 1)\n\tchErr := make(chan error, 1)\n\n\tgo func() {\n\t\ttx, err := db.Begin()\n\t\tif err != nil {\n\t\t\tchErr <- err\n\t\t\treturn\n\t\t}\n\n\t\tch <- tx\n\t}()\n\n\tselect {\n\tcase tx := <-ch:\n\t\treturn tx, nil\n\tcase err := <-chErr:\n\t\treturn nil, err\n\tcase <-time.After(timeout):\n\t\treturn nil, ErrNewTxTimedOut\n\t}\n}", "title": "" }, { "docid": "25b6a4d24b8e929a83c0e59c64d3877a", "score": "0.6210641", "text": "func ExecInTx(\n\tdb *sql.DB,\n\tinitFn func(*sql.Tx) error,\n\ttxFn func(*sql.Tx) (interface{}, error),\n) (ret interface{}, err error) {\n\ttx, err := db.Begin()\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\tswitch err {\n\t\tcase nil:\n\t\t\terr = tx.Commit()\n\t\tdefault:\n\t\t\tif rollbackErr := tx.Rollback(); rollbackErr != nil {\n\t\t\t\terr = fmt.Errorf(\"%s; tx rollback error: %s\", err, rollbackErr)\n\t\t\t}\n\t\t}\n\t}()\n\n\terr = initFn(tx)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tret, err = txFn(tx)\n\treturn\n}", "title": "" }, { "docid": "5544841add8701c24276d721aaff2468", "score": "0.6192559", "text": "func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) {\n\ttx, err := drv.Tx(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &txDriver{tx: tx, drv: drv}, nil\n}", "title": "" }, { "docid": "0e01f0d8dd8f1709c3fb7ac89da31aaa", "score": "0.61769944", "text": "func (r *rbfDBQueryContexts) writeTx(rq *rbfQueryContext) (*rbfTxWrappers, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tok := r.lockCheck.TryLock()\n\tif !ok {\n\t\treturn nil, errors.New(\"locking error: tried for write Tx when it was already held\")\n\t}\n\ttx, err := r.db.Begin(true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tq := &rbfTxWrappers{db: r, tx: tx, key: r.key, queries: make(map[fragKey]QueryRead), writeTx: true}\n\tr.queryContexts[q] = rq\n\treturn q, nil\n}", "title": "" }, { "docid": "552774c5eb8804898cfa796a5b64091b", "score": "0.6099226", "text": "func StartTx(ctx context.Context, db *sqlx.DB) (*sqlx.Tx, context.Context, error) {\n\ttx, err := db.BeginTxx(ctx, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn tx, WithTransaction(ctx, tx), nil\n}", "title": "" }, { "docid": "c1913fde05b834bdf6e9fa92da454d76", "score": "0.6083377", "text": "func (dbc *Connection) QueryInTx(statement string, tx *sql.Tx, args ...interface{}) (result *Query) {\n\treturn dbc.Invoke(tx).Query(statement, args...)\n}", "title": "" }, { "docid": "ad8cb2e3c4ba111667573d4889356b73", "score": "0.6072948", "text": "func (d *dumper) newTx() *sql.Tx {\n\n\ttx, err := d.db.Begin()\n\n\tif err != nil {\n\t\tzap.S().Fatal(\"Could not begin new transaction: %s\", err)\n\t}\n\n\tquery := fmt.Sprintf(\"SET tidb_snapshot = '%s', tidb_force_priority = 'low_priority'\", d.cfg.TidbSnapshot)\n\t_, err = tx.Exec(query)\n\n\tif err != nil {\n\t\tzap.S().Fatalf(\"Could not set tidb_snapshot: %s\", err)\n\t}\n\n\treturn tx\n\n}", "title": "" }, { "docid": "ea8f62c7f831601753e3d39c6cbf2c58", "score": "0.6061409", "text": "func (t *transactioner) beginTx(_ context.Context) error {\n\ttx, err := t.Config.DB.BeginTxx(t.ctx, txOptionsReadUncommitted)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"(*transactioner).beginTx: begin transaction\")\n\t}\n\n\tt.tx, t.txQueryCount = tx, 0\n\n\ttombCtx, cancel := context.WithCancel(t.ctx)\n\tt.cancel = cancel\n\tt.tomb, _ = tomb.WithContext(tombCtx)\n\tt.tomb.Go(t.transactionCommitter)\n\n\treturn nil\n}", "title": "" }, { "docid": "4ee2b1a8a5660d32b6e927b2b6c0636f", "score": "0.6054469", "text": "func (m *DatabaseManager) BeginTx() *gorm.DB {\n\treturn m.db.Begin()\n}", "title": "" }, { "docid": "e54687b24cc1545f7ddbd7450c94b9db", "score": "0.60455656", "text": "func (db *DB) ExecTx(query string, args ...interface{}) (sql.Result, error) {\n\ttx, err := db.db.Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr, err := tx.Exec(query, args...)\n\tif err != nil {\n\t\t_ = tx.Rollback()\n\t\treturn nil, err\n\t}\n\terr = tx.Commit()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r, nil\n}", "title": "" }, { "docid": "07cd5671caa7e914dae598192d7b14a6", "score": "0.6045484", "text": "func WithTransaction(ctx context.Context, tx *sqlx.Tx) context.Context {\n\treturn context.WithValue(ctx, &transactionKey, tx)\n}", "title": "" }, { "docid": "2025b02651892301a13f893ca2ca8766", "score": "0.60398513", "text": "func (db *DB) Wrap(sqlTx *sql.Tx) *Tx {\n\treturn &Tx{db.newBuilder(sqlTx), sqlTx}\n}", "title": "" }, { "docid": "91d2ee2c339ccd7c9665c7c6d9c9da1d", "score": "0.60369104", "text": "func (manager *TransactionerMock) WithTx(ctx context.Context, fn func(context.Context) error) (err error) {\n\treturn fn(ctx)\n}", "title": "" }, { "docid": "7c4e8ebe784704a33fd48ccb408da9d0", "score": "0.6031372", "text": "func (s *SQL) Transaction(ctx context.Context, transactionKey string, f func(tx provider.TX) error) error {\n\treturn runWithSQLAnalyzer(ctx, \"db\", func() error {\n\t\ttx, err := s.db.BeginTx(ctx, &sql.TxOptions{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tadaptedTx := &Tx{tx: tx}\n\t\tif err := f(adaptedTx); err != nil {\n\t\t\t_ = tx.Rollback()\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "199c522543c339d36845745c3ffa8232", "score": "0.60221845", "text": "func (repo *ORMClient) NewWithTransaction() (ClientRepo, error) {\n\tormClient := &ORMClient{db: repo.db.Begin()}\n\terr := ormClient.db.Error\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ormClient, nil\n}", "title": "" }, { "docid": "6b600ad22aec71f184c1d9ced0c877c6", "score": "0.6021515", "text": "func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\ttx, err := db.DB.BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Tx{Tx: tx, db: db}, nil\n}", "title": "" }, { "docid": "584fed69dd8e6018332f6c4a53d9e467", "score": "0.6017752", "text": "func (db *DB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\ttx, err := db.db.BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Return wrapper Tx that includes the transaction start time.\n\treturn &Tx{\n\t\tTx: tx,\n\t\tdb: db,\n\t\tnow: db.Now().UTC().Truncate(time.Second),\n\t}, nil\n}", "title": "" }, { "docid": "0e8ad4e496eb9162280c3b83bfd98552", "score": "0.60159653", "text": "func (f *DB) BeginTx(ctx context.Context) (*Tx, context.Context, error) {\n\t// TODO: Add support to call this function in parallel.\n\n\tif s, ok := GetTx(ctx); ok {\n\t\ts.txCount++\n\t\treturn s, ctx, nil\n\t}\n\n\t// TODO: How to provide transaction options?\n\ttx, err := f.pool.BeginTx(ctx, nil)\n\tif err != nil {\n\t\treturn nil, ctx, err\n\t}\n\n\ts := &Tx{\n\t\toptions: &f.options,\n\t\ttx: tx,\n\t\ttxCount: 1,\n\t\tctx: ctx,\n\t}\n\n\treturn s, context.WithValue(ctx, contextKeySession, s), nil\n}", "title": "" }, { "docid": "a70d5a9e27d4a91a89ee009516c231cc", "score": "0.59992105", "text": "func (c *Context) Transaction() (*dbe.Connection, error) {\n\tconn, err := c.DefaultConnection()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn conn.NewTx()\n}", "title": "" }, { "docid": "1bf2f7ab6ea9f51c2802a74f60d0753e", "score": "0.5996809", "text": "func (dbc *Connection) QueryInTx(statement string, tx *sql.Tx, args ...interface{}) (result *Query) {\n\treturn dbc.Invoke(dbc.Background(), tx).Query(statement, args...)\n}", "title": "" }, { "docid": "9a573fc7f322db3bc031f68599721aac", "score": "0.59959894", "text": "func ExecuteTx(\n\tctx context.Context, db *gorm.DB, opts *sql.TxOptions, fn func(tx *gorm.DB) error,\n) error {\n\ttx := db.WithContext(ctx).Begin(opts)\n\tif tx.Error != nil {\n\t\treturn tx.Error\n\t}\n\treturn crdb.ExecuteInTx(ctx, gormTxAdapter{tx}, func() error { return fn(tx) })\n}", "title": "" }, { "docid": "64bbce4dbec961321074102d31705879", "score": "0.5993627", "text": "func (r *rbfDBQueryContexts) readTx(rq *rbfQueryContext) (*rbfTxWrappers, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\ttx, err := r.db.Begin(false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tq := &rbfTxWrappers{db: r, tx: tx, key: r.key, queries: make(map[fragKey]QueryRead)}\n\tr.queryContexts[q] = rq\n\treturn q, nil\n}", "title": "" }, { "docid": "e71c70380384bcd82718ad82b02d1a5a", "score": "0.5992862", "text": "func (db *qlw) NewTransaction() qltx {\n\ttx := qltx{ql.NewRWCtx(), db}\n\ttx.Execute(qlBeginTransaction)\n\n\treturn tx\n}", "title": "" }, { "docid": "53ce340b86174367544a884b6e1afe42", "score": "0.5951619", "text": "func BeginTx() (*sql.Tx, error) {\n\tif _db == nil {\n\t\treturn nil, errors.New(`database connection has not been initialized`)\n\t}\n\ttx, err := _db.Begin()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, `begining transaction`)\n\t}\n\treturn tx, nil\n}", "title": "" }, { "docid": "a07573344b02893acd9b61993d167e32", "score": "0.59493613", "text": "func (c *Conn) BeginTx(ctx context.Context, opts *TxOptions) (*Tx, error) {}", "title": "" }, { "docid": "faa23613268988468fa4dfabec140763", "score": "0.5944866", "text": "func (c *Conn) BeginTx(ctx context.Context, txOptions TxOptions) (Tx, error) {\n\t_, err := c.Exec(ctx, txOptions.beginSQL())\n\tif err != nil {\n\t\t// begin should never fail unless there is an underlying connection issue or\n\t\t// a context timeout. In either case, the connection is possibly broken.\n\t\tc.die(errors.New(\"failed to begin transaction\"))\n\t\treturn nil, err\n\t}\n\n\treturn &dbTx{conn: c}, nil\n}", "title": "" }, { "docid": "8573341bda76a2deb4d700412644a6ce", "score": "0.59444803", "text": "func (tc *taosConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {\n\treturn nil, &errors.TaosError{Code: 0xffff, ErrStr: \"taosSql does not support transaction\"}\n}", "title": "" }, { "docid": "40b7f32567a8b9a91a6da084d936f839", "score": "0.5939778", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tAchievement: NewAchievementClient(cfg),\n\t\tCompany: NewCompanyClient(cfg),\n\t\tCompanyUser: NewCompanyUserClient(cfg),\n\t\tDeveloper: NewDeveloperClient(cfg),\n\t\tRecruitment: NewRecruitmentClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "3c06653bd118d35cbcf631bca1e2442c", "score": "0.5936881", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tWidget: NewWidgetClient(cfg),\n\t\tWidgetType: NewWidgetTypeClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "242e38e10a069a25ee0771b48a05e7f0", "score": "0.5927962", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tSysDict: NewSysDictClient(cfg),\n\t\tSysDictItem: NewSysDictItemClient(cfg),\n\t\tSysJwtBlock: NewSysJwtBlockClient(cfg),\n\t\tSysLogging: NewSysLoggingClient(cfg),\n\t\tSysMenu: NewSysMenuClient(cfg),\n\t\tSysMenuAction: NewSysMenuActionClient(cfg),\n\t\tSysMenuActionResource: NewSysMenuActionResourceClient(cfg),\n\t\tSysRole: NewSysRoleClient(cfg),\n\t\tSysRoleMenu: NewSysRoleMenuClient(cfg),\n\t\tSysUser: NewSysUserClient(cfg),\n\t\tSysUserRole: NewSysUserRoleClient(cfg),\n\t\tXxxDemo: NewXxxDemoClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "7e3a015dff9957db9bd823865045088e", "score": "0.592718", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tOtherTest: NewOtherTestClient(cfg),\n\t\tTest: NewTestClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "c57a040b55c1ec34f411e033a3a4e6ca", "score": "0.59053814", "text": "func (d DB) Transaction(f func(DB) error) error {\n\tif _, ok := d.dbProxy.(*sql.Tx); ok {\n\t\t// Already in a nested transaction\n\t\treturn f(d)\n\t}\n\n\ttx, err := d.dbProxy.(*sql.DB).Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = f(DB{\n\t\tdbProxy: tx,\n\t\tStatementBuilderType: statementBuilder(tx),\n\t})\n\tif err != nil {\n\t\t// Rollback error is ignored as we already have one in progress\n\t\tif err2 := tx.Rollback(); err2 != nil {\n\t\t\tlevel.Warn(util.Logger).Log(\"msg\", \"transaction rollback error (ignored)\", \"error\", err2)\n\t\t}\n\t\treturn err\n\t}\n\treturn tx.Commit()\n}", "title": "" }, { "docid": "46f8e417926b5a0682d7d22e71c582ca", "score": "0.59034604", "text": "func NewWrappedTx(tx SqlTx, ctrl *Controller) *WrappedTx {\n\tif ctrl == nil {\n\t\tctrl = NewController()\n\t}\n\treturn &WrappedTx{Tx: tx, ctrl: ctrl}\n}", "title": "" }, { "docid": "e1cc0fb13df6e9ff51e9b5e01970de22", "score": "0.5900957", "text": "func (store *SagaStore) NewTx() *sql.Tx {\n\ttx, err := store.Tx.New()\n\tif err != nil {\n\t\te := fmt.Errorf(\"can't initialize sage store.\\nerror:\\n%s\", err)\n\t\tpanic(e)\n\t}\n\n\treturn tx\n}", "title": "" }, { "docid": "061a7fd030ac8cec42b3d56bb099a43a", "score": "0.5900474", "text": "func DoTx(ctx context.Context, db *sql.DB, f TxOperationFunc) error {\n\treturn (TxDoer{DB: db}).Do(ctx, f)\n}", "title": "" }, { "docid": "27b6f5f7b5051c0c19965acb8ac70398", "score": "0.58923495", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tComments: NewCommentsClient(cfg),\n\t\tExperience: NewExperienceClient(cfg),\n\t\tTags: NewTagsClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "1d03df839c0868a9c9a200ed365e9431", "score": "0.588413", "text": "func (txExt *TxExt) SqlxTx() *sqlx.Tx {\n\treturn (*sqlx.Tx)(txExt)\n}", "title": "" }, { "docid": "7f23b7c5b49088c955789f81877da4b5", "score": "0.5877072", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tDChat: NewDChatClient(cfg),\n\t\tDChessdbCache: NewDChessdbCacheClient(cfg),\n\t\tDRoom: NewDRoomClient(cfg),\n\t\tDSession: NewDSessionClient(cfg),\n\t\tDUser: NewDUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "a756febba94eafad8260ef0fae494589", "score": "0.586987", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tCloudEvents: NewCloudEventsClient(cfg),\n\t\tNamespace: NewNamespaceClient(cfg),\n\t\tServices: NewServicesClient(cfg),\n\t\tWorkflow: NewWorkflowClient(cfg),\n\t\tWorkflowEvents: NewWorkflowEventsClient(cfg),\n\t\tWorkflowEventsWait: NewWorkflowEventsWaitClient(cfg),\n\t\tWorkflowInstance: NewWorkflowInstanceClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "7a03ed1cc8da4ecdafd87a6d095cbc72", "score": "0.5864157", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tSysDict: NewSysDictClient(cfg),\n\t\tSysDictItem: NewSysDictItemClient(cfg),\n\t\tSysJwtBlock: NewSysJwtBlockClient(cfg),\n\t\tSysLogging: NewSysLoggingClient(cfg),\n\t\tSysMenu: NewSysMenuClient(cfg),\n\t\tSysMenuAction: NewSysMenuActionClient(cfg),\n\t\tSysMenuActionResource: NewSysMenuActionResourceClient(cfg),\n\t\tSysRole: NewSysRoleClient(cfg),\n\t\tSysRoleMenu: NewSysRoleMenuClient(cfg),\n\t\tSysUser: NewSysUserClient(cfg),\n\t\tSysUserRole: NewSysUserRoleClient(cfg),\n\t\tXxxDemo: NewXxxDemoClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "b4d180dbd58e30fef87ccda3b421db6a", "score": "0.58627033", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tTag: NewTagClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t\tVideo: NewVideoClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "8ee46b3cf7dba138b32b6082921ffb3e", "score": "0.58578014", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tCompetence: NewCompetenceClient(cfg),\n\t\tContact: NewContactClient(cfg),\n\t\tDevelopper: NewDevelopperClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "f86ac8fa03dcaa8c1a7c3ecad4bf7915", "score": "0.5842799", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tJDModel: NewJDModelClient(cfg),\n\t\tQQModel: NewQQModelClient(cfg),\n\t\tSFModel: NewSFModelClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "93720e7f72c6cd265dad472a0f0fd4e3", "score": "0.58410513", "text": "func (dao *GkvDB) StartTx() (tx models.TX) {\n\tgtx := dao.db.Begin()\n\treturn &GkvTX{\n\t\ttx: gtx,\n\t}\n}", "title": "" }, { "docid": "cf0c1880ec0143df17835ddc08ed1943", "score": "0.5832797", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tCloudEvents: NewCloudEventsClient(cfg),\n\t\tNamespace: NewNamespaceClient(cfg),\n\t\tServices: NewServicesClient(cfg),\n\t\tWorkflow: NewWorkflowClient(cfg),\n\t\tWorkflowEvents: NewWorkflowEventsClient(cfg),\n\t\tWorkflowEventsWait: NewWorkflowEventsWaitClient(cfg),\n\t\tWorkflowInstance: NewWorkflowInstanceClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "e2a3e86a92c505c5378d1e933c1d62e2", "score": "0.5818011", "text": "func (r *rbfTxStore) newWriteTx(rq *rbfQueryContext, dbk dbKey) (*rbfTxWrappers, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tdb, err := r.getDB(dbk)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db.writeTx(rq)\n}", "title": "" }, { "docid": "b8bb3f4ae8ac9417ff5eac1bdfc1aeae", "score": "0.58179635", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = tx\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tArticle: NewArticleClient(cfg),\n\t\tComment: NewCommentClient(cfg),\n\t\tTag: NewTagClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "d491987c9bd21e74f2afce633aa7d5e8", "score": "0.5814156", "text": "func (c *OwmDbClient) ExecTx(stmt string) (sql.Result, error) {\n\tif c.tx == nil {\n\t\treturn nil, errors.New(\"tx does not exist\")\n\t}\n\treturn c.tx.Exec(stmt)\n}", "title": "" }, { "docid": "b0d1f9dc9ca44cbe344089637aad9c32", "score": "0.5814099", "text": "func OptTx(tx *sql.Tx) InvocationOption {\n\treturn func(i *Invocation) {\n\t\tif tx != nil {\n\t\t\ti.DB = tx\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b971edfd2ef739193251473440f4a84e", "score": "0.58122903", "text": "func TxFromContext(ctx context.Context, db *gorm.DB) *gorm.DB {\n\tif tx, ok := ctx.Value(txKey{}).(*gorm.DB); ok {\n\t\treturn tx\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "de1319562d6f2d3e89c2a73057697e45", "score": "0.580728", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tAchievement: NewAchievementClient(cfg),\n\t\tCompany: NewCompanyClient(cfg),\n\t\tCompanyUser: NewCompanyUserClient(cfg),\n\t\tDeveloper: NewDeveloperClient(cfg),\n\t\tRecruitment: NewRecruitmentClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "fde5b9cd9a1e1a2a165360eab92422a8", "score": "0.58071256", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tGender: NewGenderClient(cfg),\n\t\tProvince: NewProvinceClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t\tUserType: NewUserTypeClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "8b76b81b56fcb0fa6c02bd8ff0b94678", "score": "0.58070767", "text": "func (t *taxRepo) BeginTransaction() (*sqlx.Tx, error) {\n\treturn t.ShopeeDB.Beginx()\n}", "title": "" }, { "docid": "e53aca2c88db45f1981b4e7eaa4d482f", "score": "0.5801624", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tDoctor: NewDoctorClient(cfg),\n\t\tDrugAllergy: NewDrugAllergyClient(cfg),\n\t\tManner: NewMannerClient(cfg),\n\t\tMedicine: NewMedicineClient(cfg),\n\t\tPatient: NewPatientClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "c4b91ee7aced5f40f859de2416d22b1b", "score": "0.5790738", "text": "func (db *Reindexer) BeginTx(namespace string) (*Tx, error) {\n\treturn newTx(db, namespace)\n}", "title": "" }, { "docid": "0495bee0aa20834b56f22ab63b18ec84", "score": "0.5776301", "text": "func WithinTransaction(fn DBFunc) (err error) {\n\ttx := gormdb.DBManager().Begin() // start db transaction\n\tdefer tx.Commit()\n\terr = fn(tx)\n\t// close db transaction\n\treturn err\n}", "title": "" }, { "docid": "631946893e9374a72c598513103ef357", "score": "0.5775567", "text": "func (db *Reindexer) BeginTx(namespace string) (*Tx, error) {\n\treturn db.impl.beginTx(db.ctx, namespace)\n}", "title": "" }, { "docid": "a4af3b79f05915cea2a2ab3189df18ab", "score": "0.57719713", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tCar: NewCarClient(cfg),\n\t\tPredicament: NewPredicamentClient(cfg),\n\t\tStaff: NewStaffClient(cfg),\n\t\tStatuscar: NewStatuscarClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "5dff9e0d9ffd62916bb3c398ce53ded0", "score": "0.57708335", "text": "func transaction(ctx context.Context, db *sql.DB, f func(*sql.Tx) error) error {\n\ttx, err := db.BeginTx(ctx, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar txErr error\n\tdefer func() {\n\t\tif txErr == nil {\n\t\t\t_ = tx.Commit()\n\t\t} else {\n\t\t\t_ = tx.Rollback()\n\t\t}\n\t}()\n\n\ttxErr = f(tx)\n\treturn txErr\n}", "title": "" }, { "docid": "4926137258c557c1c39fd74b9cd6984a", "score": "0.5770732", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tWidget: NewWidgetClient(cfg),\n\t\tWidgetType: NewWidgetTypeClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "578ab72b47ad8db623a3972c4cd24382", "score": "0.57706743", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tCity: NewCityClient(cfg),\n\t\tComment: NewCommentClient(cfg),\n\t\tCountry: NewCountryClient(cfg),\n\t\tForum: NewForumClient(cfg),\n\t\tPost: NewPostClient(cfg),\n\t\tTag: NewTagClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "a5054379a26c004ebf228d912741ff3e", "score": "0.5770086", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(*sql.Driver).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: &txDriver{tx: tx, drv: c.driver}, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tAssessment: NewAssessmentClient(cfg),\n\t\tCompany: NewCompanyClient(cfg),\n\t\tCustomer: NewCustomerClient(cfg),\n\t\tDay: NewDayClient(cfg),\n\t\tDiscount: NewDiscountClient(cfg),\n\t\tEmployee: NewEmployeeClient(cfg),\n\t\tEmployeeWorkingHours: NewEmployeeWorkingHoursClient(cfg),\n\t\tEndWork: NewEndWorkClient(cfg),\n\t\tGiveaway: NewGiveawayClient(cfg),\n\t\tManager: NewManagerClient(cfg),\n\t\tOrderonline: NewOrderonlineClient(cfg),\n\t\tOrderproduct: NewOrderproductClient(cfg),\n\t\tPaymentchannel: NewPaymentchannelClient(cfg),\n\t\tPosition: NewPositionClient(cfg),\n\t\tProduct: NewProductClient(cfg),\n\t\tPromotion: NewPromotionClient(cfg),\n\t\tRole: NewRoleClient(cfg),\n\t\tSalary: NewSalaryClient(cfg),\n\t\tStartWork: NewStartWorkClient(cfg),\n\t\tStock: NewStockClient(cfg),\n\t\tTypeproduct: NewTypeproductClient(cfg),\n\t\tZoneproduct: NewZoneproductClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "9ab040373b324e44f3552b3be67d961c", "score": "0.57680714", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tGlobalsettings: NewGlobalsettingsClient(cfg),\n\t\tPost: NewPostClient(cfg),\n\t\tSource: NewSourceClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t\tUserSettings: NewUserSettingsClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "6864e4a3b4ae634db668611a9ae872bb", "score": "0.576423", "text": "func (dbs *DBs) BeginTx(ctx context.Context, opts *sql.TxOptions) (res *Tx, err error) {\n\tvar (\n\t\tw *wrapper\n\t\tr interface{}\n\t)\n\n\tfor {\n\t\tif w, err = getDBFromBalancer(dbs.masters); err != nil {\n\t\t\treportError(\"BeginTx\", err)\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// executing\n\t\tr, err = retryFunc(\"START TRANSACTION\", func() (interface{}, error) {\n\t\t\treturn w.db.BeginTx(ctx, opts)\n\t\t})\n\t\tif r != nil {\n\t\t\tres = &Tx{\n\t\t\t\tTx: r.(*sql.Tx),\n\t\t\t}\n\t\t}\n\n\t\t// check networking/wsrep error\n\t\tvar should bool\n\t\tif should, err = shouldFailure(w, dbs.masters.isWsrep, err); should {\n\t\t\tdbs.masters.failure(w, err)\n\t\t\tcontinue\n\t\t}\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "9d49c1c01cfe61513583662413859f2a", "score": "0.5751797", "text": "func (r MigrationRepository) QueryTx(ctx context.Context, t migration.Transaction, query *migration.QueryCondition, offset, limit uint) ([]migration.Log, error) {\n\tvar items []migration.Log\n\tvar where string\n\n\ttx, ok := t.(*sqlx.Tx)\n\tif !ok {\n\t\treturn nil, errors.New(\"can not assert param t migration.Transaction to *sqlx.Tx\")\n\t}\n\n\tif limit < 1 {\n\t\tlimit = MaxLIstLimit\n\t}\n\tparams := []interface{}{limit, offset}\n\n\tif query != nil && query.Where != nil {\n\t\twhere = \" WHERE status = $3 \"\n\t\tparams = append(params, query.Where.Status)\n\t}\n\n\terr := tx.SelectContext(ctx, &items, \"SELECT * FROM \" + migration.TableName + where + \" LIMIT $1 OFFSET $2\", params...)\n\tif err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn nil, apperror.ErrNotFound\n\t\t}\n\t}\n\treturn items, err\n}", "title": "" }, { "docid": "3d9c658c3b19d24174d0f706231916af", "score": "0.57429236", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tOrder: NewOrderClient(cfg),\n\t\tProduct: NewProductClient(cfg),\n\t\tRestaurant: NewRestaurantClient(cfg),\n\t\tUser: NewUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "8fb2dd32c798072b119d468a9cfb5ea2", "score": "0.5742712", "text": "func (dbc *Connection) QueryInTxContext(context context.Context, statement string, tx *sql.Tx, args ...interface{}) (result *Query) {\n\treturn dbc.Invoke(context, tx).Query(statement, args...)\n}", "title": "" }, { "docid": "a27c81d8950e35eefbb1d4316b25bffa", "score": "0.5736698", "text": "func (cn *connDb) execFromTx(btx *sql.Tx, query string, args ...interface{}) (rs sql.Result, exerr error) {\n\trs, exerr = btx.Exec(query, args...)\n\treturn\n}", "title": "" }, { "docid": "c2e163dd30568baba97467a570c85735", "score": "0.573253", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tOtherTest: NewOtherTestClient(cfg),\n\t\tTest: NewTestClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "b2a3bfc8d4727a370f432e7641f04952", "score": "0.57283884", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tArea: NewAreaClient(cfg),\n\t\tDisease: NewDiseaseClient(cfg),\n\t\tEmployee: NewEmployeeClient(cfg),\n\t\tLevel: NewLevelClient(cfg),\n\t\tStatistic: NewStatisticClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "d801d74021f30dc9d47548a1f57c3942", "score": "0.57255256", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tArea: NewAreaClient(cfg),\n\t\tCarrier: NewCarrierClient(cfg),\n\t\tContagious: NewContagiousClient(cfg),\n\t\tEmployee: NewEmployeeClient(cfg),\n\t\tPatient: NewPatientClient(cfg),\n\t\tStatistic: NewStatisticClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "c9194feeca48c64d7f38b8993f7df2f0", "score": "0.5724691", "text": "func WithinTransaction(fn DBFunc) (err error) {\n\ttx := cgorm.DBManager().Begin() // start db transaction\n\tdefer tx.Commit()\n\terr = fn(tx)\n\t// close db transaction\n\treturn err\n}", "title": "" }, { "docid": "6d480b154b86b3c6ca6d47aa4df1b9ae", "score": "0.57223433", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tCompetence: NewCompetenceClient(cfg),\n\t\tContact: NewContactClient(cfg),\n\t\tDevelopper: NewDevelopperClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "4ecadf8aa71db50a5efd669c900da6a8", "score": "0.5721506", "text": "func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tDChat: NewDChatClient(cfg),\n\t\tDChessdbCache: NewDChessdbCacheClient(cfg),\n\t\tDRoom: NewDRoomClient(cfg),\n\t\tDSession: NewDSessionClient(cfg),\n\t\tDUser: NewDUserClient(cfg),\n\t}, nil\n}", "title": "" }, { "docid": "ff4184664cb27a1a2ffec6087b0e259c", "score": "0.5718021", "text": "func (c *Client) Tx(ctx context.Context) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := newTx(ctx, c.driver)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: tx, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tctx: ctx,\n\t\tconfig: cfg,\n\t\tRoom: NewRoomClient(cfg),\n\t\tRoomInfo: NewRoomInfoClient(cfg),\n\t\tRoomStatus: NewRoomStatusClient(cfg),\n\t\tRoomType: NewRoomTypeClient(cfg),\n\t}, nil\n}", "title": "" } ]
d1f3f896c85a1d3a6ba292693eaa5db4
check if this namespace is in the whitelist for the provided violation type
[ { "docid": "7a7bffd9586dcd58654e5d973edc8fff", "score": "0.55122286", "text": "func isWhitelistedNamespace(t *HandlerImpl, pod *core_v1.Pod, rec, seciss, liciss bool) bool {\n\twhitelist := make([]string, 0)\n\tif !rec {\n\t\twhitelist = append(whitelist, t.unscanned.whitelist...)\n\t}\n\tif seciss {\n\t\twhitelist = append(whitelist, t.security.whitelist...)\n\t}\n\tif liciss {\n\t\twhitelist = append(whitelist, t.license.whitelist...)\n\t}\n\tfor _, ns := range whitelist {\n\t\tif ns == pod.Namespace {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" } ]
[ { "docid": "e7d5258e0ad8f436f535c0919476a597", "score": "0.5542051", "text": "func checkCompanyTypeIsAllowed(providedType string) bool {\n\tfor _, forbiddenType := range constants.ForbiddenCompanyTypes {\n\t\tif providedType == forbiddenType {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "704ea991a03c495f20990708e5a09839", "score": "0.5440147", "text": "func (txToken TxTokenBase) ValidateType() bool {\n\treturn txToken.Tx.GetType() == common.TxCustomTokenPrivacyType\n}", "title": "" }, { "docid": "7e0bd1162370a653982dfe7354cf812c", "score": "0.5252472", "text": "func validate(resType string) bool {\n\t//validResourceTypes contains a list of valid resources\n\tvar validResourceTypes = [7]string{\"js\", \"jsc\", \"properties\", \"java\", \"wsdl\", \"xsd\", \"py\"}\n\n\tfor _, n := range validResourceTypes {\n\t\tif n == resType {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9b313574fecd44aa44cc63098b4a6f5b", "score": "0.5222384", "text": "func ValidSTIXObjectType(t string) bool {\n\tvalid := false\n\n\tswitch t {\n\tcase \"attack-pattern\":\n\t\tvalid = true\n\tcase \"campaign\":\n\t\tvalid = true\n\tcase \"course-of-action\":\n\t\tvalid = true\n\tcase \"identity\":\n\t\tvalid = true\n\tcase \"indicator\":\n\t\tvalid = true\n\tcase \"intrusion-set\":\n\t\tvalid = true\n\tcase \"location\":\n\t\tvalid = true\n\tcase \"malware\":\n\t\tvalid = true\n\tcase \"marking-definition\":\n\t\tvalid = true\n\tcase \"note\":\n\t\tvalid = true\n\tcase \"observed-data\":\n\t\tvalid = true\n\tcase \"opinion\":\n\t\tvalid = true\n\tcase \"relationship\":\n\t\tvalid = true\n\tcase \"report\":\n\t\tvalid = true\n\tcase \"sighting\":\n\t\tvalid = true\n\tcase \"threat-actor\":\n\t\tvalid = true\n\tcase \"tool\":\n\t\tvalid = true\n\tcase \"vulnerability\":\n\t\tvalid = true\n\t}\n\treturn valid\n}", "title": "" }, { "docid": "4fdedde9b0be6e663c272c1a07870f63", "score": "0.5197246", "text": "func (v RiskCheckEmailTopLevelDomainIsSuspicious) IsValid() bool {\n\tfor _, existing := range allowedRiskCheckEmailTopLevelDomainIsSuspiciousEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "79fb322d0b3f66e9241c1a371715f710", "score": "0.51759523", "text": "func (st SeverityType) IsValid() error {\n\tswitch st {\n\tcase Informational, Low, Medium, High:\n\t\treturn nil\n\t}\n\treturn errors.New(\"Invalid Severity type. Please Check yaml config file\")\n}", "title": "" }, { "docid": "57c8dac96ff9e2703a3918c47763939c", "score": "0.5072282", "text": "func isProtectedNamespace(request admissionctl.Request) bool {\n\tns := request.Namespace\n\n\tif config.IsPrivilegedNamespace(ns) && !utils.SliceContains(ns, exceptionNamespaces) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "34f4fc23688acdadc88c047ead6dd516", "score": "0.5066482", "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": "c73b9e7ec42576dcc72878163f13e8a7", "score": "0.49852985", "text": "func ValidType(t string) bool {\n\tswitch t {\n\tcase\n\t\t\"general\",\n\t\t\"price\",\n\t\t\"daly\":\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "734769b5d04bbb78d71a0fefd8f375e1", "score": "0.4960617", "text": "func (v SLOListWidgetDefinitionType) IsValid() bool {\n\tfor _, existing := range allowedSLOListWidgetDefinitionTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "10b32463c2c5f8e8c9fe294291ac04b4", "score": "0.4953476", "text": "func isNetNamespaceValid(s *RegularuserWebhook, request admissionctl.Request) bool {\n\t// Decode object into a NetNamespace object\n\tdecoder, err := admissionctl.NewDecoder(&s.s)\n\tif err != nil {\n\t\treturn false\n\t}\n\tnetNamespace := &networkv1.NetNamespace{}\n\tif len(request.Object.Raw) == 0 {\n\t\treturn false\n\t}\n\terr = decoder.Decode(request, netNamespace)\n\tif err != nil {\n\t\treturn false\n\t}\n\t// Check if the name is bad or is privileged\n\tif namespace.BadNamespaceRe.Match([]byte(netNamespace.Name)) ||\n\t\thookconfig.IsPrivilegedNamespace(netNamespace.Name) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "e204c3022d0cdb9945fc0ca7fe1dfd95", "score": "0.4950385", "text": "func isClientTypeValid(clientType string) bool {\n\treturn clientType == ConfidentialClient || clientType == PublicClient\n}", "title": "" }, { "docid": "84153d23aaa06a6d255d5c46ea559bb3", "score": "0.49489543", "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": "b44aacc94cbdb7eb3ac47d08d90c3c81", "score": "0.49396712", "text": "func isValidType(t string) bool {\n\treturn t == aud || t == vid || t == cc || t == sub\n}", "title": "" }, { "docid": "5ce731d1d4b93b988c8edf85265f312a", "score": "0.49130166", "text": "func isUnknownType(f *desc.FieldDescriptor) bool {\n\tif ref := utils.GetResourceReference(f); ref != nil {\n\t\turt := ref.GetType()\n\t\tif urt == \"\" {\n\t\t\turt = ref.GetChildType()\n\t\t}\n\t\treturn !stringset.New(\n\t\t\t// Allow the common resource types in GCP.\n\t\t\t// FIXME: Modularize this.\n\t\t\t\"cloudresourcemanager.googleapis.com/Project\",\n\t\t\t\"cloudresourcemanager.googleapis.com/Organization\",\n\t\t\t\"cloudresourcemanager.googleapis.com/Folder\",\n\t\t\t\"billing.googleapis.com/BillingAccount\",\n\t\t\t\"locations.googleapis.com/Location\",\n\n\t\t\t// Allow *.\n\t\t\t\"*\",\n\n\t\t\t// If no type is declared, ignore this.\n\t\t\t\"\",\n\t\t).Contains(urt)\n\t}\n\treturn false\n}", "title": "" }, { "docid": "593c8e5303ff2804698277e3a8708780", "score": "0.49064314", "text": "func TestWhitelistAllowed(t *testing.T) {\n\tw := NewWhitelist()\n\tw.Add(\"a\")\n\tassert.True(t, w.Allowed(\"a\"))\n\tassert.False(t, w.Allowed(\"b\"))\n}", "title": "" }, { "docid": "923b88508bb31747767781566e519c1a", "score": "0.49053505", "text": "func IsPlacementInWhitelist(cli *redis.Client, campId uint64, placement string) (bool, error) {\n\tif cli == nil {\n\t\treturn ErrRedisCliNullPtr\n\t}\n\n\tkey := fmt.Sprintf(REDISKEY_CAMPAIGN_WHITELIST_SET, campId)\n\twlist, err := cli.SMembers(key).ScanSlice()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfor _, list := range wlist {\n\t\tif isIn, err := cli.SIsMember(list, placement).Result(); isIn {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\n\treturn false, nil\n}", "title": "" }, { "docid": "2289ee43604ae7c0b9e6df1005f7e37f", "score": "0.48660764", "text": "func (u *universe) allowed(actionType action.Type) bool {\n\treturn u.current.Actions().Includes(actionType)\n}", "title": "" }, { "docid": "3c31c6acea895a384c9c8759ad29e322", "score": "0.48552004", "text": "func checkWhitelist(r *http.Request) bool {\n\treturn true\n}", "title": "" }, { "docid": "f208765fd95f9ab6c77c56969f6b6c72", "score": "0.4854244", "text": "func (t Type) Is(checker Type) bool {\n\n\tswitch {\n\tcase t == UnknownMsg:\n\t\treturn checker == UnknownMsg\n\tcase t == SysExMsg:\n\t\treturn checker == SysExMsg\n\tcase t < UnknownMsg:\n\t\treturn false\n\tcase checker == UnknownMsg:\n\t\treturn false\n\tcase checker > UnknownMsg:\n\t\treturn t == checker\n\tdefault:\n\t\tswitch checker {\n\t\tcase RealTimeMsg:\n\t\t\treturn t <= reservedRealTimeMsg14\n\t\tcase SysCommonMsg:\n\t\t\treturn t >= MTCMsg && t <= reservedSysCommonMsg10\n\t\tcase ChannelMsg:\n\t\t\treturn t >= NoteOnMsg && t <= reservedChannelMsg16\n\t\tcase metaMsg:\n\t\t\treturn t >= firstMetaMsg\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n}", "title": "" }, { "docid": "73a2077188452729483f4b4ed7e92a3b", "score": "0.4851279", "text": "func (t Type) IsRestrictQualifiedType() bool {\n\treturn C.clang_isRestrictQualifiedType(t.c) != 0\n}", "title": "" }, { "docid": "bbd7b2e3430ede0bba6f500e003504f1", "score": "0.48310643", "text": "func (perm *RosourcePermission) CheckType(resource any) bool {\n\tvar res reflect.Type\n\tswitch t := resource.(type) {\n\tcase nil:\n\tcase reflect.Type:\n\t\tres = t\n\tdefault:\n\t\tres = reflect.TypeOf(resource)\n\t}\n\treturn perm.resType == res\n}", "title": "" }, { "docid": "0268527a3b9e4de8209d9c37467ef0ed", "score": "0.48083788", "text": "func (h *Handler) isEligible(obj *v1.Event) bool {\n\tif contains(obj.Namespace, skipNamespaces) {\n\t\treturn false\n\t}\n\treturn (len(h.conf.Namespaces) == 0 || contains(obj.Namespace, h.conf.Namespaces)) && (len(h.conf.Events) == 0 || contains(obj.Reason, h.conf.Events))\n}", "title": "" }, { "docid": "3cf21024c9874ba258c082a0ce3dd5d6", "score": "0.48082182", "text": "func (*RestrictedStaticType) isStaticType() {}", "title": "" }, { "docid": "f0e0aab4a9325a35e6f4ce53b70982d2", "score": "0.4799155", "text": "func errcheckShouldHaveAnnotation() {}", "title": "" }, { "docid": "704bcf31aa7b6d5090a85db47a87c18c", "score": "0.47972673", "text": "func (nts *NamespaceTypeSystem) Validate(ctx context.Context) error {\n\tfor _, relation := range nts.relationMap {\n\t\t// Validate the usersets's.\n\t\tusersetRewrite := relation.GetUsersetRewrite()\n\t\trerr := graph.WalkRewrite(usersetRewrite, func(childOneof *v0.SetOperation_Child) interface{} {\n\t\t\tswitch child := childOneof.ChildType.(type) {\n\t\t\tcase *v0.SetOperation_Child_ComputedUserset:\n\t\t\t\trelationName := child.ComputedUserset.GetRelation()\n\t\t\t\t_, ok := nts.relationMap[relationName]\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"under permission `%s`: relation/permission `%s` was not found\", relation.Name, relationName)\n\t\t\t\t}\n\t\t\tcase *v0.SetOperation_Child_TupleToUserset:\n\t\t\t\tttu := child.TupleToUserset\n\t\t\t\tif ttu == nil {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\ttupleset := ttu.GetTupleset()\n\t\t\t\tif tupleset == nil {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\trelationName := tupleset.GetRelation()\n\t\t\t\tfound, ok := nts.relationMap[relationName]\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"under permission `%s`: relation `%s` was not found\", relation.Name, relationName)\n\t\t\t\t}\n\n\t\t\t\tif nspkg.GetRelationKind(found) == iv1.RelationMetadata_PERMISSION {\n\t\t\t\t\treturn fmt.Errorf(\"under permission `%s`: permissions cannot be used on the left hand side of an arrow (found `%s`)\", relation.Name, relationName)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif rerr != nil {\n\t\t\treturn rerr.(error)\n\t\t}\n\n\t\t// Validate type information.\n\t\ttypeInfo := relation.TypeInformation\n\t\tif typeInfo == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tallowedDirectRelations := typeInfo.GetAllowedDirectRelations()\n\n\t\t// Check for a _this or the lack of a userset_rewrite. If either is found,\n\t\t// then the allowed list must have at least one type.\n\t\thasThis := graph.HasThis(usersetRewrite)\n\n\t\tif usersetRewrite == nil || hasThis {\n\t\t\tif len(allowedDirectRelations) == 0 {\n\t\t\t\treturn fmt.Errorf(\"at least one allowed relation/permission is required in relation `%s`\", relation.Name)\n\t\t\t}\n\t\t} else {\n\t\t\tif len(allowedDirectRelations) != 0 {\n\t\t\t\treturn fmt.Errorf(\"direct relations are not allowed under relation `%s`\", relation.Name)\n\t\t\t}\n\t\t}\n\n\t\t// Verify that all allowed relations are not this very relation, and that\n\t\t// they exist within the namespace.\n\t\tfor _, allowedRelation := range allowedDirectRelations {\n\t\t\tif allowedRelation.GetNamespace() == nts.nsDef.Name {\n\t\t\t\tif allowedRelation.GetRelation() != \"...\" {\n\t\t\t\t\t_, ok := nts.relationMap[allowedRelation.GetRelation()]\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn fmt.Errorf(\"for relation `%s`: relation/permission `%s` was not found under definition `%s`\", relation.Name, allowedRelation.GetRelation(), allowedRelation.GetNamespace())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsubjectTS, err := nts.typeSystemForNamespace(ctx, allowedRelation.GetNamespace())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"could not lookup definition `%s` for relation `%s`: %w\", allowedRelation.GetNamespace(), relation.Name, err)\n\t\t\t\t}\n\n\t\t\t\tif allowedRelation.GetRelation() != \"...\" {\n\t\t\t\t\tok := subjectTS.HasRelation(allowedRelation.GetRelation())\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn fmt.Errorf(\"for relation `%s`: relation/permission `%s` was not found under definition `%s`\", relation.Name, allowedRelation.GetRelation(), allowedRelation.GetNamespace())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "357457f0c08a9aa8add207b042f04389", "score": "0.47950134", "text": "func (v DocType) IsValid() bool {\n\tfor _, existing := range allowedDocTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "03e854d6692bb905c91df58e853f647b", "score": "0.47904027", "text": "func (x ForceLowerType) IsValid() bool {\n\t_, ok := _ForceLowerTypeMap[x]\n\treturn ok\n}", "title": "" }, { "docid": "78f975dde32a0fa478fd4220297f89ba", "score": "0.47883427", "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": "3c4d267f8c62daec168ac24d93c69bd3", "score": "0.47818995", "text": "func TestWhitelistAllowedStrict(t *testing.T) {\n\tw := NewWhitelist()\n\tw.Strict()\n\tassert.False(t, w.Allowed(\"a\"))\n}", "title": "" }, { "docid": "fea51969a3f4ac25b48c9ad418499f43", "score": "0.4781298", "text": "func (nt NotificationType) IsValid() error {\n\tswitch nt {\n\tcase Email:\n\t\treturn nil\n\t}\n\treturn errors.New(\"Invalid notification type\")\n}", "title": "" }, { "docid": "634d04bdd4144aa5194459e200dfc875", "score": "0.47727287", "text": "func (l Language) IsUndetermined() bool { return l.IsDerivedFrom(\"und\") }", "title": "" }, { "docid": "b552ab265b3d3cc4133953eefebe466f", "score": "0.47546172", "text": "func (wc *WhitelistChecker) CheckInWhiteList(fileName string) bool {\n\tfn := FileName{Name: fileName}\n\tlocalIP := fn.GetLocalIP()\n\t_, ok := wc.EmbargoWhiteList[localIP]\n\treturn ok\n}", "title": "" }, { "docid": "f9c8f1c744ff90219e46edcba300a249", "score": "0.47514057", "text": "func (v HourlyUsageType) IsValid() bool {\n\tfor _, existing := range allowedHourlyUsageTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "6fddb36ae86f5a99f34cc50138199cc1", "score": "0.47478062", "text": "func IsDisallowed(t string, records []*DomainRecord) bool {\n\treturn len(records) == 0 && strings.EqualFold(t, NSType) || strings.EqualFold(t, SOAType) || strings.EqualFold(t, CAAType)\n}", "title": "" }, { "docid": "b234908b7035a9dac0c4c1cd25a6b8d4", "score": "0.4741815", "text": "func IsNamespaceType(obj Resource) bool {\n\tswitch obj.(type) {\n\tcase *NamespaceV1:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "8756f036b911f8e0ba31d747368b0756", "score": "0.47364613", "text": "func validate(ts TypeSystem, t Type, node ipld.Node, pth string) []error {\n\tswitch t2 := t.(type) {\n\tcase TypeBool:\n\t\tif node.ReprKind() != ipld.ReprKind_Bool {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeString:\n\t\tif node.ReprKind() != ipld.ReprKind_String {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeBytes:\n\t\tif node.ReprKind() != ipld.ReprKind_Bytes {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeInt:\n\t\tif node.ReprKind() != ipld.ReprKind_Int {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeFloat:\n\t\tif node.ReprKind() != ipld.ReprKind_Float {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeMap:\n\t\tif node.ReprKind() != ipld.ReprKind_Map {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\terrs := []error(nil)\n\t\tfor itr := node.MapIterator(); !itr.Done(); {\n\t\t\tk, v, err := itr.Next()\n\t\t\tif err != nil {\n\t\t\t\treturn []error{err}\n\t\t\t}\n\t\t\t// FUTURE: if KeyType is an enum rather than string, do membership check.\n\t\t\tks, _ := k.AsString()\n\t\t\tif v.IsNull() {\n\t\t\t\tif !t2.ValueIsNullable() {\n\t\t\t\t\terrs = append(errs, fmt.Errorf(\"Schema match failed: map at path %q contains unpermitted null in key %q\", pth, ks))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terrs = append(errs, validate(ts, t2.ValueType(), v, path.Join(pth, ks))...)\n\t\t\t}\n\t\t}\n\t\treturn errs\n\tcase TypeList:\n\tcase TypeLink:\n\t\t// TODO interesting case: would need resolver to keep checking.\n\tcase TypeUnion:\n\t\t// TODO *several* interesting errors\n\tcase TypeStruct:\n\t\tswitch t2.tupleStyle {\n\t\tcase false: // as map!\n\t\t\tif node.ReprKind() != ipld.ReprKind_Map {\n\t\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t\t}\n\t\t\t// TODO loop over em\n\t\t\t// TODO REVIEW order strictness questions?\n\t\tcase true: // as array!\n\n\t\t}\n\tcase TypeEnum:\n\t\t// TODO another interesting error\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b8f8996453d279b3c678f5aa8c55e6b3", "score": "0.47355115", "text": "func (db FakeDB) IsInWhitelist(c context.Context, ip net.IP, whitelist string) (bool, error) {\n\treturn false, nil\n}", "title": "" }, { "docid": "bd1392e71f5bd76111d54d0312d06493", "score": "0.47234875", "text": "func (l *apiLinter) validate(t *types.Type) error {\n\tfor _, r := range l.rules {\n\t\tglog.V(5).Infof(\"validating API rule %v for type %v\", r.Name(), t)\n\t\tfields, err := r.Validate(t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, field := range fields {\n\t\t\tl.violations = append(l.violations, apiViolation{\n\t\t\t\trule: r.Name(),\n\t\t\t\tpackageName: t.Name.Package,\n\t\t\t\ttypeName: t.Name.Name,\n\t\t\t\tfield: field,\n\t\t\t})\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bae729564f44900765a20f3b20a55ddf", "score": "0.471541", "text": "func CheckPolicyType(rulePolicyType string, desiredPolicyTypes []string) bool {\n\tnormDesiredPolicyTypes := make(map[string]bool, len(desiredPolicyTypes))\n\tnormRulePolicyType := EnsureUpperCaseTrimmed(rulePolicyType)\n\n\tfor _, desiredPolicyType := range desiredPolicyTypes {\n\t\tdesiredPolicyType = EnsureUpperCaseTrimmed(desiredPolicyType)\n\t\tnormDesiredPolicyTypes[desiredPolicyType] = true\n\t}\n\n\tif _, ok := normDesiredPolicyTypes[\"ALL\"]; ok {\n\t\treturn true\n\t}\n\n\t_, ok := normDesiredPolicyTypes[normRulePolicyType]\n\treturn ok\n}", "title": "" }, { "docid": "9633da40f701d143894c3581c2b3c62a", "score": "0.47111413", "text": "func (a *gcPermissionsEnforcement) isWhiteListed(groupResource schema.GroupResource, subresource string) bool {\n\tfor _, item := range a.whiteList {\n\t\tif item.groupResource == groupResource && item.subresource == subresource {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "41cf24b6f011f4138d5fe36fb318d420", "score": "0.4710232", "text": "func ValidateUpstreamType(ups string) string {\n\tfound := false\n\tfor _, current := range UpstreamTypes {\n\t\tif ups == current {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !found {\n\t\treturn DefaultUpstreamType\n\t}\n\treturn ups\n}", "title": "" }, { "docid": "df2f89460414b450b882fffe1d4f6393", "score": "0.4708576", "text": "func (i *Inspector) Require(t reflect.Type) error {\n\tif i == nil {\n\t\treturn kerror.New(kerror.ENil, \"nil inspector cannot register type\")\n\t}\n\tif t == nil {\n\t\treturn kerror.New(kerror.EInvalid, \"inspector cannot register nil type\")\n\t}\n\tif _, ok := i.types[t]; !ok {\n\t\ti.types[t] = false\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5c785088c02689df837210889a4df64a", "score": "0.47074407", "text": "func (h *Hello) AllowsEventType(eventType string) bool {\n\tif h.EventSubs == nil {\n\t\treturn false\n\t}\n\treturn h.EventSubs[eventType]\n}", "title": "" }, { "docid": "ef9b1aba5e193086010f48330b6a3179", "score": "0.4702715", "text": "func (dm *KubeArmorDaemon) validateVisibility(scope string, visibility string) bool {\n\treturn strings.Contains(visibility, scope)\n}", "title": "" }, { "docid": "4b7f1873d91be3c0aae9d48003d83db0", "score": "0.46860033", "text": "func IsInferentiaInstanceType(instanceType string) bool {\n\treturn strings.HasPrefix(instanceType, \"inf1\")\n}", "title": "" }, { "docid": "c2e589f5aa1ab65f1e4778447e7e8137", "score": "0.46823466", "text": "func (o *ExcessResourceAllOf) HasAvailabilityZoneType() bool {\n\tif o != nil && o.AvailabilityZoneType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ad146cecd9d7f64a58b60ee338e9cb71", "score": "0.46820888", "text": "func (v ConfluentAccountType) IsValid() bool {\n\tfor _, existing := range allowedConfluentAccountTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5cb87e33bc65e4db53525662661a01db", "score": "0.46819693", "text": "func isValidType(t string) bool {\n\treturn t == routerTypeF5 || t == routerTypeTemplate\n}", "title": "" }, { "docid": "11afe108ec74a64845cceb9cbdb14464", "score": "0.46759018", "text": "func CheckAllowNamespace(namespace string, allowNamespaces map[string]bool) bool {\n\tif allowNamespaces[namespace] || globCompare(namespace, allowNamespaces) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5cdf57bed0a93d2faba1eeb8714f0125", "score": "0.46721485", "text": "func (v DashboardReflowType) IsValid() bool {\n\tfor _, existing := range allowedDashboardReflowTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1e9d018149c1fa75f5bcf9d525342187", "score": "0.4656099", "text": "func (m *identityWhitelist) Valid(route string, i *Identity) bool {\n\tif ok := m.Domain(route, i.EmailDomain()); ok {\n\t\treturn ok\n\t}\n\tif ok := m.Email(route, i.Email); ok {\n\t\treturn ok\n\t}\n\tfor _, group := range i.Groups {\n\t\tif ok := m.Group(route, group); ok {\n\t\t\treturn ok\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "9414e8cfaa205563fbd9a2d67bdcfb22", "score": "0.46548992", "text": "func (n *Namespaces) IsAllowed(givenNs string) bool {\n\tif n == nil || givenNs == \"\" {\n\t\treturn false\n\t}\n\n\t// 1. Check if excluded\n\tif len(n.Exclude) > 0 {\n\t\tfor _, excludeNamespace := range n.Exclude {\n\t\t\tif strings.TrimSpace(excludeNamespace) == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// exact match\n\t\t\tif excludeNamespace == givenNs {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// regexp\n\t\t\tmatched, err := regexp.MatchString(excludeNamespace, givenNs)\n\t\t\tif err == nil && matched {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Check if included, if matched, return true\n\tif len(n.Include) > 0 {\n\t\tfor _, includeNamespace := range n.Include {\n\t\t\tif strings.TrimSpace(includeNamespace) == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// exact match\n\t\t\tif includeNamespace == givenNs {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// regexp\n\t\t\tmatched, err := regexp.MatchString(includeNamespace, givenNs)\n\t\t\tif err == nil && matched {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2.1. If not included, return false\n\treturn false\n}", "title": "" }, { "docid": "2ac65f0aebbcb91e5aed4b100b410cee", "score": "0.46480376", "text": "func (p *Parser) checkTypeDeclaration(apiList []*Api) error {\n\ttypes := make(map[string]TypeExpr)\n\n\tfor _, root := range apiList {\n\t\tfor _, each := range root.Type {\n\t\t\ttypes[each.NameExpr().Text()] = each\n\t\t}\n\t}\n\n\tfor _, apiItem := range apiList {\n\t\tlinePrefix := apiItem.LinePrefix\n\t\terr := p.checkTypes(apiItem, linePrefix, types)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = p.checkServices(apiItem, types, linePrefix)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2ac65f0aebbcb91e5aed4b100b410cee", "score": "0.46480376", "text": "func (p *Parser) checkTypeDeclaration(apiList []*Api) error {\n\ttypes := make(map[string]TypeExpr)\n\n\tfor _, root := range apiList {\n\t\tfor _, each := range root.Type {\n\t\t\ttypes[each.NameExpr().Text()] = each\n\t\t}\n\t}\n\n\tfor _, apiItem := range apiList {\n\t\tlinePrefix := apiItem.LinePrefix\n\t\terr := p.checkTypes(apiItem, linePrefix, types)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = p.checkServices(apiItem, types, linePrefix)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6b90bf58e3dac273b24080ff8591db6b", "score": "0.46453443", "text": "func (v V1AnnotationForVirusType) IsValid() bool {\n\tfor _, existing := range AllowedV1AnnotationForVirusTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "eaaa1f8e3a8503061e2d01349fd0f87a", "score": "0.4631997", "text": "func isValidLayerType(layerType string) bool {\n\treturn layerType == layerTypeHidden || layerType == layerTypeInput || layerType == layerTypeOutput\n}", "title": "" }, { "docid": "ce9046e9cebb60c7865245e181566584", "score": "0.46319884", "text": "func (_SwapMining *SwapMiningCaller) IsWhitelist(opts *bind.CallOpts, _token common.Address) (bool, error) {\n\tvar out []interface{}\n\terr := _SwapMining.contract.Call(opts, &out, \"isWhitelist\", _token)\n\n\tif err != nil {\n\t\treturn *new(bool), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(bool)).(*bool)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "65d329712de6a8d971a585f11ece1544", "score": "0.46192586", "text": "func isInList(namespaceName string, namespaceList []appsv1alpha1.ResourceDistributionNamespace) bool {\n\tfor _, namespace := range namespaceList {\n\t\tif namespaceName == namespace.Name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "5aac0507a54aacad7e7f32d8a91da8d5", "score": "0.46170884", "text": "func AllowedTier(tier string) bool {\n\treturn allowedTierRegex.MatchString(tier)\n}", "title": "" }, { "docid": "6c09810993f5474d156b8a017cce3601", "score": "0.461648", "text": "func validatePolicy(t *testing.T, policy, expected Policy) {\n\tpolicyType := reflect.TypeOf(policy).String()\n\texpectedType := reflect.TypeOf(expected).String()\n\n\tif policyType != expectedType {\n\t\tt.Errorf(\"expected %q to match %q\", policyType, expectedType)\n\t}\n}", "title": "" }, { "docid": "8bf9a917452ed6bcb255cd6bb25bb266", "score": "0.46161583", "text": "func checkSpendType(tx *sqlx.Tx, id uint) bool {\n\treturn checkModel(tx, \"spend_types\", id)\n}", "title": "" }, { "docid": "21758c2126729afc03cd515944bdcec3", "score": "0.46086287", "text": "func (h *HostResourceManager) checkConsumableIntType(resourceName string, resources map[string]*ecs.Resource) bool {\n\tresourceConsumableStatus := *(h.initialHostResource[resourceName].IntegerValue) >= *(h.consumedResource[resourceName].IntegerValue)+*(resources[resourceName].IntegerValue)\n\treturn resourceConsumableStatus\n}", "title": "" }, { "docid": "8e743b9d9671fef93e04061a2e51872e", "score": "0.46080667", "text": "func (s ServiceType) Validate() error {\n\t// Must have\n\tif _, ok := s[\"@context\"]; ok == false {\n\t\t//return false, fmt.Errorf(\"Must have @context\")\n\t\treturn fmt.Errorf(\"Must have @context\")\n\t}\n\t// Should have\n\tif _, ok := s[\"@id\"]; ok == false {\n\t\t//return false, fmt.Errorf(\"Should have @id\")\n\t\treturn fmt.Errorf(\"Should have @id\")\n\t}\n\t//return true\n\treturn nil\n}", "title": "" }, { "docid": "669cc90b4e783c9e153fa09f97759a5a", "score": "0.4605823", "text": "func HostInWhitelist(host string) bool {\n\tserver, err := ParseServer(host)\n\tif err != nil {\n\t\tlog.Error.Printf(\"%s: got %s\", err, host)\n\t\treturn false\n\t}\n\n\tfor _, v := range Current.ServerWhitelist {\n\t\tif v.Equal(server) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// Automatically whitelist the configured tracer server.\n\tif Current.TracyServer.Equal(server) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ccfb313a9e34ac68e7d3cdeca7d4ba85", "score": "0.46040228", "text": "func canImportDWT(dwNamespace string, dwt *dw.DevWorkspaceTemplate) bool {\n\tif dwNamespace == dwt.Namespace {\n\t\treturn true\n\t}\n\tif dwt.Annotations == nil {\n\t\treturn false\n\t}\n\tnamespacesAnnotation := dwt.Annotations[DWTSupportedNamespacesAnnotation]\n\tswitch namespacesAnnotation {\n\tcase \"\":\n\t\treturn false\n\tcase \"*\":\n\t\treturn true\n\tdefault:\n\t\tnamespaces := strings.Split(namespacesAnnotation, \",\")\n\t\tfor _, ns := range namespaces {\n\t\t\tif ns == dwNamespace {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d7a1586196a18602dee7e3351538f71d", "score": "0.46040127", "text": "func (r ResourceType) Valid() bool {\n\treturn len(r) > 0\n}", "title": "" }, { "docid": "d582fdc5952106ffaa21444182dc77b4", "score": "0.4590309", "text": "func validAnyOf(stack_id string, mem *JSONNode, schema *JSONNode, parent *JSONNode, errs *SchemaErrors) bool {\n\tTrace.Println(stack_id, \"anyOf\")\n\t\n\tvalid := false\n\tschema.ResetIterate()\n\tindex := 1\n\tfor {\n\t\titem := schema.GetNext()\n\t\tif item == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tof := item\n\t\tif of.GetValueType () == V_OBJECT {\n\t\t\tof.ResetIterate()\n\t\t\tof = of.GetNext()\n\t\t}\n\n\t\tinSuppression := false\n\t\tif suppress {\n\t\t\tinSuppression = true\t\n\t\t} else {\n\t\t\tsuppress = true\n\t\t}\n\n\t\tnew_stack_id := stack_id + \".\" + strconv.Itoa(index)\n\t\tindex++\n\t\tvalid = validMember(new_stack_id, \"anyOf\", mem, of)\n\n\t\tif !inSuppression {\n\t\t\tsuppress = false\n\t\t}\n\n\t\tTrace.Println(\" anyOf valid\", valid)\n\t\tif valid {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !valid {\n\t\terrs.Add(mem, \"Did not match any of the anyOf constraints\", JP_ERROR)\n\t\tfor i := range suppressErrors.errorList {\n\t\t\tsuppressErrors.errorList[i].level = JP_INFO\n\t\t\tschemaErrors.errorList = append(schemaErrors.errorList, suppressErrors.errorList[i])\n\t\t}\n\t}\n\n\tsuppressErrors = NewSchemaErrors()\n\n\tTrace.Println(stack_id, \"anyOf\", valid)\n\treturn valid\n}", "title": "" }, { "docid": "3c75bba8e36177b0629a04612eae718a", "score": "0.458878", "text": "func (e WithdrawalType) ValidEnum(v int32) bool {\n\t_, ok := withdrawalTypeMap[v]\n\treturn ok\n}", "title": "" }, { "docid": "a2ea985b35d85f788d3f2d9525929a36", "score": "0.45880914", "text": "func (e TrustLineFlags) ValidEnum(v int32) bool {\n _, ok := trustLineFlagsMap[v]\n return ok\n}", "title": "" }, { "docid": "4088a08235c133e6efb74e3cf2399aac", "score": "0.45829418", "text": "func (l *Limits) EnableNamespacesCheck() bool {\n\treturn l.MaxNamespaces != 0\n}", "title": "" }, { "docid": "0ef567fbb304d5e88e29f075556b2669", "score": "0.45790505", "text": "func (v LogStreamWidgetDefinitionType) IsValid() bool {\n\tfor _, existing := range allowedLogStreamWidgetDefinitionTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "e4d9ace2c68fb382f5f8805e7a4d5bed", "score": "0.45726126", "text": "func ModuleTypeValid(moduleType string) bool {\n\tfor i := range ValidModuleTypes {\n\t\tif moduleType == ValidModuleTypes[i] {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "2527219613bd7012b5fa4e70f2b5b43f", "score": "0.45690942", "text": "func (e EnvelopeType) ValidEnum(v int32) bool {\n _, ok := envelopeTypeMap[v]\n return ok\n}", "title": "" }, { "docid": "2d1a057896f52346b5c506c9a66a0798", "score": "0.45667928", "text": "func validateSourceType(sourceType string) bool {\n\tvalidSourceTypes := []string{\n\t\t\"git\",\n\t\t\"local\",\n\t\t\"binary\",\n\t}\n\tfor _, valid := range validSourceTypes {\n\t\tif valid == sourceType {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "7bd9d6c1c4c4bbb9e048a03b4cc5083b", "score": "0.45649087", "text": "func isSubTypeOfNonRefinedType(e *Environment, t1, t2 types.Type) bool {\n\tswitch t2 := t2.(type) {\n\tcase *refinement.RefinedType:\n\t\treturn types.Identical(t1, t2.Type) && verify(e, refinement.NewRefinedTypeWithTruePredicate(t1), t2)\n\tcase *refinement.DependentSignature:\n\t\tpanic(\"not supported\")\n\tdefault:\n\t\treturn types.Identical(t1, t2)\n\t}\n}", "title": "" }, { "docid": "edaf4cc0e53b7100eca2649df5eddd30", "score": "0.45549145", "text": "func (v TopologyMapWidgetDefinitionType) IsValid() bool {\n\tfor _, existing := range allowedTopologyMapWidgetDefinitionTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "df64834a1227ff5e75e59d7a1e6c1156", "score": "0.45502242", "text": "func (conf *Settings) VerifyType(sType string) bool {\n\t_, ok := ValidTypes[sType]\n\treturn ok\n}", "title": "" }, { "docid": "6488f994e62d302b6e2c6106b84ae87a", "score": "0.45494774", "text": "func (*RoutingPolicy_DefinedSets) IsYANGGoStruct() {}", "title": "" }, { "docid": "6488f994e62d302b6e2c6106b84ae87a", "score": "0.45494774", "text": "func (*RoutingPolicy_DefinedSets) IsYANGGoStruct() {}", "title": "" }, { "docid": "6488f994e62d302b6e2c6106b84ae87a", "score": "0.45494774", "text": "func (*RoutingPolicy_DefinedSets) IsYANGGoStruct() {}", "title": "" }, { "docid": "9d54d2f6280b04758724929b863199a7", "score": "0.45437002", "text": "func (r *Realm) ValidTestType(typ string) bool {\n\tswitch project.TrimSpace(strings.ToLower(typ)) {\n\tcase \"confirmed\":\n\t\treturn r.AllowedTestTypes&TestTypeConfirmed != 0\n\tcase \"likely\":\n\t\treturn r.AllowedTestTypes&TestTypeLikely != 0\n\tcase \"negative\":\n\t\treturn r.AllowedTestTypes&TestTypeNegative != 0\n\tcase \"user-report\":\n\t\treturn r.AllowedTestTypes&TestTypeUserReport != 0\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "c51bdc05606e3c639444b36879bd3273", "score": "0.45419845", "text": "func (s *BaseRuxlangParserListener) EnterTypeAssertion(ctx *TypeAssertionContext) {}", "title": "" }, { "docid": "97be9ab695c91a06ce751869a097bedf", "score": "0.45408827", "text": "func (v ServiceMapWidgetDefinitionType) IsValid() bool {\n\tfor _, existing := range allowedServiceMapWidgetDefinitionTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "ac8bcf1fe035569b4f322823074a1eba", "score": "0.4537002", "text": "func (e PublisherType) IsValid() bool {\n\treturn array.StringInArray(\n\t\tstring(e),\n\t\tstring(PublisherTypeWeb),\n\t\tstring(PublisherTypeAPP),\n\t)\n}", "title": "" }, { "docid": "5c0ae2acc6c5ec9e2acf9b4db4e9609d", "score": "0.4536173", "text": "func (u *Usecase) IsGrantTypeAllowed(grantType string) error {\n\t_, ok := allowedGrantType[grantType]\n\tif !ok {\n\t\treturn errors.New(\"oauth2: grant type is not allowed\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "854eaf466cadf131e0d1d3e440c90764", "score": "0.4536127", "text": "func TestWhitelistImplements(t *testing.T) {\n\tassert.Implements(t, (*AllowedList)(nil), new(Whitelist))\n}", "title": "" }, { "docid": "3fa250a2815fd742f37e3183db322c26", "score": "0.45348427", "text": "func isAuthorizationValid(s string) bool {\n\n\tidx := strings.Index(s, \":\")\n\n\treturn (idx > 0 && idx < len(s)-1)\n}", "title": "" }, { "docid": "eb328ac2ab0d57373f84b2ce7c6a67bd", "score": "0.45338756", "text": "func (v DowntimeIncludedMonitorType) IsValid() bool {\n\tfor _, existing := range allowedDowntimeIncludedMonitorTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "14d4b1579aeff6771d25a7bb92b6da5f", "score": "0.4532602", "text": "func IsValidClientType(client string) bool {\n\tswitch client {\n\tcase string(IRODSFuseType):\n\t\treturn true\n\tcase string(WebdavType):\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "16ca7554ba171f411d41af77f0d6900b", "score": "0.45315307", "text": "func (v ActivityType) IsValid() bool {\n\tfor _, existing := range allowedActivityTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c1791d513d3539d376c6c326ff6d67a5", "score": "0.45304495", "text": "func IsValidIndetifier(ident string) bool {\n\t_, ok := identifiers[strings.ToLower(ident)]\n\treturn ok\n}", "title": "" }, { "docid": "c3f292fec37c17cafa9914396d67d09c", "score": "0.45292443", "text": "func (v V1AnnotationForAssemblyType) IsValid() bool {\n\tfor _, existing := range AllowedV1AnnotationForAssemblyTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b79960a2fcec99242c95bde9c960b14f", "score": "0.45288405", "text": "func (e CreativeTypes) IsValid() bool {\n\treturn array.StringInArray(\n\t\tstring(e),\n\t\tstring(CreativeBannerType),\n\t\tstring(CreativeVastType),\n\t\tstring(CreativeNativeType),\n\t)\n}", "title": "" }, { "docid": "6722832bbc2a4ee18fcb942c4b6c4cb4", "score": "0.45262983", "text": "func (e SignerType) ValidEnum(v int32) bool {\n\t_, ok := signerTypeMap[v]\n\treturn ok\n}", "title": "" }, { "docid": "e45722cff97056cf7c154d3c24295fa4", "score": "0.45214084", "text": "func (v FDXPartyType) IsValid() bool {\n\tfor _, existing := range allowedFDXPartyTypeEnumValues {\n\t\tif existing == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b92890342a29116804c00a712c31bcca", "score": "0.45190609", "text": "func (f *Blacklister) Allows(span *pb.Span) bool {\n\tfor _, entry := range f.list {\n\t\tif entry.MatchString(span.Resource) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "133e7c9c2b6f58dfb11e579f6e955f4f", "score": "0.45181304", "text": "func CheckWhitelist(d *mgo.Database, fileid, pub []byte) bool {\n\tfile := hex.EncodeToString(fileid)\n\tsn := hex.EncodeToString(pub)\n\tresult := new(WhiteList)\n\n\t// return whitelist collection\n\tc := d.C(WilCol)\n\terr := c.Find(bson.M{\"$or\": []bson.M{{\"file\": file, \"list\": sn},\n\t\t{\"file\": file, \"owner\": sn}}}).One(&result)\n\tif err == nil {\n\t\treturn true // no err means the pub is found\n\t}\n\treturn false\n}", "title": "" }, { "docid": "8a226a0cf99e3c61dc40369f8f1dc451", "score": "0.45177647", "text": "func IsInWhitelist(c context.Context, whitelist string) (bool, error) {\n\tif s := GetState(c); s != nil {\n\t\treturn s.DB().IsInWhitelist(c, s.PeerIP(), whitelist)\n\t}\n\treturn false, ErrNotConfigured\n}", "title": "" }, { "docid": "1b6c6b69ab6d01a9810f983e09f75c6e", "score": "0.45158774", "text": "func (o *CreditBankIncomeWarning) HasWarningType() bool {\n\tif o != nil && o.WarningType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
19ae98d99fb72a4649ac8e70fd5f5085
Fill a Block area of Board with a color
[ { "docid": "6627786c78dbab4e00925c2fd0da6ee1", "score": "0.7002835", "text": "func (b *Board) setBlock(x, y int, colour color.Color) {\n\tlength := b.unit\n\tfor i := x * length; i < (x+1)*length; i++ {\n\t\tfor j := y * length; j < (y+1)*length; j++ {\n\t\t\tb.Set(i, j, colour)\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "90a3baa3d3b7da990f177b5aa28b8b89", "score": "0.73135614", "text": "func (b *block) fillBlock(red, green, blue uint8, renderer *sdl.Renderer) {\n\tfor i := 0; i < len(b.pixels); i++ {\n\t\tif b.pixels[i].canChange {\n\t\t\trenderer.SetDrawColor(red, green, blue, 255)\n\t\t\trenderer.FillRect(&b.pixels[i].val)\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "240ed13af4077c5328e8161a16bd9143", "score": "0.6285099", "text": "func (d *Display) Fill(x, y, width, height int, val byte) {\n\td.growBuffer(x+width, y+height)\n\tfor ix := 0; ix < width; ix++ {\n\t\tfor iy := 0; iy < height; iy++ {\n\t\t\td.buffer[y+iy][x+ix] = val\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7d887d0d43d10e48a3014301c68ddbd8", "score": "0.62574506", "text": "func (r Rectangle) Fill(color RGB) {\n\tvar sb strings.Builder\n\tfor r.Height > 0 {\n\t\tr.Height--\n\t\twidth := r.Width\n\t\tfor width > 0 {\n\t\t\twidth--\n\t\t\tsb.WriteByte(' ')\n\t\t}\n\t\tsb.WriteString(\"\\n\" + ansiescape.SetColumn(r.Position.X))\n\t}\n\tterminal.SetPosition(r.Position.Y, r.Position.X)\n\tterminal.BackgroundByRGB(color.Red, color.Green, color.Blue)\n\tprint(sb.String())\n\tterminal.Reset()\n}", "title": "" }, { "docid": "d44ed84007dde62634f6bae664fdbafe", "score": "0.6242668", "text": "func fillRect(img *image.RGBA, r image.Rectangle, idx int) {\n\tmb := macbeth[idx]\n\tcol := color.RGBA{uint8(mb[0]), uint8(mb[1]), uint8(mb[2]), 0xff}\n\tfor y := r.Min.Y; y < r.Max.Y; y++ {\n\t\tfor x := r.Min.X; x < r.Max.X; x++ {\n\t\t\timg.SetRGBA(x, y, col)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f40af65cbddab3f91f4c08994c7fee3f", "score": "0.62271637", "text": "func (b *Buffer) Fill(cell Cell) {\n\tif b.Height == 0 {\n\t\treturn\n\t}\n\t// First set the initial line.\n\tline0 := b.Line(0)\n\tfor x := 0; x < b.Width; x++ {\n\t\tline0[x] = cell\n\t}\n\t// Then used optimized copy() to fill the rest.\n\tfor y := 1; y < b.Height; y++ {\n\t\tcopy(b.Line(y), line0)\n\t}\n}", "title": "" }, { "docid": "79d0ab94428fdd9d36407b7c5a8d12d9", "score": "0.61946493", "text": "func (image *Image) Fill(c Color) {\n\tfor y := 0; y < image.height; y++ {\n\t\tfor x := 0; x < image.width; x++ {\n\t\t\timage.frame[y][x] = c\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c98e0efa917b5ea9109b1f61b926ba3d", "score": "0.6084461", "text": "func (o Canvas) Fill(x1, y1, x2, y2 int, clr Color) {\n\tbounds := image.Rect(x1, o.Height-1-y1, x2, o.Height-1-y2)\n\t// Say(\"Min\", bounds.Min)\n\t// Say(\"Max\", bounds.Max)\n\t// Say(\"Color\", clr)\n\tdraw.Draw(o.Pixels, bounds, &image.Uniform{clr.N}, image.ZP, draw.Src)\n}", "title": "" }, { "docid": "484ab4f977bd6ca8d45c1de3ae489179", "score": "0.6008017", "text": "func (g *GameBoard) SetBlockColoring(i, j int) {\n\n\tswitch g.Blocks[j][i].MainSprite.CSequence {\n\tcase 0: // RED\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 255, G: 0, B: 0, A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 255, G: 0, B: 0, A: 128})\n\t\t}\n\tcase 1: // GREEN\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 0, G: 255, B: 0, A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 0, G: 255, B: 0, A: 128})\n\t\t}\n\tcase 2: // BLUE\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 0, G: 0, B: 255, A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 0, G: 0, B: 255, A: 128})\n\t\t}\n\tcase 3: // YELLOW\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 255, G: 255, B: 0, A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 255, G: 255, B: 0, A: 128})\n\t\t}\n\tcase 4: // VIOLET\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 128, G: 0, B: 128, A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 128, G: 0, B: 128, A: 128})\n\t\t}\n\tcase 5: // GRAY\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 128, G: 128, B: 128, A: 255})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 128, G: 128, B: 128, A: 128})\n\t\t}\n\tcase 6: // MULTI\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: uint8(rand.Intn(255)), G: uint8(rand.Intn(255)), B: uint8(rand.Intn(255)), A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: uint8(rand.Intn(255)), G: uint8(rand.Intn(255)), B: uint8(rand.Intn(255)), A: 128})\n\t\t}\n\tdefault:\n\t\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: 255, G: 255, B: 255, A: 128})\n\t\tfor k := range g.Blocks[j][i].ExplosionSprites {\n\t\t\tg.Blocks[j][i].ExplosionSprites[k].MainSprite.SetColorAndAlpha(sdl.Color{R: 255, G: 255, B: 255, A: 128})\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9a4f6151f7fed16119f58af662f13819", "score": "0.59999484", "text": "func Fill(frame []color.RGBA, c color.RGBA) {\n\tfor i := range frame {\n\t\tframe[i] = c\n\t}\n}", "title": "" }, { "docid": "dc121b60ce7ec637e00c73da0b25f600", "score": "0.59908783", "text": "func (b *block) blockFilled() bool {\n\tif b.coloredPixels > b.minColored {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "355fde75f2c5fb2fcefae5294971a314", "score": "0.5930849", "text": "func (d *Display) Fill(t string, f, b color.Color) {\n\tfor y := d.Rect.Min.Y; y < d.Rect.Max.Y; y++ {\n\t\tfor x := d.Rect.Min.X; x < d.Rect.Max.X; x++ {\n\t\t\td.Set(x, y, t, f, b)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ed50dff81f97d2ee5f6809045d35a6a7", "score": "0.5923438", "text": "func (g *GameBoard) UpdateMultiBlockColor(i, j int) {\n\tg.ColorR += rand.Intn(64)\n\tg.ColorG += rand.Intn(64)\n\tg.ColorB += rand.Intn(64)\n\tg.ColorR %= 256\n\tg.ColorG %= 256\n\tg.ColorB %= 256\n\tg.Blocks[j][i].MainSprite.SetColorAndAlpha(sdl.Color{R: uint8(g.ColorR), G: uint8(g.ColorG), B: uint8(g.ColorB), A: 128})\n}", "title": "" }, { "docid": "6a548398ebb6169abaa28a666ee40362", "score": "0.5892018", "text": "func (cv Canvas) FillBox(x int, y int, w int, h int, ch rune) {\n\tC.caca_fill_box(cv.Cv, C.int(x), C.int(y), C.int(w), C.int(h), C.uint32_t(ch))\n}", "title": "" }, { "docid": "854344ec04683bee023b256dcf738496", "score": "0.5848511", "text": "func (b *block) renderBlock(renderer *sdl.Renderer) {\n\tfor i := 0; i < len(b.pixels); i++ {\n\t\tif b.pixels[i].canChange {\n\t\t\trenderer.SetDrawColor(255, 255, 255, 255)\n\t\t\trenderer.FillRect(&b.pixels[i].val)\n\n\t\t} else {\n\t\t\trenderer.SetDrawColor(0, 0, 0, 255)\n\t\t\trenderer.FillRect(&b.pixels[i].val)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a574c821a119a9dc2a13bbb2393dfd2b", "score": "0.5752949", "text": "func initBlock(blockID int, xIndex int, yIndex int, windowD int, blockDim int) (b block) {\n\n\t//Configure fields for Block\n\tb.dimension = blockDim\n\tb.minColored = 1500\n\tb.isFilled = false\n\tb.owner = -1\n\tb.coloredPixels = 0\n\tb.minColored = 1500\n\tb.blockID = blockID\n\n\t//these must be set layer above, similar to loop below\n\tb.offsetX = xIndex\n\tb.offsetY = yIndex\n\n\tb.pixels = createPixelArray(b.offsetX, b.offsetY, b.dimension)\n\n\treturn b\n}", "title": "" }, { "docid": "b0686196cbdc5948e7b2bc0218a550a7", "score": "0.5734459", "text": "func (i *Image) Fill(clr color.Color) error {\n\trgba := color.RGBAModel.Convert(clr).(color.RGBA)\n\ti.restorable.Fill(rgba)\n\treturn nil\n}", "title": "" }, { "docid": "fd19ba7a15f2144011ad316f981e0e95", "score": "0.5673141", "text": "func (self Shape) Setfillcolor(color Color) void { \n return C.sfShape_setFillColor(self.Cref, sfColor(color));\n}", "title": "" }, { "docid": "f557ea09b6c9b241f5aea53db219a605", "score": "0.56716406", "text": "func initBoardImg() {\n\n\temptycolor := color.RGBA{233, 169, 94, 255}\n\tfor ri, row := range Board {\n\t\tfor ci, block := range row {\n\t\t\tif (block == StoneEmpty) && ci != Cols-1 && ri != Rows-1 {\n\t\t\t\tx, y := ci*BlockSize+BlockSize/2+BlockSize, ri*BlockSize+BlockSize/2+BlockSize\n\t\t\t\tmyimage := image.NewRGBA(image.Rect(x, y, x+BlockSize-1, y+BlockSize-1))\n\n\t\t\t // backfill entire surface with beige\n\t\t\t draw.Draw(BoardImg, myimage.Bounds(), &image.Uniform{emptycolor}, image.ZP, draw.Src)\n\t\t\t} \n\t\t}\n\t}\n}", "title": "" }, { "docid": "d51b939ba716d2014bc4f7751c01cffa", "score": "0.5630332", "text": "func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {\n\tif image[sr][sc] == newColor {\n\t\treturn image\n\t}\n\tdeal(image, sr, sc, image[sr][sc], newColor)\n\treturn image\n}", "title": "" }, { "docid": "4b6516a5b899628f0bfd3291e5cbdd8d", "score": "0.5588243", "text": "func (e *windowsDriver) FillRect(x, y, w, h int, c Color) {\n\tif x > e.width || y > e.height || x+w < 0 || y+h < 0 {\n\t\treturn\n\t}\n\n\tif x < 0 {\n\t\tw += x\n\t\tx = 0\n\t}\n\tif y < 0 {\n\t\th += y\n\t\ty = 0\n\t}\n\tif x+w > e.width {\n\t\tw -= (x + w) - e.width\n\t}\n\tif y+h > e.height {\n\t\th -= (y + h) - e.height\n\t}\n\n\tptr := unsafe.Add(e.backBufferPtr, (y*e.width+x)*4)\n\t//ptr := uintptr(e.backBufferPtr + uintptr((y*e.width+x)*4))\n\tif c.A() != 255 {\n\t\tfor y1 := 0; y1 < h; y1++ {\n\t\t\tfor x1 := 0; x1 < w; x1++ {\n\t\t\t\tp := (*Color)(unsafe.Add(ptr, x1*4))\n\t\t\t\t*p = c.Blend(*p)\n\t\t\t}\n\t\t\tptr = unsafe.Add(ptr, e.width*4)\n\t\t}\n\t} else {\n\t\tfor i := uintptr(0); i < uintptr(w); i++ {\n\t\t\t*(*Color)(unsafe.Add(ptr, i*4)) = c\n\t\t}\n\t\tfor i := 1; i < h; i++ {\n\t\t\tcopy(e.backBuffer[(y+i)*e.width+x:], e.backBuffer[(y+i-1)*e.width+x:(y+i-1)*e.width+x+w])\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6d34abd1abdd0ec90fb8ef61a27925c6", "score": "0.55856675", "text": "func (board *Board) FillWith(cellType CellType) {\n\tfor i := range board.matrix {\n\t\tfor e := range board.matrix[i] {\n\t\t\tboard.matrix[i][e] = &Cell{cellType.CastToCharacter(), cellType}\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ad2c9ed62b67f78bfebda9eaa11205be", "score": "0.55510265", "text": "func (board *Board) FillInnerBox() {\n\n\tk := 0\n\n\tfor i := 0; i < Width; i++ {\n\t\tfor j := 0; j < Height; j++ {\n\t\t\tboard.InnerBox[i][j].Value = board.AllValues[k]\n\t\t\tk++\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5e92a5dfc6eb4d019bffaa2f61b63f79", "score": "0.5519236", "text": "func (b BufferedCanvas) FillTestRect() {\n\tbound := b.c.rectangle.Max\n\tc := color.NRGBA{G: 128, A: 255}\n\n\tfor i := bound.X / 2; i < bound.X; i++ {\n\t\tfor j := bound.Y / 2; j < bound.Y; j++ {\n\t\t\tb.Set(i, j, c)\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "eade246eb55f4ba9d320fe4a221131f0", "score": "0.5476694", "text": "func FillRectangle(x, y, width, height, char int) {\n\tC.fillrect(\n\t\tC.int(x),\n\t\tC.int(y),\n\t\tC.int(width),\n\t\tC.int(height),\n\t\tC.int(color),\n\t)\n}", "title": "" }, { "docid": "192e55ba46c31f2151ec21c77d132da7", "score": "0.54243976", "text": "func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {\n\tif image[sr][sc] == newColor {\n\t\treturn image\n\t}\n\tdfs(image, sr, sc, image[sr][sc], newColor, len(image), len(image[0]))\n\treturn image\n}", "title": "" }, { "docid": "750cea783cb417f7a6475e24c300a86e", "score": "0.54154116", "text": "func (d *Device) FillRectangle(x, y, width, height int16, c color.RGBA) error {\n\tif x < 0 || y < 0 || width <= 0 || height <= 0 ||\n\t\tx >= d.width || (x+width) > d.width || y >= d.height || (y+height) > d.height {\n\t\treturn errors.New(\"rectangle coordinates outside display area\")\n\t}\n\td.setWindow(x, y, width, height)\n\tc565 := RGBATo565(c)\n\tc1 := uint8(c565 >> 8)\n\tc2 := uint8(c565)\n\n\tvar i int16\n\tfor i = 0; i < d.batchLength; i++ {\n\t\td.batchData[i*2] = c1\n\t\td.batchData[i*2+1] = c2\n\t}\n\ti = width * height\n\tfor i > 0 {\n\t\tif i >= d.batchLength {\n\t\t\td.Tx(d.batchData, false)\n\t\t} else {\n\t\t\td.Tx(d.batchData[:i*2], false)\n\t\t}\n\t\ti -= d.batchLength\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f86a66934888e385f9cda4950897e290", "score": "0.54096127", "text": "func floodFill(base *image.Gray, level byte, x, y int) image.Rectangle {\n\tbbox := image.Rect(x, y, x, y)\n\tcur := []int{y*base.Stride + x}\n\tfor len(cur) > 0 {\n\t\tvar pix []int\n\t\ttry := func(j int) {\n\t\t\tif base.Pix[j] != 0 && base.Pix[j] != 254 && base.Pix[j] != level {\n\t\t\t\tbase.Pix[j] = level\n\t\t\t\tpix = append(pix, j)\n\t\t\t\tx := j % base.Stride\n\t\t\t\ty := j / base.Stride\n\t\t\t\tif x < bbox.Min.X {\n\t\t\t\t\tbbox.Min.X = x\n\t\t\t\t}\n\t\t\t\tif x > bbox.Max.X {\n\t\t\t\t\tbbox.Max.X = x\n\t\t\t\t}\n\t\t\t\tif y < bbox.Min.Y {\n\t\t\t\t\tbbox.Min.Y = y\n\t\t\t\t}\n\t\t\t\tif y > bbox.Max.Y {\n\t\t\t\t\tbbox.Max.Y = y\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor _, i := range cur {\n\t\t\tif i%base.Stride != 0 {\n\t\t\t\ttry(i - 1)\n\t\t\t}\n\n\t\t\tif i%base.Stride != base.Stride-1 {\n\t\t\t\ttry(i + 1)\n\t\t\t}\n\t\t\tif i/base.Stride > 0 {\n\t\t\t\ttry(i - base.Stride)\n\t\t\t}\n\t\t\tif i/base.Stride < base.Bounds().Dy()-1 {\n\t\t\t\ttry(i + base.Stride)\n\t\t\t}\n\t\t}\n\t\tcur = pix\n\t}\n\treturn bbox\n}", "title": "" }, { "docid": "e7ebcf1204e86995a0f1c28f3871f536", "score": "0.5344009", "text": "func (b *block) drawOnBlock(renderer *sdl.Renderer, mouseX int, mouseY int, blockDim int, p *player) {\n\tblockIndex := (mouseX - b.offsetX) + (mouseY-b.offsetY)*blockDim\n\n\tif b.pixels[blockIndex].canChange {\n\t\trenderer.SetDrawColor(255, 0, 0, 255)\n\t\trenderer.FillRect(&b.pixels[blockIndex].val)\n\t\tb.coloredPixels++\n\t}\n}", "title": "" }, { "docid": "ea79160da6c9ece153ef28e093dd7d32", "score": "0.5328827", "text": "func (d *Device) FillRectangle(x, y, width, height int16, c color.RGBA) error {\n\tk, i := d.Size()\n\tif x < 0 || y < 0 || width <= 0 || height <= 0 ||\n\t\tx >= k || (x+width) > k || y >= i || (y+height) > i {\n\t\treturn errors.New(\"rectangle coordinates outside display area\")\n\t}\n\td.SetWindow()\n\tc565 := RGBATo565(c)\n\tc1 := uint8(c565)\n\tc2 := uint8(c565 >> 8)\n\n\tdata := make([]uint8, 240*2)\n\tfor i := int32(0); i < 240; i++ {\n\t\tdata[i*2] = c1\n\t\tdata[i*2+1] = c2\n\t}\n\tj := int32(width) * int32(height)\n\tfor j > 0 {\n\t\tif j >= 240 {\n\t\t\td.SendData(data)\n\t\t} else {\n\t\t\td.SendData(data[:j*2])\n\t\t}\n\t\tj -= 240\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7ba60096d43e3fb9f60f468af343d3a9", "score": "0.53041244", "text": "func NewFill(width, height int, value rune) Canvas {\n\tc := make([][]NullRune, height)\n\n\tfor i := range c {\n\t\trow := make([]NullRune, width)\n\t\tfor j := range row {\n\t\t\trow[j].Set(value)\n\t\t}\n\t\tc[i] = row\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "2b97916434c678ba18973a0d595df72e", "score": "0.5299714", "text": "func renderBoard(width, left, top, right, bottom int) {\n\tfor i := top; i < bottom; i++ {\n\t\tsetCell(left-1, i, COL)\n\t\tsetCell(right, i, COL)\n\t}\n\n\tsetCell(left-1, top, '┌')\n\tsetCell(left-1, bottom, '└')\n\tsetCell(right, top, '┐')\n\tsetCell(right, bottom, '┘')\n\n\tfill(left, top, width, 1, termbox.Cell{Ch: ROW})\n\tfill(left, bottom, width, 1, termbox.Cell{Ch: ROW})\n}", "title": "" }, { "docid": "721ff466f787786b196971ca17e82e49", "score": "0.529515", "text": "func floodFill2(image [][]int, sr int, sc int, newColor int) [][]int {\n\tR, C := len(image), len(image[0])\n\tstartColor := image[sr][sc]\n\n\tif startColor == newColor {\n\t\treturn image\n\t}\n\n\tstack := [][]int{{sr, sc}}\n\timage[sr][sc] = newColor\n\tdirs := [][]int{{-1, 0}, {0, 1}, {1, 0}, {0, -1}}\n\tfor len(stack) > 0 {\n\t\tnode := stack[len(stack)-1]\n\t\tr, c := node[0], node[1]\n\t\tstack = stack[:len(stack)-1]\n\n\t\tfor _, d := range dirs {\n\t\t\tdr, dc := d[0], d[1]\n\t\t\tnr, nc := r+dr, c+dc\n\n\t\t\tif nr >= 0 && nr < R && nc >= 0 && nc < C && image[nr][nc] == startColor {\n\t\t\t\tstack = append(stack, []int{nr, nc})\n\t\t\t\timage[nr][nc] = newColor\n\t\t\t}\n\t\t}\n\t}\n\treturn image\n}", "title": "" }, { "docid": "339426cb6a8a2e72b784ab278aee4d23", "score": "0.52459055", "text": "func (b *Board) setPiece(r, c int, val Block) {\n\tb[r][c] = val\n}", "title": "" }, { "docid": "9cb9121b37f04b12eb7218b20bfe5c47", "score": "0.5202613", "text": "func (game *Game) clearLines() {\n\tvar board [RowCount][ColCount]int\n\tfor _, dot := range game.FilledArea {\n\t\tif dot.Y == RowCount-1 {\n\t\t\tfmt.Println(\"game over\")\n\t\t\tgame.IsGameOver = true\n\t\t\treturn\n\t\t}\n\t\tboard[dot.Y][dot.X] = -1\n\t}\n\n\t// Remove rows which are filled\n\tfor i := 0; i < RowCount; i++ {\n\t\trowFilled := true\n\t\tfor j := 0; j < ColCount; j++ {\n\t\t\tif board[i][j] != -1 {\n\t\t\t\trowFilled = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif rowFilled {\n\t\t\tfor j := 0; j < ColCount; j++ {\n\t\t\t\tboard[i][j] = 0\n\t\t\t}\n\t\t}\n\t}\n\n\t// find groups using flood fill algorithm\n\tgroupNum := 0\n\tfor i := 0; i < RowCount; i++ {\n\t\tfor j := 0; j < ColCount; j++ {\n\t\t\tif board[i][j] != -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgroupNum++\n\t\t\tfillGroup(i, j, groupNum, &board)\n\t\t}\n\t}\n\n\t// go through each group and move each group down until any dot of each group reaches the bottom or collides with other group\n\tfor gr := 1; gr <= groupNum; gr++ {\n\t\tcanGoDown, groupDots := groupCanGoDown(&board, gr)\n\n\t\tfor canGoDown {\n\t\t\tfor _, dot := range groupDots {\n\t\t\t\tboard[dot.Y][dot.X] = 0\n\t\t\t\tboard[dot.Y-1][dot.X] = gr\n\t\t\t}\n\t\t\tcanGoDown, groupDots = groupCanGoDown(&board, gr)\n\t\t}\n\t}\n\n\tvar newFilledArea []BoardPos\n\n\tfor i := 0; i < RowCount; i++ {\n\t\tfor j := 0; j < ColCount; j++ {\n\t\t\tif board[i][j] != 0 {\n\t\t\t\tnewFilledArea = append(newFilledArea, BoardPos{j, i})\n\t\t\t}\n\t\t}\n\t}\n\n\tgame.FilledArea = newFilledArea\n}", "title": "" }, { "docid": "707d201dc4cf81431580474378798a45", "score": "0.5180717", "text": "func DrawBoard(board *Board, canvasWidth, cellWidth, q int) canvas.Canvas {\n\theight := len(board.cells) * cellWidth\n\twidth := len(board.cells) * cellWidth\n\tpic := canvas.CreateNewCanvas(width, height)\n\t// Color definitions\n\n\t/*\n\t\tblue := canvas.MakeColor(0, 0, 255)\n\t\tred := canvas.MakeColor(255, 0, 0)\n\t\tgreen := canvas.MakeColor(0, 255, 0)\n\t\tblack := canvas.MakeColor(0, 0, 0)\n\t*/\n\t// Set up canvas\n\n\tpic.SetFillColor(canvas.MakeColor(0, 0, 0))\n\tpic.ClearRect(0, 0, canvasWidth, canvasWidth)\n\tpic.Fill()\n\tfor i, cell := range board.cells {\n\t\t// Create Color based on proportion of classes\n\t\tS, I, R := ClassSum(cell, q)\n\t\tn1, n2, n3 := uint8(int(S*float64(255))), uint8(int(I*float64(255))), uint8(int(R*float64(255)))\n\t\tfmt.Println(n1, n2, n3)\n\t\tcc := canvas.MakeColor(n1, n2, n3)\n\t\tpic.SetFillColor(cc)\n\t\t//Coordinates of corner from which to draw the rectangle\n\t\tx := i * cellWidth\n\t\ty := 2 * cellWidth\n\t\tpic.ClearRect(x, y, x+cellWidth, y+cellWidth)\n\t\tpic.Fill()\n\n\t}\n\n\treturn pic\n}", "title": "" }, { "docid": "82ec819b48264420262b9c75f2fd1560", "score": "0.51805", "text": "func (node *RBNode) setBlack() {\n node.Color = true\n}", "title": "" }, { "docid": "e27adefa87c2254f578dc89711787c73", "score": "0.5180307", "text": "func (self Shape) Getfillcolor() Color { \n return C.sfShape_getFillColor(self.Cref);\n}", "title": "" }, { "docid": "7482549f360670f0364dba8bac17129c", "score": "0.517592", "text": "func PopulateBoard(b *board) {\n\tminesSoFar := b.mineCount\n\tfor {\n\t\tspotW := b.myRandom.Intn(b.width)\n\t\tspotH := b.myRandom.Intn(b.height)\n\t\tif b.actualBoard[spotH][spotW] != MINE {\n\t\t\tb.actualBoard[spotH][spotW] = MINE\n\t\t\tminesSoFar--\n\t\t\tif minesSoFar == 0 {\n\t\t\t\tsetBoardCounts(b)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "b0eac913e9c48cc2bf50cd0f708390ac", "score": "0.5152083", "text": "func (p *Path) Fill(dst *ebiten.Image, op *FillOptions) {\n\tvar vertices []ebiten.Vertex\n\tvar indices []uint16\n\n\tif op.Color == nil {\n\t\treturn\n\t}\n\n\tr, g, b, a := op.Color.RGBA()\n\tvar rf, gf, bf, af float32\n\tif a == 0 {\n\t\treturn\n\t}\n\trf = float32(r) / float32(a)\n\tgf = float32(g) / float32(a)\n\tbf = float32(b) / float32(a)\n\taf = float32(a) / 0xffff\n\n\tvar base uint16\n\tfor _, seg := range p.segs {\n\t\tfor _, pt := range seg {\n\t\t\tvertices = append(vertices, ebiten.Vertex{\n\t\t\t\tDstX: pt.X,\n\t\t\t\tDstY: pt.Y,\n\t\t\t\tSrcX: 0,\n\t\t\t\tSrcY: 0,\n\t\t\t\tColorR: rf,\n\t\t\t\tColorG: gf,\n\t\t\t\tColorB: bf,\n\t\t\t\tColorA: af,\n\t\t\t})\n\t\t}\n\t\tfor _, idx := range triangulate.Triangulate(seg) {\n\t\t\tindices = append(indices, idx+base)\n\t\t}\n\t\tbase += uint16(len(seg))\n\t}\n\tdst.DrawTriangles(vertices, indices, emptyImage, nil)\n}", "title": "" }, { "docid": "193404a12e4b142648b5bdd7a5b0e02c", "score": "0.514243", "text": "func (t *BlockImg) At(x, y int) color.Color {\n\treturn color.White\n}", "title": "" }, { "docid": "d372d495be3ba3296729227e3a53ef1f", "score": "0.51377684", "text": "func (s *Scene) luaExportComponentFill(mt *lua.LTable) {\n\tfillTable := s.Lua.NewTypeMetatable(luaFillComponentName)\n\n\ts.Lua.SetField(fillTable, \"add\", s.Lua.NewFunction(s.luaFillAdd()))\n\ts.Lua.SetField(fillTable, \"get\", s.Lua.NewFunction(s.luaFillGet()))\n\ts.Lua.SetField(fillTable, \"remove\", s.Lua.NewFunction(s.luaFillRemove()))\n\n\ts.Lua.SetField(mt, luaFillComponentName, fillTable)\n}", "title": "" }, { "docid": "cf6800f51124a59fc641c150a4e2a87d", "score": "0.5108489", "text": "func (m *Mat4) Fill(content float32) {\n\tfor i := range m {\n\t\tm[i] = content\n\t}\n}", "title": "" }, { "docid": "8ffd434083cd6dd3dedb5e9349f0b939", "score": "0.5102079", "text": "func (m *Map) Fill(content [][]int, xBegin, xEnd, yBegin, yEnd int) {\n\tfor i := xBegin; i < xEnd; i++ {\n\t\tfor k := yBegin; k < yEnd; k++ {\n\t\t\tm.array[i][k] = content[i][k]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0371c31c319c0e06b83cf4c51e45bad8", "score": "0.51014024", "text": "func parseBlock(image image.Image, minX int,minY int,maxX int,maxY int) []uint64{\n\tvar totalRed uint64\n\tvar totalGreen uint64\n\tvar totalBlue uint64\n\ttotalRed = 0\n\ttotalGreen = 0\n\ttotalBlue = 0\n\n\tfor y := minY; y < maxY; y++ {\n\t\tfor x := minX; x < maxX; x++ {\n\t\t\tred , green, blue, _ := image.At(int(x),int(y)).RGBA()\n\t\t\ttotalRed += uint64(red);\n\t\t\ttotalGreen += uint64(green);\n\t\t\ttotalBlue += uint64(blue);\n\t\t}\n\t}\n\taverageColor := make([]uint64,3)\n\tnumBlocks := uint64((maxY-minY)*(maxX-minX))\n\taverageColor[0] = (totalRed / numBlocks)/255\n\taverageColor[1] = (totalGreen / numBlocks)/255\n\taverageColor[2] = (totalBlue / numBlocks)/255\n\t//average color can theoretically reach values of 256. Reducing a value of 256 to 255 is necessary to avoid overflow errors.\n\tif averageColor[0] >= 256 {averageColor[0]=255}\n\tif averageColor[1] >= 256 {averageColor[1]=255}\n\tif averageColor[2] >= 256 {averageColor[2]=255}\n\treturn averageColor\n}", "title": "" }, { "docid": "349744f4fa7a1c6b472b99ec5000c428", "score": "0.50618637", "text": "func (o Canvas) Set(x, y int, clr Color) {\n\tif o.Includes(x, y) {\n\t\to.Pixels.SetNRGBA(x, o.Height-1-y, clr.N)\n\t}\n}", "title": "" }, { "docid": "b10cf6b4eff57059a1600c920ad50095", "score": "0.50516576", "text": "func (b *Board) displayBoard(win *pixelgl.Window) {\n\tboardBlockSize := 20.0 //win.Bounds().Max.X / 10\n\tpic := blockGen(0)\n\timgSize := pic.Bounds().Max.X\n\tscaleFactor := float64(boardBlockSize) / float64(imgSize)\n\n\tfor col := 0; col < BoardCols; col++ {\n\t\tfor row := 0; row < BoardRows-2; row++ {\n\t\t\tval := b[row][col]\n\t\t\tif val == Empty {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tx := float64(col)*boardBlockSize + boardBlockSize/2\n\t\t\ty := float64(row)*boardBlockSize + boardBlockSize/2\n\t\t\tpic := blockGen(block2spriteIdx(val))\n\t\t\tsprite := pixel.NewSprite(pic, pic.Bounds())\n\t\t\tsprite.Draw(win, pixel.IM.Scaled(pixel.ZV, scaleFactor).Moved(pixel.V(x+282, y+25)))\n\t\t}\n\t}\n\n\t// Display Shadow\n\tpieceType := b[activeShape[0].row][activeShape[0].col]\n\tghostShape := activeShape\n\tb.drawPiece(activeShape, Empty)\n\tfor {\n\t\tif b.checkCollision(moveShapeDown(ghostShape)) {\n\t\t\tbreak\n\t\t}\n\t\tghostShape = moveShapeDown(ghostShape)\n\t}\n\tb.drawPiece(activeShape, pieceType)\n\n\tgpic := blockGen(block2spriteIdx(Gray))\n\tsprite := pixel.NewSprite(gpic, gpic.Bounds())\n\tfor i := 0; i < 4; i++ {\n\t\tif b[ghostShape[i].row][ghostShape[i].col] == Empty {\n\t\t\tx := float64(ghostShape[i].col)*boardBlockSize + boardBlockSize/2\n\t\t\ty := float64(ghostShape[i].row)*boardBlockSize + boardBlockSize/2\n\t\t\tsprite.Draw(win, pixel.IM.Scaled(pixel.ZV, scaleFactor/2).Moved(pixel.V(x+282, y+25)))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1947b62d8db156fe4c31d6f558a10d07", "score": "0.5039775", "text": "func (fb SPIFB) Fill(p SPIFB) {\n\tdst := fb.Bytes()\n\tsrc := p.Bytes()\n\tfor i := 0; i < len(dst); i += copy(dst[i:], src) {\n\t}\n}", "title": "" }, { "docid": "431854b6bb350ec83b84bca99d57c352", "score": "0.5023783", "text": "func (m *Mono) FillRect(color color.Color, rect image.Rectangle) {\n\tw := rect.Dx()\n\tdown := image.Pt(0, 1)\n\tfor start := rect.Min; start.Y <= rect.Max.Y; start = start.Add(down) {\n\t\tm.DrawHorizontalLine(color, start, w)\n\t}\n}", "title": "" }, { "docid": "7526f4f7d48d8ea4ad6a1dab1efae2ce", "score": "0.5012966", "text": "func (r *Rectangle) SetColor(color mgl32.Vec3) {\n\tfor i := 0; i < 4; i++ {\n\t\tr.colors[i] = color\n\t}\n}", "title": "" }, { "docid": "49c711defa6d556967f26b954faae109", "score": "0.5002228", "text": "func DrawBoard(b *Board) {\n\t// start := time.Now()\n\tvar c []int\n\tvar d string\n\t// fmt.Println(\"_______Drawing_Board_Started_______\")\n\n\tfmt.Println(\" A B C D E F G H\")\n\n\tfmt.Println(\" +---|---|---|---|---|---|---|---+\")\n\tfor i := 7; i >= 0; i-- {\n\t\tc = b.square[i*8 : (i+1)*8]\n\t\tfor j := 0; j < 8; j++ {\n\t\t\td = string(display[c[j]])\n\t\t\t// d = string(c[i])\n\t\t\t// d = \"p\"\n\n\t\t\tif j == 7 {\n\t\t\t\tfmt.Printf(\"%2s |%2v\", d, i+1)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j == 0 {\n\t\t\t\tfmt.Printf(\"%1v |%2s |\", i+1, d)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Printf(\"%2s |\", d)\n\t\t}\n\t\tfmt.Println()\n\t\tfmt.Println(\" +---|---|---|---|---|---|---|---+\")\n\n\t}\n\tfmt.Println(\" A B C D E F G H\")\n\t// fmt.Println(\"_______Drawing_Board_Ended_______\\n\", time.Since(start))\n\n}", "title": "" }, { "docid": "5b93b889dbdb18fd91f3c69c5155e286", "score": "0.49918485", "text": "func (c *Canvas) Fill(p vg.Path) {\n\tc.Push()\n\tc.wstyle()\n\tc.wpath(p)\n\tc.wtex(`\\pgfusepath{fill}`)\n\tc.Pop()\n}", "title": "" }, { "docid": "dbfa752f8495157e27406bc98dbca7f2", "score": "0.49874124", "text": "func (s *Slush) SetColor(color int){\n\ts.Col = color\n}", "title": "" }, { "docid": "ec79f45756bcd32c38d8a8f592ab4774", "score": "0.4981496", "text": "func (b *Board) Set(r, c, value int) {\n b.cell[r][c] = value\n}", "title": "" }, { "docid": "62a749938e0a5a573ae165ded6d54239", "score": "0.49746034", "text": "func (g *Gui) setFillColor(c color.Color) {\n\tg.cfg.color.fill = c\n}", "title": "" }, { "docid": "2ed9440d7a4570a7404ea605bc3658f7", "score": "0.4956168", "text": "func genBoard() {\n\t// Create a \"frame\":\n\tfor ri := range Board {\n\t\tBoard[ri][0] = StoneEmpty\n\t}\n\tfor ci := range Board[0] {\n\t\tBoard[0][ci] = StoneEmpty\n\t}\n}", "title": "" }, { "docid": "213126674a4545813fb2805c93009bf2", "score": "0.49520665", "text": "func pushColor(dst *image.RGBA, strength float64) {\n\tgetLightest := func(mc, a, b, c *color.RGBA) {\n\t\tmc.R = unFloat(float64(mc.R)*(1.0-strength) + ((float64(a.R)+float64(b.R)+float64(c.R))/3.0)*strength)\n\t\tmc.G = unFloat(float64(mc.G)*(1.0-strength) + ((float64(a.G)+float64(b.G)+float64(c.G))/3.0)*strength)\n\t\tmc.B = unFloat(float64(mc.B)*(1.0-strength) + ((float64(a.B)+float64(b.B)+float64(c.B))/3.0)*strength)\n\t\tmc.A = unFloat(float64(mc.A)*(1.0-strength) + ((float64(a.A)+float64(b.A)+float64(c.A))/3.0)*strength)\n\t}\n\n\tchangeEachPixel(dst, func(x, y int, p *color.RGBA) color.RGBA {\n\t\txn, xp, yn, yp := -1, 1, -1, 1\n\t\tif x == 0 {\n\t\t\txn = 0\n\t\t} else if x == dst.Bounds().Dx()-1 {\n\t\t\txp = 0\n\t\t}\n\t\tif y == 0 {\n\t\t\tyn = 0\n\t\t} else if y == dst.Bounds().Dy()-1 {\n\t\t\typ = 0\n\t\t}\n\n\t\ttl, tc, tr := dst.RGBAAt(x+xn, y+yn), dst.RGBAAt(x, y+yn), dst.RGBAAt(x+xp, y+yn)\n\t\tml, mc, mr := dst.RGBAAt(x+xn, y), *p, dst.RGBAAt(x+xp, y)\n\t\tbl, bc, br := dst.RGBAAt(x+xn, y+yp), dst.RGBAAt(x, y+yp), dst.RGBAAt(x+xn, y+yp)\n\n\t\t//top and bottom\n\t\tmaxD := max(bl.A, bc.A, br.A)\n\t\tminL := min(tl.A, tc.A, tr.A)\n\t\tif minL > mc.A && mc.A > maxD {\n\t\t\tgetLightest(&mc, &tl, &tc, &tr)\n\t\t} else {\n\t\t\tmaxD = max(tl.A, tc.A, tr.A)\n\t\t\tminL = min(bl.A, bc.A, br.A)\n\t\t\tif minL > mc.A && mc.A > maxD {\n\t\t\t\tgetLightest(&mc, &bl, &bc, &br)\n\t\t\t}\n\t\t}\n\n\t\t//subdiagonal\n\t\tmaxD = max(ml.A, mc.A, bc.A)\n\t\tminL = min(mr.A, tc.A, tr.A)\n\t\tif minL > maxD {\n\t\t\tgetLightest(&mc, &mr, &tc, &tr)\n\t\t} else {\n\t\t\tmaxD = max(mc.A, mr.A, tc.A)\n\t\t\tminL = min(bl.A, ml.A, bc.A)\n\t\t\tif minL > maxD {\n\t\t\t\tgetLightest(&mc, &bl, &ml, &bc)\n\t\t\t}\n\t\t}\n\n\t\t//left and right\n\t\tmaxD = max(tl.A, ml.A, bl.A)\n\t\tminL = min(tr.A, mr.A, br.A)\n\t\tif minL > mc.A && mc.A > maxD {\n\t\t\tgetLightest(&mc, &tr, &mr, &br)\n\t\t} else {\n\t\t\tmaxD = max(tr.A, mr.A, br.A)\n\t\t\tminL = min(tl.A, ml.A, bl.A)\n\t\t\tif minL > mc.A && mc.A > maxD {\n\t\t\t\tgetLightest(&mc, &tl, &ml, &bl)\n\t\t\t}\n\t\t}\n\n\t\t//diagonal\n\t\tmaxD = max(ml.A, mc.A, tc.A)\n\t\tminL = min(mr.A, br.A, bc.A)\n\t\tif minL > maxD {\n\t\t\tgetLightest(&mc, &mr, &br, &tc)\n\t\t} else {\n\t\t\tmaxD = max(mc.A, mr.A, bc.A)\n\t\t\tminL = min(tc.A, ml.A, tl.A)\n\t\t\tif minL > maxD {\n\t\t\t\tgetLightest(&mc, &tc, &ml, &tl)\n\t\t\t}\n\t\t}\n\n\t\treturn mc\n\t})\n}", "title": "" }, { "docid": "1336a3012c1cfe8d9a8bdec4e771ad5e", "score": "0.49477053", "text": "func (t Term) Fill() Term {\n\treturn constructMethodTerm(t, \"Fill\", p.Term_FILL, []interface{}{}, map[string]interface{}{})\n}", "title": "" }, { "docid": "f0acbbae189aaaa8b1e034cdd8c6113d", "score": "0.49437144", "text": "func (b Board) Block(row, col int) Segment {\r\n\ts := Segment{}\r\n\r\n\tblockRow := row / 3\r\n\tblockCol := col / 3\r\n\r\n\tfor i := 0; i < 3; i++ {\r\n\t\tfor j := 0; j < 3; j++ {\r\n\r\n\t\t\ttPos := i*3 + j\r\n\r\n\t\t\ts[tPos] = b[blockRow*3+i][blockCol*3+j]\r\n\t\t}\r\n\t}\r\n\r\n\treturn s\r\n}", "title": "" }, { "docid": "9b0c33f464e4f527fc24fedb8845159a", "score": "0.49394053", "text": "func DoRender(p Plan, canvas *svg.SVG) {\n\tbrickWidth, brickHeight := GetDimensionsForBlock(p.Orig().Orientation())\n\n\tcanvas.Gid(\"blocks\")\n\tbricksByColor := make(map[BrickColor][]PlacedBrick)\n\tfor _, b := range p.Pieces() {\n\t\tbricksByColor[b.Color] = append(bricksByColor[b.Color], b)\n\t}\n\t//Draw the blocks of color\n\t// Draw outlines around each piece\n\tfor color, bricks := range bricksByColor {\n\t\tcanvas.Gid(fmt.Sprintf(\"blocks-%v\", color))\n\t\tfor _, piece := range bricks {\n\t\t\torigin := piece.Origin\n\t\t\tfor _, loc := range piece.Extent() {\n\t\t\t\ttranslated := origin.Add(loc)\n\t\t\t\tstartX := translated.Col * brickWidth\n\t\t\t\tstartY := translated.Row * brickHeight\n\t\t\t\t// In range 0, 65535; need to convert to 0-255\n\t\t\t\tr, g, b, _ := color.RGBA()\n\t\t\t\tcolorStr := canvas.RGB(int(r/255), int(g/255), int(b/255))\n\t\t\t\tcanvas.Rect(startX, startY, brickWidth, brickHeight, colorStr)\n\t\t\t}\n\t\t}\n\t\tcanvas.Gend()\n\t}\n\tcanvas.Gend()\n\n\tcanvas.Gid(\"block_outlines\")\n\t// Draw outlines around each piece\n\tfor _, piece := range p.Pieces() {\n\t\tloc := piece.Origin\n\t\tminRow, minCol, maxRow, maxCol := BoundingBox(piece, loc)\n\n\t\t// Offset by one because we draw to where it ends. e.g. if it takes up only one\n\t\t// row or column, we still need to draw it as if it went into right before the\n\t\t// next row or column.\n\t\tstartX := minCol * brickWidth\n\t\tendX := (maxCol + 1) * brickWidth\n\n\t\tstartY := minRow * brickHeight\n\t\tendY := (maxRow + 1) * brickHeight\n\n\t\twidth := endX - startX\n\t\theight := endY - startY\n\n\t\tstyle := \"fill='none' stroke='gray'\"\n\t\tcanvas.Rect(startX, startY, width, height, style)\n\t}\n\tcanvas.Gend()\n\n\t/*\n\t\tcanvas.Gid(\"gridlines\")\n\t\timageWidth := brickWidth * p.Orig().NumCols()\n\t\timageHeight := brickHeight * p.Orig().NumRows()\n\n\t\tmajorOpacity := 0.5\n\t\tminorOpacity := 0.2\n\n\t\t// Draw the grid lines, with darker lines around 'canonical' piece in this orientation.\n\t\tdarkRow, darkCol := canonicalSpacing(p.Orig().Orientation())\n\t\tfor row := 0; row < p.Orig().NumRows()+1; row++ {\n\t\t\ty := int(row * brickHeight)\n\t\t\talpha := minorOpacity\n\t\t\tif row > 0 && row%darkRow == 0 {\n\t\t\t\talpha = majorOpacity\n\t\t\t}\n\t\t\tstyle := strings.Replace(canvas.RGBA(255, 0, 0, alpha), \"fill\", \"stroke\", -1)\n\n\t\t\t// Workaround for bug - need stroke- not file\n\t\t\tcanvas.Line(0, y, imageWidth, y, style)\n\t\t}\n\n\t\t// Vertical grid lines\n\t\tfor col := 0; col < p.Orig().NumCols()+1; col++ {\n\t\t\tx := int(col * brickWidth)\n\t\t\talpha := minorOpacity\n\t\t\tif col > 0 && col%darkCol == 0 {\n\t\t\t\talpha = majorOpacity\n\t\t\t}\n\t\t\tstyle := strings.Replace(canvas.RGBA(255, 0, 0, alpha), \"fill\", \"stroke\", -1)\n\t\t\tcanvas.Line(x, 0, x, imageHeight, style)\n\t\t}\n\t\tcanvas.Gend()*/\n}", "title": "" }, { "docid": "4a1c549f215818483dadf3295e322f95", "score": "0.49285132", "text": "func FillGrid(f Fillable, val bool) {\n\tx, y := f.GetPos()\n\tw, h := f.GetSize()\n\tminx, miny := (int(x) / GridSize), (int(y) / GridSize)\n\tmaxx, maxy := int(x+w)/GridSize, int(y+h)/GridSize\n\n\tGrid[minx][miny] = val\n\n\tfor i := minx; i < maxx; i += 1 {\n\t\tfor j := miny; j < maxy; j += 1 {\n\t\t\tGrid[i][j] = val\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fd1ffbb7c1bdf8c8a45135a70bbb4b03", "score": "0.49272197", "text": "func paint(start, stop, h int, i *image.RGBA, cl color.RGBA) {\n\tfor w := start; w < stop; w++ {\n\t\ti.Set(w, h, cl)\n\t}\n}", "title": "" }, { "docid": "38f82bd8464e292bd9d511eed9fd46c2", "score": "0.49232846", "text": "func (b *Board) drawPiece(s Shape, t Block) {\n\tfor i := 0; i < 4; i++ {\n\t\tb[activeShape[i].row][activeShape[i].col] = t\n\t}\n}", "title": "" }, { "docid": "237a84c2137185a51aca5ea43077e4a6", "score": "0.49230394", "text": "func (p Polygon) Fill(dst draw.Image, c color.Color) (drawCount int) {\n\tif len(p) < 3 {\n\t\treturn\n\t}\n\n\tb := p.Bounds()\n\n\tfor x := b.Min.X; x < b.Max.X; x++ {\n\t\tfor y := b.Min.Y; y < b.Max.Y; y++ {\n\t\t\tif IV(x, y).In(p) {\n\t\t\t\tMix(dst, x, y, c)\n\t\t\t\tdrawCount++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn drawCount\n}", "title": "" }, { "docid": "a97c6f10347e45f1ad0d2655954e5a9d", "score": "0.4913724", "text": "func UpdateBoard(screen *ebiten.Image, board *[8][8]Tile) {\n\ti := 30\n\timg, _ := ebiten.NewImage(i, i, 0)\n\n\tfor a, row := range board {\n\t\tfor b, tile := range row {\n\t\t\top := &ebiten.DrawImageOptions{}\n\t\t\top.GeoM.Translate(float64(20+i+i*(b-1)), float64(20+i+i*(a-1)))\n\t\t\timg.Fill(tile.color)\n\t\t\tscreen.DrawImage(img, op)\n\t\t\tif tile.piece != (Piece{}) {\n\t\t\t\topPiece := &ebiten.DrawImageOptions{}\n\t\t\t\topPiece.GeoM.Scale(0.75, 0.75)\n\t\t\t\topPiece.GeoM.Translate(float64(20+i+i*(b-1)), float64(20+i+i*(a-1)))\n\t\t\t\tscreen.DrawImage(tile.piece.pieceIcon, opPiece)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b7f45d087ca136e0a3ab508552d59bb5", "score": "0.49072927", "text": "func (m *Mat3) Fill(content float32) {\n\tfor i := range m {\n\t\tm[i] = content\n\t}\n}", "title": "" }, { "docid": "4ec499db124706ba9c715410781b23f0", "score": "0.49050838", "text": "func newBlock(hash *btcwire.ShaHash, height int32){\n\t\t\n\t\tlog.Printf(\"Block connected: %v (%d)\", hash, height)\n\t\tif bcc.inc() == 1 {\n\t\t\tdefer bcc.clr()\t\t\t\t\t// If we execute, then clear so we execute again \n\t\t\t\t\t\t\t\t\t\t\t// with the next block!\n\t\t\ttime.Sleep(time.Minute*5)\n\t\t\tlog.Printf(\"call to record hash...\")\n\t\t\trecordHash();\n\t\t\tlog.Printf(\"...hash recorded\");\t\t\t\t\t\t\t\t\t\t\n\t }\n }", "title": "" }, { "docid": "90e13718d5a8b22883af8a497b5e373a", "score": "0.4899493", "text": "func (o *Game) Draw() {\n\ttermbox.Clear(o.fg, o.bg)\n\n\t// Draw box\n\ttermbox.SetCell(0, 0, '╔', o.fg, o.bg)\n\ttermbox.SetCell(11, 0, '╗', o.fg, o.bg)\n\ttermbox.SetCell(0, 21, '╚', o.fg, o.bg)\n\ttermbox.SetCell(11, 21, '╝', o.fg, o.bg)\n\tfor i := 0; i < 10; i++ {\n\t\ttermbox.SetCell(1+i, 0, '═', o.fg, o.bg)\n\t\ttermbox.SetCell(1+i, 21, '═', o.fg, o.bg)\n\t}\n\tfor i := 0; i < 20; i++ {\n\t\ttermbox.SetCell(0, 1+i, '║', o.fg, o.bg)\n\t\ttermbox.SetCell(11, 1+i, '║', o.fg, o.bg)\n\t}\n\n\t// Draw active piece\n\tfor _, position := range o.active {\n\t\ttermbox.SetCell(1+position.x, 1+position.y, '█', o.fg, o.bg)\n\t}\n\t// Draw blocks\n\tfor y := range o.blocks {\n\t\tfor x := range o.blocks[y] {\n\t\t\tif o.blocks[y][x] {\n\t\t\t\ttermbox.SetCell(1+x, 1+y, '█', o.fg, o.bg)\n\t\t\t}\n\t\t}\n\t}\n\n\ttermbox.HideCursor()\n\ttermbox.Flush()\n}", "title": "" }, { "docid": "19b32f3ee9734f32aa10ee63687fe771", "score": "0.48951", "text": "func RunFloodFill() {\n\tres := floodFill([][]int{\n\t\t{1, 1, 1}, {1, 1, 0}, {1, 0, 1},\n\t}, 1, 1, 2)\n\tfmt.Println(res)\n}", "title": "" }, { "docid": "71f96924e0decf625f2ef93e1bb3f5d7", "score": "0.48920575", "text": "func (c *HeadImage) backgroundColor(back color.RGBA) {\n\tbounds := c.board.Bounds()\n\tfor x := bounds.Min.X; x < bounds.Max.X; x++ {\n\t\tfor y := bounds.Min.Y; y < bounds.Max.Y; y++ {\n\t\t\tc.board.Set(x, y, back)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "472d6d4c6b2bbc73bdaf514d32ed0ef6", "score": "0.48915085", "text": "func (f *CRCField) Fill(curOffset int, buf []byte) error {\n\tcrc := crc32.ChecksumIEEE(buf[f.StartOffset+4 : curOffset])\n\tEncoding.PutUint32(buf[f.StartOffset:], crc)\n\treturn nil\n}", "title": "" }, { "docid": "67e0ca79a99b07a772f79179f00aa009", "score": "0.4878503", "text": "func (c *Canvas) Clear(color color.Color) {\n\tc.gf.Dirty()\n\n\trgba := pixel.ToRGBA(color)\n\n\t// color masking\n\trgba = rgba.Mul(pixel.RGBA{\n\t\tR: float64(c.col[0]),\n\t\tG: float64(c.col[1]),\n\t\tB: float64(c.col[2]),\n\t\tA: float64(c.col[3]),\n\t})\n\n\tmainthread.CallNonBlock(func() {\n\t\tc.setGlhfBounds()\n\t\tc.gf.Frame().Begin()\n\t\tglhf.Clear(\n\t\t\tfloat32(rgba.R),\n\t\t\tfloat32(rgba.G),\n\t\t\tfloat32(rgba.B),\n\t\t\tfloat32(rgba.A),\n\t\t)\n\t\tc.gf.Frame().End()\n\t})\n}", "title": "" }, { "docid": "4dc2423515ed13d5b17d5b116aa6d61a", "score": "0.4868529", "text": "func (canvas *Canvas) Fill(p *Path) {\r\n\tio.Copy(canvas.contents, &p.buf)\r\n\twriteCommand(canvas.contents, \"f\")\r\n}", "title": "" }, { "docid": "59c1565e8e60ce7bba97fee47f5e2a88", "score": "0.48668373", "text": "func (a *Area) SetColor(c color.Color) {\n\tswitch p := c.(type) {\n\tcase color.RGBA:\n\t\tif (int(p.A)-int(p.R))|(int(p.A)-int(p.G))|(int(p.A)-int(p.B)) < 0 {\n\t\t\tpanic(badAlphaPremul)\n\t\t}\n\tcase color.RGBA64:\n\t\tif (int(p.A)-int(p.R))|(int(p.A)-int(p.G))|(int(p.A)-int(p.B)) < 0 {\n\t\t\tpanic(badAlphaPremul)\n\t\t}\n\t}\n\ta.color = c\n}", "title": "" }, { "docid": "c67e6159dcc93dbbe11edbe61a3da8cf", "score": "0.4836866", "text": "func (f *Filler) SetFill(fill rune) {\n\tf.fill = fill\n}", "title": "" }, { "docid": "492e9548f6a204812f2ef512c31fa67d", "score": "0.4836154", "text": "func (arena *Arena) Draw(screen *tl.Screen) {\n\t// This for loop will range ArenaBorder containing the coordinates of the arenaborder and will print them out on the screen.\n\tfor i := range arena.ArenaBorder {\n\t\tscreen.RenderCell(i.X, i.Y, &tl.Cell{\n\t\t\tBg: CheckSelectedColor(counterArena),\n\t\t})\n\t}\n}", "title": "" }, { "docid": "dd72b31b65fee54def54d7ca53244b5a", "score": "0.48297518", "text": "func (b *bow) FillLinear(refColName, toFillColName string) (Bow, error) {\n\trefIndex, err := b.GetColumnIndex(refColName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"bow: FillLinear: error with refColName: %w\", err)\n\t}\n\n\ttoFillIndex, err := b.GetColumnIndex(toFillColName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"bow: FillLinear: error with toFillColName: %w\", err)\n\t}\n\n\tif refIndex == toFillIndex {\n\t\treturn nil, fmt.Errorf(\"bow: FillLinear: refColName and toFillColName are equal\")\n\t}\n\n\tswitch b.GetType(refIndex) {\n\tcase Int64:\n\tcase Float64:\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"bow: FillLinear: refColName '%s' is of type '%s'\",\n\t\t\trefColName, b.GetType(refIndex))\n\t}\n\n\tif b.IsColEmpty(refIndex) {\n\t\treturn b, nil\n\t}\n\n\tif !b.IsColSorted(refIndex) {\n\t\treturn nil, fmt.Errorf(\"bow: FillLinear: column '%s' is empty or not sorted\", refColName)\n\t}\n\n\tswitch b.GetType(toFillIndex) {\n\tcase Int64:\n\tcase Float64:\n\tdefault:\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"bow: FillLinear: toFillColName '%s' is of type '%s'\",\n\t\t\ttoFillColName, b.GetType(toFillIndex))\n\t}\n\n\tvar wg sync.WaitGroup\n\tfilledSeries := make([]Series, b.NumCols())\n\tfor colIndex, col := range b.Schema().Fields() {\n\t\tif colIndex != toFillIndex {\n\t\t\tfilledSeries[colIndex] = Series{\n\t\t\t\tName: col.Name,\n\t\t\t\tArray: b.Record.Column(colIndex),\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\t\tgo func(colIndex int, colName string) {\n\t\t\tdefer wg.Done()\n\t\t\tvar newArray array.Interface\n\t\t\tprevData := b.Record.Column(colIndex).Data()\n\t\t\tpool := memory.NewCheckedAllocator(memory.NewGoAllocator())\n\t\t\tswitch b.GetType(colIndex) {\n\t\t\tcase Int64:\n\t\t\t\tprevArray := array.NewInt64Data(prevData)\n\t\t\t\tvalues := prevArray.Int64Values()\n\t\t\t\tvalids := getValids(prevArray, b.NumRows())\n\t\t\t\tfor rowIndex := 0; rowIndex < b.NumRows(); rowIndex++ {\n\t\t\t\t\tif valids[rowIndex] {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tprevToFill, rowPrev := b.GetPreviousFloat64(colIndex, rowIndex-1)\n\t\t\t\t\tnextToFill, rowNext := b.GetNextFloat64(colIndex, rowIndex+1)\n\t\t\t\t\trowRef, valid1 := b.GetFloat64(refIndex, rowIndex)\n\t\t\t\t\tprevRef, valid2 := b.GetFloat64(refIndex, rowPrev)\n\t\t\t\t\tnextRef, valid3 := b.GetFloat64(refIndex, rowNext)\n\t\t\t\t\tif valid1 && valid2 && valid3 {\n\t\t\t\t\t\tif nextRef-prevRef != 0 {\n\t\t\t\t\t\t\ttmp := rowRef - prevRef\n\t\t\t\t\t\t\ttmp /= nextRef - prevRef\n\t\t\t\t\t\t\ttmp *= nextToFill - prevToFill\n\t\t\t\t\t\t\ttmp += prevToFill\n\t\t\t\t\t\t\tvalues[rowIndex] = int64(math.Round(tmp))\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalues[rowIndex] = int64(prevToFill)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalids[rowIndex] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbuild := array.NewInt64Builder(pool)\n\t\t\t\tbuild.AppendValues(values, valids)\n\t\t\t\tnewArray = build.NewArray()\n\t\t\tcase Float64:\n\t\t\t\tprevArray := array.NewFloat64Data(prevData)\n\t\t\t\tvalues := prevArray.Float64Values()\n\t\t\t\tvalids := getValids(prevArray, b.NumRows())\n\t\t\t\tfor rowIndex := 0; rowIndex < b.NumRows(); rowIndex++ {\n\t\t\t\t\tif valids[rowIndex] {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tprevToFill, rowPrev := b.GetPreviousFloat64(colIndex, rowIndex-1)\n\t\t\t\t\tnextToFill, rowNext := b.GetNextFloat64(colIndex, rowIndex+1)\n\t\t\t\t\trowRef, valid1 := b.GetFloat64(refIndex, rowIndex)\n\t\t\t\t\tprevRef, valid2 := b.GetFloat64(refIndex, rowPrev)\n\t\t\t\t\tnextRef, valid3 := b.GetFloat64(refIndex, rowNext)\n\t\t\t\t\tif valid1 && valid2 && valid3 {\n\t\t\t\t\t\tif nextRef-prevRef != 0.0 {\n\t\t\t\t\t\t\tvalues[rowIndex] = rowRef - prevRef\n\t\t\t\t\t\t\tvalues[rowIndex] /= nextRef - prevRef\n\t\t\t\t\t\t\tvalues[rowIndex] *= nextToFill - prevToFill\n\t\t\t\t\t\t\tvalues[rowIndex] += prevToFill\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalues[rowIndex] = prevToFill\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalids[rowIndex] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbuild := array.NewFloat64Builder(pool)\n\t\t\t\tbuild.AppendValues(values, valids)\n\t\t\t\tnewArray = build.NewArray()\n\t\t\t}\n\t\t\tfilledSeries[colIndex] = Series{\n\t\t\t\tName: colName,\n\t\t\t\tArray: newArray,\n\t\t\t}\n\t\t}(colIndex, col.Name)\n\t}\n\twg.Wait()\n\n\treturn NewBowWithMetadata(\n\t\tMetadata{b.Schema().Metadata()},\n\t\tfilledSeries...)\n}", "title": "" }, { "docid": "ac6c763d3198e8e465cc3c3b68d02024", "score": "0.4829149", "text": "func (r *Rectangle) Paint(t *tile, tileX, tileY int16) {\n\tx1 := r.x - tileX\n\ty1 := r.y - tileY\n\tx2 := r.x - tileX + r.width\n\ty2 := r.y - tileY + r.height\n\tif x1 < 0 {\n\t\tx1 = 0\n\t}\n\tif y1 < 0 {\n\t\ty1 = 0\n\t}\n\tif x2 > TileSize {\n\t\tx2 = TileSize\n\t}\n\tif y2 > TileSize {\n\t\ty2 = TileSize\n\t}\n\tfor x := x1; x < x2; x++ {\n\t\tfor y := y1; y < y2; y++ {\n\t\t\tt[x+y*TileSize] = r.color\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c8e3cab153a8671625740efa630dfaa3", "score": "0.48263398", "text": "func NewBoard(pegs ...int) Board {\n\tb := Board{}\n\tfor _, i := range pegs {\n\t\tb.fillSlot(i, Full)\n\t}\n\tfor i := 1; i <= slots; i++ {\n\t\tif b.getSlot(i) != Full {\n\t\t\tb.fillSlot(i, Empty)\n\t\t}\n\t}\n\treturn b\n}", "title": "" }, { "docid": "94ab34c18ef32af028c8b4a28e06dca8", "score": "0.4821733", "text": "func draw(g *Game, background *ebiten.Image) {\n\tfor x := 0; x < RES; x++ {\n\t\tfor y := 0; y < RES; y++ {\n\t\t\tif g.board[x][y] == 1 {\n\t\t\t\tebitenutil.DrawRect(background, float64(x), float64(y), 1, 1, color.White)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "52212b2d522fa88c24193eff2c1706d3", "score": "0.48016912", "text": "func (p *Point) setColor(graphNum int) {\n graphNum = graphNum % 7\n\n switch graphNum {\n case 0:\n p.myColor = ansi.WHITE\n break\n case 1:\n p.myColor = ansi.RED\n break\n case 2:\n p.myColor = ansi.GREEN\n break\n case 3:\n p.myColor = ansi.YELLOW\n break\n case 4:\n p.myColor = ansi.BLUE\n break\n case 5:\n p.myColor = ansi.PURPLE\n break\n case 6:\n p.myColor = ansi.CYAN\n break\n }\n}", "title": "" }, { "docid": "2d5394db0a9f94ee3fa91c6ba163fdbe", "score": "0.47985187", "text": "func (r *BasicRectangleNode) SetColor(color api.IPalette) {\n\tr.color = color\n}", "title": "" }, { "docid": "729a5adf841a13496e62e3f0cb3759bb", "score": "0.47967374", "text": "func Clear(minX, minY, maxX, maxY int, fg, bg termbox.Attribute) {\n\tfor y := minY; y <= maxY; y++ {\n\t\tfor x := minX; x <= maxX; x++ {\n\t\t\ttermbox.SetCell(x, y, ' ', fg, bg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5344da2bed3d47e38cfb6b392fe11207", "score": "0.47920617", "text": "func (m *Matrix) Fill(v float64) {\n\tfor i := 0; i < m.NumElements(); i++ {\n\t\tm.elements[i] = v\n\t}\n}", "title": "" }, { "docid": "32ac3f98c6ea5b5c8f2fdf5c485e90d4", "score": "0.4775262", "text": "func NewBoard(b *Block, unit int) *Board {\n\trect := image.Rect(0, 0, b.x*unit, b.y*unit)\n\tbr := Board{\n\t\t*image.NewRGBA(rect),\n\t\tb,\n\t\tunit,\n\t}\n\tbr.visualize()\n\treturn &br\n}", "title": "" }, { "docid": "76475a8ab74f5e2a0395f72543966d8f", "score": "0.47719505", "text": "func (l *Level) SetBlock(x, y, z int32, block Block) error {\n\tif y < 0 {\n\t\ty = 0\n\t}\n\tvar (\n\t\tc *chunk\n\t\terr error\n\t)\n\tfor mx := x - 1; mx <= x+1; mx++ {\n\t\tfor mz := z - 1; mz <= z+1; mz++ {\n\t\t\tif c, err = l.getChunk(mx, mz, true); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor my := y + 16; my >= 0; my -= 16 {\n\t\t\t\tif c.createSection(my) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tc, _ = l.getChunk(x, z, false)\n\topacity := c.GetOpacity(x, y, z)\n\tc.SetBlock(x, y, z, block)\n\tif block.Opacity() != opacity {\n\t\tif err = l.genLighting(x, y, z, true, block.Opacity() > opacity, 0); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif bl := c.GetBlockLight(x, y, z); block.Light() != bl || block.Opacity() != opacity {\n\t\tif err = l.genLighting(x, y, z, false, block.Light() < bl, block.Light()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "140216812839ff919f6c46239a28c863", "score": "0.47713146", "text": "func block(h *[4]uint32, m []byte)", "title": "" }, { "docid": "1a839e96d6b8f78be1c6f6080468adcb", "score": "0.47695702", "text": "func New(width, height int, fillColor color.Color) *image.NRGBA {\n\tdst := image.NewNRGBA(image.Rect(0, 0, width, height))\n\tc := color.NRGBAModel.Convert(fillColor).(color.NRGBA)\n\n\ti0 := dst.PixOffset(0, 0)\n\tfor y := 0; y < height; y, i0 = y+1, i0+dst.Stride {\n\t\tfor x, i := 0, i0; x < width; x, i = x+1, i+4 {\n\t\t\tdst.Pix[i+0] = c.R\n\t\t\tdst.Pix[i+1] = c.G\n\t\t\tdst.Pix[i+2] = c.B\n\t\t\tdst.Pix[i+3] = c.A\n\t\t}\n\t}\n\n\treturn dst\n}", "title": "" }, { "docid": "226696f3ef46a1fb134c3fd66eabe113", "score": "0.47473928", "text": "func (r FilledRectangle) Draw(img draw.Image) image.Rectangle {\n\tfor y := r.Position.Y; y < r.Position.Y+r.Height; y++ {\n\t\tfor x := r.Position.X; x < r.Position.X+r.Width; x++ {\n\t\t\timg.Set(x, y, r.FillColor)\n\t\t}\n\t}\n\n\ta := image.Point{r.Position.X, r.Position.Y}\n\tb := image.Point{r.Position.X + r.Width, r.Position.Y}\n\tc := image.Point{r.Position.X + r.Width, r.Position.Y + r.Height}\n\td := image.Point{r.Position.X, r.Position.Y + r.Height}\n\n\ttop := NewLine(a, b, r.OutlineColor)\n\tright := NewLine(b, c, r.OutlineColor)\n\tbottom := NewLine(c, d, r.OutlineColor)\n\tleft := NewLine(d, a, r.OutlineColor)\n\n\ttop.Draw(img)\n\tright.Draw(img)\n\tbottom.Draw(img)\n\tleft.Draw(img)\n\n\treturn image.Rect(a.X, a.Y, d.X, d.Y)\n}", "title": "" }, { "docid": "9eb8595ec406e247e91d1a8decf3e5b0", "score": "0.47386488", "text": "func background(r, g, b int) {\n\tcanvas.Rect(0, 0, canvasWidth, canvasHeight, canvas.RGB(r, g, b))\n}", "title": "" }, { "docid": "9eb8595ec406e247e91d1a8decf3e5b0", "score": "0.47386488", "text": "func background(r, g, b int) {\n\tcanvas.Rect(0, 0, canvasWidth, canvasHeight, canvas.RGB(r, g, b))\n}", "title": "" }, { "docid": "9eb8595ec406e247e91d1a8decf3e5b0", "score": "0.47386488", "text": "func background(r, g, b int) {\n\tcanvas.Rect(0, 0, canvasWidth, canvasHeight, canvas.RGB(r, g, b))\n}", "title": "" }, { "docid": "381350e23e8304a3e91062afa5318ba2", "score": "0.47371903", "text": "func (b *Board) GetColor(x, y uint8) uint8 {\n if y >= b.size || x >= b.size {\n panic(\"Invalid board.GetColor operation\") //TODO don't panic\n }\n return b.s[x+y*b.size]\n}", "title": "" }, { "docid": "0c6e76e66bef6832f87e9ee0f55fb654", "score": "0.47366595", "text": "func (b *bookie) Fill(rangeID roachpb.RangeID) bool {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\t// Lookup the reservation.\n\tres, ok := b.mu.reservationsByRangeID[rangeID]\n\tif !ok {\n\t\tif log.V(2) {\n\t\t\tlog.Infof(context.TODO(), \"there is no reservation for rangeID:%d\", rangeID)\n\t\t}\n\t\treturn false\n\t}\n\n\tb.fillReservationLocked(res)\n\treturn true\n}", "title": "" }, { "docid": "9f9ab1908d7641b511fdcc04082b84be", "score": "0.472943", "text": "func newBoard(game *models.Game) error {\n\n\t//First we populate the board with mines\n\tnumCells := game.Rows * game.Columns\n\tcells := make(models.CellRow, numCells)\n\ti := 0\n\tfor i < game.Mines {\n\t\t//Get random spot for mines\n\t\trand.Seed(time.Now().UnixNano())\n\t\tspot := rand.Intn(numCells)\n\t\tif cells[spot].Mine == false {\n\t\t\tcells[spot].Mine = true\n\t\t\ti++\n\t\t}\n\t}\n\n\tgame.Board = make([]models.CellRow, game.Rows)\n\t//Fit in the final board each of the cell rows\n\tfor c := range game.Board {\n\t\tgame.Board[c] = cells[c*game.Columns : ((c + 1) * game.Columns)]\n\t}\n\t//O(n^2)\n\tfor i, row := range game.Board {\n\t\tfor j, cell := range row {\n\t\t\tif cell.Mine == true {\n\t\t\t\tsetNumbers(game, i, j)\n\t\t\t}\n\t\t}\n\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "689cce7113b437545901b676ebca3dec", "score": "0.4720833", "text": "func (d *Device) FillScreen(c color.RGBA) {\n\td.FillRectangle(0, 0, d.width, d.height, c)\n}", "title": "" }, { "docid": "a402aab5dfde0940015e1ce4effc985e", "score": "0.4719546", "text": "func (b *Board) RandomBlock() (blk TetrisBlock) {\n\t// 1. Generate a random number and pick the matching shape\n\tswitch b.Rand.Int31() % 5 {\n\tcase 0:\n\t\tblk = b.ElleShape(Red)\n\tcase 1:\n\t\tblk = b.IElleShape(Red)\n\tcase 2:\n\t\tblk = b.PipeShape(Red)\n\tcase 3:\n\t\tblk = b.SquareShape(Red)\n\tcase 4:\n\t\tblk = b.TeeShape(Red)\n\t}\n\n\t// 2. Assigned a random colour to the shape\n\tswitch b.Rand.Int31() % 5 {\n\tcase 0:\n\t\tblk.Colour = Red\n\tcase 1:\n\t\tblk.Colour = Orange\n\tcase 2:\n\t\tblk.Colour = Green\n\tcase 3:\n\t\tblk.Colour = Purple\n\tcase 4:\n\t\tblk.Colour = Blue\n\t}\n\n\t// 3. Rotate Pattern on block\n\tswitch b.Rand.Int31() % 4 {\n\tcase 0:\n\t\t// Already orientated Up\n\tcase 1:\n\t\tblk.Rotate()\n\tcase 2:\n\t\tblk.Rotate()\n\t\tblk.Rotate()\n\tcase 3:\n\t\tblk.Rotate()\n\t\tblk.Rotate()\n\t\tblk.Rotate()\n\t}\n\n\treturn blk\n}", "title": "" }, { "docid": "3f1d77f134d207df6b8310f08c841094", "score": "0.47164345", "text": "func (p PaddingFunc) Fill(dst []byte) {\n\tp(dst)\n}", "title": "" }, { "docid": "5724931fd9d6c625b10131affa5acb9c", "score": "0.4713414", "text": "func SetAll(theBlinkt *blinkt.Blinkt, c colorful.Color) {\n var r, g, b = c.RGB255()\n log.Printf(\"Setting pixels to %v, %v, %v\", r, g, b)\n theBlinkt.SetAll(int(r), int(g), int(b))\n theBlinkt.Show()\n}", "title": "" }, { "docid": "75d55ae19c701bc1ea12286f102c10eb", "score": "0.47114488", "text": "func (p *puzzle) set(r, c, n uint) {\n\ti := r / 3\n\tj := c / 3\n\tif v := p.grid[r][c]; v != 0 {\n\t\tp.boxes[i][j].clear(v)\n\t\tp.rows[r].clear(v)\n\t\tp.cols[c].clear(v)\n\t\tp.total--\n\t}\n\n\tp.grid[r][c] = n\n\tp.boxes[i][j].set(n)\n\tp.rows[r].set(n)\n\tp.cols[c].set(n)\n\tp.total++\n}", "title": "" }, { "docid": "0cda68a1e10561c6889a0a1a8d6ad8bd", "score": "0.46956676", "text": "func CreateBoard(size int, pile int) *Board {\n var b Board\n b.cell = make([][]int, size)\n for i := 0; i < size; i++ {\n b.cell[i] = make([]int, size)\n }\n b.pile = pile\n halfSize := size / 2\n b.cell[halfSize][halfSize] = pile\n return &b\n}", "title": "" } ]
e803091d39b01e3eb2cb3ed7da6bfb5e
GetMaskPart returns mask part of IP
[ { "docid": "0ad3a5eb7b46609e1197433ee0841de7", "score": "0.8188139", "text": "func (ip IP) GetMaskPart() string {\n\tparts := strings.Split(string(ip), \"/\")\n\t//nolint:gomnd\n\tif len(parts) > 1 {\n\t\treturn parts[1]\n\t}\n\n\treturn \"\"\n}", "title": "" } ]
[ { "docid": "791b31322ba10d08f65a9ecb0ea7b44d", "score": "0.70501137", "text": "func (ip IP) DropMaskPart() IP {\n\tparts := strings.Split(string(ip), \"/\")\n\treturn IP(parts[0])\n}", "title": "" }, { "docid": "64e05c113f2b96c1530a91d01449b182", "score": "0.65447956", "text": "func (ip IP) Mask(mask IPMask) IP {\n\tif len(mask) == IPv6len && len(ip) == IPv4len && allFF(mask[:12]) {\n\t\tmask = mask[12:]\n\t}\n\tif len(mask) == IPv4len && len(ip) == IPv6len && bytesEqual(ip[:12], v4InV6Prefix) {\n\t\tip = ip[12:]\n\t}\n\tn := len(ip)\n\tif n != len(mask) {\n\t\treturn nil\n\t}\n\tout := make(IP, n)\n\tfor i := 0; i < n; i++ {\n\t\tout[i] = ip[i] & mask[i]\n\t}\n\treturn out\n}", "title": "" }, { "docid": "33490e2fab8a7b4d5aca03a1599e1165", "score": "0.6460966", "text": "func (w *Workload) GetNetMask(ip string) string {\n\tfor _, i := range PtrToVal(w.Interfaces) {\n\t\tif i.Address == ip {\n\t\t\tif i.CidrBlock != nil {\n\t\t\t\t_, ipNet, _ := net.ParseCIDR(fmt.Sprintf(\"%s/%d\", i.Address, *i.CidrBlock))\n\t\t\t\t// IPv4\n\t\t\t\tif len(ipNet.Mask) == 4 {\n\t\t\t\t\treturn fmt.Sprintf(\"%d.%d.%d.%d\", ipNet.Mask[0], ipNet.Mask[1], ipNet.Mask[2], ipNet.Mask[3])\n\t\t\t\t}\n\t\t\t\tif len(ipNet.Mask) > 4 {\n\t\t\t\t\treturn ipNet.Mask.String()\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"NA\"\n\t\t}\n\t}\n\treturn \"NA\"\n}", "title": "" }, { "docid": "cb4092b67e97e78404ce44304f56424b", "score": "0.6384615", "text": "func getMask(prefix int) (ret Ipv6Addr) {\n\tfor i := 0; i < 8; i++ {\n\t\tj := 0xFFFF\n\t\tfor ; j > 0 && prefix > 0; j >>= 1 {\n\t\t\tprefix--\n\t\t}\n\t\tret[i] = 0xFFFF - j\n\t}\n\treturn ret\n}", "title": "" }, { "docid": "b910c1f261288e55bbd9e6b543af400b", "score": "0.6284747", "text": "func (ip IP) HasMaskPart() bool {\n\tparts := strings.Split(string(ip), \"/\")\n\t//nolint:gomnd\n\treturn len(parts) > 1\n}", "title": "" }, { "docid": "b1e2fe1cb95751083002e64d500be73c", "score": "0.6237297", "text": "func GetIPFullMask(ip string) string {\n\tconst (\n\t\t// IPv4FullMask is the maximum prefix mask for an IPv4 address\n\t\tIPv4FullMask = \"/32\"\n\t\t// IPv6FullMask is the maxiumum prefix mask for an IPv6 address\n\t\tIPv6FullMask = \"/128\"\n\t)\n\n\tif utilnet.IsIPv6(net.ParseIP(ip)) {\n\t\treturn IPv6FullMask\n\t}\n\treturn IPv4FullMask\n}", "title": "" }, { "docid": "a21c1ffa338e5676a0ca18dfb6c06dfb", "score": "0.61513066", "text": "func (o *ManagementInterfaceAllOf) GetMask() string {\n\tif o == nil || o.Mask == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Mask\n}", "title": "" }, { "docid": "a4e54b80d830516ef3b5835465736a63", "score": "0.6116544", "text": "func NewWithMaskPart(ip string) (IP, error) {\n\tif !IP(ip).HasMaskPart() {\n\t\treturn \"\", fmt.Errorf(\"invalid ip `%s`, mask part is required\", ip)\n\t}\n\n\t_, _, err := net.ParseCIDR(ip)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid ip `%s`: %w\", ip, err)\n\t}\n\n\treturn IP(ip), nil\n}", "title": "" }, { "docid": "14b53f9e5c70a3e9502bfd5cf998d40d", "score": "0.60639906", "text": "func (m *TeamworkNetworkConfiguration) GetSubnetMask()(*string) {\n val, err := m.GetBackingStore().Get(\"subnetMask\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "27d4c3c6222e065a39b730311269f205", "score": "0.6056076", "text": "func (o EventGridTopicInboundIpRuleOutput) IpMask() pulumi.StringOutput {\n\treturn o.ApplyT(func(v EventGridTopicInboundIpRule) string { return v.IpMask }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4fe0b3268af3706e10c85859fc52fe95", "score": "0.5968123", "text": "func (o DomainInboundIpRuleOutput) IpMask() pulumi.StringOutput {\n\treturn o.ApplyT(func(v DomainInboundIpRule) string { return v.IpMask }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "bce0c740136cb40bf997c60c6e0e674b", "score": "0.5923868", "text": "func ipmask(addr *Address) string {\n\tip := net.ParseIP(addr.IPAddress)\n\tvar mask net.IPMask\n\tif addr.Netmask != \"\" {\n\t\tmask = net.IPMask(net.ParseIP(addr.Netmask))\n\t} else {\n\t\tmask = net.CIDRMask(addr.Cidr, 32)\n\t}\n\tipnet := net.IPNet{\n\t\tIP: ip,\n\t\tMask: mask,\n\t}\n\treturn ipnet.String()\n}", "title": "" }, { "docid": "4698c98f6a08974097c6f7a9fc474c52", "score": "0.5889981", "text": "func (m *ipMasker) Mask(addr string) string {\n\tif m.IPv4Mask == nil && m.IPv6Mask == nil {\n\t\treturn addr\n\t}\n\n\thost, port, err := net.SplitHostPort(addr)\n\tif err != nil {\n\t\t// just host\n\t\thost, port = addr, \"\"\n\t}\n\tip := net.ParseIP(host)\n\tif ip == nil {\n\t\t// not an IP address, return as is\n\t\treturn addr\n\t}\n\tif ip4 := ip.To4(); ip4 != nil && m.IPv4Mask != nil {\n\t\t// IPv4\n\t\thost = ip4.Mask(m.IPv4Mask).String()\n\t} else if ip6 := ip.To16(); ip6 != nil && m.IPv6Mask != nil {\n\t\t// IPv6\n\t\thost = ip6.Mask(m.IPv6Mask).String()\n\t}\n\tif port != \"\" {\n\t\treturn net.JoinHostPort(host, port)\n\t} else {\n\t\treturn host\n\t}\n}", "title": "" }, { "docid": "67bd93ebf19919cd9f9f9afa5c538f80", "score": "0.5769745", "text": "func (o EventHubNamespaceNetworkRulesetsIpRuleOutput) IpMask() pulumi.StringOutput {\n\treturn o.ApplyT(func(v EventHubNamespaceNetworkRulesetsIpRule) string { return v.IpMask }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "9d6c63926bd4dae6f624f367ccc90a4d", "score": "0.5759781", "text": "func (r *ReservedBlock) GetMask() net.IPMask {\n\treturn net.IPMask{r.Mask[0], r.Mask[1], r.Mask[2], r.Mask[3]}\n}", "title": "" }, { "docid": "d30c1f5f818ccaf023b9f7b22f520ae4", "score": "0.57325065", "text": "func FormatMask(ipAddr []byte, maskRawValue uint32) string {\n\tmaskSuffix := \"/\" + strconv.Itoa(int(maskRawValue))\n\n\tip := net.IP(ipAddr)\n\tif ip == nil {\n\t\treturn maskSuffix\n\t}\n\n\tvar maskBitsLen int\n\t// Using ip.To4() to test for ipv4\n\t// More info: https://stackoverflow.com/questions/40189084/what-is-ipv6-for-localhost-and-0-0-0-0\n\tif ip.To4() != nil {\n\t\tmaskBitsLen = 32\n\t} else {\n\t\tmaskBitsLen = 128\n\t}\n\n\tmask := net.CIDRMask(int(maskRawValue), maskBitsLen)\n\tif mask == nil {\n\t\treturn maskSuffix\n\t}\n\tmaskedIP := ip.Mask(mask)\n\tif maskedIP == nil {\n\t\treturn maskSuffix\n\t}\n\treturn maskedIP.String() + maskSuffix\n}", "title": "" }, { "docid": "9ebd89eecffa77d79954cbaf9c0a2e3b", "score": "0.5730107", "text": "func parseHexIPMask(h string) (net.IPMask, error) {\n\tr := make(net.IPMask, 4)\n\tnum, err := strconv.ParseUint(h, 16, 64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbinary.LittleEndian.PutUint32(r, uint32(num))\n\treturn r, nil\n}", "title": "" }, { "docid": "46657c5f449e82b07b3f43ef38a27c97", "score": "0.5728624", "text": "func hostMask(ip net.IP) net.IPMask {\n\tvar hl int\n\tif ip.To4() != nil {\n\t\thl = net.IPv4len * 8\n\t} else {\n\t\thl = net.IPv6len * 8\n\t}\n\treturn net.CIDRMask(hl, hl)\n}", "title": "" }, { "docid": "e9f127e53885ee0f6bac409773f85e73", "score": "0.5697099", "text": "func cidrToMask(value string) string {\n\treturn value\n}", "title": "" }, { "docid": "7d9ebc8fd3c43872c3a2fde78d1ee922", "score": "0.5669209", "text": "func (d *Data) GetMask(ctx *datastore.VersionedCtx, subvol *dvid.Subvolume) ([]byte, error) {\n\tpt0 := subvol.StartPoint()\n\tpt1 := subvol.EndPoint()\n\tminBlockZ := pt0.Value(2) / d.BlockSize[2]\n\tmaxBlockZ := pt1.Value(2) / d.BlockSize[2]\n\tminBlockY := pt0.Value(1) / d.BlockSize[1]\n\tmaxBlockY := pt1.Value(1) / d.BlockSize[1]\n\tminBlockX := pt0.Value(0) / d.BlockSize[0]\n\tmaxBlockX := pt1.Value(0) / d.BlockSize[0]\n\n\tminIndex := minIndexByBlockZ(minBlockZ)\n\tmaxIndex := maxIndexByBlockZ(maxBlockZ)\n\n\tspans, err := getSpans(ctx, minIndex, maxIndex)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Allocate the mask volume.\n\tdata := make([]uint8, subvol.NumVoxels())\n\tsize := subvol.Size()\n\tnx := size.Value(0)\n\tnxy := size.Value(1) * nx\n\n\t// Fill the mask volume\n\tfor _, span := range spans {\n\t\t// Handle out of range blocks\n\t\tif span[0] < minBlockZ {\n\t\t\tcontinue\n\t\t}\n\t\tif span[0] > maxBlockZ {\n\t\t\tbreak\n\t\t}\n\t\tif span[1] < minBlockY || span[1] > maxBlockY {\n\t\t\tcontinue\n\t\t}\n\t\tif span[3] < minBlockX || span[2] > maxBlockX {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Get the voxel range for this span, including limits based on subvolume.\n\t\tx0, x1 := voxelRange(d.BlockSize[0], span[2], span[3], pt0.Value(0), pt1.Value(0))\n\t\ty0, y1 := voxelRange(d.BlockSize[1], span[1], span[1], pt0.Value(1), pt1.Value(1))\n\t\tz0, z1 := voxelRange(d.BlockSize[2], span[0], span[0], pt0.Value(2), pt1.Value(2))\n\n\t\t// Write the mask\n\t\tfor z := z0; z <= z1; z++ {\n\t\t\tfor y := y0; y <= y1; y++ {\n\t\t\t\ti := z*nxy + y*nx + x0\n\t\t\t\tfor x := x0; x <= x1; x++ {\n\t\t\t\t\tdata[i] = 1\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "fb1317ab410089aabaa537c6e2c8541a", "score": "0.5661844", "text": "func (m *IPAddressMutation) SubnetMask() (r string, exists bool) {\n\tv := m.subnet_mask\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "246b9f501ba034747890abeb67c24274", "score": "0.5650967", "text": "func (h *APIface) mask() net.IPMask {\n\treturn net.IPv4Mask(255, 255, 255, 0)\n}", "title": "" }, { "docid": "34f4c3fb43b2af784475c883a04df3dc", "score": "0.5645978", "text": "func (ip IPv4Addr) AsCIDRMask() int {\n\tm := 0\n\tfor i := len(ip) - 1; i >= 0; i-- {\n\t\tfor j := uint(0); j < 8; j++ {\n\t\t\tif (ip[i]>>j)&0x1 != 0 {\n\t\t\t\treturn 32 - m\n\t\t\t}\n\t\t\tm++\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "543b4918a8fd8f0835ba57e344e7fb06", "score": "0.56241417", "text": "func (o *StorageNetAppBaseIpInterfaceAllOf) GetNetmask() string {\n\tif o == nil || o.Netmask == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Netmask\n}", "title": "" }, { "docid": "730447625076f38fd543895e1eb2e69e", "score": "0.5608143", "text": "func NewWithoutMaskPart(ip string) (IP, error) {\n\tif IP(ip).HasMaskPart() {\n\t\treturn \"\", fmt.Errorf(\"invalid ip `%s`, mask part is not allowed\", ip)\n\t}\n\n\tif net.ParseIP(ip) == nil {\n\t\treturn \"\", fmt.Errorf(\"invalid ip `%s`\", ip)\n\t}\n\n\treturn IP(ip), nil\n}", "title": "" }, { "docid": "f49deff7985c2d04fbf896dfbf9eb8bf", "score": "0.559295", "text": "func SubnetMask(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "aa3d824c8cd918697f88cd000b5b2c5c", "score": "0.5558589", "text": "func (i4 I4) Mask() IPMask {\n\treturn IPMask(net.CIDRMask(i4.maskBits, 32))\n}", "title": "" }, { "docid": "99d7890111e019a6bac32179147e0477", "score": "0.5532098", "text": "func SubnetMaskContainsFold(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.ContainsFold(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "8beab3e750afa35fdad5996687b99c45", "score": "0.55051297", "text": "func (ip IP) GetMaskAsInt() (int, error) {\n\tmask := ip.GetMaskPart()\n\treturn strconv.Atoi(mask)\n}", "title": "" }, { "docid": "70728df69b248ae32533b380448ffef2", "score": "0.5490093", "text": "func wildcard(mask net.IP) net.IP {\n\tvar ipVal net.IP\n\tfor _, octet := range mask {\n\t\tipVal = append(ipVal, ^octet)\n\t}\n\treturn ipVal\n}", "title": "" }, { "docid": "8191955bb82834d3873c84fa8522487d", "score": "0.54862773", "text": "func parseIPv4Mask(s string) net.IPMask {\n\tmask := net.ParseIP(s)\n\tif mask == nil {\n\t\treturn nil\n\t}\n\treturn net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])\n}", "title": "" }, { "docid": "9b2c04db149983f83b262d0b9110d697", "score": "0.5441947", "text": "func (ipAddr *IPAddr) Netmask() IPAddr {\n\tvar newIPAddr IPAddr\n\tnewIPAddr.Family = ipAddr.Family\n\tnewIPAddr.Addr = ipAddr.Addr\n\n\tif ipAddr.Family == IPv4family {\n\t\tLoMask := ^uint32(0) << (32 - ipAddr.Mask)\n\t\tnewIPAddr.Addr.Lo = uint64(LoMask) | IPv4mappedIPv6prefix\n\t} else if ipAddr.Mask <= 64 {\n\t\tnewIPAddr.Addr.Hi = ^uint64(0) << (64 - ipAddr.Mask)\n\t\tnewIPAddr.Addr.Lo = uint64(0)\n\t} else {\n\t\tnewIPAddr.Addr.Hi = ^uint64(0)\n\t\tnewIPAddr.Addr.Lo = ^uint64(0) << (128 - ipAddr.Mask)\n\t}\n\n\tif newIPAddr.Family == IPv4family {\n\t\tnewIPAddr.Mask = 32\n\t} else {\n\t\tnewIPAddr.Mask = 128\n\t}\n\n\treturn newIPAddr\n}", "title": "" }, { "docid": "f178d651495e2d67e2c1a1f122ed5e22", "score": "0.5423308", "text": "func Mask(n string) string {\n\tu := Unmask(n)\n\tif len(u) == 11 {\n\t\treturn cpf.Mask(u)\n\t}\n\tif len(u) == 14 {\n\t\treturn cnpj.Mask(u)\n\t}\n\treturn n\n}", "title": "" }, { "docid": "77f182d9cfaa2c91796a330ee212fa7a", "score": "0.5406191", "text": "func (vs *voteSet) getMask() *bitArray {\n\treturn vs.mask\n}", "title": "" }, { "docid": "c1b71a8f068f5cb60d56d07515b9a0b8", "score": "0.53973526", "text": "func (ipv4 *IPv4Address) Netmask() string {\n\treturn ToIPv4Address(0xffffffff << (32 - ipv4.prefix)).String()\n}", "title": "" }, { "docid": "d4e94d4b92a3c362c20f4ad4a7168f21", "score": "0.5362898", "text": "func bitMask(nBits int) *big.Int {\n\tswitch nBits {\n\tcase 0:\n\t\treturn zero\n\tcase 1:\n\t\treturn one\n\tcase 8:\n\t\treturn numTypeBounds[t.KeyU8][1]\n\tcase 16:\n\t\treturn numTypeBounds[t.KeyU16][1]\n\tcase 32:\n\t\treturn numTypeBounds[t.KeyU32][1]\n\tcase 64:\n\t\treturn numTypeBounds[t.KeyU64][1]\n\t}\n\tz := big.NewInt(0).Lsh(one, uint(nBits))\n\treturn z.Sub(z, one)\n}", "title": "" }, { "docid": "4ffe26c9fdf326f36238f1d069e663ce", "score": "0.53566206", "text": "func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {\n\treturn f.fs.GetIPv4Mask(name)\n}", "title": "" }, { "docid": "90513486b39553d456ce0eb8a26bcd8e", "score": "0.53395313", "text": "func (e *Entity) GetMask() []bool {\n\tif e.Sprite != nil {\n\t\treturn e.Sprite.mask\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "42081e0fb5c78ca3f276285e7c9114c9", "score": "0.5323447", "text": "func (m *IPStaticRoutingTableMutation) SubnetMask() (r string, exists bool) {\n\tv := m.subnet_mask\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "6fe3089ae4eecfe4175faccf19362668", "score": "0.53114694", "text": "func (ip IPv4Addr) Mask(mask IPv4Addr) IPv4Addr {\n\tmasked := ip\n\tfor i := range masked {\n\t\tmasked[i] &= mask[i]\n\t}\n\treturn masked\n}", "title": "" }, { "docid": "a214e9e2b7ca032e3cdb96cce3a0a43c", "score": "0.5307012", "text": "func (ipv6 IPv6Addr) NetIPMask() *net.IPMask {\n\tipv6Mask := make(net.IPMask, IPv6len)\n\tm := big.Int(*ipv6.Mask)\n\tcopy(ipv6Mask, m.Bytes())\n\treturn &ipv6Mask\n}", "title": "" }, { "docid": "52fa44be350e4752dda937ee71750577", "score": "0.53049195", "text": "func (l *Lease) SubnetMask() net.IPMask {\n\tif l == nil {\n\t\treturn nil\n\t}\n\tmask := net.IPMask(dhcpv4.GetIP(dhcpv4.OptionSubnetMask, l.Options))\n\tif _, bits := mask.Size(); bits != 32 { // If given mask is not valid, use the default mask\n\t\tmask = l.AssignedIP.DefaultMask()\n\t}\n\treturn mask\n}", "title": "" }, { "docid": "04089bf5d312e845760f55d34db396e5", "score": "0.5301761", "text": "func (ipAddr *IPAddr) Hostmask() IPAddr {\n\tvar newIPAddr IPAddr\n\tnewIPAddr.Family = ipAddr.Family\n\tnewIPAddr.Addr = ipAddr.Addr\n\n\tif ipAddr.Family == IPv4family {\n\t\tLoMask := ^uint32(0) >> ipAddr.Mask\n\t\tnewIPAddr.Addr.Lo = uint64(LoMask) | IPv4mappedIPv6prefix\n\t} else if ipAddr.Mask <= 64 {\n\t\tnewIPAddr.Addr.Hi = ^uint64(0) >> ipAddr.Mask\n\t\tnewIPAddr.Addr.Lo = ^uint64(0)\n\t} else {\n\t\tnewIPAddr.Addr.Hi = uint64(0)\n\t\tnewIPAddr.Addr.Lo = ^uint64(0) >> (ipAddr.Mask - 64)\n\t}\n\n\tif newIPAddr.Family == IPv4family {\n\t\tnewIPAddr.Mask = 32\n\t} else {\n\t\tnewIPAddr.Mask = 128\n\t}\n\n\treturn newIPAddr\n}", "title": "" }, { "docid": "d15471793ebc99774601e486a9a2c256", "score": "0.527407", "text": "func ipMaskContains(ip iputil.VpnIp, zeros iputil.VpnIp, testIp iputil.VpnIp) bool {\n\treturn (testIp^ip)>>zeros == 0\n}", "title": "" }, { "docid": "2189fb784ba2c321b4af0e56e140011a", "score": "0.52660316", "text": "func splitNetAddr(addr string) (netPart, addrPart string, err error) {\n\tstrs := strings.SplitN(addr, \"!\", 2)\n\tif len(strs) != 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"Invalid filesystem address : %s\\n\", addr)\n\t}\n\treturn strs[0], strs[1], nil\n}", "title": "" }, { "docid": "9acb2bbed9dcfcc770d25cb98a719f0b", "score": "0.52628154", "text": "func wordMask(i uint) (uint, uint64) {\n\treturn i >> 6, 1 << (i & 63)\n}", "title": "" }, { "docid": "3e5e9f1e723dea3229878d5bb2ae9289", "score": "0.5257117", "text": "func (o *ManagementInterfaceAllOf) GetIpv4Mask() string {\n\tif o == nil || o.Ipv4Mask == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Ipv4Mask\n}", "title": "" }, { "docid": "ddeb32c529683e497bcec28d506f0ac0", "score": "0.52441174", "text": "func (o IpSecurityRestrictionOutput) SubnetMask() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v IpSecurityRestriction) *string { return v.SubnetMask }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9797a9e28a0fc957d029584fabfa4c04", "score": "0.5234888", "text": "func (ip IPv6Addr) AsCIDRMask() int {\n\tm := 0\n\tfor i := len(ip) - 1; i >= 0; i-- {\n\t\tfor j := uint(0); j < 8; j++ {\n\t\t\tif (ip[i]>>j)&0x1 != 0 {\n\t\t\t\treturn 128 - m\n\t\t\t}\n\t\t\tm++\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "4b9429aee8b760782a6121e00eb76811", "score": "0.5209441", "text": "func (o *ManagementInterfaceAllOf) GetMaskOk() (*string, bool) {\n\tif o == nil || o.Mask == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Mask, true\n}", "title": "" }, { "docid": "5b92c82c8b86ef3ff88b95f4b4e32c00", "score": "0.51585436", "text": "func (Helpers) Mask(left int, content string) string {\n\tsize := len(content)\n\tif size < 16 {\n\t\treturn strings.Repeat(\"*\", size)\n\t}\n\n\treturn content[:left] + strings.Repeat(\"*\", size-left*2) + content[size-left:]\n}", "title": "" }, { "docid": "070598cf4cbc75cf63a3204e4f501a68", "score": "0.5132824", "text": "func (ip IPv6Addr) Mask(mask IPv6Addr) IPv6Addr {\n\tmasked := ip\n\tfor i := range masked {\n\t\tmasked[i] &= mask[i]\n\t}\n\treturn masked\n}", "title": "" }, { "docid": "17a21c1f7ebf86ec07b4dc10a391ae10", "score": "0.51284546", "text": "func lastIP(ip net.IP, mask net.IPMask) net.IP {\n\tipIn := ip.To4() // is it an IPv4\n\tif ipIn == nil {\n\t\tipIn = ip.To16() // is it IPv6\n\t\tif ipIn == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\tvar ipVal net.IP\n\t// apply network mask to each octet\n\tfor i, octet := range ipIn {\n\t\tipVal = append(ipVal, octet|mask[i])\n\t}\n\treturn ipVal\n}", "title": "" }, { "docid": "2d3598ded7cf729920927544875cb2de", "score": "0.512604", "text": "func getIP(addr string) string {\n\treturn strings.Split(addr, \":\")[0]\n}", "title": "" }, { "docid": "3fe73d445efde53e1631d493371fabbf", "score": "0.5119357", "text": "func (r *RPC) Mask(c context.Context, a *model.ArgMask, res *model.Mask) (err error) {\n\tif a == nil {\n\t\terr = ecode.RequestErr\n\t\treturn\n\t}\n\tvar m *model.Mask\n\tif m, err = r.s.MaskList(c, a.Cid, a.Plat); err == nil && m != nil {\n\t\t*res = *m\n\t}\n\treturn\n}", "title": "" }, { "docid": "ca1ce3c19d07622a89aa592c89a20882", "score": "0.51125854", "text": "func (d *Domain) Mask(ms ...uint32) ([]uint32, error) {\n\tvar (\n\t\tok bool\n\t\tb uint32\n\t)\n\n\ta := make([]uint32, len(ms))\n\n\tfor i, m := range ms {\n\t\tif b, ok = d.f[m]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"%d is not a member\", m)\n\t\t}\n\n\t\ta[i] = b\n\t}\n\n\treturn a, nil\n}", "title": "" }, { "docid": "be41e5fbc4c7f2daac658a860c977cc4", "score": "0.5084809", "text": "func cidr2mask(cidr int) string {\n mask := net.CIDRMask(cidr, 32)\n masks := []string{}\n for _, v := range mask {\n masks = append(masks, strconv.Itoa(int(v))) \n }\n\n return strings.Join(masks, \".\")\n}", "title": "" }, { "docid": "a955c141f8db9dba61af2877fff73452", "score": "0.504993", "text": "func SubnetMaskGTE(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.GTE(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "7f55362d0a5fd39294e09de218ae07c5", "score": "0.5048173", "text": "func parse_ipv4_part(i string, addr string) (*uint32, *string) {\n\tpart, err := strconv.ParseUint(i, 10, 32)\n\tif err != nil {\n\t\ttmp := fmt.Sprintf(\"IP must contain numbers %s\", addr)\n\t\t// fmt.Printf(\"parse_ipv4_part-1 %s:%s:%s:%s\\n\", i, part, err, addr, tmp)\n\t\treturn nil, &tmp\n\t}\n\tpart_num := uint32(part)\n\tif part_num >= 256 {\n\t\ttmp := fmt.Sprintf(\"IP items has to lower than 256. %s\", addr)\n\t\t// fmt.Printf(\"parse_ipv4_part-2\\n\")\n\t\treturn nil, &tmp\n\t}\n\t// fmt.Printf(\"parse_ipv4_part-3: %d\\n\", part_num)\n\treturn &part_num, nil\n}", "title": "" }, { "docid": "0a231f9e41461692d085ad1a6faddd89", "score": "0.50097257", "text": "func SubnetMaskContains(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.Contains(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "e7dd7c5f2d06e24dbf4bd592a76af7b6", "score": "0.50087714", "text": "func (o IpSecurityRestrictionResponseOutput) SubnetMask() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v IpSecurityRestrictionResponse) *string { return v.SubnetMask }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "9c39abae8b1117eba01e12b652b6946a", "score": "0.50005525", "text": "func (m *IPAddressMutation) OldSubnetMask(ctx context.Context) (v string, err error) {\n\tif !m.op.Is(OpUpdateOne) {\n\t\treturn v, fmt.Errorf(\"OldSubnetMask is only allowed on UpdateOne operations\")\n\t}\n\tif m.id == nil || m.oldValue == nil {\n\t\treturn v, fmt.Errorf(\"OldSubnetMask 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 OldSubnetMask: %w\", err)\n\t}\n\treturn oldValue.SubnetMask, nil\n}", "title": "" }, { "docid": "8c4050604b5188d189c6cf367115a5e8", "score": "0.49914536", "text": "func getSubstring(ipv4 []byte, index uint8) uint32 {\n\tvar ans = binary.BigEndian.Uint32(ipv4)\n\tans = ans <<(bitslen * index)\n\tans = ans >>(32 - bitslen)\n\n\treturn ans\n}", "title": "" }, { "docid": "55b062fe65c809076e92ae1c2866eba9", "score": "0.49818498", "text": "func (o *NetInterfaceInfoType) Netmask() IpAddressType {\n\tvar r IpAddressType\n\tif o.NetmaskPtr == nil {\n\t\treturn r\n\t}\n\tr = *o.NetmaskPtr\n\treturn r\n}", "title": "" }, { "docid": "c9e7a02aaefb9a29ab445c5c4d95ac57", "score": "0.49231803", "text": "func (o *StorageNetAppBaseIpInterfaceAllOf) GetNetmaskOk() (*string, bool) {\n\tif o == nil || o.Netmask == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Netmask, true\n}", "title": "" }, { "docid": "25824295226a0607cd176c3a376035fb", "score": "0.49213746", "text": "func (p Pin) Mask() Pins {\n\treturn Pin0 << uint(p.Num())\n}", "title": "" }, { "docid": "39571e2741206d70151fa7546bd65150", "score": "0.49212614", "text": "func SubnetMaskLTE(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.LTE(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "295fc183238ac0473503099ac2cdaeae", "score": "0.4907395", "text": "func GetSubnet(cidr string) (ipNet *net.IPNet) {\n\tparts := strings.Split(cidr, \"/\")\n\n\tipString := parts[0]\n\tprefixSize := 0\n\n\t// check prefix size\n\n\tif len(parts) == 2 {\n\t\tvar err error\n\t\tprefixSize, err = strconv.Atoi(parts[1])\n\t\tif err != nil {\n\t\t\tprefixSize = 0\n\t\t} else if prefixSize < 0 || prefixSize > 24 {\n\t\t\tprefixSize = 0\n\t\t}\n\t}\n\n\t// pad IP & choose a prefix size if not specified\n\n\tif !strings.HasSuffix(ipString, \".\") && strings.Count(ipString, \".\") < 3 {\n\t\tipString += \".\"\n\t}\n\n\tswitch strings.Count(ipString, \".\") {\n\tcase 1:\n\t\tipString += \"0.0.0\"\n\n\t\tif prefixSize == 0 {\n\t\t\tprefixSize = 8\n\t\t}\n\n\tcase 2:\n\t\tipString += \"0.0\"\n\n\t\tif prefixSize == 0 {\n\t\t\tprefixSize = 16\n\t\t}\n\n\tcase 3:\n\t\tif strings.HasSuffix(ipString, \".\") {\n\t\t\tipString += \"0\"\n\t\t}\n\n\t\tif prefixSize == 0 {\n\t\t\tprefixSize = 24\n\t\t}\n\t}\n\n\t// TODO: maybe handle error?\n\t_, ipNet, _ = net.ParseCIDR(ipString + \"/\" + strconv.Itoa(prefixSize))\n\n\treturn\n}", "title": "" }, { "docid": "eae4313a417cf015be90878da4ba10ca", "score": "0.4897397", "text": "func SubnetMaskLT(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.LT(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "c8cebf39ed6f98e134ca7abfa2d7eff4", "score": "0.48811483", "text": "func (w *Workload) GetNetwork(ip string) string {\n\tfor _, i := range PtrToVal(w.Interfaces) {\n\t\tif i.Address == ip {\n\t\t\tif i.CidrBlock != nil {\n\t\t\t\t_, ipNet, _ := net.ParseCIDR(fmt.Sprintf(\"%s/%d\", i.Address, *i.CidrBlock))\n\t\t\t\t// IPv4\n\t\t\t\tif len(ipNet.Mask) == 4 {\n\t\t\t\t\treturn fmt.Sprintf(\"%d.%d.%d.%d\", ipNet.Mask[0], ipNet.Mask[1], ipNet.Mask[2], ipNet.Mask[3])\n\t\t\t\t}\n\t\t\t\tif len(ipNet.Mask) > 4 {\n\t\t\t\t\treturn ipNet.Mask.String()\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"NA\"\n\t\t}\n\t}\n\treturn \"NA\"\n}", "title": "" }, { "docid": "c55e851fed918f902ee8190b61d720dd", "score": "0.48775434", "text": "func (p Pin) getPortMask() (*volatile.Register8, uint8) {\n\tswitch {\n\tcase p >= PB0 && p <= PB7: // port B\n\t\treturn avr.PORTB, 1 << uint8(p-portB)\n\tcase p >= PC0 && p <= PC7: // port C\n\t\treturn avr.PORTC, 1 << uint8(p-portC)\n\tcase p >= PD0 && p <= PD7: // port D\n\t\treturn avr.PORTD, 1 << uint8(p-portD)\n\tcase p >= PE0 && p <= PE7: // port E\n\t\treturn avr.PORTE, 1 << uint8(p-portE)\n\tdefault: // port F\n\t\treturn avr.PORTF, 1 << uint8(p-portF)\n\t}\n}", "title": "" }, { "docid": "28ff1e5b839315d0b782a758c66335e5", "score": "0.48762003", "text": "func IPv4Mask(a, b, c, d byte) IPMask {\n\tipmask := net.IPv4Mask(a, b, c, d)\n\n\treturn IPMask{ipmask}\n}", "title": "" }, { "docid": "8c444e016931cb50e03f51841159788d", "score": "0.4875807", "text": "func (ipv6 IPv6Addr) Maskbits() int {\n\tmaskOnes, _ := ipv6.NetIPNet().Mask.Size()\n\n\treturn maskOnes\n}", "title": "" }, { "docid": "bc4479689a9b39c2e8b67dbcb2319bb9", "score": "0.48601598", "text": "func maskKey(s string) string {\n\tvar pre string\n\tif len(s) >= 4 {\n\t\tpre = s[0:4]\n\t} else {\n\t\tpre = \"****\"\n\t}\n\treturn pre + \"****\"\n}", "title": "" }, { "docid": "adc789226d5878622aa0a72bee1ce5dd", "score": "0.48599336", "text": "func uvarintMask(buf []byte, mask uint8) (x uint64, n int) {\n\tfor i := uint(0); i < 8; i++ {\n\t\tif mask&(1<<i) != 0 {\n\t\t\tif n >= len(buf) {\n\t\t\t\treturn 0, -1\n\t\t\t}\n\t\t\tx |= uint64(buf[n]) << (i * 8)\n\t\t\tn++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "7168d52eed0c8c29d6d31f3822ccbad3", "score": "0.48538813", "text": "func (me TxsdSystemitemClass) IsNetmask() bool { return me == \"netmask\" }", "title": "" }, { "docid": "9184039d8f9586a0a1098ad81143d5f1", "score": "0.48424745", "text": "func SubnetMaskEqualFold(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.EqualFold(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "2ef6b620c0e4879ff1ac5f5c0d884fa3", "score": "0.4834781", "text": "func SubnetMaskHasPrefix(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.HasPrefix(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "a8334989503f1287a34e1edd5c28e564", "score": "0.4821139", "text": "func SubnetMaskHasSuffix(v string) predicate.IPStaticRoutingTable {\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\ts.Where(sql.HasSuffix(s.C(FieldSubnetMask), v))\n\t})\n}", "title": "" }, { "docid": "2abda245b37a694634f1fa275951a62c", "score": "0.48203248", "text": "func CIDRPartition(network *net.IPNet, exclude net.IP) {\n}", "title": "" }, { "docid": "28463dbfd351e1749f314d9edfbbeb3f", "score": "0.48153985", "text": "func maskedIPToLabelString(ip netip.Addr, prefix int) string {\n\tipStr := ip.String()\n\tipNoColons := strings.Replace(ipStr, \":\", \"-\", -1)\n\n\t// EndpointSelector keys can't start or end with a \"-\", so insert a\n\t// zero at the start or end if it would otherwise have a \"-\" at that\n\t// position.\n\tpreZero := \"\"\n\tpostZero := \"\"\n\tif ipNoColons[0] == '-' {\n\t\tpreZero = \"0\"\n\t}\n\tif ipNoColons[len(ipNoColons)-1] == '-' {\n\t\tpostZero = \"0\"\n\t}\n\tvar str strings.Builder\n\tstr.Grow(\n\t\tlen(labels.LabelSourceCIDR) +\n\t\t\tlen(preZero) +\n\t\t\tlen(ipNoColons) +\n\t\t\tlen(postZero) +\n\t\t\t2 /*len of prefix*/ +\n\t\t\t2, /* ':' '/' */\n\t)\n\tstr.WriteString(labels.LabelSourceCIDR)\n\tstr.WriteRune(':')\n\tstr.WriteString(preZero)\n\tstr.WriteString(ipNoColons)\n\tstr.WriteString(postZero)\n\tstr.WriteRune('/')\n\tstr.WriteString(strconv.Itoa(prefix))\n\treturn str.String()\n}", "title": "" }, { "docid": "ba994e7a0334ecd7f817b9ab20871ac9", "score": "0.48079032", "text": "func mustFindMask(mask string) int {\n\tfor i, v := range vmMasks {\n\t\tif v == mask {\n\t\t\treturn i\n\t\t}\n\t}\n\n\tlog.Fatal(\"missing `%s` in vmMasks\", mask)\n\treturn -1\n}", "title": "" }, { "docid": "b4fdcb2ce2dbff61f8d0280f06d40aaa", "score": "0.4806276", "text": "func (self *IPAddress) Bits() string {\n\tnum := self.Host_address.Text(2)\n\tvar ret bytes.Buffer\n\tfor i := uint8(len(num)); i < self.Ip_bits.Bits; i++ {\n\t\tret.WriteString(\"0\")\n\t}\n\tret.WriteString(num)\n\treturn ret.String()\n}", "title": "" }, { "docid": "3bd49a6ba35a24efa118e03e3e3ad214", "score": "0.48050165", "text": "func bucketMask(b uint8) uintptr {\n\treturn bucketShift(b) - 1\n}", "title": "" }, { "docid": "dd4c835d7c22ae91a2b6cad895ac8c38", "score": "0.4801299", "text": "func (m *TeamworkNetworkConfiguration) SetSubnetMask(value *string)() {\n err := m.GetBackingStore().Set(\"subnetMask\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e27bcafd491a8cb6eef2e0bc6aedf2c3", "score": "0.47991636", "text": "func (o *ManagementInterfaceAllOf) GetIpv4MaskOk() (*string, bool) {\n\tif o == nil || o.Ipv4Mask == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Ipv4Mask, true\n}", "title": "" }, { "docid": "d65e1375f52bb3376303e91b9b83cb7c", "score": "0.47900674", "text": "func ParseINet(s string, dest *IPAddr) error {\n\tvar maskSize byte\n\ti := strings.IndexByte(s, '/')\n\tfamily := getFamily(s)\n\n\t// If no mask suffix was provided, implicitly don't mask.\n\tif i < 0 {\n\t\t// Trims IPv4 suffix \".\" to match postgres compitibility.\n\t\taddr := s\n\t\tif family == IPv4family {\n\t\t\taddr = strings.TrimRight(addr, \".\")\n\t\t\tmaskSize = 32\n\t\t} else {\n\t\t\tmaskSize = 128\n\t\t}\n\t\tip := net.ParseIP(addr)\n\t\tif ip == nil {\n\t\t\treturn pgerror.NewErrorf(pgerror.CodeInvalidTextRepresentationError, \"could not parse %q as inet. invalid IP\", s)\n\t\t}\n\n\t\t*dest = IPAddr{Family: family,\n\t\t\tAddr: Addr(uint128.FromBytes(ip)),\n\t\t\tMask: maskSize,\n\t\t}\n\t\treturn nil\n\t}\n\n\taddr, maskStr := s[:i], s[i+1:]\n\t// Trims IPv4 suffix \".\" to match postgres compitibility.\n\tif family == IPv4family {\n\t\taddr = strings.TrimRight(addr, \".\")\n\t}\n\tmaskOnes, err := strconv.Atoi(maskStr)\n\tif err != nil {\n\t\treturn pgerror.NewErrorf(pgerror.CodeInvalidTextRepresentationError, \"could not parse %q as inet. invalid mask\", s)\n\t} else if maskOnes < 0 || (family == IPv4family && maskOnes > 32) || (family == IPv6family && maskOnes > 128) {\n\t\treturn pgerror.NewErrorf(pgerror.CodeInvalidTextRepresentationError, \"could not parse %q as inet. invalid mask\", s)\n\t}\n\n\tif family == IPv4family {\n\t\t// If the mask is outside the defined octets, postgres will raise an error.\n\t\toctetCount := strings.Count(addr, \".\") + 1\n\t\tif (octetCount+1)*8-1 < maskOnes {\n\t\t\treturn pgerror.NewErrorf(pgerror.CodeInvalidTextRepresentationError, \"could not parse %q as inet. mask is larger than provided octets\", s)\n\t\t}\n\n\t\t// Append extra \".0\" to ensure there are a total of 4 octets.\n\t\tvar buffer bytes.Buffer\n\t\tbuffer.WriteString(addr)\n\t\tfor i := 0; i < 4-octetCount; i++ {\n\t\t\tbuffer.WriteString(\".0\")\n\t\t}\n\t\taddr = buffer.String()\n\n\t}\n\n\tip := net.ParseIP(addr)\n\tif ip == nil {\n\t\treturn pgerror.NewErrorf(pgerror.CodeInvalidTextRepresentationError, \"could not parse %q as inet. invalid IP\", s)\n\t}\n\n\t*dest = IPAddr{Family: family,\n\t\tAddr: Addr(uint128.FromBytes(ip)),\n\t\tMask: byte(maskOnes),\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "286b8bad88739b1fc196c41fc43f7880", "score": "0.47757205", "text": "func (o *GridMap) GetCollisionMask() gdnative.Int {\n\t//log.Println(\"Calling GridMap.GetCollisionMask()\")\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(\"GridMap\", \"get_collision_mask\")\n\n\t// Call the parent method.\n\t// int\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 ret\n}", "title": "" }, { "docid": "71e83f5a19d798a1212bcc3e09499fc0", "score": "0.47672367", "text": "func (o *LinkEventMetadata) GetAccountNumberMask() string {\n\tif o == nil || o.AccountNumberMask == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.AccountNumberMask\n}", "title": "" }, { "docid": "7f25939133f0a3d8f2da3ac0ee797e27", "score": "0.47632045", "text": "func randomIP(mask string) string {\n\tvar ip netsupport.IPAddr\n\terr := ip.Parse(mask)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tb := netsupport.Unpackip(ip)\n\tfor i := 0; i < 4; i++ {\n\t\tif b[i] == 0 {\n\t\t\tb[i] = byte(rand.Intn(150) + 100)\n\t\t}\n\t}\n\trandomip := netsupport.Packip(b)\n\treturn randomip.String()\n}", "title": "" }, { "docid": "a8ed95a726827cde9d9e4d1df1f52bff", "score": "0.47572097", "text": "func SubnetMaskIn(vs ...string) predicate.IPStaticRoutingTable {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.IPStaticRoutingTable(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldSubnetMask), v...))\n\t})\n}", "title": "" }, { "docid": "45edba2eb305fab2b48fc9cabb571d08", "score": "0.47535554", "text": "func mask0(n, p uint) instruction { return ^mask1(n, p) }", "title": "" }, { "docid": "401820665c42e222f0fc59ff05c523d9", "score": "0.4743993", "text": "func TestFilterRoundCharactersSubMask(t *testing.T) {\n\tmask := testFilterRoundCharactersMask()\n\tsize := mask.CharacterSize()\n\toffs := size.X * 2\n\trect := image.Rect(offs, 0, offs+size.X*2, size.Y*2) // Second character only\n\ttemp := RoundCharacters(mask)\n\ttest := temp.SubMask(rect)\n\tt.Logf(\"%s ∩ %s = %s\", temp.Bounds(), rect, test.Bounds())\n\twant := NewBytesMask([]byte{\n\t\t// First\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t// Second\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0xc0, 0x00, /* ##______________ */\n\t\t0xe0, 0x00, /* ###_____________ */\n\t\t0x70, 0x00, /* _###____________ */\n\t\t0x30, 0x00, /* __##____________ */\n\t\t0x00, 0x00, /* ________________ */\n\t\t0x00, 0x00, /* ________________ */\n\t}, MaskOptions{\n\t\tSize: image.Pt(16, 8), /* 16x8 font */\n\t})\n\n\tt.Logf(\"mask character size: %s\", mask.CharacterSize())\n\tt.Logf(\"test character size: %s\", test.CharacterSize())\n\tt.Logf(\"mask:\")\n\ttestMaskDump(t, mask, mask.Bounds())\n\t// FIXME\n\t//t.Logf(\"want:\")\n\t//testMaskDump(t, want, want.Bounds())\n\ttestMaskEqual(t, test, want)\n}", "title": "" }, { "docid": "7ebefd151283e60aa901e94170ed4649", "score": "0.47410032", "text": "func mask(s string) string {\n\trs := []rune(s)\n\tfor i := 0; i < len(rs)-4; i++ {\n\t\trs[i] = '*'\n\t}\n\treturn string(rs)\n}", "title": "" }, { "docid": "439ad44fff6a06ed1eb88ae486034b53", "score": "0.47344658", "text": "func ParseIPv4Mask(s string) net.IPMask {\n\tmask := net.ParseIP(s)\n\tif mask == nil {\n\t\treturn nil\n\t}\n\treturn net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])\n}", "title": "" }, { "docid": "d0cfc86a0062d140d2675ecc2d045192", "score": "0.47343004", "text": "func split_on_colon(addr string) (*big.Int, *string, uint) {\n\tparts := strings.Split(strings.TrimSpace(addr), \":\")\n\tip := big.NewInt(0)\n\tparts_len := uint(len(parts))\n\t// fmt.Printf(\"soc:%s:%d\\n\", addr, parts_len);\n\tif parts_len == 1 && parts[0] == \"\" {\n\t\treturn ip, nil, 0\n\t}\n\tshift := uint((parts_len - 1) * 16)\n\tfor _, i := range parts {\n\t\tpart, err := strconv.ParseUint(i, 16, 32)\n\t\tif err != nil {\n\t\t\ttmp := fmt.Sprintf(\"IP must contain hex numbers %s->%s\", addr, i)\n\t\t\treturn nil, &tmp, 0\n\t\t}\n\t\tpart_num := int64(part)\n\t\tif part_num >= 65536 {\n\t\t\ttmp := fmt.Sprintf(\"IP items has to lower than 65536. %s\", addr)\n\t\t\treturn nil, &tmp, 0\n\t\t}\n\t\tbi_part_num := big.NewInt(part_num)\n\t\tbi_part_num = bi_part_num.Lsh(bi_part_num, shift)\n\t\tip = ip.Add(ip, bi_part_num)\n\t\tshift -= 16\n\t}\n\treturn ip, nil, parts_len\n}", "title": "" }, { "docid": "9eccdddd4c5f57a073b92e4565e8c749", "score": "0.47336066", "text": "func Mask(data, mask []byte) []byte {\n\tvar dataLength = len(data)\n\tif dataLength < 1 {\n\t\treturn data\n\t}\n\tresult := make([]byte, dataLength)\n\tcopy(result, data)\n\n\tvar maskLength = len(mask)\n\tvar operationLength = maskLength\n\t// If mask is longer than data, keep operation to (shorter) data length\n\tif maskLength > dataLength {\n\t\toperationLength = dataLength\n\t}\n\tfor i := 1; i < operationLength+1; i++ {\n\t\tresult[dataLength-i] &= mask[maskLength-i]\n\t}\n\treturn result\n}", "title": "" }, { "docid": "9c76173887d5eb58e91e4a9e85cb80e2", "score": "0.4733542", "text": "func getorigdst(fd uintptr) (rawaddr []byte, err error) {\n\t// IPv4 address starts at the 5th byte, 4 bytes long (206 190 36 45)\n\taddr, err := syscall.GetsockoptIPv6Mreq(int(fd), syscall.IPPROTO_IP, SO_ORIGINAL_DST)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trawaddr = make([]byte, 1+net.IPv4len+2)\n\t// address type, 1 - IPv4, 4 - IPv6, 3 - hostname\n\trawaddr[0] = 1\n\t// raw IP address, 4 bytes for IPv4 or 16 bytes for IPv6\n\tcopy(rawaddr[1:], addr.Multiaddr[4:4+net.IPv4len])\n\t// port\n\tcopy(rawaddr[1+net.IPv4len:], addr.Multiaddr[2:2+2])\n\n\treturn rawaddr, nil\n}", "title": "" }, { "docid": "8ae45f5958c44870fa631f54214a989b", "score": "0.4724054", "text": "func Umask(mask int) (oldmask int) {\n\treturn unix.Umask(mask)\n}", "title": "" }, { "docid": "649a4b2b1c5bcc2dd299be382a3496c2", "score": "0.47224098", "text": "func (i4 I4) MaskBits() int {\n\treturn i4.maskBits\n}", "title": "" } ]
9bd761204a36a7f9dbb63dd744f80baf
TestReadUint64 tests a reading a single uint64 field
[ { "docid": "f183949a44b0d97dc7a91b58a55cbe76", "score": "0.8587163", "text": "func TestReadUint64(t *testing.T) {\n\tbs := []byte{13, 0, 0, 0, 0, 0, 0, 0}\n\tr := bytes.NewReader(bs)\n\n\tnum, err := ReadUint64(r)\n\n\tassert.NoError(t, err)\n\tassert.Equal(t, num, uint64(13))\n}", "title": "" } ]
[ { "docid": "2c4eae9a6ad8dc92fa98f64da3025cd7", "score": "0.7789488", "text": "func TestReadUint64Slow(t *testing.T) {\n\tr := &hesitantReader{data: [][]byte{\n\t\t{13},\n\t\t{},\n\t\t{0, 0, 0, 0, 0, 0, 0},\n\t}}\n\n\tnum, err := ReadUint64(r)\n\tassert.NoError(t, err)\n\tassert.Equal(t, num, uint64(13))\n}", "title": "" }, { "docid": "0ff071e35ecc99c151fcc5212aa6478e", "score": "0.7582675", "text": "func ReadUint64(r io.Reader, v *uint64) error {\n\tvar b [8]byte\n\n\tn, err := r.Read(b[:])\n\tif err != nil || n != len(b) {\n\t\treturn err\n\t}\n\n\t*v = byteOrder.Uint64(b[:])\n\treturn nil\n}", "title": "" }, { "docid": "8c97fa48e52ff14e24a495af7ba6814c", "score": "0.75287986", "text": "func ReadUint64(r io.Reader) (v uint64, err error) {\n\tb, err := ReadNBytes(r, 8)\n\tif err != nil {\n\t\treturn\n\t}\n\tv = ToUint64(b)\n\treturn\n}", "title": "" }, { "docid": "819b56abb92c3c7f3031b9913b87144a", "score": "0.75112045", "text": "func ReadUint64(r io.Reader, order binary.ByteOrder) (uint64, error) {\n\tbuf := make([]byte, 8)\n\tif _, err := io.ReadFull(r, buf); err != nil {\n\t\treturn 0, err\n\t}\n\treturn order.Uint64(buf), nil\n}", "title": "" }, { "docid": "2160006dafae0b2d2affb312c371ceda", "score": "0.74684626", "text": "func (r *RandoMock) Uint64(key string) uint64 {\n\treturn uint64(r.ret[key].Get())\n}", "title": "" }, { "docid": "be12a6bcef0efa03ffe04d2ad0936111", "score": "0.74115086", "text": "func (r *BitReader) ReadUint64(bitCount uint) uint64 {\n\tresult := uint64(0)\n\tfor i := uint(0); i < bitCount; i++ {\n\t\tresult <<= 1\n\t\tif r.ReadBool() {\n\t\t\tresult |= 0x1\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "2d1e92fe60317ec43257143f3b9111aa", "score": "0.7377399", "text": "func (i *Iterator) ReadUInt64() (uint64, error) {\n\tif err := i.testAvailableBytes(8); err != nil {\n\t\treturn 0, err\n\t}\n\n\tv1, _ := i.bytes.ByteAt(i.index)\n\tv2, _ := i.bytes.ByteAt(i.index + 1)\n\tv3, _ := i.bytes.ByteAt(i.index + 2)\n\tv4, _ := i.bytes.ByteAt(i.index + 3)\n\tv5, _ := i.bytes.ByteAt(i.index + 4)\n\tv6, _ := i.bytes.ByteAt(i.index + 5)\n\tv7, _ := i.bytes.ByteAt(i.index + 6)\n\tv8, _ := i.bytes.ByteAt(i.index + 7)\n\n\ti.index += 8\n\treturn uint64(v1)<<56 | uint64(v2)<<48 | uint64(v3)<<40 | uint64(v4)<<32 | uint64(v5)<<24 | uint64(v6)<<16 | uint64(v7)<<8 | uint64(v8), nil\n}", "title": "" }, { "docid": "ece3d63edf4d2f213210d42188b3818e", "score": "0.7376487", "text": "func (b BufferReader) ReadUint64(offset int) (uint64, error) {\n\tif offset+8 > len(b.buffer) {\n\t\treturn 0, StackError(nil, \"Failed to read uint64 from offset %d\", offset)\n\t}\n\treturn *(*uint64)(unsafe.Pointer(&b.buffer[offset])), nil\n}", "title": "" }, { "docid": "0b5b5c2cdde74a96e24c001163b4eaa2", "score": "0.7303445", "text": "func (p *Packet) ReadUint64() (v uint64) {\n\tpos := p.readCursor + _PREPAYLOAD_SIZE\n\tv = packetEndian.Uint64(p.bytes[pos : pos+8])\n\tp.readCursor += 8\n\treturn\n}", "title": "" }, { "docid": "5986517aba4121ed31a1da159a31a1f5", "score": "0.7256832", "text": "func (r *Reader) Uint64() uint64 {\r\n\treturn binary.BigEndian.Uint64(r.buffer[r.i0:r.i1])\r\n}", "title": "" }, { "docid": "69330bb5c97a133597200fa3305445c4", "score": "0.72142076", "text": "func Uint64(r io.Reader) (uint64, error) {\n\tbuf := Borrow()[:8]\n\tif _, err := io.ReadFull(r, buf); err != nil {\n\t\tReturn(buf)\n\t\treturn 0, errors.WithStack(err)\n\t}\n\trv := binary.LittleEndian.Uint64(buf)\n\tReturn(buf)\n\treturn rv, nil\n}", "title": "" }, { "docid": "26eee94ed8e4004a2b1c66b5aa7ee044", "score": "0.71030116", "text": "func ReadBinaryToUInt64(b []byte, passedVariable *uint64) (error) {\n buf := bytes.NewReader(b)\n err := binary.Read(buf, binary.LittleEndian, passedVariable)\n return err\n}", "title": "" }, { "docid": "316de1dcf566c7aa0b8b0e05e57d0ae2", "score": "0.7014071", "text": "func GetUint64(key string) uint64 { return d.GetUint64(key) }", "title": "" }, { "docid": "3a8b5beb6ce1c8b6999a990cb29c42b8", "score": "0.6993194", "text": "func (p *rpcStream) ReadUint64() (uint64, bool) {\n\tv := p.readFrame[p.readIndex]\n\tif v > 53 && v < 64 {\n\t\tif p.hasOneByteToRead() {\n\t\t\tp.gotoNextReadByteUnsafe()\n\t\t\treturn uint64(v) - 54, true\n\t\t}\n\t} else if v == 9 {\n\t\tif p.isSafetyRead3BytesInCurrentFrame() {\n\t\t\tb := p.readFrame[p.readIndex:]\n\t\t\tp.readIndex += 3\n\t\t\treturn uint64(b[1]) |\n\t\t\t\t(uint64(b[2]) << 8), true\n\t\t}\n\t\tif p.hasNBytesToRead(3) {\n\t\t\tb := p.read3BytesCrossFrameUnsafe()\n\t\t\treturn uint64(b[1]) |\n\t\t\t\t(uint64(b[2]) << 8), true\n\t\t}\n\t} else if v == 10 {\n\t\tif p.isSafetyRead5BytesInCurrentFrame() {\n\t\t\tb := p.readFrame[p.readIndex:]\n\t\t\tp.readIndex += 5\n\t\t\treturn uint64(b[1]) |\n\t\t\t\t(uint64(b[2]) << 8) |\n\t\t\t\t(uint64(b[3]) << 16) |\n\t\t\t\t(uint64(b[4]) << 24), true\n\t\t}\n\t\tif p.hasNBytesToRead(5) {\n\t\t\tb := p.read5BytesCrossFrameUnsafe()\n\t\t\treturn uint64(b[1]) |\n\t\t\t\t(uint64(b[2]) << 8) |\n\t\t\t\t(uint64(b[3]) << 16) |\n\t\t\t\t(uint64(b[4]) << 24), true\n\t\t}\n\t} else if v == 11 {\n\t\tif p.isSafetyRead9BytesInCurrentFrame() {\n\t\t\tb := p.readFrame[p.readIndex:]\n\t\t\tp.readIndex += 9\n\t\t\treturn uint64(b[1]) |\n\t\t\t\t(uint64(b[2]) << 8) |\n\t\t\t\t(uint64(b[3]) << 16) |\n\t\t\t\t(uint64(b[4]) << 24) |\n\t\t\t\t(uint64(b[5]) << 32) |\n\t\t\t\t(uint64(b[6]) << 40) |\n\t\t\t\t(uint64(b[7]) << 48) |\n\t\t\t\t(uint64(b[8]) << 56), true\n\t\t}\n\t\tif p.hasNBytesToRead(9) {\n\t\t\tb := p.read9BytesCrossFrameUnsafe()\n\t\t\treturn uint64(b[1]) |\n\t\t\t\t(uint64(b[2]) << 8) |\n\t\t\t\t(uint64(b[3]) << 16) |\n\t\t\t\t(uint64(b[4]) << 24) |\n\t\t\t\t(uint64(b[5]) << 32) |\n\t\t\t\t(uint64(b[6]) << 40) |\n\t\t\t\t(uint64(b[7]) << 48) |\n\t\t\t\t(uint64(b[8]) << 56), true\n\t\t}\n\t}\n\treturn 0, false\n}", "title": "" }, { "docid": "51896eeac8cd0d8eb64e30ba28cc77cf", "score": "0.69884604", "text": "func readFixedLenUint64(data []byte) (uint64, bool) {\n\tswitch len(data) {\n\tcase 1: // 1 byte\n\t\treturn uint64(uint8(data[0])), true\n\tcase 3: // 2 bytes\n\t\treturn uint64(binary.LittleEndian.Uint16(data[1:])), true\n\tcase 4: // 3 bytes\n\t\treturn uint64(data[1]) |\n\t\t\tuint64(data[2])<<8 |\n\t\t\tuint64(data[3])<<16, true\n\tcase 9: // 8 bytes\n\t\treturn binary.LittleEndian.Uint64(data[1:]), true\n\tdefault:\n\t\treturn uint64(0), false\n\t}\n}", "title": "" }, { "docid": "1431e4493e7be8cefa99b5a247fb2f73", "score": "0.6971306", "text": "func (decoder *Decoder) Uint64(packed bool) uint64 {\n\tif packed {\n\t\tx, _ := decoder.Uvarint()\n\t\treturn x\n\t}\n\n\tb := decoder.reserve(8)\n\tx := decoder.endian.Uint64(b)\n\treturn x\n}", "title": "" }, { "docid": "9d271c3986c7572b7f283497c3abe0e0", "score": "0.69674516", "text": "func FzReadUint64(ctx *FzContext, stm *FzStream) uint64 {\n\tcctx, _ := (*C.fz_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown\n\tcstm, _ := (*C.fz_stream)(unsafe.Pointer(stm)), cgoAllocsUnknown\n\t__ret := C.fz_read_uint64(cctx, cstm)\n\t__v := (uint64)(__ret)\n\treturn __v\n}", "title": "" }, { "docid": "7687ee30ab8110c6a150d1aadca8e1df", "score": "0.6957241", "text": "func (body *HTTPBody) Uint64() uint64 {\n\tn, err := strconv.ParseUint(body.String(), 0, 64)\n\tminitest.NoError(err)\n\treturn n\n}", "title": "" }, { "docid": "360bc839e2fe3893c03e3b4d27c993da", "score": "0.69483465", "text": "func (m *MySource) Uint64() uint64 {\n\tbuf := make([]byte, 8)\n\tcrand.Read(buf)\n\treturn binary.BigEndian.Uint64(buf)\n}", "title": "" }, { "docid": "022c300815d9b446cea446d927653a2c", "score": "0.693558", "text": "func ReadBinaryToUInt64Big(b []byte, passedVariable *uint64) (error) {\n buf := bytes.NewReader(b)\n err := binary.Read(buf, binary.BigEndian, passedVariable)\n return err\n}", "title": "" }, { "docid": "60e4722aa0de2696144ddc44dc06d52b", "score": "0.69304484", "text": "func (f *Field) Uint64() (o uint64) {\n\tif f == nil || f.Value == nil {\n\t\treturn\n\t}\n\n\to, _ = f.Value.(uint64)\n\treturn\n}", "title": "" }, { "docid": "5f0b1ac5c17b0e00a081480ab37b71e3", "score": "0.6900917", "text": "func (p *decoderData) readU64(b []byte) uint64 {\n\tif p.endian == LittleEndian {\n\t\treturn binary.LittleEndian.Uint64(b)\n\t}\n\treturn binary.BigEndian.Uint64(b)\n}", "title": "" }, { "docid": "cf3aa7543bd6cd023bcc49990a9f4d5c", "score": "0.68838346", "text": "func (reader *BinaryReader) ReadUInt64() uint64 {\n\treturn binary.LittleEndian.Uint64(reader.Read(8))\n}", "title": "" }, { "docid": "b94b18da8009e0f623442aafd546e936", "score": "0.6861756", "text": "func TestUint64(t *testing.T) {\n\tt.Parallel()\n\tdir, err := ioutil.TempDir(\"\", \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.Remove(dir)\n\tstderr := &bytes.Buffer{}\n\tstdout := &bytes.Buffer{}\n\tenv := Env{\n\t\tStderr: stderr,\n\t\tStdout: stdout,\n\t}\n\tc := &Command{\n\t\tPackage: \"npf.io/gorram/run/_testfuncs\",\n\t\tFunction: \"DoubleUint64\",\n\t\tArgs: []string{\"5\"},\n\t\tCache: dir,\n\t\tEnv: env,\n\t}\n\terr = Run(c)\n\tcheckRunErr(err, c.script(), t)\n\tout := stdout.String()\n\texpected := \"10\\n\"\n\tif out != expected {\n\t\tt.Errorf(\"Expected %q but got %q\", expected, out)\n\t}\n\tif msg := stderr.String(); msg != \"\" {\n\t\tt.Errorf(\"Expected no stderr output but got %q\", msg)\n\t}\n}", "title": "" }, { "docid": "88c47684da6617655c7cd6828e227b3e", "score": "0.68041295", "text": "func GetUint64(key string) uint64 { return v.GetUint64(key) }", "title": "" }, { "docid": "88c47684da6617655c7cd6828e227b3e", "score": "0.68041295", "text": "func GetUint64(key string) uint64 { return v.GetUint64(key) }", "title": "" }, { "docid": "9c670f2e136066aefa8dcdab25eae20d", "score": "0.67896587", "text": "func (d *Deserializer) Uint64() uint64 {\n\td.Idx += 8\n\treturn uint64(d.Data[d.Idx-1])<<56 +\n\t\tuint64(d.Data[d.Idx-2])<<48 +\n\t\tuint64(d.Data[d.Idx-3])<<40 +\n\t\tuint64(d.Data[d.Idx-4])<<32 +\n\t\tuint64(d.Data[d.Idx-5])<<24 +\n\t\tuint64(d.Data[d.Idx-6])<<16 +\n\t\tuint64(d.Data[d.Idx-7])<<8 +\n\t\tuint64(d.Data[d.Idx-8])\n}", "title": "" }, { "docid": "9c670f2e136066aefa8dcdab25eae20d", "score": "0.67896587", "text": "func (d *Deserializer) Uint64() uint64 {\n\td.Idx += 8\n\treturn uint64(d.Data[d.Idx-1])<<56 +\n\t\tuint64(d.Data[d.Idx-2])<<48 +\n\t\tuint64(d.Data[d.Idx-3])<<40 +\n\t\tuint64(d.Data[d.Idx-4])<<32 +\n\t\tuint64(d.Data[d.Idx-5])<<24 +\n\t\tuint64(d.Data[d.Idx-6])<<16 +\n\t\tuint64(d.Data[d.Idx-7])<<8 +\n\t\tuint64(d.Data[d.Idx-8])\n}", "title": "" }, { "docid": "e593720bdc67b938f2263924227147a0", "score": "0.6781152", "text": "func (d *Decoder) Uint64() uint64 {\n\tif _, err := d.readFull(d.b[:8]); err != nil {\n\t\treturn 0\n\t}\n\treturn binary.LittleEndian.Uint64(d.b[:8])\n}", "title": "" }, { "docid": "a29676b1e7603d561ca6d8fbd2ae80d0", "score": "0.6776278", "text": "func Uint64(keys ...string) (uint64, error) {\n\treturn strconv.ParseUint(get(keys), 10, 64)\n}", "title": "" }, { "docid": "6045fdff83118be2bb589989df751613", "score": "0.6743976", "text": "func Uint64Val(x Value) (uint64, bool)", "title": "" }, { "docid": "04294920fa243d0d83d66b971dae80d4", "score": "0.6727743", "text": "func GetUint64(key string) uint64 { l.Lock(); defer l.Unlock(); return viper.GetUint64(key) }", "title": "" }, { "docid": "794125178b631465fc18a9a20afc95d6", "score": "0.6727257", "text": "func TstRandomUint64(r io.Reader) (uint64, error) {\n\treturn randomUint64(r)\n}", "title": "" }, { "docid": "221f5a5d4e968d311b92dec7d1e06266", "score": "0.67257607", "text": "func (m *FileImpl) ReadUint64At(offset int64) uint64 {\n\tm.boundaryChecks(offset, 8)\n\treturn binary.LittleEndian.Uint64(m.data[offset : offset+8])\n}", "title": "" }, { "docid": "4d8eeed2a990165556730c28e44fed49", "score": "0.67133033", "text": "func (f *Field) Uint64() uint64 {\n\tswitch f.typ {\n\tcase type32Bit:\n\t\treturn uint64(binary.LittleEndian.Uint32(f.data))\n\tcase type64Bit:\n\t\treturn uint64(binary.LittleEndian.Uint64(f.data))\n\tcase typeVarint:\n\t\tx, _ := binary.Uvarint(f.data)\n\t\treturn x\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "eee65ae1095881602d3527687efdb3e9", "score": "0.669747", "text": "func Uint64(from interface{}) (uint64, error) {\n\treturn converter.Uint64(from)\n}", "title": "" }, { "docid": "c0b840cb415f0ea8dc8e933f78634ff9", "score": "0.66957545", "text": "func Uint64(key string, fallback ...uint64) (value uint64) {\n\tif str, exists := Get(key); exists {\n\t\tif v, e := strconv.ParseUint(str, 10, 64); e == nil {\n\t\t\tvalue = v\n\t\t}\n\t} else if len(fallback) > 0 {\n\t\tvalue = fallback[0]\n\t}\n\treturn\n}", "title": "" }, { "docid": "63f4e4a55b30a78d445cb6d367720ed1", "score": "0.6692879", "text": "func Uint64(v string) (interface{}, error) {\n\tvar i uint64\n\terr := sscanf(v, \"%u\", &i)\n\treturn i, err\n}", "title": "" }, { "docid": "f9ffac1ec4e0e964a186bf944179bc96", "score": "0.6692487", "text": "func (s *sessionImpl) Uint64(key string) uint64 {\n\ts.RLock()\n\tdefer s.RUnlock()\n\n\tv, ok := s.data[key]\n\tif !ok {\n\t\treturn 0\n\t}\n\n\tvalue, ok := v.(uint64)\n\tif !ok {\n\t\treturn 0\n\t}\n\treturn value\n}", "title": "" }, { "docid": "65b952524305974f9af28407c14ba5d9", "score": "0.66870743", "text": "func (d StringDecoder) Uint64(v interface{}) (uint64, error) {\n\tb, err := toBytes(v)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn strconv.ParseUint(string(b), 10, 64)\n}", "title": "" }, { "docid": "4bec65b53934fe5ecca5ce7223b617b4", "score": "0.66813165", "text": "func Uint64(data []byte) uint64 {\n\treturn UintX(data)\n}", "title": "" }, { "docid": "aeec7cdf9d574f4687f3bbf1c9d5a3fe", "score": "0.66786695", "text": "func Uint64(reply interface{}) (uint64, error) {\n\treturn conv.ToUint64E(reply)\n}", "title": "" }, { "docid": "2457e102f9697ace9d52dde28e13d9d5", "score": "0.66665006", "text": "func randomUint64(r io.Reader) (uint64, error) {\n\tb := make([]byte, 8)\n\tn, err := r.Read(b)\n\tif n != len(b) {\n\t\treturn 0, io.ErrShortBuffer\n\t}\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn binary.BigEndian.Uint64(b), nil\n}", "title": "" }, { "docid": "d8a2ac3ad63f3ea1425bdfa14d892cd2", "score": "0.6665483", "text": "func GetUint64(key string) uint64 {\n\treturn rxxtOptions.GetUint(key)\n}", "title": "" }, { "docid": "57d607a293bd5413853e5e0f0a0f4e70", "score": "0.66423655", "text": "func (b *Binary) ReadUvarint64() uint64 {\n\tv, err := binary.ReadUvarint(b.buf)\n\tif err != nil {\n\t\tb.err = err\n\t}\n\treturn v\n}", "title": "" }, { "docid": "1939524a6919fd769d87387b18b2a171", "score": "0.6623027", "text": "func Uint64(i interface{}) uint64 {\n\tv, _ := Uint64E(i)\n\treturn v\n}", "title": "" }, { "docid": "cee4ffdb983c713dae1a1c2c7d8b6093", "score": "0.66220707", "text": "func GetUint64(key string) uint64 {\n\treturn v.GetUint64(key)\n}", "title": "" }, { "docid": "1a91b71a1a5cb9ea4d9f582577a4a3d9", "score": "0.66197264", "text": "func (ad *AttributeDecoder) Uint64() uint64 {\n\tif ad.err != nil {\n\t\treturn 0\n\t}\n\n\tb := ad.data()\n\tif len(b) != 8 {\n\t\tad.err = fmt.Errorf(\"netlink: attribute %d is not a uint64; length: %d\", ad.Type(), len(b))\n\t\treturn 0\n\t}\n\n\treturn ad.ByteOrder.Uint64(b)\n}", "title": "" }, { "docid": "93e38d363743ffd37b2fb5749ebc1428", "score": "0.6613056", "text": "func Uint64Decode(r io.Reader) (uint64, int64, error) {\n\tbuf := make([]byte, 8)\n\tn, err := r.Read(buf)\n\tif n < 8 || err != nil {\n\t\treturn 0, int64(n), err\n\t}\n\tx := uint64(buf[0]) | uint64(buf[1])<<8 | uint64(buf[2])<<16 | uint64(buf[3])<<24 | uint64(buf[4])<<32 | uint64(buf[5])<<40 | uint64(buf[6])<<48 | uint64(buf[7])<<56\n\treturn x, int64(n), nil\n}", "title": "" }, { "docid": "703cae6d9dc93f39a08bcc930cfa7511", "score": "0.6591758", "text": "func (c *Client) GetUInt64(key string) (uint64, error) {\n\tvalue, err := c.Get(key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tserializedValue := strings.Trim(string(value), \"\\r\\n \")\n\tparsedValue, err := strconv.ParseUint(serializedValue, 10, 64)\n\tif err != nil {\n\t\treturn 0, ErrNotAnInteger\n\t}\n\n\treturn parsedValue, nil\n}", "title": "" }, { "docid": "2e702b9cf9a885b0adf285604a4f750b", "score": "0.65905744", "text": "func (s *StableStore) GetUint64(key []byte) (uint64, error) {\n\tvalue, err := s.Get(key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn strconv.ParseUint(string(value), 10, 64)\n}", "title": "" }, { "docid": "aaf05d81f6cc86b19d315edb667ff50e", "score": "0.6587526", "text": "func (s *Xor64Source) Uint64() uint64 {\n\treturn s.next()\n}", "title": "" }, { "docid": "0e68b376ff5262397dd79902561ff7f4", "score": "0.6579905", "text": "func (rs *RaftStorage) GetUint64(key []byte) (uint64, error) {\n\tvalByte, err := rs.rdb.GetValue(STABLE_STORE_BUCKET, key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t//Empty value\n\tif valByte == nil {\n\t\treturn 0, nil\n\t}\n\treturn Btoi(valByte), nil\n}", "title": "" }, { "docid": "67fc7406d71957a70ffe28ebda8dbcc5", "score": "0.6579505", "text": "func GetUint64(buf []byte) uint64 {\n\treturn uint64(GetUint32(buf))<<32 | uint64(GetUint32(buf[4:]))\n}", "title": "" }, { "docid": "bef8906e6204526b8749c0000c622a41", "score": "0.65773875", "text": "func (v *V) GetUint64(firstParam interface{}, otherParams ...interface{}) (uint64, error) {\n\tret, err := v.Get(firstParam, otherParams...)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif ret.valueType != jsonparser.Number {\n\t\treturn 0, ErrTypeNotMatch\n\t}\n\treturn ret.Uint64(), nil\n}", "title": "" }, { "docid": "a1b4ff4e62ce15a6b5e204e7567123d9", "score": "0.65772706", "text": "func Uint64(v interface{}) (uint64, error) {\n\tswitch v.(type) {\n\tcase json.Number:\n\t\treturn strconv.ParseUint(v.(json.Number).String(), 10, 64)\n\tcase float32, float64:\n\t\treturn uint64(reflect.ValueOf(v).Float()), nil\n\tcase int, int8, int16, int32, int64:\n\t\treturn uint64(reflect.ValueOf(v).Int()), nil\n\tcase uint, uint8, uint16, uint32, uint64:\n\t\treturn reflect.ValueOf(v).Uint(), nil\n\t}\n\treturn 0, errors.New(\"invalid value type\")\n}", "title": "" }, { "docid": "f9c4deecba8dba182c2d85db88e01b43", "score": "0.655909", "text": "func (s secureSource) Uint64() uint64 {\n\tbuf := make([]byte, unsafe.Sizeof(int64(0))) // #nosec\n\t_, _ = rand.Read(buf)\n\treturn binary.BigEndian.Uint64(buf)\n}", "title": "" }, { "docid": "6b5010d65ab8fd9752e2e3aef16cd668", "score": "0.6553664", "text": "func (rpv *RequestParamValue) Uint64() (uint64, error) {\n\tif rpv.ui64 == nil {\n\t\tui64, err := strconv.ParseUint(rpv.String(), 10, 64)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\n\t\trpv.ui64 = &ui64\n\t}\n\n\treturn *rpv.ui64, nil\n}", "title": "" }, { "docid": "6b0e083de5c48d97cbc8cd1f68d3cee0", "score": "0.65459025", "text": "func (c *Configuration) GetUint64(key string) (uint64, error) {\n\traw, err := c.provider.Get(key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tui64, err := strconv.ParseUint(raw, 10, 64)\n\tif err != nil {\n\t\treturn 0, InvalidTypeError{\"uint64\", raw, err}\n\t}\n\treturn ui64, nil\n}", "title": "" }, { "docid": "bc012676df6acfe7837cede252378a26", "score": "0.6540007", "text": "func (kv *KeyValues) Uint64(def uint64) uint64 {\n\tif kv == nil || kv.complexValue != nil {\n\t\treturn def\n\t}\n\tif i, err := strconv.ParseUint(kv.simpleValue, 0, 64); err == nil {\n\t\treturn i\n\t}\n\treturn def\n}", "title": "" }, { "docid": "e93f9db3b62488fbe7abf3c0e92625b4", "score": "0.65396756", "text": "func (b *Storage) GetUint64(key []byte) (uint64, error) {\n\tval, err := b.Get(key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn bytesToUint64(val), nil\n}", "title": "" }, { "docid": "f7ef3c30e3500aa3f055955b86cdac6b", "score": "0.6517159", "text": "func (s *store) GetUint64(key []byte) (uint64, error) {\n\tval, err := s.Get(key)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn bytesToUint64(val), nil\n}", "title": "" }, { "docid": "6613ec607a372dfa81ad18b3065f5217", "score": "0.6507665", "text": "func (p Doc) Uint64(key string) uint64 {\n\treturn p.Uint64Or(key, 0)\n}", "title": "" }, { "docid": "554f3586ec311d612d4ba17c079f15b4", "score": "0.6506088", "text": "func (c *CargoboatClient) GetUint64(key string) uint64 {\n\tvalue := c.getConfig(key)\n\tc.log.Debugf(\"GetUint64 %s Value:%v\", key, value)\n\treturn convert.ToUint64(value)\n}", "title": "" }, { "docid": "c9fa400606461704e6b5cf8c57fa7c2b", "score": "0.64961344", "text": "func Uint64(name string, val uint64) Field {\n\treturn Field(zap.Uint64(name, val))\n}", "title": "" }, { "docid": "c9fa400606461704e6b5cf8c57fa7c2b", "score": "0.64961344", "text": "func Uint64(name string, val uint64) Field {\n\treturn Field(zap.Uint64(name, val))\n}", "title": "" }, { "docid": "fd412e96f7eb4a8ad653e5cb3e23371a", "score": "0.6493546", "text": "func LoadUint64(addr *uint64) (val uint64) {\n\tmyMutex.Lock()\n\tdefer myMutex.Unlock()\n\n\treturn *addr\n}", "title": "" }, { "docid": "7889f2e80e35ea033a1cfa2dafddaaeb", "score": "0.64866453", "text": "func (ini *IniConfig) UInt64(key string) (uint64, error) {\n\tstrVal := ini.getStringValue(key)\n\treturn strconv.ParseUint(strVal, 10, 64)\n}", "title": "" }, { "docid": "b252d7af0303e4eebcf45589bd368bbd", "score": "0.6485056", "text": "func (sv *SafeViper) GetUint64(key string) uint64 {\n\tsv.mu.RLock()\n\tdefer sv.mu.RUnlock()\n\treturn sv.viper.GetUint64(key)\n}", "title": "" }, { "docid": "8d163fd52b3ba54d2496f020b28581ca", "score": "0.6484501", "text": "func GetUint64(key string, def ...uint64) uint64 {\n\treturn _config.GetUint64(key, def...)\n}", "title": "" }, { "docid": "e8f39176f7af888ad244aaa3d18c2664", "score": "0.6474196", "text": "func (t *TypeTransform) Uint64(values ... uint64) (uint64, error) {\n\n\tvar def uint64\n\n\tif len(values) > 1 {\n\t\tlog.Panicf(\"MustUint64() received too many arguments %d\", len(values))\n\t}\n\tif len(values) == 1 {\n\t\tdef = values[0]\n\n\t}\n\n\tswitch t.data.(type) {\n\tcase json.Number:\n\t\treturn strconv.ParseUint(t.data.(json.Number).String(), 10, 64)\n\tcase float32, float64:\n\t\treturn uint64(reflect.ValueOf(t.data).Float()), nil\n\tcase int, int8, int16, int32, int64:\n\t\treturn uint64(reflect.ValueOf(t.data).Int()), nil\n\tcase uint, uint8, uint16, uint32, uint64:\n\t\treturn reflect.ValueOf(t.data).Uint(), nil\n\t}\n\treturn def, errors.New(\"invalid value type\")\n}", "title": "" }, { "docid": "1d2a4be47efbab69bec2423d039116d6", "score": "0.64681405", "text": "func Uint64(output *uint64, key string) error {\n\tval, ok, err := GetUint64(key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ok {\n\t\t*output = val\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25392e7af390b992bc98295a1e8ea15d", "score": "0.6464388", "text": "func (f *Forms) Uint64(key string) (uint64, error) {\n\treturn strconv.ParseUint((*http.Request)(f).FormValue(key), 10, 64)\n}", "title": "" }, { "docid": "216ac88627063f99ab2fda0e0f769302", "score": "0.6464069", "text": "func (f *Flags) Uint64(short, long string, defaultValue uint64, help string) {\n\tf.register(short, long, help, \"uint\", true, defaultValue,\n\t\tfunc(res FlagMap) {\n\t\t\tres[long] = &FlagMapItem{\n\t\t\t\tValue: defaultValue,\n\t\t\t\tIsDefault: true,\n\t\t\t}\n\t\t},\n\t\tfunc(flag, equalVal string, args []string, res FlagMap) ([]string, bool, error) {\n\t\t\tif !f.match(flag, short, long) {\n\t\t\t\treturn args, false, nil\n\t\t\t}\n\t\t\tvar vStr string\n\t\t\tif len(equalVal) > 0 {\n\t\t\t\tvStr = equalVal\n\t\t\t} else if len(args) > 0 {\n\t\t\t\tvStr = args[0]\n\t\t\t\targs = args[1:]\n\t\t\t} else {\n\t\t\t\treturn args, false, fmt.Errorf(\"missing uint value for flag: %s\", flag)\n\t\t\t}\n\t\t\ti, err := strconv.ParseUint(vStr, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn args, false, fmt.Errorf(\"invalid uint value for flag: %s\", flag)\n\t\t\t}\n\t\t\tres[long] = &FlagMapItem{\n\t\t\t\tValue: i,\n\t\t\t\tIsDefault: false,\n\t\t\t}\n\t\t\treturn args, true, nil\n\t\t})\n}", "title": "" }, { "docid": "a06f77f311fd1c6de340b43f5be2f757", "score": "0.6456187", "text": "func Uint64(value uint64) Type {\n\treturn Type{\n\t\tloaded: true,\n\t\tmantissa: value,\n\t\tdiv10: 0,\n\t}\n}", "title": "" }, { "docid": "6df89d111132e376e8b9a4621c460752", "score": "0.6453171", "text": "func (i Item) Uint64() (uint64, error) {\n\tif i.Err != nil {\n\t\treturn 0, i.Err\n\t}\n\n\treturn i.dec.Uint64(i.Value)\n}", "title": "" }, { "docid": "3c1a3f038b37e5fb11debb10b04b9ee2", "score": "0.64483017", "text": "func GetUint64(key string) uint64 { return defaultMapType.GetUint64(key) }", "title": "" }, { "docid": "854a7a75e37138862e3dff0e20f7c1bd", "score": "0.6432122", "text": "func (p *TCompactProtocol) readVarint64() (int64, error) {\n\tshift := uint(0)\n\tresult := int64(0)\n\tfor {\n\t\tb, err := p.readByteDirect()\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\tresult |= int64(b&0x7f) << shift\n\t\tif (b & 0x80) != 0x80 {\n\t\t\tbreak\n\t\t}\n\t\tshift += 7\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "118136693c98733de6a37e74e14ab9b8", "score": "0.6426691", "text": "func Uint64(i uint64) bool {\n\treturn i%2 == oddCheckNum\n}", "title": "" }, { "docid": "b20c9af8be724c954f83f64dcee38d18", "score": "0.64217573", "text": "func (i Uint) Uint64() uint64 {\n\tif !i.i.IsUint64() {\n\t\tpanic(\"Uint64() out of bound\")\n\t}\n\treturn i.i.Uint64()\n}", "title": "" }, { "docid": "a9def51f754ccad337a3923486d9085a", "score": "0.6419072", "text": "func (o *T) Uint64() uint64 {\n\trec := get(o.db, keyUint64)\n\tif rec == nil {\n\t\treturn 0\n\t}\n\treturn binary.BigEndian.Uint64(rec)\n}", "title": "" }, { "docid": "38dee6e2c355b57b2cd5bdd83491cb42", "score": "0.64044285", "text": "func (store *MemoryStore) GetUint64(key []byte) uint64 {\n\tkeyStr := string(key)\n\tstore.stateMu.RLock()\n\tdefer store.stateMu.RUnlock()\n\n\tif v, ok := store.state[keyStr]; ok {\n\t\treturn bytesToUint64(v)\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "f2146708c833e54f81dc15e6dc7fbb30", "score": "0.63978946", "text": "func RandomUint64() (uint64, error) {\n\treturn randomUint64(rand.Reader)\n}", "title": "" }, { "docid": "5422abfd7bb98c0447714f98101104ed", "score": "0.6391444", "text": "func (base *Base) GetUInt64(name string) uint64 {\n\tif base.Err != nil {\n\t\treturn 0\n\t}\n\n\tasStr := base.GetString(name)\n\n\tif asStr == \"\" {\n\t\treturn 0\n\t}\n\n\tasUI64, err := strconv.ParseUint(asStr, 10, 64)\n\n\tif err != nil {\n\t\tbase.SetInvalidField(name, err)\n\t\treturn 0\n\t}\n\n\treturn asUI64\n}", "title": "" }, { "docid": "1194d5d70e7fd878dcbe87ec316fbcb8", "score": "0.63858473", "text": "func (c *Config) GetUint64(path string) (uint64, error) {\n\tout, err := jsonpath.Get(path, c.store)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn cast.ToUint64E(out)\n}", "title": "" }, { "docid": "6e46df4b4c797472cb52183f13ef1937", "score": "0.63789654", "text": "func Uint64(key string, val uint64) Field {\n\treturn Field{Key: key, Val: Uint64Value(val)}\n}", "title": "" }, { "docid": "0cee8ff905c22e2c01cf0a05f11af26a", "score": "0.6372591", "text": "func Uint64(path string, value uint64) *uint64 {\n\treturn TomlVars.Uint64(path, value)\n}", "title": "" }, { "docid": "1d334349eba069393c536f55a0bee405", "score": "0.6353593", "text": "func Uint64(v interface{}) uint64 {\n\tv = Indirect(v)\n\n\tswitch T := v.(type) {\n\tcase Uint64Converter:\n\t\tif T != nil {\n\t\t\treturn T.Uint64(T)\n\t\t}\n\tcase bool:\n\t\tif T != false {\n\t\t\treturn 1\n\t\t}\n\tcase string:\n\t\tif parsed, err := strconv.ParseUint(T, 10, 0); err == nil {\n\t\t\treturn uint64(parsed)\n\t\t}\n\t\tif parsed, err := strconv.ParseFloat(T, 64); err == nil {\n\t\t\tif 1 > parsed {\n\t\t\t\treturn uint64(0)\n\t\t\t}\n\t\t\treturn uint64(parsed)\n\t\t}\n\t\tif parsed, err := strconv.ParseBool(T); err == nil {\n\t\t\tif parsed {\n\t\t\t\treturn uint64(1)\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\tcase time.Duration:\n\t\treturn uint64(T)\n\tcase time.Time:\n\t\treturn uint64(T.Unix())\n\tcase complex64:\n\t\treturn uint64(real(T))\n\tcase complex128:\n\t\treturn uint64(real(T))\n\tcase uint:\n\t\treturn uint64(T)\n\tcase uint8:\n\t\treturn uint64(T)\n\tcase uint16:\n\t\treturn uint64(T)\n\tcase uint32:\n\t\treturn uint64(T)\n\tcase uint64:\n\t\treturn T\n\tcase float32:\n\t\treturn uint64(T)\n\tcase float64:\n\t\treturn uint64(T)\n\tcase int:\n\t\treturn uint64(T)\n\tcase int8:\n\t\treturn uint64(T)\n\tcase int16:\n\t\treturn uint64(T)\n\tcase int32:\n\t\treturn uint64(T)\n\tcase int64:\n\t\treturn uint64(T)\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "bc2cc403d8fe2f22b5730ea1f893b557", "score": "0.635022", "text": "func (b *BoltStore) GetUint64(key []byte) (uint64, error) {\n\tval, err := b.Get(key)\n\tif err != nil || val == nil {\n\t\treturn 0, err\n\t}\n\n\treturn encoding.BytesToUint64(val), nil\n}", "title": "" }, { "docid": "2122a5ca98d8309adb5ca440b5e0669a", "score": "0.6341664", "text": "func FzReadUint64Le(ctx *FzContext, stm *FzStream) uint64 {\n\tcctx, _ := (*C.fz_context)(unsafe.Pointer(ctx)), cgoAllocsUnknown\n\tcstm, _ := (*C.fz_stream)(unsafe.Pointer(stm)), cgoAllocsUnknown\n\t__ret := C.fz_read_uint64_le(cctx, cstm)\n\t__v := (uint64)(__ret)\n\treturn __v\n}", "title": "" }, { "docid": "3638097112f65da0ccb1737131c6f06f", "score": "0.6338017", "text": "func UnmarshalUint64(v interface{}) (uint64, error) {\n\tswitch t := v.(type) {\n\tcase string:\n\t\tt = strings.Trim(t, `\"'`)\n\t\tif t == \"\" {\n\t\t\treturn 0, nil\n\t\t}\n\t\treturn strconv.ParseUint(t, 10, 64)\n\tcase int:\n\t\treturn uint64(t), nil\n\tcase int64:\n\t\treturn uint64(t), nil\n\tcase json.Number:\n\t\ti, err := t.Int64()\n\t\treturn uint64(i), err\n\tcase float64:\n\t\treturn uint64(t), nil\n\t}\n\n\treturn 0, fmt.Errorf(\"unable to unmarshal uint64: %#v %T\", v, v)\n}", "title": "" }, { "docid": "1f42cf890dc171cff226ae1db73dd045", "score": "0.63278663", "text": "func (h *Hash) Uint64() uint64 {\n\thash := fnv.New64a()\n\thash.Write(h.b)\n\treturn hash.Sum64()\n}", "title": "" }, { "docid": "b80874ddba2e4eb85e4dfe42291f8fa9", "score": "0.6320984", "text": "func GetUint64(key string) (output uint64, ok bool, err error) {\n\tenv, ok := os.LookupEnv(key)\n\tif !ok {\n\t\treturn 0, ok, nil\n\t}\n\tdefer os.Unsetenv(key)\n\n\tval, err := strconv.ParseUint(env, 0, 64)\n\treturn val, ok, err\n}", "title": "" }, { "docid": "2141bf76c426a68af688f7d2cb4686f5", "score": "0.63172066", "text": "func (x *Float) Uint64() (uint64, Accuracy)", "title": "" }, { "docid": "5d0679283c00d6a53fc5e2a68e206fe4", "score": "0.631584", "text": "func UnmarshalUint64(buf []byte) (int, uint64, error) {\n\tif len(buf) < 8 {\n\t\treturn 0, 0, noBufErr(\"UnmarshalUint64\", len(buf), 8)\n\t}\n\treturn 8, binary.BigEndian.Uint64(buf), nil\n}", "title": "" }, { "docid": "2ee1d1dcada33edab06ed4e2d6bb48cf", "score": "0.63067037", "text": "func Uint64(value uint64, usage string, names ...string) *uint64 {\n\tvar v uint64\n\tfor _, name := range names {\n\t\tflag.Uint64Var(&v, name, value, usage)\n\t}\n\treturn &v\n}", "title": "" }, { "docid": "6db29b2e13d12b8ad4c588405f421eac", "score": "0.63038373", "text": "func (ef StdErrflow) CheckUint64(value uint64, err error) uint64 {\n\tef.errflow.ImplementCheck(recover(), err)\n\treturn value\n}", "title": "" }, { "docid": "34d173f791286b12ecfb14d62e336e42", "score": "0.6290494", "text": "func (cl *Formatter) UInt64(buf nlog.Buffer, lvl nlog.Level, key string, val uint64) {\n\tif cl.cfg.Level < lvl {\n\t\treturn\n\t}\n\tcl.AppendFieldKey(buf, key)\n\tif cl.cfg.Colored && ValColor != NoColor {\n\t\tbuf.AppendString(ValColor, false)\n\t}\n\tbuf.AppendUInt64(val)\n\tif cl.cfg.Colored && ValColor != NoColor {\n\t\tbuf.AppendString(ColorReset, false)\n\t}\n}", "title": "" }, { "docid": "8391c63e67f7612d77055666947078bf", "score": "0.6289953", "text": "func (v Value) Uint64() uint64 {\n\tif g, w := v.Kind(), KindUint64; g != w {\n\t\tpanic(fmt.Sprintf(\"Value kind is %s, not %s\", g, w))\n\t}\n\treturn v.num\n}", "title": "" }, { "docid": "f717f904c8fa0c87b9cc807fc1685b73", "score": "0.62781805", "text": "func consumeUint64(b []byte) (uint64, int) {\n\tif len(b) < 8 {\n\t\treturn 0, -1\n\t}\n\treturn binary.BigEndian.Uint64(b), 8\n}", "title": "" } ]
a9b98c46ff45bb0a277135d67e925431
WatchOnCreateEscrow is a free log subscription operation binding the contract event 0x2deff110fb90284ba1ebd12f5a2a449109b5327e5144dcf39bae0fa2fcfa7afb. Solidity: e OnCreateEscrow(dapp indexed address, client indexed address, provider indexed address, amount uint256, daiAmount uint256)
[ { "docid": "84eaff36098b0af450372f626146c6cc", "score": "0.7726071", "text": "func (_Escrow *EscrowFilterer) WatchOnCreateEscrow(opts *bind.WatchOpts, sink chan<- *EscrowOnCreateEscrow, dapp []common.Address, client []common.Address, provider []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar clientRule []interface{}\n\tfor _, clientItem := range client {\n\t\tclientRule = append(clientRule, clientItem)\n\t}\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.WatchLogs(opts, \"OnCreateEscrow\", dappRule, clientRule, providerRule)\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(EscrowOnCreateEscrow)\n\t\t\t\tif err := _Escrow.contract.UnpackLog(event, \"OnCreateEscrow\", 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": "5e0924c37622bd0187772e16c9cbe032", "score": "0.7712384", "text": "func (_CanWork *CanWorkFilterer) WatchOnCreateEscrow(opts *bind.WatchOpts, sink chan<- *CanWorkOnCreateEscrow, dapp []common.Address, client []common.Address, provider []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar clientRule []interface{}\n\tfor _, clientItem := range client {\n\t\tclientRule = append(clientRule, clientItem)\n\t}\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.WatchLogs(opts, \"OnCreateEscrow\", dappRule, clientRule, providerRule)\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(CanWorkOnCreateEscrow)\n\t\t\t\tif err := _CanWork.contract.UnpackLog(event, \"OnCreateEscrow\", 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": "bb78f23b463a1033ee5fd48703bb20e2", "score": "0.7378201", "text": "func (_CanWorkJob *CanWorkJobFilterer) WatchOnCreateEscrow(opts *bind.WatchOpts, sink chan<- *CanWorkJobOnCreateEscrow, dapp []common.Address, client []common.Address, provider []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar clientRule []interface{}\n\tfor _, clientItem := range client {\n\t\tclientRule = append(clientRule, clientItem)\n\t}\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.WatchLogs(opts, \"OnCreateEscrow\", dappRule, clientRule, providerRule)\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(CanWorkJobOnCreateEscrow)\n\t\t\t\tif err := _CanWorkJob.contract.UnpackLog(event, \"OnCreateEscrow\", 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": "bffabc2a2a5f85fc71606ed2dfe0a820", "score": "0.6572393", "text": "func (_CanWork *CanWorkFilterer) FilterOnCreateEscrow(opts *bind.FilterOpts, dapp []common.Address, client []common.Address, provider []common.Address) (*CanWorkOnCreateEscrowIterator, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar clientRule []interface{}\n\tfor _, clientItem := range client {\n\t\tclientRule = append(clientRule, clientItem)\n\t}\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.FilterLogs(opts, \"OnCreateEscrow\", dappRule, clientRule, providerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CanWorkOnCreateEscrowIterator{contract: _CanWork.contract, event: \"OnCreateEscrow\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "242661cfcc340de22801194986babc86", "score": "0.6549504", "text": "func (_Escrow *EscrowFilterer) FilterOnCreateEscrow(opts *bind.FilterOpts, dapp []common.Address, client []common.Address, provider []common.Address) (*EscrowOnCreateEscrowIterator, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar clientRule []interface{}\n\tfor _, clientItem := range client {\n\t\tclientRule = append(clientRule, clientItem)\n\t}\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.FilterLogs(opts, \"OnCreateEscrow\", dappRule, clientRule, providerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &EscrowOnCreateEscrowIterator{contract: _Escrow.contract, event: \"OnCreateEscrow\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "31ae3adf0d499f50cc106b65fa5c33c3", "score": "0.6326095", "text": "func (_CanWorkJob *CanWorkJobFilterer) FilterOnCreateEscrow(opts *bind.FilterOpts, dapp []common.Address, client []common.Address, provider []common.Address) (*CanWorkJobOnCreateEscrowIterator, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar clientRule []interface{}\n\tfor _, clientItem := range client {\n\t\tclientRule = append(clientRule, clientItem)\n\t}\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.FilterLogs(opts, \"OnCreateEscrow\", dappRule, clientRule, providerRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CanWorkJobOnCreateEscrowIterator{contract: _CanWorkJob.contract, event: \"OnCreateEscrow\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "bfbc01894ddecbb8852d74e8c050071e", "score": "0.60061705", "text": "func (_Escrow *EscrowFilterer) WatchCreated(opts *bind.WatchOpts, sink chan<- *EscrowCreated) (event.Subscription, error) {\n\n\tlogs, sub, err := _Escrow.contract.WatchLogs(opts, \"Created\")\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(EscrowCreated)\n\t\t\t\tif err := _Escrow.contract.UnpackLog(event, \"Created\", 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": "6b6d848953c0926537864b21231b38d8", "score": "0.58676577", "text": "func (_Escrow *EscrowFilterer) WatchOnCancelEscrow(opts *bind.WatchOpts, sink chan<- *EscrowOnCancelEscrow, dapp []common.Address, escrowId []*big.Int, arbiter []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tvar arbiterRule []interface{}\n\tfor _, arbiterItem := range arbiter {\n\t\tarbiterRule = append(arbiterRule, arbiterItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.WatchLogs(opts, \"OnCancelEscrow\", dappRule, escrowIdRule, arbiterRule)\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(EscrowOnCancelEscrow)\n\t\t\t\tif err := _Escrow.contract.UnpackLog(event, \"OnCancelEscrow\", 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": "3c58f00600783a36b1ba966c21ec1862", "score": "0.5782752", "text": "func (_CanWork *CanWorkFilterer) WatchOnCancelEscrow(opts *bind.WatchOpts, sink chan<- *CanWorkOnCancelEscrow, dapp []common.Address, escrowId []*big.Int, arbiter []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tvar arbiterRule []interface{}\n\tfor _, arbiterItem := range arbiter {\n\t\tarbiterRule = append(arbiterRule, arbiterItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.WatchLogs(opts, \"OnCancelEscrow\", dappRule, escrowIdRule, arbiterRule)\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(CanWorkOnCancelEscrow)\n\t\t\t\tif err := _CanWork.contract.UnpackLog(event, \"OnCancelEscrow\", 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": "5f1f9a0b752ec4c88db5e3a8f30f4202", "score": "0.5564773", "text": "func (_CanWorkJob *CanWorkJobFilterer) WatchOnCancelEscrow(opts *bind.WatchOpts, sink chan<- *CanWorkJobOnCancelEscrow, dapp []common.Address, escrowId []*big.Int, arbiter []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tvar arbiterRule []interface{}\n\tfor _, arbiterItem := range arbiter {\n\t\tarbiterRule = append(arbiterRule, arbiterItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.WatchLogs(opts, \"OnCancelEscrow\", dappRule, escrowIdRule, arbiterRule)\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(CanWorkJobOnCancelEscrow)\n\t\t\t\tif err := _CanWorkJob.contract.UnpackLog(event, \"OnCancelEscrow\", 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": "a6c52bcb044e287d0322609a8158482a", "score": "0.55601496", "text": "func (_RollupCreator *RollupCreatorFilterer) WatchRollupCreated(opts *bind.WatchOpts, sink chan<- *RollupCreatorRollupCreated, rollupAddress []common.Address) (event.Subscription, error) {\n\n\tvar rollupAddressRule []interface{}\n\tfor _, rollupAddressItem := range rollupAddress {\n\t\trollupAddressRule = append(rollupAddressRule, rollupAddressItem)\n\t}\n\n\tlogs, sub, err := _RollupCreator.contract.WatchLogs(opts, \"RollupCreated\", rollupAddressRule)\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(RollupCreatorRollupCreated)\n\t\t\t\tif err := _RollupCreator.contract.UnpackLog(event, \"RollupCreated\", 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": "c553b0806f5e6da987117aa4ba5dddc1", "score": "0.5456283", "text": "func (_CanWork *CanWorkFilterer) WatchOnCompleteEscrow(opts *bind.WatchOpts, sink chan<- *CanWorkOnCompleteEscrow, dapp []common.Address, escrowId []*big.Int) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.WatchLogs(opts, \"OnCompleteEscrow\", dappRule, escrowIdRule)\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(CanWorkOnCompleteEscrow)\n\t\t\t\tif err := _CanWork.contract.UnpackLog(event, \"OnCompleteEscrow\", 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": "522cc2542b5ca0efe14759f09defda7a", "score": "0.54319227", "text": "func (ctrler CtrlDefReactor) OnAlertCreate(obj *Alert) error {\n\tlog.Info(\"OnAlertCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "fb3a301459dc45d6222594402ee34b52", "score": "0.53836864", "text": "func (_Escrow *EscrowFilterer) WatchOnCompleteEscrow(opts *bind.WatchOpts, sink chan<- *EscrowOnCompleteEscrow, dapp []common.Address, escrowId []*big.Int) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.WatchLogs(opts, \"OnCompleteEscrow\", dappRule, escrowIdRule)\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(EscrowOnCompleteEscrow)\n\t\t\t\tif err := _Escrow.contract.UnpackLog(event, \"OnCompleteEscrow\", 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": "9604c122911b5a8bc11d13013e46e536", "score": "0.53828096", "text": "func (c TradeClient) OnCreate(sessionID quickfix.SessionID) {\n\tfmt.Println(\"On session create\")\n\treturn\n}", "title": "" }, { "docid": "d4bc7c6fc13b9794e16a1b768ecc7cb8", "score": "0.5345499", "text": "func (_ERC1155SwapAgent *ERC1155SwapAgentFilterer) WatchSwapPairCreated(opts *bind.WatchOpts, sink chan<- *ERC1155SwapAgentSwapPairCreated, registerTxHash [][32]byte, fromTokenAddr []common.Address, mirroredTokenAddr []common.Address) (event.Subscription, error) {\n\n\tvar registerTxHashRule []interface{}\n\tfor _, registerTxHashItem := range registerTxHash {\n\t\tregisterTxHashRule = append(registerTxHashRule, registerTxHashItem)\n\t}\n\tvar fromTokenAddrRule []interface{}\n\tfor _, fromTokenAddrItem := range fromTokenAddr {\n\t\tfromTokenAddrRule = append(fromTokenAddrRule, fromTokenAddrItem)\n\t}\n\tvar mirroredTokenAddrRule []interface{}\n\tfor _, mirroredTokenAddrItem := range mirroredTokenAddr {\n\t\tmirroredTokenAddrRule = append(mirroredTokenAddrRule, mirroredTokenAddrItem)\n\t}\n\n\tlogs, sub, err := _ERC1155SwapAgent.contract.WatchLogs(opts, \"SwapPairCreated\", registerTxHashRule, fromTokenAddrRule, mirroredTokenAddrRule)\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(ERC1155SwapAgentSwapPairCreated)\n\t\t\t\tif err := _ERC1155SwapAgent.contract.UnpackLog(event, \"SwapPairCreated\", 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": "5f60ae9e6b2c6f6791455f598307b300", "score": "0.5338352", "text": "func (_TBTCSystem *TBTCSystemFilterer) WatchCreated(opts *bind.WatchOpts, sink chan<- *TBTCSystemCreated, _depositContractAddress []common.Address, _keepAddress []common.Address) (event.Subscription, error) {\n\n\tvar _depositContractAddressRule []interface{}\n\tfor _, _depositContractAddressItem := range _depositContractAddress {\n\t\t_depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem)\n\t}\n\tvar _keepAddressRule []interface{}\n\tfor _, _keepAddressItem := range _keepAddress {\n\t\t_keepAddressRule = append(_keepAddressRule, _keepAddressItem)\n\t}\n\n\tlogs, sub, err := _TBTCSystem.contract.WatchLogs(opts, \"Created\", _depositContractAddressRule, _keepAddressRule)\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(TBTCSystemCreated)\n\t\t\t\tif err := _TBTCSystem.contract.UnpackLog(event, \"Created\", 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": "7a6235f7bc4ff1d757df8838bf93980c", "score": "0.52974594", "text": "func (_Escrow *EscrowFilterer) WatchOnCancelEscrowByProvider(opts *bind.WatchOpts, sink chan<- *EscrowOnCancelEscrowByProvider, dapp []common.Address, escrowId []*big.Int) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.WatchLogs(opts, \"OnCancelEscrowByProvider\", dappRule, escrowIdRule)\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(EscrowOnCancelEscrowByProvider)\n\t\t\t\tif err := _Escrow.contract.UnpackLog(event, \"OnCancelEscrowByProvider\", 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": "bdc6dacc8ac2d9581da64b3fde6dfdf4", "score": "0.5262949", "text": "func (_ArbRollup *ArbRollupFilterer) WatchRollupStakeCreated(opts *bind.WatchOpts, sink chan<- *ArbRollupRollupStakeCreated) (event.Subscription, error) {\n\n\tlogs, sub, err := _ArbRollup.contract.WatchLogs(opts, \"RollupStakeCreated\")\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(ArbRollupRollupStakeCreated)\n\t\t\t\tif err := _ArbRollup.contract.UnpackLog(event, \"RollupStakeCreated\", 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": "266125f8bfe45ea8cba062db11567ef0", "score": "0.5245564", "text": "func (_CanWorkJob *CanWorkJobFilterer) WatchOnCompleteEscrow(opts *bind.WatchOpts, sink chan<- *CanWorkJobOnCompleteEscrow, dapp []common.Address, escrowId []*big.Int) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.WatchLogs(opts, \"OnCompleteEscrow\", dappRule, escrowIdRule)\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(CanWorkJobOnCompleteEscrow)\n\t\t\t\tif err := _CanWorkJob.contract.UnpackLog(event, \"OnCompleteEscrow\", 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": "e02d74f07350109c70b4944af2cf1568", "score": "0.5243253", "text": "func (_CanWork *CanWorkFilterer) WatchOnCancelEscrowByProvider(opts *bind.WatchOpts, sink chan<- *CanWorkOnCancelEscrowByProvider, dapp []common.Address, escrowId []*big.Int) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.WatchLogs(opts, \"OnCancelEscrowByProvider\", dappRule, escrowIdRule)\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(CanWorkOnCancelEscrowByProvider)\n\t\t\t\tif err := _CanWork.contract.UnpackLog(event, \"OnCancelEscrowByProvider\", 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": "63e88aff3ffb35a1c4bd822e60c1351d", "score": "0.52217144", "text": "func (_SfcV1Contract *SfcV1ContractFilterer) WatchCreatedStake(opts *bind.WatchOpts, sink chan<- *SfcV1ContractCreatedStake, stakerID []*big.Int, dagSfcAddress []common.Address) (event.Subscription, error) {\n\n\tvar stakerIDRule []interface{}\n\tfor _, stakerIDItem := range stakerID {\n\t\tstakerIDRule = append(stakerIDRule, stakerIDItem)\n\t}\n\tvar dagSfcAddressRule []interface{}\n\tfor _, dagSfcAddressItem := range dagSfcAddress {\n\t\tdagSfcAddressRule = append(dagSfcAddressRule, dagSfcAddressItem)\n\t}\n\n\tlogs, sub, err := _SfcV1Contract.contract.WatchLogs(opts, \"CreatedStake\", stakerIDRule, dagSfcAddressRule)\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(SfcV1ContractCreatedStake)\n\t\t\t\tif err := _SfcV1Contract.contract.UnpackLog(event, \"CreatedStake\", 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": "3321c8c61e1934949fcf0e5c5532912b", "score": "0.52115995", "text": "func (_Escrow *EscrowTransactor) CreateEscrow(opts *bind.TransactOpts, _name [8]byte) (*types.Transaction, error) {\n\treturn _Escrow.contract.Transact(opts, \"createEscrow\", _name)\n}", "title": "" }, { "docid": "6dea62e7bff823e1aba91a9283a4b92e", "score": "0.520309", "text": "func (_CanWork *CanWorkFilterer) WatchOnCreateJob(opts *bind.WatchOpts, sink chan<- *CanWorkOnCreateJob, dapp []common.Address, jobId [][32]byte, provider []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar jobIdRule []interface{}\n\tfor _, jobIdItem := range jobId {\n\t\tjobIdRule = append(jobIdRule, jobIdItem)\n\t}\n\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.WatchLogs(opts, \"OnCreateJob\", dappRule, jobIdRule, providerRule)\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(CanWorkOnCreateJob)\n\t\t\t\tif err := _CanWork.contract.UnpackLog(event, \"OnCreateJob\", 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": "5c735c326d1a19383e8583c02afcf221", "score": "0.5199479", "text": "func (_ArbRollup *ArbRollupFilterer) WatchRollupCreated(opts *bind.WatchOpts, sink chan<- *ArbRollupRollupCreated) (event.Subscription, error) {\n\n\tlogs, sub, err := _ArbRollup.contract.WatchLogs(opts, \"RollupCreated\")\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(ArbRollupRollupCreated)\n\t\t\t\tif err := _ArbRollup.contract.UnpackLog(event, \"RollupCreated\", 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": "768ad41a27c4562c1f40e50150dbabff", "score": "0.51898545", "text": "func (_SfcV2Contract *SfcV2ContractFilterer) WatchCreatedStake(opts *bind.WatchOpts, sink chan<- *SfcV2ContractCreatedStake, stakerID []*big.Int, dagSfcAddress []common.Address) (event.Subscription, error) {\n\n\tvar stakerIDRule []interface{}\n\tfor _, stakerIDItem := range stakerID {\n\t\tstakerIDRule = append(stakerIDRule, stakerIDItem)\n\t}\n\tvar dagSfcAddressRule []interface{}\n\tfor _, dagSfcAddressItem := range dagSfcAddress {\n\t\tdagSfcAddressRule = append(dagSfcAddressRule, dagSfcAddressItem)\n\t}\n\n\tlogs, sub, err := _SfcV2Contract.contract.WatchLogs(opts, \"CreatedStake\", stakerIDRule, dagSfcAddressRule)\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(SfcV2ContractCreatedStake)\n\t\t\t\tif err := _SfcV2Contract.contract.UnpackLog(event, \"CreatedStake\", 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": "3614be753c58a78e295147f85bb30882", "score": "0.51414895", "text": "func (_KyberStorage *KyberStorageFilterer) WatchAddReserveToStorage(opts *bind.WatchOpts, sink chan<- *KyberStorageAddReserveToStorage, reserve []common.Address, reserveId [][32]byte, rebateWallet []common.Address) (event.Subscription, error) {\n\n\tvar reserveRule []interface{}\n\tfor _, reserveItem := range reserve {\n\t\treserveRule = append(reserveRule, reserveItem)\n\t}\n\tvar reserveIdRule []interface{}\n\tfor _, reserveIdItem := range reserveId {\n\t\treserveIdRule = append(reserveIdRule, reserveIdItem)\n\t}\n\n\tvar rebateWalletRule []interface{}\n\tfor _, rebateWalletItem := range rebateWallet {\n\t\trebateWalletRule = append(rebateWalletRule, rebateWalletItem)\n\t}\n\n\tlogs, sub, err := _KyberStorage.contract.WatchLogs(opts, \"AddReserveToStorage\", reserveRule, reserveIdRule, rebateWalletRule)\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(KyberStorageAddReserveToStorage)\n\t\t\t\tif err := _KyberStorage.contract.UnpackLog(event, \"AddReserveToStorage\", 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": "5e7a08966c3ef9000ad6e04d43bd2600", "score": "0.51296085", "text": "func (_CanWorkJob *CanWorkJobFilterer) WatchOnCancelEscrowByProvider(opts *bind.WatchOpts, sink chan<- *CanWorkJobOnCancelEscrowByProvider, dapp []common.Address, escrowId []*big.Int) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.WatchLogs(opts, \"OnCancelEscrowByProvider\", dappRule, escrowIdRule)\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(CanWorkJobOnCancelEscrowByProvider)\n\t\t\t\tif err := _CanWorkJob.contract.UnpackLog(event, \"OnCancelEscrowByProvider\", 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": "ececaf17b732f7938e6df0e73e0b59f7", "score": "0.5125912", "text": "func (o *orchestrator) CreateWatch(req transport.Request) (transport.Watch, func()) {\n\tctx := context.Background()\n\n\taggregatedKey, err := o.mapper.GetKey(req)\n\t// If this is the first time we're seeing the request from the\n\t// downstream client, initialize a channel to feed future responses.\n\twatch := o.downstreamResponseMap.createWatch(req, metrics.OrchestratorWatchSubscope(o.scope, aggregatedKey))\n\tif err != nil {\n\t\t// TODO (https://github.com/envoyproxy/xds-relay/issues/56)\n\t\t// Support unnaggregated keys.\n\t\t// Can't map the request to an aggregated key. Log error and return.\n\t\to.logger.With(\n\t\t\t\"error\", err,\n\t\t\t\"request_type\", req.GetTypeURL(),\n\t\t\t\"node_id\", req.GetNodeID(),\n\t\t).Error(ctx, \"failed to map to aggregated key\")\n\t\treturn o.downstreamResponseMap.delete(req), nil\n\t}\n\n\to.logger.With(\n\t\t\"node_id\", req.GetNodeID(),\n\t\t\"request_type\", req.GetTypeURL(),\n\t\t\"request_version\", req.GetVersionInfo(),\n\t\t\"resource\", req.GetResourceNames(),\n\t\t\"nonce\", req.GetResponseNonce(),\n\t\t\"error\", req.GetError(),\n\t\t\"aggregated_key\", aggregatedKey,\n\t).Debug(ctx, \"creating watch\")\n\n\t// Register the watch for future responses.\n\terr = o.cache.AddRequest(aggregatedKey, req)\n\tif err != nil {\n\t\t// If we fail to register the watch, we need to kill this stream by\n\t\t// closing the response channel.\n\t\to.logger.With(\"error\", err).With(\"aggregated_key\", aggregatedKey).With(\n\t\t\t\"request\", req.GetRaw().V2).Error(ctx, \"failed to add watch\")\n\t\tmetrics.OrchestratorWatchErrorsSubscope(o.scope, aggregatedKey).Counter(metrics.ErrorRegisterWatch).Inc(1)\n\t\treturn o.downstreamResponseMap.delete(req), nil\n\t}\n\tmetrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorWatchCreated).Inc(1)\n\n\t// Log + stat to investigate NACK behavior\n\tif isNackRequest(req) {\n\t\tresourceString := \"\"\n\t\tif req.GetResourceNames() != nil {\n\t\t\tresourceString = strings.Join(req.GetResourceNames()[:], \",\")\n\t\t}\n\t\to.logger.With(\n\t\t\t\"request_version\", req.GetVersionInfo(),\n\t\t\t\"resource_names\", resourceString,\n\t\t\t\"nonce\", req.GetResponseNonce(),\n\t\t\t\"request_type\", req.GetTypeURL(),\n\t\t\t\"error\", req.GetError(),\n\t\t\t\"aggregated_key\", aggregatedKey,\n\t\t).Debug(ctx, \"NACK request\")\n\t\tmetrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorNackWatchCreated).Inc(1)\n\t}\n\n\t// Check if we have a cached response first.\n\tcached, err := o.cache.Fetch(aggregatedKey)\n\tif err != nil {\n\t\t// Log, and continue to propagate the response upstream.\n\t\to.logger.With(\"error\", err).With(\"aggregated_key\", aggregatedKey).Warn(ctx, \"failed to fetch aggregated key\")\n\t}\n\n\tif cached != nil && cached.Resp != nil &&\n\t\tcached.Resp.GetPayloadVersion() != req.GetVersionInfo() &&\n\t\treq.GetError() == nil {\n\t\t// If we have a cached response and the version is different,\n\t\t// immediately push the result to the response channel.\n\t\tgo func() {\n\t\t\terr := watch.Send(cached.Resp)\n\t\t\tif err != nil {\n\t\t\t\t// Sanity check that the channel isn't blocked. This shouldn't\n\t\t\t\t// ever happen since the channel is newly created. Regardless,\n\t\t\t\t// continue to create the watch.\n\t\t\t\to.logger.With(\"aggregated_key\", aggregatedKey, \"error\", err).Warn(context.Background(),\n\t\t\t\t\t\"failed to push cached response\")\n\t\t\t\tmetrics.OrchestratorWatchErrorsSubscope(o.scope, aggregatedKey).Counter(metrics.ErrorChannelFull).Inc(1)\n\t\t\t} else {\n\t\t\t\tmetrics.OrchestratorWatchSubscope(o.scope, aggregatedKey).Counter(metrics.OrchestratorWatchFanouts).Inc(1)\n\t\t\t}\n\t\t}()\n\t}\n\n\t// Check if we have a upstream stream open for this aggregated key. If not,\n\t// open a stream with the representative request.\n\tif !o.upstreamResponseMap.exists(aggregatedKey) {\n\t\tupstreamResponseChan, shutdown := o.upstreamClient.OpenStream(req, aggregatedKey)\n\t\trespChannel, upstreamOpenedPreviously := o.upstreamResponseMap.add(aggregatedKey, upstreamResponseChan)\n\t\tif upstreamOpenedPreviously {\n\t\t\t// A stream was opened previously due to a race between\n\t\t\t// concurrent downstreams for the same aggregated key, between\n\t\t\t// exists and add operations. In this event, simply close the\n\t\t\t// slower stream and return the existing one.\n\t\t\tshutdown()\n\t\t} else {\n\t\t\t// Spin up a go routine to watch for upstream responses.\n\t\t\t// One routine is opened per aggregate key.\n\t\t\to.logger.With(\"aggregated_key\", aggregatedKey).Debug(ctx, \"watching upstream\")\n\t\t\tgo o.watchUpstream(ctx, aggregatedKey, respChannel.response, respChannel.done, shutdown)\n\t\t}\n\t}\n\n\treturn watch, o.onCancelWatch(aggregatedKey, req)\n}", "title": "" }, { "docid": "558ec362d27af81d9e42b08f276c5598", "score": "0.5123874", "text": "func (_Escrow *EscrowSession) CreateEscrow(_name [8]byte) (*types.Transaction, error) {\n\treturn _Escrow.Contract.CreateEscrow(&_Escrow.TransactOpts, _name)\n}", "title": "" }, { "docid": "4cdb6d00ef0ef4ceb04a2beb4a11a4e1", "score": "0.51193804", "text": "func (_SfcV2Contract *SfcV2ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *SfcV2ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {\n\n\tvar authRule []interface{}\n\tfor _, authItem := range auth {\n\t\tauthRule = append(authRule, authItem)\n\t}\n\tvar receiverRule []interface{}\n\tfor _, receiverItem := range receiver {\n\t\treceiverRule = append(receiverRule, receiverItem)\n\t}\n\tvar stakerIDRule []interface{}\n\tfor _, stakerIDItem := range stakerID {\n\t\tstakerIDRule = append(stakerIDRule, stakerIDItem)\n\t}\n\n\tlogs, sub, err := _SfcV2Contract.contract.WatchLogs(opts, \"CreatedWithdrawRequest\", authRule, receiverRule, stakerIDRule)\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(SfcV2ContractCreatedWithdrawRequest)\n\t\t\t\tif err := _SfcV2Contract.contract.UnpackLog(event, \"CreatedWithdrawRequest\", 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": "8dbfb1aa68dbf6f4df251cb436ba6c0e", "score": "0.5104904", "text": "func (_Comtroller *ComtrollerFilterer) WatchNewTreasuryAddress(opts *bind.WatchOpts, sink chan<- *ComtrollerNewTreasuryAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comtroller.contract.WatchLogs(opts, \"NewTreasuryAddress\")\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(ComtrollerNewTreasuryAddress)\n\t\t\t\tif err := _Comtroller.contract.UnpackLog(event, \"NewTreasuryAddress\", 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": "728ff243edda8c9105b83a1ed422dab1", "score": "0.5095692", "text": "func EventFilterCreate(et watch.EventType) bool { return et == watch.Added }", "title": "" }, { "docid": "d019096d9dae4066af960dc234ec8bf7", "score": "0.5088382", "text": "func (_ITellor *ITellorFilterer) WatchNewDispute(opts *bind.WatchOpts, sink chan<- *ITellorNewDispute, _disputeId []*big.Int, _requestId []*big.Int) (event.Subscription, error) {\n\n\tvar _disputeIdRule []interface{}\n\tfor _, _disputeIdItem := range _disputeId {\n\t\t_disputeIdRule = append(_disputeIdRule, _disputeIdItem)\n\t}\n\tvar _requestIdRule []interface{}\n\tfor _, _requestIdItem := range _requestId {\n\t\t_requestIdRule = append(_requestIdRule, _requestIdItem)\n\t}\n\n\tlogs, sub, err := _ITellor.contract.WatchLogs(opts, \"NewDispute\", _disputeIdRule, _requestIdRule)\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(ITellorNewDispute)\n\t\t\t\tif err := _ITellor.contract.UnpackLog(event, \"NewDispute\", 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": "8e6e420e7715fb4f948b24a0b406940b", "score": "0.5086923", "text": "func (h *enqueueRequestsForVirtualGatewayEvents) Create(e event.CreateEvent, queue workqueue.RateLimitingInterface) {\n\t// no-op\n}", "title": "" }, { "docid": "c3e79dd8ce418d28d2c7531d93a1d3f8", "score": "0.508421", "text": "func (s signal) OnEncapCreate(ch *Encap) {}", "title": "" }, { "docid": "ebfb5142e0c246dca7c5463fa3e7b4a9", "score": "0.50690556", "text": "func (_CanWorkJob *CanWorkJobFilterer) WatchOnCreateJob(opts *bind.WatchOpts, sink chan<- *CanWorkJobOnCreateJob, dapp []common.Address, jobId [][32]byte, provider []common.Address) (event.Subscription, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar jobIdRule []interface{}\n\tfor _, jobIdItem := range jobId {\n\t\tjobIdRule = append(jobIdRule, jobIdItem)\n\t}\n\n\tvar providerRule []interface{}\n\tfor _, providerItem := range provider {\n\t\tproviderRule = append(providerRule, providerItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.WatchLogs(opts, \"OnCreateJob\", dappRule, jobIdRule, providerRule)\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(CanWorkJobOnCreateJob)\n\t\t\t\tif err := _CanWorkJob.contract.UnpackLog(event, \"OnCreateJob\", 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": "d939394f593304315151a66e2f369e34", "score": "0.50671834", "text": "func (_Escrow *EscrowTransactorSession) CreateEscrow(_name [8]byte) (*types.Transaction, error) {\n\treturn _Escrow.Contract.CreateEscrow(&_Escrow.TransactOpts, _name)\n}", "title": "" }, { "docid": "4787919fb853638a95787fe308af9bb2", "score": "0.5064461", "text": "func (_SfcV1Contract *SfcV1ContractFilterer) WatchCreatedWithdrawRequest(opts *bind.WatchOpts, sink chan<- *SfcV1ContractCreatedWithdrawRequest, auth []common.Address, receiver []common.Address, stakerID []*big.Int) (event.Subscription, error) {\n\n\tvar authRule []interface{}\n\tfor _, authItem := range auth {\n\t\tauthRule = append(authRule, authItem)\n\t}\n\tvar receiverRule []interface{}\n\tfor _, receiverItem := range receiver {\n\t\treceiverRule = append(receiverRule, receiverItem)\n\t}\n\tvar stakerIDRule []interface{}\n\tfor _, stakerIDItem := range stakerID {\n\t\tstakerIDRule = append(stakerIDRule, stakerIDItem)\n\t}\n\n\tlogs, sub, err := _SfcV1Contract.contract.WatchLogs(opts, \"CreatedWithdrawRequest\", authRule, receiverRule, stakerIDRule)\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(SfcV1ContractCreatedWithdrawRequest)\n\t\t\t\tif err := _SfcV1Contract.contract.UnpackLog(event, \"CreatedWithdrawRequest\", 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": "75f723185cfbf01482e8ee6859de0ea4", "score": "0.500273", "text": "func (_LendingPoolConfigurator *LendingPoolConfiguratorFilterer) WatchReserveActivated(opts *bind.WatchOpts, sink chan<- *LendingPoolConfiguratorReserveActivated, _reserve []common.Address) (event.Subscription, error) {\n\n\tvar _reserveRule []interface{}\n\tfor _, _reserveItem := range _reserve {\n\t\t_reserveRule = append(_reserveRule, _reserveItem)\n\t}\n\n\tlogs, sub, err := _LendingPoolConfigurator.contract.WatchLogs(opts, \"ReserveActivated\", _reserveRule)\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(LendingPoolConfiguratorReserveActivated)\n\t\t\t\tif err := _LendingPoolConfigurator.contract.UnpackLog(event, \"ReserveActivated\", 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": "4216a231131f7deebd0e807597430a97", "score": "0.50010514", "text": "func (ctrler CtrlDefReactor) OnTechSupportRequestCreate(obj *TechSupportRequest) error {\n\tlog.Info(\"OnTechSupportRequestCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "63f0fb3c75d7b65af491b7d7491b2639", "score": "0.49434203", "text": "func (s signal) OnChassisCreate(ch *Chassis) {}", "title": "" }, { "docid": "51331e9e26319226136840f148c222ac", "score": "0.4939613", "text": "func (m *mockKV) createEventConsumer(bufSz int) chan clientv3.Event {\n\tch := make(chan clientv3.Event, bufSz)\n\tm.eventsMtx.Lock()\n\tm.events[ch] = struct{}{}\n\tm.eventsMtx.Unlock()\n\treturn ch\n}", "title": "" }, { "docid": "31629fb74eef100cf1975b0aa30b19bb", "score": "0.49296373", "text": "func (_Staking *StakingFilterer) WatchRollupStakeCreated(opts *bind.WatchOpts, sink chan<- *StakingRollupStakeCreated) (event.Subscription, error) {\n\n\tlogs, sub, err := _Staking.contract.WatchLogs(opts, \"RollupStakeCreated\")\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(StakingRollupStakeCreated)\n\t\t\t\tif err := _Staking.contract.UnpackLog(event, \"RollupStakeCreated\", 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": "a55f8fa542d9867dd6c0f8e97e71b6ec", "score": "0.49252248", "text": "func (w *Watch) Create(tx *pop.Connection) error {\n\treturn create(tx, w)\n}", "title": "" }, { "docid": "c5adf2950a44ca90b0318aa7551d210e", "score": "0.4898265", "text": "func (ctrler CtrlDefReactor) OnRolloutActionCreate(obj *RolloutAction) error {\n\tlog.Info(\"OnRolloutActionCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "57bd24ab87daddbb5f31634fb45c84f0", "score": "0.48957658", "text": "func (_TellorStake *TellorStakeFilterer) WatchNewDispute(opts *bind.WatchOpts, sink chan<- *TellorStakeNewDispute, _disputeId []*big.Int, _requestId []*big.Int) (event.Subscription, error) {\n\n\tvar _disputeIdRule []interface{}\n\tfor _, _disputeIdItem := range _disputeId {\n\t\t_disputeIdRule = append(_disputeIdRule, _disputeIdItem)\n\t}\n\tvar _requestIdRule []interface{}\n\tfor _, _requestIdItem := range _requestId {\n\t\t_requestIdRule = append(_requestIdRule, _requestIdItem)\n\t}\n\n\tlogs, sub, err := _TellorStake.contract.WatchLogs(opts, \"NewDispute\", _disputeIdRule, _requestIdRule)\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(TellorStakeNewDispute)\n\t\t\t\tif err := _TellorStake.contract.UnpackLog(event, \"NewDispute\", 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": "afca5777cd4dc709faede01a867f61b7", "score": "0.48942453", "text": "func (ctrler CtrlDefReactor) OnTroubleshootingSessionCreate(obj *TroubleshootingSession) error {\n\tlog.Info(\"OnTroubleshootingSessionCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "6fa01e8349d9dbc2c012b5fe553a6e93", "score": "0.48909923", "text": "func (_Tellor *TellorFilterer) WatchNewDispute(opts *bind.WatchOpts, sink chan<- *TellorNewDispute, _disputeId []*big.Int, _requestId []*big.Int) (event.Subscription, error) {\n\n\tvar _disputeIdRule []interface{}\n\tfor _, _disputeIdItem := range _disputeId {\n\t\t_disputeIdRule = append(_disputeIdRule, _disputeIdItem)\n\t}\n\tvar _requestIdRule []interface{}\n\tfor _, _requestIdItem := range _requestId {\n\t\t_requestIdRule = append(_requestIdRule, _requestIdItem)\n\t}\n\n\tlogs, sub, err := _Tellor.contract.WatchLogs(opts, \"NewDispute\", _disputeIdRule, _requestIdRule)\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(TellorNewDispute)\n\t\t\t\tif err := _Tellor.contract.UnpackLog(event, \"NewDispute\", 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": "be7f09a1b99568eef56f9021534a45be", "score": "0.48668212", "text": "func (_ITellor *ITellorFilterer) WatchNewTellorAddress(opts *bind.WatchOpts, sink chan<- *ITellorNewTellorAddress) (event.Subscription, error) {\n\n\tlogs, sub, err := _ITellor.contract.WatchLogs(opts, \"NewTellorAddress\")\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(ITellorNewTellorAddress)\n\t\t\t\tif err := _ITellor.contract.UnpackLog(event, \"NewTellorAddress\", 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": "ce8bb8de3c83f8709ad29ed50b31f68a", "score": "0.4836144", "text": "func (_IdFedFactory *IdFedFactoryFilterer) WatchPairCreated(opts *bind.WatchOpts, sink chan<- *IdFedFactoryPairCreated, token []common.Address) (event.Subscription, error) {\n\n\tvar tokenRule []interface{}\n\tfor _, tokenItem := range token {\n\t\ttokenRule = append(tokenRule, tokenItem)\n\t}\n\n\tlogs, sub, err := _IdFedFactory.contract.WatchLogs(opts, \"PairCreated\", tokenRule)\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(IdFedFactoryPairCreated)\n\t\t\t\tif err := _IdFedFactory.contract.UnpackLog(event, \"PairCreated\", 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": "5f366b603c71c644f0e5f2e5b88fafa1", "score": "0.4817133", "text": "func (ctrler CtrlDefReactor) OnRolloutCreate(obj *Rollout) error {\n\tlog.Info(\"OnRolloutCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "af63989f68f2ad19628bd16e0651d117", "score": "0.48111135", "text": "func (o *OCRSoakTest) subscribeOCREvents(\n\tt *testing.T,\n\tanswerUpdated chan *offchainaggregator.OffchainAggregatorAnswerUpdated,\n) {\n\tl := utils.GetTestLogger(t)\n\tcontractABI, err := offchainaggregator.OffchainAggregatorMetaData.GetAbi()\n\trequire.NoError(t, err, \"Getting contract abi for OCR shouldn't fail\")\n\tlatestBlockNum, err := o.chainClient.LatestBlockNumber(context.Background())\n\trequire.NoError(t, err, \"Subscribing to contract event log for OCR instance shouldn't fail\")\n\tquery := geth.FilterQuery{\n\t\tFromBlock: big.NewInt(0).SetUint64(latestBlockNum),\n\t\tAddresses: []common.Address{},\n\t}\n\tfor i := 0; i < len(o.ocrInstances); i++ {\n\t\tquery.Addresses = append(query.Addresses, common.HexToAddress(o.ocrInstances[i].Address()))\n\t}\n\teventLogs := make(chan types.Log)\n\tsub, err := o.chainClient.SubscribeFilterLogs(context.Background(), query, eventLogs)\n\trequire.NoError(t, err, \"Subscribing to contract event log for OCR instance shouldn't fail\")\n\n\tgo func() {\n\t\tdefer sub.Unsubscribe()\n\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase err := <-sub.Err():\n\t\t\t\tl.Error().Err(err).Msg(\"Error while watching for new contract events. Retrying Subscription\")\n\t\t\t\tsub.Unsubscribe()\n\n\t\t\t\tsub, err = o.chainClient.SubscribeFilterLogs(context.Background(), query, eventLogs)\n\t\t\t\trequire.NoError(t, err, \"Subscribing to contract event log for OCR instance shouldn't fail\")\n\t\t\tcase vLog := <-eventLogs:\n\t\t\t\teventDetails, err := contractABI.EventByID(vLog.Topics[0])\n\t\t\t\trequire.NoError(t, err, \"Getting event details for OCR instances shouldn't fail\")\n\n\t\t\t\tgo o.processNewEvent(t, sub, answerUpdated, &vLog, eventDetails, o.ocrInstances[0], contractABI)\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "2606317594de9d48486f8b8ce8c63a46", "score": "0.4777815", "text": "func (ctrler CtrlDefReactor) OnFwlogPolicyCreate(obj *FwlogPolicy) error {\n\tlog.Info(\"OnFwlogPolicyCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "80f56886085a8e3e267d239ccec7cdc6", "score": "0.4760532", "text": "func (c *K8sEventClient) Create() *K8sEventCreate {\n\tmutation := newK8sEventMutation(c.config, OpCreate)\n\treturn &K8sEventCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "3f94c11247fc1b7a5c26d85b891a92b9", "score": "0.47418576", "text": "func (_Vtoken *VtokenFilterer) WatchNewReserveFactor(opts *bind.WatchOpts, sink chan<- *VtokenNewReserveFactor) (event.Subscription, error) {\n\n\tlogs, sub, err := _Vtoken.contract.WatchLogs(opts, \"NewReserveFactor\")\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(VtokenNewReserveFactor)\n\t\t\t\tif err := _Vtoken.contract.UnpackLog(event, \"NewReserveFactor\", 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": "909fdba21f5edc9f0269d9ea9279cb4f", "score": "0.4734478", "text": "func createHire(req *hirepb.CreateHireRequest) {\n\tresp, err := ServiceClient.CreateHire(context.Background(), req)\n\tif err != nil {\n\t\tlog.Println(\"Error creating hire data\", err)\n\t}\n\n\tfmt.Println(\"\\nHire added successully!!\")\n\tfmt.Printf(\"Welcome aboard %s!!\\n\", resp.GetData().GetName())\n}", "title": "" }, { "docid": "a391030610e45ca38468f5f9dd07f48d", "score": "0.47132316", "text": "func (_Comtroller *ComtrollerFilterer) WatchNewPriceOracle(opts *bind.WatchOpts, sink chan<- *ComtrollerNewPriceOracle) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comtroller.contract.WatchLogs(opts, \"NewPriceOracle\")\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(ComtrollerNewPriceOracle)\n\t\t\t\tif err := _Comtroller.contract.UnpackLog(event, \"NewPriceOracle\", 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": "873d434383b4d39c0fd93d003a51924c", "score": "0.47045633", "text": "func (ctrler CtrlDefReactor) OnAlertPolicyCreate(obj *AlertPolicy) error {\n\tlog.Info(\"OnAlertPolicyCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "6606869e8dae86232c247753ebd1011b", "score": "0.46999973", "text": "func (_Esd *EsdFilterer) WatchCouponPurchase(opts *bind.WatchOpts, sink chan<- *EsdCouponPurchase, account []common.Address, epoch []*big.Int) (event.Subscription, error) {\n\n\tvar accountRule []interface{}\n\tfor _, accountItem := range account {\n\t\taccountRule = append(accountRule, accountItem)\n\t}\n\tvar epochRule []interface{}\n\tfor _, epochItem := range epoch {\n\t\tepochRule = append(epochRule, epochItem)\n\t}\n\n\tlogs, sub, err := _Esd.contract.WatchLogs(opts, \"CouponPurchase\", accountRule, epochRule)\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(EsdCouponPurchase)\n\t\t\t\tif err := _Esd.contract.UnpackLog(event, \"CouponPurchase\", 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": "9e69d7a3f7c077d4ec6cecf4067d9f60", "score": "0.4658479", "text": "func (r *ICallEventResource) Create(item ICallEventConfig) error {\n\tif err := r.c.ModQuery(\"POST\", BasePath+ICallEventEndpoint, item); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ef704ffccca0c5fdbf40f947b3f87d57", "score": "0.46570903", "text": "func (h *EnqueueRequestsForSecretEvent) Create(e event.CreateEvent, queue workqueue.RateLimitingInterface) {\n\th.enqueueImpactedObjects(e.Object.(*corev1.Secret), queue)\n}", "title": "" }, { "docid": "6428bc035027582fc26c348634e386e2", "score": "0.4657027", "text": "func (b *Backend) CreateWatch(ctx context.Context, key string, withPrefix bool) chan *kvstore.Event {\n\tspan, ctx := log.CreateChildSpan(ctx, \"etcd-create-watch\")\n\tdefer span.Finish()\n\n\tformattedPath := b.makePath(ctx, key)\n\tlogger.Debugw(ctx, \"creating-key-watch\", log.Fields{\"key\": key, \"path\": formattedPath})\n\n\treturn b.Client.Watch(ctx, formattedPath, withPrefix)\n}", "title": "" }, { "docid": "3082e35edf4ac61f64c6c9cf72370f36", "score": "0.46478903", "text": "func (p LogEventsPredicate) Create(e event.CreateEvent) bool {\n\tif e.Object != nil {\n\t\tlogrus.Infof(\"Create event detected for %s (%s), queuing Reconcile\",\n\t\t\te.Object.GetName(), e.Object.GetNamespace())\n\t}\n\treturn true\n}", "title": "" }, { "docid": "0fe224645391bc9ed2dc061d94b6794a", "score": "0.46379432", "text": "func CreateEvent(apiCall string, origin string) ReportEventDetails {\n\tvar event ReportEventDetails\n\tevent.details = make(map[string]string)\n\tevent.details[CtEventType] = apiCall\n\tevent.details[CtEventOrigin] = origin\n\tevent.details[CtEventAuditTime] = time.Now().UTC().Format(timeFormat)\n\n\treturn event\n}", "title": "" }, { "docid": "a5860a625b22b46e7d278592b20b9482", "score": "0.46290898", "text": "func CreateEvent(recorder record.EventRecorder, objectRef *v1.ObjectReference, eventType string, reason string, err string) {\n\trecorder.Event(objectRef, eventType, reason, err)\n}", "title": "" }, { "docid": "60eb8359a037b7cc73f2d3414d27cd7c", "score": "0.4622331", "text": "func (_Escrow *EscrowFilterer) FilterCreated(opts *bind.FilterOpts) (*EscrowCreatedIterator, error) {\n\n\tlogs, sub, err := _Escrow.contract.FilterLogs(opts, \"Created\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &EscrowCreatedIterator{contract: _Escrow.contract, event: \"Created\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "0357463bcb20d3d84b496766179a99a7", "score": "0.46187928", "text": "func (_CanWork *CanWorkFilterer) FilterOnCancelEscrow(opts *bind.FilterOpts, dapp []common.Address, escrowId []*big.Int, arbiter []common.Address) (*CanWorkOnCancelEscrowIterator, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tvar arbiterRule []interface{}\n\tfor _, arbiterItem := range arbiter {\n\t\tarbiterRule = append(arbiterRule, arbiterItem)\n\t}\n\n\tlogs, sub, err := _CanWork.contract.FilterLogs(opts, \"OnCancelEscrow\", dappRule, escrowIdRule, arbiterRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CanWorkOnCancelEscrowIterator{contract: _CanWork.contract, event: \"OnCancelEscrow\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "1f5942c2519ed0a20094fd6c6c90388c", "score": "0.4618102", "text": "func (_Contract *ContractFilterer) WatchNewPriceOracle(opts *bind.WatchOpts, sink chan<- *ContractNewPriceOracle, oracle []common.Address) (event.Subscription, error) {\n\n\tvar oracleRule []interface{}\n\tfor _, oracleItem := range oracle {\n\t\toracleRule = append(oracleRule, oracleItem)\n\t}\n\n\tlogs, sub, err := _Contract.contract.WatchLogs(opts, \"NewPriceOracle\", oracleRule)\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(ContractNewPriceOracle)\n\t\t\t\tif err := _Contract.contract.UnpackLog(event, \"NewPriceOracle\", 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": "3b6a649965c272d01f9ddc52028e2bf1", "score": "0.4607818", "text": "func (_Vtoken *VtokenFilterer) WatchReservesAdded(opts *bind.WatchOpts, sink chan<- *VtokenReservesAdded) (event.Subscription, error) {\n\n\tlogs, sub, err := _Vtoken.contract.WatchLogs(opts, \"ReservesAdded\")\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(VtokenReservesAdded)\n\t\t\t\tif err := _Vtoken.contract.UnpackLog(event, \"ReservesAdded\", 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": "29e8a953e31d0815fd4c33ba4c89f646", "score": "0.45957863", "text": "func (ctrler CtrlDefReactor) OnEventPolicyCreate(obj *EventPolicy) error {\n\tlog.Info(\"OnEventPolicyCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "c988238c13413704f40078bcdfa83dc6", "score": "0.45925775", "text": "func (_LendingPoolConfigurator *LendingPoolConfiguratorFilterer) WatchReserveDeactivated(opts *bind.WatchOpts, sink chan<- *LendingPoolConfiguratorReserveDeactivated, _reserve []common.Address) (event.Subscription, error) {\n\n\tvar _reserveRule []interface{}\n\tfor _, _reserveItem := range _reserve {\n\t\t_reserveRule = append(_reserveRule, _reserveItem)\n\t}\n\n\tlogs, sub, err := _LendingPoolConfigurator.contract.WatchLogs(opts, \"ReserveDeactivated\", _reserveRule)\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(LendingPoolConfiguratorReserveDeactivated)\n\t\t\t\tif err := _LendingPoolConfigurator.contract.UnpackLog(event, \"ReserveDeactivated\", 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": "c7be3b01dbce6fb973ba58857d7ed665", "score": "0.45881292", "text": "func (_BalanceContract *BalanceContractFilterer) WatchPurchaseNotify(opts *bind.WatchOpts, sink chan<- *BalanceContractPurchaseNotify, _addr []common.Address, _hash [][32]byte) (event.Subscription, error) {\n\n\tvar _addrRule []interface{}\n\tfor _, _addrItem := range _addr {\n\t\t_addrRule = append(_addrRule, _addrItem)\n\t}\n\tvar _hashRule []interface{}\n\tfor _, _hashItem := range _hash {\n\t\t_hashRule = append(_hashRule, _hashItem)\n\t}\n\n\tlogs, sub, err := _BalanceContract.contract.WatchLogs(opts, \"purchaseNotify\", _addrRule, _hashRule)\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(BalanceContractPurchaseNotify)\n\t\t\t\tif err := _BalanceContract.contract.UnpackLog(event, \"purchaseNotify\", 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": "bc7c62044914e811bfa501856f13433d", "score": "0.45670664", "text": "func (_L1StandardBridge *L1StandardBridgeFilterer) WatchERC20DepositInitiated(opts *bind.WatchOpts, sink chan<- *L1StandardBridgeERC20DepositInitiated, l1Token []common.Address, l2Token []common.Address, from []common.Address) (event.Subscription, error) {\n\n\tvar l1TokenRule []interface{}\n\tfor _, l1TokenItem := range l1Token {\n\t\tl1TokenRule = append(l1TokenRule, l1TokenItem)\n\t}\n\tvar l2TokenRule []interface{}\n\tfor _, l2TokenItem := range l2Token {\n\t\tl2TokenRule = append(l2TokenRule, l2TokenItem)\n\t}\n\tvar fromRule []interface{}\n\tfor _, fromItem := range from {\n\t\tfromRule = append(fromRule, fromItem)\n\t}\n\n\tlogs, sub, err := _L1StandardBridge.contract.WatchLogs(opts, \"ERC20DepositInitiated\", l1TokenRule, l2TokenRule, fromRule)\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(L1StandardBridgeERC20DepositInitiated)\n\t\t\t\tif err := _L1StandardBridge.contract.UnpackLog(event, \"ERC20DepositInitiated\", 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": "359d446c26eb006c292718571aa63fb4", "score": "0.4560967", "text": "func (ctrler CtrlDefReactor) OnAlertDestinationCreate(obj *AlertDestination) error {\n\tlog.Info(\"OnAlertDestinationCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "fccc24c3c35c3bcdc7362f87ee976a02", "score": "0.4557814", "text": "func (ctrler CtrlDefReactor) OnAuditPolicyCreate(obj *AuditPolicy) error {\n\tlog.Info(\"OnAuditPolicyCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "013b643fe3361a79dde193ec161c3ae8", "score": "0.4552447", "text": "func (_Escrow *EscrowFilterer) WatchWithdrawal(opts *bind.WatchOpts, sink chan<- *EscrowWithdrawal, identifier [][32]byte, to []common.Address, token []common.Address) (event.Subscription, error) {\n\n\tvar identifierRule []interface{}\n\tfor _, identifierItem := range identifier {\n\t\tidentifierRule = append(identifierRule, identifierItem)\n\t}\n\tvar toRule []interface{}\n\tfor _, toItem := range to {\n\t\ttoRule = append(toRule, toItem)\n\t}\n\tvar tokenRule []interface{}\n\tfor _, tokenItem := range token {\n\t\ttokenRule = append(tokenRule, tokenItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.WatchLogs(opts, \"Withdrawal\", identifierRule, toRule, tokenRule)\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(EscrowWithdrawal)\n\t\t\t\tif err := _Escrow.contract.UnpackLog(event, \"Withdrawal\", 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": "2b1e1e4b1ce07a022bfb8586aad4750d", "score": "0.45416176", "text": "func (_Escrow *EscrowFilterer) FilterOnCancelEscrow(opts *bind.FilterOpts, dapp []common.Address, escrowId []*big.Int, arbiter []common.Address) (*EscrowOnCancelEscrowIterator, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tvar arbiterRule []interface{}\n\tfor _, arbiterItem := range arbiter {\n\t\tarbiterRule = append(arbiterRule, arbiterItem)\n\t}\n\n\tlogs, sub, err := _Escrow.contract.FilterLogs(opts, \"OnCancelEscrow\", dappRule, escrowIdRule, arbiterRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &EscrowOnCancelEscrowIterator{contract: _Escrow.contract, event: \"OnCancelEscrow\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "260c3fbefd1d8285309a47e4f3f3539c", "score": "0.45351863", "text": "func (dr *DeploymentReplication) createEvent(evt *k8sutil.Event) {\n\tdr.deps.EventRecorder.Event(evt.InvolvedObject, evt.Type, evt.Reason, evt.Message)\n}", "title": "" }, { "docid": "0d58e05443a1041185f8fdcbba2072c7", "score": "0.4531866", "text": "func (_Pancake *PancakeFilterer) WatchPairCreated(opts *bind.WatchOpts, sink chan<- *PancakePairCreated, token0 []common.Address, token1 []common.Address) (event.Subscription, error) {\n\n\tvar token0Rule []interface{}\n\tfor _, token0Item := range token0 {\n\t\ttoken0Rule = append(token0Rule, token0Item)\n\t}\n\tvar token1Rule []interface{}\n\tfor _, token1Item := range token1 {\n\t\ttoken1Rule = append(token1Rule, token1Item)\n\t}\n\n\tlogs, sub, err := _Pancake.contract.WatchLogs(opts, \"PairCreated\", token0Rule, token1Rule)\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(PancakePairCreated)\n\t\t\t\tif err := _Pancake.contract.UnpackLog(event, \"PairCreated\", 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": "ac6029ccc284dca40898284c143be226", "score": "0.4531222", "text": "func (_Comtroller *ComtrollerFilterer) WatchNewVAIVaultInfo(opts *bind.WatchOpts, sink chan<- *ComtrollerNewVAIVaultInfo) (event.Subscription, error) {\n\n\tlogs, sub, err := _Comtroller.contract.WatchLogs(opts, \"NewVAIVaultInfo\")\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(ComtrollerNewVAIVaultInfo)\n\t\t\t\tif err := _Comtroller.contract.UnpackLog(event, \"NewVAIVaultInfo\", 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": "4fef31e592e235f104226ea37296f901", "score": "0.4526993", "text": "func (_RollupCreator *RollupCreatorFilterer) FilterRollupCreated(opts *bind.FilterOpts, rollupAddress []common.Address) (*RollupCreatorRollupCreatedIterator, error) {\n\n\tvar rollupAddressRule []interface{}\n\tfor _, rollupAddressItem := range rollupAddress {\n\t\trollupAddressRule = append(rollupAddressRule, rollupAddressItem)\n\t}\n\n\tlogs, sub, err := _RollupCreator.contract.FilterLogs(opts, \"RollupCreated\", rollupAddressRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &RollupCreatorRollupCreatedIterator{contract: _RollupCreator.contract, event: \"RollupCreated\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "f47e46abcef9fd95efc9d8c57851ecc9", "score": "0.45135275", "text": "func (_HoQuBounty *HoQuBountyFilterer) WatchTokenAddedByBounty(opts *bind.WatchOpts, sink chan<- *HoQuBountyTokenAddedByBounty, _receiver []common.Address) (event.Subscription, error) {\n\n\tvar _receiverRule []interface{}\n\tfor _, _receiverItem := range _receiver {\n\t\t_receiverRule = append(_receiverRule, _receiverItem)\n\t}\n\n\tlogs, sub, err := _HoQuBounty.contract.WatchLogs(opts, \"TokenAddedByBounty\", _receiverRule)\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(HoQuBountyTokenAddedByBounty)\n\t\t\t\tif err := _HoQuBounty.contract.UnpackLog(event, \"TokenAddedByBounty\", 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": "568c5ead40b6ed5dc49f34958ad271b3", "score": "0.44908023", "text": "func (_RoomFactory *RoomFactoryFilterer) WatchRoomCreated(opts *bind.WatchOpts, sink chan<- *RoomFactoryRoomCreated, _creator []common.Address) (event.Subscription, error) {\n\n\tvar _creatorRule []interface{}\n\tfor _, _creatorItem := range _creator {\n\t\t_creatorRule = append(_creatorRule, _creatorItem)\n\t}\n\n\tlogs, sub, err := _RoomFactory.contract.WatchLogs(opts, \"RoomCreated\", _creatorRule)\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(RoomFactoryRoomCreated)\n\t\t\t\tif err := _RoomFactory.contract.UnpackLog(event, \"RoomCreated\", 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": "343e05e4015a82c219aeca7e60efd7d4", "score": "0.44882113", "text": "func (_ITellor *ITellorFilterer) WatchNewStake(opts *bind.WatchOpts, sink chan<- *ITellorNewStake, _sender []common.Address) (event.Subscription, error) {\n\n\tvar _senderRule []interface{}\n\tfor _, _senderItem := range _sender {\n\t\t_senderRule = append(_senderRule, _senderItem)\n\t}\n\n\tlogs, sub, err := _ITellor.contract.WatchLogs(opts, \"NewStake\", _senderRule)\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(ITellorNewStake)\n\t\t\t\tif err := _ITellor.contract.UnpackLog(event, \"NewStake\", 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": "196c563c383ef05ae90e9ccb7f160b37", "score": "0.4482091", "text": "func (c *Client) Create(data *CreateParams) (*xendit.Payout, *xendit.Error) {\n\treturn c.CreateWithContext(context.Background(), data)\n}", "title": "" }, { "docid": "037c2ef97768406eb7294a960af0828d", "score": "0.44756883", "text": "func (_MdexFarm *MdexFarmFilterer) WatchEmergencyWithdraw(opts *bind.WatchOpts, sink chan<- *MdexFarmEmergencyWithdraw, user []common.Address, pid []*big.Int) (event.Subscription, error) {\n\n\tvar userRule []interface{}\n\tfor _, userItem := range user {\n\t\tuserRule = append(userRule, userItem)\n\t}\n\tvar pidRule []interface{}\n\tfor _, pidItem := range pid {\n\t\tpidRule = append(pidRule, pidItem)\n\t}\n\n\tlogs, sub, err := _MdexFarm.contract.WatchLogs(opts, \"EmergencyWithdraw\", userRule, pidRule)\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(MdexFarmEmergencyWithdraw)\n\t\t\t\tif err := _MdexFarm.contract.UnpackLog(event, \"EmergencyWithdraw\", 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": "38d7458dc6b420d84cf8af5516589ffa", "score": "0.44730717", "text": "func (_BtEth *BtEthFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *BtEthNewOwner) (event.Subscription, error) {\n\n\tlogs, sub, err := _BtEth.contract.WatchLogs(opts, \"NewOwner\")\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(BtEthNewOwner)\n\t\t\t\tif err := _BtEth.contract.UnpackLog(event, \"NewOwner\", 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": "9473eb76928f061de37e72bbd76fe67f", "score": "0.4472446", "text": "func (c *clusterStateMachine) OnCreate(key string, resource []byte) {\n\tc.log.Info(\"storage cluster be created\", logger.String(\"key\", key))\n\tc.addCluster(resource)\n}", "title": "" }, { "docid": "87ef166018e7dc21ecb04460114680f0", "score": "0.44620386", "text": "func (t *Receipt) workOrderReceiptCreate(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n logger.Info(\"workOrderReceiptCreate\")\n if len(args) != 6 {\n logger.Errorf(\"Mismatch number of arguments, expect 6, received %d\", len(args))\n return shim.Error(\"workOrderReceiptCreate must include 6 arguments, workOrderId, workerId, workerServiceId, requesterId, receiptCreateStatus and workOrderRequestHash\")\n }\n\n arg4, err := strconv.ParseUint(args[4], 10, 64)\n if err != nil {\n logger.Errorf(\"Receipt create status must be an integer\")\n return shim.Error(\"Receipt create status must be an integer\")\n }\n\n var rc ReceiptCreate\n rc.WorkOrderId = args[0]\n rc.WorkerId = args[1]\n rc.WorkerServiceId = args[2]\n rc.RequesterId = args[3]\n rc.ReceiptCreateStatus = arg4\n rc.WorkOrderRequestHash = args[5]\n\n var r Receipt\n r.ReceiptCreate = rc\n r.ReceiptUpdates = []ReceiptUpdate{}\n //Serialize the value\n value, err := json.Marshal(r)\n if err != nil {\n return shim.Error(err.Error())\n }\n\n err = stub.PutState(rc.WorkOrderId, value)\n if err != nil {\n return shim.Error(err.Error())\n }\n\n compValue := []byte(rc.WorkOrderId)\n\n attrs, _ := processAttributes([]string{rc.WorkerServiceId, rc.WorkerId, rc.RequesterId, args[4]},\n []string{BYTE32FORMAT, BYTE32FORMAT, BYTE32FORMAT, UINT64FORMAT})\n compKey, err := stub.CreateCompositeKey(RECEIPT_CREATE, attrs)\n if err != nil {\n return shim.Error(err.Error())\n }\n err = stub.PutState(compKey, compValue)\n if err != nil {\n return shim.Error(err.Error())\n }\n\n // Handling payload for the event\n var eventData ReceiptCreatedEvent\n eventData.WorkOrderId = rc.WorkOrderId\n eventData.WorkerServiceId = rc.WorkerServiceId\n eventData.WorkerId = rc.WorkerId\n eventData.RequesterId = rc.RequesterId\n eventData.ReceiptStatus = rc.ReceiptCreateStatus\n eventData.WorkOrderRequestHash = rc.WorkOrderRequestHash\n eventData.ErrorCode = 0\n\n eventPayload, err := json.Marshal(eventData)\n if err != nil {\n return shim.Error(err.Error())\n }\n\n err = stub.SetEvent(\"workOrderReceiptCreated\", eventPayload)\n if err != nil {\n return shim.Error(err.Error())\n }\n\n logger.Info(\"Finished workOrderReceiptCreate\")\n return shim.Success(nil)\n}", "title": "" }, { "docid": "0876320856109e6dc13259ccc78be3e9", "score": "0.44605282", "text": "func (_Esd *EsdFilterer) WatchCouponExpiration(opts *bind.WatchOpts, sink chan<- *EsdCouponExpiration, epoch []*big.Int) (event.Subscription, error) {\n\n\tvar epochRule []interface{}\n\tfor _, epochItem := range epoch {\n\t\tepochRule = append(epochRule, epochItem)\n\t}\n\n\tlogs, sub, err := _Esd.contract.WatchLogs(opts, \"CouponExpiration\", epochRule)\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(EsdCouponExpiration)\n\t\t\t\tif err := _Esd.contract.UnpackLog(event, \"CouponExpiration\", 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": "8de4f680652a8ba542e50b7a4051ecb6", "score": "0.4456388", "text": "func (ctrler CtrlDefReactor) OnStatsAlertPolicyCreate(obj *StatsAlertPolicy) error {\n\tlog.Info(\"OnStatsAlertPolicyCreate is not implemented\")\n\treturn nil\n}", "title": "" }, { "docid": "7f90c7744c939a28664bf5c99aff14fe", "score": "0.44484273", "text": "func (_CanWorkJob *CanWorkJobFilterer) FilterOnCancelEscrow(opts *bind.FilterOpts, dapp []common.Address, escrowId []*big.Int, arbiter []common.Address) (*CanWorkJobOnCancelEscrowIterator, error) {\n\n\tvar dappRule []interface{}\n\tfor _, dappItem := range dapp {\n\t\tdappRule = append(dappRule, dappItem)\n\t}\n\tvar escrowIdRule []interface{}\n\tfor _, escrowIdItem := range escrowId {\n\t\tescrowIdRule = append(escrowIdRule, escrowIdItem)\n\t}\n\n\tvar arbiterRule []interface{}\n\tfor _, arbiterItem := range arbiter {\n\t\tarbiterRule = append(arbiterRule, arbiterItem)\n\t}\n\n\tlogs, sub, err := _CanWorkJob.contract.FilterLogs(opts, \"OnCancelEscrow\", dappRule, escrowIdRule, arbiterRule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &CanWorkJobOnCancelEscrowIterator{contract: _CanWorkJob.contract, event: \"OnCancelEscrow\", logs: logs, sub: sub}, nil\n}", "title": "" }, { "docid": "e1101688fe1968d16fe30e4d94a4d347", "score": "0.44482473", "text": "func (_MasterChef *MasterChefFilterer) WatchEmergencyWithdraw(opts *bind.WatchOpts, sink chan<- *MasterChefEmergencyWithdraw, user []common.Address, pid []*big.Int) (event.Subscription, error) {\n\n\tvar userRule []interface{}\n\tfor _, userItem := range user {\n\t\tuserRule = append(userRule, userItem)\n\t}\n\tvar pidRule []interface{}\n\tfor _, pidItem := range pid {\n\t\tpidRule = append(pidRule, pidItem)\n\t}\n\n\tlogs, sub, err := _MasterChef.contract.WatchLogs(opts, \"EmergencyWithdraw\", userRule, pidRule)\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(MasterChefEmergencyWithdraw)\n\t\t\t\tif err := _MasterChef.contract.UnpackLog(event, \"EmergencyWithdraw\", 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": "96009ad6a65abd161ff3c2d2e08dfdc9", "score": "0.44478485", "text": "func produceEvent(cli *http.Client,\n\tnotif common.NotificationFromProducer) error {\n\n\tif cli == nil {\n\t\treturn errors.New(\"Invalid http client\")\n\t}\n\n\tvar (\n\t\terr error\n\t\tpayload []byte\n\t\treq *http.Request\n\t\tresp *http.Response\n\t)\n\n\tif payload, err = json.Marshal(notif); err != nil {\n\t\treturn errors.Wrap(err, \"Failed to Marshal:\")\n\t}\n\n\tif req, err = http.NewRequest(\"POST\",\n\t\t\"https://\"+common.Cfg.EdgeNodeEndpoint+\"/notifications\",\n\t\tbytes.NewBuffer(payload)); err != nil {\n\n\t\treturn errors.Wrap(err, \"Failed to create new http request\")\n\t}\n\n\tif resp, err = cli.Do(req); err != nil {\n\t\treturn errors.Wrap(err, \"Failed to send new http request\")\n\t}\n\n\tdefer func() {\n\t\tif err := resp.Body.Close(); err != nil {\n\t\t\tlog.Println(\"Response body failed to close \" + err.Error())\n\t\t}\n\t}()\n\n\tif resp.StatusCode != 202 {\n\t\treturn errors.New(\"Response failed with status \" + resp.Status)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "164388141afc89faffa74c93868127ba", "score": "0.44447336", "text": "func (c *Callbacks) OnCDOTAUserMsg_HotPotato_Created(fn func(*dota.CDOTAUserMsg_HotPotato_Created) error) {\n\tc.onCDOTAUserMsg_HotPotato_Created = append(c.onCDOTAUserMsg_HotPotato_Created, fn)\n}", "title": "" }, { "docid": "a400cd7a5c4db93c6ad2ee127982d0d5", "score": "0.442954", "text": "func NewEscrow(address common.Address, backend bind.ContractBackend) (*Escrow, error) {\n\tcontract, err := bindEscrow(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Escrow{EscrowCaller: EscrowCaller{contract: contract}, EscrowTransactor: EscrowTransactor{contract: contract}, EscrowFilterer: EscrowFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "a400cd7a5c4db93c6ad2ee127982d0d5", "score": "0.442954", "text": "func NewEscrow(address common.Address, backend bind.ContractBackend) (*Escrow, error) {\n\tcontract, err := bindEscrow(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Escrow{EscrowCaller: EscrowCaller{contract: contract}, EscrowTransactor: EscrowTransactor{contract: contract}, EscrowFilterer: EscrowFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "a400cd7a5c4db93c6ad2ee127982d0d5", "score": "0.442954", "text": "func NewEscrow(address common.Address, backend bind.ContractBackend) (*Escrow, error) {\n\tcontract, err := bindEscrow(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Escrow{EscrowCaller: EscrowCaller{contract: contract}, EscrowTransactor: EscrowTransactor{contract: contract}, EscrowFilterer: EscrowFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "7c9dc87a106e431dbc4e3ff0f0cafae1", "score": "0.4426045", "text": "func (c *EventClient) Create() *EventCreate {\n\tmutation := newEventMutation(c.config, OpCreate)\n\treturn &EventCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "8f12d322cc37530b818e6307df3a4f3a", "score": "0.44256228", "text": "func (_LendingPoolConfigurator *LendingPoolConfiguratorFilterer) WatchStableRateEnabledOnReserve(opts *bind.WatchOpts, sink chan<- *LendingPoolConfiguratorStableRateEnabledOnReserve, _reserve []common.Address) (event.Subscription, error) {\n\n\tvar _reserveRule []interface{}\n\tfor _, _reserveItem := range _reserve {\n\t\t_reserveRule = append(_reserveRule, _reserveItem)\n\t}\n\n\tlogs, sub, err := _LendingPoolConfigurator.contract.WatchLogs(opts, \"StableRateEnabledOnReserve\", _reserveRule)\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(LendingPoolConfiguratorStableRateEnabledOnReserve)\n\t\t\t\tif err := _LendingPoolConfigurator.contract.UnpackLog(event, \"StableRateEnabledOnReserve\", 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": "" } ]
3ea298bf24aa9af3f84aaca28672225d
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationNetwork.
[ { "docid": "2262cb2cd4eb273f8d9babe505e7f49b", "score": "0.87705094", "text": "func (in *DestinationNetwork) DeepCopy() *DestinationNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" } ]
[ { "docid": "630a7b6c7b9529865ae92673435e085d", "score": "0.6424977", "text": "func (in *WeightedDestination) DeepCopy() *WeightedDestination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(WeightedDestination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "96d93f5fb03a816f3a4d52bb85a970c4", "score": "0.64161485", "text": "func (in *Destination) DeepCopy() *Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "042fc1707d510e419f4164d5e4e75ba7", "score": "0.63448167", "text": "func (in *Network) DeepCopy() *Network {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Network)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "7c9cb82782e55ff1043d687f59d16254", "score": "0.61718935", "text": "func (in *DestinationRule) DeepCopy() *DestinationRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a99565761d228bdf574283b227f30aa5", "score": "0.600662", "text": "func (in *DestinationWeight) DeepCopy() *DestinationWeight {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationWeight)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "59413e7786b1e9f3d11e53f81ca38bc9", "score": "0.5914805", "text": "func (in *PacketmirroringNetwork) DeepCopy() *PacketmirroringNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(PacketmirroringNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "7b876313239ad57f5c7ac70f0f245f1d", "score": "0.58806807", "text": "func (in *Destinations) DeepCopy() *Destinations {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destinations)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "dc5b766cc00cec587d4bf36b480cf2db", "score": "0.5851088", "text": "func (in *BuilderNetwork) DeepCopy() *BuilderNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(BuilderNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f005b45229cc3ff47a27493e22f1f557", "score": "0.5736296", "text": "func (in *DataNetwork) DeepCopy() *DataNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DataNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "e31e75ed788e1aaed12f575e9dd96e14", "score": "0.57100743", "text": "func (o ConnectivityTestDestinationPtrOutput) Network() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConnectivityTestDestination) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Network\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "b8b7ae8dc246314cf85b774fbfb89eb0", "score": "0.56800723", "text": "func (o ConnectivityTestDestinationOutput) Network() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConnectivityTestDestination) *string { return v.Network }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6d31781637c4f4ebbbe88fbcea58e831", "score": "0.5555488", "text": "func (in Destinations) DeepCopy() Destinations {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Destinations)\n\tin.DeepCopyInto(out)\n\treturn *out\n}", "title": "" }, { "docid": "ac5b67476fafc40aa9fc639eeee8a2e4", "score": "0.552339", "text": "func (in *DestinationConfiguration) DeepCopy() *DestinationConfiguration {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationConfiguration)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "dcd890224c7df252b4343d4758b3f8f9", "score": "0.5435016", "text": "func (in *DestinationEncryptionConfiguration) DeepCopy() *DestinationEncryptionConfiguration {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationEncryptionConfiguration)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3b1f3848eb0d7671e6e3d564d2cc9473", "score": "0.5426748", "text": "func (in *Bucket_Destination) DeepCopy() *Bucket_Destination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Bucket_Destination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a17ed8e199456d457b0d6224f67851cd", "score": "0.5322724", "text": "func (in *LogsinkDestination) DeepCopy() *LogsinkDestination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(LogsinkDestination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "9ac28db3cc65bfb797071a57ec272e5a", "score": "0.5229741", "text": "func (in *NetworkProfile) DeepCopy() *NetworkProfile {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkProfile)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "30784deba0d2e46fe700a8044ce173d3", "score": "0.5203932", "text": "func (in *HTTPRouteDestination) DeepCopy() *HTTPRouteDestination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(HTTPRouteDestination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "617e710c9587fe17fb3c16a1ad889106", "score": "0.51639897", "text": "func (s *NotificationSpecification) SetDestination(v string) *NotificationSpecification {\n\ts.Destination = &v\n\treturn s\n}", "title": "" }, { "docid": "e5c4f2b6cd262213f9eb24093f1e92f7", "score": "0.51593417", "text": "func (in *RouternatSubnetwork) DeepCopy() *RouternatSubnetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(RouternatSubnetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "37a6e644ef2bab4385b334b87aacf1e1", "score": "0.51267415", "text": "func NewDestinationDetails(urlOrPath string, ) *DestinationDetails {\n\tthis := DestinationDetails{}\n\tthis.UrlOrPath = urlOrPath\n\treturn &this\n}", "title": "" }, { "docid": "22539adfaf4e58c4fbad079b7972a86c", "score": "0.51262283", "text": "func (o *NumaDistance) SetDestination(v int32) {\n\to.Destination = v\n}", "title": "" }, { "docid": "5c534f8d7d5e76a3074c58556abf74fb", "score": "0.51261574", "text": "func (in *NetworkConnection) DeepCopy() *NetworkConnection {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkConnection)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "197f8cbef72db4d084ac1d9e09cdacd9", "score": "0.51009905", "text": "func (ipb *IPPacketBuilder) Destination(ip string) *IPPacketBuilder {\n\tipb.destination = net.ParseIP(ip)\n\treturn ipb\n}", "title": "" }, { "docid": "8377abafc95c0f4daf34ceed07e54d39", "score": "0.5095952", "text": "func (in *Subnetwork) DeepCopy() *Subnetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Subnetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "8377abafc95c0f4daf34ceed07e54d39", "score": "0.5095952", "text": "func (in *Subnetwork) DeepCopy() *Subnetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Subnetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3ea27db953cd090d16c74a2b2280f857", "score": "0.5087249", "text": "func (o *ConnectionDTO) SetDestination(v ConnectableDTO) {\n\to.Destination = &v\n}", "title": "" }, { "docid": "4497da0c3fc3d8efb0c3ecd3b757a5f9", "score": "0.50844085", "text": "func (in *VirtualNetwork) DeepCopy() *VirtualNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtualNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "4497da0c3fc3d8efb0c3ecd3b757a5f9", "score": "0.50844085", "text": "func (in *VirtualNetwork) DeepCopy() *VirtualNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtualNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "d5ef21f188987e5efac0f8558b4d9589", "score": "0.5052988", "text": "func (s *DataSource) SetDestination(v string) *DataSource {\n\ts.Destination = &v\n\treturn s\n}", "title": "" }, { "docid": "2c1cb0ebabe5430e301ff6d1d896b51c", "score": "0.50338745", "text": "func (s *DescribeReplayOutput) SetDestination(v *ReplayDestination) *DescribeReplayOutput {\n\ts.Destination = v\n\treturn s\n}", "title": "" }, { "docid": "60bc489a3cdb7a220b3dd165ca171aea", "score": "0.50195426", "text": "func (o TcpConfigOutput) Destination() GatewayDestinationOutput {\n\treturn o.ApplyT(func(v TcpConfig) GatewayDestination { return v.Destination }).(GatewayDestinationOutput)\n}", "title": "" }, { "docid": "74a2190143a0a2bed7d6f5912733dfe5", "score": "0.5016552", "text": "func (in *VirtualNetworkGateway) DeepCopy() *VirtualNetworkGateway {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtualNetworkGateway)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "e9dbe756f1650744589b37d00bccc24e", "score": "0.49825925", "text": "func (in *NetworkPair) DeepCopy() *NetworkPair {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkPair)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "83c05875424830fbc95e57d28571b0cc", "score": "0.49783427", "text": "func (o *RoutingRule) GetDestination() string {\n\tif o == nil || isNil(o.Destination) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Destination\n}", "title": "" }, { "docid": "189624d50cb6d4894e84c6a46b6e7008", "score": "0.49661732", "text": "func (in *NetworkPolicy) DeepCopy() *NetworkPolicy {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkPolicy)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "189624d50cb6d4894e84c6a46b6e7008", "score": "0.49661732", "text": "func (in *NetworkPolicy) DeepCopy() *NetworkPolicy {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkPolicy)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "5ac0c971350fa9bf3735092cdce507d1", "score": "0.49612668", "text": "func (in *HostNetwork) DeepCopy() *HostNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(HostNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "79bccab97cdcf68681d45859f4806d25", "score": "0.49608052", "text": "func (net Network) Copy() *Network {\n\tvar newNet Network\n\tnewNet.AllNodes = make([]Neuron, len(net.AllNodes))\n\tfor nodeIndex := range net.AllNodes {\n\t\t// This copies the node and also sets the .Net pointer correctly to this network\n\t\tnewNet.AllNodes[nodeIndex] = newNet.AllNodes[nodeIndex].Copy(&newNet)\n\t}\n\tnewNet.InputNodes = net.InputNodes\n\tnewNet.OutputNode = net.OutputNode\n\tnewNet.Weight = net.Weight\n\n\t// NOTE: It's important that a pointer to a Network is returned,\n\t// instead of an entire Network struct, so that the .Net pointers in the nodes point correctly.\n\treturn &newNet\n}", "title": "" }, { "docid": "68af42d274b5c6c28f91dfecb90e6556", "score": "0.49583167", "text": "func (in *AWSBackendDestination) DeepCopy() *AWSBackendDestination {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AWSBackendDestination)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "50cff7ccac06cd6619e137a9c3ffba2b", "score": "0.49518564", "text": "func (s *DataSourceConfig) SetDestination(v string) *DataSourceConfig {\n\ts.Destination = &v\n\treturn s\n}", "title": "" }, { "docid": "fa92834c3e5d281a169516746703e564", "score": "0.49465454", "text": "func (o *ConnectionDTO) GetDestination() ConnectableDTO {\n\tif o == nil || o.Destination == nil {\n\t\tvar ret ConnectableDTO\n\t\treturn ret\n\t}\n\treturn *o.Destination\n}", "title": "" }, { "docid": "28881a512a8cc8d2fde1e16faf1af5c4", "score": "0.49439847", "text": "func (in *NetworkPolicyEgressRule) DeepCopy() *NetworkPolicyEgressRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkPolicyEgressRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3f366c5ed1723ae08b4903cc2b99ec07", "score": "0.49356773", "text": "func (o *PostWalletSiafundsParams) SetDestination(destination *string) {\n\to.Destination = destination\n}", "title": "" }, { "docid": "aa3666bef2b91c7c2afb8eb266426f34", "score": "0.49304676", "text": "func (request *VMessRequest) Destination() v2net.Destination {\n\tif request.Command == CmdTCP {\n\t\treturn v2net.NewTCPDestination(request.Address)\n\t} else {\n\t\treturn v2net.NewUDPDestination(request.Address)\n\t}\n}", "title": "" }, { "docid": "00da7ea02d95a8d2586a4a480c7d13de", "score": "0.4922015", "text": "func (o *RoutingRule) SetDestination(v string) {\n\to.Destination = &v\n}", "title": "" }, { "docid": "b136b0c8f5d152eb49859a2c6da30e6a", "score": "0.49217603", "text": "func (d *DriverNetwork) Copy() *DriverNetwork {\n\tif d == nil {\n\t\treturn nil\n\t}\n\tpm := make(map[string]int, len(d.PortMap))\n\tfor k, v := range d.PortMap {\n\t\tpm[k] = v\n\t}\n\treturn &DriverNetwork{\n\t\tPortMap: pm,\n\t\tIP: d.IP,\n\t\tAutoAdvertise: d.AutoAdvertise,\n\t}\n}", "title": "" }, { "docid": "142c1f2b0867961f553190cfdf6f78de", "score": "0.49063927", "text": "func (o *Route4Type) SetDestination(v string) {\n\to.Destination = v\n}", "title": "" }, { "docid": "d3cc84a524585426b0e14a8211ece4d0", "score": "0.49020493", "text": "func (o *RecurrenceTransaction) SetDestinationType(v AccountTypeProperty) {\n\to.DestinationType = &v\n}", "title": "" }, { "docid": "a9fdeb1e9cba868760b776b731112294", "score": "0.48707372", "text": "func NewDestination(server, namespace string) Destination {\n\treturn Destination{\n\t\tserver: server,\n\t\tnamespace: namespace,\n\t}\n}", "title": "" }, { "docid": "846b0b667cf25c139fecf4245319cdbc", "score": "0.48695782", "text": "func (in *DestinationTable) DeepCopy() *DestinationTable {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationTable)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "d31661394bb62925c69756a20f49f584", "score": "0.48661584", "text": "func (in *KuryrNetwork) DeepCopy() *KuryrNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(KuryrNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "e8e053caef3fff63397089e011390743", "score": "0.48584163", "text": "func (o FirewallVpcFirewallControlPolicyOutput) DestinationType() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *FirewallVpcFirewallControlPolicy) pulumi.StringOutput { return v.DestinationType }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "fe6cc4695e15ed889722625cd489a997", "score": "0.48504767", "text": "func (s *StartReplayInput) SetDestination(v *ReplayDestination) *StartReplayInput {\n\ts.Destination = v\n\treturn s\n}", "title": "" }, { "docid": "2ea0bd126e38671f4771f41bcc504369", "score": "0.48386198", "text": "func (in *ComputeNetwork) DeepCopy() *ComputeNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ComputeNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "2ea0bd126e38671f4771f41bcc504369", "score": "0.48386198", "text": "func (in *ComputeNetwork) DeepCopy() *ComputeNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ComputeNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "98ddbf1296f6e5c975d754a3a0f74dbf", "score": "0.48330623", "text": "func (o *Pullrequest) SetDestination(v PullrequestEndpoint) {\n\to.Destination = &v\n}", "title": "" }, { "docid": "6020784a9da4d9a8a3912d1ebcac3eab", "score": "0.4818018", "text": "func (in *ComputeNetworkPeering) DeepCopy() *ComputeNetworkPeering {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ComputeNetworkPeering)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "6020784a9da4d9a8a3912d1ebcac3eab", "score": "0.4818018", "text": "func (in *ComputeNetworkPeering) DeepCopy() *ComputeNetworkPeering {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ComputeNetworkPeering)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "26fc5e6944c69c080dd9cdd04e30f1ce", "score": "0.4812806", "text": "func (in *RoutingRule) DeepCopy() *RoutingRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(RoutingRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "cac968348f0013c1fe35257db8c232b1", "score": "0.48079982", "text": "func (o *Route4Type) GetDestination() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Destination\n}", "title": "" }, { "docid": "1a62b34746c16bedb2f8227952fa28de", "score": "0.4801912", "text": "func (o HttpRouteConfigOutput) Destination() GatewayDestinationOutput {\n\treturn o.ApplyT(func(v HttpRouteConfig) GatewayDestination { return v.Destination }).(GatewayDestinationOutput)\n}", "title": "" }, { "docid": "7b82c29de4ff72d619fdd6bf390c561e", "score": "0.47934592", "text": "func (in *MoneroNetwork) DeepCopy() *MoneroNetwork {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MoneroNetwork)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "795e243d340877070529bea6f9791d03", "score": "0.47833383", "text": "func (in *DestinationStorage) DeepCopy() *DestinationStorage {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DestinationStorage)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "b1e25b1a4215c6d2236d94f82bcf2ba8", "score": "0.47721967", "text": "func (in *VirtualMachineScaleSetNetworkConfiguration) DeepCopy() *VirtualMachineScaleSetNetworkConfiguration {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtualMachineScaleSetNetworkConfiguration)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "1ff10f3dac89780e4da6afc7b899c946", "score": "0.4763508", "text": "func (o ConnectivityTestSourcePtrOutput) Network() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *ConnectivityTestSource) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Network\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "75a1c6ae2c93cb7a6b4b9a5f2b81f0dd", "score": "0.47208446", "text": "func (network *Network) AssignProperties_To_Network(destination *v20210501s.Network) error {\n\t// Clone the existing property bag\n\tpropertyBag := genruntime.NewPropertyBag(network.PropertyBag)\n\n\t// DelegatedSubnetResourceReference\n\tif network.DelegatedSubnetResourceReference != nil {\n\t\tdelegatedSubnetResourceReference := network.DelegatedSubnetResourceReference.Copy()\n\t\tdestination.DelegatedSubnetResourceReference = &delegatedSubnetResourceReference\n\t} else {\n\t\tdestination.DelegatedSubnetResourceReference = nil\n\t}\n\n\t// PrivateDnsZoneResourceReference\n\tif network.PrivateDnsZoneResourceReference != nil {\n\t\tprivateDnsZoneResourceReference := network.PrivateDnsZoneResourceReference.Copy()\n\t\tdestination.PrivateDnsZoneResourceReference = &privateDnsZoneResourceReference\n\t} else {\n\t\tdestination.PrivateDnsZoneResourceReference = nil\n\t}\n\n\t// Update the property bag\n\tif len(propertyBag) > 0 {\n\t\tdestination.PropertyBag = propertyBag\n\t} else {\n\t\tdestination.PropertyBag = nil\n\t}\n\n\t// Invoke the augmentConversionForNetwork interface (if implemented) to customize the conversion\n\tvar networkAsAny any = network\n\tif augmentedNetwork, ok := networkAsAny.(augmentConversionForNetwork); ok {\n\t\terr := augmentedNetwork.AssignPropertiesTo(destination)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"calling augmented AssignPropertiesTo() for conversion\")\n\t\t}\n\t}\n\n\t// No error\n\treturn nil\n}", "title": "" }, { "docid": "7928e0f61f6f490676dbfb19b8d9827d", "score": "0.47178218", "text": "func (o RouteOutput) Network() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Route) pulumi.StringOutput { return v.Network }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "099777fba3b33913deafb23244df8316", "score": "0.47104996", "text": "func (in *NetworkSpec) DeepCopy() *NetworkSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "099777fba3b33913deafb23244df8316", "score": "0.47104996", "text": "func (in *NetworkSpec) DeepCopy() *NetworkSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "099777fba3b33913deafb23244df8316", "score": "0.47104996", "text": "func (in *NetworkSpec) DeepCopy() *NetworkSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "1cbcbc47fc669d80b66813a3c7c0191a", "score": "0.46986502", "text": "func (o *NumaDistance) GetDestination() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.Destination\n}", "title": "" }, { "docid": "71c0c44b4bf4229f00fc6a022d9abf2f", "score": "0.46962148", "text": "func (o ConnectivityTestSourceOutput) Network() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConnectivityTestSource) *string { return v.Network }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "3904be4694bebe96fc8190fff598d1c1", "score": "0.46910602", "text": "func (ipb *IPPacketBuilder) DestinationIP(ip net.IP) *IPPacketBuilder {\n\tipb.destination = ip\n\treturn ipb\n}", "title": "" }, { "docid": "397fdba8e614bd10eb29d21f00689382", "score": "0.4680354", "text": "func (in *OutboundRule) DeepCopy() *OutboundRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(OutboundRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "397fdba8e614bd10eb29d21f00689382", "score": "0.4680354", "text": "func (in *OutboundRule) DeepCopy() *OutboundRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(OutboundRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "ec4aa8078de65657129ed2f98cab3e72", "score": "0.46623543", "text": "func (in *NetworkSecurityGroup) DeepCopy() *NetworkSecurityGroup {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkSecurityGroup)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "ec4aa8078de65657129ed2f98cab3e72", "score": "0.46623543", "text": "func (in *NetworkSecurityGroup) DeepCopy() *NetworkSecurityGroup {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkSecurityGroup)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "dc47b7ebd6902dd5c1ea76fe70b98cc9", "score": "0.4661396", "text": "func (in *NetworkConfig) DeepCopy() *NetworkConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "dc47b7ebd6902dd5c1ea76fe70b98cc9", "score": "0.4661396", "text": "func (in *NetworkConfig) DeepCopy() *NetworkConfig {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkConfig)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "4aba7695f3021967e50a627444b33450", "score": "0.4656742", "text": "func (o *SnmpTrapAllOf) SetDestination(v string) {\n\to.Destination = &v\n}", "title": "" }, { "docid": "e390f6a5e0eaf31bbd53315af52c171c", "score": "0.46327257", "text": "func (s *ExportTask) SetDestination(v string) *ExportTask {\n\ts.Destination = &v\n\treturn s\n}", "title": "" }, { "docid": "f8dea78a902061516f7575092cf76f23", "score": "0.46283486", "text": "func (id ConnID) Destination() net.IP {\n\tif id.IsIPv4() {\n\t\treturn net.IP(id[6:10])\n\t}\n\treturn net.IP(id[18:34])\n}", "title": "" }, { "docid": "63ad0435a18aa09833797f1fdc13b28b", "score": "0.4622354", "text": "func (in *NetworkFilterMod) DeepCopy() *NetworkFilterMod {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(NetworkFilterMod)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "435bec5f631445e5fbbf543c1878ef04", "score": "0.4618386", "text": "func (in *Sink) DeepCopy() *Sink {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Sink)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "0d686443d7ef63b602e5be4e22b49b0f", "score": "0.4577153", "text": "func (o BucketReplicationConfigurationRuleOutput) Destination() BucketReplicationConfigurationRuleDestinationOutput {\n\treturn o.ApplyT(func(v BucketReplicationConfigurationRule) BucketReplicationConfigurationRuleDestination {\n\t\treturn v.Destination\n\t}).(BucketReplicationConfigurationRuleDestinationOutput)\n}", "title": "" }, { "docid": "0508e9c4e03def38a421de08ca331923", "score": "0.45769507", "text": "func (in *VirtualNetworkRule) DeepCopy() *VirtualNetworkRule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtualNetworkRule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" } ]
77c1bfcdf3228f27ac46e4e21f550a7c
getHLSFlags are for getting the flags based on the config context
[ { "docid": "fa0c338f8e2bfc29a730722ef6483efb", "score": "0.67276853", "text": "func (p Process) getHLSFlags() string {\n\tif p.keepFiles {\n\t\treturn \"append_list\"\n\t}\n\treturn \"delete_segments+append_list\"\n}", "title": "" } ]
[ { "docid": "4807241b72fdffe98fdc0ca27b32d2f9", "score": "0.60816956", "text": "func (a *Authenticator) GetFlags(context *CtxtHandle) (uint32, error) {\n\tvar flags SecPkgContext_Flags\n\tstatus := a.Config.authAPI.QueryContextAttributes(context, SECPKG_ATTR_FLAGS, (*byte)(unsafe.Pointer(&flags)))\n\tif status != SEC_E_OK {\n\t\treturn 0, fmt.Errorf(\"QueryContextAttributes failed with status 0x%x\", status)\n\t}\n\treturn flags.Flags, nil\n}", "title": "" }, { "docid": "1801a6db08f2abbfb63e8e1cf248a482", "score": "0.58157265", "text": "func Ldflags(flags ...string) func(*Context) error {\n\treturn func(c *Context) error {\n\t\tc.ldflags = flags\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "0b3748aa71a8c595de7ca4597a2c553b", "score": "0.5789739", "text": "func ldflags(cs map[string]string) string {\n\tl := make([]string, 0, len(cs))\n\tfor k, v := range cs {\n\t\tl = append(l, fmt.Sprintf(`-X \"%s=%s\"`, k, v))\n\t}\n\treturn \"-s -w \" + strings.Join(l, \" \")\n}", "title": "" }, { "docid": "a56a5705293cd1bfdfdc447091cb747a", "score": "0.5629747", "text": "func configureFlags(api *operations.CatlogServiceManagerAPI) {\n\n}", "title": "" }, { "docid": "3154e0c76549c0a30275b52b7f8be3a5", "score": "0.5599121", "text": "func getHelmFlags(r *release) string {\n\tvar flags string\n\n\tfor _, flag := range r.HelmFlags {\n\t\tflags = flags + \" \" + flag\n\t}\n\treturn getNoHooks(r) + getTimeout(r) + getDryRunFlags() + flags\n}", "title": "" }, { "docid": "0a74f4a8f4dd4c28b16c14a2ff2d0fdb", "score": "0.5473247", "text": "func (o *InitClient) GetFlags(flags map[string]string) map[string]string {\n\tinitFlags := map[string]string{}\nouter:\n\tfor flag, value := range flags {\n\t\tfor _, f := range _initFlags {\n\t\t\tif flag == f {\n\t\t\t\tinitFlags[flag] = value\n\t\t\t\tcontinue outer\n\t\t\t}\n\t\t}\n\t}\n\treturn initFlags\n}", "title": "" }, { "docid": "3aa90e2e832394cc55ef58ad8ee9580c", "score": "0.54084635", "text": "func (ds RLEDataStore) GetFlags() ColumnFlags {\n\treturn ds.Flags\n}", "title": "" }, { "docid": "7e47d7e1093d64107a5fc6095f1631ec", "score": "0.5394538", "text": "func getFlags() (Args, error) {\n\tvar args Args\n\tflag.IntVar(&args.Port, \"port\", -1, \"the port to serve on\")\n\tflag.IntVar(&args.Port, \"p\", -1, \"the port to serve on (shorthand)\")\n\tflag.StringVar(&args.TrafficOpsUri, \"uri\", \"\", \"the Traffic Ops URI\")\n\tflag.StringVar(&args.TrafficOpsUri, \"u\", \"\", \"the Traffic Ops URI (shorthand)\")\n\tflag.StringVar(&args.TrafficOpsUser, \"user\", \"\", \"the Traffic Ops username\")\n\tflag.StringVar(&args.TrafficOpsUser, \"U\", \"\", \"the Traffic Ops username (shorthand)\")\n\tflag.StringVar(&args.TrafficOpsPass, \"Pass\", \"\", \"the Traffic Ops password\")\n\tflag.StringVar(&args.TrafficOpsPass, \"P\", \"\", \"the Traffic Ops password (shorthand)\")\n\tflag.Parse()\n\tif args.Port == -1 {\n\t\treturn args, errors.New(\"Missing port\")\n\t}\n\tif args.Port < 0 || args.Port > 65535 {\n\t\treturn args, errors.New(\"Invalid port\")\n\t}\n\tif args.TrafficOpsUri == \"\" {\n\t\treturn args, errors.New(\"Missing CDN URI\")\n\t}\n\tif args.TrafficOpsUser == \"\" {\n\t\treturn args, errors.New(\"Missing CDN user\")\n\t}\n\tif args.TrafficOpsPass == \"\" {\n\t\treturn args, errors.New(\"Missing CDN password\")\n\t}\n\treturn args, nil\n}", "title": "" }, { "docid": "6e94eff48d5c70dd9707a7c9090da128", "score": "0.53731763", "text": "func getFlags() *flag.FlagSet {\r\n\tflags := flag.NewFlagSet(\"flags\", flag.ContinueOnError)\r\n\tflags.Usage = func() {\r\n\t\tusageName := filepath.Base(os.Args[0])\r\n\t\tfmt.Printf(usage, usageName, version)\r\n\t}\r\n\tflags.StringVar(&port, \"port\", \"80\", \"\")\r\n\tflags.StringVar(&port, \"p\", \"80\", \"\")\r\n\tflags.StringVar(&host, \"host\", \"0.0.0.0\", \"\")\r\n\tflags.StringVar(&index, \"index\", \"\", \"\")\r\n\tflags.StringVar(&index, \"i\", \"\", \"\")\r\n\tflags.BoolVar(&noList, \"no-list\", false, \"\")\r\n\tflags.BoolVar(&verbose, \"verbose\", true, \"\")\r\n\tflags.BoolVar(&verbose, \"v\", true, \"\")\r\n\terr := flags.Parse(os.Args[1:])\r\n\tif err == flag.ErrHelp {\r\n\t\tos.Exit(0)\r\n\t}\r\n\tif err != nil {\r\n\t\tos.Exit(1)\r\n\t}\r\n\treturn flags\r\n}", "title": "" }, { "docid": "aa43def455cea7139d3e78eff72b0bdc", "score": "0.53703755", "text": "func getFlagsForStack() []cli.Flag {\n\tflags := getFlagsForQuery()\n\tfor i := 0; i < len(flags); i++ {\n\t\tif flags[i].GetName() == FlagQueryTypeWithAlias {\n\t\t\treturn append(flags[:i], flags[i+1:]...)\n\t\t}\n\t}\n\treturn flags\n}", "title": "" }, { "docid": "37f0c4c8fc0882637d3d277544591cbf", "score": "0.5365627", "text": "func Ldflags(flags ...string) string {\n\treturn strings.Join(flags, \" \")\n}", "title": "" }, { "docid": "b929c1d23a307079a1f7402e9312a0db", "score": "0.5360111", "text": "func (app *App) GetFeatureFlags(params features.GetFeatureFlagsParams) middleware.Responder {\n\tfeaturesClient, err := featuresclient.New(app.AppConfig.TKGConfigDir, \"\")\n\tif err != nil {\n\t\treturn features.NewGetFeatureFlagsInternalServerError().WithPayload(Err(errors.Wrap(err, \"unable to get feature flags client\")))\n\t}\n\n\tfeatureFlags, err := featuresClient.GetFeatureFlags()\n\tif err != nil {\n\t\treturn features.NewGetFeatureFlagsInternalServerError().WithPayload(Err(errors.Wrap(err, \"unable to get feature flags\")))\n\t}\n\n\treturn features.NewGetFeatureFlagsOK().WithPayload(featureFlags)\n}", "title": "" }, { "docid": "9570dda617fe652f58b8e14d4f682e2c", "score": "0.530962", "text": "func GetFlags() ([]Flag, error) {\n\tvar fs []Flag\n\t_, err := dbmap.Select(&fs, \"select * from flag order by id asc\")\n\treturn fs, err\n}", "title": "" }, { "docid": "788fb075a1dba5167b384e71c91a4b92", "score": "0.52405864", "text": "func (Help) InitFlags() {}", "title": "" }, { "docid": "1e19646feac5579f9f0d3aac89a48353", "score": "0.5236916", "text": "func getOptsByConfig(c core.CryptoSuiteConfig) *server.Opts {\n\topts := &server.Opts{\n\t\tSecLevel: c.SecurityLevel(),\n\t\tHashFamily: c.SecurityAlgorithm(),\n\t\tDefaultOpts: \"hbca\",\n\t\tHBCA: &server.HBCAOpts{\n\t\t\tWSDLServer: c.SecurityWSDLServer(),\n\t\t\tCertID: c.SecurityCertID(),\n\t\t\tAppKey: c.SecurityAppKey(),\n\t\t\tAppSecret: c.SecurityAppSecret(),\n\t\t},\n\t}\n\n\tlogger.Info(\"Initialized server cryptosuite\")\n\n\treturn opts\n}", "title": "" }, { "docid": "f6da9001951b9a899164f215b07e5083", "score": "0.52297205", "text": "func Flags() int { return std.Flags() }", "title": "" }, { "docid": "090b6a92c2bc6cc3b7610b2bd1f8a56f", "score": "0.52130467", "text": "func (c *Configurer) CheckFlags(fs *flag.FlagSet, cc *config.Config) error { return nil }", "title": "" }, { "docid": "737b0abeb2712888d13714bd67b9ee8e", "score": "0.52006835", "text": "func (E_OpenconfigIsis_Lsp_Flags) IsYANGGoEnum() {}", "title": "" }, { "docid": "737b0abeb2712888d13714bd67b9ee8e", "score": "0.52006245", "text": "func (E_OpenconfigIsis_Lsp_Flags) IsYANGGoEnum() {}", "title": "" }, { "docid": "8649ae174530968de2fbc4058aae5638", "score": "0.51983774", "text": "func (c *Config) Flags() []cli.Flag {\n\tret := []cli.Flag{\n\t\tcli.IntFlag{\n\t\t\tName: \"port, p\",\n\t\t\tUsage: \"the port you'd like to run the service on\",\n\t\t\tDestination: &c.Port,\n\t\t\tValue: DefaultPort,\n\t\t},\n\t\tcli.StringFlag{\n\t\t\tName: \"aws-access-key-id\",\n\t\t\tEnvVar: \"AWS_ACCESS_KEY_ID\",\n\t\t\tUsage: \"the AWS access key to sign requests with\",\n\t\t\tDestination: &c.AWSAccessKeyID,\n\t\t},\n\t\tcli.StringFlag{\n\t\t\tName: \"aws-secret-key\",\n\t\t\tEnvVar: \"AWS_SECRET_ACCESS_KEY\",\n\t\t\tUsage: \"the AWS secret key to sign requests with\",\n\t\t\tDestination: &c.AWSSecretKey,\n\t\t},\n\t\tcli.StringFlag{\n\t\t\tName: \"aws-region\",\n\t\t\tEnvVar: \"AWS_REGION\",\n\t\t\tUsage: \"the AWS region to connect to\",\n\t\t\tDestination: &c.AWSRegion,\n\t\t},\n\t\tcli.StringFlag{\n\t\t\tName: \"master-key\",\n\t\t\tEnvVar: \"MASTER_KEY\",\n\t\t\tUsage: \"the master key that will be required in the header for Creates and Deletes on contenders\",\n\t\t\tDestination: &c.MasterKey,\n\t\t\tValue: DefaultMasterKey,\n\t\t},\n\t\tcli.StringFlag{\n\t\t\tName: \"log-level\",\n\t\t\tEnvVar: \"LOG_LEVEL\",\n\t\t\tUsage: \"the log level that wouldyoutatter should log to stdout at, defaults to INFO\",\n\t\t\tDestination: &c.LogLevel,\n\t\t\tValue: DefaultLogLevel,\n\t\t},\n\t\tcli.DurationFlag{\n\t\t\tName: \"api-read-timeout\",\n\t\t\tEnvVar: \"API_READ_TIMEOUT\",\n\t\t\tUsage: \"the server's HTTP read timeout\",\n\t\t\tDestination: &c.APIReadTimeout,\n\t\t\tValue: time.Second * 30,\n\t\t},\n\t\tcli.DurationFlag{\n\t\t\tName: \"api-write-timeout\",\n\t\t\tEnvVar: \"API_WRITE_TIMEOUT\",\n\t\t\tUsage: \"the server's HTTP write timeout\",\n\t\t\tDestination: &c.APIWriteTimeout,\n\t\t\tValue: time.Second * 30,\n\t\t},\n\t}\n\t// initialize configs\n\tc.ContenderTableConfig = &dynamostore.TableConfig{}\n\tc.MatchupTableConfig = &dynamostore.TableConfig{}\n\tc.UserMatchupsTableConfig = &dynamostore.TableConfig{}\n\tc.MasterMatchupsTableConfig = &dynamostore.TableConfig{}\n\tc.TokenTableConfig = &dynamostore.TableConfig{}\n\n\tret = append(ret, c.ContenderTableConfig.Flags(\"contender\", DefaultContenderTableName)...)\n\tret = append(ret, c.MatchupTableConfig.Flags(\"matchup\", DefaultMatchupTableName)...)\n\tret = append(ret, c.UserMatchupsTableConfig.Flags(\"user-matchups\", DefaultUserMatchupsTableName)...)\n\tret = append(ret, c.MasterMatchupsTableConfig.Flags(\"master-matchups\", DefaultMasterMatchupsTableName)...)\n\tret = append(ret, c.TokenTableConfig.Flags(\"token\", DefaultTokenTableName)...)\n\treturn ret\n}", "title": "" }, { "docid": "4fbce3f3509d11b966c0f7a18b25ccf4", "score": "0.5182562", "text": "func LoadFeatureFlags() (ff string) {\n\t// Local feature flags.\n\t{\n\t\t// Read feature flags from the environment.\n\t\tfeatureflag.Set(os.Getenv(featureflag.EnvVar))\n\t\tlogger.Debug(\"ocean: loaded feature flags: %s\", featureflag.All())\n\t}\n\n\t// Upstream feature flags.\n\t{\n\t\t// Avoid `Parameters: [SpotFeatureFlags] must have values` errors.\n\t\tff = \"None\"\n\n\t\t// Credentials changes.\n\t\tif AllowCredentialsChanges.Enabled() {\n\t\t\t// When the user allows credentials changes, we have to configure the\n\t\t\t// opposite feature flag for the resource handler to avoid unnecessary\n\t\t\t// calls caused by updating the AWS CloudFormation stack parameters.\n\t\t\tff = \"IgnoreCredentialsChanges=true\"\n\t\t}\n\n\t\tlogger.Debug(\"ocean: configuring resource handler's feature flags: %s\", ff)\n\t}\n\n\treturn ff\n}", "title": "" }, { "docid": "91cba2dc82b24cfc07120cc5f92541ef", "score": "0.5181509", "text": "func GetFlags() FlagSet {\n\treturn FlagSet{\n\t\tDefaultLevel: flag.String(\n\t\t\t\"log.default-level\",\n\t\t\t\"info\",\n\t\t\t\"Default log level\"),\n\n\t\tChannelConfig: flag.String(\n\t\t\t\"log.filters\",\n\t\t\t\"\",\n\t\t\t\"Per-channel log level configuration\"),\n\n\t\tChannelHeaderLen: flag.Int(\n\t\t\t\"log.chan-header-len\",\n\t\t\t5,\n\t\t\t\"Maximum length for log channel strings in the header\"),\n\n\t\tEnableGID: flag.Bool(\n\t\t\t\"log.goroutine-id\",\n\t\t\tfalse,\n\t\t\t\"Log the numerica ID of the goroutine in the header\"),\n\n\t\tEnableFuncSig: flag.Bool(\n\t\t\t\"log.function-signature\",\n\t\t\tfalse,\n\t\t\t\"Log the full function signature for trace logging\"),\n\n\t\tDisableIndent: flag.Bool(\n\t\t\t\"log.no-indent\",\n\t\t\tfalse,\n\t\t\t\"Disable indentation\"),\n\n\t\tServiceName: flag.String(\n\t\t\t\"log.service-name\",\n\t\t\t\"\",\n\t\t\t\"Set a service name to display with each log line\"),\n\n\t\tOutputJSON: flag.Bool(\n\t\t\t\"log.output-json\",\n\t\t\tfalse,\n\t\t\t\"Output log lines as structured JSON rather than plain text\"),\n\t}\n}", "title": "" }, { "docid": "4339e542f128b4482a84a5b979d49ac5", "score": "0.51620275", "text": "func (s *ConfigRPCServer) Flags(args interface{}, resp *[]Flag) error {\n\treturn Flags(s.Impl, resp)\n}", "title": "" }, { "docid": "dd7e9ef98f933c8223af1bf60b16f691", "score": "0.5133187", "text": "func getAuthLookupFlags(params *v1_auth.AuthLookupParams) []cli.Flag {\n\treturn []cli.Flag{\n\t\t&cli.GenericFlag{\n\t\t\tName: \"id\",\n\t\t\tUsage: \"The ID of the authorization\",\n\t\t\tValue: &params.ID,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"username\",\n\t\t\tUsage: \"The username of the authorization\",\n\t\t\tDestination: &params.Username,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "b19dd25fa7171bea4502a5c45edb128b", "score": "0.51216507", "text": "func getTLSFlags(r *release) string {\n\ttls := \"\"\n\tns := s.Namespaces[r.TillerNamespace]\n\tif r.TillerNamespace != \"\" {\n\t\tif tillerTLSEnabled(ns) {\n\n\t\t\ttls = \" --tls --tls-ca-cert \" + r.TillerNamespace + \"-ca.cert --tls-cert \" + r.TillerNamespace + \"-client.cert --tls-key \" + r.TillerNamespace + \"-client.key \"\n\t\t}\n\t} else if s.Namespaces[r.Namespace].InstallTiller {\n\t\tns := s.Namespaces[r.Namespace]\n\t\tif tillerTLSEnabled(ns) {\n\n\t\t\ttls = \" --tls --tls-ca-cert \" + r.Namespace + \"-ca.cert --tls-cert \" + r.Namespace + \"-client.cert --tls-key \" + r.Namespace + \"-client.key \"\n\t\t}\n\t} else {\n\t\tns := s.Namespaces[\"kube-system\"]\n\t\tif tillerTLSEnabled(ns) {\n\n\t\t\ttls = \" --tls --tls-ca-cert kube-system-ca.cert --tls-cert kube-system-client.cert --tls-key kube-system-client.key \"\n\t\t}\n\t}\n\n\treturn tls\n}", "title": "" }, { "docid": "23cc10d50a7fc3abf95a720af1f63e6c", "score": "0.507212", "text": "func (w *kv) Flags() workload.Flags { return w.flags }", "title": "" }, { "docid": "6e6a92d6773bcedfdb17543f30e058b4", "score": "0.5062798", "text": "func (w *tpcds) Flags() workload.Flags { return w.flags }", "title": "" }, { "docid": "ef18bfc0574d975f0d451667f556f345", "score": "0.50394356", "text": "func retrieveModelConfigurationFlags(depth int, m *models.Configuration, cmdPrefix string, cmd *cobra.Command) (error, bool) {\n\tretAdded := false\n\n\terr, passwordAdded := retrieveConfigurationPasswordFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || passwordAdded\n\n\terr, ssidAdded := retrieveConfigurationSsidFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || ssidAdded\n\n\treturn nil, retAdded\n}", "title": "" }, { "docid": "aad3862089c6f89c7cd338c5d528cbd4", "score": "0.50314903", "text": "func X__fmodeflags(tls TLS, _mode uintptr /* *int8 */) (r int32) {\n\tvar _flags int32\n\n\tif Xstrchr(tls, _mode, int32('+')) == 0 {\n\t\tgoto _1\n\t}\n\n\t_flags = int32(02)\n\tgoto _2\n\n_1:\n\tif !(int32(*(*int8)(unsafe.Pointer(_mode))) == int32('r')) {\n\t\tgoto _3\n\t}\n\n\t_flags = int32(0)\n\tgoto _4\n\n_3:\n\t_flags = int32(01)\n_4:\n_2:\n\tif Xstrchr(tls, _mode, int32('x')) == 0 {\n\t\tgoto _5\n\t}\n\n\t_flags = _flags | int32(0200)\n_5:\n\tif Xstrchr(tls, _mode, int32('e')) == 0 {\n\t\tgoto _6\n\t}\n\n\t_flags = _flags | int32(02000000)\n_6:\n\tif !(int32(*(*int8)(unsafe.Pointer(_mode))) != int32('r')) {\n\t\tgoto _7\n\t}\n\n\t_flags = _flags | int32(0100)\n_7:\n\tif !(int32(*(*int8)(unsafe.Pointer(_mode))) == int32('w')) {\n\t\tgoto _8\n\t}\n\n\t_flags = _flags | int32(01000)\n_8:\n\tif !(int32(*(*int8)(unsafe.Pointer(_mode))) == int32('a')) {\n\t\tgoto _9\n\t}\n\n\t_flags = _flags | int32(02000)\n_9:\n\treturn _flags\n}", "title": "" }, { "docid": "61ed2fe012c4233e2517825d960797f1", "score": "0.5029037", "text": "func getOptsByConfig(c core.CryptoSuiteConfig) *bccspSw.SwOpts {\n\t// TODO: delete this check\n\tif c.SecurityProvider() != \"SW\" {\n\t\tpanic(fmt.Sprintf(\"Unsupported BCCSP Provider: %s\", c.SecurityProvider()))\n\t}\n\n\topts := &bccspSw.SwOpts{\n\t\tHashFamily: c.SecurityAlgorithm(),\n\t\tSecLevel: c.SecurityLevel(),\n\t\tFileKeystore: &bccspSw.FileKeystoreOpts{\n\t\t\tKeyStorePath: c.KeyStorePath(),\n\t\t},\n\t}\n\n\treturn opts\n}", "title": "" }, { "docid": "8e2fb0f2b2eb296bb156460800e535c2", "score": "0.50231105", "text": "func GetFlags() Flags {\n\treturn Flags{\n\t\tflag.String(\"json\", \"\",\n\t\t\t\"relative path to the FIDL intermediate representation.\"),\n\t\tflag.String(\"amend\", \"\",\n\t\t\t\"relative path to FIDL amendments file.\"),\n\t\tflag.String(\"template\", \"\",\n\t\t\t\"relative path to the template.\"),\n\t\tflag.String(\"output-base\", \"\",\n\t\t\t\"the base file name for files generated by this generator.\"),\n\t}\n}", "title": "" }, { "docid": "a71c2b3728834edfe1a07d6952d276ae", "score": "0.5019082", "text": "func (b *BoltDB) ListFlags(req FlagRequest) (res []interface{}, err error) {\n\tbdb, e := b.db(req.Locator.SiteID)\n\tif e != nil {\n\t\treturn nil, e\n\t}\n\n\tres = []interface{}{}\n\tswitch req.Flag {\n\tcase Verified:\n\t\terr = bdb.View(func(tx *bolt.Tx) error {\n\t\t\tusersBkt := tx.Bucket([]byte(verifiedBucketName))\n\t\t\t_ = usersBkt.ForEach(func(k, _ []byte) error {\n\t\t\t\tres = append(res, string(k))\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\treturn nil\n\t\t})\n\t\treturn res, err\n\tcase Blocked:\n\t\terr = bdb.View(func(tx *bolt.Tx) error {\n\t\t\tbucket := tx.Bucket([]byte(blocksBucketName))\n\t\t\treturn bucket.ForEach(func(k []byte, v []byte) error {\n\t\t\t\tts, errParse := time.ParseInLocation(tsNano, string(v), time.Local)\n\t\t\t\tif errParse != nil {\n\t\t\t\t\treturn fmt.Errorf(\"can't parse block ts: %w\", errParse)\n\t\t\t\t}\n\t\t\t\tif time.Now().Before(ts) {\n\t\t\t\t\t// get user name from comment user section\n\t\t\t\t\tuserName := \"\"\n\t\t\t\t\tfindReq := FindRequest{Locator: store.Locator{SiteID: req.Locator.SiteID}, UserID: string(k), Limit: 1}\n\t\t\t\t\tuserComments, errUser := b.Find(findReq)\n\t\t\t\t\tif errUser == nil && len(userComments) > 0 {\n\t\t\t\t\t\tuserName = userComments[0].User.Name\n\t\t\t\t\t}\n\t\t\t\t\tres = append(res, store.BlockedUser{ID: string(k), Name: userName, Until: ts})\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t})\n\t\treturn res, err\n\t}\n\treturn nil, fmt.Errorf(\"flag %s not listable\", req.Flag)\n}", "title": "" }, { "docid": "affb45c11dceca7e7465974a67ace757", "score": "0.501217", "text": "func (d *Driver) GetCreateFlags() []mcnflag.Flag {\n\treturn []mcnflag.Flag{\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_USERNAME\",\n\t\t\tName: \"ovh-username\",\n\t\t\tUsage: \"OVH Cloud username\",\n\t\t\tValue: \"\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_PASSWORD\",\n\t\t\tName: \"ovh-password\",\n\t\t\tUsage: \"OVH Cloud password\",\n\t\t\tValue: \"\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_TENANT_NAME\",\n\t\t\tName: \"ovh-tenant-name\",\n\t\t\tUsage: \"OVH Cloud project name\",\n\t\t\tValue: \"\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_TENANT_ID\",\n\t\t\tName: \"ovh-tenant-id\",\n\t\t\tUsage: \"OVH Cloud project id\",\n\t\t\tValue: \"\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_REGION_NAME\",\n\t\t\tName: \"ovh-region\",\n\t\t\tUsage: \"OVH Cloud region name\",\n\t\t\tValue: defaultRegionName,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_FLAVOR_NAME\",\n\t\t\tName: \"ovh-flavor\",\n\t\t\tUsage: \"OVH Cloud flavor name. Default: VPS SSD 2GB\",\n\t\t\tValue: defaultFlavorName,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"OS_SECURITY_GROUPS\",\n\t\t\tName: \"ovh-sec-groups\",\n\t\t\tUsage: \"OVH Cloud comma separated security groups for the machine\",\n\t\t\tValue: defaultSecurityGroup,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "de05ce76ee7be3fb93d733b927cf5f3b", "score": "0.49972248", "text": "func (m Message) GetFlags() (flags []Flag) {\n\ts := m.Filepath()\n\tif strings.Count(s, \":2,\") == 1 {\n\t\t// we have flags\n\t\tf := strings.Split(s, \",\")[1]\n\t\tfor _, fl := range f {\n\t\t\tflags = append(flags, Flag(fl))\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "5f06cf187a75dae9c54c2e56fe6ec7f9", "score": "0.49932015", "text": "func (d *Driver) GetCreateFlags() []mcnflag.Flag {\n\treturn []mcnflag.Flag{\n\t\tmcnflag.IntFlag{\n\t\t\tEnvVar: \"VSPHERE_CPU_COUNT\",\n\t\t\tName: \"vmwarevsphere-cpu-count\",\n\t\t\tUsage: \"vSphere CPU number for docker VM\",\n\t\t\tValue: defaultCpus,\n\t\t},\n\t\tmcnflag.IntFlag{\n\t\t\tEnvVar: \"VSPHERE_MEMORY_SIZE\",\n\t\t\tName: \"vmwarevsphere-memory-size\",\n\t\t\tUsage: \"vSphere size of memory for docker VM (in MB)\",\n\t\t\tValue: defaultMemory,\n\t\t},\n\t\tmcnflag.IntFlag{\n\t\t\tEnvVar: \"VSPHERE_DISK_SIZE\",\n\t\t\tName: \"vmwarevsphere-disk-size\",\n\t\t\tUsage: \"vSphere size of disk for docker VM (in MB)\",\n\t\t\tValue: defaultDiskSize,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_BOOT2DOCKER_URL\",\n\t\t\tName: \"vmwarevsphere-boot2docker-url\",\n\t\t\tUsage: \"vSphere URL for boot2docker image\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_VCENTER\",\n\t\t\tName: \"vmwarevsphere-vcenter\",\n\t\t\tUsage: \"vSphere IP/hostname for vCenter\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_USERNAME\",\n\t\t\tName: \"vmwarevsphere-username\",\n\t\t\tUsage: \"vSphere username\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_PASSWORD\",\n\t\t\tName: \"vmwarevsphere-password\",\n\t\t\tUsage: \"vSphere password\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_NETWORK\",\n\t\t\tName: \"vmwarevsphere-network\",\n\t\t\tUsage: \"vSphere network where the docker VM will be attached\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_DATASTORE\",\n\t\t\tName: \"vmwarevsphere-datastore\",\n\t\t\tUsage: \"vSphere datastore for docker VM\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_DATACENTER\",\n\t\t\tName: \"vmwarevsphere-datacenter\",\n\t\t\tUsage: \"vSphere datacenter for docker VM\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_POOL\",\n\t\t\tName: \"vmwarevsphere-pool\",\n\t\t\tUsage: \"vSphere resource pool for docker VM\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"VSPHERE_COMPUTE_IP\",\n\t\t\tName: \"vmwarevsphere-compute-ip\",\n\t\t\tUsage: \"vSphere compute host IP where the docker VM will be instantiated\",\n\t\t},\n\t}\n}", "title": "" }, { "docid": "c4f88670c617033234c42df5121d9fea", "score": "0.49726355", "text": "func (l *Logger) Flags() int {\n\treturn l.l.Flags()\n}", "title": "" }, { "docid": "be66bca8098d537281c103efea82593d", "score": "0.4969485", "text": "func GetCreateFlags() []cli.Flag {\n\treturn []cli.Flag{\n\t\tcli.IntFlag{\n\t\t\tEnvVar: \"PARALLELS_MEMORY_SIZE\",\n\t\t\tName: \"parallels-memory\",\n\t\t\tUsage: \"Size of memory for host in MB\",\n\t\t\tValue: 1024,\n\t\t},\n\t\tcli.IntFlag{\n\t\t\tEnvVar: \"PARALLELS_CPU_COUNT\",\n\t\t\tName: \"parallels-cpu-count\",\n\t\t\tUsage: \"number of CPUs for the machine (-1 to use the number of CPUs available)\",\n\t\t\tValue: 1,\n\t\t},\n\t\tcli.IntFlag{\n\t\t\tEnvVar: \"PARALLELS_DISK_SIZE\",\n\t\t\tName: \"parallels-disk-size\",\n\t\t\tUsage: \"Size of disk for host in MB\",\n\t\t\tValue: 20000,\n\t\t},\n\t\tcli.StringFlag{\n\t\t\tEnvVar: \"PARALLELS_BOOT2DOCKER_URL\",\n\t\t\tName: \"parallels-boot2docker-url\",\n\t\t\tUsage: \"The URL of the boot2docker image. Defaults to the latest available version\",\n\t\t\tValue: \"\",\n\t\t},\n\t}\n}", "title": "" }, { "docid": "6bcb1179e23d32f213bb3859505c8e1a", "score": "0.4967186", "text": "func (mock *MockOVNClient) LSGet(ls string) ([]*goovn.LogicalSwitch, error) {\n\tmock.mutex.Lock()\n\tdefer mock.mutex.Unlock()\n\tvar lsCache MockObjectCacheByName\n\tvar ok bool\n\tif lsCache, ok = mock.cache[LogicalSwitchType]; !ok {\n\t\tklog.V(5).Infof(\"Cache doesn't have any object of type %s\", LogicalSwitchType)\n\t\treturn nil, goovn.ErrorSchema\n\t}\n\tvar lswitch interface{}\n\tif lswitch, ok = lsCache[ls]; !ok {\n\t\treturn nil, goovn.ErrorNotFound\n\t}\n\tlswitch, err := copystructure.Copy(lswitch)\n\tif err != nil {\n\t\tpanic(err) // should never happen\n\t}\n\n\tif lsRet, ok := lswitch.(*goovn.LogicalSwitch); ok {\n\t\treturn []*goovn.LogicalSwitch{lsRet}, nil\n\t}\n\treturn nil, fmt.Errorf(\"invalid object type assertion for %s\", LogicalSwitchType)\n\n}", "title": "" }, { "docid": "c3d6c93869008aa4d08fbc7a113a5f42", "score": "0.49637043", "text": "func PathsFromSelectFlagsForGateway_LRFHSS(flags *pflag.FlagSet, prefix string) (paths []string, err error) {\n\tif val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix(\"supported\", prefix)); err != nil {\n\t\treturn nil, err\n\t} else if selected && val {\n\t\tpaths = append(paths, flagsplugin.Prefix(\"supported\", prefix))\n\t}\n\treturn paths, nil\n}", "title": "" }, { "docid": "771eaf9dd44736340e7f24f190bd863b", "score": "0.49612004", "text": "func (a *TargetGroupsApiService) GetSegmentFlags(ctx context.Context, accountIdentifier string, orgIdentifier string, identifier string, projectIdentifier string, environmentIdentifier string) ([]SegmentFlag, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Get\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue []SegmentFlag\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/cf/admin/segments/{identifier}/flags\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"identifier\"+\"}\", fmt.Sprintf(\"%v\", identifier), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\tlocalVarQueryParams.Add(\"accountIdentifier\", parameterToString(accountIdentifier, \"\"))\n\tlocalVarQueryParams.Add(\"orgIdentifier\", parameterToString(orgIdentifier, \"\"))\n\tlocalVarQueryParams.Add(\"projectIdentifier\", parameterToString(projectIdentifier, \"\"))\n\tlocalVarQueryParams.Add(\"environmentIdentifier\", parameterToString(environmentIdentifier, \"\"))\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\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"x-api-key\"] = key\n\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 := GenericSwaggerError{\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 []SegmentFlag\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\tif localVarHttpResponse.StatusCode == 401 {\n\t\t\tvar v CfError\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\tif localVarHttpResponse.StatusCode == 403 {\n\t\t\tvar v CfError\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\tif localVarHttpResponse.StatusCode == 404 {\n\t\t\tvar v CfError\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t}\n\t\tif localVarHttpResponse.StatusCode == 500 {\n\t\t\tvar v CfError\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\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": "c52faee396367f030a66819cdd7b468c", "score": "0.49514502", "text": "func getStaticFeatureConfig() []CustomRule {\n\treturn []CustomRule{\n\t\t{\n\t\t\tLegacyRule: &LegacyRule{\n\t\t\t\tName: \"rdma.capable\",\n\t\t\t\tMatchOn: []LegacyMatcher{\n\t\t\t\t\t{\n\t\t\t\t\t\tPciID: &rules.PciIDRule{\n\t\t\t\t\t\t\tMatchExpressionSet: nfdv1alpha1.MatchExpressionSet{\n\t\t\t\t\t\t\t\t\"vendor\": nfdv1alpha1.MustCreateMatchExpression(nfdv1alpha1.MatchIn, \"15b3\"),\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\t{\n\t\t\tLegacyRule: &LegacyRule{\n\t\t\t\tName: \"rdma.available\",\n\t\t\t\tMatchOn: []LegacyMatcher{\n\t\t\t\t\t{\n\t\t\t\t\t\tLoadedKMod: &rules.LoadedKModRule{\n\t\t\t\t\t\t\tMatchExpressionSet: nfdv1alpha1.MatchExpressionSet{\n\t\t\t\t\t\t\t\t\"ib_uverbs\": nfdv1alpha1.MustCreateMatchExpression(nfdv1alpha1.MatchExists),\n\t\t\t\t\t\t\t\t\"rdma_ucm\": nfdv1alpha1.MustCreateMatchExpression(nfdv1alpha1.MatchExists),\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": "53fd2b7572d50cc9bb98270ac6b4e2af", "score": "0.49458063", "text": "func (context *AptlifyContext) GlobalFlags() *flag.FlagSet {\n\treturn context.globalFlags\n}", "title": "" }, { "docid": "bbc46e94099d4141c284035ad6c1815a", "score": "0.49357724", "text": "func (compiler *baseCompiler) flags(ctx ModuleContext, flags Flags) Flags {\n\ttoolchain := ctx.toolchain()\n\n\tflags.CFlags = append(flags.CFlags, compiler.Properties.Cflags...)\n\tflags.CppFlags = append(flags.CppFlags, compiler.Properties.Cppflags...)\n\tflags.ConlyFlags = append(flags.ConlyFlags, compiler.Properties.Conlyflags...)\n\tflags.AsFlags = append(flags.AsFlags, compiler.Properties.Asflags...)\n\tflags.YaccFlags = append(flags.YaccFlags, compiler.Properties.Yaccflags...)\n\n\t// Include dir cflags\n\trootIncludeDirs := common.PathsForSource(ctx, compiler.Properties.Include_dirs)\n\tlocalIncludeDirs := common.PathsForModuleSrc(ctx, compiler.Properties.Local_include_dirs)\n\tflags.GlobalFlags = append(flags.GlobalFlags,\n\t\tincludeDirsToFlags(localIncludeDirs),\n\t\tincludeDirsToFlags(rootIncludeDirs))\n\n\trootIncludeFiles := common.PathsForSource(ctx, compiler.Properties.Include_files)\n\tlocalIncludeFiles := common.PathsForModuleSrc(ctx, compiler.Properties.Local_include_files)\n\n\tflags.GlobalFlags = append(flags.GlobalFlags,\n\t\tincludeFilesToFlags(rootIncludeFiles),\n\t\tincludeFilesToFlags(localIncludeFiles))\n\n\tif !ctx.noDefaultCompilerFlags() {\n\t\tif !ctx.sdk() || ctx.Host() {\n\t\t\tflags.GlobalFlags = append(flags.GlobalFlags,\n\t\t\t\t\"${commonGlobalIncludes}\",\n\t\t\t\ttoolchain.IncludeFlags(),\n\t\t\t\t\"${commonNativehelperInclude}\")\n\t\t}\n\n\t\tflags.GlobalFlags = append(flags.GlobalFlags, []string{\n\t\t\t\"-I\" + common.PathForModuleSrc(ctx).String(),\n\t\t\t\"-I\" + common.PathForModuleOut(ctx).String(),\n\t\t\t\"-I\" + common.PathForModuleGen(ctx).String(),\n\t\t}...)\n\t}\n\n\tinstructionSet := compiler.Properties.Instruction_set\n\tif flags.RequiredInstructionSet != \"\" {\n\t\tinstructionSet = flags.RequiredInstructionSet\n\t}\n\tinstructionSetFlags, err := toolchain.InstructionSetFlags(instructionSet)\n\tif flags.Clang {\n\t\tinstructionSetFlags, err = toolchain.ClangInstructionSetFlags(instructionSet)\n\t}\n\tif err != nil {\n\t\tctx.ModuleErrorf(\"%s\", err)\n\t}\n\n\t// TODO: debug\n\tflags.CFlags = append(flags.CFlags, compiler.Properties.Release.Cflags...)\n\n\tif flags.Clang {\n\t\tflags.CFlags = clangFilterUnknownCflags(flags.CFlags)\n\t\tflags.CFlags = append(flags.CFlags, compiler.Properties.Clang_cflags...)\n\t\tflags.AsFlags = append(flags.AsFlags, compiler.Properties.Clang_asflags...)\n\t\tflags.CppFlags = clangFilterUnknownCflags(flags.CppFlags)\n\t\tflags.ConlyFlags = clangFilterUnknownCflags(flags.ConlyFlags)\n\t\tflags.LdFlags = clangFilterUnknownCflags(flags.LdFlags)\n\n\t\ttarget := \"-target \" + toolchain.ClangTriple()\n\t\tgccPrefix := \"-B\" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), \"bin\")\n\n\t\tflags.CFlags = append(flags.CFlags, target, gccPrefix)\n\t\tflags.AsFlags = append(flags.AsFlags, target, gccPrefix)\n\t\tflags.LdFlags = append(flags.LdFlags, target, gccPrefix)\n\t}\n\n\tif !ctx.noDefaultCompilerFlags() {\n\t\tflags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags)\n\n\t\tif flags.Clang {\n\t\t\tflags.AsFlags = append(flags.AsFlags, toolchain.ClangAsflags())\n\t\t\tflags.CppFlags = append(flags.CppFlags, \"${commonClangGlobalCppflags}\")\n\t\t\tflags.GlobalFlags = append(flags.GlobalFlags,\n\t\t\t\ttoolchain.ClangCflags(),\n\t\t\t\t\"${commonClangGlobalCflags}\",\n\t\t\t\tfmt.Sprintf(\"${%sClangGlobalCflags}\", ctx.HostOrDevice()))\n\n\t\t\tflags.ConlyFlags = append(flags.ConlyFlags, \"${clangExtraConlyflags}\")\n\t\t} else {\n\t\t\tflags.CppFlags = append(flags.CppFlags, \"${commonGlobalCppflags}\")\n\t\t\tflags.GlobalFlags = append(flags.GlobalFlags,\n\t\t\t\ttoolchain.Cflags(),\n\t\t\t\t\"${commonGlobalCflags}\",\n\t\t\t\tfmt.Sprintf(\"${%sGlobalCflags}\", ctx.HostOrDevice()))\n\t\t}\n\n\t\tif Bool(ctx.AConfig().ProductVariables.Brillo) {\n\t\t\tflags.GlobalFlags = append(flags.GlobalFlags, \"-D__BRILLO__\")\n\t\t}\n\n\t\tif ctx.Device() {\n\t\t\tif Bool(compiler.Properties.Rtti) {\n\t\t\t\tflags.CppFlags = append(flags.CppFlags, \"-frtti\")\n\t\t\t} else {\n\t\t\t\tflags.CppFlags = append(flags.CppFlags, \"-fno-rtti\")\n\t\t\t}\n\t\t}\n\n\t\tflags.AsFlags = append(flags.AsFlags, \"-D__ASSEMBLY__\")\n\n\t\tif flags.Clang {\n\t\t\tflags.CppFlags = append(flags.CppFlags, toolchain.ClangCppflags())\n\t\t} else {\n\t\t\tflags.CppFlags = append(flags.CppFlags, toolchain.Cppflags())\n\t\t}\n\t}\n\n\tif flags.Clang {\n\t\tflags.GlobalFlags = append(flags.GlobalFlags, toolchain.ToolchainClangCflags())\n\t} else {\n\t\tflags.GlobalFlags = append(flags.GlobalFlags, toolchain.ToolchainCflags())\n\t}\n\tflags.LdFlags = append(flags.LdFlags, toolchain.ToolchainLdflags())\n\n\tif !ctx.sdk() {\n\t\tif ctx.Host() && !flags.Clang {\n\t\t\t// The host GCC doesn't support C++14 (and is deprecated, so likely\n\t\t\t// never will). Build these modules with C++11.\n\t\t\tflags.CppFlags = append(flags.CppFlags, \"-std=gnu++11\")\n\t\t} else {\n\t\t\tflags.CppFlags = append(flags.CppFlags, \"-std=gnu++14\")\n\t\t}\n\t}\n\n\t// We can enforce some rules more strictly in the code we own. strict\n\t// indicates if this is code that we can be stricter with. If we have\n\t// rules that we want to apply to *our* code (but maybe can't for\n\t// vendor/device specific things), we could extend this to be a ternary\n\t// value.\n\tstrict := true\n\tif strings.HasPrefix(common.PathForModuleSrc(ctx).String(), \"external/\") {\n\t\tstrict = false\n\t}\n\n\t// Can be used to make some annotations stricter for code we can fix\n\t// (such as when we mark functions as deprecated).\n\tif strict {\n\t\tflags.CFlags = append(flags.CFlags, \"-DANDROID_STRICT\")\n\t}\n\n\treturn flags\n}", "title": "" }, { "docid": "87adbd2dc30a8cafa9c84513368b75ae", "score": "0.4931901", "text": "func getFlags(args []string) []string {\n\tif len(args) == 0 || len(args[0]) == 0 || args[0][0] == '-' {\n\t\treturn args\n\t} else {\n\t\treturn args[1:]\n\t}\n}", "title": "" }, { "docid": "4d2cc0a043535de213ffa90e22b15581", "score": "0.4906781", "text": "func InitFlags(flagset *flag.FlagSet) {\n\tif flagset == nil {\n\t\tflagset = flag.CommandLine\n\t}\n\n\tklogv2.InitFlags(flagset)\n\n\tvmoduleFlag := flagset.Lookup(\"vmodule\")\n\tvmoduleFlag.Value = &vmoduleValue{inner: vmoduleFlag.Value}\n}", "title": "" }, { "docid": "d7a6c260d9ae17b3c957bd6b91a5a7fe", "score": "0.49038538", "text": "func GetShowFlags() []cli.Flag {\n return []cli.Flag{\n cli.StringFlag{\n Name: \"user, u\",\n Usage: \"set api username\",\n EnvVar: \"USERNAME\",\n },\n cli.StringFlag{\n Name: \"key, k\",\n Usage: \"set api key\",\n EnvVar: \"APIKEY\",\n },\n cli.StringFlag{\n Name: \"region, r\",\n Usage: \"set api region\",\n EnvVar: \"REGION\",\n },\n cli.StringFlag{\n Name: \"uuid\",\n Usage: \"set uuid of snapshot to show details\",\n },\n }\n}", "title": "" }, { "docid": "97aeb65791b4abab132d8a5b6aca0566", "score": "0.48983857", "text": "func (o *LinkLinkinfoInfoData) GetFlags() []string {\n\tif o == nil || o.Flags == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.Flags\n}", "title": "" }, { "docid": "26458e1775a92042ac5ab8cb51a26be1", "score": "0.48948628", "text": "func (f *serverConfigFactory) configureFlagsInFlagSet(fs *flag.FlagSet) {\n\twd, _ := os.Getwd()\n\tfs.StringP(\n\t\tutils.PlatformServerFlagConstants[\"Hostname\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"Hostname\"][\"ShortFlag\"],\n\t\t\"localhost\",\n\t\tutils.PlatformServerFlagConstants[\"Hostname\"][\"Description\"])\n\tfs.IntP(\n\t\tutils.PlatformServerFlagConstants[\"Port\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"Port\"][\"ShortFlag\"],\n\t\t30080,\n\t\tutils.PlatformServerFlagConstants[\"Port\"][\"Description\"])\n\tfs.StringP(\n\t\tutils.PlatformServerFlagConstants[\"RootDir\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"RootDir\"][\"ShortFlag\"],\n\t\twd,\n\t\tutils.PlatformServerFlagConstants[\"RootDir\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"Cert\"][\"FlagName\"],\n\t\t\"\",\n\t\tutils.PlatformServerFlagConstants[\"Cert\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"CertKey\"][\"FlagName\"],\n\t\t\"\",\n\t\tutils.PlatformServerFlagConstants[\"CertKey\"][\"Description\"])\n\n\tfs.StringSliceVarP(\n\t\t&f.statics,\n\t\tutils.PlatformServerFlagConstants[\"Static\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"Static\"][\"ShortFlag\"],\n\t\t[]string{},\n\t\tutils.PlatformServerFlagConstants[\"Static\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"SpaPath\"][\"FlagName\"],\n\t\t\"\",\n\t\tutils.PlatformServerFlagConstants[\"SpaPath\"][\"Description\"])\n\tfs.Bool(\n\t\tutils.PlatformServerFlagConstants[\"NoFabricBroker\"][\"FlagName\"],\n\t\tfalse,\n\t\tutils.PlatformServerFlagConstants[\"NoFabricBroker\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"FabricEndpoint\"][\"FlagName\"],\n\t\t\"/ws\",\n\t\tutils.PlatformServerFlagConstants[\"FabricEndpoint\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"TopicPrefix\"][\"FlagName\"],\n\t\t\"/topic\",\n\t\tutils.PlatformServerFlagConstants[\"TopicPrefix\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"QueuePrefix\"][\"FlagName\"],\n\t\t\"/queue\",\n\t\tutils.PlatformServerFlagConstants[\"QueuePrefix\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"RequestPrefix\"][\"FlagName\"],\n\t\t\"/pub\",\n\t\tutils.PlatformServerFlagConstants[\"RequestPrefix\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"RequestQueuePrefix\"][\"FlagName\"],\n\t\t\"/pub/queue\",\n\t\tutils.PlatformServerFlagConstants[\"RequestQueuePrefix\"][\"Description\"])\n\tfs.String(\n\t\tutils.PlatformServerFlagConstants[\"ConfigFile\"][\"FlagName\"],\n\t\t\"\",\n\t\tutils.PlatformServerFlagConstants[\"ConfigFile\"][\"Description\"])\n\tfs.Int64(\n\t\tutils.PlatformServerFlagConstants[\"ShutdownTimeout\"][\"FlagName\"],\n\t\t5,\n\t\tutils.PlatformServerFlagConstants[\"ShutdownTimeout\"][\"Description\"])\n\tfs.StringP(\n\t\tutils.PlatformServerFlagConstants[\"OutputLog\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"OutputLog\"][\"ShortFlag\"],\n\t\t\"stdout\",\n\t\tutils.PlatformServerFlagConstants[\"OutputLog\"][\"Description\"])\n\tfs.StringP(\n\t\tutils.PlatformServerFlagConstants[\"AccessLog\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"AccessLog\"][\"ShortFlag\"],\n\t\t\"stdout\",\n\t\tutils.PlatformServerFlagConstants[\"AccessLog\"][\"Description\"])\n\tfs.StringP(\n\t\tutils.PlatformServerFlagConstants[\"ErrorLog\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"ErrorLog\"][\"ShortFlag\"],\n\t\t\"stderr\",\n\t\tutils.PlatformServerFlagConstants[\"ErrorLog\"][\"Description\"])\n\tfs.BoolP(\n\t\tutils.PlatformServerFlagConstants[\"Debug\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"Debug\"][\"ShortFlag\"],\n\t\tfalse,\n\t\tutils.PlatformServerFlagConstants[\"Debug\"][\"Description\"])\n\tfs.BoolP(\n\t\tutils.PlatformServerFlagConstants[\"NoBanner\"][\"FlagName\"],\n\t\tutils.PlatformServerFlagConstants[\"NoBanner\"][\"ShortFlag\"],\n\t\tfalse,\n\t\tutils.PlatformServerFlagConstants[\"NoBanner\"][\"Description\"])\n\tfs.Bool(\n\t\tutils.PlatformServerFlagConstants[\"Prometheus\"][\"FlagName\"],\n\t\tfalse,\n\t\tutils.PlatformServerFlagConstants[\"Prometheus\"][\"Description\"])\n\tfs.Int64(\n\t\tutils.PlatformServerFlagConstants[\"RestBridgeTimeout\"][\"FlagName\"],\n\t\t1,\n\t\tutils.PlatformServerFlagConstants[\"RestBridgeTimeout\"][\"Description\"])\n}", "title": "" }, { "docid": "be6eea19d42a0fc811a31b557cf3fb35", "score": "0.48888972", "text": "func FlagsUnpack(Ftflg uint8, verbose bool) *Flags {\n\tvar Fflags Flags\n\tFflags.Tsprec = (Ftflg>>0)&1 == 1\n\tFflags.Tcgram = (Ftflg>>1)&1 == 1\n\tFflags.Tmulti = (Ftflg>>2)&1 == 1\n\tFflags.Trandm = (Ftflg>>3)&1 == 1\n\tFflags.Tordrd = (Ftflg>>4)&1 == 1\n\tFflags.Talabs = (Ftflg>>5)&1 == 1\n\tFflags.Txyxys = (Ftflg>>6)&1 == 1\n\tFflags.Txvals = (Ftflg>>7)&1 == 1\n\t// Report on flags\n\tif verbose {\n\t\tfmt.Printf(\"Flags variable: %d\\n\", Ftflg)\n\t\tif Fflags.Tsprec {\n\t\t\tfmt.Printf(\"Y data is stored in 16-bit precision (instead of 32-bit)\\n\")\n\t\t}\n\t\tif Fflags.Tcgram {\n\t\t\tfmt.Printf(\"Use Experiment extension, not SPC\\n\")\n\t\t}\n\t\tif Fflags.Tmulti {\n\t\t\tfmt.Printf(\"Multifile\\n\")\n\t\t}\n\t\tif Fflags.Trandm {\n\t\t\tfmt.Printf(\"If a Multifile, Z values are randomly ordered\\n\")\n\t\t}\n\t\tif Fflags.Tordrd {\n\t\t\tfmt.Printf(\"If a Multifile, Z values are ordered, but not even\\n\")\n\t\t}\n\t\tif Fflags.Talabs {\n\t\t\tfmt.Printf(\"Use custom axis labels (obsolete)\\n\")\n\t\t}\n\t\tif Fflags.Txyxys {\n\t\t\tfmt.Printf(\"If an XY file and a Multifile, each subfile has its own X array\\n\")\n\t\t} else if Fflags.Txvals {\n\t\t\tfmt.Printf(\"XY file\\n\")\n\t\t} else {\n\t\t\tfmt.Printf(\"No x given, must be generated\\n\")\n\t\t}\n\t}\n\treturn &Fflags\n}", "title": "" }, { "docid": "d0a3011dd99df279a651a10595a4292a", "score": "0.48878473", "text": "func Xposix_spawnattr_getflags(tls TLS, _attr uintptr /* *Tposix_spawnattr_t = struct{F__...;F__pol int32;F__pad [16]int32;} */, _flags uintptr /* *int16 */) (r int32) {\n\t*(*int16)(unsafe.Pointer(_flags)) = int16(*(*int32)(unsafe.Pointer(_attr)))\n\treturn int32(0)\n}", "title": "" }, { "docid": "6cf9a4eb7d4c3ff52d7b323921bb0ae8", "score": "0.48864603", "text": "func GetFlags(w http.ResponseWriter, r *http.Request) {\n\t// Set initial, shared headers\n\tw.Header().Set(\"Access-Control-Allow-Origin\", os.Getenv(\"ACCESS_CONTROL_ALLOW_ORIGIN\"))\n\tw.Header().Set(\"Access-Control-Allow-Methods\", \"POST, GET, OPTIONS\")\n\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Content-Type\")\n\n\trequestBody := RequestBody{}\n\n\t// Check for body\n\terr := json.NewDecoder(r.Body).Decode(&requestBody)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Check that we don't receive empty/null market\n\tif requestBody.Market == \"\" {\n\t\tvar notFoundErrorMessage = []byte(`Did not find any match`)\n\t\tfmt.Println(`Market is empty...?`)\n\t\tEndWithBadRequest(w, notFoundErrorMessage)\n\t}\n\n\tflags := GetBucketFlagData()\n\n\tvar requestedMarket string = requestBody.Market\n\n\tvar searchIndex int = FindMatch(flags, requestedMarket)\n\n\t// Return bad request if we didn't find a match\n\tif searchIndex == -1 {\n\t\tvar notFoundErrorMessage = []byte(`Did not find any match`)\n\t\tfmt.Println(`Did not find any match`)\n\t\tEndWithBadRequest(w, notFoundErrorMessage)\n\t\treturn\n\t}\n\n\t// Return data if we found a match\n\tif searchIndex != -1 {\n\t\t// Encode the data for delivery\n\t\tdata, err := json.Marshal(flags.Flags[searchIndex])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tEndWithOK(w, data)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "825ace3c37d7e4e8802e1ce23c0c6e4c", "score": "0.48780203", "text": "func parseFlags() *Config {\n\tconfig := &Config{}\n\tflg.Usage = func() {\n\t\tfmt.Println(\"Usage: secspy [--user <user>] [--pass <pass>] [--url <url>] [-c <cmd>] [-a <arg>]\")\n\t\tflg.PrintDefaults()\n\t}\n\n\tflg.StringVarP(&config.User, \"user\", \"u\", os.Getenv(\"SECSPY_USERNAME\"), \"Username to authenticate with\")\n\tflg.StringVarP(&config.Pass, \"pass\", \"p\", os.Getenv(\"SECSPY_PASSWORD\"), \"Password to authenticate with\")\n\tflg.StringVarP(&config.URL, \"url\", \"U\", \"http://127.0.0.1:8000\", \"SecuritySpy URL\")\n\tflg.BoolVarP(&config.UseSSL, \"verify-ssl\", \"s\", false, \"Validate SSL certificate if using https\")\n\tflg.StringVarP(&config.Cmd, \"command\", \"c\", \"\",\n\t\t\"Command to run. Currently supports: events/callback, cams, pic, vid, trigger, files, download, ptz, arm\")\n\tflg.StringVarP(&config.Arg, \"arg\", \"a\", \"\",\n\t\t\"if cmd supports an argument, pass it here. ie. -c pic -a Porch:/tmp/filename.jpg\")\n\n\tver := flg.BoolP(\"version\", \"v\", false, \"Print the version and exit\")\n\n\tif flg.Parse(); *ver {\n\t\tfmt.Printf(\"secspy v%s\\n\", version.Version)\n\t\tos.Exit(0) // don't run anything else.\n\t}\n\n\treturn config\n}", "title": "" }, { "docid": "b5c78236b14039140d39aae7797b872d", "score": "0.4869346", "text": "func (s HsmFileState) Flags() []string {\n\tvar flagStrings []string\n\n\tfor flag, str := range HsmStateFlags {\n\t\tif s.HasFlag(flag) {\n\t\t\tflagStrings = append(flagStrings, str)\n\t\t}\n\t}\n\n\treturn flagStrings\n}", "title": "" }, { "docid": "8947317ff361da78d0f622c77a181460", "score": "0.4847744", "text": "func InitFlags(fs *pflag.FlagSet) {\n\tlogs.AddFlags(fs, logs.SkipLoggingConfigurationFlags())\n\tlogOptions.AddFlags(fs)\n\n\tfs.StringVar(&profilerAddress, \"profiler-address\", \"\",\n\t\t\"Bind address to expose the pprof profiler (e.g. localhost:6060)\")\n\n\tfs.IntVar(&webhookPort, \"webhook-port\", 9443,\n\t\t\"Webhook Server port\")\n\n\tfs.StringVar(&webhookCertDir, \"webhook-cert-dir\", \"/tmp/k8s-webhook-server/serving-certs/\",\n\t\t\"Webhook cert dir, only used when webhook-port is specified.\")\n}", "title": "" }, { "docid": "6318d6ba101501f2361fffe4cdfd61a8", "score": "0.48476738", "text": "func GetContexts() []string {\n\tcontextMap := config.Config().ViperConfig().GetStringMap(\"contexts\")\n\treturn funk.Keys(contextMap).([]string)\n}", "title": "" }, { "docid": "013f85aabb59c20baa6d1cf0541a4172", "score": "0.48393074", "text": "func (p *Plugin) GetFlags() []pcli.Flag {\n\treturn []pcli.Flag{\n\t\tpcli.Flag{\n\t\t\tFlagType: pcli.StringFlag,\n\t\t\tName: \"layer-file\",\n\t\t\tUsage: \"the path to the yaml overlay file\",\n\t\t},\n\t\tpcli.Flag{\n\t\t\tFlagType: pcli.StringFlag,\n\t\t\tName: \"job-name\",\n\t\t\tUsage: \"if given a jobname, it will overlay the given yaml as a job object only\",\n\t\t},\n\t\tpcli.Flag{\n\t\t\tFlagType: pcli.StringFlag,\n\t\t\tName: \"instance-group-name\",\n\t\t\tUsage: \"if given a groupname, it will overlay the given yaml as that intancegroup object\",\n\t\t},\n\t}\n}", "title": "" }, { "docid": "08fc88ba291a20b246ef0b4988dc660f", "score": "0.48379612", "text": "func (d *Driver) GetCreateFlags() []mcnflag.Flag {\n\treturn []mcnflag.Flag{\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: stringFlagToEnvVar(projectFlag),\n\t\t\tName: projectFlag,\n\t\t\tUsage: \"GleSYS project (e.g. CL12345)\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: stringFlagToEnvVar(apiKeyFlag),\n\t\t\tName: apiKeyFlag,\n\t\t\tUsage: \"GleSYS API key\",\n\t\t},\n\t\tmcnflag.IntFlag{\n\t\t\tName: memoryFlag,\n\t\t\tUsage: \"Memory in MB\",\n\t\t\tValue: defaultMemory,\n\t\t},\n\t\tmcnflag.IntFlag{\n\t\t\tName: cpuFlag,\n\t\t\tUsage: \"Number of CPU cores\",\n\t\t\tValue: defaultCPU,\n\t\t},\n\t\tmcnflag.IntFlag{\n\t\t\tName: storageFlag,\n\t\t\tUsage: \"Storage in GB\",\n\t\t\tValue: defaultStorage,\n\t\t},\n\t\tmcnflag.IntFlag{\n\t\t\tName: bandwidthFlag,\n\t\t\tUsage: \"Bandwidth in MBit/s\",\n\t\t\tValue: defaultBandwidth,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: dataCenterFlag,\n\t\t\tUsage: \"Data center to place the machine in\",\n\t\t\tValue: defaultDataCenter,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: rootPasswordFlag,\n\t\t\tUsage: \"Root password to use for the machine. If omitted, a random password will be generated (VMware only)\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: templateFlag,\n\t\t\tUsage: \"Template to use for the machine\",\n\t\t\tValue: defaultTemplate,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: campaignCodeFlag,\n\t\t\tUsage: \"Campaign code to use for the machine\",\n\t\t\tValue: \"\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: sshKeyPathFlag,\n\t\t\tUsage: \"Path to the SSH key file you want to use. If omitted, a new key will be generated\",\n\t\t\tValue: \"\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: platformFlag,\n\t\t\tUsage: \"Virtualization platform (VMware or KVM)\",\n\t\t\tValue: defaultPlatform,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tName: usernameKVMFlag,\n\t\t\tUsage: \"Username to use in KVM platform\",\n\t\t\tValue: defaultUsernameKvm,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "9e2a346bfd6d670d1a9869d79da964fa", "score": "0.483673", "text": "func ConfigFlags(cmd *cobra.Command, prefix string) error {\n\tif cmd == nil {\n\t\treturn errors.New(\"command required\")\n\t}\n\n\tif prefix == \"\" {\n\t\treturn errors.New(\"prefix required\")\n\t}\n\n\tviper.SetDefault(prefix, &Config{})\n\n\tflag := prefix + \".path\"\n\tsval := \"server\"\n\tcmd.Flags().String(flag, sval, \"Path to code\")\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".devcmd\"\n\tsval = defaultDevCommand\n\tcmd.Flags().String(flag, sval, \"Command to run code in development\")\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".buildcmd\"\n\tsval = defaultBuildCommand\n\tcmd.Flags().String(flag, sval, \"Command to build code for production\")\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".servecmd\"\n\tsval = defaultServeCommand\n\tcmd.Flags().String(flag, sval, \"Command to run code in production\")\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".builddir\"\n\tsval = defaultBuildDir\n\tcmd.Flags().String(flag, sval, \"Build directory\")\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".token\"\n\tsval = \"\"\n\tcmd.Flags().String(flag, sval, fmt.Sprintf(\"Service token (pulled from %s config file)\", settings.EmpiricaDir))\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".sessionTokenPath\"\n\tsval = fmt.Sprintf(\"%s/local/callBackSessionToken\", settings.EmpiricaDir)\n\tcmd.Flags().String(flag, sval, \"Path to session token file\")\n\tviper.SetDefault(flag, sval)\n\n\tflag = prefix + \".sessionToken\"\n\tbval := true\n\tcmd.Flags().Bool(flag, bval, \"Save sessionToken\")\n\tviper.SetDefault(flag, bval)\n\n\treturn nil\n}", "title": "" }, { "docid": "e8a11289850251bcde6516b8672da19c", "score": "0.4815153", "text": "func (m *MAX31856) GetFlags(address byte) (bitflag.Flag, error) {\n\tif address >= 0x80 && address <= 0x8B {\n\t\treturn 0, errors.New(\"Invalid read address\")\n\t}\n\n\treadValue := make([]byte, 2)\n\n\tm.dev.SetCSChange(false)\n\tm.dev.Tx([]byte{address, byte(0)}, readValue)\n\n\treturn bitflag.Flag(readValue[1]), nil\n}", "title": "" }, { "docid": "54e8e443af4b768f2ef7b1ee1800c5be", "score": "0.47998032", "text": "func GetAllFeatureFlags() map[string]bool {\n\treturn fflags\n}", "title": "" }, { "docid": "987261c1a5074340b041bf1cde0a7ef5", "score": "0.4789582", "text": "func ParseFlags() (ConfigPath, JiraIssueList, error) {\n\t// String that contains the configured configuration path\n\tvar configPathStr string\n\tvar appModeStr string\n\t\n\n\t// Set up a CLI flag called \"-config\" to allow users\n\t// to supply the configuration file\n\tflag.StringVar(&configPathStr, \"config\", \"~/.config/jira-ktt-copypaster/config.yaml\", \"path to config file\")\n\n\tflag.StringVar(&appModeStr, \"mode\", \"normal\", \"application mode\")\n\n\t\n\t\n\t// Actually parse the flags\n\tflag.Parse()\n\n\t//APPLICATION MODE\n\tapplicationMode = ApplicationMode(appModeStr)\n\tif err := validateApplicationMode(applicationMode); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\t\n\t//JIRA TICKETS \n\t//All the rest(list og jira issues separated by )\n\ttail := flag.Args()\n\tlog.Printf(\"List of Jira tickets to process: %+q\\n\", tail)\n\n\t//PATH\n\t// Validate the path first\n\tif err := validateConfigPath(configPathStr); err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tconfigPath := ConfigPath(configPathStr)\n\tjiraIssueList := JiraIssueList(tail)\n\n\t// Return the configuration path\n\treturn configPath, jiraIssueList, nil\n}", "title": "" }, { "docid": "8283835c6b91c1786025a6d75dc2f53d", "score": "0.4784747", "text": "func FlagLoad(f string, deflocs ...string) ([]LZ, string) {\n\treturn defFlagger.FlagLoad(f, deflocs...)\n}", "title": "" }, { "docid": "a542015a67e27f3f44768261e23a82df", "score": "0.47838023", "text": "func (env *Env) Flags() (uint, error) {\n\tvar _flags C.uint\n\tret := C.mdb_env_get_flags(env._env, &_flags)\n\tif ret != success {\n\t\treturn 0, errno(ret)\n\t}\n\treturn uint(_flags), nil\n}", "title": "" }, { "docid": "2dedc6293f38908db383fdb378553c08", "score": "0.47831026", "text": "func (d *Driver) GetCreateFlags() []mcnflag.Flag {\n\treturn []mcnflag.Flag{\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_API_KEY\",\n\t\t\tName: \"oneandone-api-key\",\n\t\t\tUsage: \"1&1 API Key\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_SSH_PASSWORD\",\n\t\t\tName: \"oneandone-ssh-pass\",\n\t\t\tUsage: \"1&1 SSH Password\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_DATACENTER\",\n\t\t\tName: \"oneandone-datacenter\",\n\t\t\tUsage: \"1&1 Data Center. Default: \" + defaultDatacenter,\n\t\t\tValue: defaultDatacenter,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_SIZE\",\n\t\t\tName: \"oneandone-size\",\n\t\t\tUsage: \"1&1 Cloud Server Size. Default: \" + defaultSize,\n\t\t\tValue: defaultSize,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_OS\",\n\t\t\tName: \"oneandone-os\",\n\t\t\tUsage: \"1&1 Appliance OS. Default: \" + defaultOS,\n\t\t\tValue: defaultOS,\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_FIREWALL\",\n\t\t\tName: \"oneandone-firewall-id\",\n\t\t\tUsage: \"1&1 Firewall Policy ID\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_IP_ADDRESS\",\n\t\t\tName: \"oneandone-ip-address\",\n\t\t\tUsage: \"Unassigned 1&1 Public IP Address\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_LOADBALANCER\",\n\t\t\tName: \"oneandone-loadbalancer-id\",\n\t\t\tUsage: \"1&1 Load Balancer ID\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_MONITOR_POLICY\",\n\t\t\tName: \"oneandone-monitor-policy-id\",\n\t\t\tUsage: \"1&1 Monitoring Policy ID\",\n\t\t},\n\t\tmcnflag.StringFlag{\n\t\t\tEnvVar: \"ONEANDONE_SERVER_DESCRIPTION\",\n\t\t\tName: \"oneandone-server-description\",\n\t\t\tUsage: \"1&1 Cloud Server Description\",\n\t\t},\n\t}\n}", "title": "" }, { "docid": "91c8798e9b7267c300bfbcff957e32de", "score": "0.4764813", "text": "func (bt *BaseTable) getFlags(f *os.File) {\n\tif bt.HasFlags {\n\t\tnRemainingFlags := bt.NullableFields\n\t\tfor nRemainingFlags > 0 {\n\t\t\ttemp := readByte(f)\n\t\t\tbt.Flags = append(bt.Flags, temp)\n\t\t\tnRemainingFlags -= 8\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7723498717011ac3245bec873876203a", "score": "0.47487405", "text": "func resolvePathForTheFlagsInContext(c *cli.Context) (err error) {\n\terr = resolvePathForTheFlagInContext(\"log-file\", c)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolving for log-file: %w\", err)\n\t}\n\n\terr = resolvePathForTheFlagInContext(\"key-file\", c)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolving for key-file: %w\", err)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "fc68dec7f332eb36d2790777ca66caa2", "score": "0.47394764", "text": "func AddFlags(a *kingpin.Application) *string {\n\treturn a.Flag(\n\t\t\"web.config.file\",\n\t\t\"[EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.\",\n\t).Default(\"\").String()\n}", "title": "" }, { "docid": "c2fb3c2a55fb626760666e413103922e", "score": "0.47364163", "text": "func (op *Opts_t) GetStringList(flag string) []string {\n\tval := op.getStringList(flag)\n\tif len(val) == 0 {\n\t\t// try defaut value\n\t\tif opt := op.getOption(\"options\", flag); opt != nil {\n\t\t\tval = opt.defval\n\t\t} else if opt := op.getOption(\"flags\", flag); opt != nil {\n\t\t\tval = opt.defval\n\t\t}\n\t}\n\treturn val\n}", "title": "" }, { "docid": "4abdef7579ff1df3427f810cfe6b9a0d", "score": "0.47363213", "text": "func KubeletFlags(version, cloudProvider, hostname string, dnsIPs []net.IP) (string, error) {\n\ttmpl, err := template.New(\"kubelet-flags\").Funcs(TxtFuncMap()).Parse(kubeletFlagsTpl)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to parse kubelet-flags template: %v\", err)\n\t}\n\n\tdata := struct {\n\t\tCloudProvider string\n\t\tHostname string\n\t\tClusterDNSIPs []net.IP\n\t\tKubeletVersion string\n\t}{\n\t\tCloudProvider: cloudProvider,\n\t\tHostname: hostname,\n\t\tClusterDNSIPs: dnsIPs,\n\t\tKubeletVersion: version,\n\t}\n\tb := &bytes.Buffer{}\n\terr = tmpl.Execute(b, data)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to execute kubelet-flags template: %v\", err)\n\t}\n\n\treturn b.String(), nil\n}", "title": "" }, { "docid": "8a61eca9d39dc31251d91a34830afbf1", "score": "0.47302753", "text": "func ServerWithConfig(cfg *config.Config) []cli.Flag {\n\treturn []cli.Flag{\n\t\t&cli.BoolFlag{\n\t\t\tName: \"tracing-enabled\",\n\t\t\tUsage: \"Enable sending traces\",\n\t\t\tEnvVars: []string{\"GLAUTH_TRACING_ENABLED\"},\n\t\t\tDestination: &cfg.Tracing.Enabled,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-type\",\n\t\t\tValue: \"jaeger\",\n\t\t\tUsage: \"Tracing backend type\",\n\t\t\tEnvVars: []string{\"GLAUTH_TRACING_TYPE\"},\n\t\t\tDestination: &cfg.Tracing.Type,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-endpoint\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Endpoint for the agent\",\n\t\t\tEnvVars: []string{\"GLAUTH_TRACING_ENDPOINT\"},\n\t\t\tDestination: &cfg.Tracing.Endpoint,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-collector\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Endpoint for the collector\",\n\t\t\tEnvVars: []string{\"GLAUTH_TRACING_COLLECTOR\"},\n\t\t\tDestination: &cfg.Tracing.Collector,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-service\",\n\t\t\tValue: \"glauth\",\n\t\t\tUsage: \"Service name for tracing\",\n\t\t\tEnvVars: []string{\"GLAUTH_TRACING_SERVICE\"},\n\t\t\tDestination: &cfg.Tracing.Service,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"debug-addr\",\n\t\t\tValue: \"0.0.0.0:9129\",\n\t\t\tUsage: \"Address to bind debug server\",\n\t\t\tEnvVars: []string{\"GLAUTH_DEBUG_ADDR\"},\n\t\t\tDestination: &cfg.Debug.Addr,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"debug-token\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Token to grant metrics access\",\n\t\t\tEnvVars: []string{\"GLAUTH_DEBUG_TOKEN\"},\n\t\t\tDestination: &cfg.Debug.Token,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"debug-pprof\",\n\t\t\tUsage: \"Enable pprof debugging\",\n\t\t\tEnvVars: []string{\"GLAUTH_DEBUG_PPROF\"},\n\t\t\tDestination: &cfg.Debug.Pprof,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"debug-zpages\",\n\t\t\tUsage: \"Enable zpages debugging\",\n\t\t\tEnvVars: []string{\"GLAUTH_DEBUG_ZPAGES\"},\n\t\t\tDestination: &cfg.Debug.Zpages,\n\t\t},\n\n\t\t&cli.StringFlag{\n\t\t\tName: \"ldap-addr\",\n\t\t\tValue: \"0.0.0.0:9125\",\n\t\t\tUsage: \"Address to bind ldap server\",\n\t\t\tEnvVars: []string{\"GLAUTH_LDAP_ADDR\"},\n\t\t\tDestination: &cfg.Ldap.Address,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"ldap-enabled\",\n\t\t\tValue: true,\n\t\t\tUsage: \"Enable ldap server\",\n\t\t\tEnvVars: []string{\"GLAUTH_LDAP_ENABLED\"},\n\t\t\tDestination: &cfg.Ldap.Enabled,\n\t\t},\n\n\t\t&cli.StringFlag{\n\t\t\tName: \"ldaps-addr\",\n\t\t\tValue: \"0.0.0.0:9126\",\n\t\t\tUsage: \"Address to bind ldap server\",\n\t\t\tEnvVars: []string{\"GLAUTH_LDAPS_ADDR\"},\n\t\t\tDestination: &cfg.Ldaps.Address,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"ldaps-enabled\",\n\t\t\tValue: true,\n\t\t\tUsage: \"Enable ldap server\",\n\t\t\tEnvVars: []string{\"GLAUTH_LDAPS_ENABLED\"},\n\t\t\tDestination: &cfg.Ldaps.Enabled,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"ldaps-cert\",\n\t\t\tValue: \"./ldap.crt\",\n\t\t\tUsage: \"path to ldaps certificate in PEM format\",\n\t\t\tEnvVars: []string{\"GLAUTH_LDAPS_CERT\"},\n\t\t\tDestination: &cfg.Ldaps.Cert,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"ldaps-key\",\n\t\t\tValue: \"./ldap.key\",\n\t\t\tUsage: \"path to ldaps key in PEM format\",\n\t\t\tEnvVars: []string{\"GLAUTH_LDAPS_KEY\"},\n\t\t\tDestination: &cfg.Ldaps.Key,\n\t\t},\n\n\t\t&cli.StringFlag{\n\t\t\tName: \"backend-basedn\",\n\t\t\tValue: \"dc=example,dc=org\",\n\t\t\tUsage: \"base distinguished name to expose\",\n\t\t\tEnvVars: []string{\"GLAUTH_BACKEND_BASEDN\"},\n\t\t\tDestination: &cfg.Backend.BaseDN,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"backend-insecure\",\n\t\t\tValue: false,\n\t\t\tUsage: \"Allow insecure requests to the datastore\",\n\t\t\tEnvVars: []string{\"GLAUTH_BACKEND_INSECURE\"},\n\t\t\tDestination: &cfg.Backend.Insecure,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"backend-name-format\",\n\t\t\tValue: \"cn\",\n\t\t\tUsage: \"name attribute for entries to expose. typically cn or uid\",\n\t\t\tEnvVars: []string{\"GLAUTH_BACKEND_NAME_FORMAT\"},\n\t\t\tDestination: &cfg.Backend.NameFormat,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"backend-group-format\",\n\t\t\tValue: \"ou\",\n\t\t\tUsage: \"name attribute for entries to expose. typically ou, cn or dc\",\n\t\t\tEnvVars: []string{\"GLAUTH_BACKEND_GROUP_FORMAT\"},\n\t\t\tDestination: &cfg.Backend.GroupFormat,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"backend-ssh-key-attr\",\n\t\t\tValue: \"sshPublicKey\",\n\t\t\tUsage: \"ssh key attribute for entries to expose\",\n\t\t\tEnvVars: []string{\"GLAUTH_BACKEND_SSH_KEY_ATTR\"},\n\t\t\tDestination: &cfg.Backend.SSHKeyAttr,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "02fe1dc941869a82bd9af169a4aaaa13", "score": "0.47226182", "text": "func (gc *GetConf) loadFromFlags() {\n\t// Register flags in flagSet and parse it\n\tflagConfigSet := flag.NewFlagSet(gc.setName, flag.ContinueOnError) // flag.ExitOnError\n\tfor _, o := range g2.options {\n\t\tflagConfigSet.Var(o, o.name, o.usage)\n\t}\n\tflagConfigSet.Parse(os.Args[1:])\n\tflagConfigSet.Visit(g2.setConfigFromFlag)\n}", "title": "" }, { "docid": "57a73e9b9e3a0f1d7a1e41d814dca894", "score": "0.47220215", "text": "func GlobalFlags() []cli.Flag {\n\treturn global.GetFlags()\n}", "title": "" }, { "docid": "157edc578e3e43b0e9cc710d4292445d", "score": "0.47196987", "text": "func (opts *commonOptions) processFlags() (state, error) {\n\t// Logger.\n\tlogLevels := map[logging.Level]gol.Level{\n\t\tlogging.Debug: gol.DEBUG,\n\t\tlogging.Info: gol.INFO,\n\t\tlogging.Warning: gol.WARNING,\n\t\tlogging.Error: gol.ERROR,\n\t}\n\tctx := context.Background()\n\tctx = logging.Set(ctx, gologger.New(os.Stderr, logLevels[opts.localLogLevel]))\n\n\t// Auth options.\n\tauthOpts, err := opts.authFlags.Options()\n\tif err != nil {\n\t\treturn state{}, err\n\t}\n\tauthOpts.Context = ctx\n\tif opts.projectID == \"\" {\n\t\tif authOpts.ServiceAccountJSONPath != \"\" {\n\t\t\topts.projectID = projectIDFromServiceAccountJSON(authOpts.ServiceAccountJSONPath)\n\t\t}\n\t\tif opts.projectID == \"\" {\n\t\t\treturn state{}, fmt.Errorf(\"-project-id is required\")\n\t\t}\n\t}\n\n\t// Tsmon options.\n\tif opts.tsmonFlags.Target.TaskJobName == \"\" {\n\t\topts.tsmonFlags.Target.TaskJobName = fmt.Sprintf(\n\t\t\t\"%s-%s-%s\", opts.logID, opts.resourceType, opts.resourceID)\n\t}\n\tif err := tsmon.InitializeFromFlags(ctx, &opts.tsmonFlags); err != nil {\n\t\treturn state{}, err\n\t}\n\n\t// Client.\n\thttpClient, err := auth.NewAuthenticator(auth.SilentLogin, authOpts).Client()\n\tif err != nil {\n\t\treturn state{}, err\n\t}\n\tclient, err := cloudtail.NewClient(cloudtail.ClientOptions{\n\t\tClient: httpClient,\n\t\tLogger: logging.Get(ctx),\n\t\tProjectID: opts.projectID,\n\t\tResourceType: opts.resourceType,\n\t\tResourceID: opts.resourceID,\n\t\tLogID: opts.logID,\n\t\tDebug: opts.debug,\n\t})\n\tif err != nil {\n\t\treturn state{}, err\n\t}\n\n\t// Buffer.\n\tbuffer := cloudtail.NewPushBuffer(cloudtail.PushBufferOptions{\n\t\tClient: client,\n\t\tLogger: logging.Get(ctx),\n\t})\n\n\treturn state{ctx, client, buffer}, nil\n}", "title": "" }, { "docid": "208ab999299be2b000632153eff14f7c", "score": "0.47163713", "text": "func ParseFlags() {\n\thDir, _ := os.UserConfigDir()\n\tcfgPath := flag.String(\"cfg-path\", hDir+\"/swarm-cache/env.txt\", \"Path to configuration file.\")\n\n\ttF_CLIENT_LISTEN := flag.String(\"cl\", \"\", \"Address on which to listen for incoming client connections. If blank it will not listen.\")\n\ttF_NODE_LISTEN := flag.String(\"nl\", \"\", \"Address on which to listen for incoming node connections. If blank it will not listen.\")\n\ttF_NODE_CONNECT := flag.String(\"nc\", \"\", \"Nodes to which this node will connect. Separated by commas (,). If blank it will not connect. \")\n\ttF_LOG_IO_MSG := flag.Bool(\"log-io-msg\", false, \"Log input/output websocket messages. Can be true/false\")\n\ttF_MAX_USED_MEMORY := flag.Int64(\"max-memory\", 0, \"Max used memory in Bytes\")\n\ttF_MAX_CACHED_KEYS := flag.Int64(\"max-cached-keys\", 0, \"Max nr of keys node can cache. Must be >=0\")\n\ttF_OVERFLOW_EXPAND := flag.Bool(\"overflow-expand\", true, \"Pass data to other nodes from swarm if this node runs out of memory. Can be true/false\")\n\tflag.Parse()\n\n\t// if there is a config file parse that first\n\t//\n\tlog.Info(\"Loading env file...\")\n\terr := godotenv.Load(*cfgPath)\n\tif err == nil {\n\t\tglob.F_CLIENT_LISTEN = os.Getenv(\"F_CLIENT_LISTEN\")\n\t\tglob.F_NODE_LISTEN = os.Getenv(\"F_NODE_LISTEN\")\n\t\tglob.F_NODE_CONNECT = strings.Split(os.Getenv(\"F_NODE_CONNECT\"), \",\")\n\t\tglob.F_LOG_IO_MSG, _ = strconv.ParseBool(os.Getenv(\"F_LOG_IO_MSG\"))\n\t\tglob.F_MAX_USED_MEMORY, _ = strconv.ParseInt(os.Getenv(\"F_MAX_USED_MEMORY\"), 10, 64)\n\t\tglob.F_MAX_CACHED_KEYS, _ = strconv.ParseInt(os.Getenv(\"F_MAX_CACHED_KEYS\"), 10, 64)\n\t\tglob.F_OVERFLOW_EXPAND, _ = strconv.ParseBool(os.Getenv(\"F_OVERFLOW_EXPAND\"))\n\t\tlog.Info(\"OK\")\n\t} else {\n\t\tlog.Errorf(\"Could not load env file! %s\", err)\n\t}\n\n\t// otherwise parse the flags and assign to glob anyway\n\t//\n\tif *tF_CLIENT_LISTEN != \"\" {\n\t\tglob.F_CLIENT_LISTEN = *tF_CLIENT_LISTEN\n\t}\n\tif *tF_NODE_LISTEN != \"\" {\n\t\tglob.F_NODE_LISTEN = *tF_NODE_LISTEN\n\t}\n\tif *tF_NODE_CONNECT != \"\" {\n\t\tglob.F_NODE_CONNECT = strings.Split(*tF_NODE_CONNECT, \",\")\n\t}\n\tif *tF_LOG_IO_MSG != false {\n\t\tglob.F_LOG_IO_MSG = *tF_LOG_IO_MSG\n\t}\n\tif *tF_MAX_USED_MEMORY != 0 {\n\t\tglob.F_MAX_USED_MEMORY = *tF_MAX_USED_MEMORY\n\t}\n\tif *tF_MAX_CACHED_KEYS != 0 {\n\t\tglob.F_MAX_CACHED_KEYS = *tF_MAX_CACHED_KEYS\n\t}\n\tif *tF_OVERFLOW_EXPAND != true {\n\t\tglob.F_OVERFLOW_EXPAND = *tF_OVERFLOW_EXPAND\n\t}\n\n\t// other checks\n\t//\n\tif glob.F_CLIENT_LISTEN == glob.F_NODE_LISTEN && glob.F_CLIENT_LISTEN != \"\" {\n\t\tlog.Fatal(\"Client and Node servers cannot listen on the same address:port!\")\n\t\tos.Exit(0)\n\t}\n}", "title": "" }, { "docid": "cd6f9a82b24bfb8defce32c133d09b62", "score": "0.47161317", "text": "func (v *Version) Flags() int64 {\n\treturn v.Int(\"flags\")\n}", "title": "" }, { "docid": "abd92a367c2821d190e3a3c938a409ce", "score": "0.47142407", "text": "func parseFlags(path string) []string {\n\tcontent, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil\n\t}\n\theader := strings.SplitN(string(content), \"\\n\", 1)[0]\n\tm := reFlags.FindStringSubmatch(header)\n\tif len(m) != 2 {\n\t\treturn nil\n\t}\n\treturn strings.Split(m[1], \" \")\n}", "title": "" }, { "docid": "4c097b8baa3c1b3594ae2a0523c291ec", "score": "0.4713745", "text": "func (l *Loader) Flags() *flag.FlagSet {\n\tif !l.isBuilt {\n\t\tpanic(\"aconfig: you must run Build method before using the loader\")\n\t}\n\treturn l.flagSet\n}", "title": "" }, { "docid": "c47ef69f81a89173426e64dcdf3ba542", "score": "0.47126374", "text": "func ServerWithConfig(cfg *config.Config) []cli.Flag {\n\treturn []cli.Flag{\n\t\t&cli.BoolFlag{\n\t\t\tName: \"tracing-enabled\",\n\t\t\tUsage: \"Enable sending traces\",\n\t\t\tEnvVars: []string{\"PHOENIX_TRACING_ENABLED\"},\n\t\t\tDestination: &cfg.Tracing.Enabled,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-type\",\n\t\t\tValue: \"jaeger\",\n\t\t\tUsage: \"Tracing backend type\",\n\t\t\tEnvVars: []string{\"PHOENIX_TRACING_TYPE\"},\n\t\t\tDestination: &cfg.Tracing.Type,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-endpoint\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Endpoint for the agent\",\n\t\t\tEnvVars: []string{\"PHOENIX_TRACING_ENDPOINT\"},\n\t\t\tDestination: &cfg.Tracing.Endpoint,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-collector\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Endpoint for the collector\",\n\t\t\tEnvVars: []string{\"PHOENIX_TRACING_COLLECTOR\"},\n\t\t\tDestination: &cfg.Tracing.Collector,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-service\",\n\t\t\tValue: \"phoenix\",\n\t\t\tUsage: \"Service name for tracing\",\n\t\t\tEnvVars: []string{\"PHOENIX_TRACING_SERVICE\"},\n\t\t\tDestination: &cfg.Tracing.Service,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"debug-addr\",\n\t\t\tValue: \"0.0.0.0:9104\",\n\t\t\tUsage: \"Address to bind debug server\",\n\t\t\tEnvVars: []string{\"PHOENIX_DEBUG_ADDR\"},\n\t\t\tDestination: &cfg.Debug.Addr,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"debug-token\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Token to grant metrics access\",\n\t\t\tEnvVars: []string{\"PHOENIX_DEBUG_TOKEN\"},\n\t\t\tDestination: &cfg.Debug.Token,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"debug-pprof\",\n\t\t\tUsage: \"Enable pprof debugging\",\n\t\t\tEnvVars: []string{\"PHOENIX_DEBUG_PPROF\"},\n\t\t\tDestination: &cfg.Debug.Pprof,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"debug-zpages\",\n\t\t\tUsage: \"Enable zpages debugging\",\n\t\t\tEnvVars: []string{\"PHOENIX_DEBUG_ZPAGES\"},\n\t\t\tDestination: &cfg.Debug.Zpages,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"http-addr\",\n\t\t\tValue: \"0.0.0.0:9100\",\n\t\t\tUsage: \"Address to bind http server\",\n\t\t\tEnvVars: []string{\"PHOENIX_HTTP_ADDR\"},\n\t\t\tDestination: &cfg.HTTP.Addr,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"http-root\",\n\t\t\tValue: \"/\",\n\t\t\tUsage: \"Root path of http server\",\n\t\t\tEnvVars: []string{\"PHOENIX_HTTP_ROOT\"},\n\t\t\tDestination: &cfg.HTTP.Root,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"http-namespace\",\n\t\t\tValue: \"com.owncloud.web\",\n\t\t\tUsage: \"Set the base namespace for the http namespace\",\n\t\t\tEnvVars: []string{\"PHOENIX_NAMESPACE\"},\n\t\t\tDestination: &cfg.HTTP.Namespace,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"asset-path\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Path to custom assets\",\n\t\t\tEnvVars: []string{\"PHOENIX_ASSET_PATH\"},\n\t\t\tDestination: &cfg.Asset.Path,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"web-config\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Path to phoenix config\",\n\t\t\tEnvVars: []string{\"PHOENIX_WEB_CONFIG\"},\n\t\t\tDestination: &cfg.Phoenix.Path,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"web-config-server\",\n\t\t\tValue: \"https://localhost:9200\",\n\t\t\tUsage: \"Server URL\",\n\t\t\tEnvVars: []string{\"PHOENIX_WEB_CONFIG_SERVER\"},\n\t\t\tDestination: &cfg.Phoenix.Config.Server,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"web-config-theme\",\n\t\t\tValue: \"owncloud\",\n\t\t\tUsage: \"Theme\",\n\t\t\tEnvVars: []string{\"PHOENIX_WEB_CONFIG_THEME\"},\n\t\t\tDestination: &cfg.Phoenix.Config.Theme,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"web-config-version\",\n\t\t\tValue: \"0.1.0\",\n\t\t\tUsage: \"Version\",\n\t\t\tEnvVars: []string{\"PHOENIX_WEB_CONFIG_VERSION\"},\n\t\t\tDestination: &cfg.Phoenix.Config.Version,\n\t\t},\n\t\t&cli.StringSliceFlag{\n\t\t\tName: \"web-config-app\",\n\t\t\tValue: cli.NewStringSlice(\"files\", \"draw-io\", \"markdown-editor\", \"media-viewer\"),\n\t\t\tUsage: `--web-config-app files [--web-config-app draw-io]`,\n\t\t\tEnvVars: []string{\"PHOENIX_WEB_CONFIG_APPS\"},\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"oidc-metadata-url\",\n\t\t\tValue: \"https://localhost:9200/.well-known/openid-configuration\",\n\t\t\tUsage: \"OpenID Connect metadata URL\",\n\t\t\tEnvVars: []string{\"PHOENIX_OIDC_METADATA_URL\"},\n\t\t\tDestination: &cfg.Phoenix.Config.OpenIDConnect.MetadataURL,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"oidc-authority\",\n\t\t\tValue: \"https://localhost:9200\",\n\t\t\tUsage: \"OpenID Connect authority\", // TODO rename to Issuer\n\t\t\tEnvVars: []string{\"PHOENIX_OIDC_AUTHORITY\"},\n\t\t\tDestination: &cfg.Phoenix.Config.OpenIDConnect.Authority,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"oidc-client-id\",\n\t\t\tValue: \"phoenix\",\n\t\t\tUsage: \"OpenID Connect client ID\",\n\t\t\tEnvVars: []string{\"PHOENIX_OIDC_CLIENT_ID\"},\n\t\t\tDestination: &cfg.Phoenix.Config.OpenIDConnect.ClientID,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"oidc-response-type\",\n\t\t\tValue: \"code\",\n\t\t\tUsage: \"OpenID Connect response type\",\n\t\t\tEnvVars: []string{\"PHOENIX_OIDC_RESPONSE_TYPE\"},\n\t\t\tDestination: &cfg.Phoenix.Config.OpenIDConnect.ResponseType,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"oidc-scope\",\n\t\t\tValue: \"openid profile email\",\n\t\t\tUsage: \"OpenID Connect scope\",\n\t\t\tEnvVars: []string{\"PHOENIX_OIDC_SCOPE\"},\n\t\t\tDestination: &cfg.Phoenix.Config.OpenIDConnect.Scope,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "88af727ea056fb6cd6ed44d805581802", "score": "0.47119093", "text": "func populateFlags(c *cli.Context) (flags *flagStorage, err error) {\n\tcustomEndpointStr := c.String(\"custom-endpoint\")\n\tvar customEndpoint *url.URL\n\n\tif customEndpointStr == \"\" {\n\t\tcustomEndpoint = nil\n\t} else {\n\t\tcustomEndpoint, err = url.Parse(customEndpointStr)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"could not parse custom-endpoint: %w\", err)\n\t\t\treturn\n\t\t}\n\t}\n\n\tclientProtocolString := strings.ToLower(c.String(\"client-protocol\"))\n\tclientProtocol := mountpkg.ClientProtocol(clientProtocolString)\n\tflags = &flagStorage{\n\t\tAppName: c.String(\"app-name\"),\n\t\tForeground: c.Bool(\"foreground\"),\n\n\t\t// File system\n\t\tMountOptions: make(map[string]string),\n\t\tDirMode: os.FileMode(*c.Generic(\"dir-mode\").(*OctalInt)),\n\t\tFileMode: os.FileMode(*c.Generic(\"file-mode\").(*OctalInt)),\n\t\tUid: int64(c.Int(\"uid\")),\n\t\tGid: int64(c.Int(\"gid\")),\n\t\tImplicitDirs: c.Bool(\"implicit-dirs\"),\n\t\tOnlyDir: c.String(\"only-dir\"),\n\t\tRenameDirLimit: int64(c.Int(\"rename-dir-limit\")),\n\n\t\t// GCS,\n\t\tCustomEndpoint: customEndpoint,\n\t\tBillingProject: c.String(\"billing-project\"),\n\t\tKeyFile: c.String(\"key-file\"),\n\t\tTokenUrl: c.String(\"token-url\"),\n\t\tReuseTokenFromUrl: c.BoolT(\"reuse-token-from-url\"),\n\t\tEgressBandwidthLimitBytesPerSecond: c.Float64(\"limit-bytes-per-sec\"),\n\t\tOpRateLimitHz: c.Float64(\"limit-ops-per-sec\"),\n\t\tSequentialReadSizeMb: int32(c.Int(\"sequential-read-size-mb\")),\n\n\t\t// Tuning,\n\t\tMaxRetrySleep: c.Duration(\"max-retry-sleep\"),\n\t\tStatCacheCapacity: c.Int(\"stat-cache-capacity\"),\n\t\tStatCacheTTL: c.Duration(\"stat-cache-ttl\"),\n\t\tTypeCacheTTL: c.Duration(\"type-cache-ttl\"),\n\t\tHttpClientTimeout: c.Duration(\"http-client-timeout\"),\n\t\tMaxRetryDuration: c.Duration(\"max-retry-duration\"),\n\t\tRetryMultiplier: c.Float64(\"retry-multiplier\"),\n\t\tLocalFileCache: c.Bool(\"experimental-local-file-cache\"),\n\t\tTempDir: c.String(\"temp-dir\"),\n\t\tClientProtocol: clientProtocol,\n\t\tMaxConnsPerHost: c.Int(\"max-conns-per-host\"),\n\t\tMaxIdleConnsPerHost: c.Int(\"max-idle-conns-per-host\"),\n\t\tEnableNonexistentTypeCache: c.Bool(\"enable-nonexistent-type-cache\"),\n\n\t\t// Monitoring & Logging\n\t\tStackdriverExportInterval: c.Duration(\"stackdriver-export-interval\"),\n\t\tOtelCollectorAddress: c.String(\"experimental-opentelemetry-collector-address\"),\n\t\tLogFile: c.String(\"log-file\"),\n\t\tLogFormat: c.String(\"log-format\"),\n\t\tExperimentalEnableJsonRead: c.Bool(\"experimental-enable-json-read\"),\n\n\t\t// Debugging,\n\t\tDebugFuseErrors: c.BoolT(\"debug_fuse_errors\"),\n\t\tDebugFuse: c.Bool(\"debug_fuse\"),\n\t\tDebugGCS: c.Bool(\"debug_gcs\"),\n\t\tDebugHTTP: c.Bool(\"debug_http\"),\n\t\tDebugFS: c.Bool(\"debug_fs\"),\n\t\tDebugInvariants: c.Bool(\"debug_invariants\"),\n\t\tDebugMutex: c.Bool(\"debug_mutex\"),\n\t}\n\n\t// Handle the repeated \"-o\" flag.\n\tfor _, o := range c.StringSlice(\"o\") {\n\t\tmountpkg.ParseOptions(flags.MountOptions, o)\n\t}\n\n\terr = validateFlags(flags)\n\n\treturn\n}", "title": "" }, { "docid": "ecc5bd1a76308917d29be4e1c54b720a", "score": "0.47110534", "text": "func initFlags() {\n\n\tconst (\n\t\tlistenPortDefault = 8080\n\t\tlistenPortUsage = \"port on which to listen for HTTP requests\"\n\t\tcontentRootDefault = \".\"\n\t\tcontentRootUsage = \"path to (static content) templates, skeleton, etc.\"\n\t\tapiHostDefault = \"localhost\"\n\t\tapiHostUsage = \"host to use for all API calls made internally.\"\n\t\ttestingUsage = \"Set to true to use the in memory data store else blob service is used\"\n\t\ttestingDefault = false\n\t)\n\n\tflag.IntVar(&Cntxt.ListenPort, \"listenport\", listenPortDefault, listenPortUsage)\n\tflag.IntVar(&Cntxt.ListenPort, \"l\", listenPortDefault, listenPortUsage+\" (shorthand)\")\n\tflag.StringVar(&Cntxt.APIHost, \"apiHost\", apiHostDefault, apiHostUsage)\n\tflag.StringVar(&Cntxt.APIHost, \"h\", apiHostDefault, apiHostUsage+\" (shorthand)\")\n\tflag.StringVar(&Cntxt.ContentRoot, \"tplpath\", contentRootDefault, contentRootUsage)\n\tflag.StringVar(&Cntxt.ContentRoot, \"t\", contentRootDefault, contentRootUsage+\" (shorthand)\")\n\tflag.BoolVar(&Testing, \"test\", testingDefault, testingUsage+\" (shorthand)\")\n}", "title": "" }, { "docid": "01f8505dce8cfad1f73c332390414eae", "score": "0.47099313", "text": "func InitFlags() {\n\tflag.StringVar(&pulseVTMServer, \"server\", os.Getenv(\"PULSEVTM_SERVER\"),\n\t\t\"Pulse vTM API server hostname or address. (Env: PULSEVTM_SERVER)\")\n\tflag.StringVar(&pulseVTMUsername, \"username\", os.Getenv(\"PULSEVTM_USERNAME\"),\n\t\t\"Pulse vTM authentication username (Env: PULSEVTM_USERNAME)\")\n\tflag.StringVar(&pulseVTMPassword, \"password\", os.Getenv(\"PULSEVTM_PASSWORD\"),\n\t\t\"Pulse vTM authentication password (Env: PULSEVTM_PASSWORD)\")\n\tflag.StringVar(&pulseAPIVersion, \"api_version\", os.Getenv(\"PULSEVTM_API_VERSION\"),\n\t\t\"Pulse vTM REST API version\")\n\tflag.BoolVar(&debug, \"debug\", false, \"Debug output. Default:false\")\n\tflag.DurationVar(&timeout, \"timeout\", 0, \"Client timeout value. Default: 0\")\n\n}", "title": "" }, { "docid": "c4cbb5bfc5d26803dc51addec5dd2152", "score": "0.47089016", "text": "func FlagsFromCtx(ctx context.Context) FeatureFlags {\n\tif ctrl := ctx.Value(flagsCtxKey); ctrl != nil {\n\t\treturn ctrl.(FeatureFlags)\n\t}\n\treturn defaultFeatureFlags\n}", "title": "" }, { "docid": "06dcfad33d72f1ac8121bf6f5f800f2f", "score": "0.47084776", "text": "func (cs *ChanServ) GetAccessList(channel string) (res []Flagset, err error) {\n\tvar output string\n\n\toutput, err = cs.a.Command(\"ChanServ\", \"FLAGS\", channel)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlines := strings.Split(output, \"\\n\")\n\n\tfor _, line := range lines {\n\t\tline = strings.Replace(line, \" \", \"\", -1)\n\t\tdata := strings.Split(line, \" \")\n\n\t\tid, _ := strconv.Atoi(data[0])\n\n\t\tres = append(res, Flagset{\n\t\t\tId: id,\n\t\t\tNick: data[1],\n\t\t\tFlags: data[2],\n\t\t})\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "6824bd89976892981c295282d00b290e", "score": "0.47076684", "text": "func getExternalPluginFlags(req external.PluginRequest, path string) ([]external.Flag, error) {\n\treq.Universe = map[string]string{}\n\n\tres, err := makePluginRequest(req, path)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error making request to external plugin: %w\", err)\n\t}\n\n\treturn res.Flags, nil\n}", "title": "" }, { "docid": "f2bdf90cf2a4d71f27449c94bc6db5ca", "score": "0.4707321", "text": "func initFlags() {\n\tif config.Debug() {\n\t\tt.Pef()\n\t\tdefer t.Pxf()\n\t}\n\n\t// config file\n\trootCmd.PersistentFlags().StringVar(&config.ConfigFileName, configFlagKey, \"\",\n\t\tfmt.Sprintf(\"config file location. (default is %s{yaml,json,toml}\", config.ConfigFileRoot))\n\n\t// Verbose\n\tdefaultVerbose := false\n\trootCmd.PersistentFlags().BoolVarP(&verboseFlag, verboseFlagKey, \"v\",\n\t\tdefaultVerbose, \"Describe what is happening as its happening.\")\n\tconfig.Bind(config.VerboseKey, rootCmd.PersistentFlags().Lookup(verboseFlagKey))\n\n\t// Debug\n\tdefaultDebug := false\n\trootCmd.PersistentFlags().BoolVarP(&debugFlag, debugFlagKey, \"d\",\n\t\tdefaultDebug, \"Describe details about what's happening.\")\n\tconfig.Bind(config.DebugKey, rootCmd.PersistentFlags().Lookup(debugFlagKey))\n\n\t// Connection\n\tdefaultConnection := \"\"\n\trootCmd.PersistentFlags().StringVarP(&connectionFlag, connectionFlagKey, \"c\",\n\t\tdefaultConnection, \"Use the named connection (names defined in config file)\")\n\tconfig.Bind(connection.DefaultConnectionNameKey, rootCmd.PersistentFlags().Lookup(connectionFlagKey))\n\n\t// JSON\n\tdefaultJSON := false\n\trootCmd.PersistentFlags().BoolVarP(&jsonFlag, jsonFlagKey, \"j\",\n\t\tdefaultJSON, \"Print output in unencumbred JSON for easy scripting.\")\n\tconfig.Bind(t.JSONDisplayKey, rootCmd.PersistentFlags().Lookup(jsonFlagKey))\n\n\t// ScreenProfile\n\tdefaultScreenProfile := t.ScreenNoColorDefaultKey\n\trootCmd.PersistentFlags().StringVarP(&screenProfileFlag, screenProfileFlagKey, \"s\",\n\t\tdefaultScreenProfile, \"Set the screen profile for output (e.g. colors etc).\")\n\tconfig.Bind(t.ScreenProfileKey, rootCmd.PersistentFlags().Lookup(screenProfileFlagKey))\n}", "title": "" }, { "docid": "a7c5eff1b4688f88f20a2d2a71424910", "score": "0.47018152", "text": "func Features(opt string) map[string][]string {\n\tswitch opt {\n\tcase \"warwalk\":\n\t\treturn map[string][]string{\n\t\t\t\"GPS\": []string{\"lat\", \"lon\", \"alt\", \"spd\", \"heading\", \"fix\", \"connected\"},\n\t\t\t\"SSID\": []string{\"mac\", \"checksum\", \"type\", \"ssid\", \"beaconinfo\", \"cryptset\", \"cloaked\", \"firsttime\",\n\t\t\t\t\"lasttime\", \"maxrate\", \"beaconrate\", \"packets\", \"beacons\", \"dot11d\"},\n\t\t\t\"BSSID\": []string{\"bssid\", \"type\", \"llcpackets\", \"datapackets\", \"cryptpackets\", \"manuf\", \"channel\",\n\t\t\t\t\"firsttime\", \"lasttime\", \"atype\", \"rangeip\", \"netmaskip\", \"gatewayip\", \"signal_dbm\", \"minsignal_dbm\", \"maxsignal_dbm\"},\n\t\t\t\"ERROR\": []string{\"cmdid\", \"text\"},\n\t\t}\n\tcase \"gps-bssid\":\n\t\treturn map[string][]string{\n\t\t\t\"GPS\": []string{\"lat\", \"lon\", \"alt\", \"spd\", \"heading\", \"fix\", \"connected\"},\n\t\t\t\"BSSID\": []string{\"bssid\", \"type\", \"llcpackets\", \"datapackets\", \"cryptpackets\", \"manuf\", \"channel\",\n\t\t\t\t\"firsttime\", \"lasttime\", \"atype\", \"rangeip\", \"netmaskip\", \"gatewayip\", \"signal_dbm\", \"minsignal_dbm\", \"maxsignal_dbm\"},\n\t\t}\n\tdefault:\n\t\treturn map[string][]string{\n\t\t\t\"INFO\": []string{\"packets\", \"rate\", \"crypt\", \"dropped\", \"filtered\", \"llcpackets\", \"datapackets\"},\n\t\t\t\"STATUS\": []string{\"text\", \"flags\"},\n\t\t\t\"ERROR\": []string{\"cmdid\", \"text\"},\n\t\t\t\"ACK\": []string{\"cmdid\", \"text\"},\n\t\t\t\"TERMINATE\": []string{\"text\"},\n\t\t\t\"TIME\": []string{\"timesec\"},\n\t\t\t\"SOURCE\": []string{\"interface\", \"type\", \"username\", \"channel\", \"uuid\", \"packets\", \"hop\", \"velocity\",\n\t\t\t\t\"dwell\", \"hop_time_sec\", \"hop_time_usec\", \"channellist\", \"error\", \"warning\"},\n\t\t\t\"ALERT\": []string{\"sec\", \"usec\", \"header\", \"bssid\", \"source\", \"dest\", \"other\", \"channel\", \"text\"},\n\t\t\t\"BSSID\": []string{\"bssid\", \"type\", \"llcpackets\", \"datapackets\", \"cryptpackets\", \"manuf\", \"channel\",\n\t\t\t\t\"firsttime\", \"lasttime\", \"atype\", \"rangeip\", \"netmaskip\", \"gatewayip\", \"signal_dbm\", \"minsignal_dbm\", \"maxsignal_dbm\"},\n\t\t\t\"SSID\": []string{\"mac\", \"checksum\", \"type\", \"ssid\", \"beaconinfo\", \"cryptset\", \"cloaked\", \"firsttime\",\n\t\t\t\t\"lasttime\", \"maxrate\", \"beaconrate\", \"packets\", \"beacons\", \"dot11d\"},\n\t\t\t\"CLIENT\": []string{\"bssid\", \"mac\", \"type\", \"firsttime\", \"lasttime\", \"manuf\", \"llcpackets\", \"datapackets\",\n\t\t\t\t\"cryptpackets\", \"gpsfixed\", \"minlat\", \"minlon\", \"minalt\", \"maxlat\", \"maxlon\", \"maxalt\", \"agglat\", \"agglon\",\n\t\t\t\t\"aggalt\", \"signal_dbm\", \"noise_dbm\", \"minsignal_dbm\", \"minnoise_dbm\", \"maxsignal_dbm\", \"maxnoise_dbm\",\n\t\t\t\t\"signal_rssi\", \"noise_rssi\", \"minsignal_rssi\", \"minnoise_rssi\", \"maxsignal_rssi\", \"maxnoise_rssi\", \"bestlat\",\n\t\t\t\t\"bestlon\", \"bestalt\", \"atype\", \"ip\", \"gatewayip\", \"datasize\", \"maxseenrate\", \"encodingset\", \"carrierset\",\n\t\t\t\t\"decrypted\", \"channel\", \"fragments\", \"retries\", \"newpackets\", \"freqmhz\", \"cdpdevice\", \"cdpport\", \"dhcphost\",\n\t\t\t\t\"dhcpvendor\", \"datacryptset\"},\n\t\t\t\"BSSIDSRC\": []string{\"bssid\", \"uuid\", \"lasttime\", \"numpackets\"},\n\t\t\t\"CLISRC\": []string{\"bssid\", \"mac\", \"uuid\", \"lasttime\", \"numpackets\", \"signal_dbm\", \"minsignal_dbm\", \"maxsignal_dbm\"},\n\t\t\t\"NETTAG\": []string{\"bssid\", \"tag\", \"value\"},\n\t\t\t\"GPS\": []string{\"lat\", \"lon\", \"alt\", \"spd\", \"heading\", \"fix\", \"connected\"},\n\t\t\t\"CLITAG\": []string{\"bssid\", \"mac\", \"tag\", \"value\"},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d7266d28bbf6c03168ce0b454085f3c7", "score": "0.46997973", "text": "func (R *Runtime) Init() (err error) {\n\t// These are used to track if we found a file or not\n\t// contextFound, configFound, secretFound := false, false, false\n\n\t// First check config/secret flags, non-existence should err as user specified a flag\n\t// if they exist, we load into local because we prefer that later\n\t//if flags.RootPflags.Context != \"\" {\n\t//val, err := cuefig.LoadContextConfig(\"\", flags.RootPflags.Context)\n\t//if err != nil {\n\t//// Return early if they specify a file and we don't find it\n\t//return err\n\t//}\n\t//contextFound = true\n\t//R.ContextValue = val\n\t//R.ContextType = \"custom-context\"\n\t//}\n\t//if flags.RootPflags.Config != \"\" {\n\t//val, err := cuefig.LoadConfigConfig(\"\", flags.RootPflags.Config)\n\t//if err != nil {\n\t//// Return early if they specify a file and we don't find it\n\t//return err\n\t//}\n\t//configFound = true\n\t//R.ConfigValue = val\n\t//R.ConfigType = \"custom-config\"\n\t//}\n\t//if flags.RootPflags.Secret != \"\" {\n\t//val, err := cuefig.LoadSecretConfig(\"\", flags.RootPflags.Secret)\n\t//if err != nil {\n\t//// Return early if they specify a file and we don't find it\n\t//return err\n\t//}\n\t//secretFound = true\n\t//R.SecretValue = val\n\t//R.SecretType = \"custom-secret\"\n\t//}\n\n\t// Second, look for local config/secret\n\t//if !contextFound {\n\t//val, err := cuefig.LoadContextDefault()\n\t//// NOTE, we are doing the opposite of normal err checks here\n\t//if err == nil {\n\t//configFound = true\n\t//R.ContextValue = val\n\t//R.ContextType = \"local-context\"\n\t//}\n\t//}\n\t//if !configFound {\n\t//val, err := cuefig.LoadConfigDefault()\n\t//// NOTE, we are doing the opposite of normal err checks here\n\t//if err == nil {\n\t//configFound = true\n\t//R.ConfigValue = val\n\t//R.ConfigType = \"local-config\"\n\t//}\n\t//}\n\t//if !secretFound {\n\t//val, err := cuefig.LoadSecretDefault()\n\t//// NOTE, we are doing the opposite of normal err checks here\n\t//if err == nil {\n\t//secretFound = true\n\t//R.SecretValue = val\n\t//R.SecretType = \"local-secret\"\n\t//}\n\t//}\n\n\t// Finally, check for global config/secret\n\t//if !contextFound {\n\t//val, err := cuefig.LoadHofctxDefault()\n\t//// NOTE, we are doing the opposite of normal err checks here\n\t//if err == nil {\n\t//contextFound = true\n\t//R.ContextValue = val\n\t//R.ContextType = \"global-context\"\n\t//}\n\t//}\n\t//if !configFound {\n\t//val, err := cuefig.LoadHofcfgDefault()\n\t//// NOTE, we are doing the opposite of normal err checks here\n\t//if err == nil {\n\t//configFound = true\n\t//R.ConfigValue = val\n\t//R.ConfigType = \"global-config\"\n\t//}\n\t//}\n\t//if !secretFound {\n\t//val, err := cuefig.LoadHofshhDefault()\n\t//// NOTE, we are doing the opposite of normal err checks here\n\t//if err == nil {\n\t//secretFound = true\n\t//R.SecretValue = val\n\t//R.SecretType = \"global-secret\"\n\t//}\n\t//}\n\n\treturn err\n}", "title": "" }, { "docid": "0c518619f47b2efcefd521aba06bb5e2", "score": "0.46971914", "text": "func readFlags() {\n\tflag.StringVar(&devicePath, \"d\", \"/dev/ttyUSB0\", \"Device / socket path to connect to\")\n\tflag.StringVar(&serverEndpoint, \"s\", \"0.0.0.0:8000\", \"Server endpoint to listen on\")\n\tflag.DurationVar(&spinUpDuration, \"spinUpDuration\", 30*time.Second, \"Time to wait for fan / air flow to settle before taking the measurement\")\n\tflag.DurationVar(&measurementDelay, \"measurementDelay\", 5*time.Minute, \"Time to wait between measurements\")\n\n\tflag.Parse()\n\n\tmaxDataAge = 2 * measurementDelay\n}", "title": "" }, { "docid": "3668a956bc54eaa6471587b60465c178", "score": "0.46970424", "text": "func getLoggingDetailsFromContext(ctx context.Context, l *Logger) []LoggingDetail {\n\tif ctx == nil {\n\t\treturn nil\n\t}\n\tvar details []LoggingDetail\n\tif v, ok := lookupValue(ctx); ok {\n\t\tfor {\n\t\t\tdetails = append(append([]LoggingDetail{}, v.Details...), details...) // unshift\n\t\t\tif v.Super == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tv = v.Super\n\t\t}\n\t}\n\treturn details\n}", "title": "" }, { "docid": "c55b555c894407b8163d8a58d4891e36", "score": "0.46965668", "text": "func (env *Env) Flags() (uint, error) {\n\tvar _flags C.uint\n\tret := C.mdbx_env_get_flags(env._env, &_flags)\n\tif ret != success {\n\t\treturn 0, operrno(\"mdbx_env_get_flags\", ret)\n\t}\n\treturn uint(_flags), nil\n}", "title": "" }, { "docid": "a8aab8127b19c52cf0086fd4e04c0852", "score": "0.46929374", "text": "func (cliflags *CliFlags) GetCliFlags() error {\n\tcurrentDir, err := filepath.Abs(filepath.Dir(os.Args[0]))\n\tif err != nil {\n\t\treturn err\n\t}\n\tcliflags.DataDir = path.Join(currentDir, \"data\")\n\treturn nil\n}", "title": "" }, { "docid": "817d005de03f17f8c77682980e5f8d41", "score": "0.46928623", "text": "func retrieveModelModel111Flags(depth int, m *models.Model111, cmdPrefix string, cmd *cobra.Command) (error, bool) {\n\tretAdded := false\n\n\terr, applicationIdAdded := retrieveModel111ApplicationIDFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || applicationIdAdded\n\n\terr, bytesAdded := retrieveModel111BytesFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || bytesAdded\n\n\terr, categoryIdAdded := retrieveModel111CategoryIDFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || categoryIdAdded\n\n\terr, connectionStateAdded := retrieveModel111ConnectionStateFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || connectionStateAdded\n\n\terr, descriptionAdded := retrieveModel111DescriptionFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || descriptionAdded\n\n\terr, destinationAdded := retrieveModel111DestinationFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || destinationAdded\n\n\terr, enabledAdded := retrieveModel111EnabledFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || enabledAdded\n\n\terr, icmpTypeAdded := retrieveModel111IcmpTypeFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || icmpTypeAdded\n\n\terr, icmpv6TypeAdded := retrieveModel111Icmpv6TypeFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || icmpv6TypeAdded\n\n\terr, idAdded := retrieveModel111IDFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || idAdded\n\n\terr, inInterfaceAdded := retrieveModel111InInterfaceFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || inInterfaceAdded\n\n\terr, ipVersionAdded := retrieveModel111IPVersionFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || ipVersionAdded\n\n\terr, ipsecPolicyAdded := retrieveModel111IpsecPolicyFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || ipsecPolicyAdded\n\n\terr, logAdded := retrieveModel111LogFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || logAdded\n\n\terr, negateInInterfaceAdded := retrieveModel111NegateInInterfaceFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || negateInInterfaceAdded\n\n\terr, negateOutInterfaceAdded := retrieveModel111NegateOutInterfaceFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || negateOutInterfaceAdded\n\n\terr, outInterfaceAdded := retrieveModel111OutInterfaceFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || outInterfaceAdded\n\n\terr, packetsAdded := retrieveModel111PacketsFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || packetsAdded\n\n\terr, protocolAdded := retrieveModel111ProtocolFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || protocolAdded\n\n\terr, rejectWithAdded := retrieveModel111RejectWithFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || rejectWithAdded\n\n\terr, sourceAdded := retrieveModel111SourceFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || sourceAdded\n\n\terr, targetAdded := retrieveModel111TargetFlags(depth, m, cmdPrefix, cmd)\n\tif err != nil {\n\t\treturn err, false\n\t}\n\tretAdded = retAdded || targetAdded\n\n\treturn nil, retAdded\n}", "title": "" }, { "docid": "179423a9edd73e3702264b06874b6bd5", "score": "0.46854228", "text": "func ServerWithConfig(cfg *config.Config) []cli.Flag {\n\treturn []cli.Flag{\n\t\t&cli.BoolFlag{\n\t\t\tName: \"tracing-enabled\",\n\t\t\tUsage: \"Enable sending traces\",\n\t\t\tEnvVar: \"KONNECTD_TRACING_ENABLED\",\n\t\t\tDestination: &cfg.Tracing.Enabled,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-type\",\n\t\t\tValue: \"jaeger\",\n\t\t\tUsage: \"Tracing backend type\",\n\t\t\tEnvVar: \"KONNECTD_TRACING_TYPE\",\n\t\t\tDestination: &cfg.Tracing.Type,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-endpoint\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Endpoint for the agent\",\n\t\t\tEnvVar: \"KONNECTD_TRACING_ENDPOINT\",\n\t\t\tDestination: &cfg.Tracing.Endpoint,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-collector\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Endpoint for the collector\",\n\t\t\tEnvVar: \"KONNECTD_TRACING_COLLECTOR\",\n\t\t\tDestination: &cfg.Tracing.Collector,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"tracing-service\",\n\t\t\tValue: \"konnectd\",\n\t\t\tUsage: \"Service name for tracing\",\n\t\t\tEnvVar: \"KONNECTD_TRACING_SERVICE\",\n\t\t\tDestination: &cfg.Tracing.Service,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"debug-addr\",\n\t\t\tValue: \"0.0.0.0:9134\",\n\t\t\tUsage: \"Address to bind debug server\",\n\t\t\tEnvVar: \"KONNECTD_DEBUG_ADDR\",\n\t\t\tDestination: &cfg.Debug.Addr,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"debug-token\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Token to grant metrics access\",\n\t\t\tEnvVar: \"KONNECTD_DEBUG_TOKEN\",\n\t\t\tDestination: &cfg.Debug.Token,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"debug-pprof\",\n\t\t\tUsage: \"Enable pprof debugging\",\n\t\t\tEnvVar: \"KONNECTD_DEBUG_PPROF\",\n\t\t\tDestination: &cfg.Debug.Pprof,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"debug-zpages\",\n\t\t\tUsage: \"Enable zpages debugging\",\n\t\t\tEnvVar: \"KONNECTD_DEBUG_ZPAGES\",\n\t\t\tDestination: &cfg.Debug.Zpages,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"http-addr\",\n\t\t\tValue: \"0.0.0.0:9130\",\n\t\t\tUsage: \"Address to bind http server\",\n\t\t\tEnvVar: \"KONNECTD_HTTP_ADDR\",\n\t\t\tDestination: &cfg.HTTP.Addr,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"http-root\",\n\t\t\tValue: \"/\",\n\t\t\tUsage: \"Root path of http server\",\n\t\t\tEnvVar: \"KONNECTD_HTTP_ROOT\",\n\t\t\tDestination: &cfg.HTTP.Root,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"http-namespace\",\n\t\t\tValue: \"com.owncloud.web\",\n\t\t\tUsage: \"Set the base namespace for service discovery\",\n\t\t\tEnvVar: \"KONNECTD_HTTP_NAMESPACE\",\n\t\t\tDestination: &cfg.HTTP.Namespace,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"identity-manager\",\n\t\t\tValue: \"ldap\",\n\t\t\tUsage: \"Identity manager (one of ldap,kc,cookie,dummy)\",\n\t\t\tEnvVar: \"KONNECTD_IDENTITY_MANAGER\",\n\t\t\tDestination: &cfg.Konnectd.IdentityManager,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"transport-tls-cert\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Certificate file for transport encryption\",\n\t\t\tEnvVar: \"KONNECTD_TRANSPORT_TLS_CERT\",\n\t\t\tDestination: &cfg.HTTP.TLSCert,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"transport- tls-key\",\n\t\t\tValue: \"\",\n\t\t\tUsage: \"Secret file for transport encryption\",\n\t\t\tEnvVar: \"KONNECTD_TRANSPORT_TLS_KEY\",\n\t\t\tDestination: &cfg.HTTP.TLSKey,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"iss\",\n\t\t\tUsage: \"OIDC issuer URL\",\n\t\t\tEnvVar: \"KONNECTD_ISS\",\n\t\t\tValue: \"https://127.0.0.1:9130\",\n\t\t\tDestination: &cfg.Konnectd.ISS,\n\t\t},\n\t\t&cli.StringSliceFlag{\n\t\t\tName: \"signing-private-key\",\n\t\t\tUsage: \"Full path to PEM encoded private key file (must match the --signing-method algorithm)\",\n\t\t\tEnvVar: \"KONNECTD_SIGNING_PRIVATE_KEY\",\n\t\t\tValue: nil,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"signing-kid\",\n\t\t\tUsage: \"Value of kid field to use in created tokens (uniquely identifying the signing-private-key)\",\n\t\t\tEnvVar: \"KONNECTD_SIGNING_KID\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.SigningKid,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"validation-keys-path\",\n\t\t\tUsage: \"Full path to a folder containg PEM encoded private or public key files used for token validaton (file name without extension is used as kid)\",\n\t\t\tEnvVar: \"KONNECTD_VALIDATION_KEYS_PATH\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.ValidationKeysPath,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"encryption-secret\",\n\t\t\tUsage: \"Full path to a file containing a %d bytes secret key\",\n\t\t\tEnvVar: \"KONNECTD_ENCRYPTION_SECRET\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.EncryptionSecretFile,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"signing-method\",\n\t\t\tUsage: \"JWT default signing method\",\n\t\t\tEnvVar: \"KONNECTD_SIGNING_METHOD\",\n\t\t\tValue: \"PS256\",\n\t\t\tDestination: &cfg.Konnectd.SigningMethod,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"uri-base-path\",\n\t\t\tUsage: \"Custom base path for URI endpoints\",\n\t\t\tEnvVar: \"KONNECTD_URI_BASE_PATH\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.URIBasePath,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"sign-in-uri\",\n\t\t\tUsage: \"Custom redirection URI to sign-in form\",\n\t\t\tEnvVar: \"KONNECTD_SIGN_IN_URI\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.SignInUri,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"signed-out-uri\",\n\t\t\tUsage: \"Custom redirection URI to signed-out goodbye page\",\n\t\t\tEnvVar: \"KONNECTD_SIGN_OUT_URI\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.SignedOutUri,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"authorization-endpoint-uri\",\n\t\t\tUsage: \"Custom authorization endpoint URI\",\n\t\t\tEnvVar: \"KONNECTD_ENDPOINT_URI\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.AuthorizationEndpointURI,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"endsession-endpoint-uri\",\n\t\t\tUsage: \"Custom endsession endpoint URI\",\n\t\t\tEnvVar: \"KONNECTD_ENDSESSION_ENDPOINT_URI\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.EndsessionEndpointURI,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"identifier-client-path\",\n\t\t\tUsage: \"Path to the identifier web client base folder\",\n\t\t\tEnvVar: \"KONNECTD_IDENTIFIER_CLIENT_PATH\",\n\t\t\tValue: \"./identifier-webapp\",\n\t\t\tDestination: &cfg.Konnectd.IdentifierClientPath,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"identifier-registration-conf\",\n\t\t\tUsage: \"Path to a identifier-registration.yaml configuration file\",\n\t\t\tEnvVar: \"KONNECTD_IDENTIFIER_REGISTRATION_CONF\",\n\t\t\tValue: \"./identifier-registration.yaml\",\n\t\t\tDestination: &cfg.Konnectd.IdentifierRegistrationConf,\n\t\t},\n\t\t&cli.StringFlag{\n\t\t\tName: \"identifier-scopes-conf\",\n\t\t\tUsage: \"Path to a scopes.yaml configuration file\",\n\t\t\tEnvVar: \"KONNECTD_IDENTIFIER_SCOPES_CONF\",\n\t\t\tValue: \"\",\n\t\t\tDestination: &cfg.Konnectd.IdentifierScopesConf,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"insecure\",\n\t\t\tUsage: \"Disable TLS certificate and hostname validation\",\n\t\t\tEnvVar: \"KONNECTD_INSECURE\",\n\t\t\tDestination: &cfg.Konnectd.Insecure,\n\t\t},\n\t\t&cli.StringSliceFlag{\n\t\t\tName: \"trusted-proxy\",\n\t\t\tUsage: \"Trusted proxy IP or IP network (can be used multiple times)\",\n\t\t\tEnvVar: \"KONNECTD_TRUSTED_PROXY\",\n\t\t\tValue: nil,\n\t\t},\n\t\t&cli.StringSliceFlag{\n\t\t\tName: \"allow-scope\",\n\t\t\tUsage: \"Allow OAuth 2 scope (can be used multiple times, if not set default scopes are allowed)\",\n\t\t\tEnvVar: \"KONNECTD_ALLOW_SCOPE\",\n\t\t\tValue: nil,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"allow-client-guests\",\n\t\t\tUsage: \"Allow sign in of client controlled guest users\",\n\t\t\tEnvVar: \"KONNECTD_ALLOW_CLIENT_GUESTS\",\n\t\t\tDestination: &cfg.Konnectd.AllowClientGuests,\n\t\t},\n\t\t&cli.BoolFlag{\n\t\t\tName: \"allow-dynamic-client-registration\",\n\t\t\tUsage: \"Allow dynamic OAuth2 client registration\",\n\t\t\tEnvVar: \"KONNECTD_ALLOW_DYNAMIC_CLIENT_REGISTRATION\",\n\t\t\tDestination: &cfg.Konnectd.AllowDynamicClientRegistration,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f5c995b57cb8695fee6518545c5c471b", "score": "0.46846217", "text": "func InitFlags() {\n\tflag.StringVar(&brocadeVTMServer, \"server\", \"https://\"+os.Getenv(\"BROCADEVTM_SERVER\"),\n\t\t\"Brocade vTM API server hostname or address. (Env: BROCADEVTM_SERVER)\")\n\tflag.IntVar(&brocadeVTMPort, \"port\", 443,\n\t\t\"Brocade vTM API server port. Default:443\")\n\tflag.StringVar(&brocadeVTMUsername, \"username\", os.Getenv(\"BROCADEVTM_USERNAME\"),\n\t\t\"Brocade vTM authentication username (Env: BROCADEVTM_USERNAME)\")\n\tflag.StringVar(&brocadeVTMPassword, \"password\", os.Getenv(\"BROCADEVTM_PASSWORD\"),\n\t\t\"Brocade vTM authentication password (Env: BROCADEVTM_PASSWORD)\")\n\tflag.BoolVar(&debug, \"debug\", false, \"Debug output. Default:false\")\n\tflag.DurationVar(&timeout, \"timeout\", 300, \"Client timeout value. Default: 300\")\n\n}", "title": "" }, { "docid": "2453503d085f81ad72735a5e12c6dd85", "score": "0.46800464", "text": "func configureFlags(api *operations.TodoListAPI) {\n\t// api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... }\n}", "title": "" }, { "docid": "f86488cc65bcd76ec861705376b551fb", "score": "0.46729583", "text": "func (cd ContextDefinition) GetContexts() ([]ContextDefinition, []string) {\n\tvar ctx []ContextDefinition\n\tvar ctxList []string\n\n\tif err := viper.UnmarshalKey(\"contexts\", &ctx); err != nil {\n\t\tlog.Fatalf(\"Error reading contexts: %s\", err)\n\t}\n\n\t// ctxList string slice needed by promptui; adding to list only contexts with all the fields set\n\tfor _, v := range ctx {\n\t\tif v.Name != \"\" && v.Endpoint != \"\" && v.Auth != \"\" && v.Username != \"\" && v.Password != \"\" {\n\t\t\tctxList = append(ctxList, v.Name)\n\t\t}\n\t}\n\treturn ctx, ctxList\n}", "title": "" }, { "docid": "238627d7373ad9650f2fea22d738b93f", "score": "0.46701384", "text": "func (window *Window) GetFlags() uint32 {\n\tret, _, _ := getWindowFlags.Call(uintptr(unsafe.Pointer(window)))\n\treturn uint32(ret)\n}", "title": "" }, { "docid": "11ecfc16aedab6b0023e7876c22776a7", "score": "0.46614233", "text": "func (o *Options) AddFlags(fs *pflag.FlagSet) {\n\tif o == nil {\n\t\treturn\n\t}\n\n\tfs.BoolVar(&o.LeaderElection.LeaderElect, \"leader-elect\", true, \"Enable leader election, which must be true when running multi instances.\")\n\tfs.StringVar(&o.LeaderElection.ResourceName, \"leader-elect-resource-name\", \"karmada-scheduler\", \"The name of resource object that is used for locking during leader election.\")\n\tfs.StringVar(&o.LeaderElection.ResourceNamespace, \"leader-elect-resource-namespace\", util.NamespaceKarmadaSystem, \"The namespace of resource object that is used for locking during leader election.\")\n\tfs.StringVar(&o.KubeConfig, \"kubeconfig\", o.KubeConfig, \"Path to karmada control plane kubeconfig file.\")\n\tfs.StringVar(&o.Master, \"master\", o.Master, \"The address of the Kubernetes API server. Overrides any value in KubeConfig. Only required if out-of-cluster.\")\n\tfs.StringVar(&o.BindAddress, \"bind-address\", defaultBindAddress, \"The IP address on which to listen for the --secure-port port.\")\n\tfs.IntVar(&o.SecurePort, \"secure-port\", defaultPort, \"The secure port on which to serve HTTPS.\")\n\tfs.Float32Var(&o.KubeAPIQPS, \"kube-api-qps\", 40.0, \"QPS to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.\")\n\tfs.IntVar(&o.KubeAPIBurst, \"kube-api-burst\", 60, \"Burst to use while talking with karmada-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.\")\n\tfs.BoolVar(&o.EnableSchedulerEstimator, \"enable-scheduler-estimator\", false, \"Enable calling cluster scheduler estimator for adjusting replicas.\")\n\tfs.BoolVar(&o.DisableSchedulerEstimatorInPullMode, \"disable-scheduler-estimator-in-pull-mode\", false, \"Disable the scheduler estimator for clusters in pull mode, which takes effect only when enable-scheduler-estimator is true.\")\n\tfs.DurationVar(&o.SchedulerEstimatorTimeout.Duration, \"scheduler-estimator-timeout\", 3*time.Second, \"Specifies the timeout period of calling the scheduler estimator service.\")\n\tfs.StringVar(&o.SchedulerEstimatorServicePrefix, \"scheduler-estimator-service-prefix\", \"karmada-scheduler-estimator\", \"The prefix of scheduler estimator service name\")\n\tfs.IntVar(&o.SchedulerEstimatorPort, \"scheduler-estimator-port\", defaultEstimatorPort, \"The secure port on which to connect the accurate scheduler estimator.\")\n\tfs.BoolVar(&o.EnableEmptyWorkloadPropagation, \"enable-empty-workload-propagation\", false, \"Enable workload with replicas 0 to be propagated to member clusters.\")\n\tfs.StringSliceVar(&o.Plugins, \"plugins\", []string{\"*\"},\n\t\tfmt.Sprintf(\"A list of plugins to enable. '*' enables all build-in and customized plugins, 'foo' enables the plugin named 'foo', '*,-foo' disables the plugin named 'foo'.\\nAll build-in plugins: %s.\", strings.Join(frameworkplugins.NewInTreeRegistry().FactoryNames(), \",\")))\n\tfs.StringVar(&o.SchedulerName, \"scheduler-name\", scheduler.DefaultScheduler, \"SchedulerName represents the name of the scheduler. default is 'default-scheduler'.\")\n\tfeatures.FeatureGate.AddFlag(fs)\n\to.ProfileOpts.AddFlags(fs)\n}", "title": "" }, { "docid": "ef216f9ade430640a50509dd98dd4709", "score": "0.46541536", "text": "func (h *Handler) GetContextsFromK8SConfig(w http.ResponseWriter, req *http.Request) {\n\t_ = req.ParseMultipartForm(1 << 20)\n\tvar k8sConfigBytes []byte\n\n\tk8sfile, _, err := req.FormFile(\"k8sfile\")\n\tif err != nil {\n\t\tlogrus.Error(ErrFormFile(err))\n\t\thttp.Error(w, ErrFormFile(err).Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tdefer func() {\n\t\t_ = k8sfile.Close()\n\t}()\n\tk8sConfigBytes, err = ioutil.ReadAll(k8sfile)\n\tif err != nil {\n\t\tlogrus.Error(ErrReadConfig(err))\n\t\thttp.Error(w, ErrReadConfig(err).Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tccfg, err := clientcmd.Load(k8sConfigBytes)\n\tif err != nil {\n\t\tlogrus.Error(ErrLoadConfig(err))\n\t\thttp.Error(w, ErrLoadConfig(err).Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tcontexts := []*models.K8SContext{}\n\tfor contextName, contextVal := range ccfg.Contexts {\n\t\tct := &models.K8SContext{\n\t\t\tContextName: contextName,\n\t\t\tClusterName: contextVal.Cluster,\n\t\t\tIsCurrentContext: (contextName == ccfg.CurrentContext),\n\t\t}\n\t\tcontexts = append(contexts, ct)\n\t}\n\n\terr = json.NewEncoder(w).Encode(contexts)\n\tif err != nil {\n\t\tlogrus.Error(ErrMarshal(err, \"kube-context\"))\n\t\thttp.Error(w, ErrMarshal(err, \"kube-context\").Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "579415114101dd1a9720184c6c7c62ff", "score": "0.46490037", "text": "func (l *Logger) Flags() int {\n\treturn l.flags\n}", "title": "" } ]
d43f551562e0cc23d0d49cc0177e70ae
handleReapMember is used to handle members that have been reaped after a prolonged failure. They are deregistered.
[ { "docid": "cf02831be6b93d28aca1bead594e1f2f", "score": "0.86849403", "text": "func (c *cerebrum) handleReapMember(member serf.Member, details *NodeDetails) error {\n\treturn c.handleDeregisterMember(StatusReaped, member, details)\n}", "title": "" } ]
[ { "docid": "62cd0ecc20c56fe3590173d8b81883fe", "score": "0.6606584", "text": "func (c *cerebrum) handleDeregisterMember(reason NodeStatus, member serf.Member, details *NodeDetails) error {\n\t// Do not deregister ourself. This can only happen if the current leader\n\t// is leaving. Instead, we should allow a follower to take-over and\n\t// deregister us later.\n\tif member.Name == c.config.NodeName {\n\t\tc.logger.Warn(\"deregistering self should be done by follower\", \"node\", c.config.NodeName)\n\t\treturn nil\n\t}\n\n\t// Remove from Raft peers if this was a server\n\tif err := c.removeConsulServer(member, details.Port); err != nil {\n\t\treturn err\n\t}\n\n\t// Deregister the node\n\tc.logger.Info(\"deregistering member\", \"name\", member.Name, \"reason\", reason)\n\treturn c.updateNodeStatus(details, reason)\n}", "title": "" }, { "docid": "b89fbd4a8aa0c78fe0fe45c67df78fde", "score": "0.58916444", "text": "func (c *cerebrum) handleFailedMember(member serf.Member, details *NodeDetails) error {\n\tc.logger.Info(\"member failed, marking health critical\", \"member\", member.Name)\n\treturn c.updateNodeStatus(details, StatusFailed)\n}", "title": "" }, { "docid": "544a304a706d7a175fa7dd1c6384c2a5", "score": "0.58081716", "text": "func reap(user UserInfo) {\n\tfmt.Printf(\"server: [%s] disconnected due to late heartbeat\\n\", user)\n\tremoveUser(user)\n\tfmt.Println(\"Users: \", registeredUsers)\n}", "title": "" }, { "docid": "09159958b34742e3cf7bfd5087885e7d", "score": "0.5666168", "text": "func (ng *NatsGroup) processMemberHb(hb *natsGroupHB) {\n\tng.Lock()\n\tdefer ng.Unlock()\n\n\tmember := ng.members[hb.ID]\n\n\t// A new member has been discovered!\n\tif member == nil {\n\t\tng.addMember(hb.Name, hb.ID, hb.Status)\n\t} else {\n\t\tng.updateMember(member, hb.Status)\n\t}\n}", "title": "" }, { "docid": "fb5a77e6ff30ad82ae6123492c9fe2e1", "score": "0.5651801", "text": "func (h *handler) reap(group string) {\n\th.l.Lock()\n\tdefer h.l.Unlock()\n\n\tif t, ok := h.groupReap[group]; ok {\n\t\tt.Stop()\n\t\tdelete(h.groupReap, group)\n\t}\n\tdelete(h.groups, group)\n}", "title": "" }, { "docid": "388a33452d9fe4021d40a6936de4d703", "score": "0.56464964", "text": "func (t *PPMQPinger) RespHandle(c pprpc.RPCConn, pkg *packets.CmdPacket, resp *PPMQPing.Resp) (err error) {\n\tif pkg.Code != 0 {\n\t\tlogs.Logger.Errorf(\"%s, %s, Seq: %d, Response recv error code: %d.\",\n\t\t\tc, pkg.CmdName, pkg.CmdSeq, pkg.Code)\n\t\treturn\n\t}\n\tif resp.OutsideIpaddr != \"\" {\n\t\tlogs.Logger.Debugf(\"WanIpaddr: %s.\", resp.OutsideIpaddr)\n\t}\n\treturn\n}", "title": "" }, { "docid": "249ccaa3efba5e75de0cc40da8eaa56e", "score": "0.56235766", "text": "func (c *cerebrum) handleAliveMember(member serf.Member, details *NodeDetails) error {\n\n\t// Attempt to join the consul server\n\tif err := c.joinConsulServer(member, details); err != nil {\n\t\treturn err\n\t}\n\n\tc.logger.Info(\"member joined, marking health alive\", \"member\", member.Name)\n\treturn c.updateNodeStatus(details, StatusAlive)\n}", "title": "" }, { "docid": "df7d38d5ac161a22aff8fb576d28c4af", "score": "0.56146455", "text": "func (c *cerebrum) reconcileMember(member serf.Member) (err error) {\n\n\t// Check if this is a member we should handle\n\tvar node *NodeDetails\n\tif node, err = GetNodeDetails(member); err != nil {\n\t\treturn err\n\t}\n\n\t// Validate node is in the same data center\n\tif node.DataCenter != c.config.DataCenter {\n\t\tc.logger.Warn(\"skipping reconcile of node\", \"node\", member)\n\t\treturn nil\n\t}\n\n\tswitch member.Status {\n\tcase serf.StatusAlive:\n\t\terr = c.handleAliveMember(member, node)\n\tcase serf.StatusFailed:\n\t\terr = c.handleFailedMember(member, node)\n\tcase serf.StatusLeft:\n\t\terr = c.handleLeftMember(member, node)\n\tcase StatusReap:\n\t\terr = c.handleReapMember(member, node)\n\t}\n\tif err != nil {\n\t\tc.logger.Error(\"failed to reconcile member\", \"member\", member, \"err\", err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d1a5dbf5f26b66b2fcf48260b396cc86", "score": "0.5424331", "text": "func (c *cerebrum) handleLeftMember(member serf.Member, details *NodeDetails) error {\n\treturn c.handleDeregisterMember(StatusLeft, member, details)\n}", "title": "" }, { "docid": "a7e376bc8dabc146edfa292978cf3876", "score": "0.5294043", "text": "func (p *Provider) deregisterMember(timeout time.Duration) error {\n\tplog.Info(fmt.Sprintf(\"Deregistering service %s from %s\", p.podName, p.address))\n\n\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\tdefer cancel()\n\n\tpod, err := p.client.CoreV1().Pods(p.retrieveNamespace()).Get(ctx, p.podName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to get own pod information for %s: %w\", p.podName, err)\n\t}\n\n\tlabels := pod.GetLabels()\n\n\tfor labelKey := range labels {\n\t\tif strings.HasPrefix(labelKey, LabelPrefix) {\n\t\t\tdelete(labels, labelKey)\n\t\t}\n\t}\n\n\tpod.SetLabels(labels)\n\n\treturn p.replacePodLabels(ctx, pod)\n}", "title": "" }, { "docid": "e147359b565e8512f344fdcf90ae86f7", "score": "0.50521505", "text": "func (n *OpenBazaarNode) handleUnFollowMessage(from peer.ID, message *pb.Message) error {\n\tdefer n.sendAckMessage(message.MessageID, from)\n\n\tif n.isDuplicate(message) {\n\t\treturn nil\n\t}\n\n\tlog.Infof(\"Received UNFOLLOW message from %s\", from)\n\n\tvar ErrNotFollowing = errors.New(\"peer not following us\")\n\n\terr := n.repo.DB().Update(func(tx database.Tx) error {\n\t\tfollowers, err := tx.GetFollowers()\n\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\n\t\texists := false\n\t\tfor i, pid := range followers {\n\t\t\tif pid == from.Pretty() {\n\t\t\t\texists = true\n\t\t\t\tfollowers = append(followers[:i], followers[i+1:]...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !exists {\n\t\t\treturn ErrNotFollowing\n\t\t}\n\n\t\treturn tx.SetFollowers(followers)\n\t})\n\tif err != nil && err != ErrNotFollowing {\n\t\treturn err\n\t} else if err == ErrNotFollowing {\n\t\tlog.Debugf(\"Received UNFOLLOW message from peer %s that was not following us\", from)\n\t\treturn nil\n\t}\n\n\tn.eventBus.Emit(&events.Unfollow{\n\t\tPeerID: from.Pretty(),\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "71b46702ed30f42ce0dc561d86ab3711", "score": "0.5011168", "text": "func rebalanceMemberRoles(s *state.State, gateway *cluster.Gateway, r *http.Request, unavailableMembers []string) error {\n\tif s.ShutdownCtx.Err() != nil {\n\t\treturn nil\n\t}\n\nagain:\n\taddress, nodes, err := cluster.Rebalance(s, gateway, unavailableMembers)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif address == \"\" {\n\t\t// Nothing to do.\n\t\treturn nil\n\t}\n\n\t// Process demotions of offline nodes immediately.\n\tfor _, node := range nodes {\n\t\tif node.Address != address || node.Role != db.RaftSpare {\n\t\t\tcontinue\n\t\t}\n\n\t\tif cluster.HasConnectivity(s.Endpoints.NetworkCert(), s.ServerCert(), address) {\n\t\t\tbreak\n\t\t}\n\n\t\tlogger.Info(\"Demoting offline member during rebalance\", logger.Ctx{\"candidateAddress\": node.Address})\n\t\terr := gateway.DemoteOfflineNode(node.ID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Demote offline node %s: %w\", node.Address, err)\n\t\t}\n\n\t\tgoto again\n\t}\n\n\t// Tell the node to promote itself.\n\tlogger.Info(\"Promoting member during rebalance\", logger.Ctx{\"candidateAddress\": address})\n\terr = changeMemberRole(s, r, address, nodes)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgoto again\n}", "title": "" }, { "docid": "23c85b8ee37414e837f948645aed8285", "score": "0.5004884", "text": "func (ng *NatsGroup) hbHandler(msg *nats.Msg) {\n\tvar hb natsGroupHB\n\tif err := json.Unmarshal(msg.Data, &hb); err != nil {\n\t\tfmt.Printf(\"natsgroup: error unmarshalling hb.\")\n\t\treturn\n\t}\n\n\tng.processMemberHb(&hb)\n}", "title": "" }, { "docid": "c3b41b323a36f578ee354054ac88dc3e", "score": "0.4993004", "text": "func (c *RPCClient) deregisterHandler(seq uint64) {\n\tc.dispatchLock.Lock()\n\tseqH, ok := c.dispatch[seq]\n\tdelete(c.dispatch, seq)\n\tc.dispatchLock.Unlock()\n\n\tif ok {\n\t\tseqH.Cleanup()\n\t}\n}", "title": "" }, { "docid": "9f355f4d79ef08745891c1d7a2ddca2e", "score": "0.49318027", "text": "func (oh *OrganizationHandler) ReactivateMember(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tvars := mux.Vars(r)\n\torgId, memberId := vars[\"id\"], vars[\"mem_id\"]\n\n\t// check that org_id is valid\n\terr := ValidateOrg(orgId)\n\tif err != nil {\n\t\tutils.GetError(err, http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\t// Check if member id is valid\n\tpMemId, err := primitive.ObjectIDFromHex(memberId)\n\tif err != nil {\n\t\tutils.GetError(errors.New(\"invalid id\"), http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\tmemberDoc, _ := utils.GetMongoDbDoc(MemberCollectionName, bson.M{\"_id\": pMemId, \"org_id\": orgId})\n\tif memberDoc == nil {\n\t\tfmt.Printf(\"member with id %s doesn't exist!\", memberId)\n\t\tutils.GetError(errors.New(\"member with id doesn't exist\"), http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\tif memberDoc[\"deleted\"] == false {\n\t\tutils.GetError(errors.New(\"member is active\"), http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\tActivatedMember := bson.M{\"deleted\": false, \"deleted_at\": time.Time{}}\n\tres, err := utils.UpdateOneMongoDbDoc(MemberCollectionName, memberId, ActivatedMember)\n\n\tif err != nil {\n\t\tutils.GetError(fmt.Errorf(\"an error occured: %s\", err), http.StatusInternalServerError, w)\n\t}\n\n\tif res.ModifiedCount != 1 {\n\t\tutils.GetError(errors.New(\"an error occured, cannot activate user\"), http.StatusInternalServerError, w)\n\t\treturn\n\t}\n\n\t// publish update to subscriber\n\teventChannel := fmt.Sprintf(\"organizations_%s\", orgId)\n\tevent := utils.Event{Identifier: memberId, Type: \"User\", Event: ReactivateOrganizationMember, Channel: eventChannel, Payload: make(map[string]interface{})}\n\tgo utils.Emitter(event)\n\tutils.GetSuccess(\"successfully reactivated member\", nil, w)\n}", "title": "" }, { "docid": "1f38c1007c5f6a54757c0dd3b2327c90", "score": "0.48634586", "text": "func (p *peer) handleRevealEntryMsg(msg *wire.MsgRevealEntry) {\n\t// Add the msg to inbound msg queue\n\tif !ClientOnly {\n\t\tinMsgQueue <- msg\n\t}\n}", "title": "" }, { "docid": "1bcabec05f9f19692466cd8292b526f4", "score": "0.4830707", "text": "func (c *safeMembersCounter) addMember(memberAddress string, memberName string) {\n\n\tc.mux.Lock()\n\n\tc.activeMembersByAddress = append(c.activeMembersByAddress, memberAddress)\n\tc.activeMembersByName = append(c.activeMembersByName, memberName)\n\n\tif len(c.activeMembersByAddress) > 1 {\n\t\tmembershipservice.needRestartSendingHeartBeats = true\n\t\tmembershipservice.needRestartMonitoringHeartBeats = true\n\n\t\tmslog(fmt.Sprintf(\"************** ADD NEW JOIN ('%s','%s) at %s. Active members: len = %d, [%s ..... %s]\\n\", memberAddress, memberName, ConvertCurrentTimeToString(), len(c.activeMembersByAddress), c.activeMembersByAddress, c.activeMembersByName))\n\t}\n\n\tc.mux.Unlock()\n}", "title": "" }, { "docid": "0b3d42d1b6f0b29ba4bafa19b7372ecd", "score": "0.47976536", "text": "func (p *project) UnassignMember(member globalregistry.ProjectMember) error {\n\treturn fmt.Errorf(\"cannot assign member to a project in ACR: %w\",\n\t\tglobalregistry.ErrNotImplemented)\n}", "title": "" }, { "docid": "6559d2e93307584859887c14e2a72a0a", "score": "0.47943172", "text": "func (t *PPMQGetSublister) RespHandle(c pprpc.RPCConn, pkg *packets.CmdPacket, resp *PPMQGetSublist.Resp) (err error) {\n\tif pkg.Code != 0 {\n\t\tlogs.Logger.Errorf(\"%s, %s, Seq: %d, Response recv error code: %d.\",\n\t\t\tc, pkg.CmdName, pkg.CmdSeq, pkg.Code)\n\t\treturn\n\t}\n\tfor _, v := range resp.Topics {\n\t\tlogs.Logger.Debugf(\"Topic: %s.\", v.Topic)\n\t}\n\treturn\n}", "title": "" }, { "docid": "e041645ecc7dab251fdabfb8b73eedc0", "score": "0.47535458", "text": "func (s *RedisServer) onBMRemove(cmdType raftcmdpb.CMDType, cmd redis.Command, session *session) ([]byte, error) {\n\targs := cmd.Args()\n\tif len(args) < 2 {\n\t\trsp := pool.AcquireResponse()\n\t\trsp.ErrorResult = redis.ErrInvalidCommandResp\n\t\tsession.onResp(rsp)\n\t\treturn nil, nil\n\t}\n\n\treturn s.store.OnRedisCommand(session.id, cmdType, cmd, s.onResp)\n}", "title": "" }, { "docid": "73772c77db27379f8a838e99a88a70de", "score": "0.4727268", "text": "func reaper() {\n\tfor {\n\t\tlog.Println(\"Trying to reap game instances...\")\n\t\tlock.Lock()\n\t\tfor key, lobby := range lobbies {\n\t\t\tstatus := statuses[key]\n\t\t\tif lobby.Host == defaultHost && lobby.NumPlayers == 0 && status.PlayersJoined {\n\t\t\t\tlog.Printf(\"Trying to reap process with id %d\", status.Pid)\n\t\t\t\terr := syscall.Kill(status.Pid, syscall.SIGKILL)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Failed to reap process with id %d\", status.Pid)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tdelete(lobbies, key)\n\t\t\t\tdelete(statuses, key)\n\t\t\t\tlog.Printf(\"Succesfully reaped process with id %d\", status.Pid)\n\t\t\t}\n\t\t}\n\t\tlock.Unlock()\n\t\ttime.Sleep(10 * time.Second)\n\t}\n}", "title": "" }, { "docid": "10231c6963695f759aeebdb13dd48f0a", "score": "0.4699508", "text": "func (p *Player) rebind(ws *websocket.Conn) {\n\tif p.ws == ws {\n\t\tp.cl.Warn(\"player rebind websocket failed: ws same instance\")\n\t\treturn\n\t}\n\n\tp.unbind()\n\tp.ws = ws\n}", "title": "" }, { "docid": "0e7d9f7370770ec123aa118894e9a59e", "score": "0.46758413", "text": "func (h *ShutdownHandler) Handler(event discovery.MemberEvent) error {\n\tlog.Debugf(logTagListener, \"shutdown handler received message: %v\", event)\n\tswitch event.Type {\n\tcase discovery.EventMemberJoin:\n\t\tlog.Debugf(logTagListener, \"shutdown handler ignored message: %v\", event)\n\tcase discovery.EventMemberFailed:\n\t\th.handle(event.Servers)\n\tcase discovery.EventMemberLeave:\n\t\th.handle(event.Servers)\n\tcase discovery.EventMemberReap:\n\t\th.handle(event.Servers)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "36078fb7eb6701481e4f797333f92539", "score": "0.4666007", "text": "func handleRebalanceQuery(writer http.ResponseWriter, req *http.Request) *SwarmError {\n\tresponse := BaseResponse{\n\t\tVersion: SWARM_VERSION,\n\t\tTimestamp: time.Now(),\n\t\tStatus: STATUS_OK,\n\t}\n\n\t// process params\n\tswarmError, params := processParams(req, []ParamVerifier{\n\t\tParamVerifier{\"source\", verifyNothing},\n\t})\n\tif swarmError != nil {\n\t\treturn swarmError\n\t}\n\tnodeIp := params[0]\n\n\t// check rebalance status\n\tif status, ok := REPAIR_STATUS.Get(nodeIp); ok {\n\t\tif time.Now().After(status.Last.Add(MAX_REBALANCE_IDLE)) {\n\t\t\t// delete idle process\n\t\t\tREPAIR_STATUS.Delete(nodeIp)\n\t\t} else {\n\t\t\t// a rebalance process running for the same node\n\t\t\tresponse.Status = STATUS_ERROR\n\t\t\tresponse.Desc = ADMIN_REBALANCE_DUPLICATED\n\t\t}\n\t}\n\n\t// check ongoing rebalance process\n\tif len(REPAIR_STATUS.Data) > MAX_CONCURRENT_REPAIR {\n\t\tresponse.Status = STATUS_ERROR\n\t\tresponse.Desc = ADMIN_REBALANCE_EXCEED\n\t}\n\n\t// response\n\tencoder := gob.NewEncoder(writer)\n\tif err := encoder.Encode(response); err != nil {\n\t\treturn SwarmErrorf(http.StatusInternalServerError, \"Encode error: %s\", err.Error())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "16fa6adaef32e8f29d989b633cec510a", "score": "0.46554175", "text": "func (s *BaseASLListener) ExitMember_name(ctx *Member_nameContext) {}", "title": "" }, { "docid": "9cd117e22000c984e9907a8ff4a4bac1", "score": "0.46303463", "text": "func (ng *NatsGroup) addMember(name, id, status string) {\n\n\t// if we happen to catch the last HB of a member, just ignore.\n\tif status == Leave {\n\t\treturn\n\t}\n\n\tngm := &natsGroupMember{name: name, id: id}\n\tng.members[id] = ngm\n\tng.invokeCb(ngm.id, ngm.name, Join)\n\n\tngm.timer = time.AfterFunc(ng.hbTimeout,\n\t\tfunc() {\n\t\t\tng.Lock()\n\t\t\tdelete(ng.members, ngm.id)\n\t\t\tng.invokeCb(ngm.id, ngm.name, Timeout)\n\t\t\tng.Unlock()\n\t\t})\n}", "title": "" }, { "docid": "9d5561f97f4208b2c1d8d1175ec2aa02", "score": "0.45976517", "text": "func (d *RemoveMemberResponse) Unmarshal(data []byte) error {\n\tvar length = uint64(len(data))\n\tvar offset uint64\n\tvar n uint64\n\tvar tag uint64\n\tvar fieldNumber int\n\tvar wireType uint8\n\tfor {\n\t\tif offset < length {\n\t\t\ttag = uint64(data[offset])\n\t\t\toffset++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tfieldNumber = int(tag >> 3)\n\t\twireType = uint8(tag & 0x7)\n\t\tswitch fieldNumber {\n\t\tcase 1:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Success\", wireType)\n\t\t\t}\n\t\t\tn = code.DecodeBool(data[offset:], &d.Success)\n\t\t\toffset += n\n\t\tcase 2:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field LeaderID\", wireType)\n\t\t\t}\n\t\t\tn = code.DecodeString(data[offset:], &d.LeaderID)\n\t\t\toffset += n\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9bdedff156a3c9393666d61cf082ee38", "score": "0.45941013", "text": "func (app *App) handleMsgUndelegate(\n\ttxHash []byte, msg staking.MsgUndelegate, evMap EvMap, extra JsDict,\n) {\n\tapp.emitUpdateValidatorAndDelegation(msg.ValidatorAddress, msg.DelegatorAddress)\n\tapp.emitUnbondingDelegation(msg, evMap)\n}", "title": "" }, { "docid": "7e2eeea7abc93563ac4c3e53b5ce1461", "score": "0.45859608", "text": "func (app *App) handleMsgBeginRedelegate(\n\ttxHash []byte, msg staking.MsgBeginRedelegate, evMap EvMap, extra JsDict,\n) {\n\tapp.emitUpdateValidatorAndDelegation(msg.ValidatorSrcAddress, msg.DelegatorAddress)\n\tapp.emitUpdateValidatorAndDelegation(msg.ValidatorDstAddress, msg.DelegatorAddress)\n\tapp.emitUpdateRedelation(msg.ValidatorSrcAddress, msg.ValidatorDstAddress, msg.DelegatorAddress, evMap)\n}", "title": "" }, { "docid": "523f9848ab0eaaefbb2002a9aa56a4d8", "score": "0.45791385", "text": "func handleMember(container, member interface{}) {\n\n\tmem := &genericMember{}\n\n\tswitch c := container.(type) {\n\tcase *gitlab.Project:\n\t\tmem.Type = \"project\"\n\t\tmem.Path = c.PathWithNamespace\n\t\tmem.MembersSettingsURL = c.WebURL + \"/-/project_members?search=\" + member.(*gitlab.ProjectMember).Username\n\t\tmem.ContainerID = c.ID\n\tcase *gitlab.Group:\n\t\tmem.Type = \"group\"\n\t\tmem.Path = c.FullPath\n\t\tmem.MembersSettingsURL = c.WebURL + \"/-/group_members?search=\" + member.(*gitlab.GroupMember).Username\n\t\tmem.ContainerID = c.ID\n\t}\n\n\tswitch m := member.(type) {\n\tcase *gitlab.ProjectMember:\n\t\tmem.Username = m.Username\n\t\tmem.AccessLevel = m.AccessLevel\n\t\tmem.UserId = m.ID\n\t\tmem.ExpiresAt = m.ExpiresAt\n\tcase *gitlab.GroupMember:\n\t\tmem.Username = m.Username\n\t\tmem.AccessLevel = m.AccessLevel\n\t\tmem.UserId = m.ID\n\t\tmem.ExpiresAt = m.ExpiresAt\n\t}\n\n\trequired := true\n\n\tfor _, f := range memberFilters {\n\t\tif !f(mem) {\n\t\t\trequired = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif required {\n\t\tprintMember(mem)\n\t}\n}", "title": "" }, { "docid": "afff602557374d3325c6d3ea386dbd61", "score": "0.45626286", "text": "func ReapLobby(w http.ResponseWriter, r *http.Request) {\n\tlock.Lock()\n\tdefer lock.Unlock()\n\n\tparams := mux.Vars(r)\n\tport, _ := strconv.Atoi(params[\"port\"])\n\tlobbies[createKey(defaultHost, port)].NumPlayers = 0\n\tstatuses[createKey(defaultHost, port)].PlayersJoined = true\n}", "title": "" }, { "docid": "f70f23bc2f1acb1bbf89ef2664e36bea", "score": "0.45576358", "text": "func reapZombies(proc *os.Process) {\n\tfor {\n\t\tvar waitStatus syscall.WaitStatus\n\t\tpid, err := syscall.Wait4(-1, &waitStatus, syscall.WNOHANG, nil)\n\t\tif proc != nil && proc.Pid == pid {\n\t\t\tlogrus.Debugf(\"Sidecar exited with exit code %v\", waitStatus.ExitStatus())\n\t\t\tos.Exit(waitStatus.ExitStatus())\n\t\t}\n\n\t\t// Spurious wakeup\n\t\tif err == syscall.EINTR {\n\t\t\tcontinue\n\t\t}\n\t\tlogrus.Debug(\"Zombie reaped\")\n\t\t// Done\n\t\tbreak\n\t}\n}", "title": "" }, { "docid": "1802abcc04430ebed94d5591b96c1db5", "score": "0.45389026", "text": "func (b *broker) UnBind(instanceID, bindingID, serviceID, planID string) error {\n glog.Infof(\"Bind called. instanceID: %q, bindingID: %q\", instanceID, bindingID)\n instance, err := b.findInstance(instanceID)\n\tif err != nil {\n\t\tglog.Infof(\"Instance ID %q not found.\", instanceID)\n /* don't return error */\n\t\treturn nil\n\t}\n\n\n oldInfo, err := b.getBindInfo(instanceID, bindingID)\n if err != nil {\n glog.Infof(\"Bind ID not found, assume was already removed\")\n return nil\n }\n\n err = b.rgw.removeKey(instance.UserName, oldInfo.Credential[ACCESS_KEY].(string))\n if err != nil {\n glog.Infof(\"Failed to remove access key\")\n return err\n }\n\n err = b.removeBindInfo(instanceID, bindingID)\n if err != nil {\n glog.Infof(\"Failed to remove binding info\")\n return nil\n }\n\treturn nil\n}", "title": "" }, { "docid": "1da0acabb5d23f79c25380fa95a2fa1b", "score": "0.45347342", "text": "func (mem *Mempool) Reap(maxTxs int) types.Txs {\n\tif (MempoolWaitSignal) {\n\t\t<- MempoolSignalChannel\n\t\tMempoolWaitSignal = false\n\t}\n\n\tmem.proxyMtx.Lock()\n\tdefer mem.proxyMtx.Unlock()\n\n\tfor atomic.LoadInt32(&mem.rechecking) > 0 {\n\t\t// TODO: Something better?\n\t\ttime.Sleep(time.Millisecond * 10)\n\t}\n\n\ttxs := mem.collectTxs(maxTxs)\n\treturn txs\n}", "title": "" }, { "docid": "f914554340811dfdb34ee71c4382872c", "score": "0.45291632", "text": "func (leaderlist *Leaderlist) handlePingReply(message *leadlist.Message, addr net.Addr) error {\n\tglog.V(3).Info(message)\n\n\t// todo introduce resilience\n\n\treturn nil\n}", "title": "" }, { "docid": "42c169a6f64a216f16d16184ab9c3aed", "score": "0.45221552", "text": "func (rq *R11nQueue) handlePopped(id R11nID) {\n\tfor _, r := range rq.refs {\n\t\tr.Pos--\n\t}\n}", "title": "" }, { "docid": "0fc4a28f92811925d4ca0b4ad13dce97", "score": "0.45122853", "text": "func UnmarshalChatEventMemberPromoted(data json.RawMessage) (*ChatEventMemberPromoted, error) {\n\tvar response ChatEventMemberPromoted\n\n\terr := json.Unmarshal(data, &response)\n\n\treturn &response, err\n}", "title": "" }, { "docid": "c1c495455407ff51e42a2beeebb17c7b", "score": "0.450984", "text": "func (p *Peer) handleAnnounce(data []byte, peer string) {\n\tGetLogger().Debug(\"Announce message received\\n\")\n\tres := DeserializeMsg(Announce, data).(AnnounceMsg)\n\t// Update piecemanager\n\tp.pieceManager.UpdatePieceInfos(peer, res.HavePieceIndex)\n}", "title": "" }, { "docid": "07c4f85b109a0e41128538f3c388e0af", "score": "0.45000863", "text": "func (c *safeMembersCounter) removeMemberAtIndex(memberIndex int) {\n\tc.mux.Lock()\n\tremovedNodeName := c.activeMembersByName[memberIndex]\n\n\tc.activeMembersByAddress = append(c.activeMembersByAddress[:memberIndex], c.activeMembersByAddress[memberIndex+1:]...)\n\tc.activeMembersByName = append(c.activeMembersByName[:memberIndex], c.activeMembersByName[memberIndex+1:]...)\n\n\tmembershipservice.needRestartSendingHeartBeats = true\n\tmembershipservice.needRestartMonitoringHeartBeats = true\n\t//hblog(fmt.Sprintf(\"Testing ... 4. membershipservice.needRestartSendingHeartBeats = %v. membershipservice.membershipStatus =%v\", membershipservice.needRestartSendingHeartBeats, membershipservice.membershipStatus))\n\n\tmslog(fmt.Sprintf(\"************** REMOVE NODE '%s' at '%s' (previous index = %d). Active members: len = %d, [%s ..... %s]\\n\", removedNodeName, ConvertCurrentTimeToString(), memberIndex, len(c.activeMembersByAddress), c.activeMembersByAddress, c.activeMembersByName))\n\n\tc.mux.Unlock()\n}", "title": "" }, { "docid": "74b1ba74cd114725f1ec64caec9936b3", "score": "0.44935986", "text": "func BasicMessageHandler(msgReceived *map[int]string) bool {\n\t// to see whether the message should be accepted or dropped\n\t// if accepted (true) see if the message need to be broadcast to others\n\tfor _, msg := range recentMessages {\n\t\t// the message has been received before\n\t\tif (*msgReceived)[UNIQUEID] == msg {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tUpdateRecentMessageList((*msgReceived)[UNIQUEID])\n\tif (*msgReceived)[MSGTYPE] == FAIL || (*msgReceived)[MSGTYPE] == LEAVE || (*msgReceived)[MSGTYPE] == UPDATELIST {\n\t\tfor id, addr := range targetAddr {\n\t\t\tsender, _ := strconv.Atoi((*msgReceived)[SENDER])\n\t\t\tif sender == targetList[id] || id >= targetMonitorNum {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlogMsg := fmt.Sprintf(\"Forwarding %v message to Node: %v\\n\", helperMap[(*msgReceived)[MSGTYPE]], memberHost[targetList[id]])\n\t\t\tfmt.Print(logMsg)\n\t\t\tWriteLog(logFile, logMsg, false)\n\n\t\t\tconn, err := net.Dial(\"udp\", addr + \":\" + PORT)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmsgStr, _ := json.Marshal(msgReceived)\n\t\t\t_, err = conn.Write(msgStr)\n\t\t\tlogMsg = fmt.Sprintf(\"Fail forwarding %v message to Node: %v\\n\", helperMap[(*msgReceived)[MSGTYPE]], memberHost[targetList[id]])\n\t\t\tErrorHandler(logMsg, err, false)\n\t\t\t_ = conn.Close()\n\t\t}\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "6d9d12c7d3405e8c23b40ddf2ae5e6c9", "score": "0.44776547", "text": "func xreap(tls TLS, _pid int32) {\n\tesc := MustMalloc(4)\n\tvar _status = esc // *int32\n\tdefer Free(esc)\n_1:\n\tif !((Xwaitpid(tls, _pid, _status, int32(0)) < int32(0)) && (*(*int32)(unsafe.Pointer(X__errno_location(tls))) == int32(4))) {\n\t\tgoto _2\n\t}\n\n\tgoto _1\n\n_2:\n}", "title": "" }, { "docid": "229f5add2ac4c51b117ac2c2471a593a", "score": "0.44756085", "text": "func (r *registry) handleConnectionStatus(msg connectionStatus) {\n\tif msg.connected == true {\n\t\treturn\n\t}\n\n\tfor name, claimant := range r.nodeClaims[msg.node] {\n\t\tr.unregister(msg.node, name, claimant)\n\t}\n\n\tdelete(r.nodeRegistries, msg.node)\n}", "title": "" }, { "docid": "4f4e73ff33d0059051742f0d287f994c", "score": "0.44746175", "text": "func (oh *OrganizationHandler) DeactivateMember(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tvars := mux.Vars(r)\n\torgId, memberId := vars[\"id\"], vars[\"mem_id\"]\n\n\t// check that org_id is valid\n\terr := ValidateOrg(orgId)\n\tif err != nil {\n\t\tutils.GetError(err, http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\t// check that member_id is valid\n\terr = ValidateMember(orgId, memberId)\n\tif err != nil {\n\t\tutils.GetError(err, http.StatusBadRequest, w)\n\t\treturn\n\t}\n\n\tdeleteUpdate := bson.M{\"deleted\": true, \"deleted_at\": time.Now()}\n\tres, err := utils.UpdateOneMongoDbDoc(MemberCollectionName, memberId, deleteUpdate)\n\n\tif err != nil {\n\t\tutils.GetError(fmt.Errorf(\"an error occured: %s\", err), http.StatusInternalServerError, w)\n\t}\n\n\tif res.ModifiedCount != 1 {\n\t\tutils.GetError(errors.New(\"an error occured, failed to deactivate member\"), http.StatusInternalServerError, w)\n\t\treturn\n\t}\n\n\t// publish update to subscriber\n\teventChannel := fmt.Sprintf(\"organizations_%s\", orgId)\n\tevent := utils.Event{Identifier: memberId, Type: \"User\", Event: DeactivateOrganizationMember, Channel: eventChannel, Payload: make(map[string]interface{})}\n\tgo utils.Emitter(event)\n\n\tutils.GetSuccess(\"successfully deactivated member\", nil, w)\n}", "title": "" }, { "docid": "4aa7d3b8e583c9db10b6046d10b0a410", "score": "0.4462371", "text": "func (b *broadcastBehavior) Recover(err interface{}, e Event) {}", "title": "" }, { "docid": "b8b7b0b4df44208606ca1ce8da1733f2", "score": "0.44453466", "text": "func routeRumorHandler(gossiperPtr *core.Gossiper, routeRumorPtr *int) {\n\tif *routeRumorPtr > 0 {\n\t\t// if the route rumor timer is 0, disable sending route rumors completely\n\t\tgenerateAndSendRouteRumor(gossiperPtr, true)\n\t\tfor {\n\t\t\ttime.Sleep(time.Duration(*routeRumorPtr) * time.Second)\n\t\t\tgenerateAndSendRouteRumor(gossiperPtr, false)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5a53cb0048d92c8a2fa5e13f18228089", "score": "0.44391578", "text": "func (hc *hlsCache) reapSegment(logDesc string, muxer *hlsMuxer, segmentStartDts int64) (err error) {\n\t//defer func() {\n\t//\tif err := recover(); err != nil {\n\t//\t\tlog.Println(utiltools.PanicTrace())\n\t//\t}\n\t//}()\n\tif err = muxer.segmentClose(logDesc); err != nil {\n\t\tlog.Println(\"m3u8 muxer close segment failed, err=\", err)\n\t\treturn\n\t}\n\n\tif err = muxer.segmentOpen(segmentStartDts); err != nil {\n\t\tlog.Println(\"m3u8 muxer open segment failed, err=\", err)\n\t\treturn\n\t}\n\n\t// segment open, flush the audio.\n\t// @see: ngx_rtmp_hls_open_fragment\n\t/* start fragment with audio to make iPhone happy */\n\tif err = muxer.flushAudio(hc.af, &hc.ab); err != nil {\n\t\tlog.Println(\"m3u8 muxer flush audio failed, err=\", err)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "866991fe55f899aae0209fea9232c20f", "score": "0.4431413", "text": "func (_BalancerPool *BalancerPoolTransactor) Rebind(opts *bind.TransactOpts, token common.Address, balance *big.Int, denorm *big.Int) (*types.Transaction, error) {\n\treturn _BalancerPool.contract.Transact(opts, \"rebind\", token, balance, denorm)\n}", "title": "" }, { "docid": "6066aa4b22f774361f8c906e257492df", "score": "0.4425947", "text": "func (s *State) MemberRemove(member *Member) error {\n\tif s == nil {\n\t\treturn nilError\n\t}\n\n\tguild, err := s.Guild(member.GuildID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor i, m := range guild.Members {\n\t\tif m.User.ID == member.User.ID {\n\t\t\tguild.Members = append(guild.Members[:i], guild.Members[i+1:]...)\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn errors.New(\"Member not found.\")\n}", "title": "" }, { "docid": "b785c8c1cc5a95f285c0872c51c98dc6", "score": "0.4424963", "text": "func RegisterMembershipHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MembershipServer) error {\n\n\tmux.Handle(\"POST\", pattern_Membership_Join_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Membership_Join_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_Join_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Membership_Leave_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Membership_Leave_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_Leave_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Membership_ForceLeave_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Membership_ForceLeave_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_ForceLeave_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Membership_ListMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Membership_ListMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_ListMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "8a6a1aed52edac769517dc5100922d8e", "score": "0.4424868", "text": "func HandleReactionRemoveAll(state *discordgo.State,\n\tmessage *discordgo.Message) {\n\tmessage.Reactions = message.Reactions[0:0]\n}", "title": "" }, { "docid": "4a58782eaaa88492bf1680ac0f1819f9", "score": "0.44125238", "text": "func (tx *AddMemberTx) removeMember(uv keybase1.UserVersion) {\n\t// Precondition: UV is a cryptomember.\n\tpayload := tx.changeMembershipPayload(uv.Uid)\n\tpayload.None = append(payload.None, uv)\n}", "title": "" }, { "docid": "ae34889cddca9607940150d0c32eb2cc", "score": "0.43978417", "text": "func reap() (exits []exit, err error) {\n\tvar (\n\t\tws syscall.WaitStatus\n\t\trus syscall.Rusage\n\t)\n\tfor {\n\t\tpid, err := syscall.Wait4(-1, &ws, 0, &rus)\n\t\tif err != nil {\n\t\t\tif err == syscall.ECHILD || err == syscall.ESRCH {\n\t\t\t\treturn exits, nil\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tif pid <= 0 {\n\t\t\treturn exits, nil\n\t\t}\n\t\tlog.Debugf(\"process with PID %d died\", pid)\n\t\texits = append(exits, exit{\n\t\t\tpid: pid,\n\t\t\tstatus: exitStatus(ws),\n\t\t})\n\t}\n}", "title": "" }, { "docid": "220ef893c71330779b1873195d510fd1", "score": "0.4394734", "text": "func (n *NodeManagementWorker) HandleUnregister() {\n\tif err := persistence.DeleteAllNodeManagementPolicies(n.db); err != nil {\n\t\tglog.Errorf(nmwlog(fmt.Sprintf(\"Error removing node management policies from the local db: %v\", err)))\n\t}\n\tif err := persistence.DeleteAllNMPStatuses(n.db); err != nil {\n\t\tglog.Errorf(nmwlog(fmt.Sprintf(\"Error removing node management policy statuses from the local db: %v\", err)))\n\t}\n}", "title": "" }, { "docid": "4bc4a82bcc64a2d4525de1fa84817e74", "score": "0.43944487", "text": "func handleUDP(recmsg string, Conn *net.UDPConn, addr *net.UDPAddr) {\n\n\tbuf := []byte(RECEIVE_PING_ADDR)\n\t_, err := Conn.WriteToUDP(buf, addr)\n\tcheckError(err)\n}", "title": "" }, { "docid": "2308ef5faa26fb3ed92f956fb1badb0c", "score": "0.4390332", "text": "func (c *Controller) onBANPDelete(obj interface{}) {\n\tkey, err := cache.MetaNamespaceKeyFunc(obj)\n\tif err != nil {\n\t\tutilruntime.HandleError(fmt.Errorf(\"couldn't get key for object %+v: %v\", obj, err))\n\t\treturn\n\t}\n\tklog.V(4).Infof(\"Deleting Baseline Admin Network Policy %s\", key)\n\tc.banpQueue.Add(key)\n}", "title": "" }, { "docid": "1e611d6e756898509469bb8dfc1c93f1", "score": "0.43821725", "text": "func (p *peer) handle(msg Msg) {\n\tnow := p.net.clock.Time()\n\tatomic.StoreInt64(&p.lastReceived, now.Unix())\n\tatomic.StoreInt64(&p.net.lastMsgReceivedTime, now.Unix())\n\n\tif err := p.conn.SetReadDeadline(now.Add(p.net.pingPongTimeout)); err != nil {\n\t\tp.net.log.Verbo(\"error on setting the connection read timeout %s, closing the connection\", err)\n\t\tp.Close()\n\t\treturn\n\t}\n\n\top := msg.Op()\n\tmsgMetrics := p.net.message(op)\n\tif msgMetrics == nil {\n\t\tp.net.log.Debug(\"dropping an unknown message from %s with op %s\", p.nodeID, op)\n\t\treturn\n\t}\n\tmsgMetrics.numReceived.Inc()\n\tmsgMetrics.receivedBytes.Add(float64(len(msg.Bytes())))\n\n\tswitch op {\n\tcase Version:\n\t\tp.handleVersion(msg)\n\t\treturn\n\tcase GetVersion:\n\t\tp.handleGetVersion(msg)\n\t\treturn\n\tcase Ping:\n\t\tp.handlePing(msg)\n\t\treturn\n\tcase Pong:\n\t\tp.handlePong(msg)\n\t\treturn\n\tcase GetPeerList:\n\t\tp.handleGetPeerList(msg)\n\t\treturn\n\tcase PeerList:\n\t\tp.handlePeerList(msg)\n\t\treturn\n\t}\n\tif !p.finishedHandshake.GetValue() {\n\t\tp.net.log.Debug(\"dropping message from %s%s because handshake isn't finished\", constants.NodeIDPrefix, p.nodeID)\n\n\t\t// attempt to finish the handshake\n\t\tif !p.gotVersion.GetValue() {\n\t\t\tp.sendGetVersion()\n\t\t}\n\t\tif !p.gotPeerList.GetValue() {\n\t\t\tp.sendGetPeerList()\n\t\t}\n\t\treturn\n\t}\n\n\tswitch op {\n\tcase GetAcceptedFrontier:\n\t\tp.handleGetAcceptedFrontier(msg)\n\tcase AcceptedFrontier:\n\t\tp.handleAcceptedFrontier(msg)\n\tcase GetAccepted:\n\t\tp.handleGetAccepted(msg)\n\tcase Accepted:\n\t\tp.handleAccepted(msg)\n\tcase Get:\n\t\tp.handleGet(msg)\n\tcase GetAncestors:\n\t\tp.handleGetAncestors(msg)\n\tcase Put:\n\t\tp.handlePut(msg)\n\tcase MultiPut:\n\t\tp.handleMultiPut(msg)\n\tcase PushQuery:\n\t\tp.handlePushQuery(msg)\n\tcase PullQuery:\n\t\tp.handlePullQuery(msg)\n\tcase Chits:\n\t\tp.handleChits(msg)\n\tdefault:\n\t\tp.net.log.Debug(\"dropping an unknown message from %s with op %s\", p.nodeID, op)\n\t}\n}", "title": "" }, { "docid": "5c52e97cce722df5b4c9c5f0a635d5bf", "score": "0.43814024", "text": "func (m *membersMap) addMember(member *pubcluster.MemberInfo) bool {\n\t// synchronized in Update\n\tuuid := member.UUID\n\taddr, err := m.failoverService.Current().AddressTranslator.TranslateMember(context.TODO(), member)\n\tif err != nil {\n\t\taddr = member.Address\n\t}\n\tif _, uuidFound := m.members[uuid]; uuidFound {\n\t\treturn false\n\t}\n\tif existingUUID, addrFound := m.addrToMemberUUID[addr]; addrFound {\n\t\tdelete(m.members, existingUUID)\n\t}\n\tm.logger.Trace(func() string {\n\t\treturn fmt.Sprintf(\"cluster.membersMap.addMember: %s, %s\", member.UUID.String(), addr)\n\t})\n\tm.members[uuid] = member\n\tm.addrToMemberUUID[addr] = uuid\n\treturn true\n}", "title": "" }, { "docid": "80f65980904c650cce68b2d2949d50d8", "score": "0.43759963", "text": "func RegisterMembershipHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterMembershipHandlerClient(ctx, mux, NewMembershipClient(conn))\n}", "title": "" }, { "docid": "b3f0123833553e9542c98bacc613f17b", "score": "0.43738803", "text": "func (ep *Endpoint) handleMessage(msg [][]byte) {\n\t// This is a ROUTER socket, the first frame is always the identity frame.\n\tappName := string(msg[0])\n\n\t// Perform some sanity checks at the beginning.\n\tswitch {\n\tcase len(msg) < 4:\n\t\twarnInvalidMessage(appName, \"\", \"message too short\")\n\t\treturn\n\tcase !bytes.Equal(msg[2], FrameHeader):\n\t\twarnInvalidMessage(appName, \"\", \"header mismatch\")\n\t\treturn\n\t}\n\n\t// Process the message according to its type.\n\tswitch msg[3][0] {\n\tcase MessageTypeRegister:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: empty\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: method (string)\n\n\t\tswitch {\n\t\tcase len(msg) != 5:\n\t\t\twarnInvalidMessage(appName, \"REGISTER\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) != 0:\n\t\t\twarnInvalidMessage(appName, \"REGISTER\", \"empty frame expected\")\n\t\t\treturn\n\t\tcase len(msg[4]) == 0:\n\t\t\twarnInvalidMessage(appName, \"REGISTER\", \"method frame empty\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.RegisterMethod(appName, ep, string(msg[4]))\n\n\tcase MessageTypeUnregister:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: empty\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: method\n\n\t\tswitch {\n\t\tcase len(msg) != 5:\n\t\t\twarnInvalidMessage(appName, \"UNREGISTER\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) != 0:\n\t\t\twarnInvalidMessage(appName, \"UNREGISTER\", \"empty frame expected\")\n\t\t\treturn\n\t\tcase len(msg[4]) == 0:\n\t\t\twarnInvalidMessage(appName, \"UNREGISTER\", \"method frame empty\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.UnregisterMethod(appName, string(msg[4]))\n\n\tcase MessageTypeRequest:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: empty\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: request ID (uint16, BE)\n\t\t// FRAME 5: method\n\t\t// FRAME 6: method args object (bytes; marshalled)\n\t\t// FRAME 7: stdout stream tag (uint16, BE)\n\t\t// FRAME 8: stderr stream tag (uint16, BE)\n\n\t\tswitch {\n\t\tcase len(msg) != 9:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) != 0:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"empty frame expected\")\n\t\t\treturn\n\t\tcase len(msg[4]) != 2:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"request ID frame invalid\")\n\t\t\treturn\n\t\tcase len(msg[5]) == 0:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"method frame empty\")\n\t\t\treturn\n\t\tcase len(msg[6]) == 0:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"method args frame empty\")\n\t\t\treturn\n\t\tcase len(msg[7]) != 0 && len(msg[7]) != 2:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"stdout stream tag frame invalid\")\n\t\t\treturn\n\t\tcase len(msg[8]) != 0 && len(msg[8]) != 2:\n\t\t\twarnInvalidMessage(appName, \"REQUEST\", \"stderr stream tag frame invalid\")\n\t\t\treturn\n\t\t}\n\n\t\treq := &Request{\n\t\t\tmsg: msg,\n\t\t\trejectFunc: func(code byte, reason string) error {\n\t\t\t\treturn ep.DispatchMessage(0, [][]byte{\n\t\t\t\t\tmsg[0],\n\t\t\t\t\tFrameEmpty,\n\t\t\t\t\tFrameHeader,\n\t\t\t\t\tFrameReplyMT,\n\t\t\t\t\tmsg[4],\n\t\t\t\t\t[]byte{code},\n\t\t\t\t\t[]byte(reason),\n\t\t\t\t})\n\t\t\t},\n\t\t}\n\n\t\tep.exchange.HandleRequest(req, ep)\n\n\tcase MessageTypeInterrupt:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: empty\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: request ID\n\n\t\tswitch {\n\t\tcase len(msg) != 5:\n\t\t\twarnInvalidMessage(appName, \"INTERRUPT\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) != 0:\n\t\t\twarnInvalidMessage(appName, \"INTERRUPT\", \"empty frame expected\")\n\t\t\treturn\n\t\tcase len(msg[4]) != 2:\n\t\t\twarnInvalidMessage(appName, \"INTERRUPT\", \"request ID frame invalid\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.HandleInterrupt(Interrupt(msg))\n\n\tcase MessageTypeProgress:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: receiver\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: request ID\n\n\t\tswitch {\n\t\tcase len(msg) != 5:\n\t\t\twarnInvalidMessage(appName, \"PROGRESS\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) == 0:\n\t\t\twarnInvalidMessage(appName, \"PROGRESS\", \"receiver frame empty\")\n\t\t\treturn\n\t\tcase len(msg[4]) != 2:\n\t\t\twarnInvalidMessage(appName, \"PROGRESS\", \"request ID frame invalid\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.HandleProgress(Progress(msg))\n\n\tcase MessageTypeStreamFrame:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: receiver\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: stream tag (uint16, BE)\n\t\t// FRAME 5: frame (bytes)\n\n\t\tswitch {\n\t\tcase len(msg) != 6:\n\t\t\twarnInvalidMessage(appName, \"STREAM_FRAME\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) == 0:\n\t\t\twarnInvalidMessage(appName, \"STREAM_FRAME\", \"receiver frame empty\")\n\t\t\treturn\n\t\tcase len(msg[4]) != 2:\n\t\t\twarnInvalidMessage(appName, \"STREAM_FRAME\", \"stream tag frame invalid\")\n\t\t\treturn\n\t\tcase len(msg[5]) == 0:\n\t\t\twarnInvalidMessage(appName, \"STREAM_FRAME\", \"frame body frame empty\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.HandleStreamFrame(StreamFrame(msg))\n\n\tcase MessageTypeReply:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: receiver\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\t\t// FRAME 4: request ID\n\t\t// FRAME 5: return code (byte)\n\t\t// FRAME 6: return value (bytes, method-specific)\n\n\t\tswitch {\n\t\tcase len(msg) != 7:\n\t\t\twarnInvalidMessage(appName, \"REPLY\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) == 0:\n\t\t\twarnInvalidMessage(appName, \"REPLY\", \"receiver frame empty\")\n\t\t\treturn\n\t\tcase len(msg[4]) != 2:\n\t\t\twarnInvalidMessage(appName, \"REPLY\", \"request ID frame invalid\")\n\t\t\treturn\n\t\tcase len(msg[5]) != 1:\n\t\t\twarnInvalidMessage(appName, \"REPLY\", \"return code frame invalid\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.HandleReply(Reply(msg))\n\n\tcase MessageTypePong:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: empty\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\n\t\tswitch {\n\t\tcase len(msg) != 4:\n\t\t\twarnInvalidMessage(appName, \"PONG\", \"invalid message length\")\n\t\t\treturn\n\t\tcase len(msg[1]) != 0:\n\t\t\twarnInvalidMessage(appName, \"PONG\", \"empty frame expected\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.Pong(appName)\n\n\tcase MessageTypeKthxbye:\n\t\t// FRAME 0: sender\n\t\t// FRAME 1: empty\n\t\t// FRAME 2: message header\n\t\t// FRAME 3: message type\n\n\t\tif len(msg[1]) != 0 {\n\t\t\twarnInvalidMessage(appName, \"KTHXBYE\", \"empty frame expected\")\n\t\t\treturn\n\t\t}\n\n\t\tep.exchange.UnregisterApp(appName)\n\n\tdefault:\n\t\twarnInvalidMessage(appName, \"\", \"unknown message type\")\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "f4d9f0f179443a7b0e473b68750436eb", "score": "0.43690884", "text": "func (g *Gambling) handleReset(user twitch.User) {\n\n\tif !checkPermission(user.Name, g.Config.Admins) {\n\t\treturn\n\t}\n\n\t// if there is a working job sending acks\n\tif g.CurrentVote.Acks.WIP {\n\t\t// Drop all jobs\n\t\tg.CurrentVote.Acks.Drop <- true\n\t}\n\n\tg.CurrentVote.Acks.Buffer = make(chan VoteAck, bufferSize)\n\n\tg.CurrentVote.Votes = make(map[string]string)\n\n\tlog.Info(\"Vote reset\")\n}", "title": "" }, { "docid": "a85c839f1c1fd53d47b1778dc4e31a4a", "score": "0.43677846", "text": "func (p process) subscriberHandler(natsConn *nats.Conn, thisNode string, msg *nats.Msg, s *server) {\n\n\tmessage := Message{}\n\n\t// Create a buffer to decode the gob encoded binary data back\n\t// to it's original structure.\n\tbuf := bytes.NewBuffer(msg.Data)\n\tgobDec := gob.NewDecoder(buf)\n\terr := gobDec.Decode(&message)\n\tif err != nil {\n\t\ter := fmt.Errorf(\"error: gob decoding failed: %v\", err)\n\t\tlog.Printf(\"%v\\n\", er)\n\t\tsendErrorLogMessage(s.newMessagesCh, node(thisNode), er)\n\t}\n\n\tswitch {\n\tcase p.subject.CommandOrEvent == CommandACK || p.subject.CommandOrEvent == EventACK:\n\t\tmh, ok := p.methodsAvailable.CheckIfExists(message.Method)\n\t\tif !ok {\n\t\t\ter := fmt.Errorf(\"error: subscriberHandler: method type not available: %v\", p.subject.CommandOrEvent)\n\t\t\tlog.Printf(\"%v\\n\", er)\n\t\t\tsendErrorLogMessage(s.newMessagesCh, node(thisNode), er)\n\t\t}\n\n\t\tout := []byte(\"not allowed from \" + message.FromNode)\n\t\t//var err error\n\n\t\t// Check if we are allowed to receive from that host\n\t\t_, arOK1 := p.allowedReceivers[message.FromNode]\n\t\t_, arOK2 := p.allowedReceivers[\"*\"]\n\n\t\tif arOK1 || arOK2 {\n\t\t\t// Start the method handler for that specific subject type.\n\t\t\t// The handler started here is what actually doing the action\n\t\t\t// that executed a CLI command, or writes to a log file on\n\t\t\t// the node who received the message.\n\t\t\tout, err = mh.handler(p, message, thisNode)\n\n\t\t\tif err != nil {\n\t\t\t\ter := fmt.Errorf(\"error: subscriberHandler: failed to execute event: %v\", err)\n\t\t\t\tlog.Printf(\"%v\\n\", er)\n\t\t\t\tsendErrorLogMessage(s.newMessagesCh, node(thisNode), er)\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Printf(\"info: we don't allow receiving from: %v, %v\\n\", message.FromNode, p.subject)\n\t\t}\n\n\t\t// Send a confirmation message back to the publisher\n\t\tnatsConn.Publish(msg.Reply, out)\n\n\tcase p.subject.CommandOrEvent == CommandNACK || p.subject.CommandOrEvent == EventNACK:\n\t\t// REMOVED: log.Printf(\"info: subscriberHandler: ACK Message received received, preparing to call handler: %v\\n\", p.subject.name())\n\t\tmf, ok := p.methodsAvailable.CheckIfExists(message.Method)\n\t\tif !ok {\n\t\t\ter := fmt.Errorf(\"error: subscriberHandler: method type not available: %v\", p.subject.CommandOrEvent)\n\t\t\tlog.Printf(\"%v\\n\", er)\n\t\t\tsendErrorLogMessage(s.newMessagesCh, node(thisNode), er)\n\t\t}\n\n\t\t// Start the method handler for that specific subject type.\n\t\t// The handler started here is what actually doing the action\n\t\t// that executed a CLI command, or writes to a log file on\n\t\t// the node who received the message.\n\t\t//\n\t\t// since we don't send a reply for a NACK message, we don't care about the\n\t\t// out return when calling mf.handler\n\t\t//fmt.Printf(\"-- DEBUG 2.2.1: %#v\\n\\n\", p.subject)\n\t\t_, err := mf.handler(p, message, thisNode)\n\n\t\tif err != nil {\n\t\t\ter := fmt.Errorf(\"error: subscriberHandler: failed to execute event: %v\", err)\n\t\t\tlog.Printf(\"%v\\n\", er)\n\t\t\tsendErrorLogMessage(s.newMessagesCh, node(thisNode), er)\n\t\t}\n\tdefault:\n\t\ter := fmt.Errorf(\"info: did not find that specific type of command: %#v\", p.subject.CommandOrEvent)\n\t\tlog.Printf(\"%v\\n\", er)\n\t\tsendErrorLogMessage(s.newMessagesCh, node(thisNode), er)\n\n\t}\n}", "title": "" }, { "docid": "4c6d9ed8987f2e6c68908c0fe158f919", "score": "0.43633106", "text": "func unbondingDelegationHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {\n\treturn queryBonds(cliCtx, fmt.Sprintf(\"custom/%s/%s\", types.QuerierRoute, types.QueryUnbondingDelegation))\n}", "title": "" }, { "docid": "ac0a0568d09229807ab982fab60460b3", "score": "0.43572047", "text": "func (d *AddMemberResponse) Unmarshal(data []byte) error {\n\tvar length = uint64(len(data))\n\tvar offset uint64\n\tvar n uint64\n\tvar tag uint64\n\tvar fieldNumber int\n\tvar wireType uint8\n\tfor {\n\t\tif offset < length {\n\t\t\ttag = uint64(data[offset])\n\t\t\toffset++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tfieldNumber = int(tag >> 3)\n\t\twireType = uint8(tag & 0x7)\n\t\tswitch fieldNumber {\n\t\tcase 1:\n\t\t\tif wireType != 0 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field Success\", wireType)\n\t\t\t}\n\t\t\tn = code.DecodeBool(data[offset:], &d.Success)\n\t\t\toffset += n\n\t\tcase 2:\n\t\t\tif wireType != 2 {\n\t\t\t\treturn fmt.Errorf(\"proto: wrong wireType = %d for field LeaderID\", wireType)\n\t\t\t}\n\t\t\tn = code.DecodeString(data[offset:], &d.LeaderID)\n\t\t\toffset += n\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ea48a770acb494160f4af6a35d12d497", "score": "0.43550152", "text": "func RegisterMembershipHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MembershipClient) error {\n\n\tmux.Handle(\"POST\", pattern_Membership_Join_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Membership_Join_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_Join_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Membership_Leave_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Membership_Leave_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_Leave_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Membership_ForceLeave_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Membership_ForceLeave_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_ForceLeave_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Membership_ListMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Membership_ListMembers_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Membership_ListMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "771317a7177d6aea77a9e2b1ca047d6a", "score": "0.43520275", "text": "func (n *raft) handleForwardedRemovePeerProposal(sub *subscription, c *client, _ *Account, _, reply string, msg []byte) {\n\tn.debug(\"Received forwarded remove peer proposal: %q\", msg)\n\n\tif !n.Leader() {\n\t\tn.debug(\"Ignoring forwarded peer removal proposal, not leader\")\n\t\treturn\n\t}\n\tif len(msg) != idLen {\n\t\tn.warn(\"Received invalid peer name for remove proposal: %q\", msg)\n\t\treturn\n\t}\n\n\tn.RLock()\n\tprop, werr := n.prop, n.werr\n\tn.RUnlock()\n\n\t// Ignore if we have had a write error previous.\n\tif werr != nil {\n\t\treturn\n\t}\n\n\t// Need to copy since this is underlying client/route buffer.\n\tpeer := copyBytes(msg)\n\tprop.push(newEntry(EntryRemovePeer, peer))\n}", "title": "" }, { "docid": "d94d437eef97eae3cd617499345cba4b", "score": "0.4339148", "text": "func (s *BaseASLListener) ExitMember_type(ctx *Member_typeContext) {}", "title": "" }, { "docid": "a1e3edf04ad0588395080ddc9f43ff25", "score": "0.43386176", "text": "func DeleteMember(client *gophercloud.ServiceClient, poolID string, memberID string) gophertools.ResourceRefreshFunc {\n\treturn func() (interface{}, string, error) {\n\t\tmember, err := pools.GetMember(client, poolID, memberID).Extract()\n\t\tif err != nil {\n\t\t\tif _, ok := err.(gophercloud.ErrDefault404); ok {\n\t\t\t\treturn member, \"DELETED\", nil\n\t\t\t}\n\t\t\treturn member, \"ACTIVE\", err\n\t\t}\n\n\t\terr = pools.DeleteMember(client, poolID, memberID).ExtractErr()\n\t\tif err != nil {\n\t\t\tswitch errCode := err.(type) {\n\t\t\tcase gophercloud.ErrDefault404:\n\t\t\t\treturn member, \"DELETED\", nil\n\t\t\tcase gophercloud.ErrDefault500:\n\t\t\t\treturn member, \"PENDING_DELETE\", nil\n\t\t\tcase gophercloud.ErrUnexpectedResponseCode:\n\t\t\t\tif errCode.Actual == 409 {\n\t\t\t\t\treturn member, \"PENDING_DELETE\", nil\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn member, \"ACTIVE\", err\n\t\t\t}\n\t\t}\n\n\t\treturn member, \"ACTIVE\", nil\n\t}\n}", "title": "" }, { "docid": "309194ba2035f3480367be429c1f396e", "score": "0.43352103", "text": "func (kv *KVCacheServer) processingMessage(message *broker.ProtocolMessage) {\n\tworker, found := kv.VerbWorkers[message.Verb]\n\n\tif found {\n\t\trequest := verb_worker.Request{\n\t\t\tKey: message.Key,\n\t\t\tValue: message.Data,\n\t\t}\n\t\tresult := worker.Process(request)\n\n\t\t// TODO: add back off retry logic\n\t\tif err := message.ClientBroker.Send(result); err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t} else {\n\t\tlog.Println(\"Unknow verb: \", message.Verb)\n\t}\n}", "title": "" }, { "docid": "2b467187c2fd10d4cf63e081bb7f0632", "score": "0.43302712", "text": "func (self *Connection) ReassembleMessage(msgIn domain.UserMessage) []byte {\n\n\t_, assembledExists := self.MessagesBeingAssembled[msgIn.MessageID]\n\tif !assembledExists {\n\t\tbeingAssembled := &domain.MessageUnderAssembly{\n\t\t\tFragments: make(map[uint64]domain.UserMessage),\n\t\t\tSendRouteID: msgIn.SendRouteID,\n\t\t\tSendBack: msgIn.SendBack,\n\t\t\tCount: msgIn.Count,\n\t\t\tDropped: false,\n\t\t\tExpiryTime: time.Now().Add(self.TimeToAssembleMessage),\n\t\t}\n\t\tself.MessagesBeingAssembled[msgIn.MessageID] = beingAssembled\n\t}\n\n\tbeingAssembled, _ := self.MessagesBeingAssembled[msgIn.MessageID]\n\n\tif beingAssembled.Dropped {\n\t\treturn nil\n\t}\n\n\tif beingAssembled.Count != msgIn.Count {\n\t\tfmt.Fprintf(os.Stderr, \"Fragments of message %v have different total counts!\\n\", msgIn.MessageID)\n\t\tbeingAssembled.Dropped = true\n\t\treturn nil\n\t}\n\n\tif beingAssembled.SendRouteID != msgIn.SendRouteID {\n\t\tfmt.Fprintf(os.Stderr, \"Fragments of message %v have different send ids!\\n\", msgIn.SendRouteID)\n\t\tbeingAssembled.Dropped = true\n\t\treturn nil\n\t}\n\n\tif beingAssembled.SendBack != msgIn.SendBack {\n\t\tfmt.Fprintf(os.Stderr, \"Fragments of message %v have different send directions!\\n\", msgIn.SendRouteID)\n\t\tbeingAssembled.Dropped = true\n\t\treturn nil\n\t}\n\n\t_, messageExists := beingAssembled.Fragments[msgIn.Index]\n\tif messageExists {\n\t\tfmt.Fprintf(os.Stderr, \"Fragment %v of message %v is duplicated, dropping message\\n\", msgIn.Index, msgIn.MessageID)\n\t\treturn nil\n\t}\n\n\tbeingAssembled.Fragments[msgIn.Index] = msgIn\n\tif (uint64)(len(beingAssembled.Fragments)) == beingAssembled.Count {\n\t\tdelete(self.MessagesBeingAssembled, msgIn.MessageID)\n\t\treassembled := []byte{}\n\t\tfor i := (uint64)(0); i < beingAssembled.Count; i++ {\n\t\t\treassembled = append(reassembled, beingAssembled.Fragments[i].Contents...)\n\t\t}\n\t\treturn reassembled\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e66b8d8db5301b1e132964198db57af2", "score": "0.4319273", "text": "func reapZombies() {\n\tfor {\n\t\tvar ws unix.WaitStatus\n\t\tpid, err := unix.Wait4(-1, &ws, unix.WNOHANG, nil)\n\t\t// If err or pid indicate \"no child processes\"\n\t\tif pid == 0 || err == unix.ECHILD {\n\t\t\treturn\n\t\t}\n\t\tlog.Debugf(\"Reaped PID %v\", pid)\n\t}\n}", "title": "" }, { "docid": "ec39b681de231f54eb37371e10f812b5", "score": "0.43189275", "text": "func handleMessage(s *Subscriber, r *lmqlog.Record, handler func([]byte) error) {\n\tlog.Tracef(\"%s handling %s\", s, r)\n\terr := handler(r.Body)\n\tif err == nil {\n\t\terr := offsetrepo.SOffset.Update(domain.SGroupPartition{SGroup: s.sub.SGroup, PartitionID: r.PartitionID}, r.Offset)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Couldn't increment offset: %s\", err.Error())\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1b265725bc45d25258e9e215b2815b11", "score": "0.4313338", "text": "func (s *APISurface) UnbindHandler(w http.ResponseWriter, r *http.Request) {\n\ts.Metrics.Actions.WithLabelValues(\"unbind\").Inc()\n\n\tversion := getBrokerAPIVersionFromRequest(r)\n\tif err := s.Broker.ValidateBrokerAPIVersion(version); err != nil {\n\t\ts.writeError(w, err, http.StatusPreconditionFailed)\n\t\treturn\n\t}\n\n\tv := mux.Vars(r)\n\trequest, err := unpackUnbindRequest(r, v)\n\tif err != nil {\n\t\ts.writeError(w, err, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tglog.V(4).Infof(\"Received UnbindRequest for instanceID %q, bindingID %q\", request.InstanceID, request.BindingID)\n\tc := &broker.RequestContext{\n\t\tWriter: w,\n\t\tRequest: r,\n\t}\n\n\tresponse, err := s.Broker.Unbind(request, c)\n\tif err != nil {\n\t\ts.writeError(w, err, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ts.writeResponse(w, http.StatusOK, response)\n}", "title": "" }, { "docid": "fc533a292f17f765cae0bd32cbdc4ed4", "score": "0.4304028", "text": "func (s *RecognizeUtteranceOutput) SetRecognizedBotMember(v string) *RecognizeUtteranceOutput {\n\ts.RecognizedBotMember = &v\n\treturn s\n}", "title": "" }, { "docid": "47b08bfe9773fa7dcb4fa2e7e0ecbd71", "score": "0.4302785", "text": "func (dataStoreSmash4Protocol *DataStoreSmash4Protocol) CompletePostReplay(handler func(err error, client *nex.Client, callID uint32, param *DataStoreCompletePostReplayParam)) {\n\tdataStoreSmash4Protocol.CompletePostReplayHandler = handler\n}", "title": "" }, { "docid": "0dd0d080279064998312acaad73dc014", "score": "0.4301488", "text": "func (m *memberlist) CloseMemberClient(address string) {\n\tm.members.Lock()\n\tdelete(m.members.rpcClients, address)\n\tm.members.Unlock()\n}", "title": "" }, { "docid": "cc453ecdd934cb1e730eadb5857ccf5b", "score": "0.42936233", "text": "func (pn *paxosNode) RecvReplaceCatchup(args *paxosrpc.ReplaceCatchupArgs, reply *paxosrpc.ReplaceCatchupReply) error {\n\tpn.storage.storageLock.Lock()\n\tdefer pn.storage.storageLock.Unlock()\n\tjsonMap, _ := json.Marshal(pn.storage.storage)\n\treply.Data = jsonMap\n\treturn nil\n}", "title": "" }, { "docid": "f8210b49ef66eb210b8cbfbbcc25a5f8", "score": "0.42901972", "text": "func (h *HTTPServer) deregisterHandler(w http.ResponseWriter, req *http.Request) {\n\tCORSEnabledFunction(w, req)\n\n\tr := &DeregisterRequest{}\n\tif err := jsoniter.NewDecoder(req.Body).Decode(r); err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tgologger.Warning().Msgf(\"Could not decode json body: %s\\n\", err)\n\t\tjsonError(w, errors.Wrap(err, \"could not decode json body\"), http.StatusBadRequest)\n\t\treturn\n\t}\n\tif err := h.options.Storage.RemoveID(r.CorrelationID); err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tgologger.Warning().Msgf(\"Could not remove id for %s: %s\\n\", r.CorrelationID, err)\n\t\tjsonError(w, errors.Wrap(err, \"could not remove id\"), http.StatusBadRequest)\n\t\treturn\n\t}\n\tgologger.Debug().Msgf(\"Deregistered correlationID %s for key\\n\", r.CorrelationID)\n}", "title": "" }, { "docid": "23fa8d36f977428b5bcfd244061a47e0", "score": "0.4285366", "text": "func (n *NaplesUpgClient) LinkDownHandler(upgCtx *upggosdk.UpgCtx) upggosdk.HdlrResp {\n\tvar hdlrResp upggosdk.HdlrResp\n\n\tif n.evtsProxy != nil {\n\t\tn.logger.Info(\"upgrade in process, entering maintenance mode\")\n\t\tn.evtsProxy.SetMaintenanceMode(true)\n\t}\n\n\thdlrResp.Resp = upggosdk.Success\n\thdlrResp.ErrStr = \"\"\n\treturn hdlrResp\n}", "title": "" }, { "docid": "4d7f0449cf35932be908c0a18b87d890", "score": "0.42832243", "text": "func (s *APISurface) UnbindHandler(w http.ResponseWriter, r *http.Request) {\n\ts.Metrics.Actions.WithLabelValues(\"unbind\").Inc()\n\n\tversion := getBrokerAPIVersionFromRequest(r)\n\tif err := s.Broker.ValidateBrokerAPIVersion(version); err != nil {\n\t\twriteError(w, err, http.StatusPreconditionFailed)\n\t\treturn\n\t}\n\n\trequest, err := unpackUnbindRequest(r)\n\tif err != nil {\n\t\twriteError(w, err, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tglog.Infof(\"Received UnbindRequest for instanceID %q, bindingID %q\", request.InstanceID, request.BindingID)\n\tc := &broker.RequestContext{\n\t\tWriter: w,\n\t\tRequest: r,\n\t}\n\n\tresponse, err := s.Broker.Unbind(request, c)\n\tif err != nil {\n\t\twriteError(w, err, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\twriteResponse(w, http.StatusOK, response)\n}", "title": "" }, { "docid": "81cef25995a28a903bfa1dacf0d2a5ea", "score": "0.42810565", "text": "func (s *RecognizeTextOutput) SetRecognizedBotMember(v *RecognizedBotMember) *RecognizeTextOutput {\n\ts.RecognizedBotMember = v\n\treturn s\n}", "title": "" }, { "docid": "58b3a68b3d1a4f69389e3f3d36f9f19e", "score": "0.42768246", "text": "func (elfin *Elfin) handleOnReload(err error) {\n\telfin.BumpReloadCount()\n\tfor _, fun := range elfin.OnReloadFuncs {\n\t\tfun(err) //pass error to handler\n\t}\n\telfin.Start()\n}", "title": "" }, { "docid": "efeb1c4429338bc23e2e3ebdb70e01aa", "score": "0.42659226", "text": "func privmsgHandler(c *Connection, irc *IRC) bool {\n\n\t// is karma, sent to a channel (not /msg)\n\tif strings.HasPrefix(irc.To, \"#\") && c.parseKarma(irc.Message) {\n\t\treturn handled\n\n\t}\n\n\t// is parsed as command\n\tif irc.Command != \"\" {\n\t\tif fn, ok := c.CommandMap[irc.Command]; ok {\n\t\t\tc.Log.Printf(\"command found: %q\", irc.Command)\n\t\t\tfn(c, irc)\n\t\t\treturn handled\n\t\t}\n\t}\n\n\t// handle channel defined definitions\n\tif irc.Command != \"\" {\n\t\tdefinition := c.getDefinition(irc.Command)\n\t\tif definition != \"\" {\n\t\t\tirc.Reply(c, definition)\n\t\t\treturn handled\n\t\t}\n\n\t\tc.Log.Printf(\"command not found: %q\", irc.Command)\n\t\tirc.ReplyUser(c, \"command not found. try the 'help' command\")\n\t}\n\t// try to parse http link title\n\tif c.config.ParseLinks && strings.Contains(irc.Message, \"http\") {\n\t\tif c.linkhandler(irc) {\n\t\t\treturn handled\n\t\t}\n\t}\n\n\treturn nothandled\n\n}", "title": "" }, { "docid": "48e64d5065c5c86b5d8a9bd2b842f6e8", "score": "0.42637303", "text": "func (ag *agent) handleUserMessage(from *node.Node, msg *message.UserMessage) {\n\t// Test if the message is stale.\n\tdeadline := msg.GetTs() + time.Millisecond.Nanoseconds()*int64(ag.cfg.MLife)\n\tnow := time.Now().UnixNano()\n\tif now >= deadline {\n\t\tlog.Debugf(\"Message is too old, deadline: %v, now %v\\n\", deadline, now)\n\t\treturn\n\t}\n\n\t// Test if the message has been already received.\n\thash := hashMessage(msg.GetPayload())\n\n\tag.msgBuffer.Lock()\n\tdefer ag.msgBuffer.Unlock()\n\n\tif ag.msgBuffer.Has(hash) {\n\t\tpurgeDeadline := ag.msgBuffer.GetValueOf(hash)\n\t\tif purgeDeadline.(int64) >= now {\n\t\t\tlog.Debugf(\"Message is alread received, and with purge deadline, hash: %v\\n\", hash)\n\t\t\treturn\n\t\t}\n\t\tag.msgBuffer.Remove(hash)\n\t}\n\n\tpurgeDeadline := now + time.Millisecond.Nanoseconds()*int64(ag.cfg.PurgeDuration)\n\tag.msgBuffer.Append(hash, purgeDeadline)\n\n\t// Invoke user's message handler.\n\tgo ag.msgHandler(msg.GetPayload())\n\n\tag.aView.Lock()\n\tdefer ag.aView.Unlock()\n\n\tfor _, v := range ag.aView.Values() {\n\t\tnd := v.(*node.Node)\n\t\tif nd.Id != from.Id {\n\t\t\tgo ag.userMessage(nd, msg)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "805f584f2749b74295f34f0cecb0b79a", "score": "0.42607135", "text": "func (rm *ReconstructingMember) ReconstructMisbehavedIndividualKeys(\n\tmessages []*MisbehavedEphemeralKeysMessage,\n) error {\n\tfor _, message := range messages {\n\t\t// Validate received message. If message is invalid, sender should\n\t\t// be considered as misbehaving and marked as disqualified.\n\t\tif !rm.isValidMisbehavedEphemeralKeysMessage(message) {\n\t\t\tlogger.Warningf(\n\t\t\t\t\"[member:%v] member [%v] disqualified because of \"+\n\t\t\t\t\t\"sending invalid misbehaved ephemeral keys message\",\n\t\t\t\trm.ID,\n\t\t\t\tmessage.senderID,\n\t\t\t)\n\t\t\trm.group.MarkMemberAsDisqualified(message.senderID)\n\t\t}\n\t}\n\n\trevealedMisbehavedMembersShares, err := rm.revealMisbehavedMembersShares(messages)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"revealing misbehaved shares failed [%v]\", err)\n\t}\n\t// Store for the purpose of combining group public key shares in phase 12.\n\trm.revealedMisbehavedMembersShares = revealedMisbehavedMembersShares\n\n\trm.reconstructIndividualPrivateKeys(revealedMisbehavedMembersShares) // z_m\n\trm.reconstructIndividualPublicKeys() // y_m\n\treturn nil\n}", "title": "" }, { "docid": "b97d3d52d6ed304fa3232dea8cac45b0", "score": "0.42581013", "text": "func HelpMemberUpdate(ipaddr string, seTemp *net.UDPConn) {\n\tif ipaddr == introducer {\n\t\twg_memberUpdate.Done()\n\t\treturn\n\t}\n\tUDPAddr, err := net.ResolveUDPAddr(\"udp4\", ipaddr+PORT)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tconn, err := net.DialUDP(\"udp\", nil, UDPAddr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tconn.Write([]byte(\"Alive\\n\"))\n\tc1 := make(chan bool, 1)\n\tbuffer := make([]byte, 100)\n\tgo func() {\n\t\t_, _ = seTemp.Read(buffer)\n\t\tc1 <- true\n\t}()\n\tselect {\n\tcase <-c1:\n\t\t{\n\t\t\tmux_memberList.Lock()\n\t\t\thashval := hash(ipaddr)\n\t\t\tlenAllm := len(Allmembers)\n\t\t\tvar index int\n\t\t\tfor index = 0; index < lenAllm; index++ {\n\t\t\t\tif Allmembers[index].value < hashval {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\ttemp := make([]hashRecord, 1)\n\t\t\t\t\ttemp[0] = hashRecord{ipaddr, hashval}\n\t\t\t\t\tAllmembers = append(Allmembers[:index], append(temp, Allmembers[index:]...)...)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif index == len(Allmembers) {\n\t\t\t\tAllmembers = append(Allmembers, hashRecord{ipaddr, hashval})\n\t\t\t}\n\t\t\tmux_memberList.Unlock()\n\t\t}\n\tcase <-time.After(1 * time.Second):\n\t\t{\n\t\t\t//This member quit or fail when the introducer is not in virtual ring\n\t\t}\n\t}\n\twg_memberUpdate.Done()\n}", "title": "" }, { "docid": "9aa5b23d59c7df220abcd57522033a98", "score": "0.42517862", "text": "func (h PatchServiceMemberHandler) Handle(params servicememberop.PatchServiceMemberParams) middleware.Responder {\n\treturn h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest,\n\t\tfunc(appCtx appcontext.AppContext) (middleware.Responder, error) {\n\n\t\t\tserviceMemberID, _ := uuid.FromString(params.ServiceMemberID.String())\n\n\t\t\tvar err error\n\t\t\tvar serviceMember models.ServiceMember\n\t\t\tvar verrs *validate.Errors\n\n\t\t\tserviceMember, err = models.FetchServiceMemberForUser(appCtx.DB(), appCtx.Session(), serviceMemberID)\n\n\t\t\tif err != nil {\n\t\t\t\treturn handlers.ResponseForError(appCtx.Logger(), err), err\n\t\t\t}\n\n\t\t\tpayload := params.PatchServiceMemberPayload\n\n\t\t\tif verrs, err = h.patchServiceMemberWithPayload(appCtx, &serviceMember, payload); verrs.HasAny() || err != nil {\n\t\t\t\treturn handlers.ResponseForVErrors(appCtx.Logger(), verrs, err), err\n\t\t\t}\n\n\t\t\tif verrs, err = models.SaveServiceMember(appCtx, &serviceMember); verrs.HasAny() || err != nil {\n\t\t\t\treturn handlers.ResponseForVErrors(appCtx.Logger(), verrs, err), err\n\t\t\t}\n\n\t\t\tif len(serviceMember.Orders) != 0 && h.isDraftMove(&serviceMember) {\n\t\t\t\t// Will have to be refactored once we support multiple moves/orders\n\t\t\t\tvar order models.Order\n\t\t\t\torder, err = models.FetchOrderForUser(appCtx.DB(), appCtx.Session(), serviceMember.Orders[0].ID)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn handlers.ResponseForError(appCtx.Logger(), err), err\n\t\t\t\t}\n\n\t\t\t\tserviceMemberRank := (*string)(serviceMember.Rank)\n\t\t\t\tif serviceMemberRank != order.Grade {\n\t\t\t\t\torder.Grade = serviceMemberRank\n\t\t\t\t}\n\n\t\t\t\tif serviceMember.DutyLocation.ID != order.OriginDutyLocation.ID {\n\t\t\t\t\tdutyLocation := &serviceMember.DutyLocation\n\t\t\t\t\tvar originDutyLocationGBLOC models.PostalCodeToGBLOC\n\t\t\t\t\toriginDutyLocationGBLOC, err = models.FetchGBLOCForPostalCode(appCtx.DB(), dutyLocation.Address.PostalCode)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tswitch err {\n\t\t\t\t\t\tcase sql.ErrNoRows:\n\t\t\t\t\t\t\treturn nil, apperror.NewNotFoundError(dutyLocation.ID, \"while looking for Duty Location PostalCodeToGBLOC\")\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn nil, apperror.NewQueryError(\"PostalCodeToGBLOC\", err, \"\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\torder.OriginDutyLocation = &serviceMember.DutyLocation\n\t\t\t\t\torder.OriginDutyLocationID = &serviceMember.DutyLocation.ID\n\t\t\t\t\torder.OriginDutyLocationGBLOC = &originDutyLocationGBLOC.GBLOC\n\t\t\t\t}\n\n\t\t\t\tverrs, err = appCtx.DB().ValidateAndSave(&order)\n\t\t\t\tif verrs.HasAny() || err != nil {\n\t\t\t\t\treturn handlers.ResponseForVErrors(appCtx.Logger(), verrs, err), err\n\t\t\t\t}\n\t\t\t\tserviceMember.Orders[0] = order\n\t\t\t}\n\n\t\t\tserviceMemberPayload := payloadForServiceMemberModel(h.FileStorer(), serviceMember)\n\t\t\treturn servicememberop.NewPatchServiceMemberOK().WithPayload(serviceMemberPayload), nil\n\t\t})\n}", "title": "" }, { "docid": "522e5382332e803d42094fd6cc7411a7", "score": "0.42504176", "text": "func (k Keeper) HandleRegisterRelayerProposal(ctx sdk.Context, p *types.RegisterRelayerProposal) error {\n\t_, has := k.GetClientState(ctx, p.ChainName)\n\tif !has {\n\t\treturn sdkerrors.Wrapf(types.ErrClientNotFound, \"chain-name: %s\", p.ChainName)\n\t}\n\tk.RegisterRelayers(ctx, p.ChainName, p.Relayers)\n\treturn nil\n}", "title": "" }, { "docid": "9028b2e1158c0f0de8666315e9e51ea2", "score": "0.42493552", "text": "func (pn *paxosNode) RecvReplaceCatchup(args *paxosrpc.ReplaceCatchupArgs, reply *paxosrpc.ReplaceCatchupReply) error {\n\tvalue, _ := json.Marshal(pn.valueMap)\n\treply.Data = value\n\treturn nil\n}", "title": "" }, { "docid": "04905d72788a9dab0d76a16f397cf33c", "score": "0.4246113", "text": "func (s *BaseapexListener) ExitMemberDeclaration(ctx *MemberDeclarationContext) {}", "title": "" }, { "docid": "d3fa6027b23fa34efccc6b22f41a466a", "score": "0.42426008", "text": "func (b *collectorBehavior) Recover(err interface{}, e Event) {}", "title": "" }, { "docid": "7a35e7541897a2d55306dd47a5e63e01", "score": "0.42413512", "text": "func handleMsgUnblockUser(ctx sdk.Context, keeper Keeper, msg types.MsgUnblockUser) (*sdk.Result, error) {\n\tif err := keeper.UnblockUser(ctx, msg.Blocker, msg.Blocked, msg.Subspace); err != nil {\n\t\treturn nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())\n\t}\n\n\tctx.EventManager().EmitEvent(sdk.NewEvent(\n\t\ttypes.EventTypeUnblockUser,\n\t\tsdk.NewAttribute(types.AttributeUserBlockBlocker, msg.Blocker.String()),\n\t\tsdk.NewAttribute(types.AttributeUserBlockBlocked, msg.Blocked.String()),\n\t\tsdk.NewAttribute(types.AttributeSubspace, msg.Subspace),\n\t))\n\n\tresult := sdk.Result{\n\t\tData: keeper.Cdc.MustMarshalBinaryLengthPrefixed(msg.Blocker),\n\t\tEvents: ctx.EventManager().Events(),\n\t}\n\n\treturn &result, nil\n}", "title": "" }, { "docid": "48fec1cd7a1dfe4b5bf935c2d421d938", "score": "0.4238952", "text": "func handleReplicationMessage(replication net.Conn){\n\trepbuf := bufio.NewScanner(replication)\n\tfor repbuf.Scan(){\n\t\tretval := repbuf.Text()\n\t\tperformAction(retval, replication)\n\t}\n}", "title": "" }, { "docid": "98f9b8fd47756919c678445903183417", "score": "0.42373756", "text": "func (dataStoreSmash4Protocol *DataStoreSmash4Protocol) CheckPostReplay(handler func(err error, client *nex.Client, callID uint32, param *DataStorePreparePostReplayParam)) {\n\tdataStoreSmash4Protocol.CheckPostReplayHandler = handler\n}", "title": "" }, { "docid": "fec6bb780ec9743d1ea092256ae7c2dc", "score": "0.42243266", "text": "func (h *handler) handler(group string) http.Handler {\n\th.l.Lock()\n\tdefer h.l.Unlock()\n\n\thand, ok := h.groups[group]\n\tif !ok {\n\t\t// Create a new group and reap timer\n\t\thand = h.factory(group)\n\t\th.groups[group] = hand\n\t\tif h.reapDelay != 0 {\n\t\t\tt := time.AfterFunc(h.reapDelay, func() { h.reap(group) })\n\t\t\th.groupReap[group] = t\n\t\t}\n\t} else {\n\t\t// Reset the existing reap timer\n\t\tif t, ok := h.groupReap[group]; ok {\n\t\t\tt.Reset(h.reapDelay)\n\t\t}\n\t}\n\n\treturn hand\n}", "title": "" }, { "docid": "d11a00cec5806be8917371eba6b19070", "score": "0.42193523", "text": "func (s *Client) handleBanPeerMsg(state *peerState, sp *serverPeer) {\n\thost, _, err := net.SplitHostPort(sp.Addr())\n\tif err != nil {\n\t\tlog.Printf(\"can't split ban peer %s %v\", sp.Addr(), err)\n\t\treturn\n\t}\n\tdirection := directionString(sp.Inbound())\n\tlog.Printf(\"Banned peer %s (%s) for %v\", host, direction,\n\t\tcfg.BanDuration)\n\tstate.banned[host] = time.Now().Add(cfg.BanDuration)\n}", "title": "" }, { "docid": "9c62e689bb4ebdc1028041361a15183c", "score": "0.4214474", "text": "func (rm *ReplicaManager) SetUnresponsiveHandler(handler UnresponsiveHandler) {\n\trm.unresponsiveHandler = handler\n}", "title": "" }, { "docid": "289cad01a73425714c099b5775f3bb95", "score": "0.42110014", "text": "func (manager *Manager) handleHeartbeat(nodeid string, tm time.Time) (changed bool) {\n\tmember := manager.cluster.GetMember(nodeid)\n\tif member == nil {\n\t\tmemb, err := manager.dao.GetMember(nodeid)\n\t\tif err != nil {\n\t\t\tmanager.Error(fmt.Sprintf(\"[FATAL] Cannot find member [%s]\", nodeid), err)\n\t\t\treturn false\n\t\t}\n\t\tmember = &memb\n\t\tmanager.cluster.putMember(member)\n\t}\n\t\n\toldAlive := member.IsAlive()\n\t\n\tif member.IsLocal() {\n\t\tmember.SetAlive(true)\n\t} else if member.Heartbeat().IsZero() || tm.Equal(member.Heartbeat()) {\n\t\tgap := time.Now().Sub(tm).Seconds()\n\t\tif gap > float64(manager.GetConfig().AliveThresholdSeconds) {\n\t\t\tmanager.Info(fmt.Sprintf(\"Member[%s] haven't sent heartbeat for %f seconds.\", member.NodeID, gap))\n\t\t\tmember.SetAlive(false)\n\t\t} else {\n\t\t\tmember.SetAlive(true)\n\t\t}\n\t} else {\n\t\tmember.SetAlive(true)\n\t}\n\t\n\tmember.SetHeartbeat(tm)\n\t\n\tchanged = oldAlive != member.IsAlive()\n\t\n\treturn changed\n}", "title": "" }, { "docid": "584d92542d71f841efd11ca9b77bd5e9", "score": "0.42109737", "text": "func (n *OpenBazaarNode) handleFollowMessage(from peer.ID, message *pb.Message) error {\n\tdefer n.sendAckMessage(message.MessageID, from)\n\n\tif n.isDuplicate(message) {\n\t\treturn nil\n\t}\n\n\tvar ErrAlreadyFollowing = errors.New(\"peer already following us\")\n\n\terr := n.repo.DB().Update(func(tx database.Tx) error {\n\t\tfollowers, err := tx.GetFollowers()\n\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, follower := range followers {\n\t\t\tif follower == from.Pretty() {\n\t\t\t\treturn ErrAlreadyFollowing\n\t\t\t}\n\t\t}\n\t\tfollowers = append(followers, from.Pretty())\n\n\t\treturn tx.SetFollowers(followers)\n\t})\n\tif err != nil && err != ErrAlreadyFollowing {\n\t\treturn err\n\t} else if err == ErrAlreadyFollowing {\n\t\tlog.Debugf(\"Received FOLLOW message from peer %s which already follows us\", from)\n\t\treturn nil\n\t}\n\n\tlog.Infof(\"Received FOLLOW message from %s\", from)\n\tn.eventBus.Emit(&events.Follow{\n\t\tPeerID: from.Pretty(),\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "0e32e38b12537933b0ee2aaab91c9425", "score": "0.4196333", "text": "func processTheMessage(m PubSubMessage) error {\n\t// Return an error to retry this function execution.\n\treturn fmt.Errorf(\"processTheMessage: runtime error\")\n}", "title": "" }, { "docid": "505518e68932fb8ad320c982a27267bf", "score": "0.41953593", "text": "func MemberSetPolicyMember(_ context.Context, _ *dcl.Config, _ *unstructured.Resource, _ *unstructured.Resource) (*unstructured.Resource, error) {\n\treturn nil, unstructured.ErrNoSuchMethod\n}", "title": "" } ]
9c6757acbfbb72c71fc6aef0c24bcb07
Send sends a message. It blocks if the queue is full.
[ { "docid": "0414831ee9a3527462857afea195bfbe", "score": "0.6991342", "text": "func (mq *FastMq) Send(data []byte) error {\n\treturn mq.SendPriority(data, 2)\n}", "title": "" } ]
[ { "docid": "5d625da4a703c8ab18b071e75d6f3064", "score": "0.7275828", "text": "func (h *sendQueue) Send(p *packetBuffer, size protocol.ByteCount) {\n\tselect {\n\tcase h.queue <- queueEntry{buf: p, size: size}:\n\t\t// clear available channel if we've reached capacity\n\t\tif len(h.queue) == sendQueueCapacity {\n\t\t\tselect {\n\t\t\tcase <-h.available:\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\tcase <-h.runStopped:\n\tdefault:\n\t\tpanic(\"sendQueue.Send would have blocked\")\n\t}\n}", "title": "" }, { "docid": "1f1e550afc05ebdd9d9d8382f18d9178", "score": "0.71752584", "text": "func (q *bufferedQueueImpl) Send(msg *sqs.SendMessageInput) {\n\tq.buffer <- &sqs.SendMessageBatchRequestEntry{\n\t\tDelaySeconds: msg.DelaySeconds,\n\t\tMessageAttributes: msg.MessageAttributes,\n\t\tMessageBody: msg.MessageBody,\n\t\tMessageDeduplicationId: msg.MessageDeduplicationId,\n\t\tMessageGroupId: msg.MessageGroupId,\n\t}\n}", "title": "" }, { "docid": "05b28cd37b21d07c1f02af216a0c0197", "score": "0.716962", "text": "func (mmq *MockMessageQueue) Send(ctx context.Context, data []byte) error {\n\tif len(data) > mmq.maxSize {\n\t\treturn MessageTooLargeError{\n\t\t\tMessageSize: len(data),\n\t\t\tMaxSize: mmq.maxSize,\n\t\t}\n\t}\n\n\tif deadline, ok := ctx.Deadline(); !ok || deadline.Before(time.Now()) {\n\t\t// Use non-block mode\n\t\tselect {\n\t\tcase mmq.msgs <- data:\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn TimedOutError{\n\t\t\t\tCause: context.DeadlineExceeded,\n\t\t\t}\n\t\t}\n\t}\n\n\tselect {\n\tcase mmq.msgs <- data:\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\tif ctx.Err() == context.DeadlineExceeded {\n\t\t\treturn TimedOutError{\n\t\t\t\tCause: ctx.Err(),\n\t\t\t}\n\t\t}\n\t\treturn ctx.Err()\n\t}\n}", "title": "" }, { "docid": "4b47cd98daa1298cb391f76fa41a8b5e", "score": "0.7038434", "text": "func (sp *SyncProducer) Send(msg *sarama.ProducerMessage) {\n\tif msg != nil {\n\t\tsp.messages <- msg\n\t}\n}", "title": "" }, { "docid": "fee102c025637448f4248cf6d6ee77f2", "score": "0.702609", "text": "func (c *Client) Send(message Message) error {\n\tif c.options.IsDebug {\n\t\tnow := time.Now()\n\t\tdefer func() {\n\t\t\tend := time.Since(now)\n\t\t\tif end > c.options.DebugFuncTimeLimit {\n\t\t\t\tc.logger.Warnf(\"wspubsub.client.send: took=%s\", end)\n\t\t\t}\n\t\t}()\n\t}\n\n\tselect {\n\tcase c.messages <- message:\n\tdefault:\n\t\treturn errors.WithStack(NewClientSendBufferOverflowError(c.id))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9709b423f36149e34a41dfc1f25ee23e", "score": "0.70245385", "text": "func (d *downstreamSenderQueue) Send(handler DownstreamHandler, msg *wrp.Message) {\n\tswitch d.closed.Load() {\n\tcase true:\n\t\td.logger.Error(\"Failed to queue message. DownstreamSenderQueue is no longer accepting messages.\")\n\tdefault:\n\t\td.incoming <- sendInfo{handler: handler, msg: msg}\n\t}\n}", "title": "" }, { "docid": "eebde294ac28f787a1d7ba846ff6e55b", "score": "0.6935639", "text": "func (qm *QueueMessage) Send(ctx context.Context) (*SendQueueMessageResult, error) {\n\tif qm.transport == nil {\n\t\treturn nil, ErrNoTransportDefined\n\t}\n\treturn qm.transport.SendQueueMessage(ctx, qm)\n}", "title": "" }, { "docid": "88a0649603721cf3f8c919ed0369326b", "score": "0.6874998", "text": "func (l *link) Send(m *Message) error {\n\tselect {\n\tcase <-l.closed:\n\t\treturn io.EOF\n\tcase l.sendQueue <- m:\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "12231ac9e79c16839822598077be5d97", "score": "0.68623334", "text": "func (queue *Queue) Send(command string, parameters ...[]byte) {\n\tqueue.c <- Message{\n\t\tCommand: command,\n\t\tParameters: parameters,\n\t}\n}", "title": "" }, { "docid": "d4e15a882874bc2ab0c5bb8ad054d631", "score": "0.6862218", "text": "func (mq *MessageQueue) Send(data []byte, priority uint) error {\n\t_, err := mq_send(mq.handler, data, priority)\n\treturn err\n}", "title": "" }, { "docid": "2538cc28aad405bc9bcc437649497eb1", "score": "0.68616056", "text": "func (c *Client) SendMessage() {\n\tfor {\n\t\tm := <-c.SendQueue\n\t\t//TODO: implement message segmentation\n\n\t\tif _, err := c.OutputBuffer.Write(m.ToJSON()); err != nil {\n\t\t\tlogrus.Errorf(\"failed to send message: %s\\n\", err)\n\t\t}\n\n\t\tif err := c.OutputBuffer.Flush(); err != nil {\n\t\t\tlogrus.Errorf(\"failed to flush message: %s\\n\", err)\n\t\t\tc.Conn.Close()\n\t\t\tc.DisconnectChan <- c\n\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d240c63928566d35eed391712cdd4914", "score": "0.6852709", "text": "func (q *Queue) Send(data interface{}) error {\n\treturn q.PublishJSON(\"\", q.QueueName, false, false, data)\n}", "title": "" }, { "docid": "41caf1e27a3d1e7b8f6afa47cc5f4f6e", "score": "0.6851927", "text": "func (wq *WorkerQueue) Send(msg []byte) error {\n\n\tvar err error\n\tdefer wq.Rabbit.Close()\n\n\t// Declare the exchange\n\terr = wq.Rabbit.Channel.ExchangeDeclare(\n\t\twq.ExchangeName, \"direct\", true,\n\t\tfalse, false, false, nil,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Publish the message\n\terr = wq.Rabbit.Channel.Publish(\n\t\twq.ExchangeName, wq.RoutingKey,\n\t\tfalse, false,\n\t\tamqp.Publishing{\n\t\t\tContentType: \"text/plain\",\n\t\t\tBody: msg,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "848508d3db6415215b403b9c9a0359b7", "score": "0.68338597", "text": "func (c *Connection) Send(cmd Command) {\n c.sendQueue <- cmd\n}", "title": "" }, { "docid": "bd7568f3ca60424cfc3083f84a29b672", "score": "0.6827134", "text": "func (m *Mailbox) Send(msg []byte) {\n\tm.buf = append(m.buf, msg)\n}", "title": "" }, { "docid": "622e5226e377413c1e540f5a418c6409", "score": "0.68050665", "text": "func (q *Queue) Send(data interface{}) error {\n\tm, e := newMessage(data)\n\tif e != nil {\n\t\treturn e\n\t}\n\tif len(q.wsConnections) == 0 {\n\t\tLogfunc(\"No consumer, pushing message to stack\")\n\t\tq.store.Push(m)\n\t\treturn nil\n\t}\n\tq.send(m)\n\treturn nil\n}", "title": "" }, { "docid": "bdb0630a77e7a735ecf89298e6367e70", "score": "0.6801283", "text": "func (qs *QueueSession) Send(ctx context.Context, msg *Message) error {\n\tctx, span := qs.startSpanFromContext(ctx, \"sb.QueueSession.Send\")\n\tdefer span.End()\n\n\tif err := qs.ensureSender(ctx); err != nil {\n\t\treturn err\n\t}\n\n\tif msg.SessionID == nil {\n\t\tmsg.SessionID = qs.sessionID\n\t}\n\treturn qs.sender.Send(ctx, msg)\n}", "title": "" }, { "docid": "4aa57e2a00d515303313d9d4692702c7", "score": "0.6772965", "text": "func Send(msg string, clanid int32) {\n\t_lock.Lock()\n\tdefer _lock.Unlock()\n\n\tclan := _clans[clanid]\n\n\tif clan != nil {\n\t\tif !clan.MQ.Enqueue(msg) {\n\t\t\tclan.MQ.Dequeue()\n\t\t\tclan.MQ.Enqueue(msg)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "50fd7b332e200e799bd0bb0854dc5d19", "score": "0.67117405", "text": "func (c *Channel) Send(ctx context.Context, msg string) error {\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase c.writeBuf <- msg:\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "da1db3d97c35f68578f5480f812d1498", "score": "0.6668225", "text": "func (b *ZMQBroker) Send(msg string) error {\n\tidentity, _ := b.soc.Recv(0)\n\tb.soc.Send(identity, zmq.SNDMORE)\n\n\tb.soc.Recv(0)\n\tmsgRecv, _ := b.soc.Recv(0)\n\n\tmsgID, _ := strconv.Atoi(msgRecv)\n\tb.q.Discard(msgID)\n\n\tb.soc.Send(\"\", zmq.SNDMORE)\n\t_, err := b.soc.Send(msg, 0)\n\treturn err\n}", "title": "" }, { "docid": "7ed9e402dfc4c58212701d32ecb3bc01", "score": "0.66448975", "text": "func (c *Client) Send(msg osc.Message) error {\n\tif c.failSend == 0 {\n\t\treturn c.Conn.Send(msg)\n\t}\n\tc.currSend++\n\tif c.currSend == c.failSend {\n\t\treturn errors.New(\"fail send\")\n\t}\n\treturn c.Conn.Send(msg)\n}", "title": "" }, { "docid": "6bd020126eb19b1e9d38ead74c821e2e", "score": "0.6636445", "text": "func (p *Publisher) Send(message string) (e error) {\nTOP:\n\tif p.isConnected() {\n\t\tif !p.stompMsgHeaderSet {\n\t\t\treturn errors.New(\"ERROR: Send: send attempt to broker with header not set.\")\n\t\t} else {\n\t\t\tp.messageCache[1] = p.messageCache[0]\n\t\t\tp.messageCache[0] = message\n\t\t\te = p.stompConn.Send(p.stompMsgHeader, message)\n\t\t\tif e == nil {\n\t\t\t\treturn nil\n\t\t\t} else {\n\t\t\t\t// Send failed, attempt to reconnect\n\t\t\t\tfmt.Println(\"WARN: failed to send: \" + p.messageCache[1])\n\t\t\t\tfmt.Println(\"WARN: send error: \" + fmt.Sprintf(\"%v\", e))\n\t\t\t\te = p.Disconnect()\n\t\t\t\tp.connected = false\n\t\t\t\t// time.Sleep(10 * time.Second)\n\t\t\t\tfmt.Println(\"INFO: Attempting reconnect ...\")\n\t\t\t\te = p.Connect(p.transportProtocol, p.messageProtocol, p.MBSTarget)\n\n\t\t\t\t// time.Sleep(10 * time.Second)\n\t\t\t\t// resend the previous message\n\t\t\t\tfmt.Println(\"INFO: resending: \" + p.messageCache[1])\n\t\t\t\te = p.stompConn.Send(p.stompMsgHeader, p.messageCache[1])\n\t\t\t\tgoto TOP\n\t\t\t}\n\t\t}\n\t}\n\treturn errors.New(\"ERROR: Send: send attempt to broker when not connected.\")\n}", "title": "" }, { "docid": "f1875fd5fc43e83f07c3d80c707242eb", "score": "0.65935594", "text": "func (session *Session) Send(message Message) error {\n\tif session.IsClosed() {\n\t\treturn SendToClosedError\n\t}\n\n\tselect {\n\tcase session.sendChan <- message:\n\t\treturn nil\n\tdefault:\n\t\tsession.Close(BlockingError)\n\t\treturn BlockingError\n\t}\n}", "title": "" }, { "docid": "f1d16068e73f41b44df1de4b443d3726", "score": "0.6590891", "text": "func (mbs *MsgboxService) Send(targetID common.EntityID, msg Msg) {\n\tgwlog.Debugf(\"%s: Send %s => %T %v\", mbs, targetID, msg, msg)\n\tmsgid := mbs.getNextMsgId()\n\tmsgkey := mbs.getMsgKey(targetID, msgid)\n\tmsgBytes, err := msgpacker.PackMsg(msg, nil)\n\tif err != nil {\n\t\tgwlog.Panic(err)\n\t}\n\n\tkvdb.Put(msgkey, string(msgBytes), func(err error) {\n\t\tif err != nil {\n\t\t\tgwlog.Panic(err)\n\t\t}\n\t\tgwlog.Debugf(\"Msg %s is sent ok\", msgkey)\n\t})\n}", "title": "" }, { "docid": "22e151bce1020774c3590a2f2cb4a421", "score": "0.6588106", "text": "func (h *StreamHandler) SendMessage(m proto.Message) error {\n\n\tif h == nil {\n\t\treturn fmt.Errorf(\"Stream is not exist\")\n\t}\n\n\th.RLock()\n\tdefer h.RUnlock()\n\tif h.writeQueue == nil {\n\t\treturn fmt.Errorf(\"Streamhandler %s has been killed\", h.handler.Tag())\n\t}\n\n\tselect {\n\tcase h.writeQueue <- m:\n\t\treturn nil\n\tdefault:\n\t\tif !h.enableLoss {\n\t\t\treturn fmt.Errorf(\"Streamhandler %s's write channel full, rejecting\", h.handler.Tag())\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c15c82f8c77af049c4f8e7e972a8013f", "score": "0.6568411", "text": "func (s *Subscriber) send(msg interface{}) {\n\tif s.allowDrop {\n\t\tselect {\n\t\tcase s.C <- msg:\n\t\t\tatomic.AddUint64(&s.sent, 1)\n\t\tdefault:\n\t\t\tatomic.AddUint64(&s.dropped, 1)\n\t\t}\n\t} else {\n\t\ts.C <- msg\n\t\tatomic.AddUint64(&s.sent, 1)\n\t}\n}", "title": "" }, { "docid": "9cdaa82db59d9f521f6bc90812934b1c", "score": "0.65643424", "text": "func (c *QueueConn) Send(p protocol.Packet) error {\n\tif c.IsClosed() {\n\t\t// Can't send message to the closed connection.\n\t\treturn ErrConnClosed\n\t}\n\tselect {\n\tcase c.sendCh <- p:\n\t\treturn nil\n\tdefault:\n\t\t// A slow consumer was detected, close the underlying connection right away.\n\t\tc.Conn.Close()\n\t\t// Mark the connection as closed.\n\t\tc.markClosed()\n\t\treturn ErrSlowConsumer\n\t}\n}", "title": "" }, { "docid": "a05ec7def8f515b6419aa52054b97c35", "score": "0.65417165", "text": "func (mq *FastMq) SendTimeout(data []byte, timeout time.Duration) error {\n\treturn mq.SendPriorityTimeout(data, 0, timeout)\n}", "title": "" }, { "docid": "6c8c70adfc82b1dfe8d842bbedc62e10", "score": "0.653801", "text": "func (r Reco) send(msg int, m []byte) error {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tdefer logrus.Info(\"Unlocking mutex\")\n\treturn r.sock.WriteMessage(msg, m)\n}", "title": "" }, { "docid": "e12b5b5d782f860fc36d77b0777ecac5", "score": "0.65300685", "text": "func (s *SQS) Send(payload []byte) (io.Reader, error) {\n\tlog.Printf(\"Sending payload: %q\", payload)\n\tresult, err := s.client.SendMessage(&sqs.SendMessageInput{\n\t\tDelaySeconds: aws.Int64(10),\n\t\tMessageBody: aws.String(string(payload)),\n\t\tQueueUrl: s.queueURL,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlog.Printf(\"Received response:\\n%s\", result)\n\treturn strings.NewReader(result.String()), nil\n}", "title": "" }, { "docid": "552ef43575e18a3556a67ac6d462e87f", "score": "0.6514576", "text": "func (pool *ConnectionPool) SendMessage(addr string, msg Message) error {\n\tif pool.Config.DebugPrint {\n\t\tlogger.Debugf(\"Send, Msg Type: %s\", reflect.TypeOf(msg))\n\t}\n\n\treturn pool.strand(\"SendMessage\", func() error {\n\t\tif conn, ok := pool.addresses[addr]; ok {\n\t\t\tselect {\n\t\t\tcase conn.WriteQueue <- msg:\n\t\t\tdefault:\n\t\t\t\tlogger.Critical().Infof(\"Write queue full for address %s\", addr)\n\t\t\t\treturn ErrDisconnectWriteQueueFull\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "f6ffddb87c0f49a37f7af7fe7c549f71", "score": "0.65127325", "text": "func (p *Peer) Send(chID byte, msg interface{}) bool {\n\tif !p.IsRunning() {\n\t\treturn false\n\t}\n\treturn p.mconn.Send(chID, msg)\n}", "title": "" }, { "docid": "aafb64fb8355a7cffacf5a29f5d7efda", "score": "0.6507224", "text": "func Send(m msg.Pic) {\n\tgo func() { queue <- m }()\n}", "title": "" }, { "docid": "3b59093e638d1e15aae6d2fcc610bdf9", "score": "0.649952", "text": "func (bot *Bot) Send() {\n\tfor {\n\t\tselect {\n\t\tcase msg := <-bot.outQueue:\n\t\t\tbot.SendMessage(msg)\n\t\t\ttime.Sleep(500 * time.Millisecond)\n\t\tcase <-PingTicker.C:\n\t\t\terr := bot.ws.WriteControl(websocket.PingMessage, []byte(\"ping\"),\n\t\t\t\ttime.Now().Add(10*time.Second))\n\t\t\tif err != nil {\n\t\t\t\tpretty.Log(err)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8610b661f976273a642f99f9641ac39b", "score": "0.6490191", "text": "func (p *Producer) Send(msg *Message) error {\n\treturn p.SendWithContext(context.TODO(), msg)\n}", "title": "" }, { "docid": "2170a11e1aa0484cc04079b74175f2fd", "score": "0.6482325", "text": "func (sch *SChannel) Send(m []byte) bool {\n\tif !sch.ready {\n\t\treturn false\n\t}\n\treturn sch.send(NormalMessage, m)\n}", "title": "" }, { "docid": "aabd7c7a4760cbdb5eaa2868c525c2b5", "score": "0.6474364", "text": "func (sp *sendPool) send(mes message.Msg, dropOnTimeout bool) bool {\n\tif sp.isClosed() || !sp.isLocked() {\n\t\treturn false\n\t}\n\n\tsent := false\n\tfor stg, route := range sp.sndRoutes {\n\t\tif stg.isClosed() {\n\t\t\tcontinue\n\t\t}\n\n\t\tonTimeout := func() bool {\n\t\t\tsp.error(1, \"Timeout in sending to \"+string(route.route))\n\t\t\treturn dropOnTimeout\n\t\t}\n\t\tsnt := route.send(mes, _SendTimeout, onTimeout)\n\t\tsent = sent || snt\n\t}\n\n\tif sent {\n\t\tsp.lastSndMid = mes.Id()\n\t\tsp.totalSnd++\n\t}\n\n\treturn sent\n}", "title": "" }, { "docid": "0427f03f4fd5b5f52b3e5bec8fd0dc3c", "score": "0.64664954", "text": "func (d *downstreamSenderQueue) send(s sendInfo) {\n\tdefer d.wg.Done()\n\tdefer d.workers.Release(1)\n\n\td.logger.Debug(\"Sending message downstream...\")\n\n\tresponse := s.handler.HandleMessage(s.msg)\n\tif response != nil {\n\t\td.logger.Debug(\"Downstream returned a response\")\n\t\td.sendFunc(response)\n\t\treturn\n\t}\n\n\td.logger.Debug(\"Downstream Message Sent\")\n}", "title": "" }, { "docid": "46d8e298737c4060c613f58566aa745e", "score": "0.64652526", "text": "func (ws *Websocket) Send(ctx context.Context, b []byte) error {\n\tWSDebug(\"Acquiring the websocket mutex for sending.\")\n\n\tws.mutex.Lock()\n\tsendLimiter := ws.sendLimiter\n\tconn := ws.conn\n\tws.mutex.Unlock()\n\n\tWSDebug(\"Waiting for the send rate limiter...\")\n\n\tif err := sendLimiter.Wait(ctx); err != nil {\n\t\tWSDebug(\"Send rate limiter timed out.\")\n\t\treturn errors.Wrap(err, \"SendLimiter failed\")\n\t}\n\n\tWSDebug(\"Send has passed the rate limiting.\")\n\n\treturn conn.Send(ctx, b)\n}", "title": "" }, { "docid": "ab5bbd74db259e5ac2096cb28473617b", "score": "0.6457218", "text": "func (c *Client) Send(b []byte) (int, error) {\n\tc.wLock.Lock()\n\tdefer c.wLock.Unlock()\n\treturn c.conn.Write(b)\n}", "title": "" }, { "docid": "3f5e6a2ed81e1b711350c63c1436b5d5", "score": "0.64533895", "text": "func (c *Connection) sendMessage(msg message) error {\n\tf, err := marshalMessage(msg, c.framePool)\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\tselect {\n\tcase c.sendCh <- f:\n\t\treturn nil\n\tdefault:\n\t\treturn ErrSendBufferFull\n\t}\n}", "title": "" }, { "docid": "6c3544898db02b6681d11e34120b4ee5", "score": "0.644958", "text": "func (p *conn) Send(msg *mangos.Message) error {\n\n\tif msg.Expired() {\n\t\tmsg.Free()\n\t\treturn nil\n\t}\n\n\tif err := p.send(false, msg.Body); err != nil {\n\t\treturn err\n\t}\n\tmsg.Free()\n\treturn nil\n}", "title": "" }, { "docid": "31df393e3d2c3134da0c2e254ecd8cdf", "score": "0.644522", "text": "func (queue *BroadcastQueue) Send(command string, parameters ...[]byte) {\n\tm := Message{\n\t\tCommand: command,\n\t\tParameters: parameters,\n\t}\n\n\th := sha3.New256()\n\th.Write([]byte(command))\n\tfor _, p := range parameters {\n\t\th.Write(p)\n\t}\n\tvar sum signature\n\tcopy(sum[:], h.Sum([]byte{}))\n\n\tqueue.Lock()\n\tif _, ok := queue.cache[sum]; ok {\n\t\tqueue.Unlock()\n\t\treturn\n\t}\n\tqueue.cache[sum] = struct{}{}\n\tqueue.index.PushBack(sum)\n\n\tif queue.index.Len() > 100 {\n\t\ts := queue.index.Remove(queue.index.Front()).(signature)\n\t\tdelete(queue.cache, s)\n\t}\n\tqueue.Unlock()\n\n\tfor _, out := range queue.out {\n\n\t\t// check for more than one free entry\n\t\tif len(out) < cap(out)-1 {\n\t\t\tout <- m\n\t\t} else if \"block\" == command {\n\t\t\t// allow block messages to use the last free entry\n\t\t\tselect {\n\t\t\tcase out <- m:\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9bb39f22a2ba527ce0e3e2590b248e19", "score": "0.64334846", "text": "func Send(msg server.Message) {\n\tif _, err := conn.Write(msg.Pack()); err != nil {\n\t\tfmt.Printf(\"failed to the following to %s: %s:\\n%+v\\n\", conn.RemoteAddr(), err, msg)\n\n\t\t// if too many write fails occur in a row, then disconnect from server\n\t\tsendFailCounter++\n\t\tif sendFailCounter >= maxSendFails {\n\t\t\tfmt.Println(\"too many failed sends occurred - triggering a client disconnect\")\n\t\t\tDisconnect()\n\t\t}\n\t\treturn\n\t}\n\tsendFailCounter = 0\n}", "title": "" }, { "docid": "3d6fbffc051ef971c5f06e5f646c7f5c", "score": "0.6426699", "text": "func Send(ctx context.Context, send SendHandler) error {\n\tif features.XdsPushSendTimeout.Nanoseconds() > 0 {\n\t\terrChan := make(chan error, 1)\n\t\ttimeoutCtx, cancel := context.WithTimeout(ctx, features.XdsPushSendTimeout)\n\t\tdefer cancel()\n\t\tgo func() {\n\t\t\terr := send()\n\t\t\terrChan <- err\n\t\t\tclose(errChan)\n\t\t}()\n\t\tselect {\n\t\tcase <-timeoutCtx.Done():\n\t\t\treturn status.Errorf(codes.DeadlineExceeded, \"timeout sending\")\n\t\tcase err := <-errChan:\n\t\t\treturn err\n\t\t}\n\t}\n\terr := send()\n\treturn err\n}", "title": "" }, { "docid": "a000d6e81e846622e6f0de4e302fbc31", "score": "0.6394176", "text": "func (c *Client) Send(m Message) error {\n\tc.send <- m\n\treturn nil\n}", "title": "" }, { "docid": "fc1cf3b479dc4e31aa4acb3446c6ff07", "score": "0.6393436", "text": "func (eb *TestMessageBus) Send(msg core.Message) (resp core.Reply, err error) {\n\treturn eb.LogicRunner.Execute(msg)\n}", "title": "" }, { "docid": "239e010dde07ee15d0b0eefe076f4a42", "score": "0.639186", "text": "func (c *Client) Send(data []byte, size uint32) {\n\tif c.Status != Closed {\n\t\tmlog.Info(\"Send data:\", data)\n\t\tc.WriteHandler(data, size)\n\t}\n}", "title": "" }, { "docid": "3699095d043b302532b9a868d2c56752", "score": "0.6382411", "text": "func (m *messenger) send(msg []byte) {\n\tselect {\n\tcase m.sendCh <- msg:\n\tdefault:\n\t\tm.server.Remove(m.clientID)\n\t\tm.server.err(ErrClientNotFound)\n\t\tm.doneCh <- true\n\t}\n}", "title": "" }, { "docid": "908e57ee0cad7e0059fa4e76286ace2b", "score": "0.63794994", "text": "func (s *Server) Send(ctx context.Context, message *wrappers.StringValue) (*empty.Empty, error) {\n\tif message != nil {\n\t\tlog.Printf(\"Send requested: message=%v\", message.Value)\n\t\ts.message <- message.Value\n\t} else {\n\t\tlog.Print(\"Send requested: message=<empty>\")\n\t}\n\n\treturn &empty.Empty{}, nil\n}", "title": "" }, { "docid": "cc1caeea2db680405d3c8fb56326ec4b", "score": "0.6372394", "text": "func (c *channel) Send(msg *net.Message) error {\n\treturn c.endpoint.Send(*msg)\n}", "title": "" }, { "docid": "6154018b08daee1c75aa6e0ef9b8ed97", "score": "0.63561475", "text": "func (s *Client) send(data []byte) (int, error) {\n\ts.mutex.Lock()\n\tdefer s.mutex.Unlock()\n\tn, err := s.buf.Write([]byte(data))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif n == 0 {\n\t\treturn n, errors.New(\"Wrote no bytes\")\n\t}\n\terr = s.buf.Flush()\n\tif err != nil {\n\t\treturn n, err\n\t}\n\treturn n, nil\n}", "title": "" }, { "docid": "81331cfd3f513e6e94dbaffdd87a97dc", "score": "0.6350254", "text": "func (w *Websocket) SendAndWait(message string) {\n\tw.Write([]byte(message))\n\n\tw.Lock()\n\tcurrent := len(w.lines)\n\tw.Unlock()\n\n\tfor {\n\t\tif len(w.lines) != current {\n\t\t\tbreak\n\t\t}\n\n\t\ttime.Sleep(10 * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "e1c7b7c059796ac2830bf20f399c22b2", "score": "0.63467604", "text": "func SendQueuedMessage(t *testing.T,\r\n\tq []*Message,\r\n\ti int,\r\n\tsender, receiver *Chatter,\r\n\tplaintext string) error {\r\n\r\n\tmessage, err := CheckSend(t, sender, receiver, plaintext)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\tif VERBOSE {\r\n\t\tfmt.Printf(\"Message \\\"%s\\\" from %s to %s sent and added to queue\\n\",\r\n\t\t\tplaintext,\r\n\t\t\tPrintHandle(&sender.Identity.PublicKey),\r\n\t\t\tPrintHandle(&receiver.Identity.PublicKey))\r\n\t}\r\n\r\n\tq[i] = message\r\n\treturn nil\r\n}", "title": "" }, { "docid": "68d8d199bc9d02c6ca09808f296d4c3f", "score": "0.6341827", "text": "func (s *Server) Send(ctx context.Context, m *irc.Message) error {\n\tselect {\n\tcase s.sendChan <- m:\n\t\treturn nil\n\tcase <-s.stopChan:\n\t\treturn ErrStopped\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}", "title": "" }, { "docid": "e4c914b6d350832f60ba7804eda36a4a", "score": "0.6341731", "text": "func (qma *QueueMessages) Send(ctx context.Context) ([]*SendQueueMessageResult, error) {\n\tif qma.transport == nil {\n\t\treturn nil, ErrNoTransportDefined\n\t}\n\treturn qma.transport.SendQueueMessages(ctx, qma.Messages)\n}", "title": "" }, { "docid": "3ef1ac3074fcc38c84177ca75aad6954", "score": "0.63377494", "text": "func (this *Agent) Send(message []byte) error {\n var err error\n\n if !this.isConnected() && this.autoReconnect {\n err = this.Connect()\n } else if !this.isConnected() {\n err = errors.New(fmt.Sprintf(ERR_AGENT_NOT_CONNECTED, this.Info().String()))\n }\n\n if err == nil {\n _, err = this.connection.Write(message)\n }\n\n if this.wait != 0 {\n time.Sleep(this.wait)\n }\n\n return err\n}", "title": "" }, { "docid": "6fad4dc6699392291cd7979bc95a4d87", "score": "0.6332956", "text": "func (m *MessageService_MessageClientMock) Send(p *message.Msg) (r error) {\n\tatomic.AddUint64(&m.SendPreCounter, 1)\n\tdefer atomic.AddUint64(&m.SendCounter, 1)\n\n\tif m.SendMock.mockExpectations != nil {\n\t\ttestify_assert.Equal(m.t, *m.SendMock.mockExpectations, MessageService_MessageClientMockSendParams{p},\n\t\t\t\"MessageService_MessageClient.Send got unexpected parameters\")\n\n\t\tif m.SendFunc == nil {\n\n\t\t\tm.t.Fatal(\"No results are set for the MessageService_MessageClientMock.Send\")\n\n\t\t\treturn\n\t\t}\n\t}\n\n\tif m.SendFunc == nil {\n\t\tm.t.Fatal(\"Unexpected call to MessageService_MessageClientMock.Send\")\n\t\treturn\n\t}\n\n\treturn m.SendFunc(p)\n}", "title": "" }, { "docid": "3ce5bb81bcc0b1854d5365fe043d2d9b", "score": "0.6319686", "text": "func (c *Conn) queueStreamForSend(s *Stream) {\n\tc.streams.sendMu.Lock()\n\tdefer c.streams.sendMu.Unlock()\n\tif s.next != nil {\n\t\t// Already in the queue.\n\t\treturn\n\t}\n\tif c.streams.sendHead == nil {\n\t\t// The queue was empty.\n\t\tc.streams.sendHead = s\n\t\tc.streams.sendTail = s\n\t\ts.next = s\n\t} else {\n\t\t// Insert this stream at the end of the queue.\n\t\tc.streams.sendTail.next = s\n\t\tc.streams.sendTail = s\n\t\ts.next = c.streams.sendHead\n\t}\n\tc.streams.needSend.Store(true)\n\tc.wake()\n}", "title": "" }, { "docid": "45457c1ef1ccca6eb994e54692728f2d", "score": "0.6316225", "text": "func (p *Plugger) Send(msg *Message) error {\n\tcopy := *msg\n\tcopy.Time = time.Now()\n\tcopy.Text = strings.TrimRight(copy.Text, \" \\t\")\n\tif len(copy.Text) <= MaxTextLen {\n\t\tif err := p.send(&copy); err != nil {\n\t\t\tlogf(\"Cannot put message in outgoing queue: %v\", err)\n\t\t\treturn fmt.Errorf(\"cannot put message in outgoing queue: %v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\ttext := copy.Text\n\tfor len(text) > MaxTextLen {\n\t\tsplit := MaxTextLen\n\t\tif i := strings.LastIndex(text[:split], \" \"); i > 0 {\n\t\t\tsplit = i\n\t\t\tif len(text)-split < minTextLen {\n\t\t\t\tsuffix := text[(len(text)+1)/2:]\n\t\t\t\tif j := strings.Index(suffix, \" \"); j >= 0 {\n\t\t\t\t\tsplit = len(text) - len(suffix) + j\n\t\t\t\t}\n\t\t\t}\n\t\t} else if len(text)-MaxTextLen < minTextLen {\n\t\t\tsplit = (len(text) + 1) / 2\n\t\t}\n\t\tcopy.Text = strings.TrimRight(text[:split], \" \")\n\t\ttext = strings.TrimLeft(text[split:], \" \")\n\t\tif err := p.Send(&copy); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif len(text) > 0 {\n\t\tcopy.Text = text\n\t\treturn p.Send(&copy)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "45457c1ef1ccca6eb994e54692728f2d", "score": "0.6316225", "text": "func (p *Plugger) Send(msg *Message) error {\n\tcopy := *msg\n\tcopy.Time = time.Now()\n\tcopy.Text = strings.TrimRight(copy.Text, \" \\t\")\n\tif len(copy.Text) <= MaxTextLen {\n\t\tif err := p.send(&copy); err != nil {\n\t\t\tlogf(\"Cannot put message in outgoing queue: %v\", err)\n\t\t\treturn fmt.Errorf(\"cannot put message in outgoing queue: %v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\ttext := copy.Text\n\tfor len(text) > MaxTextLen {\n\t\tsplit := MaxTextLen\n\t\tif i := strings.LastIndex(text[:split], \" \"); i > 0 {\n\t\t\tsplit = i\n\t\t\tif len(text)-split < minTextLen {\n\t\t\t\tsuffix := text[(len(text)+1)/2:]\n\t\t\t\tif j := strings.Index(suffix, \" \"); j >= 0 {\n\t\t\t\t\tsplit = len(text) - len(suffix) + j\n\t\t\t\t}\n\t\t\t}\n\t\t} else if len(text)-MaxTextLen < minTextLen {\n\t\t\tsplit = (len(text) + 1) / 2\n\t\t}\n\t\tcopy.Text = strings.TrimRight(text[:split], \" \")\n\t\ttext = strings.TrimLeft(text[split:], \" \")\n\t\tif err := p.Send(&copy); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif len(text) > 0 {\n\t\tcopy.Text = text\n\t\treturn p.Send(&copy)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "792b54d5fb65b5c989f5eb604f83b9ff", "score": "0.6315432", "text": "func (actorSelf *ActorDef) Send(message interface{}) {\n\tif actorSelf.isClosed {\n\t\treturn\n\t}\n\n\t*(actorSelf.ch) <- message\n}", "title": "" }, { "docid": "4be9392939fcb37ea05f12358c352fa1", "score": "0.63104266", "text": "func (bn *BaseNetwork) Send(msg message.Message) {\n\tif msg.To == bn.localNode.Addr() || msg.To == \"\" {\n\t\treturn\n\t}\n\tdata, err := msg.Marshal(nil)\n\tif err != nil {\n\t\tbn.log.E(\"[net] marshal request encountered err:%v\", err)\n\t}\n\tbn.log.D(\"[net] send msg: type= %v, from=%v,to=%v,time=%v\", msg.ReqType, msg.From, msg.To, msg.Time)\n\treq := newRequest(Message, bn.localNode.Addr(), data)\n\tpeer, err := bn.dial(msg.To)\n\tif err != nil {\n\t\tbn.nodeTable.Delete([]byte(msg.To))\n\t\tbn.NodeAddedTime.Delete(msg.To)\n\t\tbn.log.E(\"[net] Send, dial tcp got err:%v\", err)\n\t\treturn\n\t}\n\n\tif msg.ReqType == int32(ReqSyncBlock) || msg.ReqType == int32(ReqNewBlock) {\n\t\tif er := bn.send(peer.blockConn, req); er != nil {\n\t\t\tbn.peers.RemoveByNodeStr(msg.To)\n\t\t}\n\t} else {\n\t\tif er := bn.send(peer.conn, req); er != nil {\n\t\t\tbn.peers.RemoveByNodeStr(msg.To)\n\t\t}\n\t}\n\n\tprometheusSendBlockTx(msg)\n}", "title": "" }, { "docid": "2e84214911cc156bfbbce366b79d3bcf", "score": "0.63084173", "text": "func (m *DefaultMessageEndpoint) SyncSend(addr string, msg pb.Message) (pb.Message, error) {\n\tonSucc := make(chan pb.Message)\n\tdefer close(onSucc)\n\n\td, err := proto.Marshal(&msg)\n\tif err != nil {\n\t\treturn pb.Message{}, err\n\t}\n\n\t// register callback function, this callback function is called when\n\t// member with @addr sent back us packet\n\tm.resHandler.addCallback(msg.Id, callback{\n\t\tfn: func(msg pb.Message) {\n\t\t\tonSucc <- msg\n\t\t},\n\t\tcreated: time.Now(),\n\t})\n\n\t// send the message\n\t_, err = m.transport.WriteTo(d, addr)\n\tif err != nil {\n\t\tiLogger.Error(nil, err.Error())\n\t\treturn pb.Message{}, err\n\t}\n\n\t// start timer\n\tT := time.NewTimer(m.config.SendTimeout)\n\n\tselect {\n\tcase msg := <-onSucc:\n\t\treturn msg, nil\n\tcase <-T.C:\n\t\treturn pb.Message{}, ErrSendTimeout\n\t}\n\n\treturn pb.Message{}, ErrUnreachable\n}", "title": "" }, { "docid": "00b69c991d15fc1b92dab62e2b399147", "score": "0.6306997", "text": "func (self *ConnectionPool) SendMessage(c *Connection, channel uint16, msg []byte) {\n\tselect {\n\tcase c.WriteQueue <- BinMessage{Channel: channel, Message: msg}:\n\tdefault:\n\t\tlogger.Debug(\"Warning: disconnecting client because write queue full\")\n\t\tself.Disconnect(c, DisconnectWriteQueueFull)\n\t}\n}", "title": "" }, { "docid": "f2652abccf5a4d42a9d65cfa0754ba7b", "score": "0.62894714", "text": "func (c *WSClient) Send(msg ServerMessage) {\n\tif c.connected {\n\t\tc.send <- msg\n\t}\n}", "title": "" }, { "docid": "4bc400e37ddf58cd6a7dfdd058e7e806", "score": "0.6283918", "text": "func (actorSelf *ActorDef[T]) Send(message T) {\n\tif actorSelf.isClosed {\n\t\treturn\n\t}\n\n\tactorSelf.ch <- message\n}", "title": "" }, { "docid": "357436281474d329eea0c0587198ce23", "score": "0.62782395", "text": "func (e *Executor) SendMessage(msg message.Message) error {\n\treturn message.GetSender().Send(msg)\n}", "title": "" }, { "docid": "a755f8b907b905dc544585cdac42bfa1", "score": "0.6268922", "text": "func (y *PeekChan) Send(v interface{}) error {\n\ty.slk.Lock()\n\tdefer y.slk.Unlock()\n\tfor !y.canSendOrClosed() {\n\t\ty.scond.Wait()\n\t}\n\tif y.closed {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\ty.sbuf.PushBack(v)\n\treturn nil\n}", "title": "" }, { "docid": "61026d85be7ab3b151a529a31d3c6602", "score": "0.6257936", "text": "func (p *Producer) Send(query url.Values) error {\n\tb, err := p.encode(query)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = p.sendMessage(&b)\n\tif err != nil {\n\t\tp.buffer.PushBack(b)\n\t\treturn errors.New(\"Error sending message, queued for retry\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "639fc1efd4138025c172a81cd3a0eedc", "score": "0.62567943", "text": "func (t *Transmission) Send(data []byte, flush bool) error {\n\treturn t.client.Send(data, flush)\n}", "title": "" }, { "docid": "97a5b042ac39d976edf50f341c8b404b", "score": "0.62500453", "text": "func (s *server) Send(stream msgpb.Queue_SendServer) error {\n\tlast := int64(-1)\n\tfor {\n\t\tmsg, err := stream.Recv()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\tlog.Printf(\"stream received err, %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tif msg.Id != last+1 {\n\t\t\tlog.Printf(\"last: %d, msg: %d\", last, msg.Id)\n\t\t}\n\t\tlast = msg.Id\n\t\tif last%1000000 == 0 {\n\t\t\tlog.Println(last)\n\t\t}\n\t}\n\tlog.Printf(\"done\")\n\treturn nil\n}", "title": "" }, { "docid": "73775943ad42095797287cd6798a5649", "score": "0.6249538", "text": "func (p *Peer) TrySend(chID byte, msg interface{}) bool {\n\tif !p.IsRunning() {\n\t\treturn false\n\t}\n\n\tlog.WithFields(log.Fields{\n\t\t\"module\": logModule,\n\t\t\"peer\": p.Addr(),\n\t\t\"msg\": msg,\n\t\t\"type\": reflect.TypeOf(msg),\n\t}).Info(\"send message to peer\")\n\treturn p.mconn.TrySend(chID, msg)\n}", "title": "" }, { "docid": "346bc5a725b30fa5a206fd9ab88ef1af", "score": "0.624484", "text": "func Send(c context.Context, msg *Message) error {\n\treturn send(c, \"Send\", msg)\n}", "title": "" }, { "docid": "0393d78c833123dfa3cba8d456c101e0", "score": "0.6239919", "text": "func (k msgServer) Send(goCtx context.Context, msg *types.MsgSend) (*types.MsgSendResponse, error) {\n\tctx := sdk.UnwrapSDKContext(goCtx)\n\terr := k.TrySendCoins(ctx, msg.SourcePort, msg.SourceChannel, msg.ChainType, msg.Sender, msg.ToAddress, msg.Amount)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &types.MsgSendResponse{}, nil\n}", "title": "" }, { "docid": "919ad3b47e6224ce2c7c1e62aa48c360", "score": "0.6223847", "text": "func (b *Base) Send(data []byte) error {\n\treturn b.bus.Send(b, data)\n}", "title": "" }, { "docid": "82e564d514a43ebbb2257cda9d300121", "score": "0.6220261", "text": "func (aq *AzureQueue) Send(item *Item) error {\n\treq, err := aq.requestWithBody(aq.url+\"messages/\", \"POST\", item.Request)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresp, err := aq.client.Do(req)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusCreated {\n\t\treturn nil\n\t}\n\n\tdefer resp.Body.Close()\n\n\tb, _ := ioutil.ReadAll(resp.Body)\n\n\treturn fmt.Errorf(\"Got error code %v with body %s\", resp.StatusCode, string(b))\n}", "title": "" }, { "docid": "1c987113749deb0b042cc536d876f09c", "score": "0.62193245", "text": "func (p *Peer) SendSingleMessage(msg protocol.Message){\n\tp.singleQueue <- &SingleRequest{\n\t\tData:msg,\n\t\tFromAddr:msg.GetFromAddr(),\n\t}\n}", "title": "" }, { "docid": "d61f3fff21ff0fe4276b4348c8e4c106", "score": "0.62145096", "text": "func (m *ManagedProducer) Send(ctx context.Context, payload []byte) (*api.CommandSendReceipt, error) {\n\tfor {\n\t\tm.mu.RLock()\n\t\tproducer := m.producer\n\t\twait := m.waitc\n\t\tm.mu.RUnlock()\n\n\t\tif producer != nil {\n\t\t\treturn producer.Send(ctx, payload)\n\t\t}\n\n\t\tselect {\n\t\tcase <-wait:\n\t\t\t// a new producer was established.\n\t\t\t// Re-enter read-lock to obtain it.\n\t\t\tcontinue\n\t\tcase <-ctx.Done():\n\t\t\treturn nil, ctx.Err()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f7072aebc5306bf754f8f35f93a1a815", "score": "0.6210145", "text": "func (c *Clients) Send(message string) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\t// If the other side is not ready, they lose the message.\n\t// There is a capacity so messages would only be lost if\n\t// the client is not responding.\n\n\tfor id, ch := range c.clients {\n\t\tselect {\n\t\tcase ch <- message:\n\t\t\tlog.Println(\"client: sent: to: \", id)\n\t\tdefault:\n\t\t\tlog.Println(\"client: timeout: to: \", id)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b9a190091a855437c040434b47e0552b", "score": "0.61950743", "text": "func Send(c context.Context, msg *Message) error {\n\treturn Raw(c).Send(msg)\n}", "title": "" }, { "docid": "14ec25e3deaedaa28a0dcdcc2ba59a46", "score": "0.61931604", "text": "func (m *MockGossipAdapter) Send(msg *gossipproto.GossipMessage, peers ...*comm.RemotePeer) {\n\tif m.handler != nil {\n\t\tgo m.handler(msg)\n\t}\n}", "title": "" }, { "docid": "e7ca7a57c06bcfe4213e07b8902916c3", "score": "0.61844623", "text": "func (message *Message) Send() error {\n\tlog.Printf(\"Send: Started\")\n\n\t// Accepts SMS messages\n\n\t// Validations:\n\t// Input Validation: Make sure no empty or incorrect parameter values are send to MessageBird.\n\terr := message.Validate()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Process:\n\t// If the message has more than the limit of characters, split it\n\tms, err := message.Process()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Send the received message to the MessageBird REST API\n\t// Outgoing messages won't exceed one API request per second (neither when concatenated mesages\n\t// OR when receiving requests)\n\n\t// It is using the messagebird go rest api library\n\t// Documentation: https://developers.messagebird.com/docs/messaging\n\n\tmbClient := messagebird.New(os.Getenv(\"MESSAGEBIRD_API_KEY\"))\n\n\t// message header for concatenated messages\n\n\t// Send only if there is balance\n\tbalance, err := mbClient.Balance()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif balance.Amount > 0 {\n\t\tlog.Printf(\"The balance in the account is: %v.\", balance.Amount)\n\t\tfor _, m := range ms {\n\t\t\t// Rate of sending messages\n\t\t\ttime.Sleep(1000 * time.Millisecond)\n\n\t\t\tparams := &messagebird.MessageParams{Reference: \"GO Developer Test\"}\n\n\t\t\t// Adds the UDH\n\t\t\tif len(m.Header) > 1 {\n\t\t\t\ttypedetails := make(map[string]interface{})\n\t\t\t\ttypedetails[\"udh\"] = m.Header\n\t\t\t\tparams = &messagebird.MessageParams{Reference: \"GO Developer Test\", TypeDetails: typedetails}\n\t\t\t}\n\n\t\t\t// Sending the message\n\t\t\tmessage, err := mbClient.NewMessage(m.Originator, []string{strconv.Itoa(m.Recipient)}, m.Body, params)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error %v \\n\", err)\n\t\t\t\tlog.Printf(\"Returned object %v \\n\", message)\n\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tlog.Printf(\"Send: Completed.\")\n\treturn nil\n}", "title": "" }, { "docid": "1b544447ae6e8c1f613d6c6eb5f8ed41", "score": "0.618123", "text": "func (c *Client) Send(m protocol.OutgoingMessage) {\n\tc.SendChan <- m\n}", "title": "" }, { "docid": "ff51a2fa8052ab2282b10968e8fdd639", "score": "0.6160933", "text": "func (push *pushSocket) Send(msg Msg) error {\n\treturn push.sck.Send(msg)\n}", "title": "" }, { "docid": "d6c185ae636015dd4ee8a265a9a2900b", "score": "0.6159305", "text": "func (s *MQ) Send(name string, data []byte, routingKey string) error {\n\tif s.atype == Consumer {\n\t\treturn errors.New(\"mq client is not for sending\")\n\t}\n\n\tif _, ok := s.exchanges[name]; !ok {\n\t\treturn errors.New(\"exchange has not been created\")\n\t}\n\tmsg := amqp.Publishing{\n\t\tContentType: \"application/json\",\n\t\tBody: data,\n\t}\n\n\treturn s.ch.Publish(name, routingKey, false, false, msg)\n}", "title": "" }, { "docid": "52ca62c92116bed2ff3bed345ce3780c", "score": "0.6150517", "text": "func (c *Connection) Send(msg *chat.ChatMessage) {\n\tdefer func() {\n\t\t// Ignore any errors about sending on a closed channel\n\t\trecover()\n\t}()\n\tc.send <- msg\n}", "title": "" }, { "docid": "281d79dbda2b429658d6922c363aa9c8", "score": "0.61468804", "text": "func (c *connection) send(msg []byte) os.Error {\n\tif c.err != nil {\n\t\treturn c.err\n\t}\n\twire.PutUint32(msg[0:4], uint32(len(msg)))\n\t_, err := c.conn.Write(msg)\n\tif err != nil {\n\t\treturn c.fatal(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "68e639730e9b3d223b7d0df4a844753a", "score": "0.61460847", "text": "func (p *localPeer) Send(msg wamp.Message) error {\n\tp.wr <- msg\n\treturn nil\n}", "title": "" }, { "docid": "209d7db4f461829c29fd3546dd824b7d", "score": "0.6145873", "text": "func (s *Stream) pushSend(data []byte, offset uint64, fin bool) error {\n\tif s.send.stopReceived || s.send.resetStream != deliveryNone {\n\t\t// Do not resend stream data when received STOP_SENDING or sending RESET_STREAM\n\t\treturn nil\n\t}\n\treturn s.send.push(data, offset, fin)\n}", "title": "" }, { "docid": "99759cc5e59e0f73dfca1fcf2450f43d", "score": "0.61442065", "text": "func (obj *TCPChannel) Send(msg tgdb.TGMessage) tgdb.TGError {\n\tif logger.IsDebug() {\n\t\tlogger.Debug(fmt.Sprintf(\"======> Entering TCPChannel:Send w/ Socket '%+v' and Message as '%+v'\", obj.socket, msg.String()))\n\t}\n\tif obj.output == nil || obj.GetIsClosed() {\n\t\tlogger.Error(fmt.Sprint(\"ERROR: Returning TCPChannel::Send as the channel is closed\"))\n\t\terrMsg := fmt.Sprintf(\"TCPChannel:Send - unable to send message to server as the channel is closed\")\n\t\treturn GetErrorByType(TGErrorGeneralException, \"TGErrorProtocolNotSupported\", errMsg, \"\")\n\t}\n\n\terr := obj.writeToWire(msg)\n\tif logger.IsDebug() {\n\t\tlogger.Debug(fmt.Sprintf(\"======> Returning TCPChannel:Send w/ error '%+v'\", err))\n\t}\n\treturn err\n\n\t//// Wait for success notification from the GO routine\n\t//done := make(chan bool, 1)\n\t//// Push the message on to the channel (FIFO pipe)\n\t//obj.msgCh <- msg\n\t//\n\t//// TODO: Revisit later - for performance and optimization\n\t//// Execute sending each message content in another thread/go-routine\n\t////go obj.writeLoop(done)\n\t//// This is a common function called by both SendMessage (non-blocking) and SendRequest (blocking)\n\t//// Hence this should be handled called in another thread/go-routing in SendMessage ONLY\n\t//obj.writeLoop(done)\n\t//<-done\n\t//logger.Log(fmt.Sprintf(\"======> Exiting TCPChannel:Send w/ Message as '%+v'\", msg.String()))\n\t//return nil\n}", "title": "" }, { "docid": "6ecb15d9f69ffec5f55fea79151bcb3f", "score": "0.6139042", "text": "func (s *Socket) Send(data []byte, flag SendFlag) error {\n\tvar pdata unsafe.Pointer\n\tvar msg C.zmq_msg_t\n\tif len(data) == 0 {\n\t\tpdata = unsafe.Pointer(&data)\n\t} else {\n\t\tpdata = unsafe.Pointer(&data[0])\n\t}\n\n\tsizeData := C.size_t(len(data))\n\t// The slice is reused as an unsafe pointer to avoid copy\n\t// There might be a problem if go gc collect data slice\n\t// before the message is effectively send.\n\t// TODO try to use a leaky bucket to mitigate gc collect\n\t// and improve performances\n\tC.zmq_msg_init_data(&msg, pdata, sizeData, nil, nil)\n\tfor {\n\t\trc, err := C.zmq_msg_send(&msg, s.psocket, C.int(flag))\n\t\t// Retry send on an interrupted system call\n\t\tif rc == -1 && C.zmq_errno() == C.int(C.EINTR) {\n\t\t\tcontinue\n\t\t}\n\t\tif rc == -1 {\n\t\t\treturn err\n\t\t}\n\t\tbreak\n\t}\n\tC.zmq_msg_close(&msg)\n\treturn nil\n}", "title": "" }, { "docid": "5a2fb208d0e418123df9b94fc60b86a2", "score": "0.61329263", "text": "func (client *MMClient) pollSend() {\n\tfor {\n\n\t\t// Block until a new outbound message is received.\n\t\tmessage := client.connection.GetNextOutboundMessage()\n\n\t\t// Attempt to write the message to the websocket.\n\t\terr := client.connection.WriteMessage(message)\n\n\t\t// If the client is pending kill (most likely due to being terminated by another thread)\n\t\t// break out of the loop without doing anything.\n\t\tif client.isPendingKill() {\n\t\t\tbreak\n\t\t}\n\n\t\t// If the write function returned an error, remove this client from the server and\n\t\t// break out of the loop.\n\t\tif err != nil {\n\t\t\tclient.queue.Remove(client, protocol.WSCUnknownConnectionError, err.Error())\n\t\t\tbreak\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "a213e32c379cdf19b04e858b09c680d0", "score": "0.6122369", "text": "func (obj object) send(s string) error {\n\trspBuf := make(chan response, 1)\n\tdefer close(rspBuf)\n\tmsg := message{s, rspBuf, false}\n\tobj <- msg\n\t//fmt.Println(msg)\n\trsp := <-rspBuf\n\treturn rsp.err\n}", "title": "" }, { "docid": "1b8c1deed23657439197e406062b9fee", "score": "0.61217207", "text": "func (s *sender) Send(m raftpb.Message) error {\n\ts.mu.RLock()\n\tpause := s.paused\n\ts.mu.RUnlock()\n\tif pause {\n\t\treturn nil\n\t}\n\n\ts.maybeStopStream(m.Term)\n\tif shouldInitStream(m) && !s.hasStreamClient() {\n\t\ts.initStream(types.ID(m.From), types.ID(m.To), m.Term)\n\t\ts.batcher.Reset(time.Now())\n\t}\n\n\tvar err error\n\tswitch {\n\tcase isProposal(m):\n\t\ts.propBatcher.Batch(m)\n\tcase canBatch(m) && s.hasStreamClient():\n\t\tif !s.batcher.ShouldBatch(time.Now()) {\n\t\t\terr = s.send(m)\n\t\t}\n\tcase canUseStream(m):\n\t\tif ok := s.tryStream(m); !ok {\n\t\t\terr = s.send(m)\n\t\t}\n\tdefault:\n\t\terr = s.send(m)\n\t}\n\t// send out batched MsgProp if needed\n\t// TODO: it is triggered by all outcoming send now, and it needs\n\t// more clear solution. Either use separate goroutine to trigger it\n\t// or use streaming.\n\tif !s.propBatcher.IsEmpty() {\n\t\tt := time.Now()\n\t\tif !s.propBatcher.ShouldBatch(t) {\n\t\t\ts.send(s.propBatcher.Message)\n\t\t\ts.propBatcher.Reset(t)\n\t\t}\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0875fd64c1a49845f1754f6b0516c294", "score": "0.61214966", "text": "func (conn *Connection) Send(msg *iterm2.ClientOriginatedMessage) error {\n\tconn.closedLock.Lock()\n\tdefer conn.closedLock.Unlock()\n\n\tif conn.closed {\n\t\treturn ErrClosed\n\t}\n\n\tconn.outgoingMessages <- msg\n\treturn nil\n}", "title": "" }, { "docid": "71c1793efa0c0521436b68ac62e368bf", "score": "0.6119846", "text": "func (endpoint *ServiceBusEndpoint) Send(messageType string, destination string, msg interface{}, options ...OutgoingMutation) error {\n\tctx := endpoint.createMessageContext(messageType, msg, options)\n\tif ctx.IsCancelled {\n\t\treturn nil\n\t}\n\n\tcfg := endpoint.outgoingMessages[messageType]\n\tif cfg == nil || cfg.retryConfiguration == nil {\n\t\treturn endpoint.transport.Send(destination, ctx)\n\t}\n\n\terr := cfg.retryConfiguration.Execute(func() error { return endpoint.transport.Send(destination, ctx) })\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a5af533babe0ab65ae1d3672408bddb2", "score": "0.6113918", "text": "func (q *amqQueue) Send(content *string) (*string, *errors.Error) {\n\n\tvar err *errors.Error\n\tvar e error\n\tguid := uuid.NewV4()\n\n\te = backoff.Retry(func() error {\n\n\t\tif _, ok := q.conn.Load(WRITE); !ok {\n\t\t\terr = q.connect(WRITE)\n\t\t}\n\n\t\tif err == nil {\n\n\t\t\tobj, _ := q.conn.Load(WRITE)\n\t\t\tqueue := obj.(*stomp.Conn)\n\n\t\t\te = queue.Send(*q.destination, \"application/json\", []byte(*content), stomp.SendOpt.Receipt, stomp.SendOpt.Header(\"persistent\", \"true\"), stomp.SendOpt.Header(\"correlation-id\", guid.String()))\n\t\t\terr = errors.WrapInner(\"failed to listen to topic: retrying to open a connection\", e, 0)\n\n\t\t\tif err != nil {\n\t\t\t\tqueue.Disconnect()\n\t\t\t\tq.conn.Delete(WRITE)\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\treturn err\n\n\t}, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 3))\n\n\t//if any error, don't return the uuid\n\tif e != nil {\n\t\treturn nil, e.(*errors.Error)\n\t}\n\n\treturn aws.String(guid.String()), nil\n}", "title": "" }, { "docid": "eabf7d499440fc5eb85d294b08a5c07d", "score": "0.6107653", "text": "func (c *Conn) Send(msg interface{}) error {\n\tm := msgWrap{msg, make(chan error)}\n\tselect {\n\tcase c.msgCh <- &m:\n\tcase <-time.After(5 * time.Second):\n\t\treturn errors.New(\"sending message timedout\")\n\t}\n\tselect {\n\tcase err := <-m.retCh:\n\t\treturn err\n\tcase <-time.After(5 * time.Second):\n\t\treturn errors.New(\"receiving error code from message timedout\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "12e65b8cb3c8a939f863e32b8d8db2e6", "score": "0.6106646", "text": "func (bot *ircBot) SendRaw(msg string) {\n\tbot.sendQueue <- []byte(msg + \"\\n\")\n}", "title": "" } ]
93d671419ff28795d25b977089bfcc36
Validate validates s against the YANG schema corresponding to its type.
[ { "docid": "afb84eba817e08a45edecc7e73fad1f4", "score": "0.0", "text": "func (s *Bgp_PeerGroup_AfiSafi_ApplyPolicy) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Bgp_PeerGroup_AfiSafi_ApplyPolicy\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "365a921c2fc65e967f9b2216e79718ad", "score": "0.64573413", "text": "func validateString(schema *yang.Entry, value interface{}) error {\n\t// Check that the schema itself is valid.\n\tif err := validateStringSchema(schema); err != nil {\n\t\treturn err\n\t}\n\n\tvv := reflect.ValueOf(value)\n\n\t// Check that type of value is the type expected from the schema.\n\tif vv.Kind() != reflect.String {\n\t\treturn fmt.Errorf(\"non string type %T with value %v for schema %s\", value, value, schema.Name)\n\t}\n\n\t// This value could be a union typedef string, so convert it to make\n\t// sure it's the primitive string type.\n\tstringVal := vv.Convert(reflect.TypeOf(\"\")).Interface().(string)\n\n\tif err := ValidateStringRestrictions(schema.Type, stringVal); err != nil {\n\t\treturn fmt.Errorf(\"schema %q: %v\", schema.Name, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5f4134bfac0272bb118e52d814815384", "score": "0.6265214", "text": "func (validateParser *StringTypeValidateParser) Validate(v interface{}) bool {\n\tif s, ok := v.(string); ok {\n\t\treturn validateParser.stringRegexp.MatchString(s)\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1805f842a0f3488374ecd9d12fb9002b", "score": "0.62029785", "text": "func validateStringSchema(schema *yang.Entry) error {\n\tif schema == nil {\n\t\treturn fmt.Errorf(\"string schema is nil\")\n\t}\n\tif schema.Type == nil {\n\t\treturn fmt.Errorf(\"string schema %s Type is nil\", schema.Name)\n\t}\n\tif schema.Type.Kind != yang.Ystring {\n\t\treturn fmt.Errorf(\"string schema %s has wrong type %v\", schema.Name, schema.Type.Kind)\n\t}\n\n\tpatterns, isPOSIX := util.SanitizedPattern(schema.Type)\n\tfor _, p := range patterns {\n\t\tif _, err := reCache.compilePattern(p, isPOSIX); err != nil {\n\t\t\treturn fmt.Errorf(\"error generating regexp %s %v for schema %s\", p, err, schema.Name)\n\t\t}\n\t}\n\n\treturn validateLengthSchema(schema)\n}", "title": "" }, { "docid": "8e743b9d9671fef93e04061a2e51872e", "score": "0.59978765", "text": "func (s ServiceType) Validate() error {\n\t// Must have\n\tif _, ok := s[\"@context\"]; ok == false {\n\t\t//return false, fmt.Errorf(\"Must have @context\")\n\t\treturn fmt.Errorf(\"Must have @context\")\n\t}\n\t// Should have\n\tif _, ok := s[\"@id\"]; ok == false {\n\t\t//return false, fmt.Errorf(\"Should have @id\")\n\t\treturn fmt.Errorf(\"Should have @id\")\n\t}\n\t//return true\n\treturn nil\n}", "title": "" }, { "docid": "dedfe59905e93c6428be0c9f69827a1b", "score": "0.59261745", "text": "func (b *Schema) Validate(config proto.Message) error {\n\tif !isDNS1123Label(b.Type) {\n\t\treturn fmt.Errorf(\"invalid type: %q\", b.Type)\n\t}\n\tif !isDNS1123Label(b.Plural) {\n\t\treturn fmt.Errorf(\"invalid plural: %q\", b.Plural)\n\t}\n\tif proto.MessageType(b.MessageName) == nil {\n\t\treturn fmt.Errorf(\"cannot discover proto message type: %q\", b.MessageName)\n\t}\n\tif b.AdditionalValidate != nil {\n\t\treturn b.AdditionalValidate(config)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f22c394bb35a1a8bb3c6402e106ea8f4", "score": "0.58073276", "text": "func (s *String) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "e8e811f13987dba1bffb58fb3e7f3388", "score": "0.5750257", "text": "func (s *Server) validate(idlField Field, implType reflect.Type, path string) {\n\ttestVal := idlField.testVal(s.idl)\n\tconv := newConvert(s.idl, &idlField, implType, testVal, \"\")\n\t_, err := conv.run()\n\tif err != nil {\n\t\tmsg := fmt.Sprintf(\"barrister: %s has invalid type: %s reason: %s\", path, implType, err)\n\t\tpanic(msg)\n\t}\n}", "title": "" }, { "docid": "8756f036b911f8e0ba31d747368b0756", "score": "0.57207274", "text": "func validate(ts TypeSystem, t Type, node ipld.Node, pth string) []error {\n\tswitch t2 := t.(type) {\n\tcase TypeBool:\n\t\tif node.ReprKind() != ipld.ReprKind_Bool {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeString:\n\t\tif node.ReprKind() != ipld.ReprKind_String {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeBytes:\n\t\tif node.ReprKind() != ipld.ReprKind_Bytes {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeInt:\n\t\tif node.ReprKind() != ipld.ReprKind_Int {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeFloat:\n\t\tif node.ReprKind() != ipld.ReprKind_Float {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\treturn nil\n\tcase TypeMap:\n\t\tif node.ReprKind() != ipld.ReprKind_Map {\n\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t}\n\t\terrs := []error(nil)\n\t\tfor itr := node.MapIterator(); !itr.Done(); {\n\t\t\tk, v, err := itr.Next()\n\t\t\tif err != nil {\n\t\t\t\treturn []error{err}\n\t\t\t}\n\t\t\t// FUTURE: if KeyType is an enum rather than string, do membership check.\n\t\t\tks, _ := k.AsString()\n\t\t\tif v.IsNull() {\n\t\t\t\tif !t2.ValueIsNullable() {\n\t\t\t\t\terrs = append(errs, fmt.Errorf(\"Schema match failed: map at path %q contains unpermitted null in key %q\", pth, ks))\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\terrs = append(errs, validate(ts, t2.ValueType(), v, path.Join(pth, ks))...)\n\t\t\t}\n\t\t}\n\t\treturn errs\n\tcase TypeList:\n\tcase TypeLink:\n\t\t// TODO interesting case: would need resolver to keep checking.\n\tcase TypeUnion:\n\t\t// TODO *several* interesting errors\n\tcase TypeStruct:\n\t\tswitch t2.tupleStyle {\n\t\tcase false: // as map!\n\t\t\tif node.ReprKind() != ipld.ReprKind_Map {\n\t\t\t\treturn []error{fmt.Errorf(\"Schema match failed: expected type %q (which is kind %v) at path %q, but found kind %v\", t2.Name(), t.ReprKind(), pth, node.ReprKind())}\n\t\t\t}\n\t\t\t// TODO loop over em\n\t\t\t// TODO REVIEW order strictness questions?\n\t\tcase true: // as array!\n\n\t\t}\n\tcase TypeEnum:\n\t\t// TODO another interesting error\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "90880e34a5f7186467f32725a3d38333", "score": "0.56971747", "text": "func ValidateSchema(s []string) error {\n\tif len(s) != 2 {\n\t\treturn fmt.Errorf(\"Schema should contain two components, but has %d\", len(s))\n\t}\n\n\tif s[0] != \"tnx\" {\n\t\treturn fmt.Errorf(\"Schema should be 'tnx' but was '%s'\", s[0])\n\t}\n\n\tif s[1] != \"0\" {\n\t\treturn fmt.Errorf(\"Schema version '%s' is unsupported\", s[1])\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "06cc12b7b3066e0c505e42e78940624b", "score": "0.56946856", "text": "func (v *Value_Str) Check(schema *Schema) error {\n\tswitch s := schema.Schema.(type) {\n\tcase *Schema_Str:\n\t\tmaxLen := s.Str.MaxLength\n\t\tif maxLen > 0 && uint32(len(v.Str)) > maxLen {\n\t\t\treturn fmt.Errorf(\"value is too large: %d > %d\", len(v.Str), maxLen)\n\t\t}\n\n\tcase *Schema_Enum:\n\t\tif !s.Enum.Has(v.Str) {\n\t\t\treturn fmt.Errorf(\"value does not match enum: %q\", v.Str)\n\t\t}\n\n\tdefault:\n\t\tpanic(fmt.Errorf(\"for Value_Str: unknown schema %T\", s))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9ac4e0eeac352554a03ebbe6c195cfe5", "score": "0.5686421", "text": "func Validate(schema *yang.Entry, value interface{}) (errors Errors) {\n\t// Nil value means the field is unset.\n\tif isNil(value) {\n\t\treturn nil\n\t}\n\tif schema == nil {\n\t\treturn appendErr(errors, fmt.Errorf(\"nil schema for type %T, value %v\", value, value))\n\t}\n\tdbgPrint(\"Validate with value %v, type %T, schema name %s\", valueStr(value), value, schema.Name)\n\n\tswitch {\n\tcase schema.IsLeaf():\n\t\treturn validateLeaf(schema, value)\n\tcase schema.IsContainer():\n\t\tgsv, ok := value.(ygot.GoStruct)\n\t\tif !ok {\n\t\t\treturn appendErr(errors, fmt.Errorf(\"type %T is not a GoStruct for schema %s\", value, schema.Name))\n\t\t}\n\t\terrors = validateContainer(schema, gsv)\n\tcase schema.IsLeafList():\n\t\treturn validateLeafList(schema, value)\n\tcase schema.IsList():\n\t\treturn validateList(schema, value)\n\tcase schema.IsChoice():\n\t\treturn appendErr(errors, fmt.Errorf(\"cannot pass choice schema %s to Validate\", schema.Name))\n\tdefault:\n\t\terrors = appendErr(errors, fmt.Errorf(\"unknown schema type for type %T, value %v\", value, value))\n\t}\n\treturn errors\n}", "title": "" }, { "docid": "a69e89f529ee5eef0a12ebfae10790a2", "score": "0.5643674", "text": "func (tv *TypesValidator) Validate(v *ast.GenDecl, fset *token.FileSet) error { //nolint: gocyclo\n\ttv.identType = \"Type\"\n\n\tif !v.Lparen.IsValid() {\n\t\treturn errors.Wrap(errors.New(\"expected parenthesized declaration\"), fset.PositionFor(v.Pos(), false).String())\n\t}\n\n\tfor _, t := range v.Specs {\n\t\terrPrefix := fset.PositionFor(t.Pos(), false).String()\n\n\t\ts, ok := t.(*ast.TypeSpec)\n\t\tif !ok {\n\t\t\treturn errors.Wrap(errors.Errorf(\"invalid token %+v\", t), errPrefix)\n\t\t}\n\n\t\tif err := tv.validateExported(errPrefix, s.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tnext := tv.comments.Next()\n\t\tif next != -1 && fset.PositionFor(s.Pos(), false).Line > next {\n\t\t\ttv.last = \"\"\n\t\t}\n\n\t\tif err := tv.validateSortedName(errPrefix, s.Name); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ttv.comments.MoveTo(fset.PositionFor(s.End(), false).Line)\n\n\t\ttv.types = append(tv.types, s.Name.Name)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cf5d384a6b82760560e871f8a461b924", "score": "0.5636519", "text": "func (s *Mpls) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf5d384a6b82760560e871f8a461b924", "score": "0.5636519", "text": "func (s *Mpls) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cf5d384a6b82760560e871f8a461b924", "score": "0.5636519", "text": "func (s *Mpls) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cfcfda303ea6b13a6f97ee97c80a2108", "score": "0.5625779", "text": "func (s *Schema) Validate(raw json.RawMessage) (bool, error) {\n\treturn s.Validator.Validate(raw)\n}", "title": "" }, { "docid": "32e3cd99293ac04e4f6d78b9e0845c99", "score": "0.56159586", "text": "func (s StringFunc) Validate(val string) error {\n\treturn s(val)\n}", "title": "" }, { "docid": "bbda9e061d92597106f043121147fe8d", "score": "0.5589691", "text": "func (s *Schema) Validate(raw json.RawMessage) (bool, error) {\n\treturn s.validator.Validate(raw)\n}", "title": "" }, { "docid": "24330dcfd2b2a878b098bb66991d6e8a", "score": "0.5574218", "text": "func (s *Interface_Sonet) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Interface_Sonet\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24330dcfd2b2a878b098bb66991d6e8a", "score": "0.5571264", "text": "func (s *Interface_Sonet) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Interface_Sonet\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "24330dcfd2b2a878b098bb66991d6e8a", "score": "0.5571264", "text": "func (s *Interface_Sonet) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Interface_Sonet\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "da2475df5c43201b4852ba36beec2905", "score": "0.55654705", "text": "func (ut *TestPayload) Validate() (err error) {\n\tif ut.Sor != nil {\n\t\tif utf8.RuneCountInString(*ut.Sor) < 1 {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidLengthError(`type.sor`, *ut.Sor, utf8.RuneCountInString(*ut.Sor), 1, true))\n\t\t}\n\t}\n\tif ut.TestID != nil {\n\t\tif utf8.RuneCountInString(*ut.TestID) < 1 {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidLengthError(`type.testId`, *ut.TestID, utf8.RuneCountInString(*ut.TestID), 1, true))\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "dc16c9af099a35a5400246bf2bb620d5", "score": "0.55462205", "text": "func (s *Stp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc16c9af099a35a5400246bf2bb620d5", "score": "0.55450785", "text": "func (s *Stp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc16c9af099a35a5400246bf2bb620d5", "score": "0.55445457", "text": "func (s *Stp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "74a95c7294103dcef67dfc6757e5a5e9", "score": "0.55384713", "text": "func (st SetType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics {\n\tvar diags diag.Diagnostics\n\n\tif in.Type() == nil {\n\t\treturn diags\n\t}\n\n\tif !in.Type().Is(tftypes.Set{}) {\n\t\terr := fmt.Errorf(\"expected Set value, received %T with value: %v\", in, in)\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"Set Type Validation Error\",\n\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+err.Error(),\n\t\t)\n\t\treturn diags\n\t}\n\n\tif !in.IsKnown() || in.IsNull() {\n\t\treturn diags\n\t}\n\n\tvar elems []tftypes.Value\n\n\tif err := in.As(&elems); err != nil {\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"Set Type Validation Error\",\n\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+err.Error(),\n\t\t)\n\t\treturn diags\n\t}\n\n\tvalidatableType, isValidatable := st.ElementType().(xattr.TypeWithValidate)\n\n\t// Attempting to use map[tftypes.Value]struct{} for duplicate detection yields:\n\t// panic: runtime error: hash of unhashable type tftypes.primitive\n\t// Instead, use for loops.\n\tfor indexOuter, elemOuter := range elems {\n\t\t// Only evaluate fully known values for duplicates and validation.\n\t\tif !elemOuter.IsFullyKnown() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Validate the element first\n\t\tif isValidatable {\n\t\t\telemValue, err := st.ElementType().ValueFromTerraform(ctx, elemOuter)\n\t\t\tif err != nil {\n\t\t\t\tdiags.AddAttributeError(\n\t\t\t\t\tpath,\n\t\t\t\t\t\"Set Type Validation Error\",\n\t\t\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+err.Error(),\n\t\t\t\t)\n\t\t\t\treturn diags\n\t\t\t}\n\t\t\tdiags = append(diags, validatableType.Validate(ctx, elemOuter, path.AtSetValue(elemValue))...)\n\t\t}\n\n\t\t// Then check for duplicates\n\t\tfor indexInner := indexOuter + 1; indexInner < len(elems); indexInner++ {\n\t\t\telemInner := elems[indexInner]\n\n\t\t\tif !elemInner.Equal(elemOuter) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// TODO: Point at element attr.Value when Validate method is converted to attr.Value\n\t\t\t// Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/172\n\t\t\tdiags.AddAttributeError(\n\t\t\t\tpath,\n\t\t\t\t\"Duplicate Set Element\",\n\t\t\t\tfmt.Sprintf(\"This attribute contains duplicate values of: %s\", elemInner),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn diags\n}", "title": "" }, { "docid": "7fbcb86ef7db746fa0a9026c03a35d54", "score": "0.5528913", "text": "func ValidateStruct(s interface{}) map[string]string {\n\terrs := map[string]string{}\n\n\tv := reflect.ValueOf(s)\n\n\tfor i := 0; i < v.NumField(); i++ {\n\t\ttag := v.Type().Field(i).Tag.Get(\"valid\")\n\n\t\tif tag == \"\" || tag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\n\t\ttag = strings.Replace(tag, \" \", \"\", -1)\n\n\t\ttags := strings.Split(tag, \",\")\n\t\treq := false\n\t\tty := tags[0]\n\t\tit := 0\n\n\t\tif ty == \"req\" {\n\t\t\treq = true\n\t\t\tty = tags[1]\n\t\t\tit = 2\n\t\t} else {\n\t\t\tit = 1\n\t\t}\n\n\t\tvar err error\n\t\tswitch ty {\n\t\tcase \"alphaNum\":\n\t\t\tmin := 0\n\t\t\tmax := 0\n\t\t\tfmt.Sscanf(strings.Join(tags[it:], \",\"), \"min=%d,max=%d\", &min, &max)\n\t\t\terr = validateString(v.Field(i).Interface().(string), min, max, req, \"alphaNum\")\n\t\tcase \"alphaNumu\":\n\t\t\tmin := 0\n\t\t\tmax := 0\n\t\t\tfmt.Sscanf(strings.Join(tags[it:], \",\"), \"min=%d,max=%d\", &min, &max)\n\t\t\terr = validateString(v.Field(i).Interface().(string), min, max, req, \"alphaNumu\")\n\t\tcase \"email\":\n\t\t\terr = validateEmail(v.Field(i).Interface().(string), req)\n\t\tcase \"num\":\n\t\t\tmin := -1\n\t\t\tmax := -1\n\t\t\tfmt.Sscanf(strings.Join(tags[it:], \",\"), \"min=%d,max=%d\", &min, &max)\n\t\t\terr = validateNumber(v.Field(i).Interface().(int), min, max, req)\n\t\t}\n\n\t\tif err != nil {\n\t\t\tif tagJ := v.Type().Field(i).Tag.Get(\"json\"); tagJ != \"\" {\n\t\t\t\terrs[strings.Split(tagJ, \",\")[0]] = err.Error()\n\t\t\t} else {\n\t\t\t\terrs[v.Type().Field(i).Name] = err.Error()\n\t\t\t}\n\t\t}\n\t}\n\treturn errs\n}", "title": "" }, { "docid": "f8d473f7af2c8af2f8501068e108185d", "score": "0.5490476", "text": "func (s Space) Valid() (bool, error) { return govalidator.ValidateStruct(s) }", "title": "" }, { "docid": "c3ce13ed49253b625ca492eabb9d28bc", "score": "0.5464748", "text": "func (m *Schema) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for TypeUrl\n\n\tif v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {\n\t\tif err := v.Validate(); err != nil {\n\t\t\treturn SchemaValidationError{\n\t\t\t\tfield: \"Metadata\",\n\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\tcause: err,\n\t\t\t}\n\t\t}\n\t}\n\n\tfor idx, item := range m.GetFields() {\n\t\t_, _ = idx, item\n\n\t\tif v, ok := interface{}(item).(interface{ Validate() error }); ok {\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\treturn SchemaValidationError{\n\t\t\t\t\tfield: fmt.Sprintf(\"Fields[%v]\", idx),\n\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\tcause: err,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok {\n\t\tif err := v.Validate(); err != nil {\n\t\t\treturn SchemaValidationError{\n\t\t\t\tfield: \"Error\",\n\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\tcause: err,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5e9e151d60adeca647cc5cbfac653f1d", "score": "0.5447812", "text": "func ValidateStruct(s interface{}) bool {\n\tif s == nil {\n\t\treturn true\n\t}\n\tresult := true\n\tif reflect.ValueOf(s).Kind() == reflect.Interface || reflect.ValueOf(s).Kind() == reflect.Ptr {\n\t\tval := reflect.ValueOf(s).Elem()\n\n\t\tfor i := 0; i < val.NumField(); i++ {\n\t\t\tvalueField := val.Field(i)\n\t\t\ttypeField := val.Type().Field(i)\n\t\t\ttag := typeField.Tag.Get(\"regex\")\n\t\t\ttagStr := fmt.Sprint(tag)\n\t\t\tif len(tagStr) > 0 && valueField.Kind() == reflect.String {\n\t\t\t\tfield := fmt.Sprint(valueField)\n\t\t\t\tresult = result && Matches(field, tagStr)\n\t\t\t} else if valueField.Kind() == reflect.Struct || valueField.Kind() == reflect.Ptr {\n\t\t\t\tresult = result && ValidateStruct(valueField.Interface())\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "41603d67893d6c9611f3e586857915e6", "score": "0.5439803", "text": "func (s Struct) Validate(v interface{}) error {\n\n\tval := reflect.ValueOf(v)\n\n\tif val.Kind() == reflect.Ptr {\n\t\tval = val.Elem()\n\t}\n\n\tif val.Kind() != reflect.Struct {\n\t\treturn ValidationErr(\"struct.type\", \"not a struct\")\n\t}\n\n\terrs := fail.Map{}\n\n\tfor fieldname, validator := range s {\n\t\tfield := val.FieldByName(fieldname)\n\n\t\tif field.Kind() == reflect.Invalid {\n\t\t\terrs[fieldname] = ValidationErr(\"struct.field\", \"no such field\", fieldname)\n\t\t\tcontinue\n\t\t}\n\n\t\tif err := fail.OrNil(validator.Validate(field.Interface())); err != nil {\n\t\t\terrs[fieldname] = err\n\t\t}\n\t}\n\n\treturn fail.OrNil(errs)\n}", "title": "" }, { "docid": "fa7c740464315a6f084b36bde9ee4d29", "score": "0.54131246", "text": "func (s *Schema) Validate() []error {\n\terrs := make([]error, 0)\n\t// NOTE: Not sure how to validate some of these\n\t// s.Title\n\t// s.Description\n\t// s.MaxProperties\n\t// s.MinProperties\n\t// s.Required\n\t// s.AllOf\n\t// s.Properties\n\tif s.Properties != nil {\n\t\tfor _, t := range s.Properties {\n\t\t\terrs = append(errs, t.Validate()...)\n\t\t}\n\t}\n\t// Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it.\n\t// s.Discriminator\n\t// Relevant only for Schema \"properties\" definitions. Declares the property as \"read only\". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as readOnly being true SHOULD NOT be in the required list of the defined schema. Default value is false.\n\t// s.ReadOnly\n\t// This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.\n\tif s.Xml != nil {\n\t\terrs = append(errs, s.Xml.Validate()...)\n\t}\n\t// Additional external documentation for this schema.\n\tif s.ExternalDocs != nil {\n\t\terrs = append(errs, s.ExternalDocs.Validate()...)\n\t}\n\t// A free-form property to include a an example of an instance for this schema.\n\t// s.Example\n\n\t// Other fields\n\terrs = append(errs, s.ItemsDef.Validate()...)\n\n\treturn errs\n}", "title": "" }, { "docid": "bb3b5abd882e3ebb3c2e5096a86daaa3", "score": "0.5405394", "text": "func (c *CheckType) Validate() error {\n\tintervalCheck := c.IsScript() || c.HTTP != \"\" || c.TCP != \"\" || c.GRPC != \"\"\n\n\tif c.Interval > 0 && c.TTL > 0 {\n\t\treturn fmt.Errorf(\"Interval and TTL cannot both be specified\")\n\t}\n\tif intervalCheck && c.Interval <= 0 {\n\t\treturn fmt.Errorf(\"Interval must be > 0 for Script, HTTP, or TCP checks\")\n\t}\n\tif intervalCheck && c.IsAlias() {\n\t\treturn fmt.Errorf(\"Interval cannot be set for Alias checks\")\n\t}\n\tif c.IsAlias() && c.TTL > 0 {\n\t\treturn fmt.Errorf(\"TTL must be not be set for Alias checks\")\n\t}\n\tif !intervalCheck && !c.IsAlias() && c.TTL <= 0 {\n\t\treturn fmt.Errorf(\"TTL must be > 0 for TTL checks\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ac0d42729735f45e7904ab8fe7ac8f5f", "score": "0.54017955", "text": "func (m *BitString) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "3f553f861742a4480a08cb5196b9452a", "score": "0.5398511", "text": "func (m *BaseStream) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateResolution(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateSeriesType(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": "54f604b46d602acfe51f9833d3debdcc", "score": "0.5389504", "text": "func (m *SimpleTech) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateVerbatimType(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": "3fae3513479d275d21ccd856449408bc", "score": "0.53875345", "text": "func (d *Descriptor) ValidateSQLType() error {\n\tvar val reflect.Value\n\tif d.Ptr {\n\t\tval = reflect.New(d.Type)\n\t} else {\n\t\tval = reflect.Zero(d.Type)\n\t}\n\n\tvaluer := d.Valuer(val)\n\tsqlVal, err := valuer.Value()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif ok := driver.IsValue(sqlVal); !ok {\n\t\treturn fmt.Errorf(\"%T is not a valid SQL type\", sqlVal)\n\t}\n\n\t// We need to hold onto this pointer-pointer in order to make the value addressable.\n\tvar value, ptrptr reflect.Value\n\tif d.Ptr {\n\t\tptrptr = reflect.New(reflect.PtrTo(d.Type))\n\t\tvalue = ptrptr.Elem()\n\t} else {\n\t\tvalue = reflect.New(d.Type)\n\t}\n\n\tscanner := d.Scanner()\n\tscanner.Target(value)\n\treturn scanner.Scan(sqlVal)\n}", "title": "" }, { "docid": "4ad330f13807a122c41e55e7335e7e67", "score": "0.53760856", "text": "func (m SubscriptionType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateSubscriptionTypeEnum(\"\", \"body\", m); 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": "01fcfb5133bf622b37cfb2b5a489a07b", "score": "0.53631544", "text": "func (s *Mpls_Lsps) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_Lsps\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "01fcfb5133bf622b37cfb2b5a489a07b", "score": "0.53631544", "text": "func (s *Mpls_Lsps) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_Lsps\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "01fcfb5133bf622b37cfb2b5a489a07b", "score": "0.53606594", "text": "func (s *Mpls_Lsps) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_Lsps\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "06483a233bd56793b9baf6ea0b5be2bc", "score": "0.5357438", "text": "func (v ValidateString) Validate(i interface{}) bool {\n\treturn v(i.(string))\n}", "title": "" }, { "docid": "b8180c26268cd6200115f1e4fea9fdc8", "score": "0.53500175", "text": "func (s Service) Validate() error {\n\terr := s.Type.Validate()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif s.Status != \"\" {\n\t\tif err := s.Status.Validate(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif s.URL == \"\" {\n\t\treturn errInvalidField(\"url\")\n\t}\n\tif s.Path == \"\" {\n\t\treturn errInvalidField(\"path\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "01a1fa7ee16d9875cb868cecbceff82b", "score": "0.53436047", "text": "func Validate(ts TypeSystem, t Type, node ipld.Node) []error {\n\treturn validate(ts, t, node, \"/\")\n}", "title": "" }, { "docid": "c0fbe5a978b44764bf66635a63dba40d", "score": "0.5342724", "text": "func Validate(ctx context.Context, r io.Reader) ([]string, error) {\n\tb, err := ioutil.ReadAll(r)\n\tif err != nil {\n\t\treturn nil, skerr.Wrapf(err, \"failed to read bytes\")\n\t}\n\t_, err = Parse(bytes.NewReader(b))\n\tif err != nil {\n\t\treturn nil, skerr.Wrapf(err, \"failed to parse\")\n\t}\n\n\treturn jsonschema.Validate(ctx, b, schema)\n}", "title": "" }, { "docid": "83eee96d8ce1ae9e46a1cc036ba5927d", "score": "0.53408194", "text": "func (t *Interface_Sonet) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Interface_Sonet\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc19c97b786a011b5d2c69e595fbc1a9", "score": "0.5320843", "text": "func (r ExampleType) Validate() error {\n\t_, ok := defExampleTypeValueToName[r]\n\tif !ok {\n\t\treturn ErrExampleTypeInvalid\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8982fa57f6908e2fdb6e51af99231e19", "score": "0.53077894", "text": "func isValidDataType(s string) bool {\n\ts = strings.ToLower(s)\n\tif s == \"bool\" ||\n\t\ts == \"byte\" ||\n\t\ts == \"word\" ||\n\t\ts == \"dword\" ||\n\t\ts == \"lword\" ||\n\t\ts == \"sint\" ||\n\t\ts == \"usint\" ||\n\t\ts == \"int\" ||\n\t\ts == \"uint\" ||\n\t\ts == \"dint\" ||\n\t\ts == \"udint\" ||\n\t\ts == \"lint\" ||\n\t\ts == \"ulint\" ||\n\t\ts == \"real\" ||\n\t\ts == \"lreal\" ||\n\t\ts == \"time\" ||\n\t\ts == \"any\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "50ae805ab75358db5b13b9325477f738", "score": "0.530209", "text": "func (s *String) Schema(schema interface{}) *String {\n\tcheckSchema(&s.chain, s.value, schema)\n\treturn s\n}", "title": "" }, { "docid": "97424a9f9b423265dccc9dd8141845db", "score": "0.52940273", "text": "func (t TLSType) Validate(data map[string]string) error {\n\tvar violations []string\n\n\t// Server TLS is the default\n\t// TODO: CA-only, client only?\n\tfor _, field := range []string{FieldTLSCACert, FieldTLSServerKey, FieldTLSServerCert} {\n\t\tif _, ok := data[field]; !ok {\n\t\t\tviolations = append(violations, fmt.Sprintf(\"missing key: %s\", field))\n\t\t}\n\t}\n\n\t// We expect keys for mutual TLS\n\tif len(data) > 3 {\n\t\tfor _, field := range []string{FieldTLSClientKey, FieldTLSClientCert} {\n\t\t\tif _, ok := data[field]; !ok {\n\t\t\t\tviolations = append(violations, fmt.Sprintf(\"missing key: %s\", field))\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(violations) > 0 {\n\t\t// For backward compatibility reasons, return the first violation as message\n\t\treturn secret.NewValidationError(violations[0], violations)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "747a725624276d2dd9e54cbdb99c2cc3", "score": "0.5293474", "text": "func (s *Stp_Rstp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp_Rstp\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "747a725624276d2dd9e54cbdb99c2cc3", "score": "0.52898246", "text": "func (s *Stp_Rstp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp_Rstp\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "747a725624276d2dd9e54cbdb99c2cc3", "score": "0.52898246", "text": "func (s *Stp_Rstp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp_Rstp\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ce763ecacd2eaffd1b6682639dec021b", "score": "0.52704495", "text": "func (r *Record) Validate(typ Type) error {\n\t// validate A address\n\tif typ == A {\n\t\tip := net.ParseIP(r.Address)\n\t\tif ip == nil || ip.To4() == nil {\n\t\t\treturn errors.Errorf(\"invalid IPv4 address: %s\", r.Address)\n\t\t}\n\t}\n\n\t// validate AAAA address\n\tif typ == AAAA {\n\t\tip := net.ParseIP(r.Address)\n\t\tif ip == nil || ip.To16() == nil {\n\t\t\treturn errors.Errorf(\"invalid IPv6 address: %s\", r.Address)\n\t\t}\n\t}\n\n\t// validate CNAME and MX addresses\n\tif typ == CNAME || typ == MX {\n\t\tif !IsDomain(r.Address, true) {\n\t\t\treturn errors.Errorf(\"invalid domain name: %s\", r.Address)\n\t\t}\n\t}\n\n\t// check TXT data\n\tif typ == TXT {\n\t\tif len(r.Data) == 0 {\n\t\t\treturn errors.Errorf(\"missing data\")\n\t\t}\n\n\t\tfor _, data := range r.Data {\n\t\t\tif len(data) > 255 {\n\t\t\t\treturn errors.Errorf(\"data too long\")\n\t\t\t}\n\t\t}\n\t}\n\n\t// validate NS addresses\n\tif typ == NS {\n\t\tif !IsDomain(r.Address, true) {\n\t\t\treturn errors.Errorf(\"invalid ns name: %s\", r.Address)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f6268a28793f4c9192ac9b947bbadd65", "score": "0.5260056", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f6268a28793f4c9192ac9b947bbadd65", "score": "0.52598435", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f6268a28793f4c9192ac9b947bbadd65", "score": "0.52588326", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "930250b6c8055b0aa76dcc45851c4783", "score": "0.5255605", "text": "func (s *Stp_Interface) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp_Interface\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "930250b6c8055b0aa76dcc45851c4783", "score": "0.52534753", "text": "func (s *Stp_Interface) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp_Interface\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "930250b6c8055b0aa76dcc45851c4783", "score": "0.5253187", "text": "func (s *Stp_Interface) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp_Interface\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4af534a30c5fa2256a9f7568fb7d995b", "score": "0.5252401", "text": "func (m *StsResponse) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "6b135321fd63cb96c13894aee618ef4b", "score": "0.52398115", "text": "func (u *ConnString) Validate() error {\n\tp := parser{\n\t\tdnsResolver: dns.DefaultResolver,\n\t\tConnString: *u,\n\t}\n\treturn p.validate()\n}", "title": "" }, { "docid": "cb4250434b957994381ab84cd1dac41a", "score": "0.5238151", "text": "func Validate(s string, validators ...Validator) error {\n\tfor _, v := range validators {\n\t\tif err := v(s); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "32c7941b5985cfa4b2435579ddcdf864", "score": "0.52378064", "text": "func ValidateString(s string) error {\n\tv := Validator{}\n\treturn v.Validate([]byte(s))\n}", "title": "" }, { "docid": "29c86a1178b10852280b7de582943ecb", "score": "0.5235894", "text": "func validateLengthSchema(schema *yang.Entry) error {\n\tif len(schema.Type.Length) == 0 {\n\t\treturn nil\n\t}\n\tfor _, r := range schema.Type.Length {\n\t\t// This is a limited sanity check. It's assumed that a full check is\n\t\t// done in the goyang parser.\n\t\tminLen, maxLen := r.Min, r.Max\n\t\tif minLen.Kind != yang.MinNumber && minLen.Kind != yang.Positive {\n\t\t\treturn fmt.Errorf(\"length Min must be Positive or MinNumber: %v for schema %s\", minLen, schema.Name)\n\t\t}\n\t\tif maxLen.Kind != yang.MaxNumber && maxLen.Kind != yang.Positive {\n\t\t\treturn fmt.Errorf(\"length Max must be Positive or MaxNumber: %v for schema %s\", minLen, schema.Name)\n\t\t}\n\t\tif maxLen.Less(minLen) {\n\t\t\treturn fmt.Errorf(\"schema has bad length min[%v] > max[%v] for schema %s\", minLen, maxLen, schema.Name)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "429e6d158592ec9e54b64b78ac600d2b", "score": "0.5230235", "text": "func (m VerifiableAddressType) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "dc553ffda8c83663eb0693277e9c6ca7", "score": "0.5228595", "text": "func (t DataType) ValidateEvent(bs []byte) error {\n\tif bs == nil {\n\t\treturn nil\n\t}\n\tif t.ListDepth() > 0 {\n\t\treturn errors.InvalidStateError.Errorf(\"InvalidType(type=%s)\", t.String())\n\t}\n\tswitch t.Tag() {\n\tcase TInteger:\n\t\tif len(bs) == 0 {\n\t\t\treturn errors.IllegalArgumentError.New(\"InvalidIntegerBytes\")\n\t\t}\n\tcase TBool:\n\t\tif len(bs) != 1 {\n\t\t\treturn errors.IllegalArgumentError.Errorf(\"InvalidBoolBytes(bs=<%#x>)\", bs)\n\t\t}\n\t\tif bs[0] > 1 {\n\t\t\treturn errors.IllegalArgumentError.Errorf(\"InvalidBoolBytes(bs=<%#x>)\", bs)\n\t\t}\n\tcase TAddress:\n\t\tif _, err := common.NewAddress(bs); err != nil {\n\t\t\treturn errors.IllegalArgumentError.New(\"InvalidAddressBytes\")\n\t\t}\n\tcase TString:\n\t\tif !utf8.Valid(bs) {\n\t\t\treturn errors.IllegalArgumentError.New(\"InvalidUTF8Chars\")\n\t\t}\n\tcase TStruct:\n\t\treturn errors.InvalidStateError.Errorf(\"InvalidType(type=%s)\", t.String())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c7c29931154ba21ca8e8a0afbb06ce43", "score": "0.522666", "text": "func (v Validator) Validate(s interface{}) (result *Result) {\n\tif v, ok := s.(Cleaner); ok {\n\t\tv.Clean()\n\t}\n\treturn v.validatePrefixed(s, \"\")\n}", "title": "" }, { "docid": "a4dfa7a815bceef0071d9f67beafdd3c", "score": "0.5222079", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_SummaryLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_SummaryLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4dfa7a815bceef0071d9f67beafdd3c", "score": "0.5222079", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_SummaryLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_SummaryLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a4dfa7a815bceef0071d9f67beafdd3c", "score": "0.5220002", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_SummaryLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_SummaryLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25b6eed9e4891b58a3d16ac335d8da51", "score": "0.5215708", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_NssaExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_NssaExternalLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25b6eed9e4891b58a3d16ac335d8da51", "score": "0.52149487", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_NssaExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_NssaExternalLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "25b6eed9e4891b58a3d16ac335d8da51", "score": "0.52149487", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_NssaExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_NssaExternalLsa_TypeOfService\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cce53c8f44461d852d6cdf2935b36d97", "score": "0.52090573", "text": "func (m *APIRuleTypeV1) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateChannel(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDispositionMap(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateFields(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateID(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateLongDesc(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.validatePlatform(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateReleased(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": "9b313574fecd44aa44cc63098b4a6f5b", "score": "0.5204092", "text": "func ValidSTIXObjectType(t string) bool {\n\tvalid := false\n\n\tswitch t {\n\tcase \"attack-pattern\":\n\t\tvalid = true\n\tcase \"campaign\":\n\t\tvalid = true\n\tcase \"course-of-action\":\n\t\tvalid = true\n\tcase \"identity\":\n\t\tvalid = true\n\tcase \"indicator\":\n\t\tvalid = true\n\tcase \"intrusion-set\":\n\t\tvalid = true\n\tcase \"location\":\n\t\tvalid = true\n\tcase \"malware\":\n\t\tvalid = true\n\tcase \"marking-definition\":\n\t\tvalid = true\n\tcase \"note\":\n\t\tvalid = true\n\tcase \"observed-data\":\n\t\tvalid = true\n\tcase \"opinion\":\n\t\tvalid = true\n\tcase \"relationship\":\n\t\tvalid = true\n\tcase \"report\":\n\t\tvalid = true\n\tcase \"sighting\":\n\t\tvalid = true\n\tcase \"threat-actor\":\n\t\tvalid = true\n\tcase \"tool\":\n\t\tvalid = true\n\tcase \"vulnerability\":\n\t\tvalid = true\n\t}\n\treturn valid\n}", "title": "" }, { "docid": "4ce70e70eaeeffb839977f3731abfb3c", "score": "0.52023554", "text": "func Validate(src interface{}) error {\n\treturn validate.Struct(src)\n}", "title": "" }, { "docid": "db071c7b1f487672c2623f4b9456bea8", "score": "0.51976013", "text": "func (t *Stp) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Stp\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ccd39cab45f30f2b4f1a5deb1dcef6c8", "score": "0.5191101", "text": "func TypeString(message string) *Rule {\n\treturn NewRule(func(field string, value *gjson.Result, parent *gjson.Result, source *gjson.Result, violations *Violations, validator *Validator) {\n\t\tif IsEmpty(value) || IsString(value) {\n\t\t\treturn\n\t\t}\n\n\t\tviolations.Add(field, message)\n\t})\n}", "title": "" }, { "docid": "9e5d8752fe01b2726be91f6b79eb3ba0", "score": "0.5186793", "text": "func (s *AnySchema) Validate(value interface{}) error {\n\t// Validate PRE Transform\n\tif err := s.runTransform(TransformStagePRE, &value); err != nil {\n\t\treturn err\n\t}\n\t// Validate Forbidden\n\tif IsSet(s.forbidden) && *s.forbidden == true && value != nil {\n\t\treturn ErrAnyForbidden\n\t}\n\t// Validate Required\n\tif IsSet(s.required) && *s.required == true && value == nil {\n\t\treturn ErrAnyRequired\n\t}\n\t// Validate Zero\n\tif IsSet(s.zero) && *s.zero == true {\n\t\tif value != nil {\n\t\t\tif v := reflect.Zero(reflect.TypeOf(value)).Interface(); v != value {\n\t\t\t\treturn ErrAnyZero\n\t\t\t}\n\t\t}\n\t}\n\t// Validate NonZero\n\tif IsSet(s.nonzero) && *s.nonzero == true {\n\t\tif v := reflect.Zero(reflect.TypeOf(value)).Interface(); v == value {\n\t\t\treturn ErrAnyNonZero\n\t\t}\n\t}\n\t// Validate Allow\n\tif IsSet(s.allow) {\n\t\tmatch := false\n\t\tfor _, a := range *s.allow {\n\t\t\tif value == a {\n\t\t\t\tmatch = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !match {\n\t\t\treturn ErrAnyAllow\n\t\t}\n\t}\n\t// Validate Disallow\n\tif IsSet(s.disallow) {\n\t\tfor _, a := range *s.disallow {\n\t\t\tif value == a {\n\t\t\t\treturn ErrAnyDisallow\n\t\t\t}\n\t\t}\n\t}\n\t// Validate POST Transform\n\tif err := s.runTransform(TransformStagePOST, &value); err != nil {\n\t\treturn err\n\t}\n\n\t// All ok\n\treturn nil\n}", "title": "" }, { "docid": "65395d226a8e5a6da4f0b8096c569921", "score": "0.5177291", "text": "func (t StreamConfig) Validate(v ...StructValidator) (valid bool, errors []string) {\n\tif len(v) == 0 || v[0] == nil {\n\t\treturn true, nil\n\t}\n\n\treturn v[0].ValidateStruct(t, t.SchemaType())\n}", "title": "" }, { "docid": "d8c8d9581bc633fafc3ccbccd12dae86", "score": "0.51683605", "text": "func Validate(src []byte) error {\n\tdata, err := yaml.YAMLToJSON(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdocumentLoader := gojsonschema.NewBytesLoader(data)\n\tres, err := Schema.Validate(documentLoader)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !res.Valid() {\n\t\terrs := res.Errors()\n\t\terrMsg := errs[0].String()\n\t\tfor i := 1; i < len(errs); i++ {\n\t\t\terrMsg = fmt.Sprintf(\"%s;%s\", errMsg, errs[i].String())\n\t\t}\n\t\treturn errors.New(errMsg)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "771c0d4be331e07671a5735bebd4344a", "score": "0.51679224", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "771c0d4be331e07671a5735bebd4344a", "score": "0.51679224", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "771c0d4be331e07671a5735bebd4344a", "score": "0.5164904", "text": "func (s *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4044c17b393ba7c746013d20f64379b6", "score": "0.51615083", "text": "func (s Std) Validate(params ...interface{}) *er.Error {\n\treturn nil\n}", "title": "" }, { "docid": "74654916de1790299307324d59ae1a32", "score": "0.5160167", "text": "func (typedData *TypedData) validate() error {\n\tif err := typedData.Types.validate(); err != nil {\n\t\treturn err\n\t}\n\tif err := typedData.Domain.validate(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96a10f2a083a3562e96def0f312e1042", "score": "0.5158346", "text": "func (s *Mpls_Interface) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_Interface\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96a10f2a083a3562e96def0f312e1042", "score": "0.5158346", "text": "func (s *Mpls_Interface) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_Interface\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96a10f2a083a3562e96def0f312e1042", "score": "0.5158346", "text": "func (s *Mpls_Interface) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_Interface\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44a3d8878805a57f9dc18d3c014e31b0", "score": "0.5156797", "text": "func (s Subject) Validate(vr *ValidationResults) {\n\tv := string(s)\n\tif v == \"\" {\n\t\tvr.AddError(\"subject cannot be empty\")\n\t}\n\tif strings.Contains(v, \" \") {\n\t\tvr.AddError(\"subject %q cannot have spaces\", v)\n\t}\n}", "title": "" }, { "docid": "4d8f9a8ece9d9b9fb4b05a158d747df0", "score": "0.515609", "text": "func (s Tag) Valid() (bool, error) { return govalidator.ValidateStruct(s) }", "title": "" }, { "docid": "89dbbbf866a6a79f4c75f275d648cff0", "score": "0.51549935", "text": "func Struct(s interface{}) error {\n\n\treturn validate.Struct(s)\n}", "title": "" }, { "docid": "21cff7876ea49cd1f28f47ca7b6415e0", "score": "0.51479226", "text": "func (m *StringField) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for Placeholder\n\n\t// no validation rules for DefaultValue\n\n\treturn nil\n}", "title": "" }, { "docid": "6690717e5c98d649ba8c2d04a8957de7", "score": "0.51400197", "text": "func (t *NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Protocol_Ospfv2_Area_Lsdb_LsaType_Lsa_AsExternalLsa_TypeOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "19693c344f39cdb34eebea4bd9e6bcff", "score": "0.5122027", "text": "func (m *Message) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif l := utf8.RuneCountInString(m.GetTypeName()); l < 1 || l > 256 {\n\t\treturn MessageValidationError{\n\t\t\tfield: \"TypeName\",\n\t\t\treason: \"value length must be between 1 and 256 runes, inclusive\",\n\t\t}\n\t}\n\n\tif len(m.GetRawValue()) > 262144 {\n\t\treturn MessageValidationError{\n\t\t\tfield: \"RawValue\",\n\t\t\treason: \"value length must be at most 262144 bytes\",\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "48b724dca4e8a04a1e6d047d4d4c2e4c", "score": "0.5119093", "text": "func ValidateString(input string) (bool, error) {\n\t_, err := time.ParseDuration(input)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "c658c64494267ecbc303e9abc0e03953", "score": "0.51189923", "text": "func (m DiffType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateDiffTypeEnum(\"\", \"body\", m); 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": "3e23892db654deacb24681c5b026a5c8", "score": "0.5115785", "text": "func ValidateString(val interface{}) bool {\n\tvalStr := val.(string)\n\tif len(valStr) < 0 || len(valStr) > 255 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "ab872cad717da0690f55ec38e99360da", "score": "0.5113192", "text": "func (s *Star) Validate(tx *pop.Connection) (*validate.Errors, error) {\n\treturn validate.Validate(\n\t\t&validators.StringIsPresent{Field: s.Name, Name: \"Name\"},\n\t), nil\n}", "title": "" }, { "docid": "27449ab094788c22a4f13e2fc1974424", "score": "0.5109925", "text": "func (s *Mpls_SignalingProtocols) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"Mpls_SignalingProtocols\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" } ]
cd039bb534bc5e4d0730f8cccfdf6f1a
RemoveAt Removes the element at the specified position in this list
[ { "docid": "e00b19075f1920b7d9977cd33bc4b892", "score": "0.68318087", "text": "func (list *ArrayList[T]) RemoveAt(index int) (T, bool) {\n\tif index < 0 || index >= list.Size() {\n\t\tvar zero T\n\t\treturn zero, false\n\t}\n\tele := list.elems[index]\n\tlist.elems = append(list.elems[:index], list.elems[index+1:]...)\n\treturn ele, true\n}", "title": "" } ]
[ { "docid": "a01d60405a031aeb46b930ba3d6dd9f0", "score": "0.70164573", "text": "func (lst *List) RemoveAt(idx int) (ret Val_t){\n\tif lst.Len < 1{\n\t\tpanic(\"no item to pop\")\n\t}\n\tcur := lst.GetAt(idx)\n\tret = cur.Val\n\tif(idx == 0){\n\t\treturn lst.PopFront()\n\t}else if idx == lst.Len-1{\n\t\treturn lst.PopBack()\n\t}else{\n\t\tpre,next := lst.GetAt(idx-1),lst.GetAt(idx+1)\n\t\tpre.Next = next\n\t\tlst.Len--\n\t}\n\treturn\n}", "title": "" }, { "docid": "0076d76678689614919ed370acf7e94b", "score": "0.6882886", "text": "func (list *ArrayList) Remove(index int) {\n\tif !list.boundCheck(index) {\n\t\treturn\n\t}\n\n\tlist.elements[index] = nil\n\tcopy(list.elements[index:], list.elements[index+1:list.size])\n\tlist.size -= 1\n\t//shirnk if necessary\n\tlist.shrink()\n}", "title": "" }, { "docid": "3eab0399d8a3f7ff967c2026096145a0", "score": "0.6796885", "text": "func (this *LinkedList) RemoveAt(index int) interface{} {\n\tif index < 0 || index >= this.Size() {\n\t\tpanic(\"index out of bound\")\n\t}\n\tpe := this.head\n\tvar ps *entry\n\tvar ele interface{}\n\tps = nil\n\tfor i := 0; i < index; i++ {\n\t\tps = pe\n\t\tpe = pe.next\n\t}\n\tif ps != nil {\n\t\tele = pe.elem\n\t\tps.next = pe.next\n\t\tif pe == this.tail {\n\t\t\t// remove the last element\n\t\t\tthis.tail = ps\n\t\t}\n\t} else {\n\t\t// remove the first element\n\t\tele = pe.elem\n\t\tthis.head = this.head.next\n\t\t// if remove the only one element, tail must be change to nil\n\t\tif this.tail == pe {\n\t\t\tthis.tail = nil\n\t\t}\n\t}\n\tthis.size--\n\treturn ele\n}", "title": "" }, { "docid": "199ac16b0fd9f4ba2fb4953d9ab69329", "score": "0.673156", "text": "func (l *List) Remove(index int) error {\n\t// Does it make sense to make index as uint? On the other hand it's inconvenient to use uint everywhere\n\tif index < 0 || index > l.Len-1 {\n\t\treturn errors.New(\"index is put of range\")\n\t}\n\titem := l.First\n\tfor i := 0; i <= index; i++ {\n\t\tif i != index {\n\t\t\titem = item.Next\n\t\t\tcontinue\n\t\t}\n\t\tif i == 0 {\n\t\t\t// Set element as first and update the reference to the first element\n\t\t\tl.First = l.First.Next\n\t\t\t// check if element exists in case, when on previous step it was the last one\n\t\t\tif l.First != nil {\n\t\t\t\tl.First.Prev = nil\n\t\t\t}\n\t\t}\n\t\tif i == l.Len-1 {\n\t\t\t// Set element as last and update the reference to the last element\n\t\t\tl.Last = l.Last.Prev\n\t\t\t// check if element exists in case, when on previous step it was the first one\n\t\t\tif l.Last != nil {\n\t\t\t\tl.Last.Next = nil\n\t\t\t}\n\t\t}\n\t\tif i > 0 && i < l.Len-1 {\n\t\t\t// As far as I understood, item should be removed by GC from the memory, right?\n\t\t\titem.Prev = item.Next\n\t\t}\n\t\tl.Len--\n\t\treturn nil\n\t}\n\t// actually, impossible case\n\treturn errors.New(\"element with provided index was not found\")\n}", "title": "" }, { "docid": "42b7048b39954da716b6f0c66258cd4e", "score": "0.6730868", "text": "func (list *MyArrayList) removeAtIndex(idx int) (int, error) {\n\tif idx >= list.currSize {\n\t\treturn 0, errors.New(\"index out of bounds\")\n\t}\n\toldVal := list.array[idx]\n\tfor i := idx; i< (list.currSize -1); i++ {\n\t\tlist.array[i] = list.array[i+1]\n\t}\n\tlist.currSize--\n\treturn oldVal, nil\n}", "title": "" }, { "docid": "37bf88818badec4fdbb07ee7bfa04326", "score": "0.66784567", "text": "func (s *items) removeAt(index int) Item {\n\titem := (*s)[index]\n\tcopy((*s)[index:], (*s)[index+1:])\n\t(*s)[len(*s)-1] = nil\n\t*s = (*s)[:len(*s)-1]\n\treturn item\n}", "title": "" }, { "docid": "8090678f920ae216a017565e8e35b79f", "score": "0.66772276", "text": "func (list *List) Remove(index int) {\n\n\tif !list.withinRange(index) {\n\t\treturn\n\t}\n\n\tif list.size == 1 {\n\t\tlist.Clear()\n\t\treturn\n\t}\n\n\tvar beforeElement *element\n\telement := list.first\n\tfor e := 0; e != index; e, element = e+1, element.next {\n\t\tbeforeElement = element\n\t}\n\n\tif element == list.first {\n\t\tlist.first = element.next\n\t}\n\tif element == list.last {\n\t\tlist.last = beforeElement\n\t}\n\tif beforeElement != nil {\n\t\tbeforeElement.next = element.next\n\t}\n\n\telement = nil\n\n\tlist.size--\n}", "title": "" }, { "docid": "fef2f0e5d17f00dc1fe3108fd364c56c", "score": "0.655112", "text": "func (list *List) removeByIndex(idx int) error {\n\tlist_ := []interface{}(*list)\n\t*list = append(list_[:idx], list_[idx+1:]...)\n\treturn nil\n}", "title": "" }, { "docid": "42139a228b8809a0125262060a6ef6c3", "score": "0.64175934", "text": "func (l *List) Remove(index int) {\n\tif l.len == 0 {\n\t\tfmt.Println(\"list is empty\")\n\t\treturn\n\t}\n\tif !(index >= 0 && index < l.len) {\n\t\treturn\n\t}\n\tvar item *Item\n\n\titem = l.head\n\tfor i := 0; i != index; i, item = i+1, item.Next() {\n\t}\n\t\n\tif l.head == item {\n\t\tl.head = item.Next()\n\t}\n\tif l.tail == item {\n\t\tl.tail = item.Prev()\n\t}\n\tif item.prev != nil {\n\t\titem.prev.next = item.Next()\n\t}\n\tif item.next != nil {\n\t\titem.next.prev = item.Prev()\n\t}\n\t\n\tl.len--\n}", "title": "" }, { "docid": "fd136cd7f36445d7b677ba2b72d7c199", "score": "0.63905096", "text": "func (s *ConcurrentSlice) Remove(e int64) {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\ti := s.index(e)\n\ts.items = append(s.items[0:i], s.items[i+1:]...)\n}", "title": "" }, { "docid": "c94970e2f0c5e9c5558490803dbfe773", "score": "0.634056", "text": "func (a *List) DelItem(i int) {\n\ta.Items = append(a.Items[:i], a.Items[i+1:]...)\n}", "title": "" }, { "docid": "e275a4b8bd9efb66264eadc767a6e615", "score": "0.629888", "text": "func (p *Proposal) Remove(idx int) {\n\tif !p.checkIndex(idx) {\n\t\treturn\n\t}\n\tdelete(p.nullifiers, idx)\n}", "title": "" }, { "docid": "ccf99b39baf6e9d66614664395c5e9ab", "score": "0.6264933", "text": "func (list *ArrayList) RemoveWithIndex(index int) error {\n\tif !list.withinRange(index) {\n\t\treturn errors.New(\"out of range\")\n\t} else {\n\t\tlist.elements = append(list.elements[:index], list.elements[index+1:]...)\n\t\tlist.size = list.size - 1\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "d8f8f61f4c63857f4b130fe05fa55a03", "score": "0.61792666", "text": "func (al *ArrayList) RemoveItemAtIndex(index int) error {\n\tif index >= al.Size() {\n\t\treturn errors.New(\"Cannot remove item at index \" + string(index) + \". Index is out of bounds!\")\n\t}\n\tal.slice = append(al.slice[:index], al.slice[index+1:]...)\n\treturn nil\n}", "title": "" }, { "docid": "beeeac937c4e0136506884bbc5be6d00", "score": "0.61672413", "text": "func (o *KeyValueOrdered) RemoveIndex(idx int) (cell KeyValueCapsule) {\n\tcell = o.s[idx]\n\tdelete(o.m, o.s[idx].K)\n\to.shift(idx+1, len(o.s), -1)\n\to.s = append(o.s[:idx], o.s[idx+1:]...)\n\treturn\n}", "title": "" }, { "docid": "a37de98eb936674c60706f0fe59d9e6a", "score": "0.614888", "text": "func (li *List) RemoveAt(pos int) IPanel {\n\n\t// Remove the list item from the internal scroller\n\tpan := li.ItemScroller.RemoveAt(pos)\n\tlitem := pan.(*ListItem)\n\n\t// Remove item from the list item children and disposes of the list item panel\n\titem := litem.item\n\tlitem.Remove(item)\n\tlitem.Dispose()\n\treturn item\n}", "title": "" }, { "docid": "6ac9775c932c7820e6ada58ca46d89b3", "score": "0.60772264", "text": "func (al *ArrayList) RemoveItem(value interface{}) {\n\tfor i := 0; i < al.Size(); i++ {\n\t\tif al.slice[i] == value {\n\t\t\tal.RemoveItemAtIndex(i)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a925962be3da3d77ee78e7824c4e8b40", "score": "0.6067022", "text": "func (list *List) Remove(e Entity) {\n\tdelete(list.m, e.Index())\n}", "title": "" }, { "docid": "368337fa6c7f38f61a3cfd9c74054846", "score": "0.60065985", "text": "func (l *List) Remove(i Item) error {\r\n\tif i.parent != l {\r\n\t\treturn errors.New(\"Item must belong to list, which method is called\")\r\n\t}\r\n\tif *i.invalidated {\r\n\t\treturn errors.New(\"Item was deleted, therefore invalidated\")\r\n\t}\r\n\tif i.prev != nil && i.next != nil {\r\n\t\ti.prev.next = i.next\r\n\t\ti.next.prev = i.prev\r\n\t} else if i.prev == nil && i.next != nil {\r\n\t\ti.next.prev = nil\r\n\t\tl.first = i.next\r\n\r\n\t} else if i.next == nil && i.prev != nil {\r\n\t\ti.prev.next = nil\r\n\t\tl.last = i.prev\r\n\t} else {\r\n\t\tl.first = nil\r\n\t\tl.last = nil\r\n\t}\r\n\r\n\t*i.invalidated = true\r\n\tl.length--\r\n\treturn nil\r\n}", "title": "" }, { "docid": "3b5171dc7a43b67c3ca7423efee510e7", "score": "0.6003958", "text": "func (list *List) Remove(element interface{}) error {\n\tidx := list.Index(element)\n\tif idx == -1 {\n\t\treturn fmt.Errorf(\"element not found\")\n\t}\n\treturn list.removeByIndex(idx)\n}", "title": "" }, { "docid": "7744db3871addc9cc376aaf85edc4b1a", "score": "0.5981182", "text": "func (l *LinkedList) remove(index int) {\n\tprev := l.head\n\tif index > 0 {\n\t\tprev = l.get(index - 1)\n\t}\n\n\tcurrent := prev.next\n\tnext := current.next\n\n\tprev.next = next\n\tcurrent.next = nil\n\tl.length -= 1\n}", "title": "" }, { "docid": "8394b6f9574a96dc4edf3d0f1f522af7", "score": "0.5961246", "text": "func (l SList) Remove(prev int64, free func(off int64) error) error {\n\tif free != nil {\n\t\tif err := free(l.DataOff()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif prev != 0 {\n\t\tnext, err := l.Next()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tp, err := l.OpenSList(prev)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := p.setNext(next); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn l.Free(l.Off)\n}", "title": "" }, { "docid": "1969bc0cf4a107e2be6b69bf83fef79b", "score": "0.5960955", "text": "func (self *Chromosome) Remove(i int) error {\n\t//if the index is in bounds\n\tif i < len(self.Locations) {\n\t\t//remove the specified element\n\t\tself.Locations = append(self.Locations[:i], self.Locations[i+1:]...)\n\t\treturn nil\n\t}\n\treturn errors.New(\"Index ouf of bounds.\")\n}", "title": "" }, { "docid": "4bad54713b80ce1d2459b9691bc277ef", "score": "0.5950636", "text": "func (m *clistModel) Remove(t *rapid.T) {\n\tif len(m.model) == 0 {\n\t\treturn\n\t}\n\tix := rapid.IntRange(0, len(m.model)-1).Draw(t, \"index\").(int)\n\tvalue := m.model[ix]\n\tm.model = append(m.model[:ix], m.model[ix+1:]...)\n\tm.clist.Remove(value)\n}", "title": "" }, { "docid": "2d79aad58e1a1ed70b5a323bb77e2c45", "score": "0.59137905", "text": "func (sset *SSet) Remove(value interface{}) {\n\tkey := sset.f(value)\n\tif index, found := sset.m_index[key]; found {\n\t\tsset.list.Remove(index)\n\t\tsset.m.Remove(key)\n\t\tdelete(sset.m_index, key)\n\t\tsset.fixIndex()\n\t}\n}", "title": "" }, { "docid": "cb46db3bf6ec8a47e4bf6b7401c94382", "score": "0.59003353", "text": "func (s *ItemScroller) RemoveAt(pos int) IPanel {\n\n\t// Validates position\n\tif pos < 0 || pos >= len(s.items) {\n\t\tpanic(\"ItemScroller.RemoveAt(): Invalid position\")\n\t}\n\n\t// Remove event listener\n\titem := s.items[pos]\n\n\t// Remove item from the items array\n\tcopy(s.items[pos:], s.items[pos+1:])\n\ts.items[len(s.items)-1] = nil\n\ts.items = s.items[:len(s.items)-1]\n\n\t// Remove item from the scroller children\n\ts.Panel.Remove(item)\n\ts.autoSize()\n\ts.recalc()\n\treturn item\n}", "title": "" }, { "docid": "08f26548617462d314e3d14669a1e4f5", "score": "0.58846074", "text": "func (v *IntVec) Remove(idx int) (val int) {\n\tvar nil int\n\n\tdv := *v\n\n\tval = dv[idx]\n\t*v = append(dv[:idx], dv[1+idx:]...)\n\n\tdv[len(dv)-1] = nil\n\n\treturn val\n}", "title": "" }, { "docid": "897118039b6e08413dcc5e3af5326f19", "score": "0.585331", "text": "func Remove[T any](h Interface[T], i int) T {\n\tn := h.Len() - 1\n\tif n != i {\n\t\th.Swap(i, n)\n\t\tif !down(h, i, n) {\n\t\t\tup(h, i)\n\t\t}\n\t}\n\treturn h.Pop()\n}", "title": "" }, { "docid": "5308c60649faacdb60b962c326652539", "score": "0.5849591", "text": "func (set *IntSet) Remove(i int) {\n\tdelete(set.members, i)\n}", "title": "" }, { "docid": "8280ca0e88f93fb8da0e5ec7b1312b8c", "score": "0.58308816", "text": "func (jz *Jzon) Remove(i int) (err error) {\n\tif jz.Type != JzTypeArr {\n\t\treturn expectTypeOf(JzTypeArr, jz.Type)\n\t}\n\n\tif i > len(jz.data.([]*Jzon)) || i < 0 {\n\t\treturn errors.New(\"index is out of bounds\")\n\t}\n\n\tnewArr := jz.data.([]*Jzon)[0:i]\n\n\tfor _, v := range jz.data.([]*Jzon)[i:] {\n\t\tnewArr = append(newArr, v)\n\t}\n\n\tjz.data = newArr\n\n\treturn nil\n}", "title": "" }, { "docid": "e4f9d43a44e33a925bc10e8b53867a34", "score": "0.5818115", "text": "func (s *IntSet) Remove(i int) {\n\tdelete(s.members, i)\n}", "title": "" }, { "docid": "f4754d1844d9e20a55faa3708944ce58", "score": "0.5812156", "text": "func (l *SkippedSequenceList) Remove(x uint64) error {\n\tl.lock.Lock()\n\terr := l._remove(x)\n\tl.lock.Unlock()\n\treturn err\n}", "title": "" }, { "docid": "0804805e0121a4cad63c24f326a48dfd", "score": "0.57909906", "text": "func (b *Bag) DeleteAt(index int) {\n\tb.items[index] = b.items[len(b.items)-1]\n\tb.items = b.items[:len(b.items)-1]\n}", "title": "" }, { "docid": "0f79716f210dbd1c89a041a99e715754", "score": "0.57746124", "text": "func (l *LinkedList) Remove(index int) (*LLNode, error) {\n\tswitch {\n\tcase index > l.Size-1:\n\t\treturn nil, fmt.Errorf(\"Index %d out of range\", index)\n\n\tcase index == 0:\n\t\treturn l.Shift(), nil\n\n\tcase index == l.Size-1:\n\t\treturn l.Pop(), nil\n\n\tdefault:\n\t\tvar removedNode *LLNode\n\t\tcurrentNode, NextNode := l.Head, l.Head.Next\n\t\tfor i := 0; i < l.Size-1; i++ {\n\t\t\tif i+1 == index {\n\t\t\t\tremovedNode = NextNode\n\t\t\t\tcurrentNode.Next = NextNode.Next\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcurrentNode = NextNode\n\t\t\tNextNode = NextNode.Next\n\t\t}\n\n\t\tl.Size--\n\n\t\treturn removedNode, nil\n\t}\n}", "title": "" }, { "docid": "d8243cab99bd6befde048a47da5c279e", "score": "0.5766361", "text": "func (b *Bookmarks) RemoveAt(idx int) {\n\tif idx < 0 || idx >= len(b.Bookmark) {\n\t\treturn\n\t}\n\tb.Bookmark = append(b.Bookmark[:idx], b.Bookmark[idx+1:]...)\n}", "title": "" }, { "docid": "ef063fe75715a01d73f91a90ffac5273", "score": "0.574927", "text": "func (b *BTree) removeInNodeAtIdx(n *memNode, idx int) *Item {\n\ts := n.node.Items\n\titem := s[idx]\n\tcopy(s[idx:], s[idx+1:])\n\ts[len(s)-1] = nil\n\ts = s[:len(s)-1]\n\treturn item\n}", "title": "" }, { "docid": "908d8354ae7b7f3464696747dc2ff167", "score": "0.5747223", "text": "func (this *ActivityStreamsImageProperty) Remove(idx int) {\n\t(this.properties)[idx].parent = nil\n\tcopy((this.properties)[idx:], (this.properties)[idx+1:])\n\t(this.properties)[len(this.properties)-1] = &ActivityStreamsImagePropertyIterator{}\n\tthis.properties = (this.properties)[:len(this.properties)-1]\n\tfor i := idx; i < this.Len(); i++ {\n\t\t(this.properties)[i].myIdx = i\n\t}\n}", "title": "" }, { "docid": "fe66cffeda1eed618d3b281ff07832c3", "score": "0.5730172", "text": "func (l *List) Del(v interface{} /* val */) *El {\n\tcur := l.search(v, true, true)\n\n\tif cur == nil || l.less(v, cur.val) {\n\t\treturn nil\n\t}\n\n\tl.len--\n\n\th := cur.height()\n\tfor i := h - 1; i >= 0; i-- {\n\t\t*l.up[i] = cur.nexti(i)\n\t}\n\n\tif l.autoreuse {\n\t\tReuse(cur)\n\t}\n\n\treturn cur\n}", "title": "" }, { "docid": "b92ca6ada3476cd11c415eafa00543a2", "score": "0.5697543", "text": "func (v *Data) Remove(idx int) (val PicData) {\n\tvar nil PicData\n\n\tdv := *v\n\n\tval = dv[idx]\n\t*v = append(dv[:idx], dv[1+idx:]...)\n\n\tdv[len(dv)-1] = nil\n\n\treturn val\n}", "title": "" }, { "docid": "9704d8211f3b4492779f15787b4ed183", "score": "0.5688727", "text": "func (a *DynamicArray) Remove(val int) {\n\tfor index := 0; index < a.len; {\n\t\tgot, _ := a.IndexAt(index)\n\t\t// If the element is found, erase the element at the index\n\t\tif got == val {\n\t\t\ta.EraseAt(index)\n\t\t\tcontinue\n\t\t}\n\t\t// If the element does not found in current index, shift to the right\n\t\tindex++\n\t}\n}", "title": "" }, { "docid": "3e539a0f7f105908f9e8c7864ddc9009", "score": "0.56841964", "text": "func (g *GameManager) RemoveByIndex(game int) (removedGame Game, err error) {\n\tif game > len(g.ListOfGames) || game < 0 {\n\t\treturn Game{}, errors.New(\"Index out of bounds\")\n\t}\n\n\tremovedGame = g.ListOfGames[game].RequestedGame\n\tg.ListOfGames = append(g.ListOfGames[:game], g.ListOfGames[game+1:]...)\n\treturn removedGame, nil\n}", "title": "" }, { "docid": "dc39e0cbdcabf8129db8782813587567", "score": "0.5670159", "text": "func (h *binaryHeap) removeIdx(idx int) {\n\tif h.invalidNode(idx) {\n\t\treturn\n\t}\n\th.swapIdx(idx, h.len)\n\th.tree[h.len] = 0\n\th.len--\n\th.bubbleDown(idx)\n}", "title": "" }, { "docid": "caf7dd49e4b405b4a76dbb7c0e57fefe", "score": "0.56654185", "text": "func (this *List) Remove(counterName string) {\n this.lock.Lock()\n defer this.lock.Unlock()\n\n delete(this.counters, counterName)\n}", "title": "" }, { "docid": "97d93e610ee8874fb3c6532822f9a416", "score": "0.56491566", "text": "func (s *children) removeAt(index int) *node {\n\tn := (*s)[index]\n\tcopy((**s)[index:], (*s)[index+1:])\n\t(*s)[len(*s)-1] = nil\n\t*s = (*s)[:len(*s)-1]\n\treturn n\n}", "title": "" }, { "docid": "30aef602444defd674b38a651f502301", "score": "0.5640338", "text": "func (t *txLookUp) RemoveByIndex(i int) {\n\tt.mu.Lock()\n\tdefer t.mu.Unlock()\n\n\tt.removeByIndex(i)\n}", "title": "" }, { "docid": "dc68f37a49d5fffec75e3201350e6272", "score": "0.5636689", "text": "func (li *ListItem) Delete(i int) {\n\tif i >= 0 && i < len(li.items) {\n\t\tli.items = append(li.items[:i], li.items[i+1:]...)\n\t}\n}", "title": "" }, { "docid": "f7ad6d0dbbe62e11d5cc27ae76403f1e", "score": "0.56275594", "text": "func (ap *ActivePipelines) Remove(index int) error {\n\tap.Lock()\n\tdefer ap.Unlock()\n\n\tl := len(ap.Pipelines)\n\tif index >= l || index+1 > l || index < 0 {\n\t\treturn fmt.Errorf(\"invalid index for len %d. index was: %d\", len(ap.Pipelines), index)\n\t}\n\tap.Pipelines = append(ap.Pipelines[:index], ap.Pipelines[index+1:]...)\n\treturn nil\n}", "title": "" }, { "docid": "6c28a76ea9f253a03b6f8e01fd89704e", "score": "0.56252146", "text": "func (l *List) Remove(value interface{}) {\n\tl.Lock()\n\tfor n := l.head; n != nil; n = n.next {\n\t\tif n.value == value {\n\t\t\tn.prev.next = n.next\n\t\t\tn.next.prev = n.prev\n\t\t\tl.length--\n\t\t}\n\t}\n\tl.Unlock()\n}", "title": "" }, { "docid": "84ce66c4dc127a32352d8c2bdb6790ec", "score": "0.5615949", "text": "func (*BackupList) remove(b []*BackupInfo, index int) ([]*BackupInfo, error) {\n\tif b == nil {\n\t\treturn nil, fmt.Errorf(\"empty list\")\n\t}\n\tif index >= len(b) || index < 0 {\n\t\treturn nil, fmt.Errorf(\"BUG: attempting to delete an out of range index entry from backupList\")\n\t}\n\treturn append(b[:index], b[index+1:]...), nil\n}", "title": "" }, { "docid": "988333ecfcb1e33e0d783a34d57ddfe8", "score": "0.55916935", "text": "func remove(list []*IPRange, index int) []*IPRange {\n\tfor i := index + 1; i < len(list); i++ {\n\t\tlist[i-1] = list[i]\n\t}\n\treturn list[:len(list)-1]\n}", "title": "" }, { "docid": "535f1cd3204cab19f46e3c5845948e14", "score": "0.5585121", "text": "func RemoveItem(slice []int, index int) []int {\n\tsliceLength := len(slice)\n\tif checkOutOfBounds(index, sliceLength) {\n\t\treturn slice\n\t}\n\tremovedSlice := slice[:index]\n\t// If the removed index is not at the end ...\n\tif index+1 < sliceLength {\n\t\t// tack on the rest of the slice after the removed index.\n\t\tremovedSlice = append(removedSlice, slice[index+1:]...)\n\t}\n\treturn removedSlice\n}", "title": "" }, { "docid": "650b15f8b8b79380a14efb1cdacf14a6", "score": "0.55822605", "text": "func (this *MyLinkedList) DeleteAtIndex(index int) {\n\tif this.head == nil || index < 0 {\n\t\treturn\n\t}\n\ttable := make(map[int]*ListNode)\n\ttail, i := this.head, 0\n\tfor tail != nil && i <= index {\n\t\ttable[i] = tail\n\t\ttail = tail.next\n\t\ti++\n\t}\n\tremoveElement := table[index]\n\tif removeElement == nil {\n\t\treturn\n\t}\n\tprev := table[index-1]\n\tvar next *ListNode\n\tif removeElement != nil {\n\t\tnext = removeElement.next\n\t}\n\tif prev == nil && next == nil {\n\t\tthis.head = nil\n\t\tthis.tail = nil\n\t} else {\n\t\tif prev == nil {\n\t\t\tthis.head = next\n\t\t} else {\n\t\t\tprev.next = next\n\t\t}\n\t}\n}", "title": "" }, { "docid": "59aecd23ed1f31abe56e3f43aabe8de9", "score": "0.557791", "text": "func (s *SortedList) Remove(f float64) {\n\tindex := sort.Search(len(*s), func(i int) bool { return (*s)[i] > f })\n\tlength := len(*s)\n\tif index == 0 {\n\t\tif (*s)[index] == f {\n\t\t\t*s = (*s)[1:]\n\t\t}\n\t} else if index == length {\n\t\t*s = (*s)[0 : length-1]\n\t} else {\n\t\tcopy((*s)[index-1:], (*s)[index:])\n\t\t*s = (*s)[:length-1]\n\t}\n}", "title": "" }, { "docid": "26716eefdb50a799787834257c45d619", "score": "0.55773145", "text": "func (l *list) delete(i int) {\n\n\tif l.begin == nil {\n\t\tpanic(\"list empty\")\n\t}\n\n\t// List over/underflow\n\tif i > l.nodes || i < 0 {\n\t\tpanic(\"not exists\")\n\t}\n\n\t// Removing the last node\n\tif l.nodes == 1 && i == 0 {\n\t\tl.begin = nil\n\t\tl.nodes = 0\n\t\treturn\n\t}\n\n\t// Removing at the end of the list\n\tif i == l.nodes-1 {\n\t\tn := l.begin\n\n\t\tfor j := 0; j < l.nodes-1; j++ {\n\t\t\tn = n.right\n\t\t}\n\n\t\tn.left.right = nil\n\t\tn = nil\n\t\tl.nodes--\n\t\treturn\n\t}\n\n\t// Removing the first node\n\tif i == 0 {\n\t\tn := l.begin.right\n\t\tl.begin = n\n\t\tl.begin.left = nil\n\t\tl.nodes--\n\t\treturn\n\t}\n\n\n\t// Removing in somewhere between\n\tc := l.begin\n\n\tfor j := 0; j < i; j++ {\n\t\tc = c.right\n\t}\n\n\tc.left.right, c.right.left = c.right, c.left\n\tl.nodes--\n}", "title": "" }, { "docid": "4978f15dc65c072ce6820df9e793f5a4", "score": "0.55672634", "text": "func (gdt *Array) Remove(idx Int) {\n\targ0 := gdt.getBase()\n\targ1 := idx.getBase()\n\n\tC.go_godot_array_remove(GDNative.api, arg0, arg1)\n}", "title": "" }, { "docid": "b4c4b905ad896dd00e47e4a86dd4cd48", "score": "0.55539364", "text": "func (mgmt *MonitoringManager) RemoveIPWithIndex(index int) {\n\tif index > -1 {\n\t\t// We do not need to care about order, so lets do a O(1) removal\n\t\t// We start by just swapping the last element of the list with the item specified in the index\n\t\t// Then we truncate the list by 1 to reduce the size\n\t\tmgmt.MonitorList[index] = mgmt.MonitorList[len(mgmt.MonitorList)-1]\n\t\tmgmt.MonitorList[len(mgmt.MonitorList)-1] = nil\n\t\tmgmt.MonitorList = mgmt.MonitorList[:len(mgmt.MonitorList)-1]\n\t}\n}", "title": "" }, { "docid": "1cf90147d885366e48b83b46940c82ff", "score": "0.5553072", "text": "func (t *StringSlice) RemoveAt(i int) bool {\n\tif i >= 0 && i < len(t.items) {\n\t\tt.items = append(t.items[:i], t.items[i+1:]...)\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "557d87af7c58950f05ae4594c46f275f", "score": "0.554166", "text": "func (ll *LinkedList) Remove(index uint) interface{} {\n\tll.Lock()\n\tdefer ll.Unlock()\n\n\tif index >= ll.size {\n\t\tpanic(&IndexOutOfRangeError{ll.size})\n\t}\n\n\tnode := ll.findNode(index)\n\n\tll.removeNode(index)\n\n\treturn node.data\n}", "title": "" }, { "docid": "a6c20c572eb7b5a9602115f37b7d76c0", "score": "0.5541638", "text": "func (pq *PriorityQueue) Remove(i int) interface{} {\n\treturn Remove(pq.list, i)\n}", "title": "" }, { "docid": "984421035f26de6ac9b619c0a789455c", "score": "0.5533797", "text": "func remove[T any](s []T, i int) []T {\n\ts[i] = s[len(s)-1]\n\treturn s[:len(s)-1]\n}", "title": "" }, { "docid": "6df0a3313c3b1f282695a3a7f049f00d", "score": "0.5532669", "text": "func RemoveItemFromSlice() {\n\tslice := []int{0, 1, 2, 3, 4, 5, 6}\n\tslice = append(slice[:2], slice[3:]...)\n\tfor _, val := range slice {\n\t\tfmt.Println(val)\n\t}\n}", "title": "" }, { "docid": "a79b6a88edc51f2fda98d18abb0e4235", "score": "0.5501167", "text": "func (v *Int32Vec) Remove(idx int) (val int32) {\n\tvar nil int32\n\n\tdv := *v\n\n\tval = dv[idx]\n\t*v = append(dv[:idx], dv[1+idx:]...)\n\n\tdv[len(dv)-1] = nil\n\n\treturn val\n}", "title": "" }, { "docid": "36265d709cdccb450a2e8c4a20274b66", "score": "0.5484901", "text": "func (l *PackageList) Remove(p *Package) {\n\tdelete(l.packages, l.keyFunc(p))\n\tif l.indexed {\n\t\tfor _, provides := range p.Provides {\n\t\t\tfor i, pkg := range l.providesIndex[provides] {\n\t\t\t\tif pkg.Equals(p) {\n\t\t\t\t\t// remove l.ProvidesIndex[provides][i] w/o preserving order\n\t\t\t\t\tl.providesIndex[provides][len(l.providesIndex[provides])-1], l.providesIndex[provides][i], l.providesIndex[provides] =\n\t\t\t\t\t\tnil, l.providesIndex[provides][len(l.providesIndex[provides])-1], l.providesIndex[provides][:len(l.providesIndex[provides])-1]\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ti := sort.Search(len(l.packagesIndex), func(j int) bool { return l.packagesIndex[j].Name >= p.Name })\n\t\tfor i < len(l.packagesIndex) && l.packagesIndex[i].Name == p.Name {\n\t\t\tif l.packagesIndex[i].Equals(p) {\n\t\t\t\t// remove l.packagesIndex[i] preserving order\n\t\t\t\tcopy(l.packagesIndex[i:], l.packagesIndex[i+1:])\n\t\t\t\tl.packagesIndex[len(l.packagesIndex)-1] = nil\n\t\t\t\tl.packagesIndex = l.packagesIndex[:len(l.packagesIndex)-1]\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7f60871f3341333f4c7aa2af2903f6b8", "score": "0.5475072", "text": "func (c *Comics) Remove(index int) bool {\n\tdefer logger.Trace(\"method Remove()\")()\n\n\tif index == -1 || index >= len(c.comics) {\n\t\treturn false\n\t}\n\n\tcopy(c.comics[index:], c.comics[index+1:])\n\tc.comics = c.comics[:len(c.comics)-1]\n\n\treturn true\n}", "title": "" }, { "docid": "db78a57db9d274f7d98fedcb2129b57d", "score": "0.54738194", "text": "func RemoveItemAt(list *List, index uint64) *uint64 {\n var returnPtr *uint64;\n var returnAddr uint64;\n var newReturnPtr uint64;\n var actualReturnPtr *uint64;\n var i uint64;\n returnPtr = GetItemAt(list, index); //Get the correspondig value value from the list\n newReturnPtr = Alloc(list.itemSize); //Allocate memory to store the item to be removed\n returnAddr = ToUint64FromUint64Ptr(returnPtr);\n CopyMem(returnAddr, newReturnPtr, list.itemSize); //Save item to be removed in order to return it\n for i = index; i < list.itemCount - 1; i = i + 1 { //Remove item by moving the following ones \"backwards\" in order to fill the gap caused by the deleted item\n CopyMem(list.baseAddress + (i + 1) * list.itemSize, list.baseAddress + list.itemSize * i, list.itemSize); //Move item at position i + 1 to position i\n }\n list.itemCount = list.itemCount - 1; //Update (decrease) item count\n actualReturnPtr = ToUint64PtrFromUint64(newReturnPtr);\n return actualReturnPtr; //Return value removed from list\n}", "title": "" }, { "docid": "20fe60e51eac161309cf81b2d409e903", "score": "0.54380596", "text": "func (sl *IntList) Remove(elem int) int {\n\treturn sl.RemoveByFilter(func(idx int, _elem int) bool {\n\t\treturn _elem == elem\n\t})\n}", "title": "" }, { "docid": "a11fba65c57f044733de6bb4272d361d", "score": "0.5434637", "text": "func (i *ItemInventory) Remove(o *Item) {\n\tfor c, p := range i.Contents {\n\t\tif p == o {\n\t\t\tcopy(i.Contents[c:], i.Contents[c+1:])\n\t\t\ti.Contents[len(i.Contents)-1] = nil\n\t\t\ti.Contents = i.Contents[:len(i.Contents)-1]\n\t\t\tbreak\n\t\t}\n\t}\n\tif len(i.Contents) == 0 {\n\t\ti.Contents = make([]*Item, 0, 10)\n\t}\n\ti.TotalWeight -= o.GetWeight()\n}", "title": "" }, { "docid": "2e909ed49d97271d9b711277bc782bfc", "score": "0.54275656", "text": "func (a Slice[T]) DeleteAt(index int) Slice[T] {\n\treturn append(a[:index], a[index+1:]...)\n}", "title": "" }, { "docid": "1c062abff67c1b0c16d23b686c3573b6", "score": "0.5425333", "text": "func (l *List) Delete(i int) {\n\tli := l.rootItem\n\tli.Delete(i)\n}", "title": "" }, { "docid": "3a396973a86372a10efe29b77d04bba1", "score": "0.5425238", "text": "func (s *StashList) RemoveStashAtIdx(ctx context.Context, vw types.ValueWriter, idx int) (hash.Hash, error) {\n\tamCount, err := s.am.Count()\n\tif err != nil {\n\t\treturn hash.Hash{}, err\n\t}\n\tif amCount <= idx {\n\t\treturn hash.Hash{}, fmt.Errorf(\"fatal: log for 'stash' only has %v entries\", amCount)\n\t}\n\n\tstash, err := getNthStash(ctx, s.am, amCount, idx)\n\tif err != nil {\n\t\treturn hash.Hash{}, err\n\t}\n\n\tame := s.am.Editor()\n\terr = ame.Delete(ctx, strconv.Itoa(stash.key))\n\tif err != nil {\n\t\treturn hash.Hash{}, err\n\t}\n\n\ts.am, err = ame.Flush(ctx)\n\tif err != nil {\n\t\treturn hash.Hash{}, err\n\t}\n\treturn s.updateStashListMap(ctx, vw)\n}", "title": "" }, { "docid": "a6a9640f19a6063cefb5c713ef740cdb", "score": "0.541752", "text": "func (u *UdList) Del(key string) {\n\tidx := len(u.Data)\n\tfor i, p := range u.Data {\n\t\tif p.Name == key {\n\t\t\tidx = i\n\t\t\tbreak\n\t\t}\n\t}\n\tu.Data[idx] = u.Data[len(u.Data)-1]\n\tu.Data = u.Data[:len(u.Data)-1]\n}", "title": "" }, { "docid": "79de608bd72d10fce7edc5fcd89a481a", "score": "0.5404107", "text": "func (s *IntSet) Remove(e int) {\n\tdelete(s.elem, e)\n}", "title": "" }, { "docid": "c966b8490289cba379cffeb0317fbe64", "score": "0.5397462", "text": "func (r *Rope) EraseAt(point, n int) (err error) {\n\tif point > r.runes {\n\t\tpoint = r.runes\n\t}\n\tif n >= r.runes-point {\n\t\tn = r.runes - point\n\t}\n\tvar k *knot\n\ts := skiplist{r: r}\n\tif k, err = s.find2(point); err != nil {\n\t\treturn err\n\t}\n\ts.del(k, n)\n\treturn nil\n}", "title": "" }, { "docid": "6fa3c6dbdfc5781f3cc45b814ff10c16", "score": "0.53943914", "text": "func removeAtIndex(source []int, index int) []int {\n\tlastIndex := len(source) - 1\n\tsource[index], source[lastIndex] = source[lastIndex], source[index]\n\treturn source[:lastIndex]\n}", "title": "" }, { "docid": "e5bd62cc7a99eef981333b3e14ed4f59", "score": "0.53906286", "text": "func (this *RandomizedSet) Remove(val int) bool {\n\ti, ok := this.indices[val]\n\tif !ok {\n\t\treturn false\n\t}\n\tlastVal := this.list[len(this.list)-1]\n\tthis.indices[lastVal] = i\n\tdelete(this.indices, val)\n\tthis.list[i] = lastVal\n\tthis.list = this.list[:len(this.list)-1]\n\treturn true\n}", "title": "" }, { "docid": "31727cd6c335902900587881445be3db", "score": "0.53855133", "text": "func (m *Maps) RemoveAt(c types.Coordinate) {\n\tm.active[c.Y][c.X] = Empty{}\n}", "title": "" }, { "docid": "5a89611ddbc5ef35b9cb734aabc15165", "score": "0.53847414", "text": "func Remove(slice interface{}, i int) {\n\tneogointernal.Opcode2NoReturn(\"REMOVE\", slice, i)\n}", "title": "" }, { "docid": "5c7154cb257ae1808176010582d0d744", "score": "0.538401", "text": "func (list *LinkedList) remove(index int) interface{}{\n\tfor i:=0; i<index-1;i++{\n\t\tif(list==nil){\n\t\t\treturn errors.New(\"Out of Bounds\")\n\t\t}\n\t\tlist=list.next\n\t}\n\tpivot:=list.next\n\tif pivot==nil{\n\t\treturn nil\n\t}\n\tlist.next = pivot.next\n\tpivot.next=nil\n\treturn pivot.data\n\n\n}", "title": "" }, { "docid": "da94435c4989fa3f10364cb01552e00e", "score": "0.53764963", "text": "func (t *Indexed) Remove(x int) {\n\tl, r := t.split(t.root, x-1)\n\t_, xr := t.split(r, x)\n\tt.root = t.merge(l, xr)\n}", "title": "" }, { "docid": "9c8191057da7293443891fa2bedf7a6f", "score": "0.5374614", "text": "func (this *RandomizedCollection) Remove(val int) bool {\n \n}", "title": "" }, { "docid": "5721db812d5eba2bba15908bd191cef9", "score": "0.5369037", "text": "func (s *PSlice) Remove(addr swarm.Address, po uint8) {\n\ts.Lock()\n\tdefer s.Unlock()\n\n\te, i := s.exists(addr)\n\tif !e {\n\t\treturn\n\t}\n\n\ts.peers = append(s.peers[:i], s.peers[i+1:]...)\n\ts.decDeeper(po)\n}", "title": "" }, { "docid": "99fcc25e095cb5952ef18e5ea35143ec", "score": "0.5366419", "text": "func (l *DoublyLinkedList) Remove(i int) {\n\tcur := l.head\n\n\tif cur == nil {\n\t\tpanic(\"DoublyLinkedList is empty!\")\n\t}\n\n\tif cur.value == i {\n\t\tl.head = &Node{}\n\t\treturn\n\t}\n\n\tfor cur.next != nil {\n\t\tcur = cur.next\n\n\t\tif cur.value == i {\n\t\t\tcur.prev.next = cur.next\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "efa1d20db2113baa5ccb06b410db5b86", "score": "0.53651786", "text": "func (this *MyLinkedList) DeleteAtIndex(index int) {\n\tif this.size == 0 {\n\t\treturn\n\t} else if index < 0 || index > this.size-1 {\n\t\treturn\n\t} else {\n\t\tif this.size == 1 {\n\t\t\tthis.head = nil\n\t\t\tthis.tail = nil\n\t\t\tthis.listMap = []*ListNode{}\n\t\t} else {\n\t\t\tthis.listMap[index-1].Next = this.listMap[index].Next\n\t\t\tthis.listMap = append(this.listMap[:index], this.listMap[index+1:]...)\n\t\t}\n\t\tthis.size--\n\t}\n}", "title": "" }, { "docid": "e084750e26d02b08c8674d5b2c83e802", "score": "0.53619075", "text": "func (countIndex *CountIndex) Remove(id string) {\n\tif prev, ok := countIndex.currentPosition[id]; ok {\n\t\tcountIndex.index.GetEntryAt(prev).(counter).Remove(prev)\n\t\tdelete(countIndex.currentPosition, id)\n\t}\n}", "title": "" }, { "docid": "e477173492e7ea89a5f7e4affc3ae438", "score": "0.5348827", "text": "func RemoveAtIndex(data interface{}, index int) (interface{}, error) {\n\t// Get concrete value of data\n\tvalue := reflect.ValueOf(data)\n\n\t// Get the type of value\n\tvalueType := value.Type()\n\n\tif valueType.Kind() != reflect.Array && valueType.Kind() != reflect.Slice {\n\t\terr := errors.New(\"Data parameter is not an array or slice\")\n\t\treturn nil, err\n\t}\n\n\tif index >= value.Len() {\n\t\terr := errors.New(\"Index is greater than data length\")\n\t\treturn nil, err\n\t}\n\n\t// Create slice from value\n\tresultSlice := reflect.AppendSlice(value.Slice(0, index), value.Slice(index+1, value.Len()))\n\n\treturn resultSlice.Interface(), nil\n}", "title": "" }, { "docid": "3a4170e684681b8939ed1df2034f53ed", "score": "0.53371435", "text": "func (set *AppleSet) Remove(i Apple) {\n\tset.s.Lock()\n\tdefer set.s.Unlock()\n\n\tdelete(set.m, i)\n}", "title": "" }, { "docid": "a4f31bf72476f009701c0516dc8c2144", "score": "0.53291464", "text": "func (l *SkippedSequenceList) _remove(x uint64) error {\n\tif listElement, ok := l.skippedMap[x]; ok {\n\t\tl.skippedList.Remove(listElement)\n\t\tdelete(l.skippedMap, x)\n\t\treturn nil\n\t} else {\n\t\treturn errors.New(\"Value not found\")\n\t}\n}", "title": "" }, { "docid": "86540745dd6085823b9d6f516cb92e98", "score": "0.5325367", "text": "func (vector *Vector) Delete(i int) {\n\t//a = append(a[:i], a[i+1:]...)\n\t// or\n\t//a = a[:i+copy(a[i:], a[i+1:])]\n\t// NOTE If the type of the element is a pointer or a struct with pointer fields,\n\t// which need to be garbage collected, the above implementation of Delete has a potential\n\t// memory leak problem: some elements with values are still referenced by slice a and\n\t// thus can not be collected. The following code can fix this problem:\n\n\tcopy((*vector)[i:], (*vector)[i+1:])\n\t(*vector)[len(*vector)-1] = nil // or the zero value of T\n\t*vector = (*vector)[:len(*vector)-1]\n}", "title": "" }, { "docid": "ee39eef97beed80c1e2b9002793f5f72", "score": "0.53228873", "text": "func (this *MyLinkedList) DeleteAtIndex(index int) {\n\tif index < 0 || index >= this.Length {\n\t\treturn\n\t}\n\tcurrent := this.Head\n\tfor i := 0; i < index; i++ {\n\t\tcurrent = current.Next\n\t}\n\tcurrent.Next = current.Next.Next\n\tthis.Length--\n}", "title": "" }, { "docid": "1d179a2e7b9d0a67ee019b7f6ea93b91", "score": "0.5322016", "text": "func (ht *ValueHashtable) Remove(k [HashSize]byte) {\r\n\tht.lock.Lock()\r\n\tdefer ht.lock.Unlock()\r\n\tdelete(ht.items, k)\r\n}", "title": "" }, { "docid": "1f1f5de7662467419a04888cd75a17bc", "score": "0.5315744", "text": "func removeItemByIndex(slice []string, idx int) []string {\n\n\tcopy(slice[idx:], slice[idx+1:]) // Shift slice[idx+1:] left one index.\n\tslice[len(slice)-1] = \"\" // Erase last element (write zero value).\n\treturn slice[:len(slice)-1] // Truncate slice.\n}", "title": "" }, { "docid": "76fe7615f67f294d9d5f329f80719403", "score": "0.52981454", "text": "func (l *List) remove(n *Node) {\n\tn.prev.next = n.next\n\tn.next.prev = n.prev\n\tn.next = nil\n\tn.prev = nil\n\tn.list = nil\n\tl.Size--\n}", "title": "" }, { "docid": "2e47e30bd9608cca8bccbcaa1d7cb139", "score": "0.5290497", "text": "func (s store) Remove(index string) {\n\n\trunThreadSafe(func() {\n\t\tdelete(s, index)\n\t})\n\n\ts.writeToDisk()\n}", "title": "" }, { "docid": "d656d4aadd998e8f72f262f78c3f6beb", "score": "0.5285993", "text": "func (list *List) Pop(idx ...int) (interface{}, error) {\n\tindex := list.getLastIndex()\n\tll := len(idx)\n\n\tif ll > 1 {\n\t\treturn nil, fmt.Errorf(\"only 1 or 0 arguments are allowed\")\n\t}\n\n\t// in case of `list.Pop()`\n\telement := list.getByIndex(index)\n\tif ll == 0 {\n\t\treturn element, list.removeByIndex(index)\n\t}\n\n\tif idx[0] > index {\n\t\treturn nil, fmt.Errorf(\"index out of range\")\n\t}\n\n\tindex = idx[0]\n\treturn element, list.removeByIndex(index)\n}", "title": "" }, { "docid": "0a052de541a88599765d8a6d4787eb57", "score": "0.5284212", "text": "func (l *List) Delete(i interface{}) {\n\tl = GetHead(l)\n\tfor l != nil {\n\t\tif l.value == i {\n\t\t\tif l.prev != nil {\n\t\t\t\tl.prev.next = l.next\n\t\t\t}\n\t\t\tif l.next != nil {\n\t\t\t\tl.next.prev = l.prev\n\t\t\t}\n\t\t\tl = nil\n\t\t\tbreak\n\t\t}\n\t\tl = l.next\n\t}\n}", "title": "" }, { "docid": "272e364394f6170d7ecba28bd1d5e683", "score": "0.5281365", "text": "func (coll *Collection) Remove(i int) {\n\tlen := len(*coll)\n\tif len == 0 {\n\t\treturn\n\t}\n\n\tif i > (len - 1) {\n\t\treturn\n\t}\n\n\tarr := ToInterfaces(*coll)\n\t*coll = append(arr[:i], arr[i+1:]...)\n}", "title": "" }, { "docid": "f6a57a1416c011a296531cb61ded0026", "score": "0.5276789", "text": "func (b Bucket) Remove(index int) Bucket {\n\n\t// TODO: return error if index is beyond bucket size.\n\tif len(b)-1 < index {\n\t\treturn b\n\t}\n\treturn append(b[:index], b[index+1:]...)\n}", "title": "" }, { "docid": "c79e9ab55aedd2dc11dd9719fc201e11", "score": "0.52758265", "text": "func (b *Buffer) Remove(offset int, size int) {\n if (offset + size) > len(b.data) {\n panic(\"invalid offset & size\")\n }\n\n copy(b.data[offset:], b.data[offset+size:])\n b.size -= size\n if b.offset >= (offset + size) {\n b.offset -= size\n } else if b.offset >= offset {\n b.offset -= b.offset - offset\n if b.offset > b.size {\n b.offset = b.size\n }\n }\n}", "title": "" }, { "docid": "908d05f7124b44ea6f36f8c7b7379d45", "score": "0.5274239", "text": "func (i *Inventory) Remove(thing thing.Interface) {\n\tif index := i.find(thing); index != NOT_FOUND {\n\t\ti.contents = append(i.contents[:index], i.contents[index+1:]...)\n\t\tif len(i.contents) == 0 {\n\t\t\ti.contents = nil\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8c7799ce0ec6e8aa66ea12ce07924d1e", "score": "0.5267957", "text": "func (c *recordCollection) Remove(n int) {\n\t*c = append((*c)[:n], (*c)[n+1:]...)\n}", "title": "" } ]
261c54434c4377ba3616ad5eaee5bacd
AppendNextHop appends the supplied NetworkInstance_Afts_Ipv6Entry_NextHop struct to the list NextHop of NetworkInstance_Afts_Ipv6Entry. If the key value(s) specified in the supplied NetworkInstance_Afts_Ipv6Entry_NextHop already exist in the list, an error is returned.
[ { "docid": "bf2be4130c72065e6d6183dfd8a7c533", "score": "0.87425774", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) AppendNextHop(v *NetworkInstance_Afts_Ipv6Entry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv6Entry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" } ]
[ { "docid": "476d25ad068f008fa00e645fbca4c692", "score": "0.7930461", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) NewNextHop(Index uint64) (*NetworkInstance_Afts_Ipv6Entry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv6Entry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_Ipv6Entry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "476d25ad068f008fa00e645fbca4c692", "score": "0.79277575", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) NewNextHop(Index uint64) (*NetworkInstance_Afts_Ipv6Entry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv6Entry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_Ipv6Entry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "476d25ad068f008fa00e645fbca4c692", "score": "0.79277575", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) NewNextHop(Index uint64) (*NetworkInstance_Afts_Ipv6Entry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv6Entry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_Ipv6Entry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "28884f227d48ecba56f551ae98cc57a9", "score": "0.7882167", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) AppendNextHop(v *NetworkInstance_Afts_Ipv4Entry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv4Entry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "28884f227d48ecba56f551ae98cc57a9", "score": "0.7882167", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) AppendNextHop(v *NetworkInstance_Afts_Ipv4Entry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv4Entry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "28884f227d48ecba56f551ae98cc57a9", "score": "0.7882167", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) AppendNextHop(v *NetworkInstance_Afts_Ipv4Entry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv4Entry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "845f38a349c1e2440c4819d837568fac", "score": "0.7819667", "text": "func (t *NetworkInstance_Afts) AppendNextHop(v *NetworkInstance_Afts_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "cfab2d4a27e7e234c6e8d6fa4cb8f69b", "score": "0.78138906", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) AppendNextHop(v *NetworkInstance_Afts_PolicyForwardingEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_PolicyForwardingEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "cfab2d4a27e7e234c6e8d6fa4cb8f69b", "score": "0.78138906", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) AppendNextHop(v *NetworkInstance_Afts_PolicyForwardingEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_PolicyForwardingEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "cfab2d4a27e7e234c6e8d6fa4cb8f69b", "score": "0.7813144", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) AppendNextHop(v *NetworkInstance_Afts_PolicyForwardingEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_PolicyForwardingEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "4b22634b02f20fa58f446f04bc4245ab", "score": "0.7799647", "text": "func (t *NetworkInstance_Afts_MacEntry) AppendNextHop(v *NetworkInstance_Afts_MacEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_MacEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "4b22634b02f20fa58f446f04bc4245ab", "score": "0.7799647", "text": "func (t *NetworkInstance_Afts_MacEntry) AppendNextHop(v *NetworkInstance_Afts_MacEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_MacEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "4b22634b02f20fa58f446f04bc4245ab", "score": "0.7799647", "text": "func (t *NetworkInstance_Afts_MacEntry) AppendNextHop(v *NetworkInstance_Afts_MacEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_MacEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "d87b834f1ad84e998dca16deadb4306a", "score": "0.76342475", "text": "func (t *NetworkInstance_Afts_LabelEntry) AppendNextHop(v *NetworkInstance_Afts_LabelEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_LabelEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "d87b834f1ad84e998dca16deadb4306a", "score": "0.76342475", "text": "func (t *NetworkInstance_Afts_LabelEntry) AppendNextHop(v *NetworkInstance_Afts_LabelEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_LabelEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "d87b834f1ad84e998dca16deadb4306a", "score": "0.7633461", "text": "func (t *NetworkInstance_Afts_LabelEntry) AppendNextHop(v *NetworkInstance_Afts_LabelEntry_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_LabelEntry_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "62d737c9b564dd9e3b85f4b13d478357", "score": "0.7631668", "text": "func (t *NetworkInstance_Afts_NextHopGroup) AppendNextHop(v *NetworkInstance_Afts_NextHopGroup_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_NextHopGroup_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "8ee2b3c4ca67d065282f486a49cfbd79", "score": "0.7393271", "text": "func (t *NetworkInstance_Afts) AppendIpv6Entry(v *NetworkInstance_Afts_Ipv6Entry) error {\n\tkey := *v.Prefix\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tif _, ok := t.Ipv6Entry[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Entry %v\", key)\n\t}\n\n\tt.Ipv6Entry[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "8ee2b3c4ca67d065282f486a49cfbd79", "score": "0.7393271", "text": "func (t *NetworkInstance_Afts) AppendIpv6Entry(v *NetworkInstance_Afts_Ipv6Entry) error {\n\tkey := *v.Prefix\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tif _, ok := t.Ipv6Entry[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Entry %v\", key)\n\t}\n\n\tt.Ipv6Entry[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "8ee2b3c4ca67d065282f486a49cfbd79", "score": "0.7392945", "text": "func (t *NetworkInstance_Afts) AppendIpv6Entry(v *NetworkInstance_Afts_Ipv6Entry) error {\n\tkey := *v.Prefix\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tif _, ok := t.Ipv6Entry[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Entry %v\", key)\n\t}\n\n\tt.Ipv6Entry[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "8ee2b3c4ca67d065282f486a49cfbd79", "score": "0.73914236", "text": "func (t *NetworkInstance_Afts) AppendIpv6Entry(v *NetworkInstance_Afts_Ipv6Entry) error {\n\tkey := *v.Prefix\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tif _, ok := t.Ipv6Entry[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Entry %v\", key)\n\t}\n\n\tt.Ipv6Entry[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "bfb43531072f7c6a13a153db95f6e3c9", "score": "0.71221524", "text": "func (t *NetworkInstance_Protocol_Static) AppendNextHop(v *NetworkInstance_Protocol_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*NetworkInstance_Protocol_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "bfb43531072f7c6a13a153db95f6e3c9", "score": "0.7121316", "text": "func (t *NetworkInstance_Protocol_Static) AppendNextHop(v *NetworkInstance_Protocol_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*NetworkInstance_Protocol_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "bfb43531072f7c6a13a153db95f6e3c9", "score": "0.71205205", "text": "func (t *NetworkInstance_Protocol_Static) AppendNextHop(v *NetworkInstance_Protocol_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*NetworkInstance_Protocol_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "bfb43531072f7c6a13a153db95f6e3c9", "score": "0.71205205", "text": "func (t *NetworkInstance_Protocol_Static) AppendNextHop(v *NetworkInstance_Protocol_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*NetworkInstance_Protocol_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "dcae08cdb1fb4dc985a17f96958e80d2", "score": "0.70929015", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) GetNextHop(Index uint64) *NetworkInstance_Afts_Ipv6Entry_NextHop {\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f4f61f569b6dd23c3a33f7269fcee5a5", "score": "0.7060681", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) GetNextHop(Index uint64) *NetworkInstance_Afts_Ipv6Entry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f4f61f569b6dd23c3a33f7269fcee5a5", "score": "0.7060681", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) GetNextHop(Index uint64) *NetworkInstance_Afts_Ipv6Entry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "320dee954f30e3732589b9d5addd9c46", "score": "0.7031777", "text": "func (t *LocalRoutes_Static) AppendNextHop(v *LocalRoutes_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*LocalRoutes_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "320dee954f30e3732589b9d5addd9c46", "score": "0.7031777", "text": "func (t *LocalRoutes_Static) AppendNextHop(v *LocalRoutes_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*LocalRoutes_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "320dee954f30e3732589b9d5addd9c46", "score": "0.7031777", "text": "func (t *LocalRoutes_Static) AppendNextHop(v *LocalRoutes_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*LocalRoutes_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "320dee954f30e3732589b9d5addd9c46", "score": "0.7028528", "text": "func (t *LocalRoutes_Static) AppendNextHop(v *LocalRoutes_Static_NextHop) error {\n\tkey := *v.Index\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[string]*LocalRoutes_Static_NextHop)\n\t}\n\n\tif _, ok := t.NextHop[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHop %v\", key)\n\t}\n\n\tt.NextHop[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "65ca0aac75f6118e6a99a04f9a6d0868", "score": "0.69569945", "text": "func (s *NetworkInstance_Afts_Ipv6Entry_NextHop) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Afts_Ipv6Entry_NextHop\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "65ca0aac75f6118e6a99a04f9a6d0868", "score": "0.69569945", "text": "func (s *NetworkInstance_Afts_Ipv6Entry_NextHop) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Afts_Ipv6Entry_NextHop\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "65ca0aac75f6118e6a99a04f9a6d0868", "score": "0.6956991", "text": "func (s *NetworkInstance_Afts_Ipv6Entry_NextHop) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Afts_Ipv6Entry_NextHop\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9f72d1a49fc2ca2a10a53573b39e6b4a", "score": "0.6847903", "text": "func (t *NetworkInstance_Afts) AppendNextHopGroup(v *NetworkInstance_Afts_NextHopGroup) error {\n\tkey := *v.Id\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHopGroup == nil {\n\t\tt.NextHopGroup = make(map[uint64]*NetworkInstance_Afts_NextHopGroup)\n\t}\n\n\tif _, ok := t.NextHopGroup[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list NextHopGroup %v\", key)\n\t}\n\n\tt.NextHopGroup[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "06c252c12eb128d561ae1f4e5c772a4e", "score": "0.67672163", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) NewNextHop(Index uint64) (*NetworkInstance_Afts_Ipv4Entry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv4Entry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_Ipv4Entry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "06c252c12eb128d561ae1f4e5c772a4e", "score": "0.67672163", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) NewNextHop(Index uint64) (*NetworkInstance_Afts_Ipv4Entry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv4Entry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_Ipv4Entry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "06c252c12eb128d561ae1f4e5c772a4e", "score": "0.67672163", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) NewNextHop(Index uint64) (*NetworkInstance_Afts_Ipv4Entry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_Ipv4Entry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_Ipv4Entry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "9f02117d819676934a40097da65c0a47", "score": "0.66684425", "text": "func (t *NetworkInstance_Afts_MacEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_MacEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_MacEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_MacEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "9f02117d819676934a40097da65c0a47", "score": "0.66684425", "text": "func (t *NetworkInstance_Afts_MacEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_MacEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_MacEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_MacEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "9f02117d819676934a40097da65c0a47", "score": "0.66684425", "text": "func (t *NetworkInstance_Afts_MacEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_MacEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_MacEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_MacEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "d55736f6c67584fcaa6a1aa473525fe2", "score": "0.664829", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) GetOrCreateNextHop(Index uint64) *NetworkInstance_Afts_Ipv6Entry_NextHop {\n\n\tkey := Index\n\n\tif v, ok := t.NextHop[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.NewNextHop(Index)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateNextHop got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "d55736f6c67584fcaa6a1aa473525fe2", "score": "0.664829", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) GetOrCreateNextHop(Index uint64) *NetworkInstance_Afts_Ipv6Entry_NextHop {\n\n\tkey := Index\n\n\tif v, ok := t.NextHop[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.NewNextHop(Index)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateNextHop got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "d55736f6c67584fcaa6a1aa473525fe2", "score": "0.664829", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) GetOrCreateNextHop(Index uint64) *NetworkInstance_Afts_Ipv6Entry_NextHop {\n\n\tkey := Index\n\n\tif v, ok := t.NextHop[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.NewNextHop(Index)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateNextHop got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "5f67a1a2e926164abfd12215d782129b", "score": "0.6611263", "text": "func (t *NetworkInstance_Afts) NewNextHop(Index uint64) (*NetworkInstance_Afts_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "06aa8b1e2c66c2ed5c73a525a3a3d9fc", "score": "0.6570941", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_PolicyForwardingEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_PolicyForwardingEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_PolicyForwardingEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "06aa8b1e2c66c2ed5c73a525a3a3d9fc", "score": "0.65701383", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_PolicyForwardingEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_PolicyForwardingEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_PolicyForwardingEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "06aa8b1e2c66c2ed5c73a525a3a3d9fc", "score": "0.65701383", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_PolicyForwardingEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_PolicyForwardingEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_PolicyForwardingEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "5aa0e15cef98bb27db8a7e5cf04995ea", "score": "0.6321127", "text": "func (t *NetworkInstance_Afts_LabelEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_LabelEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_LabelEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_LabelEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "5aa0e15cef98bb27db8a7e5cf04995ea", "score": "0.6321127", "text": "func (t *NetworkInstance_Afts_LabelEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_LabelEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_LabelEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_LabelEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "5aa0e15cef98bb27db8a7e5cf04995ea", "score": "0.631942", "text": "func (t *NetworkInstance_Afts_LabelEntry) NewNextHop(Index uint64) (*NetworkInstance_Afts_LabelEntry_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_LabelEntry_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_LabelEntry_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "007fd00f89ee7445d45c76f2cb21e1ec", "score": "0.6231027", "text": "func (t *NetworkInstance_Afts_NextHopGroup) NewNextHop(Index uint64) (*NetworkInstance_Afts_NextHopGroup_NextHop, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHop == nil {\n\t\tt.NextHop = make(map[uint64]*NetworkInstance_Afts_NextHopGroup_NextHop)\n\t}\n\n\tkey := Index\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.NextHop[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHop\", key)\n\t}\n\n\tt.NextHop[key] = &NetworkInstance_Afts_NextHopGroup_NextHop{\n\t\tIndex: &Index,\n\t}\n\n\treturn t.NextHop[key], nil\n}", "title": "" }, { "docid": "b47ef5c8301531fc9e0b6d8529d82a8f", "score": "0.60591686", "text": "func (o *Route4Type) SetNextHop(v string) {\n\to.NextHop = v\n}", "title": "" }, { "docid": "3018ebe3bbb699d04e53fb4e8a4cbdc8", "score": "0.60369813", "text": "func (t *NetworkInstance_Afts) NewIpv6Entry(Prefix string) (*NetworkInstance_Afts_Ipv6Entry, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tkey := Prefix\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.Ipv6Entry[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Ipv6Entry\", key)\n\t}\n\n\tt.Ipv6Entry[key] = &NetworkInstance_Afts_Ipv6Entry{\n\t\tPrefix: &Prefix,\n\t}\n\n\treturn t.Ipv6Entry[key], nil\n}", "title": "" }, { "docid": "3018ebe3bbb699d04e53fb4e8a4cbdc8", "score": "0.60368556", "text": "func (t *NetworkInstance_Afts) NewIpv6Entry(Prefix string) (*NetworkInstance_Afts_Ipv6Entry, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tkey := Prefix\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.Ipv6Entry[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Ipv6Entry\", key)\n\t}\n\n\tt.Ipv6Entry[key] = &NetworkInstance_Afts_Ipv6Entry{\n\t\tPrefix: &Prefix,\n\t}\n\n\treturn t.Ipv6Entry[key], nil\n}", "title": "" }, { "docid": "3018ebe3bbb699d04e53fb4e8a4cbdc8", "score": "0.60360676", "text": "func (t *NetworkInstance_Afts) NewIpv6Entry(Prefix string) (*NetworkInstance_Afts_Ipv6Entry, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tkey := Prefix\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.Ipv6Entry[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Ipv6Entry\", key)\n\t}\n\n\tt.Ipv6Entry[key] = &NetworkInstance_Afts_Ipv6Entry{\n\t\tPrefix: &Prefix,\n\t}\n\n\treturn t.Ipv6Entry[key], nil\n}", "title": "" }, { "docid": "3018ebe3bbb699d04e53fb4e8a4cbdc8", "score": "0.60360676", "text": "func (t *NetworkInstance_Afts) NewIpv6Entry(Prefix string) (*NetworkInstance_Afts_Ipv6Entry, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Entry == nil {\n\t\tt.Ipv6Entry = make(map[string]*NetworkInstance_Afts_Ipv6Entry)\n\t}\n\n\tkey := Prefix\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.Ipv6Entry[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Ipv6Entry\", key)\n\t}\n\n\tt.Ipv6Entry[key] = &NetworkInstance_Afts_Ipv6Entry{\n\t\tPrefix: &Prefix,\n\t}\n\n\treturn t.Ipv6Entry[key], nil\n}", "title": "" }, { "docid": "76fb576607f39582b9b1aa3cfb4737b0", "score": "0.60175574", "text": "func (ip *IPv6) Next() *IPv6 {\n\tif ip.hostId == F64{\n\t\treturn nil\n\t}\n\treturn NewIPv6(ip.netId, ip.hostId + 1)\n}", "title": "" }, { "docid": "d54748f5b4ea684d785b8191227d525a", "score": "0.5997239", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) GetNextHop(Index uint64) *NetworkInstance_Afts_Ipv4Entry_NextHop {\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cceb00b3491dda02ca74f56c6dcf9a04", "score": "0.5987479", "text": "func (s *NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cceb00b3491dda02ca74f56c6dcf9a04", "score": "0.5987479", "text": "func (s *NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cceb00b3491dda02ca74f56c6dcf9a04", "score": "0.5987479", "text": "func (s *NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef\"], s, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c903601ca393634f9a7e2c2f76035aee", "score": "0.59698534", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) GetNextHop(Index uint64) *NetworkInstance_Afts_Ipv4Entry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c903601ca393634f9a7e2c2f76035aee", "score": "0.59698534", "text": "func (t *NetworkInstance_Afts_Ipv4Entry) GetNextHop(Index uint64) *NetworkInstance_Afts_Ipv4Entry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9dc95dbf0654dd31ab26d4245a490952", "score": "0.5860729", "text": "func (t *Interface_RoutedVlan_Ipv6) AppendNeighbor(v *Interface_RoutedVlan_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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_RoutedVlan_Ipv6_Neighbor)\n\t}\n\n\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "9dc95dbf0654dd31ab26d4245a490952", "score": "0.5859767", "text": "func (t *Interface_RoutedVlan_Ipv6) AppendNeighbor(v *Interface_RoutedVlan_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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_RoutedVlan_Ipv6_Neighbor)\n\t}\n\n\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "9dc95dbf0654dd31ab26d4245a490952", "score": "0.58596146", "text": "func (t *Interface_RoutedVlan_Ipv6) AppendNeighbor(v *Interface_RoutedVlan_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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_RoutedVlan_Ipv6_Neighbor)\n\t}\n\n\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "9dc95dbf0654dd31ab26d4245a490952", "score": "0.58596146", "text": "func (t *Interface_RoutedVlan_Ipv6) AppendNeighbor(v *Interface_RoutedVlan_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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_RoutedVlan_Ipv6_Neighbor)\n\t}\n\n\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "e23936f066c81486adc7fd772be8ffff", "score": "0.5851045", "text": "func (t *Interface_Subinterface_Ipv6) AppendNeighbor(v *Interface_Subinterface_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "e23936f066c81486adc7fd772be8ffff", "score": "0.5851045", "text": "func (t *Interface_Subinterface_Ipv6) AppendNeighbor(v *Interface_Subinterface_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "e23936f066c81486adc7fd772be8ffff", "score": "0.5849984", "text": "func (t *Interface_Subinterface_Ipv6) AppendNeighbor(v *Interface_Subinterface_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "e23936f066c81486adc7fd772be8ffff", "score": "0.5847798", "text": "func (t *Interface_Subinterface_Ipv6) AppendNeighbor(v *Interface_Subinterface_Ipv6_Neighbor) error {\n\tkey := *v.Ip\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\tif _, ok := t.Neighbor[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Neighbor %v\", key)\n\t}\n\n\tt.Neighbor[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "8ae4c15956d35f4489da1d294d925ad9", "score": "0.5847725", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) RenameNextHop(oldK, newK uint64) error {\n\tif _, ok := t.NextHop[newK]; ok {\n\t\treturn fmt.Errorf(\"key %v already exists in NextHop\", newK)\n\t}\n\n\te, ok := t.NextHop[oldK]\n\tif !ok {\n\t\treturn fmt.Errorf(\"key %v not found in NextHop\", oldK)\n\t}\n\te.Index = &newK\n\n\tt.NextHop[newK] = e\n\tdelete(t.NextHop, oldK)\n\treturn nil\n}", "title": "" }, { "docid": "8ae4c15956d35f4489da1d294d925ad9", "score": "0.5847725", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) RenameNextHop(oldK, newK uint64) error {\n\tif _, ok := t.NextHop[newK]; ok {\n\t\treturn fmt.Errorf(\"key %v already exists in NextHop\", newK)\n\t}\n\n\te, ok := t.NextHop[oldK]\n\tif !ok {\n\t\treturn fmt.Errorf(\"key %v not found in NextHop\", oldK)\n\t}\n\te.Index = &newK\n\n\tt.NextHop[newK] = e\n\tdelete(t.NextHop, oldK)\n\treturn nil\n}", "title": "" }, { "docid": "8ae4c15956d35f4489da1d294d925ad9", "score": "0.58465755", "text": "func (t *NetworkInstance_Afts_Ipv6Entry) RenameNextHop(oldK, newK uint64) error {\n\tif _, ok := t.NextHop[newK]; ok {\n\t\treturn fmt.Errorf(\"key %v already exists in NextHop\", newK)\n\t}\n\n\te, ok := t.NextHop[oldK]\n\tif !ok {\n\t\treturn fmt.Errorf(\"key %v not found in NextHop\", oldK)\n\t}\n\te.Index = &newK\n\n\tt.NextHop[newK] = e\n\tdelete(t.NextHop, oldK)\n\treturn nil\n}", "title": "" }, { "docid": "82161d711f9cd7875218b3493206824a", "score": "0.5830347", "text": "func (t *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv) AppendIpv6Srlg(v *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg) error {\n\tkey := *v.InstanceNumber\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Srlg == nil {\n\t\tt.Ipv6Srlg = make(map[uint32]*NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg)\n\t}\n\n\tif _, ok := t.Ipv6Srlg[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Srlg %v\", key)\n\t}\n\n\tt.Ipv6Srlg[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "82161d711f9cd7875218b3493206824a", "score": "0.58302975", "text": "func (t *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv) AppendIpv6Srlg(v *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg) error {\n\tkey := *v.InstanceNumber\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Srlg == nil {\n\t\tt.Ipv6Srlg = make(map[uint32]*NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg)\n\t}\n\n\tif _, ok := t.Ipv6Srlg[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Srlg %v\", key)\n\t}\n\n\tt.Ipv6Srlg[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "82161d711f9cd7875218b3493206824a", "score": "0.58292776", "text": "func (t *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv) AppendIpv6Srlg(v *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg) error {\n\tkey := *v.InstanceNumber\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Srlg == nil {\n\t\tt.Ipv6Srlg = make(map[uint32]*NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg)\n\t}\n\n\tif _, ok := t.Ipv6Srlg[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Srlg %v\", key)\n\t}\n\n\tt.Ipv6Srlg[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "82161d711f9cd7875218b3493206824a", "score": "0.58292776", "text": "func (t *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv) AppendIpv6Srlg(v *NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg) error {\n\tkey := *v.InstanceNumber\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Ipv6Srlg == nil {\n\t\tt.Ipv6Srlg = make(map[uint32]*NetworkInstance_Protocol_Isis_Level_Lsp_Tlv_Ipv6Srlg)\n\t}\n\n\tif _, ok := t.Ipv6Srlg[key]; ok {\n\t\treturn fmt.Errorf(\"duplicate key for list Ipv6Srlg %v\", key)\n\t}\n\n\tt.Ipv6Srlg[key] = v\n\treturn nil\n}", "title": "" }, { "docid": "6b09fe7e1b9a99e8f19b49cb11aa4398", "score": "0.5796346", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "6b09fe7e1b9a99e8f19b49cb11aa4398", "score": "0.5796346", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "6b09fe7e1b9a99e8f19b49cb11aa4398", "score": "0.5796346", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop) IsYANGGoStruct() {}", "title": "" }, { "docid": "21310aa3764e63eb9fbc6d1ec1f315d2", "score": "0.5787855", "text": "func (t *NetworkInstance_Afts_MacEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_MacEntry_NextHop {\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "96247f961f011aa740c41c1fad3f4043", "score": "0.57754886", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_PolicyForwardingEntry_NextHop {\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c0aa5f739a0eccafc56d1e1ea69bdb0", "score": "0.5768722", "text": "func (t *NetworkInstance_Afts_MacEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_MacEntry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4c0aa5f739a0eccafc56d1e1ea69bdb0", "score": "0.5768722", "text": "func (t *NetworkInstance_Afts_MacEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_MacEntry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "66ad6d4572c8643c7d18545a06d5fd18", "score": "0.5760941", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_PolicyForwardingEntry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "66ad6d4572c8643c7d18545a06d5fd18", "score": "0.5760941", "text": "func (t *NetworkInstance_Afts_PolicyForwardingEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_PolicyForwardingEntry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "547b890dc251774b5aa71760cff57930", "score": "0.57121646", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "547b890dc251774b5aa71760cff57930", "score": "0.57121646", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "547b890dc251774b5aa71760cff57930", "score": "0.57121646", "text": "func (*NetworkInstance_Afts_Ipv6Entry_NextHop_InterfaceRef) IsYANGGoStruct() {}", "title": "" }, { "docid": "e58fc21ec65274621229c28cac301cf2", "score": "0.566652", "text": "func (t *NetworkInstance_Afts_LabelEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_LabelEntry_NextHop {\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44a50fda670ae6d2c1c3a86a284bf730", "score": "0.56576717", "text": "func (t *NetworkInstance_Afts_LabelEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_LabelEntry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "44a50fda670ae6d2c1c3a86a284bf730", "score": "0.56576717", "text": "func (t *NetworkInstance_Afts_LabelEntry) GetNextHop(Index uint64) *NetworkInstance_Afts_LabelEntry_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "97bd431c01f608b418e704552c11b765", "score": "0.563074", "text": "func (lm *RouterOsListManager) AddIPV6AddressToList(address string, listName string) error {\n\tcommand := \"/ipv6/firewall/address-list/add\"\n\n\t_, err := lm.client.RunArgs([]string{\n\t\tcommand,\n\t\t\"=list=\" + listName,\n\t\t\"=address=\" + address,\n\t\t\"=comment=Generated\",\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b26c1ec8f2b2089b0fe2fb610be9fb33", "score": "0.56241465", "text": "func (t *NetworkInstance_Afts) GetNextHop(Index uint64) *NetworkInstance_Afts_NextHop {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := Index\n\n\tif lm, ok := t.NextHop[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "702b4ff8652058518a74e33d56982da0", "score": "0.5578885", "text": "func (t *NetworkInstance_Afts) NewNextHopGroup(Id uint64) (*NetworkInstance_Afts_NextHopGroup, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.NextHopGroup == nil {\n\t\tt.NextHopGroup = make(map[uint64]*NetworkInstance_Afts_NextHopGroup)\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.NextHopGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list NextHopGroup\", key)\n\t}\n\n\tt.NextHopGroup[key] = &NetworkInstance_Afts_NextHopGroup{\n\t\tId: &Id,\n\t}\n\n\treturn t.NextHopGroup[key], nil\n}", "title": "" } ]
a41172f2146f6a17fbc749b3210b17a6
Convert_v1alpha4_Metal3MachineSpec_To_v1alpha5_Metal3MachineSpec is an autogenerated conversion function.
[ { "docid": "ee00c2c766d220670bbdfa567b2f8f6b", "score": "0.8728545", "text": "func Convert_v1alpha4_Metal3MachineSpec_To_v1alpha5_Metal3MachineSpec(in *Metal3MachineSpec, out *v1alpha5.Metal3MachineSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineSpec_To_v1alpha5_Metal3MachineSpec(in, out, s)\n}", "title": "" } ]
[ { "docid": "e52d8a2eea405dbb65dde36964822bf5", "score": "0.8214824", "text": "func Convert_v1alpha4_Metal3MachineTemplateSpec_To_v1alpha5_Metal3MachineTemplateSpec(in *Metal3MachineTemplateSpec, out *v1alpha5.Metal3MachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineTemplateSpec_To_v1alpha5_Metal3MachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "bf0a0941c69d0fd3622979b32991d3d0", "score": "0.8068716", "text": "func Convert_v1alpha4_Metal3Machine_To_v1alpha5_Metal3Machine(in *Metal3Machine, out *v1alpha5.Metal3Machine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3Machine_To_v1alpha5_Metal3Machine(in, out, s)\n}", "title": "" }, { "docid": "33b577caacad40689349c49e83cdf9cc", "score": "0.7455064", "text": "func Convert_v1alpha5_Metal3MachineSpec_To_v1alpha4_Metal3MachineSpec(in *v1alpha5.Metal3MachineSpec, out *Metal3MachineSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineSpec_To_v1alpha4_Metal3MachineSpec(in, out, s)\n}", "title": "" }, { "docid": "d082fe1756b2061348cf09ee712cfb21", "score": "0.7255685", "text": "func Convert_v1alpha3_Metal3MachineSpec_To_v1alpha2_Metal3MachineSpec(in *v1alpha3.Metal3MachineSpec, out *Metal3MachineSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3MachineSpec_To_v1alpha2_Metal3MachineSpec(in, out, s)\n}", "title": "" }, { "docid": "440e6e63a8769dc06ff5c330cfdb76bd", "score": "0.7170578", "text": "func Convert_v1alpha2_Metal3MachineSpec_To_v1alpha3_Metal3MachineSpec(in *Metal3MachineSpec, out *v1alpha3.Metal3MachineSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3MachineSpec_To_v1alpha3_Metal3MachineSpec(in, out, s)\n}", "title": "" }, { "docid": "7df0ca8a2c038840df5c15dbe86b64e9", "score": "0.7030018", "text": "func Convert_v1alpha4_Metal3DataSpec_To_v1alpha5_Metal3DataSpec(in *Metal3DataSpec, out *v1alpha5.Metal3DataSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3DataSpec_To_v1alpha5_Metal3DataSpec(in, out, s)\n}", "title": "" }, { "docid": "da60e9d9fa578198afa7eb63f4129297", "score": "0.7016635", "text": "func Convert_v1alpha4_Metal3MachineTemplate_To_v1alpha5_Metal3MachineTemplate(in *Metal3MachineTemplate, out *v1alpha5.Metal3MachineTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineTemplate_To_v1alpha5_Metal3MachineTemplate(in, out, s)\n}", "title": "" }, { "docid": "a3110805a349c5701f492c1a6a136c58", "score": "0.6969512", "text": "func Convert_v1alpha3_Metal3MachineTemplateSpec_To_v1alpha2_Metal3MachineTemplateSpec(in *v1alpha3.Metal3MachineTemplateSpec, out *Metal3MachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3MachineTemplateSpec_To_v1alpha2_Metal3MachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "2d78f2c6d1dd5b3aeb826876be225b7a", "score": "0.69659615", "text": "func Convert_v1alpha5_Metal3MachineTemplateSpec_To_v1alpha4_Metal3MachineTemplateSpec(in *v1alpha5.Metal3MachineTemplateSpec, out *Metal3MachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineTemplateSpec_To_v1alpha4_Metal3MachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "a73804b3065e0a86d411dc08727b3e4a", "score": "0.69036037", "text": "func Convert_v1alpha4_Metal3MachineStatus_To_v1alpha5_Metal3MachineStatus(in *Metal3MachineStatus, out *v1alpha5.Metal3MachineStatus, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineStatus_To_v1alpha5_Metal3MachineStatus(in, out, s)\n}", "title": "" }, { "docid": "a35d15a5797a5130ec53e780b822b38b", "score": "0.6800477", "text": "func Convert_v1alpha2_Metal3MachineTemplateSpec_To_v1alpha3_Metal3MachineTemplateSpec(in *Metal3MachineTemplateSpec, out *v1alpha3.Metal3MachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3MachineTemplateSpec_To_v1alpha3_Metal3MachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "5d23bc202d30d3fba6a9d1aeeafc5b84", "score": "0.66627985", "text": "func Convert_v1alpha4_Metal3MachineTemplateResource_To_v1alpha5_Metal3MachineTemplateResource(in *Metal3MachineTemplateResource, out *v1alpha5.Metal3MachineTemplateResource, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineTemplateResource_To_v1alpha5_Metal3MachineTemplateResource(in, out, s)\n}", "title": "" }, { "docid": "0af478e17556adb7c96cbcdac52ed998", "score": "0.6636625", "text": "func Convert_v1alpha4_Metal3DataTemplateSpec_To_v1alpha5_Metal3DataTemplateSpec(in *Metal3DataTemplateSpec, out *v1alpha5.Metal3DataTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3DataTemplateSpec_To_v1alpha5_Metal3DataTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "23ae26cb7fe19fba1566f360b426a284", "score": "0.6615352", "text": "func Convert_v1alpha7_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec(in *v1alpha7.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "2f1c31feed7b6ddf01c49c15d52ea0a8", "score": "0.6538753", "text": "func Convert_v1alpha4_Metal3MachineList_To_v1alpha5_Metal3MachineList(in *Metal3MachineList, out *v1alpha5.Metal3MachineList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineList_To_v1alpha5_Metal3MachineList(in, out, s)\n}", "title": "" }, { "docid": "6ec33b0e22ac64673543551ae585f177", "score": "0.6518037", "text": "func Convert_v1alpha4_Metal3RemediationSpec_To_v1alpha5_Metal3RemediationSpec(in *Metal3RemediationSpec, out *v1alpha5.Metal3RemediationSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3RemediationSpec_To_v1alpha5_Metal3RemediationSpec(in, out, s)\n}", "title": "" }, { "docid": "4f328a13e8fb3b3c690cbedb13f6574d", "score": "0.649217", "text": "func Convert_v1alpha4_GCPMachineSpec_To_v1alpha3_GCPMachineSpec(in *v1alpha4.GCPMachineSpec, out *GCPMachineSpec, s apiconversion.Scope) error { // nolint\n\tif err := autoConvert_v1alpha4_GCPMachineSpec_To_v1alpha3_GCPMachineSpec(in, out, s); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5c82b382dbf493568a53b6a199b15a49", "score": "0.64618266", "text": "func Convert_v1alpha5_Metal3Machine_To_v1alpha4_Metal3Machine(in *v1alpha5.Metal3Machine, out *Metal3Machine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3Machine_To_v1alpha4_Metal3Machine(in, out, s)\n}", "title": "" }, { "docid": "ceb5701579ce8a8efdf887dfcfdc159c", "score": "0.64391935", "text": "func Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in *v1alpha7.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in, out, s)\n}", "title": "" }, { "docid": "1c6fd37fe526f03df14722ef39cd299c", "score": "0.6385811", "text": "func Convert_v1alpha3_Metal3Machine_To_v1alpha2_Metal3Machine(in *v1alpha3.Metal3Machine, out *Metal3Machine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3Machine_To_v1alpha2_Metal3Machine(in, out, s)\n}", "title": "" }, { "docid": "491e7e07eb991124603caf5c68725250", "score": "0.634742", "text": "func Convert_v1alpha4_Metal3ClusterSpec_To_v1alpha5_Metal3ClusterSpec(in *Metal3ClusterSpec, out *v1alpha5.Metal3ClusterSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3ClusterSpec_To_v1alpha5_Metal3ClusterSpec(in, out, s)\n}", "title": "" }, { "docid": "52af832f8718f46375b171b3ae118808", "score": "0.63409877", "text": "func Convert_v1alpha2_Metal3Machine_To_v1alpha3_Metal3Machine(in *Metal3Machine, out *v1alpha3.Metal3Machine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3Machine_To_v1alpha3_Metal3Machine(in, out, s)\n}", "title": "" }, { "docid": "ce1f894e3789ab3c3e99312e1d42816b", "score": "0.6209744", "text": "func Convert_v1alpha4_Metal3RemediationTemplateSpec_To_v1alpha5_Metal3RemediationTemplateSpec(in *Metal3RemediationTemplateSpec, out *v1alpha5.Metal3RemediationTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3RemediationTemplateSpec_To_v1alpha5_Metal3RemediationTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "d385fe89d3d4a80cc284b86c79dacf20", "score": "0.61941975", "text": "func Convert_v1alpha1_MachineSpec_To_machine_MachineSpec(in *MachineSpec, out *machine.MachineSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_MachineSpec_To_machine_MachineSpec(in, out, s)\n}", "title": "" }, { "docid": "fdc381bac55fa649d205713ab2f37ee9", "score": "0.6130409", "text": "func Convert_v1alpha4_Metal3MachineTemplateList_To_v1alpha5_Metal3MachineTemplateList(in *Metal3MachineTemplateList, out *v1alpha5.Metal3MachineTemplateList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3MachineTemplateList_To_v1alpha5_Metal3MachineTemplateList(in, out, s)\n}", "title": "" }, { "docid": "73ba2b481b828ab81391ccb02be5574f", "score": "0.598281", "text": "func Convert_v1alpha4_AzureMachineTemplateSpec_To_v1alpha3_AzureMachineTemplateSpec(in *v1alpha4.AzureMachineTemplateSpec, out *AzureMachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_AzureMachineTemplateSpec_To_v1alpha3_AzureMachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "73162374c7c21134fefd79da9a85c2bb", "score": "0.58587587", "text": "func Convert_v1alpha4_Metal3DataClaimSpec_To_v1alpha5_Metal3DataClaimSpec(in *Metal3DataClaimSpec, out *v1alpha5.Metal3DataClaimSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3DataClaimSpec_To_v1alpha5_Metal3DataClaimSpec(in, out, s)\n}", "title": "" }, { "docid": "f5d125eefc94631e92dadf4fa9b98013", "score": "0.57727164", "text": "func Convert_v1alpha4_Metal3Data_To_v1alpha5_Metal3Data(in *Metal3Data, out *v1alpha5.Metal3Data, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3Data_To_v1alpha5_Metal3Data(in, out, s)\n}", "title": "" }, { "docid": "35a12a06a7b97021e63268cfd7fd0c97", "score": "0.5761183", "text": "func Convert_v1alpha1_ClassSpec_To_machine_ClassSpec(in *ClassSpec, out *machine.ClassSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_ClassSpec_To_machine_ClassSpec(in, out, s)\n}", "title": "" }, { "docid": "c1584a729587f0dc9c46817cceade94d", "score": "0.5728034", "text": "func Convert_v1alpha4_GCPMachineTemplateSpec_To_v1alpha3_GCPMachineTemplateSpec(in *v1alpha4.GCPMachineTemplateSpec, out *GCPMachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_GCPMachineTemplateSpec_To_v1alpha3_GCPMachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "b7f5250e187045e403d7e8a1e66ce511", "score": "0.57203025", "text": "func Convert_v1alpha3_Metal3MachineTemplate_To_v1alpha2_Metal3MachineTemplate(in *v1alpha3.Metal3MachineTemplate, out *Metal3MachineTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3MachineTemplate_To_v1alpha2_Metal3MachineTemplate(in, out, s)\n}", "title": "" }, { "docid": "92efcad01b3b15e65e417d8384a76f6f", "score": "0.5707768", "text": "func Convert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(in *AWSMachineClassSpec, out *machine.AWSMachineClassSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(in, out, s)\n}", "title": "" }, { "docid": "b08be5f0b07f8c5ba475d76c1a18eed9", "score": "0.56020397", "text": "func (in *MachineSpec) DeepCopy() *MachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "cbabbbf66efaa21d5ae48d0d91cc47f7", "score": "0.55793905", "text": "func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachineHealthCheckSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "6f502bbdec3e0176c4aa7230d03218b9", "score": "0.5576582", "text": "func Convert_v1alpha2_Metal3MachineTemplate_To_v1alpha3_Metal3MachineTemplate(in *Metal3MachineTemplate, out *v1alpha3.Metal3MachineTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3MachineTemplate_To_v1alpha3_Metal3MachineTemplate(in, out, s)\n}", "title": "" }, { "docid": "fafd425f0ec5c99753e7eb08635fcd50", "score": "0.5564832", "text": "func Convert_v1alpha5_Metal3MachineTemplate_To_v1alpha4_Metal3MachineTemplate(in *v1alpha5.Metal3MachineTemplate, out *Metal3MachineTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineTemplate_To_v1alpha4_Metal3MachineTemplate(in, out, s)\n}", "title": "" }, { "docid": "ccd0880c617bc7fc961ffd8d0e99c686", "score": "0.5508123", "text": "func Convert_v1alpha7_OpenStackMachine_To_v1alpha5_OpenStackMachine(in *v1alpha7.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachine_To_v1alpha5_OpenStackMachine(in, out, s)\n}", "title": "" }, { "docid": "2606562b946b389eec60368705848644", "score": "0.5484712", "text": "func Convert_v1alpha1_MachineTemplateSpec_To_machine_MachineTemplateSpec(in *MachineTemplateSpec, out *machine.MachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_MachineTemplateSpec_To_machine_MachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "72ff6b25f3d3386d564307d896e1de91", "score": "0.5470204", "text": "func Convert_v1alpha5_OpenStackMachineTemplateSpec_To_v1alpha7_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1alpha7.OpenStackMachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_OpenStackMachineTemplateSpec_To_v1alpha7_OpenStackMachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "8101c8d8ce489b19ba0cd07ad68c5c89", "score": "0.5423267", "text": "func Convert_v1alpha4_Metal3DataTemplate_To_v1alpha5_Metal3DataTemplate(in *Metal3DataTemplate, out *v1alpha5.Metal3DataTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3DataTemplate_To_v1alpha5_Metal3DataTemplate(in, out, s)\n}", "title": "" }, { "docid": "b4a60034f6d38eddb4533795ce5fcbff", "score": "0.5392736", "text": "func (in *KubevirtMachineSpec) DeepCopy() *KubevirtMachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(KubevirtMachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "fbd5b0f4a7c7a4cf8eff979e8f0bf77f", "score": "0.53678536", "text": "func Convert_v1alpha7_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(in *v1alpha7.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(in, out, s)\n}", "title": "" }, { "docid": "d00d3c4ef77ee7ff05e6f0fa1b37834b", "score": "0.5308754", "text": "func Convert_v1alpha4_Metal3DataList_To_v1alpha5_Metal3DataList(in *Metal3DataList, out *v1alpha5.Metal3DataList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3DataList_To_v1alpha5_Metal3DataList(in, out, s)\n}", "title": "" }, { "docid": "22c67bcd00832a6c8c0b5218e660ae68", "score": "0.5270731", "text": "func Convert_v1alpha4_Metal3Remediation_To_v1alpha5_Metal3Remediation(in *Metal3Remediation, out *v1alpha5.Metal3Remediation, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3Remediation_To_v1alpha5_Metal3Remediation(in, out, s)\n}", "title": "" }, { "docid": "4bd8d7079f38e1dd0774713ebe91e337", "score": "0.5229166", "text": "func (in *ByoMachineSpec) DeepCopy() *ByoMachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ByoMachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "59d736d9f7fbf3e64cffe97813bf24e6", "score": "0.5226296", "text": "func (in *MachineConfigSpec) DeepCopy() *MachineConfigSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachineConfigSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "4bd705dc77ba4060e4e400f253d62230", "score": "0.51961964", "text": "func Convert_v1alpha4_Metal3Cluster_To_v1alpha5_Metal3Cluster(in *Metal3Cluster, out *v1alpha5.Metal3Cluster, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3Cluster_To_v1alpha5_Metal3Cluster(in, out, s)\n}", "title": "" }, { "docid": "1d5def84534a4564399ad81f26afb4ec", "score": "0.5190202", "text": "func Convert_machine_MachineSpec_To_v1alpha1_MachineSpec(in *machine.MachineSpec, out *MachineSpec, s conversion.Scope) error {\n\treturn autoConvert_machine_MachineSpec_To_v1alpha1_MachineSpec(in, out, s)\n}", "title": "" }, { "docid": "93fe5caedd16f1dfa76ddff2352ab639", "score": "0.5189849", "text": "func Convert_v1alpha5_Metal3DataSpec_To_v1alpha4_Metal3DataSpec(in *v1alpha5.Metal3DataSpec, out *Metal3DataSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3DataSpec_To_v1alpha4_Metal3DataSpec(in, out, s)\n}", "title": "" }, { "docid": "4d1c0e2fd2d135c84bbd277b0aec6e1f", "score": "0.51852167", "text": "func Convert_v1alpha5_Metal3MachineTemplateResource_To_v1alpha4_Metal3MachineTemplateResource(in *v1alpha5.Metal3MachineTemplateResource, out *Metal3MachineTemplateResource, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineTemplateResource_To_v1alpha4_Metal3MachineTemplateResource(in, out, s)\n}", "title": "" }, { "docid": "00f0ce74d120e8f1121d7c0eac9f455c", "score": "0.51691127", "text": "func Convert_v1alpha4_AzureMachine_To_v1alpha3_AzureMachine(in *v1alpha4.AzureMachine, out *AzureMachine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_AzureMachine_To_v1alpha3_AzureMachine(in, out, s)\n}", "title": "" }, { "docid": "189e6426c4b28ffd8d6d1538ec73afe6", "score": "0.5168841", "text": "func Convert_v1alpha3_Metal3MachineTemplateResource_To_v1alpha2_Metal3MachineTemplateResource(in *v1alpha3.Metal3MachineTemplateResource, out *Metal3MachineTemplateResource, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3MachineTemplateResource_To_v1alpha2_Metal3MachineTemplateResource(in, out, s)\n}", "title": "" }, { "docid": "dc374f3a5206e69c28455199bbfb4958", "score": "0.51643604", "text": "func Convert_v1alpha5_Metal3MachineStatus_To_v1alpha4_Metal3MachineStatus(in *v1alpha5.Metal3MachineStatus, out *Metal3MachineStatus, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineStatus_To_v1alpha4_Metal3MachineStatus(in, out, s)\n}", "title": "" }, { "docid": "41e131dd5e179935b416176389b612e9", "score": "0.51426536", "text": "func Convert_v1alpha3_Metal3MachineList_To_v1alpha2_Metal3MachineList(in *v1alpha3.Metal3MachineList, out *Metal3MachineList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3MachineList_To_v1alpha2_Metal3MachineList(in, out, s)\n}", "title": "" }, { "docid": "31c3a76a810fd213094da40f642d4ff2", "score": "0.51348114", "text": "func Convert_v1alpha1_Machine_To_machine_Machine(in *Machine, out *machine.Machine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_Machine_To_machine_Machine(in, out, s)\n}", "title": "" }, { "docid": "565badff298731da4674cc89be6a0c96", "score": "0.5134635", "text": "func (in *ByoMachineTemplateSpec) DeepCopy() *ByoMachineTemplateSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(ByoMachineTemplateSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "1d7ccafb2aa965ab46d2e9ae1d749c44", "score": "0.51100063", "text": "func Convert_v1alpha2_Metal3MachineTemplateResource_To_v1alpha3_Metal3MachineTemplateResource(in *Metal3MachineTemplateResource, out *v1alpha3.Metal3MachineTemplateResource, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3MachineTemplateResource_To_v1alpha3_Metal3MachineTemplateResource(in, out, s)\n}", "title": "" }, { "docid": "9185328e0a3d461fda75726f9500c034", "score": "0.5096629", "text": "func Convert_v1alpha2_Metal3MachineList_To_v1alpha3_Metal3MachineList(in *Metal3MachineList, out *v1alpha3.Metal3MachineList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3MachineList_To_v1alpha3_Metal3MachineList(in, out, s)\n}", "title": "" }, { "docid": "72290308718ac245dc2ea2a5c0465dd4", "score": "0.50860935", "text": "func (in *VirtulMachineSpec) DeepCopy() *VirtulMachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VirtulMachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "e3e7c8ac6719da1efa605130f190604d", "score": "0.50591326", "text": "func (in *InMemoryMachineSpec) DeepCopy() *InMemoryMachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(InMemoryMachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a09c81d687538f109f17196bbd97ddf8", "score": "0.5040089", "text": "func Convert_v1alpha4_Metal3RemediationTemplate_To_v1alpha5_Metal3RemediationTemplate(in *Metal3RemediationTemplate, out *v1alpha5.Metal3RemediationTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3RemediationTemplate_To_v1alpha5_Metal3RemediationTemplate(in, out, s)\n}", "title": "" }, { "docid": "582297bedd25b612d3eabe088609edea", "score": "0.5037297", "text": "func (in *InMemoryMachineTemplateSpec) DeepCopy() *InMemoryMachineTemplateSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(InMemoryMachineTemplateSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "178c7f87ffd6264de3b84777cf9110c6", "score": "0.49992287", "text": "func (in *KubevirtMachineTemplateSpec) DeepCopy() *KubevirtMachineTemplateSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(KubevirtMachineTemplateSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "ec61708aab72d091aa9e6bac938fe322", "score": "0.49980882", "text": "func (in *MachineSetHardwareSpec) DeepCopy() *MachineSetHardwareSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachineSetHardwareSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "f38d155dbf192e9b4af9bb443e37697e", "score": "0.49866185", "text": "func Convert_v1alpha3_AzureMachineTemplateSpec_To_v1alpha4_AzureMachineTemplateSpec(in *AzureMachineTemplateSpec, out *v1alpha4.AzureMachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_AzureMachineTemplateSpec_To_v1alpha4_AzureMachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "5f1d2c828a165ade367f0dd482cbe4a2", "score": "0.4956653", "text": "func MachineHealthCheckSpec() *MachineHealthCheckSpecApplyConfiguration {\n\treturn &MachineHealthCheckSpecApplyConfiguration{}\n}", "title": "" }, { "docid": "134d0e066b809de63a90b9f5504b7a48", "score": "0.4953586", "text": "func Convert_v1alpha3_Metal3MachineTemplateList_To_v1alpha2_Metal3MachineTemplateList(in *v1alpha3.Metal3MachineTemplateList, out *Metal3MachineTemplateList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_Metal3MachineTemplateList_To_v1alpha2_Metal3MachineTemplateList(in, out, s)\n}", "title": "" }, { "docid": "6bc045638bf2236bfb599ea49b792d6d", "score": "0.49526682", "text": "func Convert_v1alpha2_Metal3MachineTemplateList_To_v1alpha3_Metal3MachineTemplateList(in *Metal3MachineTemplateList, out *v1alpha3.Metal3MachineTemplateList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha2_Metal3MachineTemplateList_To_v1alpha3_Metal3MachineTemplateList(in, out, s)\n}", "title": "" }, { "docid": "41d304257c9d63b20a23f8d16d5270b0", "score": "0.49510345", "text": "func Convert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec(in *AWSNetworkInterfaceSpec, out *machine.AWSNetworkInterfaceSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec(in, out, s)\n}", "title": "" }, { "docid": "84e741fb463254cb6b043203163faf17", "score": "0.4940487", "text": "func Convert_v1alpha1_MachineDeploymentSpec_To_machine_MachineDeploymentSpec(in *MachineDeploymentSpec, out *machine.MachineDeploymentSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_MachineDeploymentSpec_To_machine_MachineDeploymentSpec(in, out, s)\n}", "title": "" }, { "docid": "88d1c2b006ee26852729ac3c1a15a5bd", "score": "0.4904418", "text": "func Convert_v1alpha1_MachineSetSpec_To_machine_MachineSetSpec(in *MachineSetSpec, out *machine.MachineSetSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_MachineSetSpec_To_machine_MachineSetSpec(in, out, s)\n}", "title": "" }, { "docid": "57f0b12d0ebc2175b00cf2c9eca0ca82", "score": "0.4893827", "text": "func Convert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(in *machine.AWSMachineClassSpec, out *AWSMachineClassSpec, s conversion.Scope) error {\n\treturn autoConvert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(in, out, s)\n}", "title": "" }, { "docid": "ea68e09a3943b4ff6b6974fd1d202877", "score": "0.4882779", "text": "func NewMachine(name string, tags Tags, initialTs uint64, expectedTimeseries int) *Machine {\n\treturn &Machine{name: name, tags: tags, lastTs: initialTs,\n\t\ttimeseries: make([]TimeSeries, 0, expectedTimeseries)}\n}", "title": "" }, { "docid": "46acbd1f8e352bf8dd9a834937bf2012", "score": "0.4873208", "text": "func Convert_v1alpha5_Metal3MachineList_To_v1alpha4_Metal3MachineList(in *v1alpha5.Metal3MachineList, out *Metal3MachineList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineList_To_v1alpha4_Metal3MachineList(in, out, s)\n}", "title": "" }, { "docid": "97d3fdf5fa7d3ee8ff3aad1872d0a2d4", "score": "0.48704842", "text": "func (in *VsphereMachineSpec) DeepCopy() *VsphereMachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(VsphereMachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "3dbe8d7a81babeea08adc5db7cb3b440", "score": "0.48460022", "text": "func Convert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec(in *AWSBlockDeviceMappingSpec, out *machine.AWSBlockDeviceMappingSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec(in, out, s)\n}", "title": "" }, { "docid": "fd3168269ec795678e324afa4eff36bf", "score": "0.4845371", "text": "func Convert_v1alpha5_Metal3DataTemplateSpec_To_v1alpha4_Metal3DataTemplateSpec(in *v1alpha5.Metal3DataTemplateSpec, out *Metal3DataTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3DataTemplateSpec_To_v1alpha4_Metal3DataTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "eae1b90a86a5ddce7603316326c524af", "score": "0.48428673", "text": "func Convert_v1alpha4_GCPMachine_To_v1alpha3_GCPMachine(in *v1alpha4.GCPMachine, out *GCPMachine, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_GCPMachine_To_v1alpha3_GCPMachine(in, out, s)\n}", "title": "" }, { "docid": "2f1d9e310cb605cb0a6aa76d6244f0d3", "score": "0.48391765", "text": "func (r *Resolver) MachineSpec() generated.MachineSpecResolver { return &machineSpecResolver{r} }", "title": "" }, { "docid": "55314a4aa6b3d6a1964d480bbde9ae2d", "score": "0.4825716", "text": "func (in *MachineSetSpec) DeepCopy() *MachineSetSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachineSetSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "881f6fd121dfab5d5101e51edc9368e5", "score": "0.48228785", "text": "func Convert_v1alpha7_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource(in *v1alpha7.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource(in, out, s)\n}", "title": "" }, { "docid": "611f184827f9651d595640cd13c07469", "score": "0.4798065", "text": "func Convert_v1alpha5_Metal3RemediationSpec_To_v1alpha4_Metal3RemediationSpec(in *v1alpha5.Metal3RemediationSpec, out *Metal3RemediationSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3RemediationSpec_To_v1alpha4_Metal3RemediationSpec(in, out, s)\n}", "title": "" }, { "docid": "2e148230e7f0bf7f53fb37569c35b2dc", "score": "0.47769007", "text": "func Convert_v1alpha4_Metal3DataStatus_To_v1alpha5_Metal3DataStatus(in *Metal3DataStatus, out *v1alpha5.Metal3DataStatus, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_Metal3DataStatus_To_v1alpha5_Metal3DataStatus(in, out, s)\n}", "title": "" }, { "docid": "66afd4a2abed09237db1fe32bb0a2843", "score": "0.47225568", "text": "func NewMachineActuator(params MachineActuatorParams) (*MachineActuator, error) {\n\tcodec, err := baremetalspecv1.NewCodec()\n\tif err != nil {\n\t\treturn nil, gerrors.Wrap(err, \"failed to create codec\")\n\t}\n\treturn &MachineActuator{\n\t\tclient: params.Client,\n\t\tclientSet: params.ClientSet,\n\t\tcodec: codec,\n\t\tcontrollerNamespace: params.ControllerNamespace,\n\t\teventRecorder: params.EventRecorder,\n\t\tverbose: params.Verbose,\n\t}, nil\n}", "title": "" }, { "docid": "b02a8e6373300b5130308f76dc04fe7f", "score": "0.4696026", "text": "func (in *AWSMachineSpec) DeepCopy() *AWSMachineSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AWSMachineSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "c915fdc306fd7760d52f94cfcff75fa5", "score": "0.4692247", "text": "func Convert_v1alpha4_AzureMachineTemplate_To_v1alpha3_AzureMachineTemplate(in *v1alpha4.AzureMachineTemplate, out *AzureMachineTemplate, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_AzureMachineTemplate_To_v1alpha3_AzureMachineTemplate(in, out, s)\n}", "title": "" }, { "docid": "82f82797964c26d547adf65072440e79", "score": "0.46893358", "text": "func Convert_v1alpha7_OpenStackMachineList_To_v1alpha5_OpenStackMachineList(in *v1alpha7.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachineList_To_v1alpha5_OpenStackMachineList(in, out, s)\n}", "title": "" }, { "docid": "49b3782bd366aa411eb7c22c6438aa6b", "score": "0.4664297", "text": "func Convert_v1alpha5_Metal3RemediationTemplateSpec_To_v1alpha4_Metal3RemediationTemplateSpec(in *v1alpha5.Metal3RemediationTemplateSpec, out *Metal3RemediationTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3RemediationTemplateSpec_To_v1alpha4_Metal3RemediationTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "b688ba8a7f3f450e5dc801aee2fa0299", "score": "0.46431392", "text": "func Convert_v1alpha5_Metal3MachineTemplateList_To_v1alpha4_Metal3MachineTemplateList(in *v1alpha5.Metal3MachineTemplateList, out *Metal3MachineTemplateList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha5_Metal3MachineTemplateList_To_v1alpha4_Metal3MachineTemplateList(in, out, s)\n}", "title": "" }, { "docid": "b7e20d26bff3ae7c24cbdd2dcb3de61c", "score": "0.46170408", "text": "func MachineSpecFromProviderSpec(providerSpec clusterv1.ProviderSpec) (*ExoscaleMachineProviderSpec, error) {\n\tconfig := new(ExoscaleMachineProviderSpec)\n\tif err := yaml.Unmarshal(providerSpec.Value.Raw, config); err != nil {\n\t\treturn nil, err\n\t}\n\treturn config, nil\n}", "title": "" }, { "docid": "42c255bac38f18cd546ff1d918701e92", "score": "0.46061638", "text": "func Convert_v1alpha3_GCPMachineTemplateSpec_To_v1alpha4_GCPMachineTemplateSpec(in *GCPMachineTemplateSpec, out *v1alpha4.GCPMachineTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_GCPMachineTemplateSpec_To_v1alpha4_GCPMachineTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "4d8341b7926998f6b3d75c896620f1f7", "score": "0.46049947", "text": "func (in *MachineSetManagedSpec) DeepCopy() *MachineSetManagedSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(MachineSetManagedSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "ee7274da0d3118d74f59896e294b5fca", "score": "0.45961612", "text": "func Convert_v1alpha1_NodeTemplateSpec_To_machine_NodeTemplateSpec(in *NodeTemplateSpec, out *machine.NodeTemplateSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_NodeTemplateSpec_To_machine_NodeTemplateSpec(in, out, s)\n}", "title": "" }, { "docid": "4f2821e66f6995e28c3b680f108cc697", "score": "0.45958468", "text": "func Convert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(in *AWSEbsBlockDeviceSpec, out *machine.AWSEbsBlockDeviceSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(in, out, s)\n}", "title": "" }, { "docid": "95569bc8c7a3a01b851df435edf4294a", "score": "0.45706007", "text": "func (in *AWSMachineTemplateSpec) DeepCopy() *AWSMachineTemplateSpec {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(AWSMachineTemplateSpec)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "c638e1d123ba7720d442b689fccb6e4e", "score": "0.4560788", "text": "func Convert_v1alpha3_AzureMachinePoolSpec_To_v1beta1_AzureMachinePoolSpec(in *AzureMachinePoolSpec, out *v1beta1.AzureMachinePoolSpec, s conversion.Scope) error {\n\treturn autoConvert_v1alpha3_AzureMachinePoolSpec_To_v1beta1_AzureMachinePoolSpec(in, out, s)\n}", "title": "" }, { "docid": "2ef4da71ddada463b45e4c90eb72af10", "score": "0.4559747", "text": "func Convert_v1alpha7_OpenStackMachineTemplateList_To_v1alpha5_OpenStackMachineTemplateList(in *v1alpha7.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error {\n\treturn autoConvert_v1alpha7_OpenStackMachineTemplateList_To_v1alpha5_OpenStackMachineTemplateList(in, out, s)\n}", "title": "" }, { "docid": "76b405e7b1fbf94eb86b1b30a9cdbd3b", "score": "0.45543823", "text": "func Convert_v1alpha1_MachineClass_To_machine_MachineClass(in *MachineClass, out *machine.MachineClass, s conversion.Scope) error {\n\treturn autoConvert_v1alpha1_MachineClass_To_machine_MachineClass(in, out, s)\n}", "title": "" }, { "docid": "e751e77bfa3e65a26a860926261b8054", "score": "0.45530677", "text": "func M5_8() meta.TimeSig {\n\treturn Meter(5, 8)\n}", "title": "" }, { "docid": "a43a6953069616d610122cce9a993d62", "score": "0.45525128", "text": "func Convert_v1alpha4_HostSelector_To_v1alpha5_HostSelector(in *HostSelector, out *v1alpha5.HostSelector, s conversion.Scope) error {\n\treturn autoConvert_v1alpha4_HostSelector_To_v1alpha5_HostSelector(in, out, s)\n}", "title": "" } ]
2984bc02f009c5d179ca4a96cfe1deaa
baseObjectThreadUnsafe omits locking for cachingObject.
[ { "docid": "091dd6d08cb695f1034236c99ecb9f3f", "score": "0.84117854", "text": "func baseObjectThreadUnsafe(object runtime.Object) runtime.Object {\n\tif co, ok := object.(*cachingObject); ok {\n\t\treturn co.object\n\t}\n\treturn object\n}", "title": "" } ]
[ { "docid": "cbe374d4e39e625ba7563a68331d05f5", "score": "0.6298905", "text": "func (*NoCopy) Lock() {}", "title": "" }, { "docid": "cbe374d4e39e625ba7563a68331d05f5", "score": "0.6298905", "text": "func (*NoCopy) Lock() {}", "title": "" }, { "docid": "cbe374d4e39e625ba7563a68331d05f5", "score": "0.6298905", "text": "func (*NoCopy) Lock() {}", "title": "" }, { "docid": "99b92baa3c2d4a336adee50c254ca6d4", "score": "0.6219218", "text": "func (*noCopy) Lock() {}", "title": "" }, { "docid": "99b92baa3c2d4a336adee50c254ca6d4", "score": "0.6219218", "text": "func (*noCopy) Lock() {}", "title": "" }, { "docid": "80d72d319ebc6f08f3a497af8f2124fa", "score": "0.608696", "text": "func (*noCopy) Lock() {}", "title": "" }, { "docid": "80d72d319ebc6f08f3a497af8f2124fa", "score": "0.608696", "text": "func (*noCopy) Lock() {}", "title": "" }, { "docid": "a60528d7eedcb27f39da8f4a1b230c2a", "score": "0.54541194", "text": "func (c *baseCache) Lock() {\n\tc.extLocker.Lock()\n}", "title": "" }, { "docid": "de1dd2828e4e3f725cdaff6a9995ae97", "score": "0.5168467", "text": "func (*NoCopy) Unlock() {}", "title": "" }, { "docid": "d13c5818d74b90f990d85174ac198f1b", "score": "0.51465285", "text": "func LockOSThread()", "title": "" }, { "docid": "6e911f47efa3775460942ebfc4ebcffc", "score": "0.51190686", "text": "func builtinLock(args []types.Datum, _ context.Context) (d types.Datum, err error) {\n\td.SetInt64(1)\n\treturn d, nil\n}", "title": "" }, { "docid": "843f2c256f5cc3fcdbfc4f63cfef0b00", "score": "0.50527877", "text": "func (t *watcherBookmarkTimeBuckets) addWatcherThreadUnsafe(w *cacheWatcher) bool {\n\t// note that the returned time can be before t.createTime,\n\t// especially in cases when the nextBookmarkTime method\n\t// give us the zero value of type Time\n\t// so buckedID can hold a negative value\n\tnextTime, ok := w.nextBookmarkTime(t.clock.Now(), t.bookmarkFrequency)\n\tif !ok {\n\t\treturn false\n\t}\n\tbucketID := int64(nextTime.Sub(t.createTime) / time.Second)\n\tif bucketID < t.startBucketID {\n\t\tbucketID = t.startBucketID\n\t}\n\twatchers := t.watchersBuckets[bucketID]\n\tt.watchersBuckets[bucketID] = append(watchers, w)\n\treturn true\n}", "title": "" }, { "docid": "6931b20e76f435bdd86b2a0c0adc671c", "score": "0.5012193", "text": "func (a *authority) refLocked() {\n\ta.refCount++\n}", "title": "" }, { "docid": "ca7d72eaac0318bb7d8af2e4b150b2d1", "score": "0.50008774", "text": "func builtinReleaseLock(args []types.Datum, _ context.Context) (d types.Datum, err error) {\n\td.SetInt64(1)\n\treturn d, nil\n}", "title": "" }, { "docid": "ef486c949116decbd42f36459935ae46", "score": "0.49374163", "text": "func (iter *Iterx) Unsafe() *Iterx {\n\titer.unsafe = true\n\treturn iter\n}", "title": "" }, { "docid": "fb8873aa14bac8c85e904d63111f7496", "score": "0.4926565", "text": "func (c *baseCache) Unlock() {\n\tc.extLocker.Unlock()\n}", "title": "" }, { "docid": "137454beb61073a9293dc403df163f38", "score": "0.48708805", "text": "func (instance *ResourceCache) unsafeReserveEntry(key string, timeout time.Duration) fail.Error {\n\treturn instance.byID.Reserve(key, timeout)\n}", "title": "" }, { "docid": "4c983d777f421ed8be7782e9ac4ff1a3", "score": "0.4839448", "text": "func safe2(x int) {\n\tunsafeAsync(&x)\n\tunsafeCallsAWriteViaPointerLabyrinth(&x)\n}", "title": "" }, { "docid": "f9dc0b03e221f444ada95d91d1b84acb", "score": "0.48260894", "text": "func (pool *Pool) doRemoveObject(objHash common.Hash) {\n\tif tx := pool.hashToTxMap[objHash]; tx != nil {\n\t\tpool.pendingQueue.remove(tx.FromAccount(), tx.Nonce())\n\t\tdelete(pool.processingObjects, objHash)\n\t\tdelete(pool.hashToTxMap, objHash)\n\t}\n}", "title": "" }, { "docid": "fa5f6c736691bf75c3e2ee0ebd6d6625", "score": "0.48193732", "text": "func IndirectSafe(obj interface{}) interface{} {\n\tif obj == nil {\n\t\treturn nil\n\t}\n\treturn reflect.Indirect(reflect.ValueOf(obj)).Interface()\n}", "title": "" }, { "docid": "da0cd66eb415c9be1a055135e268c3ed", "score": "0.48094517", "text": "func (agent *RemoteClusterAgent) syncInternalsFromStagedReferenceNoLock() error {\n\tusername, password, httpAuthMech, certificate, sanInCertificate, clientCertificate, clientKey, err := agent.pendingRef.MyCredentials()\n\tif err != nil {\n\t\treturn err\n\t}\n\tconnStr, err := agent.pendingRef.MyConnectionStr()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// use GetNodeListWithMinInfo API to ensure that it is supported by target cluster, which could be an elastic search cluster\n\tnodeList, err := agent.utils.GetNodeListWithMinInfo(connStr, username, password, httpAuthMech, certificate, sanInCertificate, clientCertificate, clientKey, agent.logger)\n\tif err == nil {\n\t\tagent.logger.Debugf(\"connStr=%v, nodeList=%v\\n\", connStr, nodeList)\n\n\t\tnodeNameList, err := agent.utils.GetRemoteNodeNameListFromNodeList(nodeList, connStr, agent.logger)\n\t\tif err != nil {\n\t\t\tagent.logger.Errorf(\"Error getting nodes from target cluster. skipping alternative node computation. ref=%v\\n\", agent.pendingRef.HostName)\n\t\t\tagent.pendingRefNodes = base.DeepCopyStringArray(agent.refNodesList)\n\t\t} else {\n\t\t\tagent.pendingRefNodes = make([]string, 0)\n\t\t\tfor _, nodeName := range nodeNameList {\n\t\t\t\tagent.pendingRefNodes = append(agent.pendingRefNodes, nodeName)\n\t\t\t}\n\t\t}\n\t\tagent.logger.Debugf(\"agent.pendingRefNodes after internal sync =%v\", agent.pendingRefNodes)\n\n\t} else {\n\t\tagent.logger.Infof(\"Remote cluster reference %v has a bad connectivity, didn't populate alternative connection strings. err=%v\", agent.pendingRef.Id, err)\n\t\terr = InvalidConnectionStrError\n\t\tagent.logger.Infof(\"nodes_connStrs from old cache =%v\", agent.refNodesList)\n\t\tagent.pendingRefNodes = base.DeepCopyStringArray(agent.refNodesList)\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "770b4c600e916bf05ba206e098cc16cc", "score": "0.48094463", "text": "func (e *Endpoint) unconditionalLock() {\n\te.mutex.Lock()\n}", "title": "" }, { "docid": "778fe40d4af9ce821253278cabdc8fe0", "score": "0.4796059", "text": "func (instance *ResourceCache) unsafeFreeEntry(key string) fail.Error {\n\treturn instance.byID.Free(key)\n}", "title": "" }, { "docid": "3f8785198e9e76f3b058d7851146803b", "score": "0.47958234", "text": "func (obj *Buffer) Lock(offset, bytes, flags uint32) (mem BufferMemory, err Error) {\n\tret, _, _ := syscall.Syscall9(\n\t\tobj.vtbl.Lock,\n\t\t8,\n\t\tuintptr(unsafe.Pointer(obj)),\n\t\tuintptr(offset),\n\t\tuintptr(bytes),\n\t\tuintptr(unsafe.Pointer(&mem.dataPtr1)),\n\t\tuintptr(unsafe.Pointer(&mem.byteCount1)),\n\t\tuintptr(unsafe.Pointer(&mem.dataPtr2)),\n\t\tuintptr(unsafe.Pointer(&mem.byteCount2)),\n\t\tuintptr(flags),\n\t\t0,\n\t)\n\terr = toErr(ret)\n\treturn\n}", "title": "" }, { "docid": "2790e57c397121c1604aa02a9d2f7e03", "score": "0.47820628", "text": "func InternalObject(i interface{}) Object {\n\treturn nil\n}", "title": "" }, { "docid": "f5c3c0c169de28afa8997fa51cf18a4c", "score": "0.47764653", "text": "func (e *Endpoint) unconditionalRLock() {\n\te.mutex.RLock()\n}", "title": "" }, { "docid": "8dbeec40cfe9a13452ece8036854eee7", "score": "0.47488737", "text": "func (mt *MutexTrack) lockTrack(wrappedLock interface{}, rwmt *RWMutexTrack) {\n\n\t// if lock tracking is disabled, just mark the lock as locked and clear\n\t// the last locked time. (Recording the current time using time.Now()\n\t// is too expensive, but we don't want this lock marked as held too long\n\t// if lock tracking is enabled while its locked.)\n\tif atomic.LoadInt64(&globals.lockHoldTimeLimit) == 0 {\n\t\tmt.lockTime = timeZero\n\t\tatomic.StoreInt32(&mt.lockCnt, -1)\n\t\treturn\n\t}\n\n\tmt.lockStack = stackTraceObjPool.Get().(*stackTraceObj)\n\tmt.lockStack.stackTrace = mt.lockStack.stackTraceBuf[:]\n\n\tcnt := runtime.Stack(mt.lockStack.stackTrace, false)\n\tmt.lockStack.stackTrace = mt.lockStack.stackTrace[0:cnt]\n\tmt.lockerGoId = utils.StackTraceToGoId(mt.lockStack.stackTrace)\n\tmt.lockTime = time.Now()\n\tatomic.StoreInt32(&mt.lockCnt, -1)\n\n\t// add to the list of watched mutexes if anybody is watching -- its only\n\t// at this point that we need to know if this a Mutex or RWMutex, and it\n\t// only happens when not currently watched\n\tif !mt.isWatched && atomic.LoadInt64(&globals.lockCheckPeriod) != 0 {\n\t\tglobals.mapMutex.Lock()\n\n\t\tif rwmt != nil {\n\t\t\tglobals.rwMutexMap[rwmt] = wrappedLock\n\t\t} else {\n\t\t\tglobals.mutexMap[mt] = wrappedLock\n\t\t}\n\t\tglobals.mapMutex.Unlock()\n\t\tmt.isWatched = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "c90ad1f0c7d7c3d1dbd3b0a9665e6d90", "score": "0.47282463", "text": "func GetObjMemCache(c context.Context, key string, v interface{}) error {\r\n\t_, err := memcache.Gob.Get(c, key, v)\t\r\n\treturn err\r\n}", "title": "" }, { "docid": "f9821d3fd5ad6f9a1f1fa55197a1050d", "score": "0.4723589", "text": "func (dict *AsyncStrDict) SetUnsafe(key, value string) {\n\tdict.pool[dict.getSeek()].set(key, value)\n}", "title": "" }, { "docid": "8bf2e2dafedce53a6ba0d206914234ac", "score": "0.47185677", "text": "func runtime_doSpin()", "title": "" }, { "docid": "22793bb4e3ae2e7de78ab38077afabca", "score": "0.47127038", "text": "func globalLock(c coordinable) {\n\tc.Coordinate().sem.Lock()\n}", "title": "" }, { "docid": "bd0785ab243f21f9324d67bc029e20bd", "score": "0.46575454", "text": "func FetchViaObjectProxyCache(r *http.Request) ([]byte, *http.Response, bool) {\n\tw := bytes.NewBuffer(nil)\n\tresp, cacheStatus := fetchViaObjectProxyCache(w, r)\n\tif cacheStatus == status.LookupStatusProxyOnly {\n\t\tresp = DoProxy(w, r)\n\t}\n\treturn w.Bytes(), resp, cacheStatus == status.LookupStatusHit\n}", "title": "" }, { "docid": "6ebf9b5db222b68da1901b4dffcf3b69", "score": "0.46381092", "text": "func (AppSession) RLock() {}", "title": "" }, { "docid": "3aa8164195bb76675cc52115a11aca50", "score": "0.46333158", "text": "func BenchmarkWithSyncPool(b *testing.B) {\n\tfor i := 0; i < b.N; i++ {\n\t\tobj := bytePool.Get().(*[]byte)\n\t\t_ = obj\n\t\tbytePool.Put(obj)\n\t}\n}", "title": "" }, { "docid": "ad0995adb6dd4b41c504934a9cb77164", "score": "0.4632219", "text": "func (object Object) FreezeNotify() {\n\tC.g_object_freeze_notify(object.native())\n}", "title": "" }, { "docid": "a51b933bf2186da33e3d758fdd7f79d9", "score": "0.46291518", "text": "func (rc *rejectionCache) Lock() {\n\tif rc != nil {\n\t\trc.mtx.Lock()\n\t}\n}", "title": "" }, { "docid": "b0cd3ed3965a857d6eaf058f3616b0ab", "score": "0.46198577", "text": "func (m *packetEndpointListRWMutex) RLockBypass() {\n\tm.mu.RLock()\n}", "title": "" }, { "docid": "ff486238b27f97229147c3f25edb7a8f", "score": "0.4618124", "text": "func (mp *Mempool) Lock() {\n\tmp.proxyMtx.Lock()\n}", "title": "" }, { "docid": "4b77a7b024e6541bcda4b65b631785db", "score": "0.46151266", "text": "func ObjectProxyCacheRequest(w http.ResponseWriter, r *http.Request) {\n\t_, cacheStatus := fetchViaObjectProxyCache(w, r)\n\tif cacheStatus == status.LookupStatusProxyOnly {\n\t\tDoProxy(w, r)\n\t}\n}", "title": "" }, { "docid": "7a611cd2baa42cbf3aebe9584c8a7492", "score": "0.46129158", "text": "func (obj *AbstractChannel) ExceptionLock() {\n\tobj.exceptionLock.Lock()\n}", "title": "" }, { "docid": "80d66e07738fe040586d245870c600f5", "score": "0.45969206", "text": "func unsafe_getObject(frame *rtda.Frame) {\n\n\tlocals := frame.LocalVars()\n\topStack := frame.OpStack()\n\tobj := locals.GetRef(1)\n\toffset := locals.GetLong(2)\n\n\tif obj.GetKlass().IsArray() {\n\t\t// [I arr[i]=\n\t\trefs := obj.GetRefTable()\n\t\topStack.PushRef(refs[offset])\n\n\t} else {\n\t\t// object.int\n\t\tfields := obj.GetFields()\n\t\tref := fields.GetRef(uint(offset))\n\t\topStack.PushRef(ref)\n\t}\n}", "title": "" }, { "docid": "8b630bb1f9854b64bc6ccdde680f4e15", "score": "0.45745194", "text": "func (reg *ServingRangeRegistry) Lock() {\n\treg.registryAccessLock.RLock()\n}", "title": "" }, { "docid": "10f1b2cff9fef677937e53b675b44cdc", "score": "0.45601282", "text": "func (e *Endpoint) runlock() {\n\te.mutex.RUnlock()\n}", "title": "" }, { "docid": "2010ed07488b65a812259aefbc231c50", "score": "0.45549023", "text": "func (o *Mutex) Lock() {\n\t//log.Println(\"Calling _Mutex.Lock()\")\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(\"_Mutex\", \"lock\")\n\n\t// Call the parent method.\n\t// void\n\tretPtr := gdnative.NewEmptyVoid()\n\tgdnative.MethodBindPtrCall(methodBind, o.GetBaseObject(), ptrArguments, retPtr)\n\n}", "title": "" }, { "docid": "6f6812053e4157f90f8bfaef437ce64f", "score": "0.45474505", "text": "func directGet(c *Cache, req reqGet) {\n\te, ok := c.entries[req.id]\n\tif !ok {\n\t\tgo handleCacheMiss(c, req)\n\t\treturn\n\t}\n\treq.reply <- replyGet{e.payload, nil}\n\tclose(req.reply)\n\tif e.younger == nil {\n\t\t// I'm already the fresh kid on the block\n\t\treturn\n\t}\n\t// Put element at the start of the LRU list\n\tif e.older != nil {\n\t\te.older.younger = e.younger // the only reason this is a *D*LL\n\t} else {\n\t\t// pfew! just in time... c.leastRU is the pointer of death\n\t\tc.leastRU = e.younger // (ok and this)\n\t}\n\t// some pointer mumbo jumbo\n\te.younger.older = e.older\n\te.older = c.mostRU // my elder is whoever used to be youngest\n\tc.mostRU = e // I'm the newest one now!\n\te.younger = nil // nobody's younger than me\n\te.older.younger = e // eeeeee\n\treturn\n}", "title": "" }, { "docid": "e4c922be867f051949633097942902c2", "score": "0.45459446", "text": "func (pd protectedDictionary) Protect() Object {\n\treturn pd\n}", "title": "" }, { "docid": "491ddde974450e8ad82fb84b6156c48f", "score": "0.45421642", "text": "func (s *TestSuiteCommon) TestObjectGet(c *check) {\n\t// generate a random bucket name.\n\tbucketName := getRandomBucketName()\n\tbuffer := bytes.NewReader([]byte(\"hello world\"))\n\t// HTTP request to create the bucket.\n\trequest, err := newTestSignedRequest(\"PUT\", getMakeBucketURL(s.endPoint, bucketName),\n\t\t0, nil, s.accessKey, s.secretKey, s.signer)\n\tc.Assert(err, nil)\n\n\tclient := http.Client{Transport: s.transport}\n\t// execute the make bucket http request.\n\tresponse, err := client.Do(request)\n\tc.Assert(err, nil)\n\t// assert the response http status code.\n\tc.Assert(response.StatusCode, http.StatusOK)\n\n\tobjectName := \"testObject\"\n\t// create HTTP request to upload the object.\n\trequest, err = newTestSignedRequest(\"PUT\", getPutObjectURL(s.endPoint, bucketName, objectName),\n\t\tint64(buffer.Len()), buffer, s.accessKey, s.secretKey, s.signer)\n\tc.Assert(err, nil)\n\n\tclient = http.Client{Transport: s.transport}\n\t// execute the HTTP request to upload the object.\n\tresponse, err = client.Do(request)\n\tc.Assert(err, nil)\n\t// assert the HTTP response status code.\n\tc.Assert(response.StatusCode, http.StatusOK)\n\t// concurrently reading the object, safety check for races.\n\tvar wg sync.WaitGroup\n\tfor i := 0; i < testConcurrencyLevel; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\t// HTTP request to create the bucket.\n\t\t\t// create HTTP request to fetch the object.\n\t\t\tgetRequest, err := newTestSignedRequest(\"GET\", getGetObjectURL(s.endPoint, bucketName, objectName),\n\t\t\t\t0, nil, s.accessKey, s.secretKey, s.signer)\n\t\t\tc.Assert(err, nil)\n\n\t\t\treqClient := http.Client{Transport: s.transport}\n\t\t\t// execute the http request to fetch the object.\n\t\t\tgetResponse, err := reqClient.Do(getRequest)\n\t\t\tc.Assert(err, nil)\n\t\t\tdefer getResponse.Body.Close()\n\t\t\t// assert the http response status code.\n\t\t\tc.Assert(getResponse.StatusCode, http.StatusOK)\n\n\t\t\t// extract response body content.\n\t\t\tresponseBody, err := ioutil.ReadAll(getResponse.Body)\n\t\t\tc.Assert(err, nil)\n\t\t\t// assert the HTTP response body content with the expected content.\n\t\t\tc.Assert(responseBody, []byte(\"hello world\"))\n\t\t}()\n\n\t}\n\twg.Wait()\n}", "title": "" }, { "docid": "9c20509f5124438e3aad04a7c6374a7d", "score": "0.4529899", "text": "func copyObjectData(value reflect.Value, memory []byte) {\n\taddr := ObjectAddress(value)\n\tsize := ObjectSize(value)\n\tobjectData := ByteSliceFromUnsafePointer(addr, size, size)\n\tcopy(memory, objectData)\n\tUse(addr)\n}", "title": "" }, { "docid": "94bf50a2df9fde3c33df9ed0960fa231", "score": "0.4529361", "text": "func (c *lru) putInternal(key interface{}, value interface{}, allowUpdate bool) (interface{}, error) {\n\tif c.maxSize == 0 {\n\t\treturn nil, nil\n\t}\n\tnewEntrySize := getSize(value)\n\tif newEntrySize > c.maxSize {\n\t\treturn nil, ErrCacheItemTooLarge\n\t}\n\n\tc.mut.Lock()\n\tdefer c.mut.Unlock()\n\n\telt := c.byKey[key]\n\t// If the entry exists, check if it has expired or update the value\n\tif elt != nil {\n\t\texistingEntry := elt.Value.(*entryImpl)\n\t\tif !c.isEntryExpired(existingEntry, time.Now().UTC()) {\n\t\t\texistingVal := existingEntry.value\n\t\t\tif allowUpdate {\n\t\t\t\tnewCacheSize := c.calculateNewCacheSize(newEntrySize, existingEntry.Size())\n\t\t\t\tif newCacheSize > c.maxSize {\n\t\t\t\t\tc.tryEvictUntilEnoughSpaceWithSkipEntry(newEntrySize, existingEntry)\n\t\t\t\t\t// calculate again after eviction\n\t\t\t\t\tnewCacheSize = c.calculateNewCacheSize(newEntrySize, existingEntry.Size())\n\t\t\t\t\tif newCacheSize > c.maxSize {\n\t\t\t\t\t\t// This should never happen since allowUpdate is always **true** for non-pinned cache,\n\t\t\t\t\t\t// and if all entries are not pinned(ref==0), then the cache should never be full as long as\n\t\t\t\t\t\t// new entry's size is less than max size.\n\t\t\t\t\t\t// However, to prevent any unexpected behavior, it checks the cache size again.\n\t\t\t\t\t\treturn nil, ErrCacheFull\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\texistingEntry.value = value\n\t\t\t\texistingEntry.size = newEntrySize\n\t\t\t\tc.currSize = newCacheSize\n\t\t\t\tc.updateEntryTTL(existingEntry)\n\t\t\t}\n\n\t\t\tc.updateEntryRefCount(existingEntry)\n\t\t\tc.byAccess.MoveToFront(elt)\n\t\t\treturn existingVal, nil\n\t\t}\n\n\t\t// Entry has expired\n\t\tc.deleteInternal(elt)\n\t}\n\n\tc.tryEvictUntilEnoughSpaceWithSkipEntry(newEntrySize, nil)\n\n\t// check if the new entry can fit in the cache\n\tnewCacheSize := c.calculateNewCacheSize(newEntrySize, emptyEntrySize)\n\tif newCacheSize > c.maxSize {\n\t\treturn nil, ErrCacheFull\n\t}\n\n\tentry := &entryImpl{\n\t\tkey: key,\n\t\tvalue: value,\n\t\tsize: newEntrySize,\n\t}\n\n\tc.updateEntryTTL(entry)\n\tc.updateEntryRefCount(entry)\n\telement := c.byAccess.PushFront(entry)\n\tc.byKey[key] = element\n\tc.currSize = newCacheSize\n\treturn nil, nil\n}", "title": "" }, { "docid": "4da3daa6a1266b7d878f4592b3297be1", "score": "0.45237792", "text": "func (ipc *IPCache) Lock() {\n\tipc.mutex.Lock()\n}", "title": "" }, { "docid": "562d0b0f40bfe93e90c029006ddd6563", "score": "0.45181248", "text": "func DoSomeLocking(l *sync.RWMutex) {\n\tl.Lock()\n\tl.Unlock()\n\tl.RLock()\n\tl.RLock()\n\tl.RUnlock()\n\tl.RUnlock()\n}", "title": "" }, { "docid": "92cf420625c5f23bf0842e4a15e712ad", "score": "0.4516988", "text": "func (this *BasicCache) PutItem() {\n\tthis.lock.Lock()\n\toldest := this.itemShare[0]\n\tthis.itemShare = this.itemShare[1:]\n\tthis.lock.Unlock()\n\tthis.itemPool.Put(oldest)\n}", "title": "" }, { "docid": "d0dbcb4cda86c297df6964ee8d29d536", "score": "0.45097533", "text": "func (l *Lock) createLockObject(ctx context.Context, goroutineID uint64) (*storage.ObjectHandle, error) {\n\tobject := l.bucket.\n\t\tObject(l.config.Path).\n\t\tIf(storage.Conditions{DoesNotExist: true})\n\twriter := object.NewWriter(ctx)\n\twriter.ObjectAttrs.CacheControl = \"no-store\"\n\twriter.ObjectAttrs.Metadata = map[string]string{\n\t\t\"expires_at\": l.ttlTimestampString(),\n\t\t\"identity\": l.identity(goroutineID),\n\t}\n\n\terr := writer.Close()\n\tif err != nil {\n\t\tgerr, isGoogleAPIError := err.(*googleapi.Error)\n\t\tif isGoogleAPIError && gerr.Code == 412 {\n\t\t\treturn nil, nil\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\treturn object, nil\n\t}\n}", "title": "" }, { "docid": "00639c87ab1a425c233c691a858810bc", "score": "0.45059577", "text": "func (b *bucket) newReaderLocked(\n\treq *gcs.ReadObjectRequest) (r io.Reader, index int, err error) {\n\t// Find the object with the requested name.\n\tindex = b.objects.find(req.Name)\n\tif index == len(b.objects) {\n\t\terr = &gcs.NotFoundError{\n\t\t\tErr: fmt.Errorf(\"Object %s not found\", req.Name),\n\t\t}\n\n\t\treturn\n\t}\n\n\to := b.objects[index]\n\n\t// Does the generation match?\n\tif req.Generation != 0 && req.Generation != o.metadata.Generation {\n\t\terr = &gcs.NotFoundError{\n\t\t\tErr: fmt.Errorf(\n\t\t\t\t\"Object %s generation %v not found\", req.Name, req.Generation),\n\t\t}\n\n\t\treturn\n\t}\n\n\t// Extract the requested range.\n\tresult := o.data\n\n\tif req.Range != nil {\n\t\tstart := req.Range.Start\n\t\tlimit := req.Range.Limit\n\t\tl := uint64(len(result))\n\n\t\tif start > limit {\n\t\t\tstart = 0\n\t\t\tlimit = 0\n\t\t}\n\n\t\tif start > l {\n\t\t\tstart = 0\n\t\t\tlimit = 0\n\t\t}\n\n\t\tif limit > l {\n\t\t\tlimit = l\n\t\t}\n\n\t\tresult = result[start:limit]\n\t}\n\n\tr = bytes.NewReader(result)\n\n\treturn\n}", "title": "" }, { "docid": "d9946dd8c4db989c108b084a667e315f", "score": "0.45050907", "text": "func ( c atomicCastCall ) castAtomicUnrestricted() ( mg.Value, error ) {\n if _, ok := c.val().( *mg.Null ); ok {\n if c.at.Equals( mg.TypeNull ) { return c.val(), nil }\n return nil, newNullInputError( c.ve.GetPath() )\n }\n switch nm := c.at.Name(); {\n case nm.Equals( mg.QnameValue ): return c.val(), nil\n case nm.Equals( mg.QnameBoolean ): return c.castBoolean()\n case nm.Equals( mg.QnameBuffer ): return c.castBuffer()\n case nm.Equals( mg.QnameString ): return c.castString()\n case nm.Equals( mg.QnameInt32 ): return c.castInt32()\n case nm.Equals( mg.QnameInt64 ): return c.castInt64()\n case nm.Equals( mg.QnameUint32 ): return c.castUint32()\n case nm.Equals( mg.QnameUint64 ): return c.castUint64()\n case nm.Equals( mg.QnameFloat32 ): return c.castFloat32()\n case nm.Equals( mg.QnameFloat64 ): return c.castFloat64()\n case nm.Equals( mg.QnameTimestamp ): return c.castTimestamp()\n case nm.Equals( mg.QnameSymbolMap ): return c.castSymbolMap()\n }\n return nil, c.newTypeInputErrorValue()\n}", "title": "" }, { "docid": "12eaaa0a32c9cb54d585b64ce0117200", "score": "0.4492752", "text": "func directSet(c *Cache, req reqSet) {\n\t// Overwrite old entry\n\tif old, ok := c.entries[req.id]; ok {\n\t\tsafeOnPurge(old.payload, KEYCOLLISION)\n\t\tremoveEntry(c, old)\n\t}\n\te := cacheEntry{payload: req.payload, id: req.id}\n\tc.entries[req.id] = &e\n\tsize := getSize(e.payload)\n\tif size == 0 {\n\t\treturn\n\t}\n\tif c.leastRU == nil { // aka \"if this is the first entry...\"\n\t\t// init DLL\n\t\tc.leastRU = &e\n\t\tc.mostRU = &e\n\t\te.younger = nil\n\t\te.older = nil\n\t} else {\n\t\t// e is younger than the old \"most recently used\"\n\t\tc.mostRU.younger = &e\n\t\te.older = c.mostRU\n\t\tc.mostRU = &e\n\t}\n\tc.size += size\n\ttrimCache(c)\n\treturn\n}", "title": "" }, { "docid": "11cbbb93905903cf07c890074ee75329", "score": "0.44896463", "text": "func init() {\n\truntime.LockOSThread()\n}", "title": "" }, { "docid": "11cbbb93905903cf07c890074ee75329", "score": "0.44896463", "text": "func init() {\n\truntime.LockOSThread()\n}", "title": "" }, { "docid": "11cbbb93905903cf07c890074ee75329", "score": "0.44896463", "text": "func init() {\n\truntime.LockOSThread()\n}", "title": "" }, { "docid": "57b25bf1ef66b99fd54163a7304f0139", "score": "0.44872034", "text": "func (m *mutex) Lock() {\n\tq := url.Values{\n\t\t\"name\": {m.object},\n\t\t\"uploadType\": {\"media\"},\n\t\t\"ifGenerationMatch\": {\"0\"},\n\t}\n\turl := fmt.Sprintf(\"%s/b/%s/o?%s\", storageLockURL, m.bucket, q.Encode())\n\tfor i := 1; ; i *= 2 {\n\t\tres, err := m.client.Post(url, \"plain/text\", bytes.NewReader([]byte(\"1\")))\n\t\tif err == nil {\n\t\t\tres.Body.Close()\n\t\t\tif res.StatusCode == 200 {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ttime.Sleep(time.Duration(i) * time.Millisecond)\n\t}\n}", "title": "" }, { "docid": "abc822c3178a4381de24bbc670be99fe", "score": "0.44840816", "text": "func Freeze() { atomic.StoreInt32(&frozen, 1) }", "title": "" }, { "docid": "7f18512a110d8f3f358811aaecebfaeb", "score": "0.44818094", "text": "func (in *InMem) putLocked(key proto.EncodedKey, value []byte) error {\n\tif len(key) == 0 {\n\t\treturn emptyKeyError()\n\t}\n\tkv := proto.RawKeyValue{Key: key, Value: value}\n\tsize := computeSize(kv)\n\t// If the key already exists, compute the size change of the\n\t// replacement with the new value.\n\tif val := in.data.Get(proto.RawKeyValue{Key: key}); val != nil {\n\t\tsize -= computeSize(val.(proto.RawKeyValue))\n\t}\n\n\tif size > in.maxBytes-in.usedBytes {\n\t\treturn util.Errorf(\"in mem store at capacity %d + %d > %d\", in.usedBytes, size, in.maxBytes)\n\t}\n\tin.usedBytes += size\n\tin.data.Insert(kv)\n\treturn nil\n}", "title": "" }, { "docid": "93caef31adc69be8e59e3e424f6c34e9", "score": "0.44730103", "text": "func (ac *AuthCache) synchronize() {\n\t// if none of our internal reflectors changed, then we can skip reviewing the cache\n\tskip, currentState := ac.skip.SkipSynchronize(ac.lastState, ac.lastSyncResourceVersioner, ac.policyLastSyncResourceVersioner)\n\tif skip {\n\t\treturn\n\t}\n\n\t// by default, we update our current caches and do an incremental change\n\tuserSubjectRecordStore := ac.userSubjectRecordStore\n\tgroupSubjectRecordStore := ac.groupSubjectRecordStore\n\treviewRecordStore := ac.reviewRecordStore\n\n\t// iterate over caches and synchronize our three caches\n\tnewKnownNames := ac.syncResources(userSubjectRecordStore, groupSubjectRecordStore, reviewRecordStore)\n\tac.synchronizeClusterRoleBindings(userSubjectRecordStore, groupSubjectRecordStore, reviewRecordStore)\n\tac.purgeDeletedResources(ac.allKnownNames, newKnownNames, userSubjectRecordStore, groupSubjectRecordStore, reviewRecordStore)\n\n\tac.allKnownNames = newKnownNames\n\n\t// we were able to update our cache since this last observation period\n\tac.lastState = currentState\n}", "title": "" }, { "docid": "8f46745a1d1bfa9d760146a54bc38b41", "score": "0.446531", "text": "func newSafeBuffer() *safeBuffer {\n\treturn newSafeBufferWithSize(defaultBufferSize)\n}", "title": "" }, { "docid": "c66a8b51c82da2e61a338ad071cff45b", "score": "0.44593328", "text": "func (s *secret) release() error {\n\ts.rw.Lock()\n\tdefer s.rw.Unlock()\n\tdefer s.c.Broadcast()\n\n\ts.accessCounter--\n\t// Only set no access if we're the last one trying to access this potentially-shared Secret\n\tif s.accessCounter == 0 {\n\t\tif err := s.mc.Protect(s.buffer.Inner(), memcall.NoAccess()); err != nil {\n\t\t\t// Shouldn't happen but return the err if it does\n\t\t\treturn errors.WithMessage(err, \"unable to mark memory as no-access\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "773f211a45eaa18b913643a1ab55ba58", "score": "0.44550863", "text": "func (m *ObjectEntriesMap) RLock(key string) {\n\tmu, _ := m.entriesRWMutexMap.LoadOrStore(key, &sync.RWMutex{})\n\tmu.(*sync.RWMutex).RLock()\n}", "title": "" }, { "docid": "498db583e60ff5450568a04fba771138", "score": "0.4452123", "text": "func main() {\n\tpool := &sync.Pool{\n\t\tNew: func() interface{} {\n\t\t\tfmt.Println(\"creating new object\")\n\t\t\treturn struct{}{}\n\t\t},\n\t}\n\t// this will invoke New\n\tpool.Get()\n\n\t// this will invoke New\n\tobj := pool.Get()\n\tpool.Put(obj)\n\n\t// this will not invoke the New func\n\tpool.Get()\n}", "title": "" }, { "docid": "2199757a9cf8b2490a4d0f0f11909229", "score": "0.44462928", "text": "func (i *ArrayIter) ValueUnsafe() Value {\n\treturn i.di.ValueUnsafe()\n}", "title": "" }, { "docid": "2afd0edc9da5f72ec4eaff3f14f43684", "score": "0.44424498", "text": "func (l *Liveness) updateLocked() {\n\tl.m.Update(l.getLocked())\n}", "title": "" }, { "docid": "bdd15fbe331eca6aa95160526541f098", "score": "0.44404182", "text": "func selfSpeedTest(ctx context.Context, opts speedTestOpts) (SpeedTestResult, error) {\n\tobjAPI := newObjectLayerFn()\n\tif objAPI == nil {\n\t\treturn SpeedTestResult{}, errServerNotInitialized\n\t}\n\n\tvar wg sync.WaitGroup\n\tvar errOnce sync.Once\n\tvar retError string\n\tvar totalBytesWritten uint64\n\tvar totalBytesRead uint64\n\n\tobjCountPerThread := make([]uint64, opts.concurrency)\n\n\tuploadsCtx, uploadsCancel := context.WithCancel(context.Background())\n\tdefer uploadsCancel()\n\n\tgo func() {\n\t\ttime.Sleep(opts.duration)\n\t\tuploadsCancel()\n\t}()\n\n\tobjNamePrefix := pathJoin(speedTest, mustGetUUID())\n\n\tuserMetadata := make(map[string]string)\n\tuserMetadata[globalObjectPerfUserMetadata] = \"true\" // Bypass S3 API freeze\n\tpopts := minio.PutObjectOptions{\n\t\tUserMetadata: userMetadata,\n\t\tDisableContentSha256: true,\n\t\tDisableMultipart: true,\n\t}\n\n\tvar mu sync.Mutex\n\tvar uploadTimes madmin.TimeDurations\n\twg.Add(opts.concurrency)\n\tfor i := 0; i < opts.concurrency; i++ {\n\t\tgo func(i int) {\n\t\t\tdefer wg.Done()\n\t\t\tfor {\n\t\t\t\tt := time.Now()\n\t\t\t\treader := newRandomReader(opts.objectSize)\n\t\t\t\ttmpObjName := pathJoin(objNamePrefix, fmt.Sprintf(\"%d/%d\", i, objCountPerThread[i]))\n\t\t\t\tinfo, err := globalMinioClient.PutObject(uploadsCtx, opts.bucketName, tmpObjName, reader, int64(opts.objectSize), popts)\n\t\t\t\tif err != nil {\n\t\t\t\t\tif !contextCanceled(uploadsCtx) && !errors.Is(err, context.Canceled) {\n\t\t\t\t\t\terrOnce.Do(func() {\n\t\t\t\t\t\t\tretError = err.Error()\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tuploadsCancel()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tresponse := time.Since(t)\n\t\t\t\tatomic.AddUint64(&totalBytesWritten, uint64(info.Size))\n\t\t\t\tobjCountPerThread[i]++\n\t\t\t\tmu.Lock()\n\t\t\t\tuploadTimes = append(uploadTimes, response)\n\t\t\t\tmu.Unlock()\n\t\t\t}\n\t\t}(i)\n\t}\n\twg.Wait()\n\n\t// We already saw write failures, no need to proceed into read's\n\tif retError != \"\" {\n\t\treturn SpeedTestResult{\n\t\t\tUploads: totalBytesWritten,\n\t\t\tDownloads: totalBytesRead,\n\t\t\tUploadTimes: uploadTimes,\n\t\t\tError: retError,\n\t\t}, nil\n\t}\n\n\tdownloadsCtx, downloadsCancel := context.WithCancel(context.Background())\n\tdefer downloadsCancel()\n\tgo func() {\n\t\ttime.Sleep(opts.duration)\n\t\tdownloadsCancel()\n\t}()\n\n\tgopts := minio.GetObjectOptions{}\n\tgopts.Set(globalObjectPerfUserMetadata, \"true\") // Bypass S3 API freeze\n\n\tvar downloadTimes madmin.TimeDurations\n\tvar downloadTTFB madmin.TimeDurations\n\twg.Add(opts.concurrency)\n\tfor i := 0; i < opts.concurrency; i++ {\n\t\tgo func(i int) {\n\t\t\tdefer wg.Done()\n\t\t\tvar j uint64\n\t\t\tif objCountPerThread[i] == 0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor {\n\t\t\t\tif objCountPerThread[i] == j {\n\t\t\t\t\tj = 0\n\t\t\t\t}\n\t\t\t\ttmpObjName := pathJoin(objNamePrefix, fmt.Sprintf(\"%d/%d\", i, j))\n\t\t\t\tt := time.Now()\n\t\t\t\tr, err := globalMinioClient.GetObject(downloadsCtx, opts.bucketName, tmpObjName, gopts)\n\t\t\t\tif err != nil {\n\t\t\t\t\terrResp, ok := err.(minio.ErrorResponse)\n\t\t\t\t\tif ok && errResp.StatusCode == http.StatusNotFound {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif !contextCanceled(downloadsCtx) && !errors.Is(err, context.Canceled) {\n\t\t\t\t\t\terrOnce.Do(func() {\n\t\t\t\t\t\t\tretError = err.Error()\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tdownloadsCancel()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfbr := firstByteRecorder{\n\t\t\t\t\tr: r,\n\t\t\t\t}\n\t\t\t\tn, err := io.Copy(io.Discard, &fbr)\n\t\t\t\tr.Close()\n\t\t\t\tif err == nil {\n\t\t\t\t\tresponse := time.Since(t)\n\t\t\t\t\tttfb := time.Since(*fbr.t)\n\t\t\t\t\t// Only capture success criteria - do not\n\t\t\t\t\t// have to capture failed reads, truncated\n\t\t\t\t\t// reads etc.\n\t\t\t\t\tatomic.AddUint64(&totalBytesRead, uint64(n))\n\t\t\t\t\tmu.Lock()\n\t\t\t\t\tdownloadTimes = append(downloadTimes, response)\n\t\t\t\t\tdownloadTTFB = append(downloadTTFB, ttfb)\n\t\t\t\t\tmu.Unlock()\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\tif !contextCanceled(downloadsCtx) && !errors.Is(err, context.Canceled) {\n\t\t\t\t\t\terrOnce.Do(func() {\n\t\t\t\t\t\t\tretError = err.Error()\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tdownloadsCancel()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tj++\n\t\t\t}\n\t\t}(i)\n\t}\n\twg.Wait()\n\n\treturn SpeedTestResult{\n\t\tUploads: totalBytesWritten,\n\t\tDownloads: totalBytesRead,\n\t\tUploadTimes: uploadTimes,\n\t\tDownloadTimes: downloadTimes,\n\t\tDownloadTTFB: downloadTTFB,\n\t\tError: retError,\n\t}, nil\n}", "title": "" }, { "docid": "0ff7bc3e93a28ba1d1ace3a2de41bc34", "score": "0.4425928", "text": "func (s *sdkGrpcServer) rwlockIntercepter(\n\tctx context.Context,\n\treq interface{},\n\tinfo *grpc.UnaryServerInfo,\n\thandler grpc.UnaryHandler,\n) (interface{}, error) {\n\ts.lock.RLock()\n\tdefer s.lock.RUnlock()\n\n\treturn handler(ctx, req)\n}", "title": "" }, { "docid": "0f106608eb1f9c462122cf72eab6cf16", "score": "0.44158795", "text": "func (p *Proxy) syncCanaryRelease(obj interface{}) error {\n\n\t// type assertion\n\tcr, ok := obj.(*releaseapi.CanaryRelease)\n\tif !ok {\n\t\treturn fmt.Errorf(\"expect canary release, got:%v\", obj)\n\t}\n\n\t// get obj key\n\tkey, _ := cache.DeletionHandlingMetaNamespaceKeyFunc(cr)\n\n\t// record time\n\tstartTime := time.Now()\n\tdefer func() {\n\t\tlog.Debug(\"Finished syncing canary release\", log.Fields{\"cr\": key, \"usedTime\": time.Since(startTime)})\n\t}()\n\n\t// find obj in local store\n\tncr, err := p.crLister.CanaryReleases(cr.Namespace).Get(cr.Name)\n\tif errors.IsNotFound(err) {\n\t\tlog.Warn(\"CanaryRelease has been deleted, clean up\", log.Fields{\"cr\": key})\n\t\treturn p.cleanup(cr)\n\t}\n\tif err != nil {\n\t\tutilruntime.HandleError(fmt.Errorf(\"Unable to retrieve CanaryRelease %v from store: %v\", key, err))\n\t\treturn err\n\t}\n\n\t// fresh cr\n\tif cr.UID != ncr.UID {\n\t\t// original canary release is gone\n\t\treturn nil\n\t}\n\n\tif ncr.DeletionTimestamp != nil {\n\t\treturn nil\n\t}\n\n\t// deep copy\n\tcr = ncr.DeepCopy()\n\n\tif cr.Spec.Transition != releaseapi.CanaryTrasitionNone {\n\t\tlog.Info(\"detected a adopted/deprecated Cananry Release, cleanup it\", log.Fields{\"cr\": key})\n\t\treturn p.cleanup(cr)\n\t}\n\n\t// find related release\n\trelease, err := p.rLister.Releases(cr.Namespace).Get(cr.Spec.Release)\n\tif errors.IsNotFound(err) {\n\t\t// if release has been deleted, deprecate this canary release\n\t\tlog.Info(\"Release has been deleted, deprecate this CanaryRelease\", log.Fields{\"cr\": key})\n\t\treturn p.deprecate(cr)\n\t}\n\n\tif err != nil {\n\t\tutilruntime.HandleError(fmt.Errorf(\"Unable to retrieve Release %v from store: %v\", key, err))\n\t\treturn err\n\t}\n\n\t// if release.version != canary.version, deprecate it\n\tif release.Status.Version != cr.Spec.Version {\n\t\tlog.Info(\"Release.Version != CanaryRelease.Version deprecate this CanaryRelease\", log.Fields{\"release.version\": release.Status.Version, \"canary.version\": cr.Spec.Version})\n\t\treturn p.deprecate(cr)\n\t}\n\n\treturn p.sync(cr, release)\n}", "title": "" }, { "docid": "198ad23ad2b682294d695ba93dd74e92", "score": "0.4409805", "text": "func (r *Replica) maybeUpdateCachedProtectedTS(ts *cachedProtectedTimestampState) {\n\tif *ts == (cachedProtectedTimestampState{}) {\n\t\treturn\n\t}\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tif r.mu.cachedProtectedTS.readAt.Less(ts.readAt) {\n\t\tr.mu.cachedProtectedTS = *ts\n\t}\n}", "title": "" }, { "docid": "0e32a183faf71abb389d9cbcc6ea434a", "score": "0.44022062", "text": "func (o *Object) Update() {\n\to.mut.Lock()\n\to.checked = false\n\to.mut.Unlock()\n}", "title": "" }, { "docid": "9006dd1490553943df35bcf9615d6313", "score": "0.43974736", "text": "func TestRWLockAcquireAndReleaseLocksReadBlocksWriteNoRaceDetection(t *testing.T) {\n\tskipRWLockTestIfRaceDetectionEnabled(t)\n\n\tcode := `\n require 'concurrent/rw_lock'\n\n lock = Concurrent::RWLock.new\n message = nil\n\n thread do\n lock.acquire_read_lock\n sleep 2\n message ||= \"thread 1\"\n lock.release_read_lock\n end\n\n thread do\n sleep 1\n lock.acquire_write_lock\n message ||= \"thread 2\"\n lock.release_write_lock\n end\n\n sleep 3\n lock.with_read_lock do\n message\n end\n `\n\n\texpected := \"thread 1\"\n\n\tv := initTestVM()\n\tevaluated := v.testEval(t, code, getFilename())\n\tverifyStringObject(t, i, evaluated, expected)\n\tv.checkCFP(t, i, 0)\n\tv.checkSP(t, i, 1)\n}", "title": "" }, { "docid": "97d2b482e231b3f95eee2d692c6bc5eb", "score": "0.43932483", "text": "func checkCopyObjectPreconditions(ctx context.Context, w http.ResponseWriter, r *http.Request, objInfo ObjectInfo, encETag string) bool {\n\t// Return false for methods other than GET and HEAD.\n\tif r.Method != http.MethodPut {\n\t\treturn false\n\t}\n\tif encETag == \"\" {\n\t\tencETag = objInfo.ETag\n\t}\n\t// If the object doesn't have a modtime (IsZero), or the modtime\n\t// is obviously garbage (Unix time == 0), then ignore modtimes\n\t// and don't process the If-Modified-Since header.\n\tif objInfo.ModTime.IsZero() || objInfo.ModTime.Equal(time.Unix(0, 0)) {\n\t\treturn false\n\t}\n\n\t// Headers to be set of object content is not going to be written to the client.\n\twriteHeaders := func() {\n\t\t// set common headers\n\t\tsetCommonHeaders(w)\n\n\t\t// set object-related metadata headers\n\t\tw.Header().Set(xhttp.LastModified, objInfo.ModTime.UTC().Format(http.TimeFormat))\n\n\t\tif objInfo.ETag != \"\" {\n\t\t\tw.Header()[xhttp.ETag] = []string{\"\\\"\" + objInfo.ETag + \"\\\"\"}\n\t\t}\n\t}\n\t// x-amz-copy-source-if-modified-since: Return the object only if it has been modified\n\t// since the specified time otherwise return 412 (precondition failed).\n\tifModifiedSinceHeader := r.Header.Get(xhttp.AmzCopySourceIfModifiedSince)\n\tif ifModifiedSinceHeader != \"\" {\n\t\tif givenTime, err := time.Parse(http.TimeFormat, ifModifiedSinceHeader); err == nil {\n\t\t\tif !ifModifiedSince(objInfo.ModTime, givenTime) {\n\t\t\t\t// If the object is not modified since the specified time.\n\t\t\t\twriteHeaders()\n\t\t\t\twriteErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPreconditionFailed), r.URL, guessIsBrowserReq(r))\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\t// x-amz-copy-source-if-unmodified-since : Return the object only if it has not been\n\t// modified since the specified time, otherwise return a 412 (precondition failed).\n\tifUnmodifiedSinceHeader := r.Header.Get(xhttp.AmzCopySourceIfUnmodifiedSince)\n\tif ifUnmodifiedSinceHeader != \"\" {\n\t\tif givenTime, err := time.Parse(http.TimeFormat, ifUnmodifiedSinceHeader); err == nil {\n\t\t\tif ifModifiedSince(objInfo.ModTime, givenTime) {\n\t\t\t\t// If the object is modified since the specified time.\n\t\t\t\twriteHeaders()\n\t\t\t\twriteErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPreconditionFailed), r.URL, guessIsBrowserReq(r))\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\tshouldDecryptEtag := crypto.SSECopy.IsRequested(r.Header) && !crypto.IsMultiPart(objInfo.UserDefined)\n\n\t// x-amz-copy-source-if-match : Return the object only if its entity tag (ETag) is the\n\t// same as the one specified; otherwise return a 412 (precondition failed).\n\tifMatchETagHeader := r.Header.Get(xhttp.AmzCopySourceIfMatch)\n\tif ifMatchETagHeader != \"\" {\n\t\tetag := objInfo.ETag\n\t\tif shouldDecryptEtag {\n\t\t\tetag = encETag[len(encETag)-32:]\n\t\t}\n\t\tif objInfo.ETag != \"\" && !isETagEqual(etag, ifMatchETagHeader) {\n\t\t\t// If the object ETag does not match with the specified ETag.\n\t\t\twriteHeaders()\n\t\t\twriteErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPreconditionFailed), r.URL, guessIsBrowserReq(r))\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// If-None-Match : Return the object only if its entity tag (ETag) is different from the\n\t// one specified otherwise, return a 304 (not modified).\n\tifNoneMatchETagHeader := r.Header.Get(xhttp.AmzCopySourceIfNoneMatch)\n\tif ifNoneMatchETagHeader != \"\" {\n\t\tetag := objInfo.ETag\n\t\tif shouldDecryptEtag {\n\t\t\tetag = encETag[len(encETag)-32:]\n\t\t}\n\t\tif objInfo.ETag != \"\" && isETagEqual(etag, ifNoneMatchETagHeader) {\n\t\t\t// If the object ETag matches with the specified ETag.\n\t\t\twriteHeaders()\n\t\t\twriteErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPreconditionFailed), r.URL, guessIsBrowserReq(r))\n\t\t\treturn true\n\t\t}\n\t}\n\t// Object content should be written to http.ResponseWriter\n\treturn false\n}", "title": "" }, { "docid": "ca60142cd32024561f7c0405733dd8d7", "score": "0.4391564", "text": "func (b *basicCache) update(operation func()) {\n\tb.updateLock.Lock()\n\tdefer b.updateLock.Unlock()\n\toperation()\n}", "title": "" }, { "docid": "771924199a4d11b81d698add6135241e", "score": "0.43865559", "text": "func (m *consistentHeapStats) unsafeRead(out *heapStatsDelta) {\n\tassertWorldStopped()\n\n\tfor i := range m.stats {\n\t\tout.merge(&m.stats[i])\n\t}\n}", "title": "" }, { "docid": "12a421a98c841fdd3aa773f2888a659e", "score": "0.43834087", "text": "func (image *Image) LockUse() error {\n return image.Lock(1)\n}", "title": "" }, { "docid": "a6d5730fb7da41004b4ea3f73d77a069", "score": "0.43739936", "text": "func (s *StatusSyncer) GetObject() interface{} { return nil }", "title": "" }, { "docid": "6fba04d1237b997e0172e01b7d42aed5", "score": "0.4366395", "text": "func newUnsafeHashTable(estCount int) *unsafeHashTable {\n\tht := new(unsafeHashTable)\n\tht.hashMap = make(map[uint64]*entry, estCount)\n\tht.entryStore = newEntryStore()\n\treturn ht\n}", "title": "" }, { "docid": "d1b840f506c8a9a600fdde8c3f133c75", "score": "0.43648586", "text": "func (objSrv *ObjectServer) releaseSpaceWithLock(size uint64) bool {\n\tif objSrv.cachedBytes+objSrv.downloadingBytes+size <=\n\t\tobjSrv.maxCachedBytes {\n\t\treturn true\n\t}\n\tif objSrv.cachedBytes-objSrv.lruBytes+objSrv.downloadingBytes+size >\n\t\tobjSrv.maxCachedBytes {\n\t\treturn false // No amount of deleting unused objects will help.\n\t}\n\tfor objSrv.oldest != nil {\n\t\tfilename := filepath.Join(objSrv.baseDir,\n\t\t\tobjectcache.HashToFilename(objSrv.oldest.hash))\n\t\tif err := os.Remove(filename); err != nil {\n\t\t\tobjSrv.logger.Println(err)\n\t\t\treturn false\n\t\t}\n\t\tobjSrv.removeFromLruWithLock(objSrv.oldest)\n\t\tobjSrv.cachedBytes -= objSrv.oldest.size\n\t\tif objSrv.cachedBytes+objSrv.downloadingBytes+size <=\n\t\t\tobjSrv.maxCachedBytes {\n\t\t\treturn true\n\t\t}\n\t}\n\tpanic(\"not enough space despite freeing unused objects\")\n}", "title": "" }, { "docid": "6338422ead4d97246724399d19160c59", "score": "0.43616515", "text": "func Protect() {\r\n\r\n\tprocess, err := syscall.GetCurrentProcess()\r\n\r\n\tif err != nil {\r\n\t\treturn\r\n\t}\r\n\r\n\tntSetInformationProcess.Call(uintptr(process), 29, 1, 4)\r\n\r\n}", "title": "" }, { "docid": "4f936ef620cd655ab74230c2680f8dbb", "score": "0.43602416", "text": "func MustWrap(store storage.BatchedStore, capacity int) *Cache {\n\tc, err := Wrap(store, capacity)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn c\n}", "title": "" }, { "docid": "702c0f32a4f1417ccb9afeec29d592fc", "score": "0.4360175", "text": "func (n *M) tryLockInternal(key string) (func(), chan bool) {\n\tn.masterMu.Lock()\n\tdefer n.masterMu.Unlock()\n\n\tif tryAgain, open := n.locks[key]; open {\n\t\treturn nil, tryAgain\n\t}\n\n\tunlocked := make(chan bool)\n\tn.locks[key] = unlocked\n\n\treturn func() {\n\t\tn.masterMu.Lock()\n\t\tdefer n.masterMu.Unlock()\n\n\t\tdelete(n.locks, key)\n\t\tclose(unlocked)\n\t}, nil\n}", "title": "" }, { "docid": "f4c6c6f8eec92c3caaca29ee2056c099", "score": "0.435548", "text": "func (worker *Worker) Lock() {\n\tworker.store.Lock()\n}", "title": "" }, { "docid": "46aa85605de88dc27893a41dfa435b45", "score": "0.43509918", "text": "func (rwmt *RWMutexTrack) lockTrack(wrappedLock interface{}) {\n\trwmt.tracker.lockTrack(wrappedLock, rwmt)\n}", "title": "" }, { "docid": "c4cbc376d7214b9bc864bc807ed02d06", "score": "0.43508005", "text": "func (m *ObjectEntriesMap) Lock(key string) {\n\tmu, _ := m.entriesRWMutexMap.LoadOrStore(key, &sync.RWMutex{})\n\tmu.(*sync.RWMutex).Lock()\n}", "title": "" }, { "docid": "3e2db1b1868725215dd50ebe797c0306", "score": "0.43493623", "text": "func (rwmt *RWMutexTrack) rLockTrack(wrappedLock interface{}) {\n\n\t// if lock tracking is disabled, just mark the lock as locked and clear\n\t// the last locked time. (Recording the current time using time.Now()\n\t// is too expensive, but we don't want this lock marked as held too long\n\t// if lock tracking is enabled while its locked.)\n\tif atomic.LoadInt64(&globals.lockHoldTimeLimit) == 0 {\n\t\trwmt.sharedStateLock.Lock()\n\t\tatomic.AddInt32(&rwmt.tracker.lockCnt, 1)\n\t\trwmt.tracker.lockTime = timeZero\n\t\trwmt.sharedStateLock.Unlock()\n\n\t\treturn\n\t}\n\n\t// get the stack trace and goId before getting the shared state lock to\n\t// cut down on lock contention\n\tlockStack := stackTraceObjPool.Get().(*stackTraceObj)\n\tlockStack.stackTrace = lockStack.stackTraceBuf[:]\n\n\tcnt := runtime.Stack(lockStack.stackTrace, false)\n\tlockStack.stackTrace = lockStack.stackTrace[0:cnt]\n\tgoId := utils.StackTraceToGoId(lockStack.stackTrace)\n\n\t// The lock is held as a reader (shared mode) so no goroutine can have\n\t// it locked exclusive. Holding rwmt.sharedStateLock is sufficient to\n\t// insure that no other goroutine is changing rwmt.tracker.lockCnt.\n\trwmt.sharedStateLock.Lock()\n\n\tif rwmt.rLockStack == nil {\n\t\trwmt.rLockStack = make(map[uint64]*stackTraceObj)\n\t\trwmt.rLockTime = make(map[uint64]time.Time)\n\t}\n\trwmt.tracker.lockTime = time.Now()\n\trwmt.rLockTime[goId] = rwmt.tracker.lockTime\n\trwmt.rLockStack[goId] = lockStack\n\tatomic.AddInt32(&rwmt.tracker.lockCnt, 1)\n\n\t// add to the list of watched mutexes if anybody is watching\n\tif !rwmt.tracker.isWatched && atomic.LoadInt64(&globals.lockCheckPeriod) != 0 {\n\n\t\tglobals.mapMutex.Lock()\n\t\tglobals.rwMutexMap[rwmt] = wrappedLock\n\t\tglobals.mapMutex.Unlock()\n\t\trwmt.tracker.isWatched = true\n\t}\n\trwmt.sharedStateLock.Unlock()\n\n\treturn\n}", "title": "" }, { "docid": "a895e60ff9c6b193be79efa1aca2e3f8", "score": "0.43491235", "text": "func (this *DynamicBucket) getBucket() (*Bucket) {\n this.lock.RLock(); defer this.lock.RUnlock()\n return this.bucket\n}", "title": "" }, { "docid": "7b3490f9b31f912a736b9f4bc8fcc2d4", "score": "0.43478742", "text": "func (index *invertedIndex) withLock() (release func()) {\n\tindex.rwMutex.RLock()\n\n\treturn index.rwMutex.RUnlock\n}", "title": "" }, { "docid": "0c0d5d7e0065db23d61e829adb596502", "score": "0.43389773", "text": "func (o *OnlineAPI) GetSafe(uuid string) (safe OnlineGetSafe, err error) {\n\t// TODO: enable to use the name instead of only the UUID\n\tvar (\n\t\tok bool\n\t)\n\n\tif safe, ok = o.cache.GetSafe(uuid); ok {\n\t\treturn\n\t}\n\tif err = o.getWrapper(fmt.Sprintf(\"%s/storage/c14/safe/%s\", APIUrl, uuid), &safe); err != nil {\n\t\terr = errors.Annotate(err, \"GetSafe\")\n\t\treturn\n\t}\n\to.cache.InsertSafe(safe.UUIDRef, safe)\n\treturn\n}", "title": "" }, { "docid": "ab832a3d6a94a9606b049f72812b41a8", "score": "0.43324235", "text": "func (c *twoLevelClient) Get(key string, obj interface{}) error {\n\terr := c.inMemoryCache.Get(key, obj)\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\terr = c.externalCache.Get(key, obj)\n\tif err == nil {\n\t\t_ = c.inMemoryCache.Set(&Item{Key: key, Object: obj})\n\t}\n\treturn err\n}", "title": "" }, { "docid": "496631359a55e67e037c70e7e98a4da5", "score": "0.43270287", "text": "func runtime_Semacquire(s *uint32)", "title": "" }, { "docid": "9a9ca5dd1beefb4f5f52c2ed9c723ae3", "score": "0.43227798", "text": "func (obj *ConnectionPoolImpl) AdminLock() {\n\tobj.adminLock.RLock()\n}", "title": "" }, { "docid": "fcde05b465d0a1748c09a5051a9410c6", "score": "0.4320751", "text": "func (mset *stream) subscribeInternalUnlocked(subject string, cb msgHandler) (*subscription, error) {\n\tmset.mu.Lock()\n\tdefer mset.mu.Unlock()\n\treturn mset.subscribeInternal(subject, cb)\n}", "title": "" }, { "docid": "9394b44df0a47aff13e6b5cd78d94383", "score": "0.43096706", "text": "func drainRWMutex() {}", "title": "" }, { "docid": "98363e3b220e2e04d49b2b89db432e25", "score": "0.43080083", "text": "func test() {\n\t// Obtain a new mutex by using the same name for all instances wanting the\n\t// same lock.\n\tmutexname := \"my-global-mutex\"\n\tmutex := rlock.NewMutex(mutexname)\n\n\t// Obtain a lock for our given mutex. After this is successful, no one else\n\t// can obtain the same lock (the same mutex name) until we unlock it.\n\tif err := mutex.Lock(); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Do your work that requires the lock.\n\n\t// Release the lock so other processes or threads can obtain a lock.\n\tif ok, err := mutex.Unlock(); !ok || err != nil {\n\t\tpanic(\"unlock failed\")\n\t}\n}", "title": "" }, { "docid": "c5ac0768a3cd27c125f023bf2f867970", "score": "0.43027988", "text": "func (r *DynamoNodePutRecords) WLock() {\n\tr.mu.Lock()\n}", "title": "" }, { "docid": "33f214e36a1a11ef3f93833de1d674c8", "score": "0.42977548", "text": "func (image *Image) LockManage() error {\n return image.Lock(2)\n}", "title": "" } ]
a8de36a849079644a3fa9c4fd948d231
RegisterUtilHandlerServer registers the http handlers for service Util to "mux". UnaryRPC :call UtilServer directly. StreamingRPC :currently unsupported pending Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUtilHandlerFromEndpoint instead.
[ { "docid": "8c3becce11fec2df0d7f22cf59bdf205", "score": "0.79005814", "text": "func RegisterUtilHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UtilServer) error {\n\tmux.Handle(\"GET\", pattern_Util_CheckStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/gunk.example.v1.Util/CheckStatus\", runtime.WithHTTPPathPattern(\"/v1/status\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Util_CheckStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Util_CheckStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_Util_Echo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/gunk.example.v1.Util/Echo\", runtime.WithHTTPPathPattern(\"/v1/echo\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Util_Echo_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Util_Echo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_Util_Echo_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/gunk.example.v1.Util/Echo\", runtime.WithHTTPPathPattern(\"/v1/echo\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Util_Echo_1(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Util_Echo_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "645d6f035a2492b02233f1911c471d13", "score": "0.7529259", "text": "func RegisterUtilHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterUtilHandlerClient(ctx, mux, NewUtilClient(conn))\n}", "title": "" }, { "docid": "9004b6b7962e911871735d65e1a8e57f", "score": "0.61689454", "text": "func RegisterImmuServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ImmuServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_ImmuService_Set_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Set_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Set_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_SafeSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_SafeSet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_SafeSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_SafeGet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_SafeGet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_SafeGet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_SetBatch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_SetBatch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_SetBatch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_GetBatch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_GetBatch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_GetBatch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_Scan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Scan_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Scan_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_Count_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Count_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Count_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_CurrentRoot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_CurrentRoot_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_CurrentRoot_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_Inclusion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Inclusion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Inclusion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_Consistency_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Consistency_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Consistency_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_ByIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_ByIndex_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_ByIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_History_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_History_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_History_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ImmuService_Health_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Health_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Health_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_Reference_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_Reference_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_Reference_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_SafeReference_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_SafeReference_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_SafeReference_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_ZAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_ZAdd_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_ZAdd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_ZScan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_ZScan_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_ZScan_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ImmuService_SafeZAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ImmuService_SafeZAdd_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ImmuService_SafeZAdd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "471207535b31c0e702f9f096586b240b", "score": "0.6149196", "text": "func RegisterServerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServerServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_ServerService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_Login_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_Index_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_Index_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Index_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ServerService_AddServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_AddServer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_AddServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ServerService_UpdateServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_UpdateServer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_UpdateServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_DetailsServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_DetailsServer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_DetailsServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ServerService_DeleteServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_DeleteServer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_DeleteServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ServerService_ChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_ChangePassword_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_ChangePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_CheckStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_CheckStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_CheckStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_Export_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Export_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ServerService_Logout_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Logout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "89f5961734019283c06535874107a923", "score": "0.60965836", "text": "func RegisterUtilHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UtilClient) error {\n\tmux.Handle(\"GET\", pattern_Util_CheckStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateContext(ctx, mux, req, \"/gunk.example.v1.Util/CheckStatus\", runtime.WithHTTPPathPattern(\"/v1/status\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Util_CheckStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams)\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Util_CheckStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"GET\", pattern_Util_Echo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateContext(ctx, mux, req, \"/gunk.example.v1.Util/Echo\", runtime.WithHTTPPathPattern(\"/v1/echo\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Util_Echo_0(annotatedContext, inboundMarshaler, client, req, pathParams)\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Util_Echo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_Util_Echo_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateContext(ctx, mux, req, \"/gunk.example.v1.Util/Echo\", runtime.WithHTTPPathPattern(\"/v1/echo\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_Util_Echo_1(annotatedContext, inboundMarshaler, client, req, pathParams)\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Util_Echo_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "af725f644c6258847d4f643b75998446", "score": "0.60883", "text": "func RegisterUtilHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {\n\tconn, err := grpc.Dial(endpoint, opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tgo func() {\n\t\t\t<-ctx.Done()\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t}()\n\t}()\n\n\treturn RegisterUtilHandler(ctx, mux, conn)\n}", "title": "" }, { "docid": "79c6cab32bb9e5290c8ebbc23dd85294", "score": "0.6039315", "text": "func RegisterInternalServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InternalServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_InternalService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_Login_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_Profile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_Profile_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_Profile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_GlobalSearch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_GlobalSearch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_GlobalSearch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_InternalService_CreateAPIKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_CreateAPIKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_CreateAPIKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_InternalService_DeleteAPIKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_DeleteAPIKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_DeleteAPIKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_ListAPIKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_ListAPIKeys_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_ListAPIKeys_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_Settings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_Settings_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_Settings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_OpenIDConnectLogin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_OpenIDConnectLogin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_OpenIDConnectLogin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_GetDevicesSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_GetDevicesSummary_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_GetDevicesSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InternalService_GetGatewaysSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InternalService_GetGatewaysSummary_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InternalService_GetGatewaysSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "2d48072c175ed24d15a1a531fa2c2cb8", "score": "0.5962183", "text": "func RegisterSecretManagerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server extSecretmanager.SecretManagerServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_SecretManagerService_ListSecrets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/ListSecrets\", runtime.WithHTTPPathPattern(\"/v1/{parent=projects/*}/secrets\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_ListSecrets_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_ListSecrets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_CreateSecret_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/CreateSecret\", runtime.WithHTTPPathPattern(\"/v1/{parent=projects/*}/secrets\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_CreateSecret_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_CreateSecret_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_AddSecretVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/AddSecretVersion\", runtime.WithHTTPPathPattern(\"/v1/{parent=projects/*/secrets/*}:addVersion\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_AddSecretVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_AddSecretVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SecretManagerService_GetSecret_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/GetSecret\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_GetSecret_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_GetSecret_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_SecretManagerService_UpdateSecret_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/UpdateSecret\", runtime.WithHTTPPathPattern(\"/v1/{secret.name=projects/*/secrets/*}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_UpdateSecret_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_UpdateSecret_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_SecretManagerService_DeleteSecret_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/DeleteSecret\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_DeleteSecret_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_DeleteSecret_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SecretManagerService_ListSecretVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/ListSecretVersions\", runtime.WithHTTPPathPattern(\"/v1/{parent=projects/*/secrets/*}/versions\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_ListSecretVersions_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_ListSecretVersions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SecretManagerService_GetSecretVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/GetSecretVersion\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*/versions/*}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_GetSecretVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_GetSecretVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SecretManagerService_AccessSecretVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/AccessSecretVersion\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*/versions/*}:access\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_AccessSecretVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_AccessSecretVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_DisableSecretVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/DisableSecretVersion\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*/versions/*}:disable\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_DisableSecretVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_DisableSecretVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_EnableSecretVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/EnableSecretVersion\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*/versions/*}:enable\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_EnableSecretVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_EnableSecretVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_DestroySecretVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/DestroySecretVersion\", runtime.WithHTTPPathPattern(\"/v1/{name=projects/*/secrets/*/versions/*}:destroy\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_DestroySecretVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_DestroySecretVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_SetIamPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/SetIamPolicy\", runtime.WithHTTPPathPattern(\"/v1/{resource=projects/*/secrets/*}:setIamPolicy\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_SetIamPolicy_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_SetIamPolicy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SecretManagerService_GetIamPolicy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/GetIamPolicy\", runtime.WithHTTPPathPattern(\"/v1/{resource=projects/*/secrets/*}:getIamPolicy\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_GetIamPolicy_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_GetIamPolicy_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SecretManagerService_TestIamPermissions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/google.cloud.secretmanager.v1.SecretManagerService/TestIamPermissions\", runtime.WithHTTPPathPattern(\"/v1/{resource=projects/*/secrets/*}:testIamPermissions\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SecretManagerService_TestIamPermissions_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SecretManagerService_TestIamPermissions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "2b0f20fe50eb4ed94c07d040e0979c8e", "score": "0.5878095", "text": "func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_AuthService_SignInWithPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AuthService_SignInWithPassword_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AuthService_SignInWithPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AuthService_SignUpWithPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AuthService_SignUpWithPassword_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AuthService_SignUpWithPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "d64b59832ab64a6ff0237ed7ea5c8be7", "score": "0.58518225", "text": "func RegisterApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ApiServer) error {\n\n\tmux.Handle(\"GET\", pattern_Api_SayHelloURL_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Api/SayHelloURL\", runtime.WithHTTPPathPattern(\"/api/v1/cms/say_hello\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Api_SayHelloURL_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Api_SayHelloURL_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Api_ListAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Api/ListAlbum\", runtime.WithHTTPPathPattern(\"/api/v1/cms/albumList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Api_ListAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Api_ListAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Api_GetAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Api/GetAlbum\", runtime.WithHTTPPathPattern(\"/api/v1/cms/album/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Api_GetAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Api_GetAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "25d294106d42d8d1503a4e69b1868312", "score": "0.58299834", "text": "func RegisterAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServer) error {\n\n\tmux.Handle(\"GET\", pattern_Admin_ListAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListAlbum\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsalbumList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/GetAlbum\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsalbum/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/CreateAlbum\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsalbum\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/UpdateAlbum\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsalbum\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteAlbum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/DeleteAlbum\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsalbum/{ids}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteAlbum_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteAlbum_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListBrand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListBrand\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsbrandList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListBrand_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListBrand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetBrand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/GetBrand\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsbrand/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetBrand_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetBrand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateBrand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/CreateBrand\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsbrand\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateBrand_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateBrand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateBrand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/UpdateBrand\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsbrand\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateBrand_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateBrand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteBrand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/DeleteBrand\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsbrand/{ids}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteBrand_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteBrand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListProductCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListProductCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductcategoryList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListProductCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListProductCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListProductCategoryTree_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListProductCategoryTree\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductcategorytreeList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListProductCategoryTree_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListProductCategoryTree_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetProductCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/GetProductCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductcategory/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetProductCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetProductCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateProductCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/CreateProductCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductcategory\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateProductCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateProductCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateProductCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/UpdateProductCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductcategory\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateProductCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateProductCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteProductCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/DeleteProductCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductcategory/{ids}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteProductCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteProductCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListProduct\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/GetProduct\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproduct/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/CreateProduct\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproduct\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/UpdateProduct\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproduct\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/DeleteProduct\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproduct/{ids}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListProductAttribute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListProductAttribute\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattributeList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListProductAttribute_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListProductAttribute_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetProductAttribute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/GetProductAttribute\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattribute/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetProductAttribute_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetProductAttribute_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateProductAttribute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/CreateProductAttribute\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattribute\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateProductAttribute_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateProductAttribute_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateProductAttribute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/UpdateProductAttribute\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattribute\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateProductAttribute_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateProductAttribute_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteProductAttribute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/DeleteProductAttribute\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattribute/{ids}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteProductAttribute_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteProductAttribute_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListProductAttributeCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/ListProductAttributeCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattributecategoryList\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListProductAttributeCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListProductAttributeCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetProductAttributeCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/GetProductAttributeCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattributecategory/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetProductAttributeCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetProductAttributeCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateProductAttributeCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/CreateProductAttributeCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattributecategory\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateProductAttributeCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateProductAttributeCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateProductAttributeCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/UpdateProductAttributeCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattributecategory\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateProductAttributeCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateProductAttributeCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteProductAttributeCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/api.pms.Admin/DeleteProductAttributeCategory\", runtime.WithHTTPPathPattern(\"/admin/v1/pmsproductattributecategory/{ids}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteProductAttributeCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteProductAttributeCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "4b27b8f3ce779a14fc183dcb488d759d", "score": "0.5774859", "text": "func RegisterControlAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ControlAPIServer) error {\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_LoggerSignal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_LoggerSignal_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_LoggerSignal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_ProcessSignal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_ProcessSignal_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_ProcessSignal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_AllProcesses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_AllProcesses_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_AllProcesses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_Halt_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_Halt_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_Halt_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_AddProcess_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_AddProcess_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_AddProcess_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_UpdateProcess_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_UpdateProcess_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_UpdateProcess_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_DeleteProcess_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_DeleteProcess_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_DeleteProcess_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ControlAPI_GetProcess_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ControlAPI_GetProcess_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ControlAPI_GetProcess_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "687d74745d81175db2afcdef57e17cb8", "score": "0.5772941", "text": "func RegisterMetricServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MetricServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MetricService_RegisterMetricMeta_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_RegisterMetricMeta_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_RegisterMetricMeta_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetricService_UpdateMetricMeta_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_UpdateMetricMeta_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_UpdateMetricMeta_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetricService_DeleteMetricMeta_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_DeleteMetricMeta_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_DeleteMetricMeta_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetricService_GetMetricMeta_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_GetMetricMeta_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_GetMetricMeta_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetricService_ListDatasetMetricMetas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_ListDatasetMetricMetas_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_ListDatasetMetricMetas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetricService_ListModelMetricMetas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_ListModelMetricMetas_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_ListModelMetricMetas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetricService_RegisterMetricSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_RegisterMetricSummary_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_RegisterMetricSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetricService_UpdateMetricSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_UpdateMetricSummary_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_UpdateMetricSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetricService_DeleteMetricSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_DeleteMetricSummary_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_DeleteMetricSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetricService_GetMetricSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_GetMetricSummary_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_GetMetricSummary_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetricService_ListMetricSummaries_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetricService_ListMetricSummaries_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetricService_ListMetricSummaries_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "05274a0ad236422bb33b0f87e0ea33dd", "score": "0.57550895", "text": "func RegisterDynizerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DynizerServer) error {\n\n\tmux.Handle(\"POST\", pattern_Dynizer_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/Login\", runtime.WithHTTPPathPattern(\"/api/v2/login\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_Login_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_ServiceLogin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ServiceLogin\", runtime.WithHTTPPathPattern(\"/api/v2/servicelogin\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ServiceLogin_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ServiceLogin_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/Logout\", runtime.WithHTTPPathPattern(\"/api/v2/logout\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_Logout_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_Logout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ValidateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ValidateToken\", runtime.WithHTTPPathPattern(\"/api/v2/jwt/{token}/validate\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ValidateToken_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ValidateToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_IssueServiceToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/IssueServiceToken\", runtime.WithHTTPPathPattern(\"/api/v2/servicetoken/issue\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_IssueServiceToken_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_IssueServiceToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListRoles\", runtime.WithHTTPPathPattern(\"/api/v2/roles\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListRoles_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddUser\", runtime.WithHTTPPathPattern(\"/api/v2/users\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AssignUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AssignUserRole\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}/roles\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AssignUserRole_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AssignUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RevokeUserRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RevokeUserRole\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}/roles/{role.name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RevokeUserRole_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RevokeUserRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_EnableUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/EnableUser\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}/enable\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_EnableUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_EnableUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_DisableUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DisableUser\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}/disable\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DisableUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DisableUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Dynizer_SetUserPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/SetUserPassword\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}/password\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_SetUserPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_SetUserPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Dynizer_ChangeMyPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ChangeMyPassword\", runtime.WithHTTPPathPattern(\"/api/v2/my/password\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ChangeMyPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ChangeMyPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetUser\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetMyProfile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetMyProfile\", runtime.WithHTTPPathPattern(\"/api/v2/my/profile\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetMyProfile_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetMyProfile_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteUser\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetUserCount\", runtime.WithHTTPPathPattern(\"/api/v2/users/all/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetUserCount_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListUsers\", runtime.WithHTTPPathPattern(\"/api/v2/users\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListUserRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListUserRoles\", runtime.WithHTTPPathPattern(\"/api/v2/users/{user}/roles\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListUserRoles_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListUserRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetMyRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetMyRoles\", runtime.WithHTTPPathPattern(\"/api/v2/my/roles\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetMyRoles_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetMyRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CheckUserName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CheckUserName\", runtime.WithHTTPPathPattern(\"/api/v2/check/user/{user}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CheckUserName_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CheckUserName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CheckPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CheckPassword\", runtime.WithHTTPPathPattern(\"/api/v2/check/password\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CheckPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CheckPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateActionType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateActionType\", runtime.WithHTTPPathPattern(\"/api/v2/actiontypes\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateActionType_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateActionType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_UpdateActionType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UpdateActionType\", runtime.WithHTTPPathPattern(\"/api/v2/actiontypes/{action_type_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UpdateActionType_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UpdateActionType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReadActionType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReadActionType\", runtime.WithHTTPPathPattern(\"/api/v2/actiontypes/{action_type_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReadActionType_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReadActionType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CheckActionName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CheckActionName\", runtime.WithHTTPPathPattern(\"/api/v2/check/actions/{action_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CheckActionName_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CheckActionName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateAction\", runtime.WithHTTPPathPattern(\"/api/v2/actions\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateAction_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_UpdateAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UpdateAction\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UpdateAction_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UpdateAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteAction\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteAction_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReadAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReadAction\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReadAction_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReadAction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CountActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CountActions\", runtime.WithHTTPPathPattern(\"/api/v2/actions/types/{action_type_label}/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CountActions_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CountActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListActionNames_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListActionNames\", runtime.WithHTTPPathPattern(\"/api/v2/actions/types/{action_type_label}/names/all\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListActionNames_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListActionNames_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CheckActionLabelName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CheckActionLabelName\", runtime.WithHTTPPathPattern(\"/api/v2/check/actions/{action_name}/actionlabels/{action_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CheckActionLabelName_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CheckActionLabelName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddActionLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddActionLabel\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}/actionlabels\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddActionLabel_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddActionLabel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Dynizer_UpdateActionLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UpdateActionLabel\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}/actionlabels/{action_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UpdateActionLabel_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UpdateActionLabel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteActionLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteActionLabel\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}/actionlabels/{action_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteActionLabel_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteActionLabel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReadActionLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReadActionLabel\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}/actionlabels/{action_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReadActionLabel_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReadActionLabel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateObject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateObject\", runtime.WithHTTPPathPattern(\"/api/v2/objects\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateObject_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateObject_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_ClearObjectData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ClearObjectData\", runtime.WithHTTPPathPattern(\"/api/v2/objects/{type}/{ref_uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ClearObjectData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ClearObjectData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteObject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteObject\", runtime.WithHTTPPathPattern(\"/api/v2/objects/{type}/{ref_uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteObject_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteObject_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_UploadObjectData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UploadObjectData\", runtime.WithHTTPPathPattern(\"/api/v2/objects/{type}/{ref_uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UploadObjectData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UploadObjectData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_DownloadObjectData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DownloadObjectData\", runtime.WithHTTPPathPattern(\"/api/v2/objects/{type}/{ref_uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DownloadObjectData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DownloadObjectData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListObjectUUIDS_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListObjectUUIDS\", runtime.WithHTTPPathPattern(\"/api/v2/objects\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListObjectUUIDS_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListObjectUUIDS_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteAllObjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteAllObjects\", runtime.WithHTTPPathPattern(\"/api/v2/objects\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteAllObjects_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteAllObjects_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateInstance\", runtime.WithHTTPPathPattern(\"/api/v2/instances\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateInstance_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateInstance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_UpdateInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UpdateInstance\", runtime.WithHTTPPathPattern(\"/api/v2/instances/{instance_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UpdateInstance_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UpdateInstance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteInstance\", runtime.WithHTTPPathPattern(\"/api/v2/instances/{instance_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteInstance_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteInstance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReadInstance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReadInstance\", runtime.WithHTTPPathPattern(\"/api/v2/instances/{instance_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReadInstance_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReadInstance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReadActionInstances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReadActionInstances\", runtime.WithHTTPPathPattern(\"/api/v2/actions/{action_name}/instances\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReadActionInstances_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReadActionInstances_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_DynizerQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DynizerQuery\", runtime.WithHTTPPathPattern(\"/api/v2/query\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DynizerQuery_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DynizerQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_QueryResultNext_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryResultNext\", runtime.WithHTTPPathPattern(\"/api/v2/query/{result_handle}/next\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryResultNext_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryResultNext_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_QueryResultClose_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryResultClose\", runtime.WithHTTPPathPattern(\"/api/v2/query/{result_handle}/close\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryResultClose_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryResultClose_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_QueryResultStreamed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CheckMetaDataKeyName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CheckMetaDataKeyName\", runtime.WithHTTPPathPattern(\"/api/v2/check/metadata/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CheckMetaDataKeyName_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CheckMetaDataKeyName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateMetaDataKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateMetaDataKey\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/keys\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateMetaDataKey_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateMetaDataKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReadMetaDataKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReadMetaDataKey\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReadMetaDataKey_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReadMetaDataKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_UpdateMetaDataKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UpdateMetaDataKey\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UpdateMetaDataKey_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UpdateMetaDataKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DeleteMetaDataKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteMetaDataKey\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteMetaDataKey_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteMetaDataKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CountMetaDataKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CountMetaDataKeys\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/keys/all/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CountMetaDataKeys_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CountMetaDataKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListMetaDataKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListMetaDataKeys\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/keys\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListMetaDataKeys_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListMetaDataKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddInstanceMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddInstanceMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddInstanceMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddInstanceMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RemoveInstanceMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RemoveInstanceMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RemoveInstanceMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RemoveInstanceMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddInstanceMetaDataValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddInstanceMetaDataValue\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys/{key_name}/values\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddInstanceMetaDataValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddInstanceMetaDataValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RemoveInstanceMetaDataValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RemoveInstanceMetaDataValue\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys/{key_name}/values/{value}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RemoveInstanceMetaDataValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RemoveInstanceMetaDataValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetInstanceMetaDataValues_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetInstanceMetaDataValues\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetInstanceMetaDataValues_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetInstanceMetaDataValues_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CountInstanceMetaDataKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CountInstanceMetaDataKeys\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys/all/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CountInstanceMetaDataKeys_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CountInstanceMetaDataKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CountInstanceMetaDataKeyValues_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CountInstanceMetaDataKeyValues\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys/{key_name}/values/all/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CountInstanceMetaDataKeyValues_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CountInstanceMetaDataKeyValues_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListInstanceMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListInstanceMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/keys\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListInstanceMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListInstanceMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddInstanceActionLabelMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddInstanceActionLabelMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddInstanceActionLabelMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddInstanceActionLabelMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RemoveInstanceActionLabelMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RemoveInstanceActionLabelMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RemoveInstanceActionLabelMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RemoveInstanceActionLabelMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddInstanceActionLabelMetaDataValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddInstanceActionLabelMetaDataValue\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/keys/{key_name}/values\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddInstanceActionLabelMetaDataValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddInstanceActionLabelMetaDataValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RemoveInstanceActionLabelMetaDataValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RemoveInstanceActionLabelMetaDataValue\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/keys/{key_name}/values/{value}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RemoveInstanceActionLabelMetaDataValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RemoveInstanceActionLabelMetaDataValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddInstanceCellMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddInstanceCellMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddInstanceCellMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddInstanceCellMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RemoveInstanceCellMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RemoveInstanceCellMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RemoveInstanceCellMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RemoveInstanceCellMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_AddInstanceCellMetaDataValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/AddInstanceCellMetaDataValue\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys/{key_name}/values\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_AddInstanceCellMetaDataValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_AddInstanceCellMetaDataValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_RemoveInstanceCellMetaDataValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/RemoveInstanceCellMetaDataValue\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys/{key_name}/values/{value}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_RemoveInstanceCellMetaDataValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_RemoveInstanceCellMetaDataValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetInstanceCellMetaDataValues_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetInstanceCellMetaDataValues\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys/{key_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetInstanceCellMetaDataValues_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetInstanceCellMetaDataValues_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CountInstanceCellMetaDataKeys_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CountInstanceCellMetaDataKeys\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys/all/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CountInstanceCellMetaDataKeys_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CountInstanceCellMetaDataKeys_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_CountInstanceCellMetaDataKeyValues_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CountInstanceCellMetaDataKeyValues\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys/{key_name}/values/all/count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CountInstanceCellMetaDataKeyValues_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CountInstanceCellMetaDataKeyValues_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ListInstanceCellMetaData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ListInstanceCellMetaData\", runtime.WithHTTPPathPattern(\"/api/v2/metadata/instances/{instance_id}/actionlabels/{action_label}/position/{value_position}/keys\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ListInstanceCellMetaData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ListInstanceCellMetaData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetDynizerConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetDynizerConfiguration\", runtime.WithHTTPPathPattern(\"/api/v2/config\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetDynizerConfiguration_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetDynizerConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_ExportUserActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ExportUserActions\", runtime.WithHTTPPathPattern(\"/api/v2/system/export/useractions\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ExportUserActions_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ExportUserActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_ImportUserActions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ImportUserActions\", runtime.WithHTTPPathPattern(\"/api/v2/system/import/useractions\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ImportUserActions_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ImportUserActions_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Dynizer_DropData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DropData\", runtime.WithHTTPPathPattern(\"/api/v2/system/data\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DropData_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DropData_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetDynizerVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetDynizerVersion\", runtime.WithHTTPPathPattern(\"/api/v2/system/version\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetDynizerVersion_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetDynizerVersion_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateActionLabelLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateActionLabelLink\", runtime.WithHTTPPathPattern(\"/api/v2/actions/link\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateActionLabelLink_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateActionLabelLink_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_GetActionLabelLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetActionLabelLink\", runtime.WithHTTPPathPattern(\"/api/v2/actions/link/{action_label_link_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetActionLabelLink_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetActionLabelLink_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryDataElements_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryDataElements\", runtime.WithHTTPPathPattern(\"/api/v2/dataelements/query/contains\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryDataElements_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryDataElements_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_GetTopNDataElements_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/GetTopNDataElements\", runtime.WithHTTPPathPattern(\"/api/v2/dataelements/top\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_GetTopNDataElements_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_GetTopNDataElements_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_DynizerFilteredQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DynizerFilteredQuery\", runtime.WithHTTPPathPattern(\"/api/v2/query/filtered\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DynizerFilteredQuery_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DynizerFilteredQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Dynizer_ReIndex_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/ReIndex\", runtime.WithHTTPPathPattern(\"/api/v2/maintenance/index/{index_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_ReIndex_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_ReIndex_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_DynizerFilteredPlot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DynizerFilteredPlot\", runtime.WithHTTPPathPattern(\"/api/v2/plots/filtered/{top}/{plot_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DynizerFilteredPlot_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DynizerFilteredPlot_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_CreateShareName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/CreateShareName\", runtime.WithHTTPPathPattern(\"/api/v2/sharename\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_CreateShareName_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_CreateShareName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Dynizer_UpdateShareNameValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/UpdateShareNameValue\", runtime.WithHTTPPathPattern(\"/api/v2/sharename/{share_name}/value\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_UpdateShareNameValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_UpdateShareNameValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_DeleteShareNameValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/DeleteShareNameValue\", runtime.WithHTTPPathPattern(\"/api/v2/sharename/{share_name}/delete/value\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_DeleteShareNameValue_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_DeleteShareNameValue_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_SimpleQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/SimpleQuery\", runtime.WithHTTPPathPattern(\"/api/v2/query/simple\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_SimpleQuery_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_SimpleQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryParse_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryParse\", runtime.WithHTTPPathPattern(\"/api/v2/query/parse\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryParse_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryParse_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryBind_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryBind\", runtime.WithHTTPPathPattern(\"/api/v2/query/bind\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryBind_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryBind_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryDescribeStatement_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryDescribeStatement\", runtime.WithHTTPPathPattern(\"/api/v2/query/statement/describe\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryDescribeStatement_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryDescribeStatement_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryDescribePortal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryDescribePortal\", runtime.WithHTTPPathPattern(\"/api/v2/query/portal/describe\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryDescribePortal_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryDescribePortal_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryExecute_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryExecute\", runtime.WithHTTPPathPattern(\"/api/v2/query/execute\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryExecute_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryExecute_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryClose_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryClose\", runtime.WithHTTPPathPattern(\"/api/v2/query/close\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryClose_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryClose_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_QueryCancel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/QueryCancel\", runtime.WithHTTPPathPattern(\"/api/v2/query/cancel\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_QueryCancel_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_QueryCancel_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Dynizer_FindActionLabelLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/.Dynizer/FindActionLabelLinks\", runtime.WithHTTPPathPattern(\"/api/v2/find_actionlabel_links\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Dynizer_FindActionLabelLinks_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Dynizer_FindActionLabelLinks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "cabbb821278ac4290016e534487180c9", "score": "0.5743893", "text": "func RegisterMruVEntrancesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MruVEntrancesServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MruVEntrancesService_CreateEntrance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/CreateEntrance\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_CreateEntrance_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_CreateEntrance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVEntrancesService_GetEntrance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/GetEntrance\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_GetEntrance_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_GetEntrance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_MruVEntrancesService_UpdateEntrance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/UpdateEntrance\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_UpdateEntrance_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_UpdateEntrance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVEntrancesService_DeleteEntrance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/DeleteEntrance\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_DeleteEntrance_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_DeleteEntrance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVEntrancesService_Lock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/Lock\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_Lock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_Lock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVEntrancesService_Unlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/Unlock\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_Unlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_Unlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVEntrancesService_FindNearestEntrance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/FindNearestEntrance\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_FindNearestEntrance_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_FindNearestEntrance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVEntrancesService_Enter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/Enter\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_Enter_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_Enter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MruVEntrancesService_Exit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.entrances.MruVEntrancesService/Exit\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVEntrancesService_Exit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVEntrancesService_Exit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "cf7605b8adacf8d62945c584f5351786", "score": "0.5717552", "text": "func RegisterMruVCharactersServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MruVCharactersServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_MruVCharactersService_CreateCharacter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/CreateCharacter\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_CreateCharacter_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_CreateCharacter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVCharactersService_GetCharacter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/GetCharacter\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_GetCharacter_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_GetCharacter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_MruVCharactersService_UpdateCharacter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/UpdateCharacter\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_UpdateCharacter_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_UpdateCharacter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVCharactersService_DeleteCharacter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/DeleteCharacter\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_DeleteCharacter_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_DeleteCharacter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_MruVCharactersService_PermanentCharacterKill_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/PermanentCharacterKill\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_PermanentCharacterKill_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_PermanentCharacterKill_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_MruVCharactersService_ChangeClothes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/ChangeClothes\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_ChangeClothes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_ChangeClothes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVCharactersService_GetServiceStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/GetServiceStatus\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_GetServiceStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_GetServiceStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MruVCharactersService_GetServiceVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/mruv.characters.MruVCharactersService/GetServiceVersion\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MruVCharactersService_GetServiceVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MruVCharactersService_GetServiceVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "d8f637c66681b74bb7b003756b51234d", "score": "0.5642417", "text": "func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_UserService_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_GetInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_GetInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_UserService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_UserService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Add_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UserService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_Update_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Update_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Update_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UserService_Withdraw_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Withdraw_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Withdraw_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_Withdraw_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Withdraw_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Withdraw_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UserService_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Deposit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_Deposit_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_Deposit_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_Deposit_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_UserService_ResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_ResetPassword_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_ResetPassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_UserService_ResetPassword_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_UserService_ResetPassword_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_UserService_ResetPassword_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "3b6a7fc1cfa1ed41ac227ceb36ab831a", "score": "0.5511289", "text": "func RegisterProviderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProviderServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_ProviderService_CreateProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProviderService_CreateProvider_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProviderService_CreateProvider_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ProviderService_GetProviders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProviderService_GetProviders_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProviderService_GetProviders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "68c16c2bb34a4e027b8a2fa92da22a86", "score": "0.54882526", "text": "func (a *ApiOption) RegisterServerAndListen() error {\n\tmux := http.NewServeMux()\n\tif a.Profiling {\n\t\t// pporf debug support\n\t\tmux.HandleFunc(\"/debug/pprof/\", pprof.Index)\n\t\tmux.HandleFunc(\"/debug/pprof/profile\", pprof.Profile)\n\t\tmux.HandleFunc(\"/debug/pprof/symbol\", pprof.Symbol)\n\t}\n\n\t// version support\n\tmux.HandleFunc(\"/version\", verflag.RequestVersion)\n\n\t// nodemanager operation support\n\tcontainer := restful.NewContainer()\n\tcontainer.ServeMux = mux\n\tcontainer.Router(restful.CurlyRouter{})\n\tcors := restful.CrossOriginResourceSharing{\n\t\tAllowedHeaders: []string{\"Content-Type\", \"Accept\", \"Origin\"},\n\t\t// now just support GET and POST, users could add other methods if needed in future\n\t\tAllowedMethods: []string{\"GET\", \"POST\"},\n\t\tCookiesAllowed: false,\n\t\tContainer: container,\n\t}\n\tcontainer.Filter(cors.Filter)\n\tcontainer.Filter(container.OPTIONSFilter)\n\t// register nodemanager operation route\n\tnmoperator.RegisterNMOperatorService(a.EnableCadvisor, container)\n\n\thandler := http.TimeoutHandler(mux, time.Duration(1*time.Minute), \"time out\")\n\thttpServer := &http.Server{\n\t\tHandler: handler,\n\t\tMaxHeaderBytes: 1 << 20,\n\t}\n\n\t// get port from environment\n\tportStr := os.Getenv(types.EnvPort)\n\tif portStr != \"\" {\n\t\ta.InsecurePort = portStr\n\t}\n\n\tinsecureLocation := net.JoinHostPort(a.InsecureAddress, a.InsecurePort)\n\tlistener, err := net.Listen(\"tcp\", insecureLocation)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listen(%s) err: %v\", insecureLocation, err)\n\t}\n\n\treturn httpServer.Serve(listener)\n}", "title": "" }, { "docid": "a1e052454f941b154afd41fb30515418", "score": "0.5484591", "text": "func RegisterFarmServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FarmServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_FarmService_NewFarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/NewFarm\", runtime.WithHTTPPathPattern(\"/chicken_farmer.v1.FarmService/NewFarm\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_NewFarm_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_NewFarm_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_FarmService_DeleteFarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/DeleteFarm\", runtime.WithHTTPPathPattern(\"/chicken_farmer.v1.FarmService/DeleteFarm\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_DeleteFarm_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_DeleteFarm_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_FarmService_FarmDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/FarmDetails\", runtime.WithHTTPPathPattern(\"/v1/farm\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_FarmDetails_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_FarmDetails_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_FarmService_BuyBarn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/BuyBarn\", runtime.WithHTTPPathPattern(\"/v1/farm/barns/buy\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_BuyBarn_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_BuyBarn_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_FarmService_BuyFeedBag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/BuyFeedBag\", runtime.WithHTTPPathPattern(\"/v1/farm/barns/{barn_id}/buy-feed-bag\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_BuyFeedBag_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_BuyFeedBag_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_FarmService_BuyChicken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/BuyChicken\", runtime.WithHTTPPathPattern(\"/v1/farm/chickens/buy\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_BuyChicken_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_BuyChicken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_FarmService_SellChicken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/SellChicken\", runtime.WithHTTPPathPattern(\"/v1/farm/chickens/{chicken_id}/sell\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_SellChicken_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_SellChicken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_FarmService_FeedChicken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/chicken_farmer.v1.FarmService/FeedChicken\", runtime.WithHTTPPathPattern(\"/v1/farm/chickens/{chicken_id}/feed\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FarmService_FeedChicken_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FarmService_FeedChicken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "197b7e7234ab407e31b6a999e55f8830", "score": "0.548375", "text": "func RegisterRemoteMulticastGroupServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RemoteMulticastGroupServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_RemoteMulticastGroupService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RemoteMulticastGroupService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RemoteMulticastGroupService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RemoteMulticastGroupService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RemoteMulticastGroupService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RemoteMulticastGroupService_AddDevice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_AddDevice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_AddDevice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_RemoteMulticastGroupService_ResetDevice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_ResetDevice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_ResetDevice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RemoteMulticastGroupService_RemoveDevice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_RemoveDevice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_RemoveDevice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RemoteMulticastGroupService_ListDevicesForRemoteMulticast_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_ListDevicesForRemoteMulticast_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_ListDevicesForRemoteMulticast_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RemoteMulticastGroupService_GetDevicesList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_GetDevicesList_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_GetDevicesList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RemoteMulticastGroupService_GetDeploymentDevice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_GetDeploymentDevice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_GetDeploymentDevice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_RemoteMulticastGroupService_Enqueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_Enqueue_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_Enqueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_RemoteMulticastGroupService_FlushQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_FlushQueue_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_FlushQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_RemoteMulticastGroupService_ListQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_RemoteMulticastGroupService_ListQueue_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_RemoteMulticastGroupService_ListQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "dd6965a82b0343b1eeb1dc5344ce420b", "score": "0.5456865", "text": "func RegisterGroupsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GroupsServer) error {\n\n\tmux.Handle(\"POST\", pattern_Groups_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Groups/Create\", runtime.WithHTTPPathPattern(\"/groups\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Groups_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Groups_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Groups_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Groups/Update\", runtime.WithHTTPPathPattern(\"/groups/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Groups_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Groups_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Groups_ValidatedList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Groups/ValidatedList\", runtime.WithHTTPPathPattern(\"/groups\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Groups_ValidatedList_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Groups_ValidatedList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Groups_ValidatedList_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Groups/ValidatedList\", runtime.WithHTTPPathPattern(\"/groups_add\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Groups_ValidatedList_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Groups_ValidatedList_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Groups_ValidateWKT_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Groups/ValidateWKT\", runtime.WithHTTPPathPattern(\"/wkt_get\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Groups_ValidateWKT_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Groups_ValidateWKT_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Groups_ValidateWKT_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Groups/ValidateWKT\", runtime.WithHTTPPathPattern(\"/wkt_get_additional\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Groups_ValidateWKT_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Groups_ValidateWKT_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "c1703c94ba90c0b1e11716bfdfa4f811", "score": "0.54545045", "text": "func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RegistryServer) error {\n\n\tmux.Handle(\"GET\", pattern_Registry_GetBrokers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/GetBrokers\", runtime.WithHTTPPathPattern(\"/v1/brokers\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_GetBrokers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_GetBrokers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_ListBrokers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/ListBrokers\", runtime.WithHTTPPathPattern(\"/v1/brokers/list\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_ListBrokers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_ListBrokers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_UnmappedBrokers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/UnmappedBrokers\", runtime.WithHTTPPathPattern(\"/v1/brokers/unmapped\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_UnmappedBrokers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_UnmappedBrokers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_GetTopics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/GetTopics\", runtime.WithHTTPPathPattern(\"/v1/topics\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_GetTopics_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_GetTopics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_ListTopics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/ListTopics\", runtime.WithHTTPPathPattern(\"/v1/topics/list\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_ListTopics_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_ListTopics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Registry_CreateTopic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/CreateTopic\", runtime.WithHTTPPathPattern(\"/v1/topics/create\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_CreateTopic_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_CreateTopic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Registry_DeleteTopic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/DeleteTopic\", runtime.WithHTTPPathPattern(\"/v1/topics/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_DeleteTopic_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_DeleteTopic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_ReassigningTopics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/ReassigningTopics\", runtime.WithHTTPPathPattern(\"/v1/topics/reassigning\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_ReassigningTopics_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_ReassigningTopics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_UnderReplicatedTopics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/UnderReplicatedTopics\", runtime.WithHTTPPathPattern(\"/v1/topics/underreplicated\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_UnderReplicatedTopics_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_UnderReplicatedTopics_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_TopicMappings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/TopicMappings\", runtime.WithHTTPPathPattern(\"/v1/mappings/topic/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_TopicMappings_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_TopicMappings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_BrokerMappings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/BrokerMappings\", runtime.WithHTTPPathPattern(\"/v1/mappings/broker/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_BrokerMappings_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_BrokerMappings_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Registry_TagTopic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/TagTopic\", runtime.WithHTTPPathPattern(\"/v1/topics/tag/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_TagTopic_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_TagTopic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Registry_DeleteTopicTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/DeleteTopicTags\", runtime.WithHTTPPathPattern(\"/v1/topics/tag/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_DeleteTopicTags_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_DeleteTopicTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Registry_TagBroker_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/TagBroker\", runtime.WithHTTPPathPattern(\"/v1/brokers/tag/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_TagBroker_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_TagBroker_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Registry_TagBrokers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/TagBrokers\", runtime.WithHTTPPathPattern(\"/v2/brokers/tag\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_TagBrokers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_TagBrokers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Registry_DeleteBrokerTags_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/DeleteBrokerTags\", runtime.WithHTTPPathPattern(\"/v1/brokers/tag/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_DeleteBrokerTags_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_DeleteBrokerTags_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Registry_TranslateOffsets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/registry.Registry/TranslateOffsets\", runtime.WithHTTPPathPattern(\"/v1/translate-offsets/{remote_cluster_alias}/{group_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Registry_TranslateOffsets_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Registry_TranslateOffsets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "01fecdaa053d62b001090f0db24b0425", "score": "0.5412404", "text": "func RegisterAccountAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountAPIServer) error {\n\n\tmux.Handle(\"POST\", pattern_AccountAPI_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_Login_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AccountAPI_CreateAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_CreateAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_CreateAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AccountAPI_ActivateAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_ActivateAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_ActivateAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_AccountAPI_UpdateAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_UpdateAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_UpdateAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AccountAPI_GetAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_GetAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_GetAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AccountAPI_GetSettings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_GetSettings_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_GetSettings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AccountAPI_UpdateSettings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_UpdateSettings_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_UpdateSettings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AccountAPI_GetJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_GetJobs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_GetJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AccountAPI_UpdateJobs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_UpdateJobs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_UpdateJobs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AccountAPI_GetStarredFacilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_GetStarredFacilities_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_GetStarredFacilities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_AccountAPI_UpdateStarredFacilities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AccountAPI_UpdateStarredFacilities_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AccountAPI_UpdateStarredFacilities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "57b724118b1d593babda47c791c80c44", "score": "0.5412152", "text": "func RegisterAccountsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountsServer) error {\n\n\tmux.Handle(\"GET\", pattern_Accounts_SelfAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_SelfAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_SelfAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Accounts_Token_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_Token_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_Token_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Accounts_CreateUserAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_CreateUserAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_CreateUserAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Accounts_GetAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_GetAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_GetAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Accounts_UpdateAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_UpdateAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_UpdateAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Accounts_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_ListAccounts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_ListAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Accounts_DeleteAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_DeleteAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_DeleteAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Accounts_AssignOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_AssignOwner_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_AssignOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Accounts_RemoveOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Accounts_RemoveOwner_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Accounts_RemoveOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "b191c4586de6cb534143e3b4263f0985", "score": "0.54033226", "text": "func RegisterPostHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PostServer) error {\n\n\tmux.Handle(\"POST\", pattern_Post_AddType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.Post/AddType\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Post_AddType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Post_AddType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Post_FndTypes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.Post/FndTypes\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Post_FndTypes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Post_FndTypes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Post_AddPost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.Post/AddPost\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Post_AddPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Post_AddPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Post_FndPosts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.Post/FndPosts\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Post_FndPosts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Post_FndPosts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Post_OvrPost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.Post/OvrPost\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Post_OvrPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Post_OvrPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Post_RmvPost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pb.Post/RmvPost\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Post_RmvPost_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Post_RmvPost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "45fc3ad103ad6885c5498ff934e0dc16", "score": "0.53888744", "text": "func RegisterServerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterServerServiceHandlerClient(ctx, mux, NewServerServiceClient(conn))\n}", "title": "" }, { "docid": "c3df1b814a4fff58175ee43c746dd397", "score": "0.53823686", "text": "func (s *service) RegisterAdditionalServers(server *grpc.Server) {\n\tLog.Info(\"Registering additional GRPC servers\")\n\tpodmon.RegisterPodmonServer(server, s)\n\tvolumeGroupSnapshot.RegisterVolumeGroupSnapshotServer(server, s)\n}", "title": "" }, { "docid": "637682f3bb03bbe478bdf92a36918617", "score": "0.53637946", "text": "func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error {\n\n\tmux.Handle(\"POST\", pattern_Users_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/Create\", runtime.WithHTTPPathPattern(\"/users\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Users_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/Update\", runtime.WithHTTPPathPattern(\"/users/{payload.id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Users_Update_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/Update\", runtime.WithHTTPPathPattern(\"/user/{payload.id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_Update_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_Update_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Users_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/List\", runtime.WithHTTPPathPattern(\"/users\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Users_List_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/List\", runtime.WithHTTPPathPattern(\"/antother_users\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_List_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_List_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Users_UpdateExternalUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/UpdateExternalUser\", runtime.WithHTTPPathPattern(\"/external_users\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_UpdateExternalUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_UpdateExternalUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Users_UpdateExternalUser2_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Users/UpdateExternalUser2\", runtime.WithHTTPPathPattern(\"/external_users_update\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Users_UpdateExternalUser2_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Users_UpdateExternalUser2_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "8930e9b659a187c2aa308678297734ac", "score": "0.5356869", "text": "func RegisterSwaggerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SwaggerServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_SwaggerService_Json_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SwaggerService_Json_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SwaggerService_Json_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SwaggerService_Yaml_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SwaggerService_Yaml_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SwaggerService_Yaml_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SwaggerService_UI_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SwaggerService_UI_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SwaggerService_UI_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SwaggerService_UI_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SwaggerService_UI_1(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SwaggerService_UI_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "05c0a9fa135ed55735b3ba5a262f3be6", "score": "0.53449774", "text": "func RegisterSDKHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SDKServer) error {\n\n\tmux.Handle(\"GET\", pattern_SDK_GetGameServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/carrier.dev.sdk.SDK/GetGameServer\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SDK_GetGameServer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SDK_GetGameServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SDK_WatchGameServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"PUT\", pattern_SDK_SetLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/carrier.dev.sdk.SDK/SetLabel\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SDK_SetLabel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SDK_SetLabel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_SDK_SetAnnotation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/carrier.dev.sdk.SDK/SetAnnotation\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SDK_SetAnnotation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SDK_SetAnnotation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_SDK_SetCondition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/carrier.dev.sdk.SDK/SetCondition\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SDK_SetCondition_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SDK_SetCondition_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "507dcb42a98130c449aaf85b710813e5", "score": "0.53439116", "text": "func RegisterOcpQuizApiServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OcpQuizApiServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_OcpQuizApiService_CreateQuiz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_OcpQuizApiService_CreateQuiz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_OcpQuizApiService_CreateQuiz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_OcpQuizApiService_DescribeQuiz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_OcpQuizApiService_DescribeQuiz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_OcpQuizApiService_DescribeQuiz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_OcpQuizApiService_ListQuiz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_OcpQuizApiService_ListQuiz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_OcpQuizApiService_ListQuiz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_OcpQuizApiService_RemoveQuiz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_OcpQuizApiService_RemoveQuiz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_OcpQuizApiService_RemoveQuiz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_OcpQuizApiService_MultiCreateQuiz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_OcpQuizApiService_MultiCreateQuiz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_OcpQuizApiService_MultiCreateQuiz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_OcpQuizApiService_UpdateQuiz_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_OcpQuizApiService_UpdateQuiz_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_OcpQuizApiService_UpdateQuiz_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "ba699440496f96faf63bff3250abc482", "score": "0.5334527", "text": "func RegisterLanguageServerProtocolHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LanguageServerProtocolServer) error {\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Cancel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Cancel\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Cancel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Cancel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Progress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Progress\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Progress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Progress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Initialize_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Initialize\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Initialize_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Initialize_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Initialized_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Initialized\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Initialized_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Initialized_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Shutdown\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Shutdown_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Shutdown_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Exit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Exit\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Exit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Exit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_LogTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/LogTrace\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_LogTrace_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_LogTrace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_SetTrace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/SetTrace\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_SetTrace_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_SetTrace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_ShowMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/ShowMessage\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_ShowMessage_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_ShowMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_ShowMessageRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/ShowMessageRequest\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_ShowMessageRequest_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_ShowMessageRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_LogMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/LogMessage\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_LogMessage_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_LogMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CreateWorkDoneProgress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CreateWorkDoneProgress\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CreateWorkDoneProgress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CreateWorkDoneProgress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CancelWorkDoneProgress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CancelWorkDoneProgress\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CancelWorkDoneProgress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CancelWorkDoneProgress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Telemetry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Telemetry\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Telemetry_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Telemetry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_WorkspaceFolders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/WorkspaceFolders\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_WorkspaceFolders_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_WorkspaceFolders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidChangeWorkspaceFolders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidChangeWorkspaceFolders\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidChangeWorkspaceFolders_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidChangeWorkspaceFolders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidChangeConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidChangeConfiguration\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidChangeConfiguration_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidChangeConfiguration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Configuration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Configuration\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Configuration_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Configuration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidChangeWatchedFiles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidChangeWatchedFiles\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidChangeWatchedFiles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidChangeWatchedFiles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_WorkspaceSymbols_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/WorkspaceSymbols\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_WorkspaceSymbols_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_WorkspaceSymbols_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_ExecuteCommand_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/ExecuteCommand\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_ExecuteCommand_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_ExecuteCommand_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_ApplyEdit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/ApplyEdit\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_ApplyEdit_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_ApplyEdit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidOpenTextDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidOpenTextDocument\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidOpenTextDocument_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidOpenTextDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidChangeTextDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidChangeTextDocument\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidChangeTextDocument_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidChangeTextDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_WillSaveTextDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/WillSaveTextDocument\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_WillSaveTextDocument_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_WillSaveTextDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_WillSaveWaitUntilTextDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/WillSaveWaitUntilTextDocument\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_WillSaveWaitUntilTextDocument_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_WillSaveWaitUntilTextDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidSaveTextDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidSaveTextDocument\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidSaveTextDocument_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidSaveTextDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DidCloseTextDocument_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DidCloseTextDocument\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DidCloseTextDocument_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DidCloseTextDocument_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_PublishDiagnostics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/PublishDiagnostics\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_PublishDiagnostics_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_PublishDiagnostics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Completion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Completion\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Completion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Completion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CompletionItemResolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CompletionItemResolve\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CompletionItemResolve_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CompletionItemResolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Hover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Hover\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Hover_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Hover_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_SignatureHelp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/SignatureHelp\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_SignatureHelp_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_SignatureHelp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_GotoDeclaration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/GotoDeclaration\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_GotoDeclaration_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_GotoDeclaration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_GotoDefinition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/GotoDefinition\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_GotoDefinition_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_GotoDefinition_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_GotoTypeDefinition_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/GotoTypeDefinition\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_GotoTypeDefinition_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_GotoTypeDefinition_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_GotoImplementation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/GotoImplementation\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_GotoImplementation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_GotoImplementation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_FindReferences_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/FindReferences\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_FindReferences_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_FindReferences_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentHighlights_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentHighlights\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentHighlights_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentHighlights_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentSymbols_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentSymbols\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentSymbols_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentSymbols_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CodeAction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CodeAction\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CodeAction_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CodeAction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CodeLens_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CodeLens\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CodeLens_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CodeLens_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CodeLensResolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CodeLensResolve\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CodeLensResolve_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CodeLensResolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentLink\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentLink_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentLinkResolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentLinkResolve\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentLinkResolve_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentLinkResolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentColor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentColor\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentColor_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentColor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_ColorPresentation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/ColorPresentation\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_ColorPresentation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_ColorPresentation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentFormatting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentFormatting\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentFormatting_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentFormatting_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_DocumentRangeFormatting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/DocumentRangeFormatting\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_DocumentRangeFormatting_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_DocumentRangeFormatting_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_OnTypeFormatting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/OnTypeFormatting\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_OnTypeFormatting_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_OnTypeFormatting_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_Rename_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/Rename\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_Rename_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_Rename_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_PrepareRename_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/PrepareRename\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_PrepareRename_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_PrepareRename_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_FoldingRange_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/FoldingRange\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_FoldingRange_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_FoldingRange_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_SelectionRange_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/SelectionRange\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_SelectionRange_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_SelectionRange_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_PrepareCallHierarchy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/PrepareCallHierarchy\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_PrepareCallHierarchy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_PrepareCallHierarchy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CallHierarchyIncomingCalls_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CallHierarchyIncomingCalls\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CallHierarchyIncomingCalls_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CallHierarchyIncomingCalls_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\tmux.Handle(\"POST\", pattern_LanguageServerProtocol_CallHierarchyOutgoingCalls_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/protocol.rpc.LanguageServerProtocol/CallHierarchyOutgoingCalls\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LanguageServerProtocol_CallHierarchyOutgoingCalls_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LanguageServerProtocol_CallHierarchyOutgoingCalls_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "748628a09ac2b014057225e11aab7cef", "score": "0.53263485", "text": "func RegisterSketchitHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SketchitServer) error {\n\n\tmux.Handle(\"POST\", pattern_Sketchit_SayHello_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_SayHello_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_SayHello_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Sketchit_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Sketchit_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Sketchit_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Sketchit_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Sketchit_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Sketchit_ListCollections_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_ListCollections_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_ListCollections_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Sketchit_GetDeputy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Sketchit_GetDeputy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Sketchit_GetDeputy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "56c85bee6b2bf74f3947715ea3de72b6", "score": "0.530107", "text": "func ServerRegister(server *rpc.Server, rcvr interface{}) error", "title": "" }, { "docid": "0d335d5b806bddb68890b2fd3111df3c", "score": "0.5297463", "text": "func (s *GrpcServiceHandler) RegisterServer(ctx context.Context, server *grpc.Server) {\n\tpb.RegisterCardsServer(server, s)\n}", "title": "" }, { "docid": "c377b4e2fcc8f20fc483df28afaf5e57", "score": "0.52937955", "text": "func (s *Server) RegisterUnaryServerInterceptors(intr ...grpc.UnaryServerInterceptor) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif s.started {\n\t\ts.Fatal(errors.Reason(\"the server has already been started\").Err())\n\t}\n\ts.unaryInterceptors = append(s.unaryInterceptors, intr...)\n}", "title": "" }, { "docid": "a9f9a20cf184b05c131555cb84d42d03", "score": "0.5286831", "text": "func RegisterAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServer) error {\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateSchema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateSchema_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateSchema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListSchema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListSchema_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListSchema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetSchema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetSchema_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetSchema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteSchema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteSchema_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteSchema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_UpdateSchema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateSchema_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateSchema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_ListAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ListAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ListAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_UpdateAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_LaunchAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_LaunchAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_LaunchAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_ShutdownAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_ShutdownAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_ShutdownAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_RegisterPublicDID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_RegisterPublicDID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_RegisterPublicDID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetInvitationForAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetInvitationForAgent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetInvitationForAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "dde211e87dabf8896ba736817be23a2c", "score": "0.5279245", "text": "func RegisterLightsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LightsServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_LightsService_PreviewLight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_PreviewLight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_PreviewLight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_PlayLight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_PlayLight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_PlayLight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_StopLight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_StopLight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_StopLight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_ListLights_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_ListLights_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_ListLights_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_NewLight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_NewLight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_NewLight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_UpdateLight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_UpdateLight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_UpdateLight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_DeleteLights_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_DeleteLights_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_DeleteLights_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_LightsService_State_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_State_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_State_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_LightsService_Switch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_LightsService_Switch_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_LightsService_Switch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "7d954029b6eb403460de0b8948fda911", "score": "0.526733", "text": "func RegisterEPPProxyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EPPProxyServer) error {\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainCheck\", runtime.WithHTTPPathPattern(\"/domain/{name}/check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainCheck_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainClaimsCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainClaimsCheck\", runtime.WithHTTPPathPattern(\"/domain/{name}/claims_check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainClaimsCheck_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainClaimsCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainTrademarkCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainTrademarkCheck\", runtime.WithHTTPPathPattern(\"/domain/{name}/trademark_check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainTrademarkCheck_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainTrademarkCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainInfo\", runtime.WithHTTPPathPattern(\"/domain/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainCreate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainCreate\", runtime.WithHTTPPathPattern(\"/domain/{name}/create\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainCreate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainCreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainDelete\", runtime.WithHTTPPathPattern(\"/domain/{name}/delete\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainDelete_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainUpdate\", runtime.WithHTTPPathPattern(\"/domain/{name}/update\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainUpdate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainRenew_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainRenew\", runtime.WithHTTPPathPattern(\"/domain/{name}/renew\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainRenew_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainRenew_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainTransferQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainTransferQuery\", runtime.WithHTTPPathPattern(\"/domain/{name}/transfer\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainTransferQuery_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainTransferQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainTransferRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainTransferRequest\", runtime.WithHTTPPathPattern(\"/domain/{name}/transfer/request\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainTransferRequest_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainTransferRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainTransferCancel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainTransferCancel\", runtime.WithHTTPPathPattern(\"/domain/{name}/transfer/cancel\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainTransferCancel_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainTransferCancel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainTransferAccept_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainTransferAccept\", runtime.WithHTTPPathPattern(\"/domain/{name}/transfer/accept\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainTransferAccept_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainTransferAccept_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainTransferReject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainTransferReject\", runtime.WithHTTPPathPattern(\"/domain/{name}/transfer/reject\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainTransferReject_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainTransferReject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainRestoreRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainRestoreRequest\", runtime.WithHTTPPathPattern(\"/domain/{name}/restore\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainRestoreRequest_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainRestoreRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DomainSync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DomainSync\", runtime.WithHTTPPathPattern(\"/domain/{name}/sync\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DomainSync_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DomainSync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_HostCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/HostCheck\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{name}/check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_HostCheck_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_HostCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_HostInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/HostInfo\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_HostInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_HostInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_HostCreate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/HostCreate\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{name}/create\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_HostCreate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_HostCreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_HostDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/HostDelete\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{name}/delete\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_HostDelete_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_HostDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_HostUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/HostUpdate\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{name}/update\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_HostUpdate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_HostUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_ContactCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactCheck\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactCheck_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_ContactInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactInfo\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactCreate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactCreate\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/create\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactCreate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactCreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactDelete\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/delete\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactDelete_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactDelete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactUpdate\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/update\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactUpdate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactTransferQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactTransferQuery\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/transfer\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactTransferQuery_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactTransferQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactTransferRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactTransferRequest\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/transfer/request\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactTransferRequest_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactTransferRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactTransferAccept_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactTransferAccept\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/transfer/accept\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactTransferAccept_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactTransferAccept_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_ContactTransferReject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/ContactTransferReject\", runtime.WithHTTPPathPattern(\"/host/{registry_name}/{id}/transfer/reject\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_ContactTransferReject_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_ContactTransferReject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_MaintenanceList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/MaintenanceList\", runtime.WithHTTPPathPattern(\"/maintenance/{registry_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_MaintenanceList_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_MaintenanceList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_MaintenanceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/MaintenanceInfo\", runtime.WithHTTPPathPattern(\"/maintenance/{registry_name}/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_MaintenanceInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_MaintenanceInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_Poll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_NominetTagList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetTagList\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/tag_list\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetTagList_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetTagList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_NominetAccept_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetAccept\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/case/{case_id}/accept\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetAccept_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetAccept_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_NominetReject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetReject\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/case/{case_id}/reject\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetReject_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetReject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_NominetRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetRelease\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/release\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetRelease_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetRelease_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_NominetContactValidate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetContactValidate\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/contact_validate\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetContactValidate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetContactValidate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_NominetLock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetLock\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/lock\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetLock_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetLock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_NominetUnlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/NominetUnlock\", runtime.WithHTTPPathPattern(\"/nominet/{registry_name}/unlock\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_NominetUnlock_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_NominetUnlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_BalanceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/BalanceInfo\", runtime.WithHTTPPathPattern(\"/balance_info/{registry_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_BalanceInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_BalanceInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_HitPointsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/HitPointsInfo\", runtime.WithHTTPPathPattern(\"/hit_points_info/{registry_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_HitPointsInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_HitPointsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_RegistrationLimitInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/RegistrationLimitInfo\", runtime.WithHTTPPathPattern(\"/registration_limit_info/{registry_name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_RegistrationLimitInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_RegistrationLimitInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DNSQualityInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DNSQualityInfo\", runtime.WithHTTPPathPattern(\"/eurid/{registry_name}/dns_quality_info\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DNSQualityInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DNSQualityInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_DNSSECEligibilityInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DNSSECEligibilityInfo\", runtime.WithHTTPPathPattern(\"/eurid/{registry_name}/dnssec_eligibility_info\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DNSSECEligibilityInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DNSSECEligibilityInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_TMCHMarkCheck_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkCheck\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkCheck_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkCheck_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_TMCHMarkCreate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkCreate\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/create\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkCreate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkCreate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_TMCHMarkInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkInfo\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/info\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_TMCHMarkSMDInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkSMDInfo\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/info/smd\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkSMDInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkSMDInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_TMCHMarkEncodedSMDInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkEncodedSMDInfo\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/info/encoded_smd\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkEncodedSMDInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkEncodedSMDInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_TMCHMarkFileInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkFileInfo\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/info/file\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkFileInfo_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkFileInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_TMCHMarkUpdate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkUpdate\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/update\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkUpdate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkUpdate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_TMCHMarkRenew_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkRenew\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/renew\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkRenew_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkRenew_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_TMCHMarkTransferInitiate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkTransferInitiate\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/transfer/initiate\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkTransferInitiate_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkTransferInitiate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_EPPProxy_TMCHMarkTransfer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/TMCHMarkTransfer\", runtime.WithHTTPPathPattern(\"/tmch/{registry_name}/mark/{id}/transfer\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_TMCHMarkTransfer_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_TMCHMarkTransfer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_DACDomain_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DACDomain\", runtime.WithHTTPPathPattern(\"/dac/{registry_name}/{environment}/domain/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DACDomain_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DACDomain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_DACUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DACUsage\", runtime.WithHTTPPathPattern(\"/dac/{registry_name}/{environment}/usage\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DACUsage_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DACUsage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_EPPProxy_DACLimits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/epp.EPPProxy/DACLimits\", runtime.WithHTTPPathPattern(\"/dac/{registry_name}/{environment}/limits\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_EPPProxy_DACLimits_0(ctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_EPPProxy_DACLimits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "63c31697d4a60e6236f4df4672cc53a4", "score": "0.5263126", "text": "func RegisterSecretManagerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterSecretManagerServiceHandlerClient(ctx, mux, extSecretmanager.NewSecretManagerServiceClient(conn))\n}", "title": "" }, { "docid": "1770566047651a584c1d8e19a9fa3c86", "score": "0.52473754", "text": "func Register(server *rpc.Server, thing interface{}) (name string, err error) {\n\tnextLock.Lock()\n\tdefer nextLock.Unlock()\n\n\tswitch t := thing.(type) {\n\tcase terraform.ResourceProvider:\n\t\tname = fmt.Sprintf(\"Terraform%d\", nextId)\n\t\terr = server.RegisterName(name, &ResourceProviderServer{Provider: t})\n\tcase terraform.ResourceProvisioner:\n\t\tname = fmt.Sprintf(\"Terraform%d\", nextId)\n\t\terr = server.RegisterName(name, &ResourceProvisionerServer{Provisioner: t})\n\tdefault:\n\t\treturn \"\", errors.New(\"Unknown type to register for RPC server.\")\n\t}\n\n\tnextId += 1\n\treturn\n}", "title": "" }, { "docid": "efa49fcc43ef4a883fa3b9c5ade65f2b", "score": "0.5246372", "text": "func RegisterHandshakerServiceServer(s grpc.ServiceRegistrar, srv HandshakerServiceServer) {\n\tstr := &HandshakerServiceService{\n\t\tDoHandshake: srv.DoHandshake,\n\t}\n\tRegisterHandshakerServiceService(s, str)\n}", "title": "" }, { "docid": "1be27ded27f8a62d3ed6f4af293473a4", "score": "0.5245613", "text": "func RegisterFragmentationDeploymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FragmentationDeploymentServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_FragmentationDeploymentService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FragmentationDeploymentService_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FragmentationDeploymentService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_FragmentationDeploymentService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FragmentationDeploymentService_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FragmentationDeploymentService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_FragmentationDeploymentService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FragmentationDeploymentService_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FragmentationDeploymentService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_FragmentationDeploymentService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FragmentationDeploymentService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FragmentationDeploymentService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_FragmentationDeploymentService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_FragmentationDeploymentService_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_FragmentationDeploymentService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "cbf0de5f818aa5f9fb8724bd933a69cc", "score": "0.52276945", "text": "func (server *RPCServerWithMWs) RegistHandler(spec RPCSpec, handler RPCHandler) error {\n\tn := len(server.mws)\n\tfor i := n - 1; i >= 0; i-- {\n\t\thandler = server.mws[i](spec, handler)\n\t}\n\treturn server.server.RegistHandler(spec, handler)\n}", "title": "" }, { "docid": "d6076c5fd932efb633165be60fcbca7e", "score": "0.5214", "text": "func (svc Service) RegisterHTTPServices(ctx context.Context, mux *mux.Router, addr string, opts []grpc.DialOption, jwtMiddleware *jwtmiddleware.JWTMiddleware) {\n\t// get server mux\n\tgwmux := runtime.NewServeMux()\n\terr := pb.RegisterProfileHandlerFromEndpoint(ctx, gwmux, addr, opts)\n\tif err != nil {\n\t\tlog.Fatalf(\"RegisterGRPCGateway error : %s\\n\", err)\n\t}\n\n\t// prometheus instrument handler\n\tinstrf := prometheus.InstrumentHandlerFunc\n\n\t// HTTP/1.1 routes\n\t// status handler\n\tmux.\n\t\tHandleFunc(\"/status\", instrf(\"Http.Status\", controller.Status))\n\n\tmux.\n\t\tHandleFunc(\"/version\", instrf(\"Http.Version\", controller.Version))\n\n\tmux.\n\t\tHandleFunc(\"/\", instrf(\"Http.Root\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t// The \"/\" pattern matches everything not matched by previous handlers\n\t\t\tfmt.Fprintf(w, \"%s-%s OK\", svc.Name, svc.Version)\n\t\t}))\n\n\t// swagger doc handler\n\tmux.\n\t\tPathPrefix(\"/api/v1/swagger.json\").\n\t\tHandler(instrf(\"Api.Swagger\", controller.Swagger))\n\n\t// to declare an authenticated handler do something like this\n\t// if jwtMiddleware == nil {\n\t// mux.\n\t// PathPrefix(\"/<URL>\").\n\t// Handler(instrf(\"<METRICS_KEY>\", controller.<HTTP_HANDLER>))\n\t// } else {\n\t// mux.\n\t// PathPrefix(\"/<URL>\").\n\t// Handler(negroni.New(\n\t// negroni.HandlerFunc(jwtMiddleware.HandlerWithNext),\n\t// negroni.Wrap(instrf(\"<METRICS_KEY>\", controller.<HTTP_HANDLER>)),\n\t// ))\n\t// }\n\n\t// it's not necessary to use secure middleware for gRPC calls\n\t// api gateway handlers with metrics instrumentations\n\trouteMap := map[string]string{\n\t\t\"/api/v1/services/status\": \"Api.ServicesStatus\",\n\t\t\"/api/v1/create\": \"Api.Create\",\n\t\t\"/api/v1/read\": \"Api.Read\",\n\t\t\"/api/v1/list\": \"Api.List\",\n\t\t\"/api/v1/update\": \"Api.Update\",\n\t\t\"/api/v1/soft_delete\": \"Api.SoftDelete\",\n\t\t\"/api/v1/hard_delete\": \"Api.HardDelete\",\n\t\t\"/api/v1/version\": \"Api.Version\",\n\t}\n\tfor route, label := range routeMap {\n\t\tmux.PathPrefix(route).Handler(instrf(label, gwmux.ServeHTTP))\n\t}\n\n\t// prometheus metrics handler\n\tmux.\n\t\tHandle(\"/metrics\", prometheus.Handler())\n}", "title": "" }, { "docid": "e54e9ad5d671b193603652730663441e", "score": "0.52072024", "text": "func RegisterCollectorServiceHandler(r http.Router, srv CollectorServiceHandler, opts ...http.HandleOption) {\n}", "title": "" }, { "docid": "5518e6e5dbaa64b5a805df493c3d8616", "score": "0.5205537", "text": "func (g *Manager) RegisterServer() {\n\tg.runningServerWaitGroup.Add(1)\n}", "title": "" }, { "docid": "f416054882d197421d4d87ef92f0b6b0", "score": "0.5202593", "text": "func RegisterTrackingServerAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TrackingServerAPIServer) error {\n\n\tmux.Handle(\"GET\", pattern_TrackingServerAPI_Ping_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_TrackingServerAPI_Ping_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_TrackingServerAPI_Ping_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TrackingServerAPI_ActivationCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_TrackingServerAPI_ActivationCode_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_TrackingServerAPI_ActivationCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TrackingServerAPI_Credentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_TrackingServerAPI_Credentials_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_TrackingServerAPI_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TrackingServerAPI_RenewCredentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_TrackingServerAPI_RenewCredentials_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_TrackingServerAPI_RenewCredentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TrackingServerAPI_Record_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_TrackingServerAPI_Record_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_TrackingServerAPI_Record_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_TrackingServerAPI_NewIdentifier_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_TrackingServerAPI_NewIdentifier_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_TrackingServerAPI_NewIdentifier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "48dd1c6ab027f38c6fddb6e2a92fca77", "score": "0.51918024", "text": "func RegisterMetadataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MetadataServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetDatasetById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetDatasetById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetDatasetById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetDatasetByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetDatasetByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetDatasetByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_ListDatasets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_ListDatasets_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_ListDatasets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterDataset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterDataset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterDataset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterDatasetWithCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterDatasetWithCatalog_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterDatasetWithCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterDatasets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterDatasets_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterDatasets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_UpdateDataset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_UpdateDataset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_UpdateDataset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteDatasetById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteDatasetById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteDatasetById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteDatasetByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteDatasetByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteDatasetByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetModelRelationById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetModelRelationById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetModelRelationById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetModelRelationByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetModelRelationByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetModelRelationByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_ListModelRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_ListModelRelation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_ListModelRelation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterModelRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterModelRelation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterModelRelation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteModelRelationById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteModelRelationById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteModelRelationById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteModelRelationByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteModelRelationByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteModelRelationByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetModelById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetModelById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetModelById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetModelByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetModelByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetModelByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterModel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterModel_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterModel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteModelById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteModelById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteModelById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteModelByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteModelByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteModelByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetModelVersionRelationByVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetModelVersionRelationByVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetModelVersionRelationByVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_ListModelVersionRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_ListModelVersionRelation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_ListModelVersionRelation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterModelVersionRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterModelVersionRelation_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterModelVersionRelation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteModelVersionRelationByVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteModelVersionRelationByVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteModelVersionRelationByVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetModelVersionByVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetModelVersionByVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetModelVersionByVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterModelVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteModelVersionByVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteModelVersionByVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteModelVersionByVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetDeployedModelVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetDeployedModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetDeployedModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetLatestValidatedModelVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetLatestValidatedModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetLatestValidatedModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetLatestGeneratedModelVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetLatestGeneratedModelVersion_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetLatestGeneratedModelVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetProjectById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetProjectById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetProjectById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetProjectByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetProjectByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetProjectByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_UpdateProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_UpdateProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_UpdateProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_ListProject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_ListProject_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_ListProject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteProjectById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteProjectById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteProjectById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteProjectByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteProjectByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteProjectByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetArtifactById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetArtifactById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetArtifactById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetArtifactByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetArtifactByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetArtifactByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_UpdateArtifact_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_UpdateArtifact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_UpdateArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterArtifact_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterArtifact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_ListArtifact_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_ListArtifact_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_ListArtifact_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteArtifactById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteArtifactById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteArtifactById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteArtifactByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteArtifactByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteArtifactByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_RegisterWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_RegisterWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_RegisterWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_UpdateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_UpdateWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_UpdateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetWorkflowById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetWorkflowById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetWorkflowById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_GetWorkflowByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_GetWorkflowByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_GetWorkflowByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteWorkflowById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteWorkflowById_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteWorkflowById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_MetadataService_DeleteWorkflowByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_DeleteWorkflowByName_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_DeleteWorkflowByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_MetadataService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_MetadataService_ListWorkflows_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_MetadataService_ListWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "0e5a6f371f67057ecb08fede09aa584e", "score": "0.519165", "text": "func RegisterImmuServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterImmuServiceHandlerClient(ctx, mux, NewImmuServiceClient(conn))\n}", "title": "" }, { "docid": "1595df3fc02c4c5b1b5aeb1afe06f377", "score": "0.51833534", "text": "func RegisterPetStoreHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PetStoreServer) error {\n\n\tmux.Handle(\"GET\", pattern_PetStore_GetPet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pet.v1.PetStore/GetPet\", runtime.WithHTTPPathPattern(\"/pet/get\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PetStore_GetPet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PetStore_GetPet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_PetStore_PutPet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pet.v1.PetStore/PutPet\", runtime.WithHTTPPathPattern(\"/pet/put\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PetStore_PutPet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PetStore_PutPet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_PetStore_DeletePet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pet.v1.PetStore/DeletePet\", runtime.WithHTTPPathPattern(\"/pet/delete\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PetStore_DeletePet_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PetStore_DeletePet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "12d63c45115e335cdbb6b0c4ef0f3480", "score": "0.5180144", "text": "func RegisterServiceServerOption(f func(*grpc.Server)) grpc.ServerOption {\n\treturn &registerServiceServerOption{f: f}\n}", "title": "" }, { "docid": "a641e6c1544464a0d3fb9c4acb26bc06", "score": "0.5179402", "text": "func (s *Server) RegisterUnifiedServerInterceptors(intr ...grpcutil.UnifiedServerInterceptor) {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\tif s.started {\n\t\ts.Fatal(errors.Reason(\"the server has already been started\").Err())\n\t}\n\tfor _, cb := range intr {\n\t\ts.unaryInterceptors = append(s.unaryInterceptors, cb.Unary())\n\t\ts.streamInterceptors = append(s.streamInterceptors, cb.Stream())\n\t}\n}", "title": "" }, { "docid": "e877f8a85d8569f2ad63db40b923dc22", "score": "0.5177702", "text": "func RegisterServer(s *http.Server, srv *rest.Server) {\n\tregister(s, newSettingsServer(srv))\n}", "title": "" }, { "docid": "0cb607a8d4f45a772338eb5313317304", "score": "0.5170966", "text": "func RegisterABitOfEverythingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ABitOfEverythingServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Create\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value=strprefix/*}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{enum_value_annotation}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Create_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_CreateBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CreateBody\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CreateBody_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CreateBody_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_CreateBook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CreateBook\", runtime.WithHTTPPathPattern(\"/v1/{parent=publishers/*}/books\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CreateBook_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CreateBook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_ABitOfEverythingService_UpdateBook_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/UpdateBook\", runtime.WithHTTPPathPattern(\"/v1/{book.name=publishers/*/books/*}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_UpdateBook_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_UpdateBook_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_Lookup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Lookup\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Lookup_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Lookup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_Custom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Custom\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}:custom\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Custom_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Custom_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_DoubleColon_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/DoubleColon\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}:custom:custom\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_DoubleColon_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_DoubleColon_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ABitOfEverythingService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Update\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Update_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Update_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ABitOfEverythingService_UpdateV2_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/UpdateV2\", runtime.WithHTTPPathPattern(\"/v2/example/a_bit_of_everything/{abe.uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_UpdateV2_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_UpdateV2_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_ABitOfEverythingService_UpdateV2_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/UpdateV2\", runtime.WithHTTPPathPattern(\"/v2/example/a_bit_of_everything/{abe.uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_UpdateV2_1(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_UpdateV2_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_ABitOfEverythingService_UpdateV2_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/UpdateV2\", runtime.WithHTTPPathPattern(\"/v2a/example/a_bit_of_everything/{abe.uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_UpdateV2_2(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_UpdateV2_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ABitOfEverythingService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Delete\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_GetQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/GetQuery\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/query/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_GetQuery_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_GetQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_GetRepeatedQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/GetRepeatedQuery\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything_repeated/{path_repeated_float_value}/{path_repeated_double_value}/{path_repeated_int64_value}/{path_repeated_uint64_value}/{path_repeated_int32_value}/{path_repeated_fixed64_value}/{path_repeated_fixed32_value}/{path_repeated_bool_value}/{path_repeated_string_value}/{path_repeated_bytes_value}/{path_repeated_uint32_value}/{path_repeated_enum_value}/{path_repeated_sfixed32_value}/{path_repeated_sfixed64_value}/{path_repeated_sint32_value}/{path_repeated_sint64_value}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_GetRepeatedQuery_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_GetRepeatedQuery_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_Echo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Echo\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/echo/{value}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Echo_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Echo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_Echo_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Echo\", runtime.WithHTTPPathPattern(\"/v2/example/echo\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Echo_1(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Echo_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_Echo_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Echo\", runtime.WithHTTPPathPattern(\"/v2/example/echo\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Echo_2(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Echo_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_DeepPathEcho_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/DeepPathEcho\", runtime.WithHTTPPathPattern(\"/v1/example/deep_path/{single_nested.name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_DeepPathEcho_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_DeepPathEcho_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_Timeout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Timeout\", runtime.WithHTTPPathPattern(\"/v2/example/timeout\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Timeout_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Timeout_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_ErrorWithDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/ErrorWithDetails\", runtime.WithHTTPPathPattern(\"/v2/example/errorwithdetails\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_ErrorWithDetails_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_ErrorWithDetails_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_GetMessageWithBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/GetMessageWithBody\", runtime.WithHTTPPathPattern(\"/v2/example/withbody/{id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_GetMessageWithBody_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_GetMessageWithBody_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_PostWithEmptyBody_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/PostWithEmptyBody\", runtime.WithHTTPPathPattern(\"/v2/example/postwithemptybody/{name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_PostWithEmptyBody_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_PostWithEmptyBody_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_CheckGetQueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CheckGetQueryParams\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/params/get/{single_nested.name}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CheckGetQueryParams_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CheckGetQueryParams_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CheckNestedEnumGetQueryParams\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/params/get/nested_enum/{single_nested.ok}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CheckNestedEnumGetQueryParams_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_CheckPostQueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CheckPostQueryParams\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/params/post/{string_value}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CheckPostQueryParams_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CheckPostQueryParams_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_OverwriteRequestContentType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/OverwriteRequestContentType\", runtime.WithHTTPPathPattern(\"/v2/example/overwriterequestcontenttype\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_OverwriteRequestContentType_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_OverwriteRequestContentType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_OverwriteResponseContentType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/OverwriteResponseContentType\", runtime.WithHTTPPathPattern(\"/v2/example/overwriteresponsecontenttype\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_OverwriteResponseContentType_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_OverwriteResponseContentType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_CheckExternalPathEnum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CheckExternalPathEnum\", runtime.WithHTTPPathPattern(\"/v2/{value}:check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CheckExternalPathEnum_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CheckExternalPathEnum_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_CheckExternalNestedPathEnum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CheckExternalNestedPathEnum\", runtime.WithHTTPPathPattern(\"/v3/{value}:check\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CheckExternalNestedPathEnum_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CheckExternalNestedPathEnum_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ABitOfEverythingService_CheckStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CheckStatus\", runtime.WithHTTPPathPattern(\"/v1/example/checkStatus\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CheckStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CheckStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"HEAD\", pattern_ABitOfEverythingService_Exists_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/Exists\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_Exists_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_Exists_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"OPTIONS\", pattern_ABitOfEverythingService_CustomOptionsRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/CustomOptionsRequest\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_CustomOptionsRequest_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_CustomOptionsRequest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"TRACE\", pattern_ABitOfEverythingService_TraceRequest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/TraceRequest\", runtime.WithHTTPPathPattern(\"/v1/example/a_bit_of_everything/{uuid}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_TraceRequest_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_TraceRequest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_PostOneofEnum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/PostOneofEnum\", runtime.WithHTTPPathPattern(\"/v1/example/oneofenum\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_PostOneofEnum_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_PostOneofEnum_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ABitOfEverythingService_PostRequiredMessageType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.ABitOfEverythingService/PostRequiredMessageType\", runtime.WithHTTPPathPattern(\"/v1/example/requiredmessagetype\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ABitOfEverythingService_PostRequiredMessageType_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ABitOfEverythingService_PostRequiredMessageType_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "645b910b0a187cd8721d1c659d57494a", "score": "0.5153874", "text": "func RegisterServer(s *http.Server, srv *rest.Server) {\n\tregister(s, newUserServer(srv))\n}", "title": "" }, { "docid": "4bd1b3dc91c3ca29440e7f707020e9aa", "score": "0.51450384", "text": "func RegisterServer(s *grpc.Server, srv Server) {\n\totlpcollectormetrics.RegisterMetricsServiceServer(s, &rawMetricsServer{srv: srv})\n}", "title": "" }, { "docid": "f8164a6b3f672e1ff4d81bd007d166eb", "score": "0.51439726", "text": "func RegisterSettlementAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SettlementAPIServer) error {\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_ToAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_ToAddress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_ToAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetSettlementRewardsBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetSettlementRewardsBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetSettlementRewardsBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetCreateContractBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetCreateContractBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetCreateContractBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetSignContractBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetSignContractBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetSignContractBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetAddPreStopBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAddPreStopBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAddPreStopBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetRemovePreStopBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetRemovePreStopBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetRemovePreStopBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetUpdatePreStopBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetUpdatePreStopBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetUpdatePreStopBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetAddNextStopBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAddNextStopBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAddNextStopBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetRemoveNextStopBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetRemoveNextStopBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetRemoveNextStopBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetUpdateNextStopBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetUpdateNextStopBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetUpdateNextStopBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetAllContracts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAllContracts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAllContracts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetContractsByAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetContractsByAddress_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetContractsByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetContractsByStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetContractsByStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetContractsByStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetExpiredContracts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetExpiredContracts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetExpiredContracts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetContractsAsPartyA_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetContractsAsPartyA_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetContractsAsPartyA_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetContractsAsPartyB_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetContractsAsPartyB_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetContractsAsPartyB_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetContractAddressByPartyANextStop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetContractAddressByPartyANextStop_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetContractAddressByPartyANextStop_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetContractAddressByPartyBPreStop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetContractAddressByPartyBPreStop_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetContractAddressByPartyBPreStop_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetProcessCDRBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetProcessCDRBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetProcessCDRBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_SettlementAPI_GetTerminateContractBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetTerminateContractBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetTerminateContractBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetCDRStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetCDRStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetCDRStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetCDRStatusByCdrData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetCDRStatusByCdrData_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetCDRStatusByCdrData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetCDRStatusByDate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetCDRStatusByDate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetCDRStatusByDate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetAllCDRStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAllCDRStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAllCDRStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetMultiPartyCDRStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetMultiPartyCDRStatus_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetMultiPartyCDRStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetSummaryReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetSummaryReport_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetSummaryReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetSummaryReportByAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetSummaryReportByAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetSummaryReportByAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetSummaryReportByCustomer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetSummaryReportByCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetSummaryReportByCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GenerateInvoices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GenerateInvoices_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GenerateInvoices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GenerateInvoicesByAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GenerateInvoicesByAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GenerateInvoicesByAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GenerateInvoicesByCustomer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GenerateInvoicesByCustomer_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GenerateInvoicesByCustomer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GenerateInvoicesByContract_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GenerateInvoicesByContract_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GenerateInvoicesByContract_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GenerateMultiPartyInvoice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GenerateMultiPartyInvoice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GenerateMultiPartyInvoice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GenerateMultiPartySummaryReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GenerateMultiPartySummaryReport_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GenerateMultiPartySummaryReport_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetPreStopNames_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetPreStopNames_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetPreStopNames_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetNextStopNames_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetNextStopNames_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetNextStopNames_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetRegisterAssetBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetRegisterAssetBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetRegisterAssetBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetAllAssets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAllAssets_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAllAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetAssetsByOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAssetsByOwner_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAssetsByOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_SettlementAPI_GetAsset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SettlementAPI_GetAsset_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SettlementAPI_GetAsset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "3781a191f079f87e9df87d575a41e89a", "score": "0.51395696", "text": "func RegisterItemServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ItemServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_ItemService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pkg.proto.order.item.v1.ItemService/Get\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ItemService_Get_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ItemService_Get_0(ctx, mux, outboundMarshaler, w, req, response_ItemService_Get_0{resp}, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ItemService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pkg.proto.order.item.v1.ItemService/List\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ItemService_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ItemService_List_0(ctx, mux, outboundMarshaler, w, req, response_ItemService_List_0{resp}, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ItemService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pkg.proto.order.item.v1.ItemService/Create\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ItemService_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ItemService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ItemService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pkg.proto.order.item.v1.ItemService/Update\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ItemService_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ItemService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ItemService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/pkg.proto.order.item.v1.ItemService/Delete\")\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ItemService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ItemService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "53d883aad975464ae4603b65c740d908", "score": "0.5137919", "text": "func RegisterMiddleware(svr Server, serviceName, method string, middleware ...string) {\n\tif e, ok := svr.(handlers.Middlewareable); ok {\n\t\te.AddMiddleware(serviceName, method, middleware...)\n\t}\n}", "title": "" }, { "docid": "32d40c8b37ca914b67a56bfd26157cb3", "score": "0.5122468", "text": "func RegisterControlServiceServer(s *grpc.Server, srv ControlServiceServer) {\n\tsrc.RegisterControlServiceServer(s, srv)\n}", "title": "" }, { "docid": "4d296f12ed3cec3bd39071bd21e8bd76", "score": "0.51197845", "text": "func RegisterWechatBMServer(e *bm.Engine, server WechatBMServer) {\n\tWechatSvc = server\n\te.GET(\"/demo.service.v1.Wechat/MatchedTemplateMsgSend\", wechatMatchedTemplateMsgSend)\n\te.GET(\"/demo.service.v1.Wechat/BalanceTemplateMsgSend\", wechatBalanceTemplateMsgSend)\n}", "title": "" }, { "docid": "8aaad9915a48717fcf01b91ddcc1d6f0", "score": "0.5105929", "text": "func RegisterSkinHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SkinServer) error {\n\n\tmux.Handle(\"GET\", pattern_Skin_GetSkins_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Skin_GetSkins_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Skin_GetSkins_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Skin_GetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Skin_GetInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Skin_GetInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Skin_SetUsedSkin_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Skin_SetUsedSkin_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Skin_SetUsedSkin_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "9c7bd3a41954e0c6310d2e871c190587", "score": "0.5092162", "text": "func RegisterStoreServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StoreServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_StoreService_CreateStoreDry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_StoreService_CreateStoreDry_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_StoreService_CreateStoreDry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_StoreService_CreateStore_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_StoreService_CreateStore_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_StoreService_CreateStore_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_StoreService_UpdateStore_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_StoreService_UpdateStore_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_StoreService_UpdateStore_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_StoreService_ListStores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_StoreService_ListStores_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_StoreService_ListStores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_StoreService_GetStore_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_StoreService_GetStore_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_StoreService_GetStore_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "32ef2e0c88d81f5ed935b09171987ee3", "score": "0.5091432", "text": "func RegisterService(server *grpc.Server, director StreamDirector, serviceName string, methodNames ...string) {\n\tstreamer := &handler{director}\n\tfakeDesc := &grpc.ServiceDesc{\n\t\tServiceName: serviceName,\n\t\tHandlerType: (*interface{})(nil),\n\t}\n\tfor _, m := range methodNames {\n\t\tstreamDesc := grpc.StreamDesc{\n\t\t\tStreamName: m,\n\t\t\tHandler: streamer.handler,\n\t\t\tServerStreams: true,\n\t\t\tClientStreams: true,\n\t\t}\n\t\tfakeDesc.Streams = append(fakeDesc.Streams, streamDesc)\n\t}\n\tserver.RegisterService(fakeDesc, streamer)\n}", "title": "" }, { "docid": "296ee12e8248239b7fb23f1c9a2608c8", "score": "0.5085447", "text": "func RegisterPodiumHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PodiumServer) error {\n\n\tmux.Handle(\"DELETE\", pattern_Podium_RemoveLeaderboard_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/RemoveLeaderboard\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_RemoveLeaderboard_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_RemoveLeaderboard_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Podium_BulkUpsertScores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/BulkUpsertScores\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/scores\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_BulkUpsertScores_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_BulkUpsertScores_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Podium_UpsertScore_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/UpsertScore\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members/{member_public_id}/score\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_UpsertScore_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_UpsertScore_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_TotalMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/TotalMembers\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members-count\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_TotalMembers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_TotalMembers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_Podium_IncrementScore_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/IncrementScore\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members/{member_public_id}/score\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_IncrementScore_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_IncrementScore_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetMember_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetMember\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members/{member_public_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetMember_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetMember_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetMembers\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetMembers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetMembers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Podium_RemoveMember_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/RemoveMember\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members/{member_public_id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_RemoveMember_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_RemoveMember_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Podium_RemoveMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/RemoveMembers\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_RemoveMembers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_RemoveMembers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetRank_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetRank\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members/{member_public_id}/rank\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetRank_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetRank_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetAroundMember_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetAroundMember\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/members/{member_public_id}/around\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetAroundMember_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetAroundMember_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetAroundScore_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetAroundScore\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/scores/{score}/around\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetAroundScore_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetAroundScore_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetTopMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetTopMembers\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/top/{page_number}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetTopMembers_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetTopMembers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetTopPercentage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetTopPercentage\", runtime.WithHTTPPathPattern(\"/l/{leaderboard_id}/top-percent/{percentage}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetTopPercentage_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetTopPercentage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Podium_UpsertScoreMultiLeaderboards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/UpsertScoreMultiLeaderboards\", runtime.WithHTTPPathPattern(\"/m/{member_public_id}/scores\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_UpsertScoreMultiLeaderboards_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_UpsertScoreMultiLeaderboards_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Podium_GetRankMultiLeaderboards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/podium.api.v1.Podium/GetRankMultiLeaderboards\", runtime.WithHTTPPathPattern(\"/m/{member_public_id}/scores\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Podium_GetRankMultiLeaderboards_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Podium_GetRankMultiLeaderboards_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "2e593426c13df54f7cc4fd71fdb5cfdb", "score": "0.50781494", "text": "func (server *Server) AddStatusHandlers(mux *http.ServeMux) {\n\n\tstats := func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.Header().Set(\"Cache-Control\", \"private, max-age=0, no-cache\")\n\t\tfmt.Fprintf(w, server.StatsJsonString())\n\t}\n\tstatus := func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Cache-Control\", \"private, max-age=0, no-cache\")\n\t\thave_s := 0\n\t\tif server.DevNullOut {\n\t\t\tfmt.Fprintf(w, \"ok (/dev/null)\")\n\t\t\treturn\n\t\t}\n\t\tfor _, hasher := range server.Hashers {\n\t\t\thave_s += len(hasher.Members())\n\t\t}\n\t\tif have_s <= 0 {\n\t\t\thttp.Error(w, \"all servers down\", http.StatusServiceUnavailable)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Fprintf(w, \"ok\")\n\t\t}\n\t}\n\n\t// add a new hasher node to a server dynamically\n\taddnode := func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Cache-Control\", \"private, max-age=0, no-cache\")\n\n\t\tif server.DevNullOut {\n\t\t\thttp.Error(w, \"This is a /dev/null server .. cannot add\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tr.ParseForm()\n\t\tserver_str := strings.TrimSpace(r.Form.Get(\"server\"))\n\t\tif len(server_str) == 0 {\n\t\t\thttp.Error(w, \"Invalid server name\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tserver_url, err := url.Parse(server_str)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"Not a valid server URL\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tchk_server_str := strings.TrimSpace(r.Form.Get(\"check_server\"))\n\t\tif len(chk_server_str) == 0 {\n\t\t\tchk_server_str = server_str\n\t\t}\n\t\tchk_server_url, err := url.Parse(chk_server_str)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"Not a valid Check server URL\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tif chk_server_url.Scheme != \"tcp\" && chk_server_url.Scheme != \"http\" {\n\t\t\thttp.Error(w, \"Check server can only be TCP or HTTP\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\t// since we can have replicas .. need an index to add it to\n\t\treplica_str := r.Form.Get(\"replica\")\n\t\tif len(replica_str) == 0 {\n\t\t\treplica_str = \"0\"\n\t\t}\n\t\treplica_int, err := strconv.Atoi(replica_str)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"Replica index is not an int\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tif replica_int > len(server.Hashers)-1 {\n\t\t\thttp.Error(w, \"Replica index Too large\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tif replica_int < 0 {\n\t\t\thttp.Error(w, \"Replica index Too small\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\t//we can also accept a hash key for that server\n\t\thash_key_str := r.Form.Get(\"hashkey\")\n\t\tif len(hash_key_str) == 0 {\n\t\t\thash_key_str = server_str\n\t\t}\n\n\t\tserver.Hashers[replica_int].AddServer(server_url, chk_server_url, hash_key_str)\n\t\tfmt.Fprintf(w, \"Server \"+server_str+\" Added\")\n\t}\n\n\t// add a new hasher node to a server dynamically\n\tpurgenode := func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Cache-Control\", \"private, max-age=0, no-cache\")\n\t\tif server.DevNullOut {\n\t\t\thttp.Error(w, \"This is a /dev/null server .. cannot purge\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tr.ParseForm()\n\t\tserver_str := strings.TrimSpace(r.Form.Get(\"server\"))\n\t\tif len(server_str) == 0 {\n\t\t\thttp.Error(w, \"Invalid server name\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tserver_url, err := url.Parse(server_str)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"Not a valid server URL\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\t// since we can have replicas .. need an index to add it to\n\t\treplica_str := r.Form.Get(\"replica\")\n\t\tif len(replica_str) == 0 {\n\t\t\treplica_str = \"0\"\n\t\t}\n\t\treplica_int, err := strconv.Atoi(replica_str)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"Replica index is not an int\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tif replica_int > len(server.Hashers)-1 {\n\t\t\thttp.Error(w, \"Replica index Too large\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tif replica_int < 0 {\n\t\t\thttp.Error(w, \"Replica index Too small\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tserver.Hashers[replica_int].PurgeServer(server_url)\n\n\t\t// we need to CLOSE and thing in the Outpool\n\t\tif serv, ok := server.Outpool[server_str]; ok {\n\t\t\tserv.DestroyAll()\n\t\t\tdelete(server.Outpool, server_str)\n\t\t}\n\n\t\tfmt.Fprintf(w, \"Server \"+server_str+\" Purged\")\n\t}\n\n\t// accumulator pokers\n\tif server.PreRegFilter == nil || server.PreRegFilter.Accumulator == nil {\n\t\t// \"nothing to see here\"\n\t\tnullacc := func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Header().Set(\"Cache-Control\", \"private, max-age=0, no-cache\")\n\t\t\thttp.Error(w, \"No accumulators defined\", http.StatusNotImplemented)\n\t\t\treturn\n\t\t}\n\t\thttp.HandleFunc(fmt.Sprintf(\"/%s/accumulator\", server.Name), nullacc)\n\t} else {\n\t\tstats := func(w http.ResponseWriter, r *http.Request) {\n\t\t\tw.Header().Set(\"Cache-Control\", \"private, max-age=0, no-cache\")\n\t\t\tstats, err := json.Marshal(server.PreRegFilter.Accumulator.CurrentStats())\n\t\t\tif err != nil {\n\t\t\t\thttp.Error(w, fmt.Sprintf(\"%v\", err), http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfmt.Fprintf(w, string(stats))\n\t\t\treturn\n\t\t}\n\t\thttp.HandleFunc(fmt.Sprintf(\"/%s/accumulator\", server.Name), stats)\n\t}\n\n\t//stats and status\n\tmux.HandleFunc(fmt.Sprintf(\"/%s\", server.Name), stats)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/ops/status\", server.Name), status)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/ping\", server.Name), status)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/ops/status/\", server.Name), status)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/status\", server.Name), status)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/stats/\", server.Name), stats)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/stats\", server.Name), stats)\n\n\t//admin like functions to add and remove servers to a hashring\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/addserver\", server.Name), addnode)\n\tmux.HandleFunc(fmt.Sprintf(\"/%s/purgeserver\", server.Name), purgenode)\n}", "title": "" }, { "docid": "99edb671220e4e45fb3ce9b603c56885", "score": "0.5075498", "text": "func RegisterClusterManagerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ClusterManagerServer) error {\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_CreateKeyPair_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_CreateKeyPair_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_CreateKeyPair_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ClusterManager_DeleteKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DeleteKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DeleteKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_AttachKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_AttachKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_AttachKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_DetachKeyPairs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DetachKeyPairs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DetachKeyPairs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeSubnets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeSubnets_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeSubnets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_CreateCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_CreateCluster_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_CreateCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_CreateDebugCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_CreateDebugCluster_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_CreateDebugCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_ModifyClusterAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_ModifyClusterAttributes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_ModifyClusterAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_ModifyClusterNodeAttributes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_ModifyClusterNodeAttributes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_ModifyClusterNodeAttributes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_DeleteClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DeleteClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DeleteClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_UpgradeCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_UpgradeCluster_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_UpgradeCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_RollbackCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_RollbackCluster_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_RollbackCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_ResizeCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_ResizeCluster_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_ResizeCluster_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_AddClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_AddClusterNodes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_AddClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_DeleteClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DeleteClusterNodes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DeleteClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PATCH\", pattern_ClusterManager_UpdateClusterEnv_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_UpdateClusterEnv_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_UpdateClusterEnv_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeDebugClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeDebugClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeDebugClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeAppClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeAppClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeAppClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeDebugAppClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeDebugAppClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeDebugAppClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_DescribeClusterNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_DescribeClusterNodes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_DescribeClusterNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_StopClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_StopClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_StopClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_StartClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_StartClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_StartClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_RecoverClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_RecoverClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_RecoverClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ClusterManager_CeaseClusters_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_CeaseClusters_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_CeaseClusters_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ClusterManager_GetClusterStatistics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ClusterManager_GetClusterStatistics_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ClusterManager_GetClusterStatistics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "291fba1be1373294015c46262a388016", "score": "0.50720996", "text": "func (s Short) RegisterServers(server *grpc.Server) {\n\tproto.RegisterMetaTagServiceServer(server, s.metaTagServer)\n}", "title": "" }, { "docid": "15d2f316f3eb17fd10f974ac40fde75a", "score": "0.5069869", "text": "func (fn RPCServerFunc) RegistHandler(spec RPCSpec, handler RPCHandler) error {\n\treturn fn(spec, handler)\n}", "title": "" }, { "docid": "d6a7a3cc5ea3de73238e6bd293228de9", "score": "0.50693834", "text": "func makeRegisterHandler(m *mux.Router, endpoints endpoint.Endpoints, options []http.ServerOption) {\n\tm.Methods(\"POST\").Path(\"/register\").Handler(handlers.CORS(handlers.AllowedMethods([]string{\"POST\"}), handlers.AllowedOrigins([]string{\"*\"}))(http.NewServer(endpoints.RegisterEndpoint, decodeRegisterRequest, encodeRegisterResponse, options...)))\n}", "title": "" }, { "docid": "ef52c71d853264bc63ead1540249bd99", "score": "0.5064217", "text": "func RegisterHandlers(ctx context.Context, svc FacebookFriendsService, serverOpts *kitworker.ServerOption, logger log.Logger) {\n\thttp.Handle(NewCreateHandler(ctx, svc, serverOpts, logger))\n\thttp.Handle(NewDeleteHandler(ctx, svc, serverOpts, logger))\n\thttp.Handle(NewMutualsHandler(ctx, svc, serverOpts, logger))\n\thttp.Handle(NewOneHandler(ctx, svc, serverOpts, logger))\n}", "title": "" }, { "docid": "ee01e0fd6546a39a1349327f293a5d83", "score": "0.5062792", "text": "func RegisterTeamsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TeamsServer) error {\n\n\tmux.Handle(\"POST\", pattern_Teams_CreateTeam_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_CreateTeam_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_CreateTeam_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Teams_ListTeams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_ListTeams_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_ListTeams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Teams_GetTeam_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_GetTeam_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_GetTeam_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Teams_UpdateTeam_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_UpdateTeam_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_UpdateTeam_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Teams_DeleteTeam_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_DeleteTeam_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_DeleteTeam_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Teams_GetTeamMembership_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_GetTeamMembership_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_GetTeamMembership_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Teams_AddTeamMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_AddTeamMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_AddTeamMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Teams_RemoveTeamMembers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_RemoveTeamMembers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_RemoveTeamMembers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Teams_GetTeamsForMember_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Teams_GetTeamsForMember_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Teams_GetTeamsForMember_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "9033c98658aff23cee60f522a3dd837a", "score": "0.50542223", "text": "func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProductServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_ProductService_CreateProductSchemaDry_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_CreateProductSchemaDry_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_CreateProductSchemaDry_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ProductService_CreateProductSchema_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_CreateProductSchema_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_CreateProductSchema_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ProductService_CreateUpload_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_CreateUpload_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_CreateUpload_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ProductService_CreateProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_CreateProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_CreateProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ProductService_UpdateProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_UpdateProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_UpdateProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ProductService_ListProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_ListProducts_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_ListProducts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ProductService_GetProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_ProductService_GetProduct_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ProductService_GetProduct_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "7bfa8f66c3cad3ad42ced5c6d317f22f", "score": "0.50480324", "text": "func RegisterServerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {\n\tconn, err := grpc.Dial(endpoint, opts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tgo func() {\n\t\t\t<-ctx.Done()\n\t\t\tif cerr := conn.Close(); cerr != nil {\n\t\t\t\tgrpclog.Infof(\"Failed to close conn to %s: %v\", endpoint, cerr)\n\t\t\t}\n\t\t}()\n\t}()\n\n\treturn RegisterServerServiceHandler(ctx, mux, conn)\n}", "title": "" }, { "docid": "a59acabe42db23f2ae47e779d8d708c0", "score": "0.504159", "text": "func RegisterInventoryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InventoryServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_InventoryService_CreateInventory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryService_CreateInventory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryService_CreateInventory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InventoryService_GetInventory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryService_GetInventory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryService_GetInventory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InventoryService_ListInventories_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryService_ListInventories_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryService_ListInventories_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_InventoryService_ItemEvent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryService_ItemEvent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryService_ItemEvent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_InventoryService_StoreEvent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryService_StoreEvent_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryService_StoreEvent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "c7c325efbe04434c57acad20692f2542", "score": "0.50359666", "text": "func RegisterPublicKeyDistributionAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PublicKeyDistributionAPIServer) error {\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetVerifierRegisterBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetVerifierRegisterBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetVerifierRegisterBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetVerifierUnregisterBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetVerifierUnregisterBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetVerifierUnregisterBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetAllVerifiers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetAllVerifiers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetAllVerifiers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetVerifiersByType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetVerifiersByType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetVerifiersByType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetActiveVerifiers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetActiveVerifiers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetActiveVerifiers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetVerifiersByAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetVerifiersByAccount_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetVerifiersByAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetVerifierStateByBlockHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetVerifierStateByBlockHeight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetVerifierStateByBlockHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetAllVerifierStatesByBlockHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetAllVerifierStatesByBlockHeight_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetAllVerifierStatesByBlockHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_PublicKeyDistributionAPI_GetPublishBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetPublishBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetPublishBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_PublicKeyDistributionAPI_GetUnPublishBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetUnPublishBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetUnPublishBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetPubKeyByTypeAndID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetPubKeyByTypeAndID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetPubKeyByTypeAndID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetRecommendPubKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetRecommendPubKey_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetRecommendPubKey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetPublishInfosByType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetPublishInfosByType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetPublishInfosByType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetPublishInfosByAccountAndType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetPublishInfosByAccountAndType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetPublishInfosByAccountAndType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetOracleBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetOracleBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetOracleBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetOracleInfosByType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetOracleInfosByType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetOracleInfosByType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_PublicKeyDistributionAPI_GetOracleInfosByTypeAndID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetOracleInfosByTypeAndID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetOracleInfosByTypeAndID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetOracleInfosByAccountAndType_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetOracleInfosByAccountAndType_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetOracleInfosByAccountAndType_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetOracleInfosByHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetOracleInfosByHash_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetOracleInfosByHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_PackRewardData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_PackRewardData_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_PackRewardData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_UnpackRewardData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_UnpackRewardData_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_UnpackRewardData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetRewardSendBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetRewardSendBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetRewardSendBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_PublicKeyDistributionAPI_GetRewardRecvBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetRewardRecvBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetRewardRecvBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetRewardRecvBlockBySendHash_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetRewardRecvBlockBySendHash_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetRewardRecvBlockBySendHash_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetRewardHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetRewardHistory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetRewardHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_PublicKeyDistributionAPI_GetAvailRewardInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetAvailRewardInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetAvailRewardInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_PublicKeyDistributionAPI_GetVerifierHeartBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_PublicKeyDistributionAPI_GetVerifierHeartBlock_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_PublicKeyDistributionAPI_GetVerifierHeartBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "da9854414398b784ca12e49a2cd6ca10", "score": "0.5035821", "text": "func RegisterServer(s *http.Server, srv *rest.Server) {\n\tregister(s, newPasswordServer(srv))\n}", "title": "" }, { "docid": "e82fc051c27d230250766f85475d58b0", "score": "0.50261396", "text": "func RegisterSnakeEnumServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SnakeEnumServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_SnakeEnumService_SnakeEnum_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\tvar err error\n\t\tvar annotatedContext context.Context\n\t\tannotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, \"/grpc.gateway.examples.internal.proto.examplepb.SnakeEnumService/SnakeEnum\", runtime.WithHTTPPathPattern(\"/v1/example/snake/{who}/{what}/{where}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_SnakeEnumService_SnakeEnum_0(annotatedContext, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tannotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_SnakeEnumService_SnakeEnum_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "fe466c2c18e146a5a964fbc66c8abcbf", "score": "0.5009413", "text": "func RegisterAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServer) error {\n\n\tmux.Handle(\"GET\", pattern_Admin_GetRoles_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetRoles_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetRoles_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetAllOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetAllOrders_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetAllOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_GetAllUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_GetAllUsers_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_GetAllUsers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_CreateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_CreateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Admin_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UpdateUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UpdateUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_Admin_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_DeleteUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_DeleteUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_SetOrderUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_SetOrderUser_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_SetOrderUser_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_Admin_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_Login_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Admin_UserTypes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Admin_UserTypes_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Admin_UserTypes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "58dabf509e676bf0626c0af977053fd2", "score": "0.5000179", "text": "func RegisterProtocolServer(protocol string, server util.ProtocolServerModule) {\n\tprotoServers[protocol] = &server\n}", "title": "" }, { "docid": "4fc89b3ca74dbd0ca4f113fabf7c3a6c", "score": "0.4997622", "text": "func RegisterDogTrackHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DogTrackServer) error {\n\n\tmux.Handle(\"POST\", pattern_DogTrack_TrackDogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\terr := status.Error(codes.Unimplemented, \"streaming calls are not yet supported in the in-process transport\")\n\t\t_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\treturn\n\t})\n\n\tmux.Handle(\"POST\", pattern_DogTrack_AddDog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DogTrack_AddDog_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DogTrack_AddDog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DogTrack_GetAllDogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DogTrack_GetAllDogs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DogTrack_GetAllDogs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_DogTrack_DeleteDog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DogTrack_DeleteDog_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DogTrack_DeleteDog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "c2ff4d1a1df246d81b52a05a882f1c69", "score": "0.49972987", "text": "func ServeMux(s *HTTPServer, muxOpts MuxOptions) *http.ServeMux {\n\n\tmux := http.NewServeMux()\n\n\tprefix := muxOpts.Prefix\n\twebPath := muxOpts.WebPath\n\twebFS := muxOpts.WebFS\n\tflags := muxOpts.HandlerFlags\n\n\tif flags&HandlerDebug != 0 {\n\t\tmux.Handle(prefix+\"/debug/pprof/\", http.HandlerFunc(pprof.Index))\n\t\tmux.Handle(prefix+\"/debug/pprof/cmdline\", http.HandlerFunc(pprof.Cmdline))\n\t\tmux.Handle(prefix+\"/debug/pprof/profile\", http.HandlerFunc(pprof.Profile))\n\t\tmux.Handle(prefix+\"/debug/pprof/symbol\", http.HandlerFunc(pprof.Symbol))\n\t\tmux.Handle(prefix+\"/debug/pprof/trace\", http.HandlerFunc(pprof.Trace))\n\t}\n\n\tif flags&HandlerRawWS != 0 {\n\t\t// register raw Websocket endpoint.\n\t\tmux.Handle(prefix+\"/connection/websocket\", s.logged(s.wrapShutdown(http.HandlerFunc(s.rawWebsocketHandler))))\n\t}\n\n\tif flags&HandlerSockJS != 0 {\n\t\t// register SockJS endpoints.\n\t\tsjsh := newSockJSHandler(s, path.Join(prefix, \"/connection\"), muxOpts.SockjsOptions)\n\t\tmux.Handle(path.Join(prefix, \"/connection/\")+\"/\", s.logged(s.wrapShutdown(sjsh)))\n\t}\n\n\tif flags&HandlerAPI != 0 {\n\t\t// register HTTP API endpoint.\n\t\tmux.Handle(prefix+\"/api/\", s.logged(s.wrapShutdown(http.HandlerFunc(s.apiHandler))))\n\t}\n\n\tif flags&HandlerAdmin != 0 {\n\t\t// register admin websocket endpoint.\n\t\tmux.Handle(prefix+\"/socket\", s.logged(http.HandlerFunc(s.adminWebsocketHandler)))\n\n\t\t// optionally serve admin web interface.\n\t\tif flags&HandlerWeb != 0 {\n\t\t\t// register admin web interface API endpoints.\n\t\t\tmux.Handle(prefix+\"/auth/\", s.logged(http.HandlerFunc(s.authHandler)))\n\n\t\t\t// serve web interface single-page application.\n\t\t\tif webPath != \"\" {\n\t\t\t\twebPrefix := prefix + \"/\"\n\t\t\t\tmux.Handle(webPrefix, http.StripPrefix(webPrefix, http.FileServer(http.Dir(webPath))))\n\t\t\t} else if webFS != nil {\n\t\t\t\twebPrefix := prefix + \"/\"\n\t\t\t\tmux.Handle(webPrefix, http.StripPrefix(webPrefix, http.FileServer(webFS)))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn mux\n}", "title": "" }, { "docid": "19d48afce06687a557b31244965d9cca", "score": "0.4996835", "text": "func (s *Server) RegisterService(cfg config.ServiceConfig, handler http.Handler) error {\n\tsrv := &http.Server{\n\t\tAddr: cfg.Address,\n\t\tHandler: handler,\n\t\tMaxHeaderBytes: cfg.MaxHeaderBytes,\n\t}\n\tvar err error\n\tsrv.ReadTimeout, err = cfg.ReadTimeout.Duration()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing duration for server %s: %v\", cfg.Address, err)\n\t}\n\tsrv.WriteTimeout, err = cfg.WriteTimeout.Duration()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing duration for server %s: %v\", cfg.Address, err)\n\t}\n\ts.httpServers = append(s.httpServers, srv)\n\treturn nil\n}", "title": "" }, { "docid": "ecac6248d5622c4e8656fc1322356533", "score": "0.49963912", "text": "func (s *server) RegisterHandler(p string, h http.HandlerFunc) {\n\ts.r.HandleFunc(p, h)\n}", "title": "" }, { "docid": "9fe40e4d58d58bc4031c5ac08ad9488b", "score": "0.49875674", "text": "func (m *Manager) RegisterHandler(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != http.MethodPost {\n\t\thttp.Error(w, \"Not support method\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tvar req workerRegistrationBody\n\terr := json.NewDecoder(r.Body).Decode(&req)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tworkerAddr := strings.Split(r.RemoteAddr, \":\")[0] + \":\" + req.WorkerPort\n\tm.scheduler.RegisterWorker(req.WorkerID, workerAddr)\n\n\tresb, _ := json.Marshal(m.registrationResponse)\n\tw.Write(resb)\n\n\treturn\n}", "title": "" }, { "docid": "3a0bd7ba4a090dc3a03c74cfc0ca7f88", "score": "0.4978482", "text": "func (c *Collector) RegisterMux(mux *http.ServeMux) {\n\tmux.Handle(c.path, promhttp.Handler())\n}", "title": "" }, { "docid": "63fa524feb8f47bc8f0c1ea90f3a0df9", "score": "0.49779838", "text": "func RegisterAnimeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AnimeServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_AnimeService_AddCategory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_AddCategory_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_AddCategory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AnimeService_CategoryList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_CategoryList_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_CategoryList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AnimeService_AddAnime_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_AddAnime_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_AddAnime_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AnimeService_AddVideo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_AddVideo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_AddVideo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AnimeService_GetAnimeList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_GetAnimeList_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_GetAnimeList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_AnimeService_GetAnimeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_GetAnimeInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_GetAnimeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AnimeService_AnimeLike_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_AnimeLike_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_AnimeLike_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_AnimeService_AnimeUnLike_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_AnimeService_AnimeUnLike_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_AnimeService_AnimeUnLike_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "22dd3620d491c73ee6c37e3f7f276e9e", "score": "0.4975469", "text": "func RegisterDataServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_DataService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DataService_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DataService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DataService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DataService_Read_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DataService_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_DataService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DataService_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DataService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_DataService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DataService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DataService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_DataService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DataService_List_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DataService_List_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "a8c5a0b04702948e8c02daeb33f2b3bf", "score": "0.49752107", "text": "func RegisterHttpServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HttpServiceServer) error {\n\n\tmux.Handle(\"GET\", pattern_HttpService_Genesis_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Genesis_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Genesis_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_MinGasPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_MinGasPrice_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_MinGasPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_NetInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_NetInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_NetInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Status_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Address_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Address_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Address_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Addresses_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Addresses_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Addresses_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Block_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Block_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Block_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Candidate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Candidate_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Candidate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Candidates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Candidates_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Candidates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_CoinInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_CoinInfo_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_CoinInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_EstimateCoinBuy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_EstimateCoinBuy_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_EstimateCoinBuy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_EstimateCoinSell_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_EstimateCoinSell_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_EstimateCoinSell_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_EstimateCoinSellAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_EstimateCoinSellAll_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_EstimateCoinSellAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_EstimateTxCommission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_EstimateTxCommission_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_EstimateTxCommission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Events_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Events_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Events_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_MaxGas_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_MaxGas_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_MaxGas_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_MissedBlocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_MissedBlocks_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_MissedBlocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_SendTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_SendTransaction_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_SendTransaction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Transaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Transaction_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Transaction_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Transactions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Transactions_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Transactions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_UnconfirmedTxs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_UnconfirmedTxs_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_UnconfirmedTxs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_HttpService_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_HttpService_Validators_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_HttpService_Validators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "acdd52295948d95c3ed6112e558e7732", "score": "0.4970156", "text": "func RegisterServiceManagerServer(s *grpc.Server, srv ServiceManagerServer) {\n\tsrc.RegisterServiceManagerServer(s, srv)\n}", "title": "" }, { "docid": "6aadd137c3febe908856a75f71b10866", "score": "0.4967568", "text": "func RegisterServerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServerServiceClient) error {\n\n\tmux.Handle(\"POST\", pattern_ServerService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_Login_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Login_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_Index_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_Index_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Index_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"POST\", pattern_ServerService_AddServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_AddServer_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_AddServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ServerService_UpdateServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_UpdateServer_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_UpdateServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_DetailsServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_DetailsServer_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_DetailsServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"DELETE\", pattern_ServerService_DeleteServer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_DeleteServer_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_DeleteServer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_ServerService_ChangePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_ChangePassword_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_ChangePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_CheckStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_CheckStatus_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_CheckStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_Export_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Export_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_ServerService_Logout_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := request_ServerService_Logout_0(rctx, inboundMarshaler, client, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_ServerService_Logout_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "7e91519c30ebed6c54f04fdf46a1c5e7", "score": "0.4964684", "text": "func RegisterAppMuxerHandler(prefix string, handler http.Handler) {\n\tif prefix == \"\" {\n\t\tprefix = \"/\"\n\t} else {\n\t\tif prefix[0] != '/' {\n\t\t\tprefix = \"/\" + prefix\n\t\t}\n\t\t// Make sure the registered prefix ends with a /\n\t\tif prefix[len(prefix) - 1] != '/' {\n\t\t\tprefix = prefix + \"/\"\n\t\t}\n\t}\n\t// Here we register the handler with a closing / so that similar names will not be confused,\n\t// but we do not strip the last / from the file name passed on.\n\tAppMuxer.Handle(prefix, http.StripPrefix(prefix[0:len(prefix) - 1],handler))\n}", "title": "" }, { "docid": "831c5a4ab911195dabcfd76d27443a27", "score": "0.49546716", "text": "func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {\n\n\tmux.Handle(\"GET\", pattern_Query_Profile_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_Profile_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_Profile_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_IncomingDTagTransferRequests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_IncomingDTagTransferRequests_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_IncomingDTagTransferRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_Relationships_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_Relationships_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_Relationships_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_Blocks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_Blocks_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_Blocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_ChainLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_ChainLinks_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_ChainLinks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_UserChainLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_UserChainLink_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_UserChainLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_ApplicationLinks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_ApplicationLinks_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_ApplicationLinks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_UserApplicationLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_UserApplicationLink_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_UserApplicationLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_Query_ApplicationLinkByClientID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Query_ApplicationLinkByClientID_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Query_ApplicationLinkByClientID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "b894941bebc27d77ff0a1268db21fd6b", "score": "0.4948394", "text": "func registerServerMethods(s *grpc.Server) {\r\n}", "title": "" }, { "docid": "57838df9de9c6e9b2f54c9d8b4aa11ad", "score": "0.49383548", "text": "func RegisterRegistryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterRegistryHandlerClient(ctx, mux, NewRegistryClient(conn))\n}", "title": "" }, { "docid": "1827e3eca9936e3437347b08c860ee02", "score": "0.49383202", "text": "func RegisterRegistryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {\n\treturn RegisterRegistryServiceHandlerClient(ctx, mux, NewRegistryServiceClient(conn))\n}", "title": "" }, { "docid": "48424cd3c2ca47746cee02d47678c586", "score": "0.49319974", "text": "func RegisterProfilesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProfilesServer) error {\n\n\tmux.Handle(\"POST\", pattern_Profiles_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Profiles/Create\", runtime.WithHTTPPathPattern(\"/profiles\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Profiles_Create_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Profiles_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_Profiles_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/examples.foo.Profiles/Update\", runtime.WithHTTPPathPattern(\"/profiles/{payload.id}\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_Profiles_Update_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_Profiles_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "208bc29942bb694e9ef2ec131ac9e7ef", "score": "0.49252146", "text": "func RegisterInventoryItemServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InventoryItemServiceServer) error {\n\n\tmux.Handle(\"POST\", pattern_InventoryItemService_AddInventoryItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryItemService_AddInventoryItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryItemService_AddInventoryItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"GET\", pattern_InventoryItemService_ListInventoryItems_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryItemService_ListInventoryItems_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryItemService_ListInventoryItems_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\tmux.Handle(\"PUT\", pattern_InventoryItemService_UpdateInventoryItem_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_InventoryItemService_UpdateInventoryItem_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_InventoryItemService_UpdateInventoryItem_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" }, { "docid": "83d8b86a8d6169d40180c365fd50d35f", "score": "0.49243218", "text": "func RegisterDaoUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DaoUserServer) error {\n\n\tmux.Handle(\"POST\", pattern_DaoUser_UserDaoDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {\n\t\tctx, cancel := context.WithCancel(req.Context())\n\t\tdefer cancel()\n\t\tvar stream runtime.ServerTransportStream\n\t\tctx = grpc.NewContextWithServerTransportStream(ctx, &stream)\n\t\tinboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)\n\t\trctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, \"/user.DaoUser/UserDaoDetail\", runtime.WithHTTPPathPattern(\"/api/v1/dao/user/query/detail\"))\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\t\tresp, md, err := local_request_DaoUser_UserDaoDetail_0(rctx, inboundMarshaler, server, req, pathParams)\n\t\tmd.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())\n\t\tctx = runtime.NewServerMetadataContext(ctx, md)\n\t\tif err != nil {\n\t\t\truntime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)\n\t\t\treturn\n\t\t}\n\n\t\tforward_DaoUser_UserDaoDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)\n\n\t})\n\n\treturn nil\n}", "title": "" } ]
d859834b957a65d132b35859d4458ba0
SetServiceId sets the ServiceId field's value.
[ { "docid": "4465a912b2f4b3b7a8201932a4bb2499", "score": "0.8703665", "text": "func (s *GetListenerOutput) SetServiceId(v string) *GetListenerOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "57cdaafa93f2c1c393aaa6facdde76bc", "score": "0.8807925", "text": "func (s *GetRouteOutput) SetServiceId(v string) *GetRouteOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "c681e9d6daf35250adeefad81525c7ee", "score": "0.87643516", "text": "func (s *GetServiceNetworkServiceAssociationOutput) SetServiceId(v string) *GetServiceNetworkServiceAssociationOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "45b22500f2fcac69c56142408e631b67", "score": "0.86841303", "text": "func (s *CreateRouteOutput) SetServiceId(v string) *CreateRouteOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "6ce2a54b965a10436054639efdab3ef2", "score": "0.867524", "text": "func (s *CreateListenerOutput) SetServiceId(v string) *CreateListenerOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "109dfc1e2e8b0594f4ca9f644ca58438", "score": "0.8670321", "text": "func (s *ServiceNetworkServiceAssociationSummary) SetServiceId(v string) *ServiceNetworkServiceAssociationSummary {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "59cbbe68016865aefa1dc6c9cd47cd77", "score": "0.86286545", "text": "func (s *UpdateRouteOutput) SetServiceId(v string) *UpdateRouteOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "e3f4cb4464594d313aa66877efc447ce", "score": "0.86220604", "text": "func (s *GetServiceOutput) SetServiceId(v string) *GetServiceOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "b7b1fe29836478a621d1d8655fecce72", "score": "0.8601262", "text": "func (s *UpdateListenerOutput) SetServiceId(v string) *UpdateListenerOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "3d51b71602fd55730307cd71cae582b5", "score": "0.85518014", "text": "func (s *DeleteRouteOutput) SetServiceId(v string) *DeleteRouteOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "65d3bca1f501efc0744c100e080aede9", "score": "0.85223925", "text": "func (s *RouteSummary) SetServiceId(v string) *RouteSummary {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "1e663ca954bb4772b98e6d881028357f", "score": "0.8500187", "text": "func (s *Service) SetServiceId(v string) *Service {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "fc49a6002e266222b95dd2ebb8a0f631", "score": "0.84888583", "text": "func (s *CreateServiceOutput) SetServiceId(v string) *CreateServiceOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "d5e105e06abe94edc58a1ac41a458173", "score": "0.8436405", "text": "func (s *DeleteServiceOutput) SetServiceId(v string) *DeleteServiceOutput {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "be2de6ab189d5c7d6a184834f3cc0e1e", "score": "0.8419522", "text": "func (s *ServiceSummary) SetServiceId(v string) *ServiceSummary {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "be2de6ab189d5c7d6a184834f3cc0e1e", "score": "0.8419522", "text": "func (s *ServiceSummary) SetServiceId(v string) *ServiceSummary {\n\ts.ServiceId = &v\n\treturn s\n}", "title": "" }, { "docid": "0ec1d18f8b985fa99e8b84b4de400d0f", "score": "0.80775994", "text": "func (m *AvailabilityItem) SetServiceId(value *string)() {\n m.serviceId = value\n}", "title": "" }, { "docid": "4911e604a7f650eba1f7ba966657f051", "score": "0.80621314", "text": "func (m *AppleManagedIdentityProvider) SetServiceId(value *string)() {\n m.serviceId = value\n}", "title": "" }, { "docid": "f5ac085f23904a8fdb8e41989e9c2bea", "score": "0.7843232", "text": "func (pu *PropertyUpdate) SetServiceID(id int) *PropertyUpdate {\n\tpu.mutation.SetServiceID(id)\n\treturn pu\n}", "title": "" }, { "docid": "96ceca21f301122810640f8c3f1adf33", "score": "0.781425", "text": "func (puo *PropertyUpdateOne) SetServiceID(id int) *PropertyUpdateOne {\n\tpuo.mutation.SetServiceID(id)\n\treturn puo\n}", "title": "" }, { "docid": "f9ea17283e600c4e2ea7d4dc281c1465", "score": "0.76487744", "text": "func (o *DeleteV1ServicesServiceIDServiceLinksRemoteIDParams) SetServiceID(serviceID int32) {\n\to.ServiceID = serviceID\n}", "title": "" }, { "docid": "8c8c610f930edb3c09debaea5942c542", "score": "0.75531065", "text": "func (o *ServiceInstanceLastOperationGetParams) SetServiceID(serviceID *string) {\n\to.ServiceID = serviceID\n}", "title": "" }, { "docid": "182a45403f790d0a5ece95f9b727b407", "score": "0.74314904", "text": "func (m *BookingAppointment) SetServiceId(value *string)() {\n err := m.GetBackingStore().Set(\"serviceId\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "e4658cf5fd22339391a846d3e8a19a7a", "score": "0.72458464", "text": "func (o *ModelsBackup) SetDataServiceId(v string) {\n\to.DataServiceId = &v\n}", "title": "" }, { "docid": "4791e935bacf0d840a3360d6644c7d87", "score": "0.68355346", "text": "func (pu *PropertyUpdate) SetServiceValueID(id int) *PropertyUpdate {\n\tpu.mutation.SetServiceValueID(id)\n\treturn pu\n}", "title": "" }, { "docid": "165c6a63f6e26e6cd3fe9d655a9de03c", "score": "0.6779869", "text": "func (puo *PropertyUpdateOne) SetServiceValueID(id int) *PropertyUpdateOne {\n\tpuo.mutation.SetServiceValueID(id)\n\treturn puo\n}", "title": "" }, { "docid": "f1c9f3e0c84ba01d2f701497bea53c75", "score": "0.661592", "text": "func (mr *MockDynamicOptionsMockRecorder) SetServiceID(s interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"SetServiceID\", reflect.TypeOf((*MockDynamicOptions)(nil).SetServiceID), s)\n}", "title": "" }, { "docid": "d9c67c76ca20845d140a99a7bd95caf9", "score": "0.64469665", "text": "func (o *AWSLogsListServicesResponse) SetId(v string) {\n\to.Id = &v\n}", "title": "" }, { "docid": "bd157e4e5203583be97a7925278e6aaa", "score": "0.63971144", "text": "func (m *AppIdentity) SetServicePrincipalId(value *string)() {\n m.servicePrincipalId = value\n}", "title": "" }, { "docid": "c640fe6faaf49ce60afa93b34bb55393", "score": "0.6342244", "text": "func (s *FailedServiceActionAssociation) SetServiceActionId(v string) *FailedServiceActionAssociation {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "4a3e67f88932bd250c3a2145fd0f2a39", "score": "0.63238966", "text": "func (s *ServiceActionAssociation) SetServiceActionId(v string) *ServiceActionAssociation {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "e34bbde52721c56196134ce32b9d3ee9", "score": "0.62704", "text": "func (c *Client) PutServiceID(id int64, svc *models.ServiceSpec) (bool, error) {\n\tsvc.ID = id\n\tparams := service.NewPutServiceIDParams().WithID(id).WithConfig(svc).WithTimeout(api.ClientTimeout)\n\t_, created, err := c.Service.PutServiceID(params)\n\treturn created != nil, Hint(err)\n}", "title": "" }, { "docid": "5e3d22bede1fbb4abfddfcc00515c7f8", "score": "0.6252459", "text": "func (o *ControllersPublicV1ProxyMutateServiceVariablesParams) SetServiceInstanceID(serviceInstanceID string) {\n\to.ServiceInstanceID = serviceInstanceID\n}", "title": "" }, { "docid": "b41daa27a52f23982f451e2feb84ed2a", "score": "0.6246848", "text": "func (o ServiceOutput) ServiceId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Service) pulumi.StringOutput { return v.ServiceId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5272ae6ebe377a9ad9cc3b441fdacd7f", "score": "0.6200361", "text": "func (_options *ReplaceTektonPipelineDefinitionOptions) SetServiceInstanceID(serviceInstanceID string) *ReplaceTektonPipelineDefinitionOptions {\n\t_options.ServiceInstanceID = core.StringPtr(serviceInstanceID)\n\treturn _options\n}", "title": "" }, { "docid": "1f7b8599caa29aa9bc499404bfd48384", "score": "0.6182112", "text": "func (m *BookborrowMutation) SetSERVICEPOINTID(id int) {\n\tm._SERVICEPOINT = &id\n}", "title": "" }, { "docid": "b2aef9ed0a52d3a52e7c1401164aa58e", "score": "0.6169947", "text": "func (s *DescribeServiceActionExecutionParametersInput) SetServiceActionId(v string) *DescribeServiceActionExecutionParametersInput {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "c30e1736a174ce46b963ebf290877a3a", "score": "0.6169613", "text": "func (p *Path) SetService(serviceName string, server *Server) {\n\tp.mux.Lock()\n\tp.ServiceName = serviceName\n\tp.Server = server\n\tp.mux.Unlock()\n}", "title": "" }, { "docid": "d517464e4b4ee2b7b843c4a4d630ed1d", "score": "0.6069996", "text": "func (s *BatchUpdateRuleInput) SetServiceIdentifier(v string) *BatchUpdateRuleInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "0c5a7915df20eeb5a5217115f6f7a543", "score": "0.60652643", "text": "func (s *GetServiceNetworkVpcAssociationOutput) SetServiceNetworkId(v string) *GetServiceNetworkVpcAssociationOutput {\n\ts.ServiceNetworkId = &v\n\treturn s\n}", "title": "" }, { "docid": "6ffc0eeec8bf40419acd66d20819a311", "score": "0.603784", "text": "func (k *Item) SetService(s string) {\n\tk.SetString(ServiceKey, s)\n}", "title": "" }, { "docid": "9c04be0d7e425eed2da1d9bb1ee5cd76", "score": "0.6028275", "text": "func (o *DeleteServicesServiceIDParams) WithServiceID(ServiceID int64) *DeleteServicesServiceIDParams {\n\to.ServiceID = ServiceID\n\treturn o\n}", "title": "" }, { "docid": "8c22e6e0113676537fd1392a9e5cedf8", "score": "0.6018029", "text": "func (c *Check) IsServiceId(serviceId string) bool {\n\treturn serviceId == c.ServiceID\n}", "title": "" }, { "docid": "518f87c4d94a125f404c89dc5abc3d2a", "score": "0.6014145", "text": "func (m *BookingMutation) SetGetserviceID(id int) {\n\tm.getservice = &id\n}", "title": "" }, { "docid": "dba6858d909155fd78fc6a3ad04b40cb", "score": "0.60010713", "text": "func (e *DefaultService) ServiceID() string {\n\treturn e.Id\n}", "title": "" }, { "docid": "c9ba03b05962ee3d94391410f15dc71c", "score": "0.59704673", "text": "func (s *ServiceNetworkVpcAssociationSummary) SetServiceNetworkId(v string) *ServiceNetworkVpcAssociationSummary {\n\ts.ServiceNetworkId = &v\n\treturn s\n}", "title": "" }, { "docid": "2b33df53648d3ef902950b3f82d8fa8c", "score": "0.5955014", "text": "func (s *GetRuleInput) SetServiceIdentifier(v string) *GetRuleInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "38520b8be23f7c76c280792d0e9965b4", "score": "0.59484595", "text": "func (o *MicrosoftGraphServicePlanInfo) SetServicePlanId(v string) {\n\to.ServicePlanId = &v\n}", "title": "" }, { "docid": "946c0729c15580563d766fb9adbc5dbd", "score": "0.59365505", "text": "func (s *ExecuteProvisionedProductServiceActionInput) SetServiceActionId(v string) *ExecuteProvisionedProductServiceActionInput {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "4f02645fd83d2fd99d6b52f9f69aed4e", "score": "0.59294343", "text": "func (s *ListProvisioningArtifactsForServiceActionInput) SetServiceActionId(v string) *ListProvisioningArtifactsForServiceActionInput {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "09a909729ce2e5dbb4021272ce1d2a98", "score": "0.5917988", "text": "func (s *UpdateRuleInput) SetServiceIdentifier(v string) *UpdateRuleInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "5f319a28cb979653c1a497d043328618", "score": "0.59155375", "text": "func (o *DhcpAclentryDataData) SetServerId(v string) {\n\to.ServerId = &v\n}", "title": "" }, { "docid": "9238047b53ca1ab651f2206ae02d707e", "score": "0.590904", "text": "func (o *DeleteV1ServicesServiceIDServiceLinksRemoteIDParams) WithServiceID(serviceID int32) *DeleteV1ServicesServiceIDServiceLinksRemoteIDParams {\n\to.SetServiceID(serviceID)\n\treturn o\n}", "title": "" }, { "docid": "eb75b2cdbf84e4802720271c00569c3b", "score": "0.59085816", "text": "func (o *GetPullRequestParams) SetServiceEndpointID(serviceEndpointID *strfmt.UUID) {\n\to.ServiceEndpointID = serviceEndpointID\n}", "title": "" }, { "docid": "63ee4f885dcdac1763f772ec29649442", "score": "0.5885416", "text": "func (o *NatService) SetNatServiceId(v string) {\n\to.NatServiceId = &v\n}", "title": "" }, { "docid": "7524301be191eb157b16308b234e21d4", "score": "0.5869576", "text": "func (s *CreateRuleInput) SetServiceIdentifier(v string) *CreateRuleInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "016f9653af6ed17a416830eb3f9140e5", "score": "0.5866697", "text": "func (c *ConfigLocal) SetKeybaseService(k KeybaseService) {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\tc.service = k\n}", "title": "" }, { "docid": "6aa9fbce4fd7d521ad7c3baa6a5f1cda", "score": "0.58561546", "text": "func (s *AssociateServiceActionWithProvisioningArtifactInput) SetServiceActionId(v string) *AssociateServiceActionWithProvisioningArtifactInput {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "3af73f73dcb898e115b83f624fc12fd0", "score": "0.58561534", "text": "func (s *CreateRouteInput) SetServiceIdentifier(v string) *CreateRouteInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "768bdc0330b5235499408e74dd0dc1e3", "score": "0.58387035", "text": "func (o *ResolveParams) SetService(service *string) {\n\to.Service = service\n}", "title": "" }, { "docid": "f6cb3ed068f56a72277401879716d398", "score": "0.5824446", "text": "func (ctx *ApiContext) SetId(id string) *ApiContext {\n\treturn ctx.SetContextValue(ctxId, id)\n}", "title": "" }, { "docid": "d550df89b6426bd1b8204b25b9163c12", "score": "0.5823621", "text": "func (mr *MockDynamicOptionsMockRecorder) ServiceID() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"ServiceID\", reflect.TypeOf((*MockDynamicOptions)(nil).ServiceID))\n}", "title": "" }, { "docid": "cdae9e13f9e98647a9cf569aafcf17df", "score": "0.58207154", "text": "func (s *ListServiceNetworkServiceAssociationsInput) SetServiceIdentifier(v string) *ListServiceNetworkServiceAssociationsInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "ff6961081fb0a910f9828f3d87ba5ea6", "score": "0.5815529", "text": "func (s *ListRulesInput) SetServiceIdentifier(v string) *ListRulesInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "95478dfaebbed9899307fbd021e0e95f", "score": "0.58124614", "text": "func (l *EventListen) ServiceID() string {\n\treturn l.serviceID\n}", "title": "" }, { "docid": "0bb663beb8c8c44d7bc1f629199411db", "score": "0.58018434", "text": "func (s *CreateServiceNetworkServiceAssociationInput) SetServiceIdentifier(v string) *CreateServiceNetworkServiceAssociationInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "f10fbb7114e6e9f42572bbe652709586", "score": "0.5801273", "text": "func (a PipelineID) ServiceID() app.ServiceID {\n\treturn app.ServiceID(a)\n}", "title": "" }, { "docid": "4454c61888e12b6ece4bfabd7f1f3e6a", "score": "0.5800002", "text": "func (s *CreateListenerInput) SetServiceIdentifier(v string) *CreateListenerInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "26b1627131932d06033abfa164ed7597", "score": "0.5792032", "text": "func (o *DeleteServiceAccountParams) SetServiceAccountID(serviceaccountID string) {\n\to.ServiceAccountID = serviceaccountID\n}", "title": "" }, { "docid": "a8aafd60fac7fb3c38e626c2745e4bba", "score": "0.5787341", "text": "func SetService(key string, ext extractor.Extractor, auth authenticator.Authenticator, writer writer.Writer) {\n\tservices[key] = &service{ext: ext, auth: auth, w: writer}\n}", "title": "" }, { "docid": "1d65bb445454352ddfa084111ee0acd2", "score": "0.5784395", "text": "func (s *DeleteRuleInput) SetServiceIdentifier(v string) *DeleteRuleInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "d34f5d6be8c9ae9fb395059f1871fe2f", "score": "0.5779208", "text": "func (e *Event) SetId(id string) {\n\te.id = id\n}", "title": "" }, { "docid": "a699bba1f0d893cfe036666cac292eaf", "score": "0.57740325", "text": "func (puo *PropertyUpdateOne) SetService(s *Service) *PropertyUpdateOne {\n\treturn puo.SetServiceID(s.ID)\n}", "title": "" }, { "docid": "98c4d27357ede2a2cf3f17e68fe9e77d", "score": "0.5768229", "text": "func (o *Service) SetId(v string) {\n\to.Id = &v\n}", "title": "" }, { "docid": "105ce41496a37b025f6099a967bc1fda", "score": "0.5762142", "text": "func (s *UpdateListenerInput) SetServiceIdentifier(v string) *UpdateListenerInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "dd20d11d051baf3f7f84effe01dfb386", "score": "0.576183", "text": "func (s *DisassociateServiceActionFromProvisioningArtifactInput) SetServiceActionId(v string) *DisassociateServiceActionFromProvisioningArtifactInput {\n\ts.ServiceActionId = &v\n\treturn s\n}", "title": "" }, { "docid": "985b69d7db9a7d92a55a989ddf128e07", "score": "0.5759921", "text": "func (s *GetServiceInput) SetServiceIdentifier(v string) *GetServiceInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "985b69d7db9a7d92a55a989ddf128e07", "score": "0.5759921", "text": "func (s *GetServiceInput) SetServiceIdentifier(v string) *GetServiceInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "c4e028343bde55f64185f4208e832375", "score": "0.5757496", "text": "func (v *Options) SetServerID(s string) *Options {\n\tif len(s) > 0 {\n\t\tv.ServerID = s\n\t\tgo v.notify()\n\t}\n\treturn v\n}", "title": "" }, { "docid": "3631350dd2d3a51e22056ed8bb7bdd95", "score": "0.57504624", "text": "func (o *UpdateMainServiceAccountTokenParams) SetServiceAccountID(serviceaccountID string) {\n\to.ServiceAccountID = serviceaccountID\n}", "title": "" }, { "docid": "095edc5b5c32223d06fd9a70bbff9a67", "score": "0.5717439", "text": "func (s *GetListenerInput) SetServiceIdentifier(v string) *GetListenerInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "4d0f7a19cc02c20a37983991ec6045e8", "score": "0.5699497", "text": "func (pu *PropertyUpdate) SetService(s *Service) *PropertyUpdate {\n\treturn pu.SetServiceID(s.ID)\n}", "title": "" }, { "docid": "6a38dee2e2667abcc9df894518654716", "score": "0.5695965", "text": "func (s *GetServiceNetworkServiceAssociationOutput) SetServiceNetworkId(v string) *GetServiceNetworkServiceAssociationOutput {\n\ts.ServiceNetworkId = &v\n\treturn s\n}", "title": "" }, { "docid": "c9dbd56769fa2764d92413343bfe8d54", "score": "0.5687182", "text": "func (s *ServiceNetworkServiceAssociationSummary) SetServiceNetworkId(v string) *ServiceNetworkServiceAssociationSummary {\n\ts.ServiceNetworkId = &v\n\treturn s\n}", "title": "" }, { "docid": "215265b094f6f65070fe37f769818324", "score": "0.56854695", "text": "func (m *MockDynamicOptions) SetServiceID(s services.ServiceID) DynamicOptions {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetServiceID\", s)\n\tret0, _ := ret[0].(DynamicOptions)\n\treturn ret0\n}", "title": "" }, { "docid": "c36ec41ca1c6da00d4ea573d65cadfd4", "score": "0.56813633", "text": "func (o *Monitor) SetService(v string) {\n\to.Service = v\n}", "title": "" }, { "docid": "541087cf24a3dd0ebad7b4c9f0b6bc5b", "score": "0.56789243", "text": "func (r *AlibabaWholesaleGoodsGetAPIRequest) SetId(_id string) error {\n\tr._id = _id\n\tr.Set(\"id\", _id)\n\treturn nil\n}", "title": "" }, { "docid": "976f70ecab9cdef02ae507e6c6dfeef2", "score": "0.56736004", "text": "func (o *UpdateRouteRequest) SetNatServiceId(v string) {\n\to.NatServiceId = &v\n}", "title": "" }, { "docid": "c166ade671a9f55fb6a64246448ca668", "score": "0.56537205", "text": "func (s *ListListenersInput) SetServiceIdentifier(v string) *ListListenersInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "0011cb53ac2feb2a158c93f4a6acb822", "score": "0.5653514", "text": "func (o *GetCSPMPolicySettingsParams) SetService(service *string) {\n\to.Service = service\n}", "title": "" }, { "docid": "a6e1291f8cd2e2bbdf06adec953d447f", "score": "0.56436634", "text": "func (o *object) SetServiceData(serviceData []byte) Interface {\n\to.ServiceData = serviceData\n\treturn o\n}", "title": "" }, { "docid": "7d68343e4774efbdd52d8e933c660bea", "score": "0.5639229", "text": "func (o *SearchResultGroupDTO) SetId(v string) {\n\to.Id = v\n}", "title": "" }, { "docid": "dabd6af80dfe8e791ea16d93b322ac25", "score": "0.56292725", "text": "func (p *Path) SetServicePort(servicePort string) {\n\tp.mux.Lock()\n\tp.ServicePort = servicePort\n\tp.mux.Unlock()\n}", "title": "" }, { "docid": "6d2142faa9a55ae2d5ea115c427ebedc", "score": "0.55992657", "text": "func (s *UpdateServiceInput) SetServiceIdentifier(v string) *UpdateServiceInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "e037105c1541d3ab1cdc62dee8950bdb", "score": "0.55895627", "text": "func (o *EnvironmentVariableResponse) SetId(v string) {\n\to.Id = v\n}", "title": "" }, { "docid": "ef94f41e176d6e190167a94ec30e5007", "score": "0.55883723", "text": "func (s *DeleteListenerInput) SetServiceIdentifier(v string) *DeleteListenerInput {\n\ts.ServiceIdentifier = &v\n\treturn s\n}", "title": "" }, { "docid": "85aa45791d0a5f3f8ff9756644985b29", "score": "0.55798274", "text": "func (o *AddTokenToServiceAccountParams) SetServiceAccountID(serviceaccountID string) {\n\to.ServiceAccountID = serviceaccountID\n}", "title": "" }, { "docid": "a80d2aef7ca6c6c0fb8e9426432fbdae", "score": "0.55687964", "text": "func (o *AccessFeature) SetId(v string) {\n\to.Id = v\n}", "title": "" }, { "docid": "49f483ae22f355fd26a2c9acc7ddf80d", "score": "0.55520165", "text": "func (l *ResultListen) ServiceID() string {\n\treturn l.serviceID\n}", "title": "" }, { "docid": "f43244432bec4de54cf6dda6da4672ae", "score": "0.55328923", "text": "func MakeServiceID(serviceID string) string {\n\treturn makeID(\"service\", serviceID)\n}", "title": "" }, { "docid": "73f62ded207fde3ff5ddc61825dbd142", "score": "0.55133414", "text": "func (o *Token) SetId(v int32) {\n\to.Id = v\n}", "title": "" } ]
0bd787aa7fd6297426507ee780326d27
runGateway runs the grpcgateway
[ { "docid": "4e2229ad7bd353e92e2988e233d1e7de", "score": "0.84361905", "text": "func runGateway(ctx context.Context, grpcEndpoint string, mux *gwruntime.ServeMux, httpServer *http.Server) {\n\tconn, err := grpc.DialContext(ctx, grpcEndpoint, grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials()))\n\tif err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not dial grpc server...\")\n\t}\n\n\tif err := sdk.RegisterSDKHandler(ctx, mux, conn); err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not register sdk grpc-gateway\")\n\t}\n\tif err := sdkalpha.RegisterSDKHandler(ctx, mux, conn); err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not register alpha sdk grpc-gateway\")\n\t}\n\n\tlogger.WithField(\"httpEndpoint\", httpServer.Addr).Info(\"Starting SDKServer grpc-gateway...\")\n\tif err := httpServer.ListenAndServe(); err != nil {\n\t\tif err == http.ErrServerClosed {\n\t\t\tlogger.WithError(err).Info(\"http server closed\")\n\t\t} else {\n\t\t\tlogger.WithError(err).Fatal(\"Could not serve http server\")\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "6c885775be16c737bbe1b640342ef1fb", "score": "0.73946", "text": "func RunGateway(ctx context.Context, registers ...registerHandlerFromEndpointFunc) error {\n\treturn runGateway(ctx, registers...)\n}", "title": "" }, { "docid": "69d2a4eda533440531acb2eef6593205", "score": "0.7156703", "text": "func runGateway(opts commandlineOpts) error {\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)\n\n\tif opts.Debug {\n\t\t// pipe debug to standard out\n\t\tthing.SetDebugLogger(log.New(os.Stdout, \"\", log.Ldate|log.Ltime|log.Lmicroseconds|log.Llongfile))\n\t}\n\n\tamKey, err := loadKey(opts.KeyFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif opts.KeyID == \"\" {\n\t\topts.KeyID, err = thing.JWKThumbprint(amKey)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tcallbacks := []callback.Handler{\n\t\tcallback.AuthenticateHandler{\n\t\t\tAudience: opts.Audience,\n\t\t\tThingID: opts.Name,\n\t\t\tKeyID: opts.KeyID,\n\t\t\tKey: amKey,\n\t\t}}\n\tif opts.CertFile != \"\" {\n\t\tcerts, err := loadCertificates(opts.CertFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcallbacks = append(callbacks, callback.RegisterHandler{\n\t\t\tAudience: opts.Audience,\n\t\t\tThingID: opts.Name,\n\t\t\tThingType: callback.TypeGateway,\n\t\t\tKeyID: opts.KeyID,\n\t\t\tKey: amKey,\n\t\t\tCertificates: certs,\n\t\t})\n\n\t}\n\tiotGateway := gateway.New(opts.URL, opts.Realm, opts.Tree, opts.Timeout, callbacks)\n\n\terr = iotGateway.Initialise()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tserverKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = iotGateway.StartCOAPServer(opts.Address, serverKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer iotGateway.ShutdownCOAPServer()\n\n\tfmt.Println(\"IoT Gateway server started.\")\n\t<-signals\n\tfmt.Println(\"IoT Gateway server shutting down.\")\n\treturn nil\n}", "title": "" }, { "docid": "df2cc411f06ea0bb3913c7a837b4bc1f", "score": "0.6997822", "text": "func run(gateway *zanzibar.Gateway) {\n\tgateway.Logger.Info(\"Started Selective-gateway\",\n\t\tzap.String(\"realHTTPAddr\", gateway.RealHTTPAddr),\n\t\tzap.String(\"realTChannelAddr\", gateway.RealTChannelAddr),\n\t\tzap.Any(\"config\", gateway.InspectOrDie()),\n\t)\n}", "title": "" }, { "docid": "b068811d5223e3422bcc2177adb9f382", "score": "0.69718647", "text": "func (s *Server) startGateway() error {\n\tvar opts []grpc.DialOption\n\tvar err error\n\tif s.clientTLS != nil {\n\t\topts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(s.clientTLS)))\n\t} else {\n\t\topts = append(opts, grpc.WithInsecure())\n\t}\n\t// init http gateway\n\ts.gwmux = runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: true}))\n\terr = proto.RegisterLogManagerGwFromEndpoint(s.ctx, s.gwmux, s.grpcEndpoint, opts)\n\tif err != nil {\n\t\tblog.Errorf(\"register logmanager gateway failed, err %s\", err.Error())\n\t\treturn err\n\t}\n\tblog.Infof(\"register logmanager gateway succ\")\n\n\t// start http server\n\tmux := http.NewServeMux()\n\tmux.Handle(\"/\", s.gwmux)\n\n\t// http serve function\n\tvar workFunc func()\n\tvar server http.Server\n\t// whether to use transport layer secuerity\n\tif s.serverTLS != nil {\n\t\tserver = http.Server{\n\t\t\tAddr: s.httpEndpoint,\n\t\t\tHandler: mux,\n\t\t\tTLSConfig: s.serverTLS,\n\t\t}\n\t\tworkFunc = func() {\n\t\t\tblog.Info(\"starting logmanager gateway api server...\")\n\t\t\tif err := server.ListenAndServeTLS(\"\", \"\"); err != nil {\n\t\t\t\tblog.Errorf(\"start grpc server with net listener failed, err %s\", err.Error())\n\t\t\t\tutil.SendTermSignal()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tserver = http.Server{\n\t\t\tAddr: s.httpEndpoint,\n\t\t\tHandler: mux,\n\t\t}\n\t\tworkFunc = func() {\n\t\t\tblog.Info(\"starting logmanager gateway api server...\")\n\t\t\tif err := server.ListenAndServe(); err != nil {\n\t\t\t\tblog.Errorf(\"start grpc server with net listener failed, err %s\", err.Error())\n\t\t\t\tutil.SendTermSignal()\n\t\t\t}\n\t\t}\n\t}\n\tgo workFunc()\n\treturn nil\n}", "title": "" }, { "docid": "93f78d1991bc2556e5d2bbcd8eb9bdb3", "score": "0.6897024", "text": "func run(ctx context.Context, addr, endpoint, spec string) error {\n\t// build gateway mux\n\tgw, opts := runtime.NewServeMux(), []grpc.DialOption{grpc.WithInsecure()}\n\tfor _, f := range []func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error{\n\t\texamplepb.RegisterUtilHandlerFromEndpoint,\n\t\texamplepb.RegisterCountriesHandlerFromEndpoint,\n\t} {\n\t\tif err := f(ctx, gw, endpoint, opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// build mux\n\tmux := http.NewServeMux()\n\t// handle swagger\n\tmux.HandleFunc(spec, func(res http.ResponseWriter, req *http.Request) {\n\t\tres.Header().Set(\"Content-Type\", \"application/json\")\n\t\t_, _ = res.Write(examplepb.Swagger)\n\t})\n\t// handle gateway\n\tmux.Handle(\"/v1/\", gw)\n\t// add redoc\n\tif err := redoc.New(spec, \"/\", redoc.WithServeMux(mux)).Build(ctx, nil); err != nil {\n\t\treturn err\n\t}\n\t// listen and serve\n\tl, err := (&net.ListenConfig{}).Listen(ctx, \"tcp\", addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer l.Close()\n\treturn http.Serve(l, mux)\n}", "title": "" }, { "docid": "c29ee5c5af3e8ce0e88629f60f8472ed", "score": "0.67852604", "text": "func gatewayMain(ctx *cli.Context) {\n\tif !ctx.Args().Present() || ctx.Args().First() == \"help\" {\n\t\tcli.ShowCommandHelpAndExit(ctx, \"gateway\", 1)\n\t}\n\n\t// Fetch access and secret key from env.\n\taccessKey, secretKey := mustGetGatewayCredsFromEnv()\n\n\t// Initialize new gateway config.\n\t//\n\t// TODO: add support for custom region when we add\n\t// support for S3 backend storage, currently this can\n\t// default to \"us-east-1\"\n\terr := newGatewayConfig(accessKey, secretKey, \"us-east-1\")\n\tif err != nil {\n\t\tconsole.Fatalf(\"Unable to initialize gateway config. Error: %s\", err)\n\t}\n\n\t// Enable console logging.\n\tenableConsoleLogger()\n\n\t// Get quiet flag from command line argument.\n\tquietFlag := ctx.Bool(\"quiet\") || ctx.GlobalBool(\"quiet\")\n\n\t// First argument is selected backend type.\n\tbackendType := ctx.Args().First()\n\n\tnewObject, err := newGatewayLayer(backendType, accessKey, secretKey)\n\tif err != nil {\n\t\tconsole.Fatalf(\"Unable to initialize gateway layer. Error: %s\", err)\n\t}\n\n\tinitNSLock(false) // Enable local namespace lock.\n\n\trouter := mux.NewRouter().SkipClean(true)\n\tregisterGatewayAPIRouter(router, newObject)\n\n\tvar handlerFns = []HandlerFunc{\n\t\t// Limits all requests size to a maximum fixed limit\n\t\tsetRequestSizeLimitHandler,\n\t\t// Adds 'crossdomain.xml' policy handler to serve legacy flash clients.\n\t\tsetCrossDomainPolicy,\n\t\t// Validates all incoming requests to have a valid date header.\n\t\tsetTimeValidityHandler,\n\t\t// CORS setting for all browser API requests.\n\t\tsetCorsHandler,\n\t\t// Validates all incoming URL resources, for invalid/unsupported\n\t\t// resources client receives a HTTP error.\n\t\tsetIgnoreResourcesHandler,\n\t\t// Auth handler verifies incoming authorization headers and\n\t\t// routes them accordingly. Client receives a HTTP error for\n\t\t// invalid/unsupported signatures.\n\t\tsetAuthHandler,\n\t}\n\n\tapiServer := NewServerMux(ctx.String(\"address\"), registerHandlers(router, handlerFns...))\n\n\t// Set if we are SSL enabled S3 gateway.\n\tglobalIsSSL = isSSL()\n\n\t// Start server, automatically configures TLS if certs are available.\n\tgo func() {\n\t\tcert, key := \"\", \"\"\n\t\tif globalIsSSL {\n\t\t\tcert, key = getPublicCertFile(), getPrivateKeyFile()\n\t\t}\n\t\tif aerr := apiServer.ListenAndServe(cert, key); aerr != nil {\n\t\t\tconsole.Fatalf(\"Failed to start minio server. Error: %s\\n\", aerr)\n\t\t}\n\t}()\n\n\tapiEndPoints, err := finalizeAPIEndpoints(apiServer.Addr)\n\tfatalIf(err, \"Unable to finalize API endpoints for %s\", apiServer.Addr)\n\n\t// Once endpoints are finalized, initialize the new object api.\n\tglobalObjLayerMutex.Lock()\n\tglobalObjectAPI = newObject\n\tglobalObjLayerMutex.Unlock()\n\n\t// Prints the formatted startup message once object layer is initialized.\n\tif !quietFlag {\n\t\tmode := \"\"\n\t\tif gatewayBackend(backendType) == azureBackend {\n\t\t\tmode = globalMinioModeGatewayAzure\n\t\t}\n\t\tcheckUpdate(mode)\n\t\tprintGatewayStartupMessage(apiEndPoints, accessKey, secretKey, backendType)\n\t}\n\n\t<-globalServiceDoneCh\n}", "title": "" }, { "docid": "e8c0350ab85665fe9711c3bd3986a60a", "score": "0.6736853", "text": "func Run() {\n\tgrpcInterface := viper.GetString(\"server.grpc.interface\")\n\tgrpcPort := viper.GetInt(\"server.grpc.port\")\n\tgrpcConnectionString := fmt.Sprintf(\"%s:%d\", grpcInterface, grpcPort)\n\n\tlogrus.Infoln(\"serving gRPC on \" + grpcConnectionString)\n\tlis, err := net.Listen(\"tcp\", grpcConnectionString)\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err.Error(),\n\t\t}).Fatalln(\"failed to listen\")\n\t}\n\tgrpcServer := grpc.NewServer()\n\tpb.RegisterApiServiceServer(grpcServer, &ApiServiceServer{}) // registring new grpc server\n\n\t// starting new grpc server in a goroutine\n\tgo func() {\n\t\tif grpcServer.Serve(lis) != nil {\n\t\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\t\"error\": err.Error(),\n\t\t\t}).Fatalln(\"failed to start server\")\n\t\t}\n\t}()\n\n\tconn, err := grpc.DialContext(\n\t\tcontext.Background(),\n\t\tgrpcConnectionString,\n\t\tgrpc.WithBlock(),\n\t\tgrpc.WithInsecure(),\n\t)\n\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err.Error(),\n\t\t}).Fatalln(\"failed to dial server\")\n\t}\n\n\thttpInterface := viper.GetString(\"server.http.interface\")\n\thttpPort := viper.GetInt(\"server.http.port\")\n\thttpConnectionString := fmt.Sprintf(\"%s:%d\", httpInterface, httpPort)\n\n\tgwMux := runtime.NewServeMux()\n\terr = pb.RegisterApiServiceHandler(context.Background(), gwMux, conn) // setting grpc http gateway\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err.Error(),\n\t\t}).Fatalln(\"failed to register gateway\")\n\t}\n\n\tmux := http.NewServeMux()\n\tmux.Handle(\"/\", gwMux)\n\n\tmux.HandleFunc(\"/swagger.json\", serveSwagger) // handling swagger.json file for swagger-ui\n\n\tlogrus.Infoln(\"serving HTTP gRPC-Gateway on \" + httpConnectionString)\n\tif err := http.ListenAndServe(httpConnectionString, allowCORS(mux)); err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err.Error(),\n\t\t}).Fatalln(\"gateway listener failed\")\n\t}\n}", "title": "" }, { "docid": "27de5fde50ba00a403faec880bc3d388", "score": "0.65659106", "text": "func Run(ctx *cli.Context) error {\n\tif len(ctx.String(\"address\")) > 0 {\n\t\taddress = ctx.String(\"address\")\n\t}\n\tif len(ctx.String(\"network\")) > 0 {\n\t\tnetwork = ctx.String(\"network\")\n\t}\n\n\t// Initialise the local service\n\tservice := service.New(\n\t\tservice.Name(\"network\"),\n\t\tservice.Address(address),\n\t)\n\n\tgateway := ctx.String(\"gateway\")\n\tid := service.Server().Options().Id\n\n\t// increase the client retries\n\tclient.DefaultClient.Init(\n\t\tclient.Retries(3),\n\t)\n\n\t// local tunnel router\n\trtr := router.DefaultRouter\n\n\trtr.Init(\n\t\trouter.Network(network),\n\t\trouter.Id(id),\n\t\trouter.Gateway(gateway),\n\t\trouter.Cache(),\n\t)\n\n\t// local proxy using grpc\n\t// TODO: reenable after PR\n\tlocalProxy := grpcProxy.NewProxy(\n\t\tproxy.WithRouter(rtr),\n\t\tproxy.WithClient(service.Client()),\n\t)\n\n\t// local mux\n\tlocalMux := muxer.New(\"network\", localProxy)\n\n\t// set the handler\n\tsrv := grpc.NewServer(\n\t\tserver.Name(\"network\"),\n\t\tserver.Address(netAddress),\n\t\tserver.WithRouter(localMux),\n\t)\n\n\t// start the grpc server\n\tif err := srv.Start(); err != nil {\n\t\tlog.Fatal(\"Error starting network: %v\", err)\n\t}\n\n\tlog.Infof(\"Network [%s] listening on %s\", network, netAddress)\n\n\tif err := service.Run(); err != nil {\n\t\tlog.Errorf(\"Network %s failed: %v\", network, err)\n\t\tos.Exit(1)\n\t}\n\n\t// stop the grpc server\n\treturn srv.Stop()\n}", "title": "" }, { "docid": "0bd04a522b1c294bdb146b65c0187cc8", "score": "0.65595824", "text": "func StartGateway(es EventingServer) {\n\tport, ok := os.LookupEnv(common.EnvVarGatewayServerPort)\n\tif !ok {\n\t\tpanic(fmt.Errorf(\"port is not provided\"))\n\t}\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\":%s\", port))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tsrv := grpc.NewServer()\n\tRegisterEventingServer(srv, es)\n\n\tfmt.Println(\"starting gateway server\")\n\n\tif err := srv.Serve(lis); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "ef4d1addf09834c80be2270d3f068339", "score": "0.6320079", "text": "func Run(ctx context.Context, addr string, endpoint string, opts ...runtime.ServeMuxOption) error {\n\tmux := runtime.NewServeMux(opts...)\n\tgrpcOpts := []grpc.DialOption{grpc.WithInsecure()}\n\t\n\terr := proto.RegisterEchoServiceHandlerFromEndpoint(ctx, mux, endpoint, grpcOpts)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to register endpoint server: %v\", err)\n\t\treturn err\n\t}\n\n\ts := &http.Server{\n\t\tAddr: addr,\n\t\tHandler: mux,\n\t}\n\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tif err := s.Shutdown(context.Background()); err != nil {\n\t\t\tfmt.Printf(\"Failed to shutdown http gateway server: %v\", err)\n\t\t}\n\t}()\n\n\tif err := s.ListenAndServe(); err != http.ErrServerClosed {\n\t\tfmt.Printf(\"Failed to listen and serve: %v\", err)\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "991c7ac93d6e6575005be9deb37f9c76", "score": "0.62859875", "text": "func RunManagementGateway(ctx context.Context, srv xds.Server, port uint) {\n\tglog.Infof(\"Gateway listening HTTP/1.1 on port %d\", port)\n\tserver := &http.Server{Addr: fmt.Sprintf(\":%d\", port), Handler: &xds.HTTPGateway{Server: srv}}\n\tgo func() {\n\t\tif err := server.ListenAndServe(); err != nil {\n\t\t\tglog.Error(err)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "fd8309441b4de81c3dab2c5dc8b4fc2f", "score": "0.62538326", "text": "func run() error {\n\tctx := context.Background()\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tmux := runtime.NewServeMux()\n\tresolver := grpclb.NewResolver(*serv)\n\tbl := googlegrpc.RoundRobin(resolver)\n\topts := []googlegrpc.DialOption{googlegrpc.WithInsecure(), googlegrpc.WithBalancer(bl)}\n\terr := pb.RegisterRouteGuideHandlerFromEndpoint(ctx, mux, *reg, opts)\n\n\tif err != nil {\n\t\tglog.Fatal(err)\n\t\treturn err\n\t}\n\tfmt.Printf(\"http server listener on: %v\\n\", httpAddress)\n\treturn http.ListenAndServe(httpAddress, mux)\n}", "title": "" }, { "docid": "abfe327e193b8c513bd7a1f313eeb9f8", "score": "0.62220377", "text": "func RunManagementGateway(ctx context.Context, srv xds.Server, port uint) {\n\tlog.Printf(\"Starting HTTP/1.1 gateway on Port %d\\n\", port)\n\tserver := &http.Server{Addr: fmt.Sprintf(\":%d\", port), Handler: &xds.HTTPGateway{Server: srv}}\n\tgo func() {\n\t\tif err := server.ListenAndServe(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\t<-ctx.Done()\n\tif err := server.Shutdown(ctx); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "71ea2c399049ebbc1d42fd3d4eea7824", "score": "0.6200131", "text": "func runGrpc(grpcServer *grpc.Server, grpcEndpoint string) {\n\tlis, err := net.Listen(\"tcp\", grpcEndpoint)\n\tif err != nil {\n\t\tlogger.WithField(\"grpcEndpoint\", grpcEndpoint).Fatal(\"Could not listen on grpc endpoint\")\n\t}\n\n\tlogger.WithField(\"grpcEndpoint\", grpcEndpoint).Info(\"Starting SDKServer grpc service...\")\n\tif err := grpcServer.Serve(lis); err != nil {\n\t\tlogger.WithError(err).Fatal(\"Could not serve grpc server\")\n\t}\n}", "title": "" }, { "docid": "062e4ca970c39b13a1394ec0a7c98670", "score": "0.61768603", "text": "func RunServer(opt config.Config) error {\n\n\t// Initialize logger, on any error fn will panic\n\tlogger.Init(opt.Log.LogLevel, opt.Log.LogOutputPaths)\n\n\tctx := context.Background()\n\n\t// get configuration\n\n\tif len(opt.Server.GrpcPort) == 0 {\n\t\treturn fmt.Errorf(\"invalid TCP port for gRPC server: '%s'\", opt.Server.GrpcPort)\n\t}\n\n\tif len(opt.Server.HttpPort) == 0 {\n\t\treturn fmt.Errorf(\"invalid TCP port for HTTP gateway: '%s'\", opt.Server.HttpPort)\n\t}\n\n\tif err := opt.Mongo.Init(); err != nil {\n\t\treturn err\n\t}\n\n\tDB := db.Connect(db.Options{\n\t\tClient: opt.Mongo.Client,\n\t\tDB: opt.Mongo.DB,\n\t})\n\n\tv1API := v1.NewOpServiceServer(v1.Options{\n\t\tConfig: opt,\n\t\tDB: DB,\n\t})\n\n\t// initialize access logger\n\taccessLog, err := logger.CreateLogger(\n\t\tlogger.LogLevels[opt.Log.AccessLogLevel], opt.Log.AccessLogOutputPaths,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// run HTTP gateway\n\tgo func() {\n\t\t_ = rest.RunServer(rest.RunServerOptions{\n\t\t\tCtx: ctx,\n\t\t\tGrpcPort: opt.Server.GrpcPort,\n\t\t\tHttpPort: opt.Server.HttpPort,\n\t\t\tAccessLog: accessLog,\n\t\t})\n\t}()\n\n\treturn grpc.RunServer(grpc.RunServerOptions{\n\t\tCtx: ctx,\n\t\tV1API: v1API,\n\t\tPort: opt.Server.GrpcPort,\n\t\tAccessLog: accessLog,\n\t})\n}", "title": "" }, { "docid": "4913ea2b2d9be9b1ff1c37d37be9e5c1", "score": "0.6088327", "text": "func (g grpcHttpProxyImpl) Run() {\n\tgo func() {\n\t\terr := g.sendRequests()\n\t\tif err != nil {\n\t\t\tg.logger.Printf(\"Error sending request to prefix %s: %v\", g.prefix, err)\n\t\t}\n\t}()\n\n\tgo func() {\n\t\terr := g.receiveResponses()\n\t\tif err != nil {\n\t\t\tg.logger.Printf(\"Error receiving responses to prefix %s: %v\", g.prefix, err)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "0c2543d307183104dd1236d4a9d03e4a", "score": "0.607321", "text": "func run(flags *flagpole) {\n\tgrpcServerEndpoint := \":\" + flags.ServerPort\n\tl, err := net.Listen(\"tcp\", grpcServerEndpoint)\n\tif err != nil {\n\t\tglog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\tgrpcServer := grpc.NewServer()\n\tinstaller := grpcserver.NewInstaller(&grpcserver.Options{\n\t\tServerPort: flags.ServerPort,\n\t\tAgentPort: flags.AgentPort,\n\t\tImagesRegistry: flags.ImagesRegistry,\n\t\tServer: grpcServer,\n\t})\n\n\t// register grpc server\n\tinstallerv1.RegisterInstallerServer(grpcServer, installer)\n\treflection.Register(grpcServer)\n\tgo func() {\n\t\tglog.Info(\"starting grpc server...\")\n\t\tglog.Fatal(grpcServer.Serve(l))\n\t}()\n\n\t// start http server\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\t// Register gRPC server endpoint\n\t// Note: Make sure the gRPC server is running properly and accessible\n\tmux := runtime.NewServeMux()\n\topts := []grpc.DialOption{grpc.WithInsecure()}\n\terr = installerv1.RegisterInstallerHandlerFromEndpoint(ctx, mux, grpcServerEndpoint, opts)\n\tif err != nil {\n\t\tglog.Fatal(err)\n\t}\n\n\tglog.Info(\"starting http server...\")\n\t// Start HTTP server (and proxy calls to gRPC server endpoint)\n\tglog.Fatal(http.ListenAndServe(\":8080\", mux))\n}", "title": "" }, { "docid": "334466c43f5ddc16db993d05cd527e6f", "score": "0.6061045", "text": "func (server *GatewayToFeGServer) Run(addr string) {\n\tserver.H2CServer.Run(addr, server.useDispatcherHandler)\n}", "title": "" }, { "docid": "1abd6e53650c46eadd7a546f1fe48ee9", "score": "0.6044107", "text": "func serveHTTPGateway(cctx *oldcmds.Context) (<-chan error, error) {\n\tcfg, err := cctx.GetConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ServeHTTPGateway: GetConfig() failed: %s\", err)\n\t}\n\n\tgatewayMaddr, err := ma.NewMultiaddr(cfg.Addresses.Gateway)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ServeHTTPGateway: invalid gateway address: %q (err: %s)\", cfg.Addresses.Gateway, err)\n\t}\n\n\tgwLis, err := manet.Listen(gatewayMaddr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ServeHTTPGateway: manet.Listen(%s) failed: %s\", gatewayMaddr, err)\n\t}\n\t// we might have listened to /tcp/0 - lets see what we are listing on\n\tgatewayMaddr = gwLis.Multiaddr()\n\n\tvar opts = []corehttp.ServeOption{\n\t\tcorehttp.MetricsCollectionOption(\"gateway\"),\n\t\tcorehttp.CheckVersionOption(),\n\t\tcorehttp.CommandsROOption(*cctx),\n\t\tcorehttp.VersionOption(),\n\t\tcorehttp.IPNSHostnameOption(),\n\t\tcorehttp.GatewayOption(false, \"/ipfs\", \"/ipns\"),\n\t}\n\n\tif len(cfg.Gateway.RootRedirect) > 0 {\n\t\topts = append(opts, corehttp.RedirectOption(\"\", cfg.Gateway.RootRedirect))\n\t}\n\n\tnode, err := cctx.ConstructNode()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ServeHTTPGateway: ConstructNode() failed: %s\", err)\n\t}\n\n\terrc := make(chan error)\n\tgo func() {\n\t\terrc <- corehttp.Serve(node, gwLis.NetListener(), opts...)\n\t\tclose(errc)\n\t}()\n\tlog.Infof(\"gateway (readonly) server listening on %s\\n\", gatewayMaddr)\n\n\treturn errc, nil\n}", "title": "" }, { "docid": "dd882cd28dc7091e3dc91eb14f9b2ea6", "score": "0.60173213", "text": "func (api *api) serveGateway(w http.ResponseWriter, r *http.Request, logger log.Logger) {\n\tswitch r.Method {\n\tcase \"GET\":\n\t\t// Retrieves the current status of the Corona Network gateway\n\t\tlogger.Trace(\"Retrieving gateway status\")\n\t\tvar (\n\t\t\tstatus GatewayStatus\n\t\t\terr error\n\t\t)\n\t\tstatus.Enabled, status.Connected, status.Bandwidth.Ingress, status.Bandwidth.Egress, err = api.backend.GatewayStatus()\n\t\tif err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\t// All ok, stream the status and stats over to the client\n\t\tw.Header().Add(\"Content-Type\", \"application/json\")\n\t\tjson.NewEncoder(w).Encode(status)\n\n\tcase \"PUT\":\n\t\t// Requests the gateway to connect to the Corona Network\n\t\tif err := api.backend.EnableGateway(); err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\n\tcase \"DELETE\":\n\t\t// Ping the backend to disable itself, don't care if it's running or not,\n\t\t// keeps things stateless\n\t\tif err := api.backend.DisableGateway(); err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\treturn\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\n\tdefault:\n\t\thttp.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)\n\t}\n}", "title": "" }, { "docid": "292c2936842879734503c75178786b97", "score": "0.6001822", "text": "func Run(cfg Config) {\n\tendpoints := NewEndpoints()\n\n\t// Mechanical domain.\n\terrc := make(chan error)\n\n\t// Interrupt handler.\n\tgo handlers.InterruptHandler(errc)\n\n\t// Debug listener.\n\tgo func() {\n\t\tlog.Println(\"transport\", \"debug\", \"addr\", cfg.DebugAddr)\n\n\t\tm := http.NewServeMux()\n\t\tm.Handle(\"/debug/pprof/\", http.HandlerFunc(pprof.Index))\n\t\tm.Handle(\"/debug/pprof/cmdline\", http.HandlerFunc(pprof.Cmdline))\n\t\tm.Handle(\"/debug/pprof/profile\", http.HandlerFunc(pprof.Profile))\n\t\tm.Handle(\"/debug/pprof/symbol\", http.HandlerFunc(pprof.Symbol))\n\t\tm.Handle(\"/debug/pprof/trace\", http.HandlerFunc(pprof.Trace))\n\n\t\terrc <- http.ListenAndServe(cfg.DebugAddr, m)\n\t}()\n\n\t// HTTP transport.\n\tgo func() {\n\t\tlog.Println(\"transport\", \"HTTP\", \"addr\", cfg.HTTPAddr)\n\t\th := svc.MakeHTTPHandler(endpoints)\n\t\terrc <- http.ListenAndServe(cfg.HTTPAddr, h)\n\t}()\n\n\t// gRPC transport.\n\tgo func() {\n\t\tlog.Println(\"transport\", \"gRPC\", \"addr\", cfg.GRPCAddr)\n\t\tln, err := net.Listen(\"tcp\", cfg.GRPCAddr)\n\t\tif err != nil {\n\t\t\terrc <- err\n\t\t\treturn\n\t\t}\n\n\t\tsrv := svc.MakeGRPCServer(endpoints)\n\t\ts := grpc.NewServer()\n\t\tpb.RegisterRelloServer(s, srv)\n\n\t\terrc <- s.Serve(ln)\n\t}()\n\n\t// Run!\n\tlog.Println(\"exit\", <-errc)\n}", "title": "" }, { "docid": "0fe06f1bda9b6ca86d30fb065de59238", "score": "0.5993408", "text": "func RunInProcessGateway(ctx context.Context, addr string, opts ...runtime.ServeMuxOption) error {\n\tmux := runtime.NewServeMux(opts...)\n\n\texamples.RegisterEchoServiceHandlerServer(ctx, mux, newEchoServer())\n\texamples.RegisterFlowCombinationHandlerServer(ctx, mux, newFlowCombinationServer())\n\texamples.RegisterNonStandardServiceHandlerServer(ctx, mux, newNonStandardServer())\n\tstandalone.RegisterUnannotatedEchoServiceHandlerServer(ctx, mux, newUnannotatedEchoServer())\n\n\tabe := newABitOfEverythingServer()\n\texamples.RegisterABitOfEverythingServiceHandlerServer(ctx, mux, abe)\n\texamples.RegisterStreamServiceHandlerServer(ctx, mux, abe)\n\texamples.RegisterResponseBodyServiceHandlerServer(ctx, mux, newResponseBodyServer())\n\n\ts := &http.Server{\n\t\tAddr: addr,\n\t\tHandler: mux,\n\t}\n\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tglog.Infof(\"Shutting down the http gateway server\")\n\t\tif err := s.Shutdown(context.Background()); err != nil {\n\t\t\tglog.Errorf(\"Failed to shutdown http gateway server: %v\", err)\n\t\t}\n\t}()\n\n\tif err := s.ListenAndServe(); err != http.ErrServerClosed {\n\t\tglog.Errorf(\"Failed to listen and serve: %v\", err)\n\t\treturn err\n\t}\n\treturn nil\n\n}", "title": "" }, { "docid": "cc3ef4f845761f670cb8e891771d9373", "score": "0.5983532", "text": "func (g *Gateway) run() {\n\tg.startOnce.Do(func() {\n\t\tgo g.handleIncomingEvents()\n\t})\n}", "title": "" }, { "docid": "4383b45a2cc6bd608fe94ca92a295415", "score": "0.5966548", "text": "func RunServer(ctx context.Context, grpcPort int, httpPort int) error {\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tmux := runtime.NewServeMux()\n\n\topts := []grpc.DialOption{grpc.WithInsecure()}\n\n\tif err := auth.RegisterAuthenticationHandlerFromEndpoint(ctx, mux, fmt.Sprintf(\"localhost:%d\", grpcPort), opts); err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to authentication gRPC service %w\", err)\n\t}\n\n\tif err := discovery.RegisterDiscoveryHandlerFromEndpoint(ctx, mux, fmt.Sprintf(\"localhost:%d\", grpcPort), opts); err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to discovery gRPC service %w\", err)\n\t}\n\n\tsrv := &http.Server{\n\t\tAddr: fmt.Sprintf(\":%d\", httpPort),\n\t\tHandler: mux,\n\t}\n\n\t// graceful shutdown\n\tc := make(chan os.Signal, 1)\n\tsignal.Notify(c, os.Interrupt)\n\tgo func() {\n\t\tfor range c {\n\t\t\t// sig is a ^C, handle it\n\t\t\tbreak\n\t\t}\n\n\t\t_, cancel := context.WithTimeout(ctx, 5*time.Second)\n\t\tdefer cancel()\n\n\t\tlog.Printf(\"Shutting down REST gateway on :%d\", httpPort)\n\n\t\t_ = srv.Shutdown(ctx)\n\t}()\n\n\tlog.Printf(\"Starting REST gateway on :%d\", httpPort)\n\n\treturn srv.ListenAndServe()\n}", "title": "" }, { "docid": "999aac1e222afd33f967ff685f42f6ea", "score": "0.5946169", "text": "func createGateway(host string) (gateway.Gateway, error) {\n\t// create default grpc client\n\treturn gateway.NewGrpcGateway(host)\n}", "title": "" }, { "docid": "748297f1080a775ef485078608189997", "score": "0.5945788", "text": "func run(ctx *cli.Context, srvOpts ...micro.Option) {\n\t// Init plugins\n\tfor _, p := range Plugins() {\n\t\tp.Init(ctx)\n\t}\n\n\tif len(ctx.GlobalString(\"server_name\")) > 0 {\n\t\tName = ctx.GlobalString(\"server_name\")\n\t}\n\tif len(ctx.String(\"address\")) > 0 {\n\t\tAddress = ctx.String(\"address\")\n\t}\n\tif len(ctx.String(\"router\")) > 0 {\n\t\tRouter = ctx.String(\"router\")\n\t}\n\tif len(ctx.String(\"network\")) > 0 {\n\t\tNetwork = ctx.String(\"network\")\n\t}\n\n\t// Initialise service\n\tservice := micro.NewService(\n\t\tmicro.Name(Name),\n\t\tmicro.Address(Address),\n\t\tmicro.RegisterTTL(time.Duration(ctx.GlobalInt(\"register_ttl\"))*time.Second),\n\t\tmicro.RegisterInterval(time.Duration(ctx.GlobalInt(\"register_interval\"))*time.Second),\n\t)\n\n\tr := router.NewRouter(\n\t\trouter.ID(service.Server().Options().Id),\n\t\trouter.Address(Router),\n\t\trouter.Network(Network),\n\t\trouter.Registry(service.Client().Options().Registry),\n\t)\n\n\t// register router handler\n\tpb.RegisterRouterHandler(\n\t\tservice.Server(),\n\t\t&handler.Router{Router: r},\n\t)\n\n\t// channel to collect errors\n\terrChan := make(chan error, 2)\n\n\t// WaitGroup to track goroutines\n\tvar wg sync.WaitGroup\n\n\t// Start the micro server\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\tlog.Log(\"[router] starting micro router\")\n\t\terrChan <- r.Advertise()\n\t}()\n\n\t// Start the micro server service\n\twg.Add(1)\n\tgo func() {\n\t\tdefer wg.Done()\n\t\terrChan <- service.Run()\n\t}()\n\n\t// we block here until either service or server fails\n\tif err := <-errChan; err != nil {\n\t\tlog.Logf(\"[router] error running the router: %v\", err)\n\t}\n\n\tlog.Log(\"[router] attempting to stop the router\")\n\n\t// stop the server\n\tif err := r.Stop(); err != nil {\n\t\tlog.Logf(\"[router] error stopping the router: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\t// wait for all the goroutines to stop\n\twg.Wait()\n\n\tlog.Logf(\"[router] successfully stopped\")\n}", "title": "" }, { "docid": "7265a105136ad3e6823fbff9e11829e3", "score": "0.59394974", "text": "func CreateGateway(\n\tt *testing.T, config map[string]interface{}, opts *Options,\n) (TestGateway, error) {\n\tstartTime := time.Now()\n\n\tif config == nil {\n\t\tconfig = map[string]interface{}{}\n\t}\n\tif opts == nil {\n\t\tpanic(\"opts in test.CreateGateway() mandatory\")\n\t}\n\tif opts.TestBinary == \"\" {\n\t\tpanic(\"opts.TestBinary in test.CreateGateway() mandatory\")\n\t}\n\n\tbackendsHTTP, err := testBackend.BuildHTTPBackends(config, opts.KnownHTTPBackends)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbackendsTChannel, err := testBackend.BuildTChannelBackends(config, opts.KnownTChannelBackends)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttchannelOpts := &tchannel.ChannelOptions{\n\t\tLogger: tchannel.NullLogger,\n\t}\n\n\tserviceName := \"test-gateway\"\n\tchannel, err := tchannel.NewChannel(serviceName, tchannelOpts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttchannelClient := zanzibar.NewTChannelClient(channel, &zanzibar.TChannelClientOption{\n\t\tServiceName: serviceName,\n\t\tTimeout: time.Duration(1000) * time.Millisecond,\n\t\tTimeoutPerAttempt: time.Duration(100) * time.Millisecond,\n\t})\n\n\ttestGateway := &ChildProcessGateway{\n\t\tchannel: channel,\n\t\tserviceName: serviceName,\n\t\ttest: t,\n\t\topts: opts,\n\t\tstartTime: startTime,\n\t\tHTTPClient: &http.Client{\n\t\t\tTransport: &http.Transport{\n\t\t\t\tDisableKeepAlives: false,\n\t\t\t\tMaxIdleConns: 500,\n\t\t\t\tMaxIdleConnsPerHost: 500,\n\t\t\t},\n\t\t},\n\t\tTChannelClient: tchannelClient,\n\t\tjsonLines: []string{},\n\t\terrorLogs: map[string][]string{},\n\t\tbackendsHTTP: backendsHTTP,\n\t\tbackendsTChannel: backendsTChannel,\n\t}\n\n\ttestGateway.setupMetrics(t, opts)\n\n\tif _, contains := config[\"http.port\"]; !contains {\n\t\tconfig[\"http.port\"] = 0\n\t}\n\n\tif _, contains := config[\"tchannel.port\"]; !contains {\n\t\tconfig[\"tchannel.port\"] = 0\n\t}\n\n\tconfig[\"tchannel.serviceName\"] = serviceName\n\tconfig[\"tchannel.processName\"] = serviceName\n\tconfig[\"metrics.m3.hostPort\"] = testGateway.m3Server.Addr\n\tconfig[\"metrics.tally.service\"] = serviceName\n\tconfig[\"metrics.tally.flushInterval\"] = 10\n\tconfig[\"metrics.m3.flushInterval\"] = 10\n\tconfig[\"logger.output\"] = \"stdout\"\n\n\terr = testGateway.createAndSpawnChild(opts.TestBinary, config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn testGateway, nil\n}", "title": "" }, { "docid": "bdc5a8d9edf25f85ac46f8d6ffa242d6", "score": "0.5887365", "text": "func Run() {\n\trunGRPC()\n}", "title": "" }, { "docid": "a4e722171d7bffcb7bdb60c082ccfeb7", "score": "0.5873665", "text": "func Run() {\n\tport := fmt.Sprintf(\":%d\", config.AppSetting.RPCPort)\n\n\tlis, err := net.Listen(\"tcp\", port)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ts := grpc.NewServer()\n\tmatch.RegisterMatchServer(s, &matchServer{})\n\treflection.Register(s)\n\n\tif err := s.Serve(lis); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "b3347bbc68fa7f37043de0c530770508", "score": "0.5857381", "text": "func createGateway(host string) (gateway.Gateway, error) {\n\t// TODO implement emulator gateway and check emulator flag here\n\n\t// create default grpc client\n\treturn gateway.NewGrpcGateway(host)\n}", "title": "" }, { "docid": "dc9ee325fcbb6efa336f6adfdee8a935", "score": "0.5856845", "text": "func (webInterface *InformationRequestInterface) run(port string) {\n\tfmt.Println(\"IDSGatewayInterface started\")\n\twebInterface.providerStarted.Done()\n\n\trouter := mux.NewRouter()\n\tgoPath := os.Getenv(\"GOPATH\")\n\thtmlPath := goPath+\"/src/github.com/tkrex/IDS/gateway/frontend/\"\n\tfs := http.Dir(htmlPath)\n\tfileHandler := http.FileServer(fs)\n\trouter.HandleFunc(\"/rest/domainInformation/{domain}\", webInterface.handleDomainInformation).Methods(\"GET\")\n\trouter.HandleFunc(\"/rest/brokers/{brokerId}/{domain}\", webInterface.getDomainInformationForBroker).Methods(\"GET\")\n\trouter.HandleFunc(\"/rest/brokers/{domainName}\", webInterface.getBrokersForDomain).Methods(\"GET\")\n\trouter.HandleFunc(\"/rest/domains\", webInterface.getAllDomains).Methods(\"GET\")\n\n\trouter.PathPrefix(\"/\").Handler(http.StripPrefix(\"/\", fileHandler))\n\thttp.ListenAndServe(\":\" + port, router)\n}", "title": "" }, { "docid": "55461fc9b7f9bb862f41bd4c7fbaccbb", "score": "0.58075297", "text": "func rungRPC(ctx context.Context, port int) error {\n\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", port))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to listen: %w\", err)\n\t}\n\n\ts := grpc.NewServer()\n\tpb.RegisterGreeterServer(s, &server{port: port})\n\treflection.Register(s)\n\n\tgo stopWhenDone(ctx, s)\n\n\tif err := s.Serve(lis); err != nil {\n\t\treturn fmt.Errorf(\"failed to serve: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "85f89be5be606d08cd766c9d065a9dc0", "score": "0.5800063", "text": "func StartAGateway( init GatewayInit ) {\r\n\r\n\t// if enabled, a new gateway instance will spawn up if this one exits\r\n\t// todo: \\/ configurable \\/\r\n\tautoReconnect := true\r\n\r\n\t// Process the tag slice\r\n\tvar tagSlice [] string\r\n\tvar strTagSlice [] string\r\n\tfor _, t := range init.TagSlice {\r\n\r\n\t\t// build struct expected by the AddTag method\r\n\t\tvar tag KK_Tag_DB.TagObj\r\n\t\ttag.PLCName = init.PlcName\r\n\t\ttag.TagAddress = t.TagName \t// yes these seems backwards\r\n\t\ttag.TagName = t.Alias\t\t// clean up later\r\n\t\ttag.IsWritable = t.IsWritable\r\n\t\ttag.Events = t.Events\r\n\r\n\t\t// add the tag to the tag database\r\n\t\tKK_Tag_DB.TagDatabase.AddTag( tag )\r\n\r\n\t\t// parse out the Tag and strTag names for the gateway\r\n\t\tif ( t.IsString ) {\r\n\t\t\tstrTagSlice = append( strTagSlice, t.TagName )\r\n\t\t}else{\r\n\t\t\ttagSlice = append( tagSlice, t.TagName )\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// instiate a new gateway process\r\n\tplcGatewayApp := plcGatewayBinder(init.PlcName, init.Path, init.Args)\r\n\r\n\t// add this gateway to the global slice\r\n\tPLCGateways = append(PLCGateways, plcGatewayApp)\r\n\r\n\t// start the gateway child process\r\n\terr := plcGatewayApp.cmdBind.Start()\r\n\tif err != nil {\r\n\t\tKK_Globals.Dbg( init.PlcName + \" fatal gateway error, cannot start gateway: \" + err.Error(), \"error\" )\r\n\r\n\r\n\t\t// todo: come back to this idea of raising events in the system\r\n\t\tKK_Tag_DB.TagDatabase.SetSystemTag( \"plcTagInitFailure\", init.PlcName)\r\n\t\treturn\r\n\t}\r\n\r\n\t// connect to the PLC\r\n\tplcGatewayApp.SendCommand(\"connect \" + init.ConnectAddress)\r\n\r\n\t// disable the tag event logging\r\n\tplcGatewayApp.SendCommand(\"logging disable\")\r\n\r\n\t// add tags to the gateway monitor groups\r\n\tplcGatewayApp.AddTags(tagSlice)\r\n\tplcGatewayApp.AddStringTags(strTagSlice)\r\n\r\n\t// start monitoring all tags in the default tag group\r\n\tplcGatewayApp.SendCommand(\"groupenable default_group\")\r\n\r\n\t// hold the go app open until the nested app closes\r\n\terr = plcGatewayApp.cmdBind.Wait()\r\n\tif err != nil {\r\n\t\tKK_Globals.Dbg( init.PlcName + \" gateway has exited unexpectedly\", \"warning\" )\r\n\t\tKK_Globals.Dbg( init.PlcName + \" gateway Error: \" + err.Error(), \"error\" )\r\n\t}\r\n\r\n\t/////////////////////////////////////////////////////////////////////////////\r\n\t/////////// code flow only passes this point when the exe exits /////////////\r\n\t/////////////////////////////////////////////////////////////////////////////\r\n\r\n\t// clean up the plcGatewayApp slice to removed the exited gateway\r\n\ti, err := getPLCGatewayIndex(init.PlcName)\r\n\tif err != nil {\r\n\t\tKK_Globals.Dbg( \"Error finding \" + init.PlcName + \" in Gateway Slice\", \"warning\" )\r\n\t\tKK_Globals.Dbg( err.Error(), \"warning\" )\r\n\t}else{\r\n\r\n\t\t// remove the gateway from the slice\r\n\t\tPLCGateways = append(PLCGateways[:i], PLCGateways[i+1:]...)\r\n\t}\r\n\r\n\t// reconnect if auto reconnect is enabled\r\n\tif autoReconnect {\r\n\t\tKK_Globals.Dbg( \"Restarting \" + init.PlcName, \"info\" )\r\n\t\tStartAGateway(init)\r\n\t}\r\n}", "title": "" }, { "docid": "1a9f0443c5fb7aa0bfe77be81385c1d3", "score": "0.5744097", "text": "func Run() error {\n\ts := grapiserver.New(\n\t\tgrapiserver.WithDefaultLogger(),\n\t\tgrapiserver.WithGrpcServerUnaryInterceptors(interceptors.AuthInterceptor),\n\t\tgrapiserver.WithGrpcAddr(\"tcp\", fmt.Sprintf(\"localhost:%d\", config.ServerCfg.GRPCPort)),\n\t\tgrapiserver.WithGatewayAddr(\"tcp\", fmt.Sprintf(\"localhost:%d\", config.ServerCfg.HTTPPort)),\n\t\tgrapiserver.WithServers(\n\t\t\t&controllers.ServerInfoSrv{},\n\t\t\t&controllers.UserSrv{},\n\t\t),\n\t)\n\treturn s.Serve()\n}", "title": "" }, { "docid": "bf246aee9a45128351253d28c42e7aa3", "score": "0.5733859", "text": "func c14GatewayMain(ctx *cli.Context) {\n\t// Validate gateway arguments.\n\thost := ctx.Args().First()\n\t// Validate gateway arguments.\n\tlogger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString(\"address\"), host), \"Invalid argument\")\n\n\tminio.StartGateway(ctx, &c14{})\n}", "title": "" }, { "docid": "c4f2c8696b54dea783722a9c658678a2", "score": "0.57284963", "text": "func runProxy(ctx context.Context, t *testing.T, duration time.Duration, srcPort int, dstPort int) {\n\tcmd := exec.CommandContext(ctx, \"go\", \"run\", \"main.go\", \"-duration\", duration.String(), \"-src\", strconv.Itoa(srcPort), \"-dst\", strconv.Itoa(dstPort))\n\tcmd.Dir = \"proxy\"\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tt.Log(err)\n\t}\n\tif len(out) != 0 {\n\t\tt.Log(string(out))\n\t}\n}", "title": "" }, { "docid": "03ab94e3f4843e0df61a7be299cd8459", "score": "0.5707204", "text": "func Run() {\n\tactiveScenario := scenarios.ActiveScenario\n\n\tserver := grpc.NewServer(utilTesting.NewGRPCServerOptions(logger)...)\n\tpb.RegisterEvaluatorServer(server, activeScenario.Evaluator)\n\tln, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", 50508))\n\tif err != nil {\n\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\"error\": err.Error(),\n\t\t\t\"port\": 50508,\n\t\t}).Fatal(\"net.Listen() error\")\n\t}\n\n\tlogger.WithFields(logrus.Fields{\n\t\t\"port\": 50508,\n\t}).Info(\"TCP net listener initialized\")\n\n\tlogger.Info(\"Serving gRPC endpoint\")\n\terr = server.Serve(ln)\n\tif err != nil {\n\t\tlogger.WithFields(logrus.Fields{\n\t\t\t\"error\": err.Error(),\n\t\t}).Fatal(\"gRPC serve() error\")\n\t}\n}", "title": "" }, { "docid": "8346b425b6afbf66b0313452eb13ba99", "score": "0.5702132", "text": "func Run() error {\n\tcfg, err := config.LoadConfig()\n\tif err != nil {\n\t\tgrpclog.Errorf(\"%+v\", err)\n\t\treturn err\n\t}\n\n\tstore, err := di.NewStoreComponent(cfg)\n\tif err != nil {\n\t\tgrpclog.Errorf(\"%+v\", err)\n\t\treturn err\n\t}\n\n\tcli, err := di.NewClientComponent(cfg)\n\tif err != nil {\n\t\tgrpclog.Errorf(\"%+v\", err)\n\t\treturn err\n\t}\n\n\tboil.DebugMode = cfg.DebugLog\n\n\tauthorizator := interceptor.NewAuthorizator(store)\n\n\ts := grapiserver.New(\n\t\tgrapiserver.WithDefaultLogger(),\n\t\tgrapiserver.WithGatewayServerMiddlewares(\n\t\t\tinterceptor.CORSMiddleware,\n\t\t),\n\t\tgrapiserver.WithGatewayMuxOptions(\n\t\t\truntime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: true}),\n\t\t),\n\t\tgrapiserver.WithGrpcServerUnaryInterceptors(\n\t\t\tinterceptor.RecoverUnaryServerInterceptor(),\n\t\t\tinterceptor.ErrorUnaryServerInterceptor(),\n\t\t\tinterceptor.ValidationUnaryServerInterceptor(),\n\t\t\tauthorizator.UnaryServerInterceptor(),\n\t\t),\n\t\tgrapiserver.WithServers(\n\t\t\tserver.NewSessionServiceServer(store),\n\t\t\tserver.NewUserServiceServer(store, cfg),\n\t\t\tserver.NewOAuthServiceServer(cli, store),\n\t\t\tserver.NewUserBlogServiceServer(store),\n\t\t\tserver.NewEntryServiceServer(store, cfg),\n\t\t\tserver.NewPingServiceServer(store),\n\t\t\tserver.NewRoleServiceServer(store),\n\t\t\tserver.NewDepartmentServiceServer(store),\n\t\t\tserver.NewInvitationServiceServer(store, cli),\n\t\t\tserver.NewContributionConllectionServiceServer(store, cfg),\n\t\t\tserver.NewEmailConfirmationServiceServer(store, cli, cfg),\n\t\t\tserver.NewPasswordResetServiceServer(store, cli, cfg),\n\t\t\tserver.NewAchievementServiceServer(store, cli, cfg),\n\t\t),\n\t)\n\n\tjob.Start(store, cfg)\n\tdefer job.Close()\n\n\treturn s.Serve()\n}", "title": "" }, { "docid": "b5eb474602711e6c525eed9f12cc7129", "score": "0.56988704", "text": "func run(ctx context.Context, conf config) error {\n\tvar opts []grpc.DialOption\n\tvar err error\n\tif len(conf.certFile) == 0 || len(conf.keyFile) == 0 {\n\t\topts, err = tunnel.DialTLSCredsOpts(conf.caFile)\n\t} else {\n\t\topts, err = tunnel.DialmTLSCredsOpts(conf.certFile, conf.keyFile, conf.caFile)\n\t}\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tclientConn, err := grpc.Dial(conf.tunnelAddress, opts...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"grpc dial error: %v\", err)\n\t}\n\tdefer clientConn.Close()\n\n\tpeers := make(map[tunnel.Target]struct{})\n\tvar peerMux sync.Mutex\n\n\tpeerAddHandler := func(t tunnel.Target) error {\n\t\tpeerMux.Lock()\n\t\tdefer peerMux.Unlock()\n\t\tpeers[t] = struct{}{}\n\t\tlog.Printf(\"peer target %s added\\n\", t)\n\t\treturn nil\n\t}\n\n\tpeerDelHandler := func(t tunnel.Target) error {\n\t\tpeerMux.Lock()\n\t\tdefer peerMux.Unlock()\n\t\tif _, ok := peers[t]; ok {\n\t\t\tdelete(peers, t)\n\t\t\tlog.Printf(\"peer target %s deleted\\n\", t)\n\t\t}\n\t\treturn nil\n\t}\n\n\ttargets := make(map[tunnel.Target]struct{})\n\tclient, err := tunnel.NewClient(tpb.NewTunnelClient(clientConn), tunnel.ClientConfig{\n\t\tPeerAddHandler: peerAddHandler,\n\t\tPeerDelHandler: peerDelHandler,\n\t\tSubscriptions: []string{conf.dialTargetType},\n\t}, targets)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create tunnel client: %v\", err)\n\t}\n\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\terrCh := make(chan error, 2)\n\tgo func() {\n\t\tif err := client.Register(ctx); err != nil {\n\t\t\terrCh <- err\n\t\t\treturn\n\t\t}\n\t\tclient.Start(ctx)\n\t\tif err := client.Error(); err != nil {\n\t\t\terrCh <- err\n\t\t}\n\t}()\n\n\tdialTarget := tunnel.Target{ID: conf.dialTarget, Type: conf.dialTargetType}\n\tfoundDialTarget := func() bool {\n\t\tpeerMux.Lock()\n\t\tdefer peerMux.Unlock()\n\t\t_, ok := peers[dialTarget]\n\t\treturn ok\n\t}\n\n\t// Dial the target with retry.\n\tgo func() {\n\t\tbo := getBackOff()\n\t\tfor !foundDialTarget() {\n\t\t\twait := bo.NextBackOff()\n\t\t\tlog.Printf(\"dial target %s (type: %s) not found. reconnecting in %s (all targets found: %s) \\n\", conf.dialTarget, conf.dialTargetType, wait, peers)\n\t\t\ttime.Sleep(wait)\n\t\t}\n\n\t\tsession, err := client.NewSession(dialTarget)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"error from new session: %v\", err)\n\t\t\terrCh <- err\n\t\t\treturn\n\t\t}\n\t\tlog.Printf(\"new session established for target: %s\\n\", dialTarget)\n\n\t\t// Once a tunnel session is established, it connects it to a stdio.\n\t\tstdio := &stdIOConn{Reader: os.Stdin, WriteCloser: os.Stdout}\n\t\tif err = bidi.Copy(session, stdio); err != nil {\n\t\t\tlog.Printf(\"error from bidi copy: %v\\n\", err)\n\t\t\treturn\n\t\t}\n\n\t}()\n\n\t// Listen for any request to create a new session.\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase err := <-errCh:\n\t\treturn fmt.Errorf(\"exiting: %s\", err)\n\t}\n}", "title": "" }, { "docid": "91ad1504b0c3fe834ffdc3dbb44b16be", "score": "0.5693967", "text": "func (server *Server) Run_gRPC() error {\n\n\tportStr := fmt.Sprintf(\":%d\", gRPC_Server_Port)\n\tlis, err := net.Listen(\"tcp\", portStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgrpcServer := grpc.NewServer()\n\tpb.RegisterLaterServer(grpcServer, server)\n\n\tlog.Printf(\"Running gRPC server on port %d \\n\", gRPC_Server_Port)\n\treturn grpcServer.Serve(lis)\n}", "title": "" }, { "docid": "7a988f52cd3f11d4a795bb292cf4c74e", "score": "0.56824774", "text": "func (s *GrpcAdapter) Run(shutdown chan error) {\n\tshutdown <- s.server.Serve(s.listener)\n}", "title": "" }, { "docid": "7a988f52cd3f11d4a795bb292cf4c74e", "score": "0.56824774", "text": "func (s *GrpcAdapter) Run(shutdown chan error) {\n\tshutdown <- s.server.Serve(s.listener)\n}", "title": "" }, { "docid": "9a34f7d304f98704ca94b6452cd24af6", "score": "0.56739235", "text": "func (cm *ClusterManager) initHTTPGateway(router *mux.Router) error {\n\tgwmux := runtime.NewServeMux(\n\t\truntime.WithIncomingHeaderMatcher(CustomMatcher),\n\t\truntime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{\n\t\t\tOrigName: true,\n\t\t\tEmitDefaults: true,\n\t\t}),\n\t)\n\tgrpcDialOpts := []grpc.DialOption{}\n\tif cm.tlsConfig != nil && cm.clientTLSConfig != nil {\n\t\tgrpcDialOpts = append(grpcDialOpts, grpc.WithTransportCredentials(grpccred.NewTLS(cm.clientTLSConfig)))\n\t} else {\n\t\tgrpcDialOpts = append(grpcDialOpts, grpc.WithInsecure())\n\t}\n\terr := cmproto.RegisterClusterManagerGwFromEndpoint(\n\t\tcontext.TODO(),\n\t\tgwmux,\n\t\tcm.opt.Address+\":\"+strconv.Itoa(int(cm.opt.Port)),\n\t\tgrpcDialOpts)\n\tif err != nil {\n\t\tblog.Errorf(\"register http gateway failed, err %s\", err.Error())\n\t\treturn fmt.Errorf(\"register http gateway failed, err %s\", err.Error())\n\t}\n\trouter.Handle(\"/{uri:.*}\", gwmux)\n\tblog.Info(\"register grpc gateway handler to path /\")\n\treturn nil\n}", "title": "" }, { "docid": "e55b31b2975f79ef1d682f45fcb0206c", "score": "0.5663973", "text": "func (p *GatewayAPIProcessor) Run(dag *DAG, source *KubernetesCache) {\n\tp.dag = dag\n\tp.source = source\n\n\t// reset the processor when we're done\n\tdefer func() {\n\t\tp.dag = nil\n\t\tp.source = nil\n\t}()\n\n\t// Gateway and GatewayClass must be defined for resources to be processed.\n\tif p.source.gateway == nil {\n\t\tp.Info(\"Gateway not found in cache.\")\n\t\treturn\n\t}\n\tif p.source.gatewayclass == nil {\n\t\tp.Info(\"GatewayClass not found in cache.\")\n\t\treturn\n\t}\n\n\tgwAccessor, commit := p.dag.StatusCache.GatewayStatusAccessor(\n\t\tk8s.NamespacedNameOf(p.source.gateway),\n\t\tp.source.gateway.Generation,\n\t\t&p.source.gateway.Status,\n\t)\n\tdefer commit()\n\n\tvar gatewayNotProgrammedCondition *metav1.Condition\n\n\tif !isAddressAssigned(p.source.gateway.Spec.Addresses, p.source.gateway.Status.Addresses) {\n\t\t// TODO(sk) resolve condition type-reason mismatch\n\t\tgatewayNotProgrammedCondition = &metav1.Condition{\n\t\t\tType: string(gatewayapi_v1beta1.GatewayConditionProgrammed),\n\t\t\tStatus: metav1.ConditionFalse,\n\t\t\tReason: string(gatewayapi_v1beta1.GatewayReasonAddressNotAssigned),\n\t\t\tMessage: \"None of the addresses in Spec.Addresses have been assigned to the Gateway\",\n\t\t}\n\t}\n\n\t// Validate listener protocols, ports and hostnames and add conditions\n\t// for all invalid listeners.\n\tvalidateListenersResult := gatewayapi.ValidateListeners(p.source.gateway.Spec.Listeners)\n\tfor name, cond := range validateListenersResult.InvalidListenerConditions {\n\t\tgwAccessor.AddListenerCondition(\n\t\t\tstring(name),\n\t\t\tgatewayapi_v1beta1.ListenerConditionType(cond.Type),\n\t\t\tcond.Status,\n\t\t\tgatewayapi_v1beta1.ListenerConditionReason(cond.Reason),\n\t\t\tcond.Message,\n\t\t)\n\t}\n\n\t// Compute listeners and save a list of the valid/ready ones.\n\tvar readyListeners []*listenerInfo\n\n\tfor _, listener := range p.source.gateway.Spec.Listeners {\n\t\tif ready, listenerInfo := p.computeListener(listener, gwAccessor, validateListenersResult); ready {\n\t\t\treadyListeners = append(readyListeners, listenerInfo)\n\t\t}\n\t}\n\n\t// Keep track of the number of routes attached\n\t// to each Listener so we can set status properly.\n\tlistenerAttachedRoutes := map[string]int{}\n\n\t// Process HTTPRoutes.\n\tfor _, httpRoute := range p.source.httproutes {\n\t\tp.processRoute(KindHTTPRoute, httpRoute, httpRoute.Spec.ParentRefs, gatewayNotProgrammedCondition, readyListeners, listenerAttachedRoutes, &gatewayapi_v1beta1.HTTPRoute{})\n\t}\n\n\t// Process TLSRoutes.\n\tfor _, tlsRoute := range p.source.tlsroutes {\n\t\tp.processRoute(KindTLSRoute, tlsRoute, tlsRoute.Spec.ParentRefs, gatewayNotProgrammedCondition, readyListeners, listenerAttachedRoutes, &gatewayapi_v1alpha2.TLSRoute{})\n\t}\n\n\t// Process GRPCRoutes.\n\tfor _, grpcRoute := range p.source.grpcroutes {\n\t\tp.processRoute(KindGRPCRoute, grpcRoute, grpcRoute.Spec.ParentRefs, gatewayNotProgrammedCondition, readyListeners, listenerAttachedRoutes, &gatewayapi_v1alpha2.GRPCRoute{})\n\t}\n\n\t// Process TCPRoutes.\n\tfor _, tcpRoute := range p.source.tcproutes {\n\t\tp.processRoute(KindTCPRoute, tcpRoute, tcpRoute.Spec.ParentRefs, gatewayNotProgrammedCondition, readyListeners, listenerAttachedRoutes, &gatewayapi_v1alpha2.TCPRoute{})\n\t}\n\n\tfor listenerName, attachedRoutes := range listenerAttachedRoutes {\n\t\tgwAccessor.SetListenerAttachedRoutes(listenerName, attachedRoutes)\n\t}\n\n\tp.computeGatewayConditions(gwAccessor, gatewayNotProgrammedCondition)\n}", "title": "" }, { "docid": "c797a5d8cd440922f34c335d770ccd42", "score": "0.55862993", "text": "func gatewaycmd() {\n\tinfo, err := httpClient.GatewayGet()\n\tif err != nil {\n\t\tdie(\"Could not get gateway address:\", err)\n\t}\n\tfmt.Println(\"Address:\", info.NetAddress)\n\tfmt.Println(\"Active peers:\", len(info.Peers))\n\tfmt.Println(\"Max download speed:\", info.MaxDownloadSpeed)\n\tfmt.Println(\"Max upload speed:\", info.MaxUploadSpeed)\n}", "title": "" }, { "docid": "cfb22866b04886a08f39da4b46fc5795", "score": "0.557568", "text": "func gatewaycmd() {\n\tinfo, err := httpClient.GatewayGet()\n\tif err != nil {\n\t\tdie(\"Could not get gateway address:\", err)\n\t}\n\tfmt.Println(\"Address:\", info.NetAddress)\n\tfmt.Println(\"Active peers:\", len(info.Peers))\n}", "title": "" }, { "docid": "56a4652c00a4db2d5e1733345465de2a", "score": "0.5562027", "text": "func Run(ctx context.Context, conf Config) error {\n\topts := []grpc.DialOption{grpc.WithDefaultCallOptions()}\n\tif conf.CertFile == \"\" {\n\t\topts = append(opts, grpc.WithInsecure())\n\t} else {\n\t\tcreds, err := credentials.NewClientTLSFromFile(conf.CertFile, \"\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load credentials: %v\", err)\n\t\t}\n\t\topts = append(opts, grpc.WithTransportCredentials(creds))\n\t}\n\tclientConn, err := grpc.Dial(conf.TunnelAddress, opts...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"grpc dial error: %v\", err)\n\t}\n\tdefer clientConn.Close()\n\n\tregisterHandler := func(u string) error {\n\t\tif u != conf.Target {\n\t\t\treturn fmt.Errorf(\"client cannot handle: %s\", u)\n\t\t}\n\t\treturn nil\n\t}\n\n\thandler := func(_ string, i io.ReadWriteCloser) error {\n\t\tconn, err := net.Dial(\"tcp\", conf.DialAddress)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error dialing client: %v\", err)\n\t\t\treturn err\n\t\t}\n\t\tif err = bidi.Copy(i, conn); err != nil {\n\t\t\t// Logging this error only as we don't want the client to stop because an\n\t\t\t// underlying stream had an issue\n\t\t\tlog.Printf(\"Copy error: %v\", err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tclient, err := tunnel.NewClient(tpb.NewTunnelClient(clientConn), tunnel.ClientConfig{\n\t\tRegisterHandler: registerHandler,\n\t\tHandler: handler,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create tunnel client: %v\", err)\n\t}\n\treturn client.Run(ctx)\n}", "title": "" }, { "docid": "956c6f0c0dad1b02c810aac30381d9a3", "score": "0.5556354", "text": "func (c *Console) Gateway() http.Handler {\n\tstandardMiddleware := alice.New(c.recoverPanic, c.logRequest, secureHeaders, handlers.ProxyHeaders)\n\ttokenMiddleware := alice.New(c.tokenHandler)\n\tr := mux.NewRouter()\n\n\thandle := func(path string, handler http.Handler) {\n\t\tr.PathPrefix(proxy.SingleJoiningSlash(c.BaseURL.Path, path)).Handler(handler)\n\t}\n\tk8sProxy := proxy.NewProxy(c.K8sProxyConfig)\n\thandle(k8sProxyPath, http.StripPrefix(\n\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, k8sProxyPath),\n\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\tk8sProxy.ServeHTTP(w, r)\n\t\t})),\n\t)\n\tif c.PrometheusProxyConfig != nil {\n\t\t// Only proxy requests to the Prometheus API, not the UI.\n\t\tvar (\n\t\t\tlabelSourcePath = prometheusProxyPath + \"/api/v1/label/\"\n\t\t\trulesSourcePath = prometheusProxyPath + \"/api/v1/rules\"\n\t\t\tquerySourcePath = prometheusProxyPath + \"/api/v1/query\"\n\t\t\tqueryRangeSourcePath = prometheusProxyPath + \"/api/v1/query_range\"\n\t\t\ttargetAPIPath = prometheusProxyPath + \"/api/\"\n\n\t\t\ttenancyQuerySourcePath = prometheusTenancyProxyPath + \"/api/v1/query\"\n\t\t\ttenancyQueryRangeSourcePath = prometheusTenancyProxyPath + \"/api/v1/query_range\"\n\t\t\ttenancyTargetAPIPath = prometheusTenancyProxyPath + \"/api/\"\n\n\t\t\tprometheusProxy = proxy.NewProxy(c.PrometheusProxyConfig)\n\t\t\t// hypercloud has not installed Thanos until now, so we use promethues proxy config instead thanos\n\t\t\tthanosProxy = proxy.NewProxy(c.PrometheusProxyConfig)\n\t\t\tthanosTenancyProxy = proxy.NewProxy(c.PrometheusProxyConfig)\n\t\t)\n\n\t\t// global label, query, and query_range requests have to be proxied via thanos\n\t\thandle(querySourcePath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, targetAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tthanosProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t\thandle(queryRangeSourcePath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, targetAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tthanosProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t\thandle(labelSourcePath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, targetAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tthanosProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\n\t\t// alerting (rules) have to be proxied via cluster monitoring prometheus\n\t\thandle(rulesSourcePath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, targetAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tprometheusProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\n\t\t// tenancy queries and query ranges have to be proxied via thanos\n\t\thandle(tenancyQuerySourcePath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, tenancyTargetAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tthanosTenancyProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t\thandle(tenancyQueryRangeSourcePath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, tenancyTargetAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tthanosTenancyProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\tif c.AlertManagerProxyConfig != nil {\n\t\talertManagerProxyAPIPath := alertManagerProxyPath + \"/api/\"\n\t\talertManagerProxy := proxy.NewProxy(c.AlertManagerProxyConfig)\n\t\thandle(alertManagerProxyAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, alertManagerProxyAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\talertManagerProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// NOTE: webhook proxy\n\tif c.WebhookProxyConfig != nil {\n\t\twebhookProxyAPIPath := webhookPath\n\t\twebhookProxy := proxy.NewProxy(c.WebhookProxyConfig)\n\t\thandle(webhookProxyAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, webhookProxyAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\twebhookProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// NOTE: hypercloudServer proxy\n\tif c.HypercloudServerProxyConfig != nil {\n\t\thypercloudServerProxyAPIPath := hypercloudServerPath\n\t\thypercloudServerProxy := proxy.NewProxy(c.HypercloudServerProxyConfig)\n\t\thandle(hypercloudServerProxyAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, hypercloudServerProxyAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\thypercloudServerProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// NOTE: multi-hypercloudServer proxy\n\tif c.MultiHypercloudServerProxyConfig != nil {\n\t\tmultiHypercloudServerProxyAPIPath := multiHypercloudServerPath\n\t\tmultiHypercloudServerProxy := proxy.NewProxy(c.MultiHypercloudServerProxyConfig)\n\t\thandle(multiHypercloudServerProxyAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, multiHypercloudServerProxyAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tmultiHypercloudServerProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// NOTE: grafa proxy\n\tif c.GrafanaProxyConfig != nil {\n\t\tgrafanaProxyAPIPath := grafanaProxyPath\n\t\tgrafanaProxy := proxy.NewProxy(c.GrafanaProxyConfig)\n\t\thandle(grafanaProxyAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, grafanaProxyAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tgrafanaProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// NOTE: kiali proxy\n\tif c.KialiProxyConfig != nil {\n\t\tkialiProxyAPIPath := kialiProxyPath\n\t\tkialiProxy := proxy.NewProxy(c.KialiProxyConfig)\n\t\thandle(kialiProxyAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, kialiProxyAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tkialiProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// NOTE: kibana proxy\n\tif c.KibanaProxyConfig != nil {\n\t\tkibanaAPIPath := kibanaPath\n\t\tkibanaProxy := proxy.NewProxy(c.KibanaProxyConfig)\n\t\thandle(kibanaAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, kibanaAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tr.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %s\", c.StaticUser.Token))\n\t\t\t\tkibanaProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\t// Kubeflow proxy\n\tif c.KubeflowProxyConfig != nil {\n\t\tkubeflowAPIPath := kubeflowPath\n\t\tkubeflowProxy := proxy.NewProxy(c.KubeflowProxyConfig)\n\t\thandle(kubeflowAPIPath, http.StripPrefix(\n\t\t\tproxy.SingleJoiningSlash(c.BaseURL.Path, kubeflowAPIPath),\n\t\t\ttokenMiddleware.ThenFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tkubeflowProxy.ServeHTTP(w, r)\n\t\t\t})),\n\t\t)\n\t}\n\tstaticHandler := http.StripPrefix(proxy.SingleJoiningSlash(c.BaseURL.Path, \"/static/\"), http.FileServer(http.Dir(c.PublicDir)))\n\thandle(\"/static/\", gzipHandler(staticHandler))\n\tr.PathPrefix(c.BaseURL.Path).HandlerFunc(c.indexHandler)\n\tr.PathPrefix(\"/api/\").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\tfmt.Fprintln(w, \"not found\")\n\t})\n\treturn standardMiddleware.Then(r)\n}", "title": "" }, { "docid": "6167bbef2cdfad42f01bde7232166dfc", "score": "0.5555251", "text": "func gatewayProxy(gateway *structs.ConsulGateway, mode string) *structs.ConsulGatewayProxy {\n\tif gateway == nil {\n\t\treturn nil\n\t}\n\n\t// operator has supplied custom proxy configuration, just use that without\n\t// modification\n\tif !gatewayProxyIsDefault(gateway.Proxy) {\n\t\treturn gateway.Proxy\n\t}\n\n\t// copy over unrelated fields if proxy block exists\n\tproxy := new(structs.ConsulGatewayProxy)\n\tif gateway.Proxy != nil {\n\t\tproxy.ConnectTimeout = gateway.Proxy.ConnectTimeout\n\t\tproxy.EnvoyDNSDiscoveryType = gateway.Proxy.EnvoyDNSDiscoveryType\n\t\tproxy.Config = gateway.Proxy.Config\n\t}\n\n\t// set default connect timeout if not set\n\tif proxy.ConnectTimeout == nil {\n\t\tproxy.ConnectTimeout = pointer.Of(defaultConnectTimeout)\n\t}\n\n\tif mode == \"bridge\" {\n\t\t// magically configure bind address(es) for bridge networking, per gateway type\n\t\t// non-default configuration is gated above\n\t\tswitch {\n\t\tcase gateway.Ingress != nil:\n\t\t\tproxy.EnvoyGatewayNoDefaultBind = true\n\t\t\tproxy.EnvoyGatewayBindTaggedAddresses = false\n\t\t\tproxy.EnvoyGatewayBindAddresses = gatewayBindAddressesIngressForBridge(gateway.Ingress)\n\t\tcase gateway.Terminating != nil:\n\t\t\tproxy.EnvoyGatewayNoDefaultBind = true\n\t\t\tproxy.EnvoyGatewayBindTaggedAddresses = false\n\t\t\tproxy.EnvoyGatewayBindAddresses = map[string]*structs.ConsulGatewayBindAddress{\n\t\t\t\t\"default\": {\n\t\t\t\t\tAddress: \"0.0.0.0\",\n\t\t\t\t\tPort: -1, // filled in later with dynamic port\n\t\t\t\t}}\n\t\tcase gateway.Mesh != nil:\n\t\t\tproxy.EnvoyGatewayNoDefaultBind = true\n\t\t\tproxy.EnvoyGatewayBindTaggedAddresses = false\n\t\t\tproxy.EnvoyGatewayBindAddresses = map[string]*structs.ConsulGatewayBindAddress{\n\t\t\t\t\"wan\": {\n\t\t\t\t\tAddress: \"0.0.0.0\",\n\t\t\t\t\tPort: -1, // filled in later with configured port\n\t\t\t\t},\n\t\t\t\t\"lan\": {\n\t\t\t\t\tAddress: \"0.0.0.0\",\n\t\t\t\t\tPort: -1, // filled in later with generated port\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\n\treturn proxy\n}", "title": "" }, { "docid": "ed058d03a0a6fcda293bc2a45203005d", "score": "0.55438906", "text": "func main() {\n\t// create a logger before we load config\n\t// TODO: make logger a package variable so we don't have to pass it around\n\tlogger := log.NewContext(log.DefaultLogger.CreateChild()).With(logkey.Time, log.DefaultTimestamp, logkey.Caller, log.DefaultCaller)\n\n\t// parse runtime flags only once\n\tflagParse()\n\n\t// if the version flag is present, print the version and return\n\tif flags != nil && flags.version {\n\t\tfmt.Println(Version)\n\t\tfmt.Println(BuildDate)\n\t\tflags.version = false\n\t\treturn\n\t}\n\n\t// instantiate a gateway\n\tmainInstance := newGateway()\n\n\t// send sigterm to the signalChan\n\tsignal.Notify(mainInstance.signalChan, syscall.SIGTERM)\n\n\t// when main completes stop sending sigterms to the channel\n\tdefer func() {\n\t\t//signal.Stop(mainInstance.signalChan)\n\t\tclose(mainInstance.signalChan)\n\t}()\n\n\t// load the config file using runtime flag\n\tloadedConfig, err := loadConfig(flags.configFileName, logger)\n\tlog.IfErrWithKeys(logger, err, log.Err, \"an error occurred while loading the config file\")\n\n\t// setup pid file if one is configured\n\twritePidFile(loadedConfig, logger)\n\n\t// use the config value for NumProcs to set the maximum processes for go to schedule against\n\tlogger.Log(log.Msg, \"setting go maximum number of processes to \", setupGoMaxProcs(loadedConfig, runtime.GOMAXPROCS))\n\n\t// configure the gateway\n\tlog.IfErr(logger, mainInstance.configure(loadedConfig))\n\n\t// start the gateway\n\tlog.IfErr(logger, mainInstance.start(context.Background()))\n}", "title": "" }, { "docid": "d13ec136a4483618939924a998a30ccb", "score": "0.5539997", "text": "func dialChildOrParenGateway(addressToDial string, dialSuccess bool, gRpcClientTowardsFenix gRPC.GatewayTowardsFenixClient, gRpcClientTowardPlugin gRPC.GatewayTowayPluginClient, remoteServerConnection *grpc.ClientConn, transmitOrDispatchEngineType string, pluginId string) (string, bool, gRPC.GatewayTowardsFenixClient, gRPC.GatewayTowayPluginClient, *grpc.ClientConn) {\n\n\tvar err error\n\n\t// Get address to parent or child depending if we are running a TransmitEngine or a DispatchEngine\n\tswitch transmitOrDispatchEngineType {\n\tcase common_code.DispatchEngineTowardsPlugin:\n\t\t// Get address to next child gateway/plugin\n\t\taddressToDial = getClientAddressAndPort(pluginId)\n\n\tcase common_code.TransmitEngineTowardsFenix:\n\t\t// Get adress to parent gateway/Fenix\n\t\taddressToDial = getParentAddressAndPort()\n\n\tdefault:\n\t\t// No known 'transmitOrDispatchEngineType'\n\t\tLogErrorAndSendInfoToFenix(\n\t\t\t\"2c976770-ef52-4bd1-8a52-aaf1f64ebc69\",\n\t\t\tgRPC.InformationMessage_FATAL,\n\t\t\t\"No know 'transmitOrDispatchEngineType'\",\n\t\t\ttransmitOrDispatchEngineType,\n\t\t\t\"No known 'transmitOrDispatchEngineType when dialing to child/parent\",\n\t\t\t\"No known 'transmitOrDispatchEngineType when dialing to child/parent\",\n\t\t)\n\t}\n\n\t// Set up connection to Parent Gateway/Fenix or child gateway/plugin\n\tremoteServerConnection, err = grpc.Dial(addressToDial, grpc.WithInsecure())\n\tif err != nil {\n\t\t// Connection Not OK\n\t\tdialSuccess = false\n\n\t\tLogErrorAndSendInfoToFenix(\n\t\t\t\"f1e2922b-d1b8-4c5d-9861-40ba71733383\",\n\t\t\tgRPC.InformationMessage_WARNING,\n\t\t\t\"addressToDial\",\n\t\t\taddressToDial,\n\t\t\terr.Error(),\n\t\t\t\"Coldn't dial Parent Gateway/Fenix or child Gateway/plugin\",\n\t\t)\n\t} else {\n\t\t// Connection OK\n\t\tdialSuccess = true\n\n\t\t// Creates a new gateway gRPC-Client\n\t\tswitch transmitOrDispatchEngineType {\n\t\tcase common_code.DispatchEngineTowardsPlugin:\n\t\t\t// Creates a new gateway gRPC-Client towards Plugin\n\t\t\tgRpcClientTowardPlugin = gRPC.NewGatewayTowayPluginClient(remoteServerConnection)\n\n\t\tcase common_code.TransmitEngineTowardsFenix:\n\t\t\t// Creates a new gateway gRPC-Client towards Fenix\n\t\t\tgRpcClientTowardsFenix = gRPC.NewGatewayTowardsFenixClient(remoteServerConnection)\n\n\t\tdefault:\n\t\t\t// No known 'transmitOrDispatchEngineType'\n\t\t\tLogErrorAndSendInfoToFenix(\n\t\t\t\t\"0b819638-a8b7-4aa7-8d6c-a75627491829\",\n\t\t\t\tgRPC.InformationMessage_FATAL,\n\t\t\t\t\"No know 'transmitOrDispatchEngineType'\",\n\t\t\t\ttransmitOrDispatchEngineType,\n\t\t\t\t\"No known 'transmitOrDispatchEngineType when creating gRPC-client\",\n\t\t\t\t\"No known 'transmitOrDispatchEngineType when creating gRPC-client\",\n\t\t\t)\n\t\t}\n\n\t}\n\n\t// Return values to be used by calling function\n\treturn addressToDial, dialSuccess, gRpcClientTowardsFenix, gRpcClientTowardPlugin, remoteServerConnection\n}", "title": "" }, { "docid": "a013cadc78930013883d36f96077883f", "score": "0.5539662", "text": "func (d *Driver) Run() error {\n\tu, err := url.Parse(d.endpoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\taddr := path.Join(u.Host, filepath.FromSlash(u.Path))\n\n\tswitch u.Scheme {\n\tcase \"unix\", \"unixgram\", \"unixpacket\":\n\t\t// Check if file already exists and clean it up\n\t\tif _, err := os.Stat(u.Path); err == nil {\n\t\t\terr := os.Remove(u.Path)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to remove socket file (%s): %s\", u.Path, err)\n\t\t\t}\n\t\t}\n\t}\n\n\tlistener, err := net.Listen(u.Scheme, addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogErr := func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\tresp, err := handler(ctx, req)\n\t\tif err != nil {\n\t\t\td.log.Errorf(\"GRPC error: %v\", err)\n\t\t}\n\t\treturn resp, err\n\t}\n\topts := []grpc.ServerOption{\n\t\tgrpc.UnaryInterceptor(logErr),\n\t}\n\td.srv = grpc.NewServer(opts...)\n\n\tcsi.RegisterIdentityServer(d.srv, d)\n\tcsi.RegisterControllerServer(d.srv, d)\n\tcsi.RegisterNodeServer(d.srv, d)\n\n\td.log.Infof(\"Listening for connections on address: %#v\", listener.Addr())\n\treturn d.srv.Serve(listener)\n}", "title": "" }, { "docid": "b81fef564ac3fa0ff3083be8b9a8d635", "score": "0.5530946", "text": "func azureGatewayMain(ctx *cli.Context) {\n\t// Validate gateway arguments.\n\thost := ctx.Args().First()\n\t// Validate gateway arguments.\n\tlogger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString(\"address\"), host), \"Invalid argument\")\n\n\tminio.StartGateway(ctx, &Azure{host})\n}", "title": "" }, { "docid": "a95d8227011846ab20aef3b5e1c39862", "score": "0.55194926", "text": "func runGateway(config *gateways.ConfigContext) error {\n\tvar err error\n\tvar errMessage string\n\n\t// mark final gateway state\n\tdefer httpGatewayServerConfig.GwConfig.GatewayCleanup(config, &errMessage, err)\n\n\thttpGatewayServerConfig.GwConfig.Log.Info().Str(\"config-name\", config.Data.Src).Msg(\"parsing calendar schedule...\")\n\n\tvar cal *calSchedule\n\terr = yaml.Unmarshal([]byte(config.Data.Config), &cal)\n\tif err != nil {\n\t\terrMessage = \"failed to parse calendar schedule\"\n\t\treturn err\n\t}\n\n\tschedule, err := resolveSchedule(cal)\n\tif err != nil {\n\t\terrMessage = \"failed to resolve calendar schedule.\"\n\t\treturn err\n\t}\n\texDates, err := common.ParseExclusionDates(cal.Recurrence)\n\tif err != nil {\n\t\terrMessage = \"failed to resolve calendar schedule.\"\n\t\treturn err\n\t}\n\n\tvar next Next\n\tnext = func(last time.Time) time.Time {\n\t\tnextT := schedule.Next(last)\n\t\tnextYear := nextT.Year()\n\t\tnextMonth := nextT.Month()\n\t\tnextDay := nextT.Day()\n\t\tfor _, exDate := range exDates {\n\t\t\t// if exDate == nextEvent, then we need to skip this and get the next\n\t\t\tif exDate.Year() == nextYear && exDate.Month() == nextMonth && exDate.Day() == nextDay {\n\t\t\t\treturn next(nextT)\n\t\t\t}\n\t\t}\n\t\treturn nextT\n\t}\n\n\tevent := httpGatewayServerConfig.GwConfig.GetK8Event(\"configuration running\", v1alpha1.NodePhaseRunning, config.Data)\n\tk8Event, err := common.CreateK8Event(event, httpGatewayServerConfig.GwConfig.Clientset)\n\tif err != nil {\n\t\thttpGatewayServerConfig.GwConfig.Log.Error().Str(\"config-key\", config.Data.Src).Err(err).Msg(\"failed to mark configuration as running\")\n\t\treturn err\n\t}\n\thttpGatewayServerConfig.GwConfig.Log.Info().Str(\"config-key\", config.Data.Src).Str(\"phase\", string(v1alpha1.NodePhaseRunning)).Str(\"event-name\", k8Event.Name).Msg(\"k8 event created\")\n\tlastT := time.Now()\ncalendarConfigRunner:\n\tfor {\n\t\tt := next(lastT)\n\t\ttimer := time.After(time.Until(t))\n\t\thttpGatewayServerConfig.GwConfig.Log.Info().Str(\"config-key\", config.Data.Src).Str(\"time\", t.String()).Msg(\"expected next calendar event\")\n\t\tselect {\n\t\tcase tx := <-timer:\n\t\t\tlastT = tx\n\t\t\tevent := metav1.Time{Time: t}\n\t\t\tpayload, err := event.Marshal()\n\t\t\tif err != nil {\n\t\t\t\thttpGatewayServerConfig.GwConfig.Log.Error().Err(err).Msg(\"failed to marshal event\")\n\t\t\t} else {\n\t\t\t\tre := gateways.GatewayEvent{\n\t\t\t\t\tSrc: config.Data.Src,\n\t\t\t\t\tPayload: payload,\n\t\t\t\t}\n\t\t\t\tpayload, err = json.Marshal(re)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\terrMessage = \"failed to marshal payload into gateway event\"\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\thttpGatewayServerConfig.GwConfig.Log.Info().Str(\"config-key\", config.Data.Src).Msg(\"dispatching event to gateway processor client\")\n\t\t\t\thttpGatewayServerConfig.GwConfig.Log.Info().Str(\"url\", fmt.Sprintf(\"http://localhost:%s%s\", httpGatewayServerConfig.HTTPClientPort, httpGatewayServerConfig.EventEndpoint)).Msg(\"client url\")\n\t\t\t\tres, err := http.Post(fmt.Sprintf(\"http://localhost:%s%s\", httpGatewayServerConfig.HTTPClientPort, httpGatewayServerConfig.EventEndpoint), \"application/octet-stream\", bytes.NewReader(payload))\n\t\t\t\tif err != nil {\n\t\t\t\t\terrMessage = \"failed to dispatch event to gateway-processor.\"\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif res.StatusCode == http.StatusBadRequest {\n\t\t\t\t\terrMessage = \"gateway processor client failed to process event.\"\n\t\t\t\t\terr = fmt.Errorf(errMessage)\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-config.StopCh:\n\t\t\thttpGatewayServerConfig.GwConfig.Log.Info().Str(\"config-key\", config.Data.Src).Msg(\"stopping configuration\")\n\t\t\tbreak calendarConfigRunner\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ec59bae42330cea81d18362e670fd017", "score": "0.5483691", "text": "func runServer(addr string, port chan<- int) {\n\tlog.SetFlags(log.Lshortfile | log.LstdFlags)\n\tflag.Parse()\n\n\tlis, err := net.Listen(\"tcp\", addr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif port != nil {\n\t\tport <- lis.(*net.TCPListener).Addr().(*net.TCPAddr).Port\n\t}\n\n\tprojectID := os.Getenv(\"GOOGLE_CLOUD_PROJECT\")\n\ttraceClient, err = trace.NewClient(context.Background(), projectID)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tp, err := trace.NewLimitedSampler(traceFraction, maxTracesPerSecond)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\ttraceClient.SetSamplingPolicy(p)\n\n\tgrpcServer := grpc.NewServer(\n\t\tgrpc.MaxSendMsgSize(maxMsgSizeBytes),\n\t\tgrpc.MaxRecvMsgSize(maxMsgSizeBytes))\n\tpubsubServer := newPubsubServer()\n\tpb.RegisterPublisherServer(grpcServer, pubsubServer)\n\tpb.RegisterSubscriberServer(grpcServer, pubsubServer)\n\n\tlog.Println(\"Starting tunnel gRPC server...\")\n\tlog.Fatal(\"grpcServer.Serve() ended unexpectedly:\", grpcServer.Serve(lis))\n}", "title": "" }, { "docid": "bb069f68c4fb52dec039483489db8a44", "score": "0.5467127", "text": "func Run(cfg Config, biz *types.Business, protoFunc, wsProtoFunc erpc.ProtoFunc) error {\n\t// config\n\terr := cfg.check()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// protocol\n\tif protoFunc == nil {\n\t\tprotoFunc = rawproto.NewRawProtoFunc()\n\t}\n\n\t// client\n\tclientele.SetProtoFunc(protoFunc)\n\n\t// business\n\tif biz == nil {\n\t\tbiz = types.DefaultBusiness()\n\t}\n\tlogic.SetBusiness(biz)\n\n\t// sdk version\n\tsdk.SetApiVersion(logic.ApiVersion())\n\n\tvar (\n\t\thttpAddr string\n\t\touterSocketAddr string\n\t\tinnerSocketAddr string\n\t\twebSocketAddr string\n\t)\n\n\t// HTTP server\n\tif cfg.EnableHttp {\n\t\thttpAddr = cfg.OuterHttpServer.OuterIpPort()\n\t\tgo short.Serve(cfg.OuterHttpServer)\n\t}\n\n\t// TCP socket server\n\tif cfg.EnableSocket {\n\t\touterSocketAddr = cfg.OuterSocketServer.OuterIpPort()\n\t\tinnerSocketAddr = cfg.InnerSocketServer.InnerIpPort()\n\t\tgo long.Serve(\n\t\t\tcfg.OuterSocketServer,\n\t\t\tcfg.InnerSocketServer,\n\t\t\tprotoFunc,\n\t\t)\n\t}\n\n\t// web socket proto func\n\tif wsProtoFunc == nil {\n\t\twsProtoFunc = jsonSubProto.NewJSONSubProtoFunc()\n\t}\n\t// web socket server\n\tif cfg.EnableWebSocket {\n\t\twebSocketAddr = cfg.WebSocketServer.OuterIpPort()\n\t\tgo ws.Serve(\n\t\t\tcfg.WebSocketServer,\n\t\t\twsProtoFunc,\n\t\t)\n\t}\n\n\thosts.Start(\n\t\thttpAddr,\n\t\touterSocketAddr,\n\t\tinnerSocketAddr,\n\t\twebSocketAddr,\n\t)\n\n\tselect {}\n}", "title": "" }, { "docid": "7d87788fc2b312bf31431d871674c5ac", "score": "0.54584765", "text": "func Run() error {\n\tctx := context.Background()\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\n\t//TODO: Refactor into config\n\tl, err := net.Listen(\"tcp\", \"9090\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts := grpc.NewServer()\n\tvending.RegisterSHOPPERSSHOP_VendingMachineServiceServer(s, newVendingServer())\n\n\treturn s.Serve(l)\n}", "title": "" }, { "docid": "e851a3a0d7d9bb5d0dc119fa12997309", "score": "0.5453062", "text": "func (s *Service) Run() error {\n\tcErr := s.Configuration.Validate()\n\tif cErr != nil {\n\t\tlog.Fatal().Str(\"err\", cErr.DebugReport()).Msg(\"invalid configuration\")\n\t}\n\ts.Configuration.Print()\n\tclients, cErr := s.GetClients()\n\tif cErr != nil {\n\t\tlog.Fatal().Str(\"err\", cErr.DebugReport()).Msg(\"Cannot create clients\")\n\t}\n\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", s.Configuration.Port))\n\tif err != nil {\n\t\tlog.Fatal().Errs(\"failed to listen: %v\", []error{err})\n\t}\n\n\tprov := s.GetProviders()\n\n\t// Create handlers\n\tmanager := device.NewManager(clients.AuthxClient, clients.DevicesClient, clients.AppsClient, prov.pProvider, s.Configuration.Threshold)\n\thandler := device.NewHandler(manager)\n\n\tpManager := lat.NewManager(prov.pProvider)\n\tpHandler := lat.NewHandler(pManager)\n\n\tgrpcServer := grpc.NewServer()\n\n\tgrpc_device_manager_go.RegisterDevicesServer(grpcServer, handler)\n\tgrpc_device_manager_go.RegisterLatencyServer(grpcServer, pHandler)\n\n\t// Register reflection service on gRPC server.\n\treflection.Register(grpcServer)\n\tlog.Info().Int(\"port\", s.Configuration.Port).Msg(\"Launching gRPC server\")\n\tif err := grpcServer.Serve(lis); err != nil {\n\t\tlog.Fatal().Errs(\"failed to serve: %v\", []error{err})\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa9ca673db5dacdd68cb0ba186105820", "score": "0.54439956", "text": "func sdfsGatewayMain(ctx *cli.Context) {\n\t// Validate gateway arguments.\n\tif ctx.Args().First() == \"help\" {\n\t\tcli.ShowCommandHelpAndExit(ctx, sdfsBackend, 1)\n\t}\n\n\tminio.StartGateway(ctx, &SDFS{args: ctx.Args()})\n}", "title": "" }, { "docid": "f50c7c2ad27c154ad26489c94c9f47bd", "score": "0.54399544", "text": "func (p *peer) run() {\n\tdefer close(p.done)\n\n\tvar err error\n\tvar serviceClient TransportServiceClient\n\tvar sendClient TransportService_SendMessageClient\n\n\t// Receive mssage.\n\tfor msg := range p.msgc {\n\t\t// Connect node.\n\t\tif nil == serviceClient {\n\t\t\tconn, err := grpc.Dial(p.endpoint, grpc.WithInsecure(), grpc.WithBackoffMaxDelay(2*time.Second))\n\t\t\tif nil != err {\n\t\t\t\tlogger.Errorf(\"connect node(%s) failed:%v\", p.endpoint, err)\n\t\t\t\treportUnreachable(p.gmap.raft, &msg)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tserviceClient = NewTransportServiceClient(conn)\n\t\t}\n\n\t\tvar try int\n\tretry:\n\t\t// Create send stream client.\n\t\tif nil == sendClient {\n\t\t\tif sendClient, err = serviceClient.SendMessage(context.Background()); nil != err {\n\t\t\t\tlogger.Errorf(\"create send client(%s) failed:%v\", p.endpoint, err)\n\t\t\t\treportUnreachable(p.gmap.raft, &msg)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t// Snapshots should be sent by creating a coroutine, because the snapshot may be very large,\n\t\t// and the sending time will be very long, even affect heartbeat sending.\n\t\tif msg.Type == raftpb.MsgSnap {\n\t\t\tgo func() {\n\t\t\t\t// Compress the sent snapshot with gzip.\n\t\t\t\tctx, snap, opt := context.Background(), &Bytes{Data: pbutil.MustMarshal(&msg)}, grpc.UseCompressor(gzip.Name)\n\t\t\t\tif _, err := serviceClient.SendSnapshot(ctx, snap, opt); nil != err {\n\t\t\t\t\tlogger.Errorf(\"send(%s) snapshot failed:%v\", p.endpoint, err)\n\t\t\t\t\tp.gmap.raft.ReportSnapshot(msg.To, raft.SnapshotFailure)\n\t\t\t\t}\n\t\t\t\t// Report send snapshot finished to raft and reduce inflight snapshots count.\n\t\t\t\tp.gmap.raft.ReportSnapshot(p.id, raft.SnapshotFinish)\n\t\t\t\tatomic.AddInt64(&p.gmap.inflightSnapshots, -1)\n\t\t\t}()\n\t\t} else if err := sendClient.Send(&Bytes{Data: pbutil.MustMarshal(&msg)}); nil != err {\n\t\t\tlogger.Errorf(\"send(%s) message failed:%v\", p.endpoint, err)\n\t\t\t// Maybe the network connection exception, reconnect and try again.\n\t\t\tif try++; try >= 3 {\n\t\t\t\treportUnreachable(p.gmap.raft, &msg)\n\t\t\t} else {\n\t\t\t\tsendClient = nil\n\t\t\t\tgoto retry\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b6d4aaca248394f2c53b6d9fabf198b4", "score": "0.54329115", "text": "func main() {\n\t// create a listener on TCP port 50051\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\":%d\", 50051))\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\n\t// create a server instance\n\ts := api.Server{}\n\n\t// setup billing client\n\tconn1, err := grpc.Dial(\"0.0.0.0:50052\", grpc.WithInsecure())\n\tif err != nil {\n\t\tlog.Fatalf(\"did not connect: %v\", err)\n\t}\n\tdefer conn1.Close()\n\ts.BillingClient = billing.NewBillingClient(conn1)\n\n\t// setup payments client\n\tconn2, err := grpc.Dial(\"0.0.0.0:50053\", grpc.WithInsecure())\n\tif err != nil {\n\t\tlog.Fatalf(\"did not connect: %v\", err)\n\t}\n\tdefer conn2.Close()\n\ts.PaymentsClient = payments.NewPaymentsClient(conn2)\n\n\t// create a gRPC server object\n\tgrpcServer := grpc.NewServer()\n\n\t// attach the Ping service to the server\n\tapi.RegisterAccountsServer(grpcServer, &s)\n\n\t// start the server\n\tif err := grpcServer.Serve(lis); err != nil {\n\t\tlog.Fatalf(\"failed to serve: %s\", err)\n\t}\n}", "title": "" }, { "docid": "46baeb1cf139577684786134e179bf5c", "score": "0.5431565", "text": "func runGrpcServer(address string) {\n\tln, err := net.Listen(\"tcp\", address)\n\tif err != nil {\n\t\tglog.Fatalf(\"While running server for client: %v\", err)\n\t\treturn\n\t}\n\tglog.WithField(\"address\", ln.Addr()).Info(\"Client Worker listening\")\n\n\ts := grpc.NewServer()\n\tgraph.RegisterDGraphServer(s, &server{})\n\tif err = s.Serve(ln); err != nil {\n\t\tglog.Fatalf(\"While serving gRpc requests\", err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "245a67a68f0ac0e4d79da523536dcfc9", "score": "0.54301", "text": "func main() {\n\n\t//get address of grpc auth from ENV\n\tauthIP = os.Getenv(\"AUTH_IP\")\n\n\t//show info to console\n\tfmt.Println(\"auth address: \" + authIP)\n\tfmt.Println(\"\\n portal admin running with port \" + exposeport)\n\n\t//start gin\n\trouter := gin.Default()\n\trouter.POST(\"/*name\", postHandler)\n\trouter.Run(\":\" + exposeport)\n\n}", "title": "" }, { "docid": "436a6a7c9c50c0b88a85b5f5fa31e6d7", "score": "0.5424024", "text": "func newGateway(ctx context.Context, opts ...runtime.ServeMuxOption) (http.Handler, error) {\n\tmux := runtime.NewServeMux(opts...)\n\n\t// Don't manually set mutual TLS, enable it cluster wide with a service mesh\n\tdialOpts := []grpc.DialOption{grpc.WithInsecure()}\n\n\tvar errs []error\n\n\terrs = append(errs, proto.RegisterHealthHandlerFromEndpoint(ctx, mux, cfg.GrpcHost+cfg.GrpcPort, dialOpts))\n\terrs = append(errs, proto.RegisterCabHandlerFromEndpoint(ctx, mux, cfg.GrpcHost+cfg.GrpcPort, dialOpts))\n\n\tfor _, err := range errs {\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn mux, nil\n}", "title": "" }, { "docid": "b8cd4a2711baf28bd22313b4745c6d26", "score": "0.542233", "text": "func cstGatewayMain(ctx *cli.Context) {\r\n\tif ctx.Args().First() == \"help\" {\r\n\t\tcli.ShowCommandHelpAndExit(ctx, cstBackend, 1)\r\n\t}\r\n\tURL := ctx.Args().First()\r\n\tlogger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString(\"address\"), URL), \"Invalid argument\")\r\n\tminio.StartGateway(ctx, &CST{URL})\r\n}", "title": "" }, { "docid": "ae1f2001a3b4435e188fb08e658c6da9", "score": "0.54195935", "text": "func (a *DevicesApiService) Gateway(ctx _context.Context, gatewayId string) ([]Gateway, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue []Gateway\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/di/gateways/{gatewayId}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"gatewayId\"+\"}\", _neturl.QueryEscape(parameterToString(gatewayId, \"\")) , -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.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\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"x-refresh-token\"] = key\n\t\t}\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\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 400 {\n\t\t\tvar v ErrorEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 401 {\n\t\t\tvar v ErrorEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 {\n\t\t\tvar v ErrorEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v ErrorEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 500 {\n\t\t\tvar v ErrorEntity\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = 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 := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "0896784ed08c3b91aef6173922bfbc64", "score": "0.53948647", "text": "func Run() (err error) {\n\tdefer log.Flush()\n\n\t// make data folder\n\tos.MkdirAll(DataFolder, 0755)\n\n\t// load current apikeys\n\tapikeys, err = jsonstore.Open(path.Join(DataFolder, \"apikeys.json.gz\"))\n\tif err != nil {\n\t\tapikeys = new(jsonstore.JSONStore)\n\t}\n\tgo func() {\n\t\tfor {\n\t\t\tjsonstore.Save(apikeys, path.Join(DataFolder, \"apikeys.json.gz\"))\n\t\t\ttime.Sleep(10 * time.Second)\n\t\t}\n\t}()\n\n\t// make websocket hubs\n\thubs = make(map[string]*Hub)\n\thubs2 = make(map[string]*Hub)\n\tgo garbageCollectWebsockets()\n\n\tgin.SetMode(gin.ReleaseMode)\n\tr := gin.New()\n\tr.LoadHTMLGlob(\"templates/*\")\n\tr.Static(\"/static\", \"./static\")\n\tr.Use(middleWareHandler(), gin.Recovery())\n\tr.HEAD(\"/\", handlerOK)\n\tr.GET(\"/realtime\", func(c *gin.Context) {\n\t\tapikey := c.DefaultQuery(\"apikey\", \"\")\n\t\tusername, err := authenticate(apikey)\n\t\tif err != nil {\n\t\t\tc.String(http.StatusOK, \"not authenticated\")\n\t\t\treturn\n\t\t}\n\t\tc.HTML(http.StatusOK, \"realtime.tmpl\", gin.H{\n\t\t\t\"Username\": username,\n\t\t\t\"SSL\": UseSSL,\n\t\t\t\"ServerAddress\": ServerAddress,\n\t\t\t\"APIKey\": apikey,\n\t\t})\n\t})\n\tr.GET(\"/ws\", handleWebsockets) // handle websockets\n\tr.GET(\"/ws2\", handleWebsockets2) // handle websockets\n\tr.POST(\"/sensor\", handlePostSensorData) // handle sensor data\n\tr.POST(\"/activity\", handlerPostActivity)\n\tr.POST(\"/login\", handlerPostLogin)\n\tr.OPTIONS(\"/activity\", handlerOK)\n\n\tlog.Infof(\"Running at http://0.0.0.0:\" + Port)\n\terr = r.Run(\":\" + Port)\n\treturn\n\treturn\n}", "title": "" }, { "docid": "0430bde9b507a0796e3fbe97abc3364f", "score": "0.539413", "text": "func runProxy(\n\tctx context.Context,\n\tch *cmdutil.Helper,\n\tproxyOpts proxy.Options,\n\tdatabase, branch string,\n\tready chan string,\n) error {\n\tp, err := proxy.NewClient(proxyOpts)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"couldn't create proxy client: %s\", err)\n\t}\n\n\tgo func(ready chan string) {\n\t\t// this is blocking and will only return once p.Run() below is\n\t\t// invoked\n\t\taddr, err := p.LocalAddr()\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"failed getting local addr: %s\\n\", err)\n\t\t\treturn\n\t\t}\n\n\t\tch.Printer.Printf(\"Secure connection to database %s and branch %s is established!.\\n\\nLocal address to connect your application: %s (press ctrl-c to quit)\\n\",\n\t\t\tprinter.BoldBlue(database),\n\t\t\tprinter.BoldBlue(branch),\n\t\t\tprinter.BoldBlue(addr.String()),\n\t\t)\n\t\tready <- addr.String()\n\t}(ready)\n\n\treturn p.Run(ctx)\n}", "title": "" }, { "docid": "fd9f57387084e9f26adac6fe0b3259c4", "score": "0.539406", "text": "func (c *Client) Gateway(ctx context.Context) (string, error) {\n\te := endpoint.Gateway()\n\tresp, err := c.restClient.Do(ctx, e, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\n\tvar gateway struct {\n\t\tURL string\n\t}\n\tif err = json.NewDecoder(resp.Body).Decode(&gateway); err != nil {\n\t\treturn \"\", err\n\t}\n\tc.gatewayURL = gateway.URL\n\treturn gateway.URL, nil\n}", "title": "" }, { "docid": "f5e86065e6597158a96c6833377701cf", "score": "0.53933936", "text": "func (c *RaftController) Run() {\n\tif c.running {\n\t\treturn\n\t}\n\tif err := c.grpcServer.Serve(*c.socket); err != nil {\n\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t}\n}", "title": "" }, { "docid": "4dda8ec0174da026ca61904a439c6d00", "score": "0.5382232", "text": "func listenAndServeGateway(node *core.IpfsNode, addr ma.Multiaddr) error {\n\tgateway, err := NewGatewayHandler(node)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmux := http.NewServeMux()\n\tmux.Handle(\"/ipfs/\", gateway)\n\treturn listenAndServe(\"gateway\", node, addr, mux)\n}", "title": "" }, { "docid": "d0c97aa653f12358fd62c923fbfdd7fd", "score": "0.5379982", "text": "func Run(listenHost string) error {\n\tlis, err := net.Listen(\"tcp\", listenHost)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts := grpc.NewServer()\n\tproto.RegisterHarryPotterSpellsServer(s, harryServer{})\n\n\terr = s.Serve(lis)\n\treturn err\n}", "title": "" }, { "docid": "6ecdbc594bd124ff14625a47cd1e6408", "score": "0.53759366", "text": "func (r extGinRouter) Run(cfg config.ServiceConfig) {\n\tif !cfg.Debug {\n\t\tgin.SetMode(gin.ReleaseMode)\n\t} else {\n\t\tr.cfg.Logger.Debug(\"Debug enabled\")\n\t}\n\n\tserver.InitHTTPDefaultTransport(cfg)\n\n\tr.cfg.Engine.RedirectTrailingSlash = true\n\tr.cfg.Engine.RedirectFixedPath = true\n\tr.cfg.Engine.HandleMethodNotAllowed = true\n\n\tr.cfg.Engine.Use(r.cfg.Middlewares...)\n\n\tif cfg.Debug {\n\t\tr.cfg.Engine.Any(\"/__debug/*param\", ginRouter.DebugHandler(r.cfg.Logger))\n\t}\n\n\tr.registerKrakendEndpoints(cfg.Endpoints)\n\n\tr.cfg.Engine.NoRoute(func(c *gin.Context) {\n\t\tc.Header(server.CompleteResponseHeaderName, server.HeaderIncompleteResponseValue)\n\t})\n\n\tif err := r.RunServer(r.ctx, cfg, r.cfg.Engine); err != nil {\n\t\tr.cfg.Logger.Error(err.Error())\n\t}\n\n\tr.cfg.Logger.Info(\"Router execution ended\")\n}", "title": "" }, { "docid": "83d3a9ec6c19777807ec65d3486c08e3", "score": "0.5368861", "text": "func Run() error {\n\tcfg, err := config.LoadConfig()\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn err\n\t}\n\n\tstore, err := di.NewStoreComponent(cfg)\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn err\n\t}\n\n\tboil.DebugMode = cfg.DebugLog\n\n\tauthorizator := interceptor.NewAuthorizator(store)\n\n\ts := grapiserver.New(\n\t\tgrapiserver.WithDefaultLogger(),\n\t\tgrapiserver.WithGrpcServerUnaryInterceptors(\n\t\t\tauthorizator.UnaryServerInterceptor(),\n\t\t),\n\t\tgrapiserver.WithServers(\n\t\t\tserver.NewSessionServiceServer(store),\n\t\t\tserver.NewUserServiceServer(store),\n\t\t),\n\t)\n\treturn s.Serve()\n}", "title": "" }, { "docid": "73b7e90b58f67310f5e96633d5cfbba1", "score": "0.5357949", "text": "func TestNewGateway(t *testing.T) {\n\tt.Log(\"/*******************************************************/\")\n\tt.Log(\"/* Start TestNewGateway */\")\n\tt.Log(\"/*******************************************************/\")\n\n\tvar err error\n\tprivateKeys, accountAddrs, err := util.GenerateAccount(lotusAP, lotusToken, superAcct, 37)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Main key used across the chain\n\tblockchainPrivateKey, err := fcrcrypto.GenerateBlockchainKeyPair()\n\tif err != nil {\n\t\tlogging.Error(\"error generating blockchain key: %s\", err.Error())\n\t\tt.FailNow()\n\t}\n\n\t// Create and start register manager\n\tvar rm = fcrregistermgr.NewFCRRegisterMgr(gatewayConfig.GetString(\"REGISTER_API_URL\"), true, true, 10*time.Second)\n\tif err := rm.Start(); err != nil {\n\t\tlogging.Error(\"error starting Register Manager: %s\", err.Error())\n\t\tt.FailNow()\n\t}\n\tdefer rm.ShutdownAndWait()\n\n\t// Configure gateway admin\n\tgConfBuilder := fcrgatewayadmin.CreateSettings()\n\tgConfBuilder.SetBlockchainPrivateKey(blockchainPrivateKey)\n\tgConfBuilder.SetRegisterURL(gatewayConfig.GetString(\"REGISTER_API_URL\"))\n\tgConf := gConfBuilder.Build()\n\tgwAdmin := fcrgatewayadmin.NewFilecoinRetrievalGatewayAdmin(*gConf)\n\n\t// Initialise gateways\n\tvar gwIDs []*nodeid.NodeID\n\t// Only initialise 32 gateways, with one extra to initialise later to test list single cid offer\n\tfor i := 0; i < 32; i++ {\n\t\twalletKey := privateKeys[0]\n\t\twalletAddress := accountAddrs[0]\n\t\tprivateKeys = privateKeys[1:]\n\t\taccountAddrs = accountAddrs[1:]\n\n\t\tgatewayRootPubKey, gatewayRetrievalPubKey, gatewayRetrievalPrivateKey, err := generateKeys()\n\t\tvar idStr string\n\t\tif i%2 == 0 {\n\t\t\tidStr = fmt.Sprintf(\"%X000000000000000000000000000000000000000000000000000000000000000\", i/2)\n\t\t} else {\n\t\t\tidStr = fmt.Sprintf(\"%X800000000000000000000000000000000000000000000000000000000000000\", i/2)\n\t\t}\n\t\tt.Log(idStr)\n\n\t\tgatewayID, err := nodeid.NewNodeIDFromHexString(idStr)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tgwIDs = append(gwIDs, gatewayID)\n\n\t\tidentifier := fmt.Sprintf(\"-%v\", i)\n\t\tgatewayRegistrar := register.NewGatewayRegister(\n\t\t\tgatewayID.ToString(),\n\t\t\twalletAddress,\n\t\t\tgatewayRootPubKey,\n\t\t\tgatewayRetrievalPubKey,\n\t\t\tgatewayConfig.GetString(\"GATEWAY_REGION_CODE\"),\n\t\t\tgatewayConfig.GetString(\"NETWORK_INFO_GATEWAY\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_GATEWAY\")[7:],\n\t\t\tgatewayConfig.GetString(\"NETWORK_INFO_PROVIDER\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_PROVIDER\")[7:],\n\t\t\tgatewayConfig.GetString(\"NETWORK_INFO_CLIENT\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_CLIENT\")[7:],\n\t\t\tgatewayConfig.GetString(\"NETWORK_INFO_ADMIN\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_ADMIN\")[7:],\n\t\t)\n\n\t\terr = gwAdmin.InitialiseGatewayV2(gatewayRegistrar, gatewayRetrievalPrivateKey, fcrcrypto.DecodeKeyVersion(1), walletKey, lotusAP, lotusToken)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\t// Enroll the gateway in the Register srv.\n\t\tif err := rm.RegisterGateway(gatewayRegistrar); err != nil {\n\t\t\tlogging.Error(\"error registering gateway: %s\", err.Error())\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\n\t// Initialise providers\n\tpConfBuilder := fcrprovideradmin.CreateSettings()\n\tpConfBuilder.SetBlockchainPrivateKey(blockchainPrivateKey)\n\tpConfBuilder.SetRegisterURL(providerConfig.GetString(\"REGISTER_API_URL\"))\n\tpConf := pConfBuilder.Build()\n\tpAdmin := fcrprovideradmin.NewFilecoinRetrievalProviderAdmin(*pConf)\n\tvar pIDs []*nodeid.NodeID\n\tfor i := 0; i < 3; i++ {\n\t\twalletKey := privateKeys[0]\n\t\twalletAddress := accountAddrs[0]\n\t\tprivateKeys = privateKeys[1:]\n\t\taccountAddrs = accountAddrs[1:]\n\n\t\tproviderRootPubKey, providerRetrievalPubKey, providerRetrievalPrivateKey, err := generateKeys()\n\t\tproviderID := nodeid.NewRandomNodeID()\n\t\tpIDs = append(pIDs, providerID)\n\n\t\tidentifier := fmt.Sprintf(\"-%v\", i)\n\t\tproviderRegistrar := register.NewProviderRegister(\n\t\t\tproviderID.ToString(),\n\t\t\twalletAddress,\n\t\t\tproviderRootPubKey,\n\t\t\tproviderRetrievalPubKey,\n\t\t\tproviderConfig.GetString(\"PROVIDER_REGION_CODE\"),\n\t\t\tproviderConfig.GetString(\"NETWORK_INFO_GATEWAY\")[:8]+identifier+providerConfig.GetString(\"NETWORK_INFO_GATEWAY\")[8:],\n\t\t\tproviderConfig.GetString(\"NETWORK_INFO_CLIENT\")[:8]+identifier+providerConfig.GetString(\"NETWORK_INFO_CLIENT\")[8:],\n\t\t\tproviderConfig.GetString(\"NETWORK_INFO_ADMIN\")[:8]+identifier+providerConfig.GetString(\"NETWORK_INFO_ADMIN\")[8:],\n\t\t)\n\t\t// Initialise the provider in the Admin\n\t\terr = pAdmin.InitialiseProviderV2(providerRegistrar, providerRetrievalPrivateKey, fcrcrypto.DecodeKeyVersion(1), walletKey, lotusAP, lotusToken)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\t// Enroll the provider in the Register srv.\n\t\tif err := rm.RegisterProvider(providerRegistrar); err != nil {\n\t\t\tlogging.Error(\"error registering provider: %s\", err.Error())\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\n\tclientWalletKey := privateKeys[0]\n\t// drop used key and account pair\n\tprivateKeys = privateKeys[1:]\n\taccountAddrs = accountAddrs[1:]\n\n\t// Configure client\n\tclientConfBuilder := fcrclient.CreateSettings()\n\tclientConfBuilder.SetEstablishmentTTL(101)\n\tclientConfBuilder.SetBlockchainPrivateKey(blockchainPrivateKey)\n\tclientConfBuilder.SetRegisterURL(gatewayConfig.GetString(\"REGISTER_API_URL\"))\n\tclientConfBuilder.SetWalletPrivateKey(clientWalletKey)\n\tclientConfBuilder.SetLotusAP(lotusAP)\n\tclientConfBuilder.SetLotusAuthToken(lotusToken)\n\tclientConf := clientConfBuilder.Build()\n\tclient, err := fcrclient.NewFilecoinRetrievalClient(*clientConf, rm)\n\tif !assert.Nil(t, err, \"Error should be nil\") {\n\t\tt.Fatal(err)\n\t}\n\tres := client.PaymentMgr()\n\tif !assert.NotNil(t, res, \"Fail to initialise a payment manager\") {\n\t\tt.FailNow()\n\t}\n\n\tadded := client.AddGatewaysToUse(gwIDs)\n\tif !assert.Equal(t, 32, added, \"32 gateways should be added\") {\n\t\tt.FailNow()\n\t}\n\n\tadded = client.AddActiveGateways(gwIDs)\n\tif !assert.Equal(t, 32, added, \"32 gateways should be active\") {\n\t\tt.FailNow()\n\t}\n\n\t// Force providers and gateways to update\n\tfor _, p := range pIDs {\n\t\terr := pAdmin.ForceUpdate(p)\n\t\tif err != nil {\n\t\t\tlogging.Error(\"provider update error: %s\", err)\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\tfor _, g := range gwIDs {\n\t\terr := gwAdmin.ForceUpdate(g)\n\t\tif err != nil {\n\t\t\tlogging.Error(\"gateway update error: %s\", err)\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\n\t// Publish offer 0 from provider 0\n\tcontentID01, err := cid.NewContentIDFromHexString(\"101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E21\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcontentID02, err := cid.NewContentIDFromHexString(\"101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E22\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcontentID03, err := cid.NewContentIDFromHexString(\"101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E23\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpiryDate := time.Now().Local().Add(time.Hour * time.Duration(24)).Unix()\n\terr = pAdmin.PublishGroupCID(pIDs[0], []cid.ContentID{*contentID01, *contentID02, *contentID03}, 42, expiryDate, 42)\n\tif err != nil {\n\t\tlogging.Error(\"error to publish group offer for content IDs: %s, %s, %s; error: %s\", contentID01.ToString(), contentID02.ToString(), contentID03.ToString(), err.Error())\n\t\tt.FailNow()\n\t}\n\n\t// Publish offer 1 from provider 1\n\tcontentID11, err := cid.NewContentIDFromHexString(\"101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E24\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcontentID12, err := cid.NewContentIDFromHexString(\"101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E25\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tcontentID13, err := cid.NewContentIDFromHexString(\"101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E26\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpiryDate = time.Now().Local().Add(time.Hour * time.Duration(24)).Unix()\n\terr = pAdmin.PublishGroupCID(pIDs[1], []cid.ContentID{*contentID11, *contentID12, *contentID13}, 42, expiryDate, 42)\n\tif err != nil {\n\t\tlogging.Error(\"error to publish group offer for content IDs: %s, %s, %s; error: %s\", contentID11.ToString(), contentID12.ToString(), contentID13.ToString(), err.Error())\n\t\tt.FailNow()\n\t}\n\n\t// Publish DHT Offer from pvd0\n\t// It will be published to gateway 6 - gateway 21\n\tcontentID0, err := cid.NewContentIDFromHexString(\"6880000000000000000000000000000000000000000000000000000000000000\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpiryDate = time.Now().Local().Add(time.Hour * time.Duration(24)).Unix()\n\terr = pAdmin.PublishDHTCID(pIDs[0], []cid.ContentID{*contentID0}, []uint64{42}, []int64{expiryDate}, []uint64{42})\n\tif err != nil {\n\t\tlogging.Error(\"error to publish DHT offer for content ID: %s; error: %s\", contentID0.ToString(), err.Error())\n\t\tt.FailNow()\n\t}\n\n\t// Publish DHT Offer from pvd1\n\t// It will be published to gateway 25 to gateway 31 and gateway 0 to gateway 8\n\tcontentID1, err := cid.NewContentIDFromHexString(\"0080000000000000000000000000000000000000000000000000000000000000\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\texpiryDate = time.Now().Local().Add(time.Hour * time.Duration(24)).Unix()\n\terr = pAdmin.PublishDHTCID(pIDs[0], []cid.ContentID{*contentID1}, []uint64{42}, []int64{expiryDate}, []uint64{42})\n\tif err != nil {\n\t\tlogging.Error(\"error to publish DHT offer for content ID: %s; error: %s\", contentID1.ToString(), err.Error())\n\t\tt.FailNow()\n\t}\n\n\t///////////////////////////////////////////////////////////////\n\t// unique part below\n\n\tnewGatewayWalletKey := privateKeys[0]\n\tnewGatwayWalletAddress := accountAddrs[0]\n\tprivateKeys = privateKeys[1:]\n\taccountAddrs = accountAddrs[1:]\n\n\tgatewayRootPubKey, gatewayRetrievalPubKey, gatewayRetrievalPrivateKey, err := generateKeys()\n\tnewGatewayID, err := nodeid.NewNodeIDFromHexString(\"3880000000000000000000000000000000000000000000000000000000000000\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tgwIDs = append(gwIDs, newGatewayID)\n\tidentifier := fmt.Sprintf(\"-32\")\n\tgatewayRegistrar := register.NewGatewayRegister(\n\t\tnewGatewayID.ToString(),\n\t\tnewGatwayWalletAddress,\n\t\tgatewayRootPubKey,\n\t\tgatewayRetrievalPubKey,\n\t\tgatewayConfig.GetString(\"GATEWAY_REGION_CODE\"),\n\t\tgatewayConfig.GetString(\"NETWORK_INFO_GATEWAY\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_GATEWAY\")[7:],\n\t\tgatewayConfig.GetString(\"NETWORK_INFO_PROVIDER\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_PROVIDER\")[7:],\n\t\tgatewayConfig.GetString(\"NETWORK_INFO_CLIENT\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_CLIENT\")[7:],\n\t\tgatewayConfig.GetString(\"NETWORK_INFO_ADMIN\")[:7]+identifier+gatewayConfig.GetString(\"NETWORK_INFO_ADMIN\")[7:],\n\t)\n\terr = gwAdmin.InitialiseGatewayV2(gatewayRegistrar, gatewayRetrievalPrivateKey, fcrcrypto.DecodeKeyVersion(1), newGatewayWalletKey, lotusAP, lotusToken)\n\tif err != nil {\n\t\tlogging.Error(\"error to initialise gateway ID: %s; error: %s\", gatewayRegistrar.GetNodeID(), err.Error())\n\t\tt.FailNow()\n\t}\n\tif err = rm.RegisterGateway(gatewayRegistrar); err != nil {\n\t\tlogging.Error(\"error to register gateway ID: %s; error: %s\", gatewayRegistrar.GetNodeID(), err.Error())\n\t\tt.FailNow()\n\t}\n\t// Force update providers and admins\n\tfor _, p := range pIDs {\n\t\terr := pAdmin.ForceUpdate(p)\n\t\tif err != nil {\n\t\t\tlogging.Error(\"error updating provider ID: %s; error: %s\", p.ToString(), err.Error())\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\tfor _, g := range gwIDs {\n\t\terr := gwAdmin.ForceUpdate(g)\n\t\tif err != nil {\n\t\t\tlogging.Error(\"error updating gateway ID: %s; error: %s\", g.ToString(), err.Error())\n\t\t\tt.FailNow()\n\t\t}\n\t}\n\n\terr = gwAdmin.ListDHTOffer(newGatewayID)\n\tif err != nil {\n\t\tlogging.Error(\"error listing DHT offer for the new gateway: %s\", err.Error())\n\t\tt.FailNow()\n\t}\n\n\tadded = client.AddGatewaysToUse([]*nodeid.NodeID{newGatewayID})\n\tif !assert.Equal(t, 1, added, \"1 gateway should be added\") {\n\t\tt.FailNow()\n\t}\n\n\tadded = client.AddActiveGateways([]*nodeid.NodeID{newGatewayID})\n\tif !assert.Equal(t, 1, added, \"1 gateway should be active\") {\n\t\tt.FailNow()\n\t}\n\n\t//////////////////////////////\n\t// unique assertion part\n\n\toffers, err := client.FindOffersStandardDiscoveryV2(contentID0, newGatewayID, 1)\n\tif err != nil {\n\t\tlogging.Error(\"standard offers discovery error: %s\", err.Error())\n\t\tt.FailNow()\n\t}\n\tif !assert.Equal(t, 1, len(offers), \"Should find offer with cid 0 from gateway 32.\") {\n\t\tt.FailNow()\n\t}\n\n\toffers, err = client.FindOffersStandardDiscoveryV2(contentID1, newGatewayID, 1)\n\tif err != nil {\n\t\tlogging.Error(\"standard offers discovery error: %s\", err.Error())\n\t\tt.FailNow()\n\t}\n\tif !assert.Equal(t, 1, len(offers), \"Should find offer with cid 1 from gateway 32.\") {\n\t\tt.FailNow()\n\t}\n\n\tt.Log(\"/*******************************************************/\")\n\tt.Log(\"/* End TestNewGateway */\")\n\tt.Log(\"/*******************************************************/\")\n}", "title": "" }, { "docid": "285e9925af9cca2c295f241cd7ea578e", "score": "0.5357519", "text": "func (s *Server) Run() error {\n\tvar err error\n\ts.grpcEndpoint = fmt.Sprintf(\"%s:%d\", s.conf.Host, s.conf.Port)\n\ts.httpEndpoint = fmt.Sprintf(\"%s:%d\", s.conf.Host, s.conf.Port-1)\n\ts.clientTLS, err = ssl.ClientTslConfVerity(s.conf.APICerts.CAFile, s.conf.APICerts.ClientCertFile, s.conf.APICerts.ClientKeyFile, static.ClientCertPwd)\n\tif err != nil {\n\t\tblog.Warnf(\"parse client TLS config failed: %s\", err.Error())\n\t\ts.clientTLS = nil\n\t}\n\ts.serverTLS, err = ssl.ServerTslConf(s.conf.APICerts.CAFile, s.conf.APICerts.ServerCertFile, s.conf.APICerts.ServerKeyFile, static.ServerCertPwd)\n\tif err != nil {\n\t\tblog.Warnf(\"parse server TLS config failed: %s\", err.Error())\n\t\ts.serverTLS = nil\n\t}\n\ts.etcdTLS, err = ssl.ClientTslConfVerity(s.conf.EtcdCerts.CAFile, s.conf.EtcdCerts.ClientCertFile, s.conf.EtcdCerts.ClientKeyFile, \"\")\n\tif err != nil {\n\t\tblog.Warnf(\"parse etcd client TLS config failed: %s\", err.Error())\n\t\ts.etcdTLS = nil\n\t}\n\t// s.initGRPCServer()\n\terr = s.startGateway()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = s.startMicroService()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0cae9bdeb416d0af7246a7682da3d613", "score": "0.5354842", "text": "func main() {\n\tsrv := drpc.NewEndpoint(\n\t\tdrpc.EndpointConfig{\n\t\t\tListenPort: 8080,\n\t\t},\n\t\tnewProxyPlugin(),\n\t)\n\tsrv.ListenAndServe()\n}", "title": "" }, { "docid": "cf14dee57113982f2cd480d2d388a92b", "score": "0.53537583", "text": "func (i *Instance) Run() {\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"%s:%d\", i.args.SIP, i.args.SPort))\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to listen: %v\", err))\n\t}\n\n\tlog.Infof(\"Listening on %s\", lis.Addr().String())\n\ti.addr = lis.Addr().String()\n\n\tsrv, err := service.New(i.store, i.args.CogKV, i.args.MaxCrashes)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\topts := []grpc.ServerOption{\n\t\tgrpc.RPCCompressor(grpc.NewGZIPCompressor()),\n\t\tgrpc.RPCDecompressor(grpc.NewGZIPDecompressor()),\n\t\tgrpc.MaxMsgSize(1024 * 1024 * 1024 * 2),\n\t}\n\n\tif !i.args.Insecure {\n\t\ttc, err := credentials.NewServerTLSFromFile(i.args.CertFile, i.args.KeyFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\topts = append(opts, grpc.Creds(tc))\n\t}\n\n\ti.server = grpc.NewServer(opts...)\n\tpb.RegisterMarmotServiceServer(i.server, srv)\n\n\ti.server.Serve(lis)\n}", "title": "" }, { "docid": "67b9eb78a0b235ffa78cdfd90d774d86", "score": "0.53509015", "text": "func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {\n\t// this line is used by starport scaffolding # 2\n}", "title": "" }, { "docid": "328e4a06d8958da98c66c2213f7a26a8", "score": "0.5348557", "text": "func (d *Driver) Run() error {\n\tif config.Provisioner {\n\t\tgo d.provisionerService.Run(context.Background())\n\t}\n\tscheme, addr, err := util.ParseEndpoint(d.endpoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlistener, err := net.Listen(scheme, addr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogErr := func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n\t\tresp, err := handler(ctx, req)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"GRPC error: %v\", err)\n\t\t}\n\t\treturn resp, err\n\t}\n\topts := []grpc.ServerOption{\n\t\tgrpc.UnaryInterceptor(logErr),\n\t}\n\td.srv = grpc.NewServer(opts...)\n\n\tcsi.RegisterIdentityServer(d.srv, d)\n\tcsi.RegisterControllerServer(d.srv, d)\n\tcsi.RegisterNodeServer(d.srv, d)\n\n\tklog.Infof(\"Listening for connection on address: %#v\", listener.Addr())\n\treturn d.srv.Serve(listener)\n}", "title": "" }, { "docid": "276bd382d68efc25668b109056c59dc3", "score": "0.5347987", "text": "func newGateway() *gateway {\n\treturn &gateway{\n\t\ttk: timekeeper.RealTime{},\n\t\tlogger: log.DefaultLogger.CreateChild(),\n\t\tstdout: os.Stdout,\n\t\tdebugContext: web.HeaderCtxFlag{\n\t\t\tHeaderName: \"X-Debug-Id\",\n\t\t},\n\t\tdebugSink: dpsink.ItemFlagger{\n\t\t\tEventMetaName: \"dbg_events\",\n\t\t\tMetricDimensionName: \"sf_metric\",\n\t\t},\n\t\tsetupDoneSignal: make(chan struct{}),\n\t\tsignalChan: make(chan os.Signal, 1),\n\t}\n}", "title": "" }, { "docid": "8ad2d632ab182816c8e9e856c942367a", "score": "0.534694", "text": "func main() {\n\n\tvar err error\n\n\tdefer cleanup()\n\n\t// Init Customer Object\n\tinitTaxi()\n\n\t// Init logger\n\ttaxi.InitLogger(\"\")\n\n\t// Should only be done from init functions\n\t//grpclog.SetLoggerV2(grpclog.NewLoggerV2(taxi.logger.Out, taxi.logger.Out, taxi.logger.Out))\n\n\n\t//initLog()\n\n\t// *********************\n\t// Set up connection to Taxi Hardware Server\n\tremoteTaxiHWServerConnection, err = grpc.Dial(addressToDialToTaxiHWServer, grpc.WithInsecure())\n\tif err != nil {\n\t\t//log.Println(\"did not connect to Taxi Hardware Server on address: \", addressToDialToTaxiHWServer, \"error message\", err)\n\t\ttaxi.logger.WithFields(logrus.Fields{\n\t\t\t\"addressToDialToTaxiHWServer\": addressToDialToTaxiHWServer,\n\t\t\t\"error message\": err,\n\t\t}).Error(\"did not connect to Taxi Hardware Server on address\")\n\t\tos.Exit(0)\n\t} else {\n\t\t//log.Println(\"gRPC connection OK to Taxi Hardware Server, address: \", addressToDialToTaxiHWServer)\n\t\ttaxi.logger.WithFields(logrus.Fields{\n\t\t\t\"addressToDialToTaxiHWServer\": addressToDialToTaxiHWServer,\n\t\t}).Info(\"gRPC connection OK to Taxi Hardware Server\")\n\t\t// Creates a new Clients\n\t\ttaxiHWClient = taxiHW_api.NewTaxiHardwareClient(remoteTaxiHWServerConnection)\n\n\t}\n\n\t// *********************\n\t// Set up connection to Taxi Hardware Stream Server\n\tremoteTaxiHWStreamServerConnection, err = grpc.Dial(addressToDialToTaxiHWStreamServer, grpc.WithInsecure())\n\tif err != nil {\n\t\t//log.Println(\"did not connect to Taxi Hardware Stream Server on address: \", addressToDialToTaxiHWStreamServer, \"error message\", err)\n\t\ttaxi.logger.WithFields(logrus.Fields{\n\t\t\t\"addressToDialToTaxiHWStreamServer\": addressToDialToTaxiHWStreamServer,\n\t\t\t\"error message\": err,\n\t\t}).Error(\"did not connect to Taxi Hardware Stream Server on address\")\n\t\tos.Exit(0)\n\t} else {\n\t\t//log.Println(\"gRPC connection OK to Taxi Hardware Stream Server, address: \", addressToDialToTaxiHWStreamServer)\n\t\ttaxi.logger.WithFields(logrus.Fields{\n\t\t\t\"addressToDialToTaxiHWStreamServer\": addressToDialToTaxiHWStreamServer,\n\t\t}).Info(\"gRPC connection OK to Taxi Hardware Stream Server\")\n\t\t// Creates a new Clients\n\t\ttaxiHWStreamClient = taxiHW_stream_api.NewTaxiStreamHardwareClient(remoteTaxiHWStreamServerConnection)\n\n\t}\n\n\t// Starting to receive stream from Taxi Engine about Powerconsumption\n\tgo receiveEnginePowerdata(taxiHWStreamClient, messasurePowerMessage)\n\n\t// *********************\n\t// Start Taxi Server for Incomming Customer connectionss\n\t//log.Println(\"Taxi Customer Server started\")\n\ttaxi.logger.Info(\"Taxi Customer Server started\")\n\t//log.Println(\"Start listening on: %v\", localTaxiServerEngineLocalPort)\n\ttaxi.logger.WithFields(logrus.Fields{\n\t\t\"localTaxiServerEngineLocalPort\": localTaxiServerEngineLocalPort,\n\t}).Info(\"Start listening on\")\n\tlis, err = net.Listen(\"tcp\", localTaxiServerEngineLocalPort)\n\tif err != nil {\n\t\t//log.Fatalf(\"failed to listen: %v\", err)\n\t\ttaxi.logger.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t}).Fatal(\"failed to listen:\")\n\t}\n\n\t// Creates a new RegisterClient gRPC server\n\tgo func() {\n\t\t//log.Println(\"Starting Taxi Customer Server\")\n\t\ttaxi.logger.Info(\"Starting Taxi Customer Server\")\n\t\tregisterTaxiServer = grpc.NewServer()\n\t\ttaxi_api.RegisterTaxiServer(registerTaxiServer, &taxiServiceServer{})\n\t\t//log.Println(\"registerTaxiServer for Taxi Gate started\")\n\t\ttaxi.logger.Info(\"registerTaxiServer for Taxi Gate started\")\n\t\tregisterTaxiServer.Serve(lis)\n\t}()\n\t// *********************\n\n\t// Test State Machine in Test/Production Mode\n\tuseEnv = taxiHW_api.TestOrProdEnviroment_Production\n\t//testTaxiCycle()\n\n\t//Initiate Lightning\n\t//lightningConnection.InitLndServerConnection()\n\t//lightningConnection.RetrieveGetInfo()\n\n\tgo lightningConnection.LigtningMainService(taxi.logger, customerPaysPaymentRequest)\n\n\t// Set up the Private Taxi Road State Machine\n\ttaxi.startTaxi()\n\n\t// Set system in wait mode for externa input, Taxi and payment ...\n\tc := make(chan os.Signal, 2)\n\tsignal.Notify(c, os.Interrupt, syscall.SIGTERM)\n\tgo func() {\n\t\t<-c\n\t\tcleanup()\n\t\tos.Exit(0)\n\t}()\n\n\tfor {\n\t\t//fmt.Println(\"sleeping...for another 5 minutes\")\n\t\ttaxi.logger.Info(\"sleeping...for another 5 minutes\")\n\n\t\ttime.Sleep(300 * time.Second) // or runtime.Gosched() or similar per @misterbee\n\t}\n\n}", "title": "" }, { "docid": "8e3cb7a889d6afa49063891e1d0b853a", "score": "0.53427833", "text": "func (s *Service) createGateway(ctx context.Context, params CreateGatewayParams) (*gateway.Gateway, error) {\n\tcliCommandProvider := clusters.NewDbcmdCLICommandProvider(s.cfg.Storage, dbcmd.SystemExecer{})\n\tclusterCreateGatewayParams := clusters.CreateGatewayParams{\n\t\tTargetURI: params.TargetURI,\n\t\tTargetUser: params.TargetUser,\n\t\tTargetSubresourceName: params.TargetSubresourceName,\n\t\tLocalPort: params.LocalPort,\n\t\tCLICommandProvider: cliCommandProvider,\n\t\tTCPPortAllocator: s.cfg.TCPPortAllocator,\n\t}\n\n\tgateway, err := s.cfg.GatewayCreator.CreateGateway(ctx, clusterCreateGatewayParams)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\tgo func() {\n\t\tif err := gateway.Serve(); err != nil {\n\t\t\tgateway.Log().WithError(err).Warn(\"Failed to handle a gateway connection.\")\n\t\t}\n\t}()\n\n\ts.gateways[gateway.URI().String()] = gateway\n\n\treturn gateway, nil\n}", "title": "" }, { "docid": "e95305cb4c1d742b7960a9cf805d9a65", "score": "0.534212", "text": "func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "28f8c42495b334c84ab61c099d294754", "score": "0.5338701", "text": "func main() {\n\tlog, err := createLogger()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer func() {\n\t\t_ = log.Sync()\n\t}()\n\n\tvar (\n\t\tport = flag.String(\"port\", _defaultPort, \"port on which the gateway server runs on\")\n\t\tqueueURL = flag.String(\"queue\", \"\", \"SQS queue URL\")\n\t\tregion = flag.String(\"region\", \"\", \"AWS region\")\n\t\tbucket = flag.String(\"bucket\", \"\", \"AWS bucket\")\n\t\tclusterName = flag.String(\"cluster\", \"\", \"cluster name\")\n\t)\n\tflag.Parse()\n\n\tswitch {\n\tcase *queueURL == \"\":\n\t\tlog.Fatal(\"missing required option: -queue\")\n\tcase *region == \"\":\n\t\tlog.Fatal(\"missing required option: -region\")\n\tcase *bucket == \"\":\n\t\tlog.Fatal(\"missing required option: -bucket\")\n\tcase *clusterName == \"\":\n\t\tlog.Fatal(\"missing required option: -cluster\")\n\t}\n\n\tapiName := flag.Arg(0)\n\tif apiName == \"\" {\n\t\tlog.Fatal(\"apiName argument was not provided\")\n\t}\n\n\tsess, err := session.NewSessionWithOptions(session.Options{\n\t\tConfig: aws.Config{\n\t\t\tRegion: region,\n\t\t},\n\t\tSharedConfigState: session.SharedConfigEnable,\n\t})\n\tif err != nil {\n\t\tlog.Fatal(\"failed to create AWS session: %s\", zap.Error(err))\n\t}\n\n\ts3Storage := NewS3(sess, *bucket)\n\tsqsQueue := NewSQS(*queueURL, sess)\n\n\tsvc := NewService(*clusterName, apiName, sqsQueue, s3Storage, log)\n\tep := NewEndpoint(svc, log)\n\n\trouter := mux.NewRouter()\n\trouter.HandleFunc(\"/\", ep.CreateWorkload).Methods(\"POST\")\n\trouter.HandleFunc(\n\t\t\"/healthz\",\n\t\tfunc(w http.ResponseWriter, r *http.Request) {\n\t\t\trespondPlainText(w, http.StatusOK, \"ok\")\n\t\t},\n\t)\n\trouter.HandleFunc(\"/{id}\", ep.GetWorkload).Methods(\"GET\")\n\n\t// inspired by our nginx config\n\tcorsOptions := []handlers.CORSOption{\n\t\thandlers.AllowedOrigins([]string{\"*\"}),\n\t\t// custom headers are not supported currently, since \"*\" is not supported in AllowedHeaders(); here are some common ones:\n\t\thandlers.AllowedHeaders([]string{\"Content-Type\", \"X-Requested-With\", \"User-Agent\", \"Accept\", \"Accept-Language\", \"Content-Language\", \"Origin\"}),\n\t\thandlers.AllowedMethods([]string{\"GET\", \"HEAD\", \"POST\", \"PUT\", \"OPTIONS\"}),\n\t\thandlers.ExposedHeaders([]string{\"Content-Length\", \"Content-Range\"}),\n\t\thandlers.AllowCredentials(),\n\t}\n\n\tlog.Info(\"Running on port \" + *port)\n\tif err = http.ListenAndServe(\":\"+*port, handlers.CORS(corsOptions...)(router)); err != nil {\n\t\tlog.Fatal(\"failed to start server\", zap.Error(err))\n\t}\n}", "title": "" }, { "docid": "5c16cb1c898861f5920fe2018198862d", "score": "0.53281456", "text": "func rpcRun(chord *ChordServer) (*RPC, error) {\n\trpcServer := &RPC{}\n\trpcServer.chord = chord\n\t// rpcs.errChan = make(chan error, 1)\n\trpcServer.rpcBase = rpc.NewServer()\n\tvar err error\n\tif err := rpcServer.rpcBase.Register(rpcServer); err != nil {\n\t\tcheckError(err)\n\t\treturn nil, fmt.Errorf(\"rpc registration failed: %s\", err)\n\t}\n\n\trpcServer.listener, err = net.Listen(\"tcp\", chord.GetIP())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Start thread for server.\n\tgo func() {\n\t\t// rpcHandler.mu.Lock()\n\t\t// rpcHandler.running = true\n\t\t// rpcHandler.mu.Unlock()\n\n\t\t// Blocks until completion\n\t\tDPrintf(\"accepting.........\")\n\t\trpcServer.rpcBase.Accept(rpcServer.listener)\n\t\tDPrintf(\"err...............\")\n\t\t// rpcs.mu.Lock()\n\t\t// rpcs.errChan <- nil\n\t\t// rpcs.running = false\n\t\t// rpcs.mu.Unlock()\n\t}()\n\n\treturn rpcServer, nil\n}", "title": "" }, { "docid": "6baed69d58dac6bb43e5a16524b7f895", "score": "0.5321891", "text": "func (ts *GatewayTestSuite) TestBinanceGateway() {\n\n\trequire := ts.Require()\n\townerAddr := ts.dAppAddr\n\toracleAddr := ts.dAppAddr2\n\tczBinanceAddr := ts.binanceAddr\n\tczBinanceDappAddr := ts.dAppAddr5\n\n\tfakeCtx := plugin.CreateFakeContextWithEVM(oracleAddr, loom.RootAddress(\"chain\"))\n\tfakeCtx = fakeCtx.WithFeature(features.CoinVersion1_3Feature, true)\n\tfakeCtx = fakeCtx.WithFeature(features.TGVersion1_3, true)\n\tfakeCtx.FakeContext.SetFeature(features.TGVersion1_3, true)\n\tfakeCtx.FakeContext.SetFeature(features.CoinVersion1_3Feature, true)\n\tfakeCtx.FakeContext.SetFeature(features.TGVersion1_4, true)\n\n\taddressMapper, err := deployAddressMapperContract(fakeCtx)\n\trequire.NoError(err)\n\n\tsig, err := address_mapper.SignIdentityMapping(czBinanceAddr, czBinanceDappAddr, ts.binanceKey, sigType)\n\trequire.NoError(err)\n\n\trequire.NoError(addressMapper.AddIdentityMapping(fakeCtx.WithSender(czBinanceDappAddr), czBinanceAddr, czBinanceDappAddr, sig))\n\n\ttransferFee := &types.BigUInt{Value: *loom.NewBigUIntFromInt(37500)}\n\n\tgwHelper, err := deployGatewayContract(fakeCtx, &InitRequest{\n\t\tOwner: ownerAddr.MarshalPB(),\n\t\tOracles: []*types.Address{oracleAddr.MarshalPB()},\n\t}, BinanceGateway)\n\trequire.NoError(err)\n\n\treq := &UpdateBinanceTransferFeeRequest{\n\t\tTransferFee: transferFee,\n\t}\n\terr = gwHelper.Contract.SetTransferFee(gwHelper.ContractCtx(fakeCtx.WithSender(ownerAddr)), req)\n\trequire.NoError(err)\n\n\t// deploy erc20 coin for sampleBNBToken\n\tdappTokenAddr2, err := deployTokenContract(fakeCtx, \"SampleBNBToken\", gwHelper.Address, ts.dAppAddr2)\n\trequire.NoError(err)\n\trequire.NoError(gwHelper.AddContractMapping(fakeCtx, binanceBNBAddr, dappTokenAddr2))\n\n\t// deploy LOOM coin\n\tloomCoinContract, err := deployLoomCoinContract(fakeCtx)\n\n\trequire.NoError(err)\n\t// depositing from binance we put Dapp\n\tloomamountsByBlock := []int64{160, 239, 581}\n\tloomdeposits := genLoomDepositsFromBinance(\n\t\tloomCoinContract.Address,\n\t\tczBinanceDappAddr,\n\t\t[]uint64{71, 73, 75},\n\t\tloomamountsByBlock,\n\t)\n\terr = gwHelper.Contract.ProcessEventBatch(gwHelper.ContractCtx(fakeCtx), &ProcessEventBatchRequest{\n\t\tEvents: loomdeposits,\n\t})\n\trequire.NoError(err)\n\n\t// depositing BNB from binance\n\tbep2BNBamountsByBlock := []int64{37500}\n\tbep2BNBdeposits := genBEP2DepositsFromBinance(\n\t\tbinanceBNBAddr,\n\t\tczBinanceDappAddr,\n\t\t[]uint64{78},\n\t\tbep2BNBamountsByBlock,\n\t)\n\n\terr = gwHelper.Contract.ProcessEventBatch(gwHelper.ContractCtx(fakeCtx), &ProcessEventBatchRequest{\n\t\tEvents: bep2BNBdeposits,\n\t})\n\trequire.NoError(err)\n\n\tloomcoin := newcoinStaticContext(gwHelper.ContractCtx(fakeCtx))\n\tbal, err := loomcoin.balanceOf(czBinanceDappAddr)\n\trequire.NoError(err)\n\trequire.Equal(int64(9800000000000), bal.Int64()) // we gain 10**10 from precision adjustment\n\tresp, err := gwHelper.Contract.GetUnclaimedContractTokens(gwHelper.ContractCtx(fakeCtx), &GetUnclaimedContractTokensRequest{TokenAddress: loomCoinContract.Address.MarshalPB()})\n\trequire.NoError(err)\n\trequire.Equal(loom.NewBigUIntFromInt(0), &resp.UnclaimedAmount.Value)\n\n\terc20bnb := newERC20Context(contract.WrapPluginContext(fakeCtx.WithAddress(czBinanceDappAddr)), dappTokenAddr2)\n\tbalbnb, err := erc20bnb.balanceOf(czBinanceDappAddr)\n\trequire.NoError(err)\n\trequire.Equal(int64(37500), balbnb.Int64()) // we gain no decimals as this erc20 bnb token contract has 8 decimals\n\n\trequire.NoError(erc20bnb.approve(gwHelper.Address, big.NewInt(37500)))\n\t// cz withdraw LOOM coin from dAppChain Gateway\n\terr = gwHelper.Contract.WithdrawLoomCoin(\n\t\tgwHelper.ContractCtx(fakeCtx.WithSender(czBinanceDappAddr)),\n\t\t&WithdrawLoomCoinRequest{\n\t\t\tTokenContract: loomcoin.contractAddr.MarshalPB(),\n\t\t\tAmount: &types.BigUInt{Value: *loom.NewBigUIntFromInt(1000000000000)},\n\t\t\tRecipient: czBinanceAddr.MarshalPB(),\n\t\t},\n\t)\n\trequire.NoError(err)\n\n\treceipt, err := gwHelper.Contract.WithdrawalReceipt(\n\t\tgwHelper.ContractCtx(fakeCtx.WithSender(czBinanceDappAddr)),\n\t\t&WithdrawalReceiptRequest{\n\t\t\tOwner: czBinanceDappAddr.MarshalPB(),\n\t\t},\n\t)\n\trequire.NoError(err)\n\t// When TGVersion1_5 feature flag is disabled TokenWithdrawer should be written to the receipt\n\trequire.NotNil(receipt.Receipt.TokenWithdrawer)\n\n\terr = gwHelper.Contract.ProcessEventBatch(gwHelper.ContractCtx(fakeCtx), &ProcessEventBatchRequest{\n\t\tEvents: []*MainnetEvent{\n\t\t\t&MainnetEvent{\n\t\t\t\tEthBlock: 80,\n\t\t\t\tPayload: &MainnetWithdrawalEvent{\n\t\t\t\t\tWithdrawal: &MainnetTokenWithdrawn{\n\t\t\t\t\t\tTokenKind: TokenKind_BNBLoomToken,\n\t\t\t\t\t\tTokenContract: loomcoin.contractAddr.MarshalPB(),\n\t\t\t\t\t\tTokenOwner: czBinanceAddr.MarshalPB(),\n\t\t\t\t\t\tTokenAmount: &types.BigUInt{Value: *loom.NewBigUIntFromInt(1000000000000)},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\trequire.NoError(err)\n\n\tbalanceAfter, err := loomcoin.balanceOf(czBinanceDappAddr)\n\trequire.NoError(err)\n\trequire.Equal(int64(8800000000000), balanceAfter.Int64())\n\n\terr = gwHelper.Contract.WithdrawLoomCoin(\n\t\tgwHelper.ContractCtx(fakeCtx.WithSender(czBinanceDappAddr).WithFeature(features.TGVersion1_5, true)),\n\t\t&WithdrawLoomCoinRequest{\n\t\t\tTokenContract: loomcoin.contractAddr.MarshalPB(),\n\t\t\tAmount: &types.BigUInt{Value: *loom.NewBigUIntFromInt(1000000000000)},\n\t\t\tRecipient: czBinanceAddr.MarshalPB(),\n\t\t},\n\t)\n\trequire.NoError(err)\n\n\treceipt, err = gwHelper.Contract.WithdrawalReceipt(\n\t\tgwHelper.ContractCtx(fakeCtx.WithSender(czBinanceDappAddr)),\n\t\t&WithdrawalReceiptRequest{\n\t\t\tOwner: czBinanceDappAddr.MarshalPB(),\n\t\t},\n\t)\n\trequire.NoError(err)\n\t// When TGVersion1_5 feature flag is enabled TokenWithdrawer shouldn't be written to the receipt\n\trequire.Nil(receipt.Receipt.TokenWithdrawer)\n}", "title": "" }, { "docid": "b48e011d0d810e7d95666d73d8c914c2", "score": "0.53170097", "text": "func Run() {\n\tlogger.Log.Warn(\"[gate]Run begin...\")\n\t// 初始化log\n\tlogger.Log.Global.LoadConfiguration(*logConfig, nil)\n\tif *debugLog {\n\t\tlogger.Log.AddFilter(\"colorLogger\", logger.Log.DEBUG, mylog4go.NewColorConsoleLogWriter())\n\t}\n\n\tif err := configuration.ParseConfig(*svrConfig); err != nil {\n\t\tpanic(fmt.Sprintf(\"load config %v fail: %v\", *svrConfig, err))\n\t}\n\n\t//global\n\tglobal.InitGlobal(*id)\n\n\t//监听logic\n\tlogicMgr = sess.NewLogicManager(configuration.GetInBoundCfg(), configuration.GetMsgQueueSize())\n\tlogicMgr.GoRun()\n\tdefer logicMgr.Close()\n\n\t//监听client\n\tclientMgr = sess.NewClientManager(configuration.GetOutBoundCfg(), configuration.GetMsgQueueSize(), *qps)\n\tclientMgr.GoRun()\n\tdefer clientMgr.Close()\n\n\t//注册gate状态\n\ts := registerState()\n\tif s != nil {\n\t\tdefer s.Stop()\n\t}\n\n\t//注册自己到etcd的gateway\n\ts1 := registerGateway()\n\tif s1 != nil {\n\t\tdefer s1.Stop()\n\t}\n\n\t// ticker\n\taliveTicker := time.NewTicker(time.Minute * 5)\n\tdefer aliveTicker.Stop()\n\n\tticker := time.NewTicker(time.Millisecond * 200)\n\tdefer ticker.Stop()\n\n\t// system signal\n\tsigs := make(chan os.Signal, 1)\n\tsignal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n\t//主循环\nQUIT:\n\tfor {\n\t\tselect {\n\t\tcase sig := <-sigs:\n\t\t\tlogger.Log.Warn(\"[main] sig = %d\", sig)\n\t\t\tif sig == syscall.SIGHUP {\n\t\t\t\ttable.Reload()\n\t\t\t\tlogger.Log.Warn(\"[main] table.Reload()r\")\n\t\t\t\tcontinue\n\t\t\t} else if sig == syscall.SIGQUIT {\n\t\t\t\tlogger.Log.Error(\"[main] cross is stopped by force!\")\n\t\t\t}\n\t\t\tbreak QUIT\n\t\tcase <-logicMgr.WatchChan():\n\t\t\tlogger.Log.Info(\"[main] gate etcd watch close...\")\n\t\t\tbreak QUIT\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9855537b1e329b3a6ed31cbdfce15f53", "score": "0.5313402", "text": "func RunServer(grpcPort string, restAddress string) error {\n\n\tvar wait time.Duration\n\tvar apiServer *http.Server\n\n\tctx, cancel := context.WithTimeout(context.Background(), timeoutValue)\n\tdefer cancel()\n\n\tcommon.Info.Println(\"Starting server on port \", grpcPort)\n\n\tlisten, err := net.Listen(\"tcp\", \":\"+grpcPort)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgrpcServer := grpc.NewServer(\n\t\tgrpc.UnaryInterceptor(\n\t\t\tgrpc_auth.UnaryServerInterceptor(authorize),\n\t\t),\n\t\tgrpc.StreamInterceptor(\n\t\t\tgrpc_auth.StreamServerInterceptor(authorize),\n\t\t),\n\t)\n\n\tShipmentServer, err := service.NewShipmentService()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t//register shipment server\n\tapi.RegisterShipmentServer(grpcServer, ShipmentServer)\n\n\t//start gRPC server\n\tgo func() {\n\t\tif err := grpcServer.Serve(listen); err != nil {\n\t\t\tcommon.Error.Fatalf(\"failed to serve: %v\", err)\n\t\t}\n\t}()\n\n\tif DISABLE_APISERVER != \"true\" {\n\t\tgwmux := runtime.NewServeMux()\n\n\t\tconn, err := grpc.DialContext(\n\t\t\tctx,\n\t\t\t\"0.0.0.0:\"+grpcPort,\n\t\t\tgrpc.WithBlock(),\n\t\t\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n\t\t\tgrpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize), grpc.MaxCallSendMsgSize(maxMsgSize)),\n\t\t)\n\n\t\tif err != nil {\n\t\t\tcommon.Error.Println(err)\n\t\t\treturn err\n\t\t}\n\n\t\terr = api.RegisterShipmentHandler(ctx, gwmux, conn)\n\t\tif err != nil {\n\t\t\tcommon.Error.Println(err)\n\t\t\treturn err\n\t\t}\n\n\t\tcommon.Info.Println(\"Starting API server on port \", common.GetAddress())\n\t\tapiServer := &http.Server{\n\t\t\tAddr: restAddress,\n\t\t\tWriteTimeout: timeoutValue,\n\t\t\tReadTimeout: timeoutValue,\n\t\t\tIdleTimeout: time.Second * 60,\n\t\t\tHandler: gwmux,\n\t\t}\n\t\tgo func() {\n\t\t\tif err := apiServer.ListenAndServe(); err != nil {\n\t\t\t\tcommon.Error.Println(err)\n\t\t\t}\n\t\t}()\n\n\t}\n\n\t// graceful shutdown\n\tc := make(chan os.Signal, 1)\n\t// We'll accept graceful shutdowns when quit via SIGINT (Ctrl+C)\n\t// SIGKILL, SIGQUIT or SIGTERM (Ctrl+/) will not be caught.\n\tsignal.Notify(c, os.Interrupt)\n\t// Block until we receive our signal.\n\t<-c\n\t// Create a deadline to wait for.\n\tctxDeadline, cancelDeadline := context.WithTimeout(context.Background(), wait)\n\tdefer cancelDeadline()\n\t// Doesn't block if no connections, but will otherwise wait\n\t// until the timeout deadline.\n\tgrpcServer.GracefulStop()\n\tif DISABLE_APISERVER != \"true\" && apiServer != nil {\n\t\terr = apiServer.Shutdown(ctxDeadline)\n\t}\n\tcommon.Info.Println(\"Shutting down\")\n\treturn err\n}", "title": "" }, { "docid": "0fc0990016895b708d4f6f6c993dd1dc", "score": "0.5308129", "text": "func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {\r\n\t_ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))\r\n}", "title": "" }, { "docid": "b35fdb4e4c3330a3b2dd72f5639c3a6c", "score": "0.5303388", "text": "func runGrpcServer(config *configs.Config) {\n\tlis, err := net.Listen(\"tcp\", config.GrpcAddr)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\n\topts, err := getGrpcServerOptions(config)\n\n\tif err != nil {\n\t\tlog.Fatalf(\"failed with %v\", err)\n\t}\n\n\tgrpcServer := grpc.NewServer(opts...)\n\n\tpb.RegisterEventMapperServer(grpcServer, createNewGrpcServer(config.MqUrl))\n\t// Register reflection service on gRPC server.\n\treflection.Register(grpcServer)\n\n\tif err := grpcServer.Serve(lis); err != nil {\n\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t}\n}", "title": "" }, { "docid": "7c85039547b1ebd074403c868120483e", "score": "0.5298671", "text": "func (ws *Service) Run(conf *config.WebAPIConfiguration, st *storage.Storage, ledger *ledger.Ledger) {\n\n\tws.down = make(chan bool, 1)\n\n\tws.server.Addr = conf.Interface + \":\" + strconv.Itoa(conf.Port)\n\tws.server.Handler = newRouter(conf, st, ledger)\n\tws.server.ReadTimeout = 15 * time.Second\n\tws.server.WriteTimeout = 15 * time.Second\n\n\tlog.Printf(\"Ploc web service is now listening on '%s'.\", ws.server.Addr)\n\n\tif err := ws.server.ListenAndServe(); err != http.ErrServerClosed {\n\t\tlog.Fatalf(\"Starting ploc web service has failed. %s\", err)\n\t}\n\n\t// Raise signal that service has shut down.\n\tws.down <- true\n}", "title": "" }, { "docid": "d4b89846d556dd38f96d2c2070f15d1b", "score": "0.52959657", "text": "func (b *B) run() {\n\tisDriver := IsDriver()\n\tif err := b.system.Init(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar err error\n\tb.client, err = rpc.NewClient(func() *http.Client { return b.system.HTTPClient() }, RpcPrefix)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tb.mu.Lock()\n\tb.running = true\n\tb.mu.Unlock()\n\tif isDriver {\n\t\treturn\n\t}\n\tb.server = rpc.NewServer()\n\tsupervisor := StartSupervisor(context.Background(), b, b.system, b.server)\n\tif err := b.server.Register(\"Supervisor\", supervisor); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := maybeInit(supervisor, b); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tmux := http.NewServeMux()\n\tmux.Handle(RpcPrefix, b.server)\n\tgo func() {\n\t\tlog.Fatal(b.system.ListenAndServe(\"\", mux))\n\t}()\n\tlog.Fatal(b.system.Main())\n\tpanic(\"not reached\")\n}", "title": "" }, { "docid": "744dcfef8dc632bd664a0a4f797ae0d5", "score": "0.52912205", "text": "func (g *GrpcServer) Run() error {\n\t// New Grpc Server\n\ts := grpc.NewServer()\n\t// Register controller service.\n\tpb.RegisterControllerServer(s, g)\n\t//pb.RegisterFileShareControllerServer(s, g)\n\n\t// Listen the controller server port.\n\tlis, err := net.Listen(\"tcp\", g.Port)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %+v\", err)\n\t\treturn err\n\t}\n\n\tlog.Info(\"osdslet server initialized! Start listening on port:\", lis.Addr())\n\n\t// Start controller server watching loop.\n\tdefer s.Stop()\n\treturn s.Serve(lis)\n}", "title": "" }, { "docid": "f559bb42c1767621bac8d60e8685d8ff", "score": "0.5283702", "text": "func Run() {\n\tflag.Parse()\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"0.0.0.0:%d\", *port))\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\tvar opts []grpc.ServerOption\n\tif *tls {\t\t// TODO make auth mandatory\n\t\tcreds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to generate credentials %v\", err)\n\t\t}\n\t\topts = []grpc.ServerOption{grpc.Creds(creds)}\n\t}\n\tgrpcServer := grpc.NewServer(opts...)\n\tpb.RegisterBrokerServer(grpcServer, newServer())\n\tlog.Println(\"BrokerServer is registered...Starting store\")\n\tstore.Init()\n\tgrpcServer.Serve(lis)\n}", "title": "" }, { "docid": "eebf660212268c71d05ba6f396d0ab21", "score": "0.52836376", "text": "func main() {\n\n\t// set the logger.\n\tgrpclog.SetLogger(log.New(os.Stdout, \"echo_service: \", log.LstdFlags))\n\n\t// Set the log information in case of crash...\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n\n\t// The first argument must be the port number to listen to.\n\tport := defaultPort // the default value.\n\n\tif len(os.Args) > 1 {\n\t\tport, _ = strconv.Atoi(os.Args[1]) // The second argument must be the port number\n\t}\n\n\t// First of all I will creat a listener.\n\tlis, err := net.Listen(\"tcp\", \"0.0.0.0:\"+strconv.Itoa(port))\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to listen: %v\", err)\n\t}\n\n\t// The actual server implementation.\n\ts_impl := new(server)\n\ts_impl.Name = Utility.GetExecName(os.Args[0])\n\ts_impl.Port = port\n\ts_impl.Proxy = defaultProxy\n\ts_impl.Protocol = \"grpc\"\n\n\t// TODO set it from the program arguments...\n\ts_impl.AllowAllOrigins = allow_all_origins\n\ts_impl.AllowedOrigins = allowed_origins\n\n\t// Here I will retreive the list of connections from file if there are some...\n\ts_impl.init()\n\n\tgrpcServer := grpc.NewServer()\n\techopb.RegisterEchoServiceServer(grpcServer, s_impl)\n\n\t// Here I will make a signal hook to interrupt to exit cleanly.\n\tgo func() {\n\t\tlog.Println(s_impl.Name + \" grpc service is starting\")\n\t\t// no web-rpc server.\n\t\tif err := grpcServer.Serve(lis); err != nil {\n\t\t\tlog.Fatalf(\"failed to serve: %v\", err)\n\t\t}\n\t\tlog.Println(s_impl.Name + \" grpc service is closed\")\n\t}()\n\n\t// Wait for signal to stop.\n\tch := make(chan os.Signal, 1)\n\tsignal.Notify(ch, os.Interrupt)\n\t<-ch\n\n}", "title": "" }, { "docid": "b1067f2ef0572c97fc5ef5fccace08ca", "score": "0.52820593", "text": "func (d *Driver) Run() {\n\tserver := &nonBlockingGRPCServer{}\n\tserver.Start(d.config.Endpoint, d, d, d)\n\tserver.Wait()\n}", "title": "" }, { "docid": "fc6c567b6dda8bc4c6a75427b695972c", "score": "0.52810776", "text": "func CreateGateway(ctx context.Context, muxOptions ...runtime.ServeMuxOption) (http.Handler, error) {\n\tmux := runtime.NewServeMux(muxOptions...)\n\n\tvar err error\n\n\t// Create client credentials with certificate if we are not on development\n\tvar service1Credentials credentials.TransportCredentials\n\tif config.Environment == \"development\" {\n\t\tservice1Credentials = credentials.NewTLS(&tls.Config{InsecureSkipVerify: true})\n\t} else {\n\t\tservice1Credentials, err = credentials.NewClientTLSFromFile(helpers.SSLCertPath(config.Service1ServiceName), \"\")\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Error in creating server credentials. %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Create service1 service dial options using the created credentials.\n\tservice1DialOptions := []grpc.DialOption{grpc.WithTransportCredentials(service1Credentials)}\n\n\t// Register the service1 service handler from endpoint using the created dial options.\n\terr = pb_service1.RegisterService1HandlerFromEndpoint(ctx, mux, config.Service1ServiceEndpoint, service1DialOptions)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error in registering end point. %v\", err)\n\t\treturn nil, err\n\t}\n\n\t// Create client credentials with certificate if we are not on development\n\tvar service2Credentials credentials.TransportCredentials\n\tif config.Environment == \"development\" {\n\t\tservice2Credentials = credentials.NewTLS(&tls.Config{InsecureSkipVerify: true})\n\t} else {\n\t\tservice2Credentials, err = credentials.NewClientTLSFromFile(helpers.SSLCertPath(config.Service2ServiceName), \"\")\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Error in creating server credentials. %v\", err)\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Create service2 service dial options using the created credentials.\n\tservice2DialOptions := []grpc.DialOption{grpc.WithTransportCredentials(service2Credentials)}\n\n\t// Register the service2 service handler from endpoint using the created dial options.\n\terr = pb_service2.RegisterService2HandlerFromEndpoint(ctx, mux, config.Service2ServiceEndpoint, service2DialOptions)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error in registering end point. %v\", err)\n\t\treturn nil, err\n\t}\n\n\treturn mux, nil\n}", "title": "" }, { "docid": "661ba30183abb863cf794228437c5fce", "score": "0.5276285", "text": "func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux) {\n\t_ = RegisterServiceHandlerClient(context.Background(), mux, NewServiceClient(clientConn))\n}", "title": "" }, { "docid": "1b5a2e7c11f5b5ce9098c3865ff6a932", "score": "0.5274528", "text": "func startMessageGateway() (uint16, error) {\n\treturn startServer(func(portChan chan int, errorChan chan error) {\n\t\tlogger.Info(\"starting message gateway\")\n\n\t\tlistener, err := net.Listen(\"tcp\", \":0\")\n\n\t\tif err != nil {\n\t\t\terrorChan <- errors.New(\"couldn't start message gateway on random port\")\n\t\t\treturn\n\t\t}\n\n\t\tport := listener.Addr().(*net.TCPAddr).Port\n\n\t\tlogger.Debug(\"started message gatway\",\n\t\t\t\"port\", port)\n\n\t\tportChan <- port\n\n\t\tfor {\n\t\t\tconn, err := listener.Accept()\n\t\t\tif err != nil {\n\t\t\t\tlogger.Warn(\"there was an error while accepting new connection to message gateway\",\n\t\t\t\t\t\"error\", err)\n\t\t\t\t_ = conn.Close()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tgo handleMessageClient(conn)\n\t\t}\n\t})\n}", "title": "" } ]
d69b57ec823528a035ea47fc256994ab
Patch applies the patch and returns the patched keycloakUser.
[ { "docid": "dc9f78e05915e0ca59d876fa296870be", "score": "0.73239625", "text": "func (c *FakeKeycloakUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.KeycloakUser, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(keycloakusersResource, c.ns, name, pt, data, subresources...), &v1alpha1.KeycloakUser{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.KeycloakUser), err\n}", "title": "" } ]
[ { "docid": "a7dd11c74e493b4ec39f766046c55580", "score": "0.62031335", "text": "func (c *Controller) Patch(context *gin.Context) {\n\tuserID, err := userParser.parseUserID(context)\n\tif err != nil {\n\t\tcontext.JSON(err.Status, err)\n\t\treturn\n\t}\n\n\tvar user *dto.User\n\tuser, err = userParser.parseUser(context)\n\tif err != nil {\n\t\tcontext.JSON(err.Status, err)\n\t\treturn\n\t}\n\tuser.ID = userID\n\n\ttarget, updateErr := c.service.PatchUser(*user)\n\tif updateErr != nil {\n\t\tcontext.JSON(updateErr.Status, updateErr)\n\t\treturn\n\t}\n\tisPublic := oauth.IsPublic(context.Request)\n\tcontext.JSON(http.StatusOK, target.Marshall(isPublic))\n}", "title": "" }, { "docid": "8a0309ba57c667bc911e3f393d12cb40", "score": "0.60931516", "text": "func UserPatch(c echo.Context) error {\n\tdefer c.Request().Body.Close()\n\terr := validatePermission(c, \"core_user_patch\")\n\tif err != nil {\n\t\treturn returnInvalidResponse(http.StatusForbidden, err, fmt.Sprintf(\"%s\", err))\n\t}\n\n\tuserID, _ := strconv.ParseUint(c.Param(\"id\"), 10, 64)\n\n\tuserM := models.User{}\n\tuserPayload := UserPayload{}\n\terr = userM.FindbyID(userID)\n\tif err != nil {\n\t\tnlogs.NLog(\"warning\", \"UserPatch\", map[string]interface{}{\"message\": \"error finding user\", \"error\": err}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusNotFound, err, fmt.Sprintf(\"User %v tidak ditemukan\", userID))\n\t}\n\torigin := userM\n\n\tpayloadRules := govalidator.MapData{\n\t\t\"username\": []string{},\n\t\t\"email\": []string{},\n\t\t\"phone\": []string{},\n\t\t\"roles\": []string{\"valid_id:roles\"},\n\t\t\"status\": []string{},\n\t}\n\tvalidate := validateRequestPayload(c, payloadRules, &userPayload)\n\tif validate != nil {\n\t\tnlogs.NLog(\"warning\", \"UserPatch\", map[string]interface{}{\"message\": \"validation error\", \"error\": validate}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusUnprocessableEntity, validate, \"Kesalahan Validasi\")\n\t}\n\n\tdb := covid19.App.DB\n\tvar count int\n\tdb.Table(\"roles\").Select(\"*\").\n\t\tWhere(\"roles.id IN (?)\", []int64(userPayload.Roles)).\n\t\tWhere(\"roles.system = ?\", \"Dashboard\").Count(&count)\n\n\tif len(userPayload.Roles) != count {\n\t\tnlogs.NLog(\"warning\", \"UserPatch\", map[string]interface{}{\"message\": \"invalid roles\", \"roles\": userPayload.Roles}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusUnprocessableEntity, nil, \"Roles tidak valid.\")\n\t}\n\n\tif len(userPayload.Username) > 0 {\n\t\tuserM.Username = userPayload.Username\n\t}\n\tif len(userPayload.Email) > 0 {\n\t\tuserM.Email = userPayload.Email\n\t}\n\tif len(userPayload.Phone) > 0 {\n\t\tuserM.Phone = userPayload.Phone\n\t}\n\tif len(userPayload.Status) > 0 {\n\t\tuserM.Status = userPayload.Status\n\t}\n\tif len(userPayload.Roles) > 0 {\n\t\tuserM.Roles = pq.Int64Array(userPayload.Roles)\n\t}\n\n\terr = userM.Save()\n\tif err != nil {\n\t\tnlogs.NLog(\"error\", \"UserPatch\", map[string]interface{}{\"message\": \"error saving user\", \"error\": err}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusInternalServerError, err, fmt.Sprintf(\"Gagal update User %v\", userID))\n\t}\n\n\tnlogs.NAudittrail(origin, userM, c.Get(\"user\").(*jwt.Token), \"user\", fmt.Sprint(userM.ID), \"update\")\n\n\treturn c.JSON(http.StatusOK, userM)\n}", "title": "" }, { "docid": "e7c4e1de3944d40001bae98e692dcebf", "score": "0.5784818", "text": "func (e Endpoints) Patch(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User) {\n\trequest := PatchRequest{\n\t\tId: id,\n\t\tUser: user,\n\t}\n\tresponse, err := e.PatchEndpoint(ctx, request)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn response.(PatchResponse).Status, response.(PatchResponse).Errinfo, response.(PatchResponse).Data\n}", "title": "" }, { "docid": "5582821746fecc4eb51d77ccf90838a7", "score": "0.5778657", "text": "func (c *FakeObjectStoreUsers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ObjectStoreUser, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(objectstoreusersResource, c.ns, name, data, subresources...), &v1beta1.ObjectStoreUser{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1beta1.ObjectStoreUser), err\n}", "title": "" }, { "docid": "58514994c2768fe71ee52056318db880", "score": "0.5711462", "text": "func (c *awsIamUserPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.AwsIamUserPolicy, err error) {\n\tresult = &v1.AwsIamUserPolicy{}\n\terr = c.client.Patch(pt).\n\t\tNamespace(c.ns).\n\t\tResource(\"awsiamuserpolicies\").\n\t\tSubResource(subresources...).\n\t\tName(name).\n\t\tBody(data).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "d170d6deb6661016f0d46f2e2030cd1a", "score": "0.5372111", "text": "func (s *namespacedSshAuthClient) Patch(o *v3.NamespacedSSHAuth, patchType types.PatchType, data []byte, subresources ...string) (*v3.NamespacedSSHAuth, error) {\n\tobj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)\n\treturn obj.(*v3.NamespacedSSHAuth), err\n}", "title": "" }, { "docid": "d3e3e1558c5923a9c29606c64f34cbf7", "score": "0.5317301", "text": "func (c *FakeKeycloakUsers) Update(ctx context.Context, keycloakUser *v1alpha1.KeycloakUser, opts v1.UpdateOptions) (result *v1alpha1.KeycloakUser, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewUpdateAction(keycloakusersResource, c.ns, keycloakUser), &v1alpha1.KeycloakUser{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.KeycloakUser), err\n}", "title": "" }, { "docid": "ed9c765763fbf73d75174b710d9ac87c", "score": "0.52552545", "text": "func DefaultPatchUser(ctx context.Context, in *User, updateMask *field_mask1.FieldMask, db *gorm1.DB) (*User, error) {\n\tif in == nil {\n\t\treturn nil, errors1.NilArgumentError\n\t}\n\tvar pbObj User\n\tvar err error\n\tif hook, ok := interface{}(&pbObj).(UserWithBeforePatchRead); ok {\n\t\tif db, err = hook.BeforePatchRead(ctx, in, updateMask, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tpbReadRes, err := DefaultReadUser(ctx, &User{Id: in.GetId()}, db)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpbObj = *pbReadRes\n\tif hook, ok := interface{}(&pbObj).(UserWithBeforePatchApplyFieldMask); ok {\n\t\tif db, err = hook.BeforePatchApplyFieldMask(ctx, in, updateMask, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif _, err := DefaultApplyFieldMaskUser(ctx, &pbObj, in, updateMask, \"\", db); err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&pbObj).(UserWithBeforePatchSave); ok {\n\t\tif db, err = hook.BeforePatchSave(ctx, in, updateMask, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tpbResponse, err := DefaultStrictUpdateUser(ctx, &pbObj, db)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(pbResponse).(UserWithAfterPatchSave); ok {\n\t\tif err = hook.AfterPatchSave(ctx, in, updateMask, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn pbResponse, nil\n}", "title": "" }, { "docid": "a76da4193a9b813a981c37005e3b0bad", "score": "0.5159557", "text": "func (o *operator) Patch(user, resource, name string, data []byte) (runtime.Object, error) {\n\n\tif user != \"\" {\n\t\tif resource == v2beta2.ResourcesPluralRouter ||\n\t\t\tresource == v2beta2.ResourcesPluralNotificationManager {\n\t\t\treturn nil, errors.NewForbidden(v2beta2.Resource(resource), \"\",\n\t\t\t\tfmt.Errorf(\"tenant can not update %s\", resource))\n\t\t}\n\t}\n\n\t_, err := o.Get(user, resource, name, \"\")\n\tif err != nil {\n\t\tklog.Error(err)\n\t\treturn nil, err\n\t}\n\n\tswitch resource {\n\tcase v2beta2.ResourcesPluralNotificationManager:\n\t\treturn o.ksClient.NotificationV2beta2().NotificationManagers().Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tcase v2beta2.ResourcesPluralConfig:\n\t\treturn o.ksClient.NotificationV2beta2().Configs().Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tcase v2beta2.ResourcesPluralReceiver:\n\t\treturn o.ksClient.NotificationV2beta2().Receivers().Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tcase v2beta2.ResourcesPluralRouter:\n\t\treturn o.ksClient.NotificationV2beta2().Routers().Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tcase v2beta2.ResourcesPluralSilence:\n\t\treturn o.ksClient.NotificationV2beta2().Silences().Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tcase Secret:\n\t\treturn o.k8sClient.CoreV1().Secrets(constants.NotificationSecretNamespace).Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tcase ConfigMap:\n\t\treturn o.k8sClient.CoreV1().ConfigMaps(constants.NotificationSecretNamespace).Patch(context.Background(), name, types.MergePatchType, data, v1.PatchOptions{})\n\tdefault:\n\t\treturn nil, errors.NewInternalError(nil)\n\t}\n}", "title": "" }, { "docid": "1145c49e5fa6925716cf5eb0e848a6c9", "score": "0.51318234", "text": "func (s *ScalewayAPI) PatchUserSSHKey(UserID string, definition ScalewayUserPatchSSHKeyDefinition) error {\n\tresp, err := s.PatchResponse(AccountAPI, fmt.Sprintf(\"users/%s\", UserID), definition)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tif _, err := s.handleHTTPError([]int{http.StatusOK}, resp); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f9ccd5bf5d6b1c25048face73d752634", "score": "0.5064111", "text": "func (group *JoyAuthorizeGroup) PATCH(relativePath string, permission string, handlers ...gin.HandlerFunc) gin.IRoutes {\n\tgroup.registerHandlerPermission(permission, handlers...)\n\treturn group.GinGroup.PATCH(relativePath, handlers...)\n}", "title": "" }, { "docid": "b5937f6c4c28656a3009ba73de50c155", "score": "0.50257534", "text": "func (a *Client) ModifyUser(params *ModifyUserParams, authInfo runtime.ClientAuthInfoWriter) (*ModifyUserOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewModifyUserParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"modifyUser\",\n\t\tMethod: \"PATCH\",\n\t\tPathPattern: \"/v4/users/{email}/\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &ModifyUserReader{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.(*ModifyUserOK), nil\n\n}", "title": "" }, { "docid": "64bae7684f77384c3acdc6931ae8deab", "score": "0.50166255", "text": "func patchUser(c *gin.Context) {\n\tlog.Info(\"[Function] patchUser\")\n\n\tvar user mongoDB.User\n\n\tsocialNumber := c.Request.Header.Get(\"socialNumber\")\n\tjson.NewDecoder(c.Request.Body).Decode(&user)\n\n\tlogRequest(c.Request.Header, user)\n\n\tif socialNumber != user.SocialNumber{\n\t\terr := errorStatus.ErrorSocialNumberCannotBeChanged()\n\t\tc.JSON(err.HTTPStatus, err)\n\t\tlog.Info(toJSON(err))\n\t\treturn\n\t}\n\n\tif user.Name == \"\" && user.Age == \"\" && user.Phones == nil &&\n\t\tuser.Address.Country == \"\" && user.Address.State == \"\" && user.Address.StreetName == \"\" &&\n\t\tuser.Address.ZipCode == \"\" && user.Address.StreetNumber == \"\"{\n\t\tem := errorStatus.ErrorMissingBodyValues()\n\t\tc.JSON(em.HTTPStatus, em)\n\t\tlog.Info(toJSON(em))\n\t\treturn\n\t}\n\tif socialNumber == \"\"{\n\t\tem := errorStatus.ErrorMissingHeaderValues()\n\t\tc.JSON(em.HTTPStatus, em)\n\t\tlog.WithFields(log.Fields{\"socialNumber\": socialNumber}).Info(toJSON(em))\n\t\treturn\n\t}\n\terr := service.PatchUserService(socialNumber, user)\n\tif err.HTTPStatus != 200 {\n\t\tc.JSON(err.HTTPStatus, err)\n\t} else {\n\t\tc.JSON(err.HTTPStatus, \"User Permissions Updated.\")\n\t}\n\tlog.Info(toJSON(err))\n}", "title": "" }, { "docid": "2140647c3da7dcc6e3c90b8587243ed8", "score": "0.4922629", "text": "func (c *Credentials) Patch(apiVersion, apiEndpoint string, config interface{}, timeout ...int) (interface{}, error) {\n\n\thttpTimeout := httpTimeout(timeout)\n\n\tapiRequest, err := c.commonAPI(\"PATCH\", apiVersion, apiEndpoint, config, httpTimeout)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn apiRequest, nil\n\n}", "title": "" }, { "docid": "d57d03090e19cb61cd2116f047e24067", "score": "0.49043548", "text": "func (s *ScalewayAPI) PatchUserdata(serverID, key string, value []byte, metadata bool) error {\n\tvar resource, endpoint string\n\n\tendpoint = s.computeAPI\n\tif metadata {\n\t\tresource = fmt.Sprintf(\"/user_data/%s\", key)\n\t\tendpoint = MetadataAPI\n\t} else {\n\t\tresource = fmt.Sprintf(\"servers/%s/user_data/%s\", serverID, key)\n\t}\n\n\turi := fmt.Sprintf(\"%s/%s\", strings.TrimRight(endpoint, \"/\"), resource)\n\tpayload := new(bytes.Buffer)\n\tpayload.Write(value)\n\n\treq, err := http.NewRequest(\"PATCH\", uri, payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.Header.Set(\"X-Auth-Token\", s.Token)\n\treq.Header.Set(\"Content-Type\", \"text/plain\")\n\treq.Header.Set(\"User-Agent\", s.userAgent)\n\n\ts.LogHTTP(req)\n\n\tresp, err := s.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == http.StatusNoContent {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"cannot set user_data (%d)\", resp.StatusCode)\n}", "title": "" }, { "docid": "e3eb71700173e23f53e58a5e7616474a", "score": "0.48770222", "text": "func (r *EntitlementsService) Patch(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsPatchCall {\n\treturn &EntitlementsPatchCall{\n\t\ts: r.s,\n\t\tenterpriseId: enterpriseId,\n\t\tuserId: userId,\n\t\tentitlementId: entitlementId,\n\t\tentitlement: entitlement,\n\t\tcaller_: googleapi.JSONCall{},\n\t\tparams_: make(map[string][]string),\n\t\tpathTemplate_: \"enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}\",\n\t\tcontext_: googleapi.NoContext,\n\t}\n}", "title": "" }, { "docid": "5b3355e8be4229b40240ab24a84890ed", "score": "0.48732492", "text": "func GetPatchUser(gitHubUID int) (*DBUser, error) {\n\tu, err := FindByGithubUID(gitHubUID)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"finding user by GitHub UID\")\n\t}\n\tif u == nil {\n\t\t// set to a default user\n\t\tu, err = FindOne(ById(evergreen.GithubPatchUser))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"getting user for PR\")\n\t\t}\n\t\t// default user doesn't exist yet\n\t\tif u == nil {\n\t\t\tu = &DBUser{\n\t\t\t\tId: evergreen.GithubPatchUser,\n\t\t\t\tDispName: \"GitHub Pull Requests\",\n\t\t\t\tAPIKey: utility.RandomString(),\n\t\t\t}\n\t\t\tif err = u.Insert(); err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"creating GitHub patch user\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn u, nil\n}", "title": "" }, { "docid": "43aadcd4cad74ca29baf8f044efdbfdd", "score": "0.48666453", "text": "func (f *FakeSecret) Patch(context.Context, string, types.PatchType, []byte, metav1.PatchOptions, ...string) (*v1.Secret, error) {\n\treturn &v1.Secret{}, nil\n}", "title": "" }, { "docid": "1855e1412e85b9a8309705e6a6efc00c", "score": "0.4861457", "text": "func (c *Caller) PATCH() ([]byte, error) {\n\treturn invoke(value{\n\t\tURL: c.URL,\n\t\tMethod: http.MethodPatch,\n\t\tBody: c.Body,\n\t\tHeader: c.Header,\n\t\tClient: c.Client,\n\t})\n}", "title": "" }, { "docid": "65579a28dab597a90cae11a7828f0f6d", "score": "0.48378694", "text": "func (r *CollectionviewersService) Patch(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersPatchCall {\n\treturn &CollectionviewersPatchCall{\n\t\ts: r.s,\n\t\tenterpriseId: enterpriseId,\n\t\tcollectionId: collectionId,\n\t\tuserId: userId,\n\t\tuser: user,\n\t\tcaller_: googleapi.JSONCall{},\n\t\tparams_: make(map[string][]string),\n\t\tpathTemplate_: \"enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}\",\n\t\tcontext_: googleapi.NoContext,\n\t}\n}", "title": "" }, { "docid": "0f4b966d121c1dd192a3ff5c982fb27a", "score": "0.48326713", "text": "func (r *InstallsService) Patch(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsPatchCall {\n\treturn &InstallsPatchCall{\n\t\ts: r.s,\n\t\tenterpriseId: enterpriseId,\n\t\tuserId: userId,\n\t\tdeviceId: deviceId,\n\t\tinstallId: installId,\n\t\tinstall: install,\n\t\tcaller_: googleapi.JSONCall{},\n\t\tparams_: make(map[string][]string),\n\t\tpathTemplate_: \"enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}\",\n\t\tcontext_: googleapi.NoContext,\n\t}\n}", "title": "" }, { "docid": "2d3d2549c5cd41969d6f55407d809cfd", "score": "0.4824645", "text": "func (c *FakeStorageBackendClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *xuanwuv1.StorageBackendClaim, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(storagebackendclaimsResource, c.ns, name, pt, data, subresources...), &xuanwuv1.StorageBackendClaim{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*xuanwuv1.StorageBackendClaim), err\n}", "title": "" }, { "docid": "1d4677c6868ecdf68c65d89bae6b8cc4", "score": "0.48142496", "text": "func (a *Client) ModifyUser(params *ModifyUserParams, authInfo runtime.ClientAuthInfoWriter) (*ModifyUserOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewModifyUserParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"modifyUser\",\n\t\tMethod: \"PATCH\",\n\t\tPathPattern: \"/users/{name}\",\n\t\tProducesMediaTypes: []string{\"application/json\", \"application/x-gzip\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &ModifyUserReader{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.(*ModifyUserOK), nil\n\n}", "title": "" }, { "docid": "4fbf10cb8120231a3355564f5a0e3758", "score": "0.4799073", "text": "func (c *UserService) Update(user *User) (*User, *http.Response, error) {\n\trestful := Restful{}\n\tupdatedUser := new(User)\n\tpath := NewIdentityResourcePath(user.GetResourceId(), user)\n\tresp, err := restful.\n\t\tPatch(path.Path()).\n\t\tBody(user).\n\t\tJson(updatedUser).\n\t\tClient(c.client).\n\t\tDo()\n\treturn updatedUser, resp, err\n}", "title": "" }, { "docid": "64b1ab10831b4745133f713818ef761b", "score": "0.47714108", "text": "func (c *UserClient) Update(ctx context.Context, guid string, r *resource.UserUpdate) (*resource.User, error) {\n\tvar user resource.User\n\t_, err := c.client.patch(ctx, path.Format(\"/v3/users/%s\", guid), r, &user)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &user, nil\n}", "title": "" }, { "docid": "d91dcff0c5939448a46f9fd942e7f664", "score": "0.4767589", "text": "func (a *Client) ModifyPassword(params *ModifyPasswordParams, authInfo runtime.ClientAuthInfoWriter) (*ModifyPasswordAccepted, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewModifyPasswordParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"modifyPassword\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/v4/users/{email}/password/\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &ModifyPasswordReader{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.(*ModifyPasswordAccepted), nil\n\n}", "title": "" }, { "docid": "aa8034c108db1175a1fe8c1a21984a87", "score": "0.47667006", "text": "func (c *Controller) PatchAll(_ context.Context, _ url.Values, cf func(interface{}) error) (interface{}, error) {\n\tauth := new(Auth)\n\tif err := cf(auth); err != nil {\n\t\treturn nil, err\n\t}\n\treturn auth, auth.RefreshToken()\n}", "title": "" }, { "docid": "575c481fe58dc3dc8cf82b811ae6df5a", "score": "0.47656056", "text": "func (c *dryRunProwJobClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *prowapi.ProwJob, err error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "316ac4480dca350e7bce70bdaa472500", "score": "0.47628635", "text": "func DefaultPatchSetUser(ctx context.Context, objects []*User, updateMasks []*field_mask1.FieldMask, db *gorm1.DB) ([]*User, error) {\n\tif len(objects) != len(updateMasks) {\n\t\treturn nil, fmt.Errorf(errors1.BadRepeatedFieldMaskTpl, len(updateMasks), len(objects))\n\t}\n\n\tresults := make([]*User, 0, len(objects))\n\tfor i, patcher := range objects {\n\t\tpbResponse, err := DefaultPatchUser(ctx, patcher, updateMasks[i], db)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresults = append(results, pbResponse)\n\t}\n\n\treturn results, nil\n}", "title": "" }, { "docid": "3428c36d9935479476609b1ffbaf5693", "score": "0.475868", "text": "func (_e *Client_Expecter) Patch(ctx interface{}, request interface{}) *Client_Patch_Call {\n\treturn &Client_Patch_Call{Call: _e.mock.On(\"Patch\", ctx, request)}\n}", "title": "" }, { "docid": "03ef861c4b05235665446ba36ff05683", "score": "0.47414058", "text": "func NewPatchUserForbidden() *PatchUserForbidden {\n\treturn &PatchUserForbidden{}\n}", "title": "" }, { "docid": "1a21ffa205c09f7eb8315d2ad97214ee", "score": "0.4740435", "text": "func (fms *FakeMockStore) Update(id int64, updates *Updates) (*User, error) {\n\tif fms.expectedErr {\n\t\treturn &User{}, fmt.Errorf(\"error when receiving fake mock store user by id\")\n\t}\n\n\terr := fms.User.ApplyUpdates(updates)\n\tif err != nil {\n\t\treturn &User{}, fmt.Errorf(\"error when applying fake mock store user updates\")\n\t}\n\treturn fms.User, nil\n}", "title": "" }, { "docid": "9aeaa9b74e4de3585505fbdda59bfbbb", "score": "0.47335082", "text": "func (a *Client) ChangeUserPassword(params *ChangeUserPasswordParams, authInfo runtime.ClientAuthInfoWriter) (*ChangeUserPasswordOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewChangeUserPasswordParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"ChangeUserPassword\",\n\t\tMethod: \"PATCH\",\n\t\tPathPattern: \"/users/{userId}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &ChangeUserPasswordReader{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\tsuccess, ok := result.(*ChangeUserPasswordOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for ChangeUserPassword: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "11f70e32b8c3d727fd31c8fc0b89f1ab", "score": "0.47319266", "text": "func EditUser(c *gin.Context) {\n\tvar user = models.User{}.MapRequestToUser(c)\n\n\tuser.ID = helpers.GrabIDParamAndConvertToUInt(c)\n\n\tresult := models.DB.Save(&user)\n\n\t// Patch does not care whether rows rows were affected or not.\n\n\tif result.Error != nil {\n\t\tc.JSON(http.StatusBadRequest, helpers.BadRequest())\n\t\treturn\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\"data\": helpers.Results{\n\t\tCount: 1,\n\t\tResults: user,\n\t}})\n}", "title": "" }, { "docid": "dd527ccd9dbfe2e266bdf56136649282", "score": "0.47275603", "text": "func updateUserPassword(ctx iris.Context) {\n\tpayload := updatePasswordPayload{}\n\terr := decodePayloadAndValidate(ctx, &payload)\n\tif err != nil {\n\t\thandleError(ctx, apiErrors.ErrUnprocessable)\n\t\treturn\n\t}\n\n\t// Validate requesting user matches requested user to be updated\n\terr = mustMatchContextUser(ctx, payload.UserID)\n\tif err != nil {\n\t\thandleError(ctx, apiErrors.ErrForbiden)\n\t\treturn\n\t}\n\n\tclaimedUser, err := store.GetUserByID(payload.UserID)\n\tif err != nil {\n\t\thandleError(ctx, err)\n\t\treturn\n\t}\n\n\tif err := bcrypt.CompareHashAndPassword([]byte(claimedUser.Password), []byte(payload.OldPassword)); err != nil {\n\t\thandleError(ctx, apiErrors.ErrForbiden)\n\t\treturn\n\t}\n\n\tclaimedUser.Password = payload.NewPassword\n\terrs := claimedUser.Validate()\n\tif errs != nil {\n\t\trender.Error(ctx, iris.StatusUnprocessableEntity, errs)\n\t\treturn\n\t}\n\n\tnewPasswordHash, err := bcrypt.GenerateFromPassword([]byte(claimedUser.Password), bcrypt.DefaultCost)\n\tif err != nil {\n\t\thandleError(ctx, err)\n\t\treturn\n\t}\n\n\tclaimedUser.Password = string(newPasswordHash)\n\n\tresult, err := store.UpdateUserPassword(*claimedUser)\n\tif err != nil {\n\t\thandleError(ctx, err)\n\t\treturn\n\t}\n\n\t// Hide password\n\tresult.Password = \"\"\n\trender.JSON(ctx, iris.StatusOK, result)\n}", "title": "" }, { "docid": "b51741be0e22a40f7f15861d42fe96db", "score": "0.46946147", "text": "func (c *FakeInstallations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Installation, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(installationsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Installation{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.Installation), err\n}", "title": "" }, { "docid": "6f22f7e335c9fc1f691ad3b3e993f10f", "score": "0.4679464", "text": "func (r *UserRequest) Update(ctx context.Context, reqObj *User) error {\n\treturn r.JSONRequest(ctx, \"PATCH\", \"\", reqObj, nil)\n}", "title": "" }, { "docid": "4987f4d355db949a2ef6057120ccf091", "score": "0.46794075", "text": "func (client *EncryptionScopesClient) Patch(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesPatchOptions) (EncryptionScopeResponse, error) {\n\treq, err := client.patchCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, encryptionScope, options)\n\tif err != nil {\n\t\treturn EncryptionScopeResponse{}, err\n\t}\n\tresp, err := client.con.Pipeline().Do(req)\n\tif err != nil {\n\t\treturn EncryptionScopeResponse{}, err\n\t}\n\tif !resp.HasStatusCode(http.StatusOK) {\n\t\treturn EncryptionScopeResponse{}, client.patchHandleError(resp)\n\t}\n\treturn client.patchHandleResponse(resp)\n}", "title": "" }, { "docid": "89a49a419c1c9f445338229939dbc257", "score": "0.4676046", "text": "func (r *RetryClient) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error {\n\treturn Retry(ctx, func(ctx context.Context) error {\n\t\treturn r.Client.Patch(ctx, obj, patch, opts...)\n\t}, IsJSONSyntaxError)\n}", "title": "" }, { "docid": "f7ba2661b6deab93cc61fc1273e1c5f2", "score": "0.46752095", "text": "func DefaultStrictUpdateUser(ctx context.Context, in *User, db *gorm1.DB) (*User, error) {\n\tif in == nil {\n\t\treturn nil, fmt.Errorf(\"Nil argument to DefaultStrictUpdateUser\")\n\t}\n\tormObj, err := in.ToORM(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlockedRow := &UserORM{}\n\tdb.Model(&ormObj).Set(\"gorm:query_option\", \"FOR UPDATE\").Where(\"id=?\", ormObj.Id).First(lockedRow)\n\tif hook, ok := interface{}(&ormObj).(UserORMWithBeforeStrictUpdateCleanup); ok {\n\t\tif db, err = hook.BeforeStrictUpdateCleanup(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfilterProfile := ProfileORM{}\n\tif ormObj.Id == go_uuid1.Nil {\n\t\treturn nil, errors1.EmptyIdError\n\t}\n\tfilterProfile.UserId = new(go_uuid1.UUID)\n\t*filterProfile.UserId = ormObj.Id\n\tif err = db.Where(filterProfile).Delete(ProfileORM{}).Error; err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&ormObj).(UserORMWithBeforeStrictUpdateSave); ok {\n\t\tif db, err = hook.BeforeStrictUpdateSave(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err = db.Save(&ormObj).Error; err != nil {\n\t\treturn nil, err\n\t}\n\tif hook, ok := interface{}(&ormObj).(UserORMWithAfterStrictUpdateSave); ok {\n\t\tif err = hook.AfterStrictUpdateSave(ctx, db); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tpbResponse, err := ormObj.ToPB(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pbResponse, err\n}", "title": "" }, { "docid": "4bc23fdbeb5afdca64b0d74fd7430e0e", "score": "0.46702555", "text": "func (s *applicationClient) Patch(o *Application, patchType types.PatchType, data []byte, subresources ...string) (*Application, error) {\n\tobj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)\n\treturn obj.(*Application), err\n}", "title": "" }, { "docid": "ff881cd8e1d160aa2e77fbdc8caeb264", "score": "0.46285176", "text": "func (rest *RestCli) Patch() *RestCli {\n\trest.method = \"PATCH\"\n\treturn rest\n}", "title": "" }, { "docid": "f973b4375adb7bb183d36729d7dff89d", "score": "0.4622774", "text": "func (m *MeRequestBuilder) Patch(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable, requestConfiguration *MeRequestBuilderPatchRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable, error) {\n requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.requestAdapter.SendAsync(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateEducationUserFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.EducationUserable), nil\n}", "title": "" }, { "docid": "b41e1c3e2f93417418a87eb2ce47e3e9", "score": "0.4621896", "text": "func (k *K8Client) Patch(ctx context.Context, obj runtime.Object, patch client.Patch, opts ...client.PatchOption) error {\n\targs := k.Mock.Called(ctx, obj, patch, opts)\n\treturn args.Error(0)\n}", "title": "" }, { "docid": "6401c02a07195078d279fd4ed03c3423", "score": "0.46180186", "text": "func UpdatePassword(c *fiber.Ctx) error {\r\n\r\n\tvar data map[string]string\r\n\tif err := c.BodyParser(&data); err != nil {\r\n\t\treturn err\r\n\t}\r\n\tif data[\"password\"] != data[\"password_confirm\"] {\r\n\t\tc.Status(400)\r\n\t\treturn c.JSON(fiber.Map{\r\n\t\t\t\"menssaje\": \"Password incorrecta\",\r\n\t\t})\r\n\t}\r\n\tcookie := c.Cookies(\"jwt\")\r\n\r\n\tid, _ := utils.ParseJwt(cookie)\r\n\r\n\tuserId, _ := strconv.Atoi(id)\r\n\r\n\tuser := models.User{\r\n\t\tId: uint(userId),\r\n\t}\r\n\r\n\tuser.SetPassword(data[\"password\"])\r\n\r\n\tdatabase.DB.Model(&user).Updates(user)\r\n\r\n\treturn c.JSON(user)\r\n\r\n}", "title": "" }, { "docid": "d7b7765b511a88631e2d44b04794147c", "score": "0.46170592", "text": "func (m *ServicePrincipalItemRequestBuilder) Patch(ctx context.Context, body iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ServicePrincipalable, requestConfiguration *ServicePrincipalItemRequestBuilderPatchRequestConfiguration)(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ServicePrincipalable, error) {\n requestInfo, err := m.CreatePatchRequestInformation(ctx, body, requestConfiguration);\n if err != nil {\n return nil, err\n }\n errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings {\n \"4XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n \"5XX\": ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a.CreateODataErrorFromDiscriminatorValue,\n }\n res, err := m.requestAdapter.SendAsync(ctx, requestInfo, iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.CreateServicePrincipalFromDiscriminatorValue, errorMapping)\n if err != nil {\n return nil, err\n }\n if res == nil {\n return nil, nil\n }\n return res.(iadcd81124412c61e647227ecfc4449d8bba17de0380ddda76f641a29edf2b242.ServicePrincipalable), nil\n}", "title": "" }, { "docid": "bf52316c1c842c8fe81966387b0d2a54", "score": "0.46161765", "text": "func (s service) Update(ctx context.Context, req *usersProto.UpdateUserRequest) (*usersProto.User, error) {\n\tif err := ValidateUpdateRequest(req); err != nil {\n\t\treturn nil, err\n\t}\n\n\tuser, err := s.repo.Get(ctx, req.Uuid)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnow := time.Now()\n\n\tuser.Username = req.Username\n\tuser.Email = req.Email\n\tuser.Enable = req.Enable\n\tuser.UpdatedAt = now\n\n\tuserModel := entity.User{\n\t\tID: user.ID,\n\t\tUUID: user.UUID,\n\t\tUsername: req.Username,\n\t\tPassword: user.Password,\n\t\tEmail: req.Email,\n\t\tEnable: req.Enable,\n\t\tCreatedAt: user.CreatedAt,\n\t\tUpdatedAt: now,\n\t}\n\n\tif err := s.repo.Update(ctx, userModel); err != nil {\n\t\treturn nil, err\n\t}\n\treturn user.ToProto(true /*secure*/), nil\n}", "title": "" }, { "docid": "6b5420f3449ba10dc02644d0e73a3d8e", "score": "0.46122497", "text": "func (s *Server) Patch(ctx context.Context, in *pb.KeyEntityRequest) (*pb.CommandResponse, error) {\n\tport := new(dto.Port)\n\terr := s.repository.FindOne(ctx, in.GetKey(), port)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = unmarshalAndValidateKeyEntity(port, in)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = s.repository.ReplaceOne(ctx, in.GetKey(), port)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"failed to update value in db: %w\", err)\n\t\treturn nil, err\n\t}\n\n\treturn newCommandResponse(1), nil\n}", "title": "" }, { "docid": "e6b13ef7fcd8467de841092f601cad37", "score": "0.46044523", "text": "func (u *UserDBService) EditUser(user *models.User) models.User {\n\tuserInstance := models.User{}\n\tdbConn.Where(\"login = ?\", user.Login).Take(&userInstance)\n\tif user.Username != \"\" {\n\t\tuserInstance.Username = user.Username\n\t}\n\tif user.Email != \"\" {\n\t\tuserInstance.Email = user.Email\n\t}\n\tif user.Password != \"\" {\n\t\tuserInstance.Password = user.Password\n\t}\n\tif userInstance.Status {\n\t\tdbConn.Save(&userInstance)\n\t\tlog.Printf(\"User with login %s was updated\", userInstance.Login)\n\t\treturn userInstance\n\t}\n\tuserInstance.Status = false\n\treturn userInstance\n}", "title": "" }, { "docid": "a20381a8d2510869eb210af673963f2c", "score": "0.46043336", "text": "func (c *Client) Patch() *Request {\n\treq := c.Request()\n\treq.Method(\"PATCH\")\n\treturn req\n}", "title": "" }, { "docid": "8d2f0202a11c14ac888f2873825fceba", "score": "0.46034738", "text": "func (o *PatchedUserAdminUpdate) GetPassword() string {\n\tif o == nil || IsNil(o.Password) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Password\n}", "title": "" }, { "docid": "53b56fe58579fb6a653265dc741cc43b", "score": "0.45983514", "text": "func (app *userService) Update(original users.User, updated users.User, originalPass string) error {\n\treturn nil\n}", "title": "" }, { "docid": "9dfb395a2cc0f071c57ffd38feddc1ac", "score": "0.45964688", "text": "func (c UserResource) Update(obj interface{}, r api2go.Request) (api2go.Responder, error) {\n\tuser, ok := obj.(models.User)\n\tif !ok {\n\t\treturn &api2go.Response{}, api2go.NewHTTPError(errors.New(\"Invalid instance given\"), \"Invalid instance given\", http.StatusBadRequest)\n\t}\n\terr := c.UserStorage.Update(user)\n\treturn &api2go.Response{Res: user, Code: http.StatusNoContent}, err\n}", "title": "" }, { "docid": "f20570e656857844436c60bba91377b6", "score": "0.4586135", "text": "func (app *userService) UpdateWithPassword(original users.User, updated users.User, originalPass string, updatedPassword string) error {\n\treturn nil\n}", "title": "" }, { "docid": "eb93956efc73af29540a5b6df6aee259", "score": "0.45785743", "text": "func getGeneratedKeycloakUser(ctx context.Context, serverClient k8sclient.Client, ns string, tsUser *User) (*keycloak.KeycloakUser, error) {\n\n\tvar users keycloak.KeycloakUserList\n\n\tlistOptions := []k8sclient.ListOption{\n\t\tk8sclient.MatchingLabels(rhsso.GetInstanceLabels()),\n\t\tk8sclient.InNamespace(ns),\n\t}\n\terr := serverClient.List(ctx, &users, listOptions...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i := range users.Items {\n\t\tkcUser := users.Items[i]\n\t\tif tsUserIDInKc(tsUser, &kcUser) {\n\t\t\treturn &kcUser, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"Genrated Keycloak user was not found\")\n}", "title": "" }, { "docid": "5c3555a033bd0d43fdbb99cfc6bc69ea", "score": "0.45690334", "text": "func (client Client) patch(response interface{}, path string, request interface{}) error {\n\treturn client.submitForm(response, path, request, \"PATCH\", true /* encodeJSON */)\n}", "title": "" }, { "docid": "a8667ce77fd49fa385a744eaca157c7d", "score": "0.4568686", "text": "func (client GroupClient) Patch(resourceGroupName string, webServiceName string, patchPayload WebService, cancel <-chan struct{}) (<-chan WebService, <-chan error) {\n\tresultChan := make(chan WebService, 1)\n\terrChan := make(chan error, 1)\n\tgo func() {\n\t\tvar err error\n\t\tvar result WebService\n\t\tdefer func() {\n\t\t\tif err != nil {\n\t\t\t\terrChan <- err\n\t\t\t}\n\t\t\tresultChan <- result\n\t\t\tclose(resultChan)\n\t\t\tclose(errChan)\n\t\t}()\n\t\treq, err := client.PatchPreparer(resourceGroupName, webServiceName, patchPayload, cancel)\n\t\tif err != nil {\n\t\t\terr = autorest.NewErrorWithError(err, \"webservices.GroupClient\", \"Patch\", nil, \"Failure preparing request\")\n\t\t\treturn\n\t\t}\n\n\t\tresp, err := client.PatchSender(req)\n\t\tif err != nil {\n\t\t\tresult.Response = autorest.Response{Response: resp}\n\t\t\terr = autorest.NewErrorWithError(err, \"webservices.GroupClient\", \"Patch\", resp, \"Failure sending request\")\n\t\t\treturn\n\t\t}\n\n\t\tresult, err = client.PatchResponder(resp)\n\t\tif err != nil {\n\t\t\terr = autorest.NewErrorWithError(err, \"webservices.GroupClient\", \"Patch\", resp, \"Failure responding to request\")\n\t\t}\n\t}()\n\treturn resultChan, errChan\n}", "title": "" }, { "docid": "69ce12c2e38376913d623bec00fb1077", "score": "0.45625332", "text": "func ModifyPassword(c *gin.Context) {\n\n\t// id := c.PostForm(\"id\")\n\tuser := c.MustGet(\"user\").(userModel.User)\n\tid := user.Id\n\told_pass := c.PostForm(\"old_pass\")\n\tnew_pass := c.PostForm(\"new_pass\")\n\n\t// check user exist or not\n\tusers, err := userModel.GetUsersByStrKey(\"id\", id)\n\tif err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"msg\": err.Error(),\n\t\t})\n\t\tlog.ErrorLog.Println(err)\n\t\tc.Error(err)\n\t\treturn\n\t}\n\tif len(users) == 0 {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\n\t\t\t\"msg\": \"user is not exist\",\n\t\t})\n\t\tlog.ErrorLog.Println(\"user is not exist\")\n\t\tc.Error(errors.New(\"user is not exist\"))\n\t\treturn\n\t}\n\n\t// check old_pass correct or not\n\tif util.MD5(old_pass) != users[0].Password {\n\t\tc.JSON(http.StatusBadRequest, gin.H{\n\t\t\t\"msg\": \"old password is incorrect\",\n\t\t})\n\t\tlog.ErrorLog.Println(\"old password is incorrect\")\n\t\tc.Error(errors.New(\"old password is incorrect\"))\n\t\treturn\n\t}\n\n\tusers[0].Password = util.MD5(new_pass)\n\tif err := userModel.UpdateUser(users[0]); err == nil {\n\t\tc.JSON(http.StatusOK, gin.H{\n\t\t\t\"msg\": \"successfully modify password\",\n\t\t})\n\t\tlog.ErrorLog.Println(\"successfully modify password\")\n\t\tc.Error(errors.New(\"successfully modify password\"))\n\t} else {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\"msg\": err.Error(),\n\t\t})\n\t\tlog.ErrorLog.Println(err)\n\t\tc.Error(err)\n\t}\n\n}", "title": "" }, { "docid": "44d987ffdc2c000aad8676ee56991e4c", "score": "0.45513994", "text": "func (h *Helper) patch(ctx context.Context, obj client.Object) error {\n\tif !h.shouldPatch(\"metadata\") && !h.shouldPatch(\"spec\") {\n\t\treturn nil\n\t}\n\tbeforeObject, afterObject, err := h.calculatePatch(obj, specPatch)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn h.client.Patch(ctx, afterObject, client.MergeFrom(beforeObject))\n}", "title": "" }, { "docid": "548dca8c4fce137e58486bf47a047946", "score": "0.45475414", "text": "func (SetUserdefaultWrappedResponse) SetUserImpl() {}", "title": "" }, { "docid": "fd74b1d0a76612274aa39db796eb532b", "score": "0.45440862", "text": "func usersPatchOne(w http.ResponseWriter, r *http.Request, id bson.ObjectId) {\n\n\tu, err := user.One(id)\n\n\tif err != nil {\n\t\tif err == storm.ErrNotFound {\n\t\t\tpostError(w, http.StatusNotFound)\n\t\t\treturn\n\t\t}\n\t\t// anything else means internal server error code\n\t\tpostError(w, http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\terr = bodyTouser(r, u)\n\tif err != nil {\n\t\tpostError(w, http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Assign this id to the parsed user record instead of generating a new one\n\tu.ID = id\n\terr = u.Save() // call save method of user object and it will return an error,\n\n\tif err != nil {\n\n\t\tif err == user.ErrRecordInvalid {\n\t\t\tpostError(w, http.StatusBadRequest)\n\t\t} else {\n\t\t\tpostError(w, http.StatusInternalServerError)\n\t\t}\n\t\t// And in both cases, terminate dysfunction by calling return\n\t\treturn\n\t}\n\n\tpostBodyResponse(w, http.StatusOK, jsonResponse{\"user\": u})\n\n}", "title": "" }, { "docid": "06bf105b6422465437edcb205194cba8", "score": "0.4541679", "text": "func RawPatch(patchType types.PatchType, data []byte) Patch {\n\treturn &patch{patchType, data}\n}", "title": "" }, { "docid": "477b068e89bb854a23a18eb05da3dfe4", "score": "0.45361307", "text": "func (d *DotmeshRPC) UpdatePassword(r *http.Request, args *struct{ NewPassword string }, result *SafeUser) error {\n\tuser, err := d.usersManager.UpdatePassword(auth.GetUserID(r), args.NewPassword)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*result = user.SafeUser()\n\treturn nil\n}", "title": "" }, { "docid": "18f53677f7400cc1911bfbd0b25bb922", "score": "0.45225826", "text": "func (c *routeClaims) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RouteClaim, err error) {\n\tresult = &v1alpha1.RouteClaim{}\n\terr = c.client.Patch(pt).\n\t\tNamespace(c.ns).\n\t\tResource(\"routeclaims\").\n\t\tSubResource(subresources...).\n\t\tName(name).\n\t\tBody(data).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "868c02b1e906ab94b0cdf7f133883457", "score": "0.45161393", "text": "func StubbedUser() entity.User {\n\tnow := time.Now()\n\treturn entity.User{\n\t\tName: \"Rocky Balboa\",\n\t\tPhone: \"628961234321\",\n\t\tPassword: \"rockybalboa\",\n\t\tRole: \"admin\",\n\t\tCreatedAt: now,\n\t\tUpdatedAt: now,\n\t}\n}", "title": "" }, { "docid": "cc352383a12a20bb53150a34421de0cf", "score": "0.45147735", "text": "func (a *Client) ChangeCurrentUserPassword(params *ChangeCurrentUserPasswordParams, authInfo runtime.ClientAuthInfoWriter) (*ChangeCurrentUserPasswordOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewChangeCurrentUserPasswordParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"ChangeCurrentUserPassword\",\n\t\tMethod: \"PATCH\",\n\t\tPathPattern: \"/users/password\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &ChangeCurrentUserPasswordReader{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\tsuccess, ok := result.(*ChangeCurrentUserPasswordOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for ChangeCurrentUserPassword: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "47d94003e9f9edf4e4de90685f40b701", "score": "0.4496939", "text": "func (s UserResource) Update(obj interface{}, r api2go.Request) (api2go.Responder, error) {\n\tuser, ok := obj.(model.User)\n\tif !ok {\n\t\treturn &Response{}, api2go.NewHTTPError(errors.New(\"Invalid instance given\"), \"Invalid instance given\", http.StatusBadRequest)\n\t}\n\n\terr := s.UserStorage.Update(user)\n\treturn &Response{Res: user, Code: http.StatusNoContent}, err\n}", "title": "" }, { "docid": "632f8b702cd90eddcf0c1a6d218a2e5d", "score": "0.4493414", "text": "func (c *UserController) Modify(ctx *app.ModifyUserContext) error {\n\t// login user\n\treqUser := user.FromContext(ctx)\n\n\t// target user requested modify authority by login_user\n\t_, err := UserDB.Get(ctx, ctx.ID)\n\tif err == gorm.ErrRecordNotFound {\n\t\treturn ctx.NotFound()\n\t}\n\n\t// only Register user can do\n\tif reqUser.IsRegister == false {\n\t\treturn ctx.Forbidden()\n\t}\n\n\terr = UserDB.UpdateFromModifyUserPayload(ctx, ctx.Payload, ctx.ID)\n\tif err != nil {\n\t\tgoa.LogError(ctx, \"Failed to access DB\", err)\n\t}\n\treturn ctx.NoContent()\n}", "title": "" }, { "docid": "bd8e4c2891909ceebe7e9c0dee70bdfc", "score": "0.44847745", "text": "func (r *Resolvers) ChangePassword(ctx context.Context, args changePasswordMutationArgs) (*UserResponse, error) {\n\tuserID := ctx.Value(handler.ContextKey(\"userID\"))\n\n\tif userID == nil {\n\t\treturn nil, &changePassError{Code: \"NotAuth\", Message: \"Not authorized\"}\n\t}\n\tuser := model.User{}\n\n\tif err := r.DB.First(&user, userID).Error; err != nil {\n\t\treturn nil, &changePassError{Code: \"NotExist\", Message: \"User Doesnt Exist\"}\n\t}\n\n\thashPassword, err := utils.HashPass(args.Password)\n\tif err != nil {\n\t\tlog.Printf(\"ERROR, couldnt hash password: %#v\", err)\n\t\treturn nil, err\n\t}\n\n\tuser.Password = hashPassword\n\n\tr.DB.Save(&user)\n\treturn &UserResponse{u: &user}, nil\n}", "title": "" }, { "docid": "10ac129bfeaa1c4e30b16d403c189b23", "score": "0.4483815", "text": "func DefaultApplyFieldMaskUser(ctx context.Context, patchee *User, patcher *User, updateMask *field_mask1.FieldMask, prefix string, db *gorm1.DB) (*User, error) {\n\tif patcher == nil {\n\t\treturn nil, nil\n\t} else if patchee == nil {\n\t\treturn nil, errors1.NilArgumentError\n\t}\n\tvar err error\n\tvar updatedProfile bool\n\tfor i, f := range updateMask.Paths {\n\t\tif f == prefix+\"Id\" {\n\t\t\tpatchee.Id = patcher.Id\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"CreatedAt\" {\n\t\t\tpatchee.CreatedAt = patcher.CreatedAt\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"UpdatedAt\" {\n\t\t\tpatchee.UpdatedAt = patcher.UpdatedAt\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"DeletedAt\" {\n\t\t\tpatchee.DeletedAt = patcher.DeletedAt\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"Username\" {\n\t\t\tpatchee.Username = patcher.Username\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"FirstName\" {\n\t\t\tpatchee.FirstName = patcher.FirstName\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"LastName\" {\n\t\t\tpatchee.LastName = patcher.LastName\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"Email\" {\n\t\t\tpatchee.Email = patcher.Email\n\t\t\tcontinue\n\t\t}\n\t\tif !updatedProfile && strings.HasPrefix(f, prefix+\"Profile.\") {\n\t\t\tupdatedProfile = true\n\t\t\tif patcher.Profile == nil {\n\t\t\t\tpatchee.Profile = nil\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif patchee.Profile == nil {\n\t\t\t\tpatchee.Profile = &Profile{}\n\t\t\t}\n\t\t\tif o, err := DefaultApplyFieldMaskProfile(ctx, patchee.Profile, patcher.Profile, &field_mask1.FieldMask{Paths: updateMask.Paths[i:]}, prefix+\"Profile.\", db); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t} else {\n\t\t\t\tpatchee.Profile = o\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif f == prefix+\"Profile\" {\n\t\t\tupdatedProfile = true\n\t\t\tpatchee.Profile = patcher.Profile\n\t\t\tcontinue\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn patchee, nil\n}", "title": "" }, { "docid": "5b471ec4423f5c4dcf9563ddd66b982d", "score": "0.44835114", "text": "func updateToPatch(f UpdateFunction) PatchFunction {\n\treturn func(obj metav1.Object) (metav1.Object, metav1.Object, error) {\n\t\tobj, err := f(obj)\n\t\treturn nil, obj, err\n\t}\n}", "title": "" }, { "docid": "29f892fe5584d62bf1068717748df6a0", "score": "0.44726557", "text": "func (d *DotmeshRPC) UpdateUserPassword(\n\tr *http.Request,\n\targs *struct {\n\t\tId string\n\t\tNewPassword string\n\t},\n\tresult *SafeUser,\n) error {\n\n\terr := ensureAdminUser(r)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuser, err := d.usersManager.UpdatePassword(args.Id, args.NewPassword)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t*result = user.SafeUser()\n\treturn nil\n}", "title": "" }, { "docid": "2070db6139994ad88e911adef6911107", "score": "0.44691768", "text": "func (c *slackBots) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SlackBot, err error) {\n\tresult = &v1alpha1.SlackBot{}\n\terr = c.client.Patch(pt).\n\t\tNamespace(c.ns).\n\t\tResource(\"slackbots\").\n\t\tSubResource(subresources...).\n\t\tName(name).\n\t\tBody(data).\n\t\tDo().\n\t\tInto(result)\n\treturn\n}", "title": "" }, { "docid": "f45e82eec97829d78d7b05d3f1e184a7", "score": "0.4468064", "text": "func NewPatchUserOK() *PatchUserOK {\n\treturn &PatchUserOK{}\n}", "title": "" }, { "docid": "17d725885c46d0561ae53ac96a345064", "score": "0.44664216", "text": "func modifyUser(method string, user User) (*Response, bool, error) {\n\tuser.Owner = authConfig.OrganizationName\n\n\turl := fmt.Sprintf(\"%s/api/%s?id=%s/%s&clientId=%s&clientSecret=%s\", authConfig.Endpoint, method, user.Owner, user.Name, authConfig.ClientId, authConfig.ClientSecret)\n\tuserByte, err := json.Marshal(user)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresp, err := http.Post(url, \"text/plain;charset=UTF-8\", bytes.NewReader(userByte))\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tdefer func(Body io.ReadCloser) {\n\t\terr := Body.Close()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}(resp.Body)\n\n\trespByte, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\n\tvar response Response\n\terr = json.Unmarshal(respByte, &response)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\n\tif response.Data == \"Affected\" {\n\t\treturn &response, true, nil\n\t}\n\treturn &response, false, nil\n}", "title": "" }, { "docid": "c5d58b90aa28b6246b385edf073ca8cb", "score": "0.44659546", "text": "func (client GroupClient) PatchResponder(resp *http.Response) (result WebService, err error) {\n\terr = autorest.Respond(\n\t\tresp,\n\t\tclient.ByInspecting(),\n\t\tazure.WithErrorUnlessStatusCode(http.StatusOK),\n\t\tautorest.ByUnmarshallingJSON(&result),\n\t\tautorest.ByClosing())\n\tresult.Response = autorest.Response{Response: resp}\n\treturn\n}", "title": "" }, { "docid": "e15b4e7794cc9d5165004c554f962a79", "score": "0.44589773", "text": "func (c *FakeFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Function, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(functionsResource, c.ns, name, pt, data, subresources...), &v1.Function{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1.Function), err\n}", "title": "" }, { "docid": "5941d7aeb5fdacf87ef2f2ee24486961", "score": "0.44539294", "text": "func (ur *UserRepository) Update(id string, u *model.User) (model.User, error) {\n\treturn *u, nil\n}", "title": "" }, { "docid": "6ee6934e8b7d9376eb88fe53410632cc", "score": "0.44392994", "text": "func (r *UserReconciler) updateUserCR(ctx context.Context, parentInstance *v1alpha2.Instance, originalUser,\n\tuser *v1alpha2.User) (ctrl.Result, error) {\n\tif originalUser == nil || user == nil {\n\t\treturn ctrl.Result{}, fmt.Errorf(\"cannot update user because the original user has not been set\")\n\t}\n\n\t// Update Status\n\tif !reflect.DeepEqual(originalUser.Status, user.Status) {\n\t\tif err := r.Client.Status().Update(ctx, user); err != nil {\n\t\t\treturn ctrl.Result{}, err\n\t\t}\n\t}\n\n\t// set owner\n\tif len(user.OwnerReferences) == 0 && parentInstance != nil {\n\t\tif err := ctrl.SetControllerReference(parentInstance, user, r.Scheme); err != nil {\n\t\t\treturn ctrl.Result{}, err\n\t\t}\n\t}\n\n\tif !reflect.DeepEqual(originalUser, user) {\n\t\tif err := r.Client.Update(ctx, user); err != nil {\n\t\t\treturn ctrl.Result{}, err\n\t\t}\n\t}\n\n\treturn ctrl.Result{}, nil\n}", "title": "" }, { "docid": "5f315513f755de4be9cd4614286bfaa9", "score": "0.4438145", "text": "func UpdatePassword(w http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\tbody := bjson.BodyFromContext(ctx)\n\n\tvar payload updatePasswordPayload\n\tif err := validate.Do(&payload, body); err != nil {\n\t\tbjson.HandleError(w, err)\n\t\treturn\n\t}\n\n\tu, err := models.GetUserByID(ctx, payload.UserID)\n\tif err != nil {\n\t\tbjson.HandleError(w, errors.E(\n\t\t\terrors.Op(\"handlers.UpdatePassword\"),\n\t\t\terr,\n\t\t\thttp.StatusBadRequest))\n\t\treturn\n\t}\n\n\tif err := magic.Verify(\n\t\tpayload.UserID,\n\t\tpayload.Timestamp,\n\t\tu.PasswordDigest,\n\t\tpayload.Signature,\n\t); err != nil {\n\t\tbjson.HandleError(w, err)\n\t\treturn\n\t}\n\n\tif err := magic.TooOld(payload.Timestamp); err != nil {\n\t\tbjson.HandleError(w, err)\n\t\treturn\n\t}\n\n\tu.ChangePassword(payload.Password)\n\tu.IsLocked = false\n\tu.AddEmail(u.Email)\n\tu.DeriveProperties()\n\n\tif err := u.Commit(ctx); err != nil {\n\t\tbjson.HandleError(w, err)\n\t\treturn\n\t}\n\n\tbjson.WriteJSON(w, u, http.StatusOK)\n}", "title": "" }, { "docid": "335a38c3445cf4a161a66bb06f4ce249", "score": "0.44324914", "text": "func (c *FakeAwsGameliftAliases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *aws_v1.AwsGameliftAlias, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(awsgameliftaliasesResource, c.ns, name, data, subresources...), &aws_v1.AwsGameliftAlias{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*aws_v1.AwsGameliftAlias), err\n}", "title": "" }, { "docid": "725c2fb6a08950f25db0649db6253e48", "score": "0.4430524", "text": "func (s *pgService) Update(_ context.Context, p *domain.User) (*domain.User, error) {\n\told := domain.User{Model: domain.Model{ID: p.ID}}\n\tif err := s.db.Find(&old).Error; err != nil {\n\t\tif err == gorm.ErrRecordNotFound {\n\t\t\treturn nil, ErrNotFound\n\t\t}\n\t\treturn nil, err\n\t}\n\n\told.Name = p.Name\n\told.Email = p.Email\n\n\treturn &old, s.db.Save(&old).Error\n}", "title": "" }, { "docid": "aaabd4e0e6902a3e9f0f80fba81168b6", "score": "0.44241518", "text": "func (a *FeatureFlagsApiService) PatchExpiringUserTargets(ctx context.Context, projectKey string, environmentKey string, featureFlagKey string, semanticPatchWithComment interface{}) (UserTargetingExpirationForFlags, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Patch\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue UserTargetingExpirationForFlags\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"projectKey\"+\"}\", fmt.Sprintf(\"%v\", projectKey), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"environmentKey\"+\"}\", fmt.Sprintf(\"%v\", environmentKey), -1)\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"featureFlagKey\"+\"}\", fmt.Sprintf(\"%v\", featureFlagKey), -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{\"application/json\"}\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\t// body params\n\tlocalVarPostBody = &semanticPatchWithComment\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t\t\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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\treturn localVarReturnValue, localVarHttpResponse, err\n\t}\n\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tnewErr := GenericSwaggerError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHttpResponse.Status,\n\t\t}\n\t\t\n\t\tif localVarHttpResponse.StatusCode == 200 {\n\t\t\tvar v UserTargetingExpirationForFlags\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\t\n\t\treturn localVarReturnValue, localVarHttpResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHttpResponse, nil\n}", "title": "" }, { "docid": "c6adc168307200793561ee443b143e6c", "score": "0.44216332", "text": "func (c *FakeApiManagementAuthorizationServers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ApiManagementAuthorizationServer, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewPatchSubresourceAction(apimanagementauthorizationserversResource, c.ns, name, pt, data, subresources...), &v1alpha1.ApiManagementAuthorizationServer{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.ApiManagementAuthorizationServer), err\n}", "title": "" }, { "docid": "b8ae6fce4292c30a5d1bfb2c92d1f2a4", "score": "0.44204712", "text": "func (s *UserhandlerService) ModifyUser(c *fiber.Ctx) error {\n\t//Get the ID\n\tID := c.Params(\"id\")\n\n\tif len(ID) < 0 {\n\t\treturn c.Status(fiber.ErrBadRequest.Code).JSON(fiber.Map{\"status\": \"error\", \"message\": \"Review your input\"})\n\t}\n\t//Decode the body\n\tvar body models.UserRequest\n\n\tif err := c.BodyParser(&body); err != nil {\n\t\treturn c.Status(fiber.ErrBadRequest.Code).JSON(fiber.Map{\"status\": \"error\", \"message\": \"Review your body\", \"data\": err.Error()})\n\t}\n\n\t//Check the JWT ID\n\ttk := c.Locals(\"user\").(*jwt.Token)\n\tif err := internalJWT.GetClaims(*tk); err != nil {\n\t\treturn c.Status(fiber.ErrBadGateway.Code).JSON(fiber.Map{\"status\": \"error\", \"message\": \"Error in process JWT\", \"data\": err.Error()})\n\t}\n\n\tif match, err := internalJWT.CheckID(ID); !match || err != nil {\n\t\treturn c.Status(fiber.ErrBadRequest.Code).JSON(fiber.Map{\"status\": \"error\", \"message\": \"Error in process JWT\", \"data\": err.Error()})\n\t}\n\n\tvar userDB models.User\n\tvar newUserName string\n\n\t//Username\n\tif len(strings.TrimSpace(body.CurrentUserName)) > 0 && len(strings.TrimSpace(body.NewUsername)) > 0 {\n\t\tuserDB.UserName = strings.ToLower(strings.TrimSpace(body.CurrentUserName))\n\t\tnewUserName = strings.ToLower(strings.TrimSpace(body.NewUsername))\n\t}\n\n\t//Email\n\tif len(strings.TrimSpace(body.Email)) > 0 || body.Email != \"\" {\n\t\tuserDB.Profile.Email = strings.ToLower(strings.TrimSpace(body.Email))\n\t}\n\n\t//Birthday\n\tif date, err := time.Parse(\"2006-01-02\", body.Birthday); err == nil {\n\t\tuserDB.Profile.Birthday = date\n\t}\n\n\t//FirstName\n\tif len(strings.TrimSpace(body.FirstName)) > 0 || strings.TrimSpace(body.FirstName) != \"\" {\n\t\tuserDB.Profile.FirstName = strings.ToLower(strings.TrimSpace(body.FirstName))\n\t}\n\n\t//LastName\n\tif len(strings.TrimSpace(body.LastName)) > 0 || strings.TrimSpace(body.LastName) != \"\" {\n\t\tuserDB.Profile.LastName = strings.ToLower(strings.TrimSpace(body.LastName))\n\t}\n\n\t//Password\n\tif len(body.Password) >= 6 || body.Password != \"\" {\n\t\tuserDB.Profile.Password = body.Password\n\t}\n\n\t//Biography\n\tif len(strings.TrimSpace(body.Biography)) > 0 || strings.TrimSpace(body.Biography) != \"\" {\n\t\tuserDB.Profile.Biography = body.Biography\n\t}\n\n\tif sucess, err := s.StorageService.ModifyUser(&userDB, ID, newUserName); err != nil || sucess != true {\n\t\treturn c.Status(fiber.ErrConflict.Code).JSON(fiber.Map{\"status\": \"error\", \"message\": \"Error in DB\", \"data\": err.Error()})\n\t}\n\n\treturn c.SendStatus(fiber.StatusAccepted)\n}", "title": "" }, { "docid": "b6e0cead22994cc3a591c1ed35f3cf38", "score": "0.4418321", "text": "func (c *Client) UpdateAdminuser(ctx context.Context, path string, payload *UpdateAdminuserPayload) (*http.Response, error) {\n\tvar body io.Reader\n\tb, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to serialize body: %s\", err)\n\t}\n\tbody = bytes.NewBuffer(b)\n\tscheme := c.Scheme\n\tif scheme == \"\" {\n\t\tscheme = \"https\"\n\t}\n\tu := url.URL{Host: c.Host, Scheme: scheme, Path: path}\n\treq, err := http.NewRequest(\"PATCH\", u.String(), body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader := req.Header\n\theader.Set(\"Content-Type\", \"application/json\")\n\tc.SignerJWT.Sign(ctx, req)\n\treturn c.Client.Do(ctx, req)\n}", "title": "" }, { "docid": "58d3932be79e5559bddb06c4b84b7141", "score": "0.44162324", "text": "func (r repository) UpdatePassword(userPassword *entities.UserPassword, isAdminBeingReset bool) error {\n\tvar result = entities.User{}\n\tresult.UserName = userPassword.Username\n\tfindOneErr := r.Collection.FindOne(context.TODO(), bson.M{\n\t\t\"username\": result.UserName,\n\t}).Decode(&result)\n\tif findOneErr != nil {\n\t\treturn findOneErr\n\t}\n\tif isAdminBeingReset {\n\t\terr := bcrypt.CompareHashAndPassword([]byte(result.Password), []byte(userPassword.OldPassword))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tnewHashedPassword, err := bcrypt.GenerateFromPassword([]byte(userPassword.NewPassword), utils.PasswordEncryptionCost)\n\t_, err = r.Collection.UpdateOne(context.Background(), bson.M{\"_id\": result.ID}, bson.M{\"$set\": bson.M{\n\t\t\"password\": string(newHashedPassword),\n\t}})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ab39dc6278582a277c9734037ec65d86", "score": "0.44061956", "text": "func (req *patchResource) Run(ctx context.Context, s *MockKubeAPIServer) error {\n\tgr := schema.GroupResource{Group: req.Group, Resource: req.Resource}\n\tresource := s.storage.FindResource(gr)\n\tif resource == nil {\n\t\treturn req.writeErrorResponse(http.StatusNotFound)\n\t}\n\n\tid := types.NamespacedName{Namespace: req.Namespace, Name: req.Name}\n\texistingObj, found, err := s.storage.GetObject(ctx, resource, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !found {\n\t\texistingObj = nil\n\t}\n\n\tbodyBytes, err := io.ReadAll(req.r.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbody := &unstructured.Unstructured{}\n\t// Can't use the MarshalJSON overload, it doesn't like missing kind etc\n\tif err := json.Unmarshal(bodyBytes, &body.Object); err != nil {\n\t\treturn fmt.Errorf(\"failed to parse PATCH payload: %w\", err)\n\t}\n\n\t// TODO: We need to implement patch properly\n\tklog.Infof(\"patch request %#v\", string(bodyBytes))\n\n\tif !found {\n\t\t// TODO: Only if server-side-apply\n\n\t\tif req.SubResource != \"\" {\n\t\t\t// TODO: Is this correct for server-side-apply?\n\t\t\treturn req.writeErrorResponse(http.StatusNotFound)\n\t\t}\n\n\t\t// TODO: Should we treat this like an apply to an empty object?\n\n\t\tpatched := body\n\t\tif err := s.storage.CreateObject(ctx, resource, id, patched); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn req.writeResponse(patched)\n\t}\n\n\tvar updated *unstructured.Unstructured\n\tchanged := true\n\tif req.SubResource == \"\" {\n\t\tif resource.TypeInfo != nil {\n\t\t\tpatchOptions := metav1.PatchOptions{}\n\t\t\tif fieldManager := req.r.URL.Query().Get(\"fieldManager\"); fieldManager != \"\" {\n\t\t\t\tpatchOptions.FieldManager = fieldManager\n\t\t\t}\n\t\t\tif force := req.r.URL.Query().Get(\"force\"); force != \"\" {\n\t\t\t\tforceBool, err := strconv.ParseBool(force)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"invalid value %q for force\", force)\n\t\t\t\t}\n\t\t\t\tpatchOptions.Force = &forceBool\n\t\t\t}\n\t\t\tupdated, changed, err = resource.DoServerSideApply(ctx, existingObj, bodyBytes, patchOptions)\n\t\t\tif err != nil {\n\t\t\t\tklog.Warningf(\"error from DoServerSideApply: %v\", err)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t} else {\n\t\t\tklog.Warningf(\"falling back to untyped apply emulation\")\n\t\t\tupdated = existingObj.DeepCopy()\n\t\t\tif err := applyPatch(updated.Object, body.Object); err != nil {\n\t\t\t\tklog.Warningf(\"error from patch: %v\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// TODO: We need to implement put properly\n\t\treturn fmt.Errorf(\"unknown subresource %q\", req.SubResource)\n\t}\n\n\tif !changed {\n\t\tklog.Infof(\"skipping write, object not changed\")\n\t\treturn req.writeResponse(existingObj)\n\t} else {\n\t\tif err := s.storage.UpdateObject(ctx, resource, id, updated); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn req.writeResponse(updated)\n\t}\n}", "title": "" }, { "docid": "3db064d74c76a1d54f77b25a4fe74576", "score": "0.44012368", "text": "func (a *SessionApiService) UpdateMyPassword(ctx context.Context, body PasswordsObject) (SuccessData, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Post\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue SuccessData\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/session/user/password/update\"\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\t// body params\n\tlocalVarPostBody = &body\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t\t\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, 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 := GenericSwaggerError{\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 SuccessData\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\tif localVarHttpResponse.StatusCode == 400 {\n\t\t\tvar v ErrorList\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\tif localVarHttpResponse.StatusCode == 404 {\n\t\t\tvar v ErrorList\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\tif localVarHttpResponse.StatusCode == 500 {\n\t\t\tvar v ErrorList\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": "a77f5b5a29e2b0ca63a97e41a25eefa3", "score": "0.43986815", "text": "func Patch(path string, body io.Reader, res *httptest.ResponseRecorder) *nhttp.Ctx {\n\treturn NewRequest(\"PATCH\", path, body, res)\n}", "title": "" }, { "docid": "a7942d5d112af7c36ad4b026e42c0ca9", "score": "0.43982825", "text": "func (ctx *Context) GetOriginalUser() (user *common.User) {\n\tctx.mu.Lock()\n\tdefer ctx.mu.Unlock()\n\n\tif ctx.originalUser != nil {\n\t\treturn ctx.originalUser\n\t}\n\n\treturn ctx.user\n}", "title": "" }, { "docid": "c51cb34c896b71ff9422bc8afa41bc16", "score": "0.4387454", "text": "func NewPatchUserUnauthorized() *PatchUserUnauthorized {\n\treturn &PatchUserUnauthorized{}\n}", "title": "" }, { "docid": "ef77c1c553e00ab7d9e23f2a1d3f65f1", "score": "0.43862692", "text": "func NewPatchUserNotFound() *PatchUserNotFound {\n\treturn &PatchUserNotFound{}\n}", "title": "" }, { "docid": "d57f4cb90d1507af0bc66de90ab940bb", "score": "0.43837106", "text": "func (a *adminBuilder) GetUser() models.User{\n\ta.InitUser(a.UserName, a.Password)\n\ta.SetRole()\n\ta.SetStatus()\n\ta.SetDateTimeBuilding()\n\t_ = a.EncriptPassword()\n\treturn models.User{\n\t\tId: a.Id,\n\t\tUserName: a.UserName,\n\t\tPassword: a.Password,\n\t\tRole: a.Role,\n\t\tStatus: a.Status,\n\t\tCreated: a.Created,\n\t\tUserNameVerified: false,\n\t\tUpdated: a.Updated,\n\t}\n}", "title": "" }, { "docid": "f035b07a67e8c3c3e13c07a8b00131e1", "score": "0.4380449", "text": "func (userProfileClient *KeycloakUserProfileClient) Update(keycloakUserProfile *KeycloakUserProfile, accessToken string, keycloakProfileURL string) error {\n\tbody, err := json.Marshal(keycloakUserProfile)\n\tif err != nil {\n\t\treturn errors.NewInternalError(err)\n\t}\n\n\treq, err := http.NewRequest(\"POST\", keycloakProfileURL, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn errors.NewInternalError(err)\n\t}\n\treq.Header.Add(\"Authorization\", \"Bearer \"+accessToken)\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tresp, err := userProfileClient.client.Do(req)\n\n\tif err != nil {\n\t\tlog.Error(nil, map[string]interface{}{\n\t\t\t\"keycloak_user_profile_url\": keycloakProfileURL,\n\t\t\t\"err\": err,\n\t\t}, \"Unable to update Keycloak user profile\")\n\t\treturn errors.NewInternalError(err)\n\t} else if resp != nil {\n\t\tdefer resp.Body.Close()\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\n\t\tlog.Error(nil, map[string]interface{}{\n\t\t\t\"response_status\": resp.Status,\n\t\t\t\"response_body\": rest.ReadBody(resp.Body),\n\t\t\t\"keycloak_user_profile_url\": keycloakProfileURL,\n\t\t}, \"Unable to update Keycloak user profile\")\n\n\t\tif resp.StatusCode == 500 {\n\t\t\t// Observed that a 500 is returned whenever username/email is not unique\n\t\t\treturn errors.NewBadParameterError(\"username or email\", fmt.Sprintf(\"%s , %s\", *keycloakUserProfile.Email, *keycloakUserProfile.Username))\n\t\t}\n\t\tif resp.StatusCode == 400 {\n\t\t\treturn errors.NewUnauthorizedError(rest.ReadBody(resp.Body))\n\t\t}\n\n\t\treturn errors.NewInternalError(errs.Errorf(\"received a non-200 response %s while updating keycloak user profile %s\", resp.Status, keycloakProfileURL))\n\t}\n\tlog.Info(nil, map[string]interface{}{\n\t\t\"response_status\": resp.Status,\n\t\t\"response_body\": rest.ReadBody(resp.Body),\n\t\t\"keycloak_user_profile_url\": keycloakProfileURL,\n\t}, \"Successfully updated Keycloak user profile\")\n\n\treturn nil\n}", "title": "" }, { "docid": "625ab3ea9630bc80409edc3c605c198a", "score": "0.43787068", "text": "func getAdminUser(ctx context.Context) *models.User {\n\tobj := ctx.Value(adminUserKey)\n\tif obj == nil {\n\t\treturn nil\n\t}\n\treturn obj.(*models.User)\n}", "title": "" }, { "docid": "489f4e9555d7677b9a2031a83b3d92ad", "score": "0.43760392", "text": "func (p *Plugin) GetUsersChangePassword() {\n\tp.LayoutDashboard()\n\tp.Data[TITLE] = Tr(p.Locale(), \"nut.users.change-password.title\")\n\tp.TplName = \"nut/users/change-password.html\"\n}", "title": "" }, { "docid": "19458cbd429a75653d52514347c0f96f", "score": "0.4371997", "text": "func UpdateUser(w http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\tu := middleware.UserFromContext(ctx)\n\tbody := bjson.BodyFromContext(ctx)\n\n\tvar payload updateUserPayload\n\tif err := validate.Do(&payload, body); err != nil {\n\t\tbjson.HandleError(w, err)\n\t\treturn\n\t}\n\n\tif payload.Password {\n\t\tu.SendPasswordResetEmail()\n\t}\n\n\t// TODO: Come up with something better than this.\n\tif payload.FirstName != \"\" && payload.FirstName != u.FirstName {\n\t\tu.FirstName = payload.FirstName\n\t}\n\n\tif payload.LastName != \"\" && payload.LastName != u.LastName {\n\t\tu.LastName = payload.LastName\n\t}\n\n\tif err := u.Commit(ctx); err != nil {\n\t\tbjson.HandleError(w, err)\n\t\treturn\n\t}\n\n\tbjson.WriteJSON(w, u, http.StatusOK)\n}", "title": "" }, { "docid": "4c679d8eecc7ad3de1932d95f5a99f30", "score": "0.43675137", "text": "func (bl BLUser) Update(reqCtx common.RequestContext, id int, usr model.User) (model.User, error) {\n\t// todo: add validation here\n\tif reqCtx.CompanyID() != usr.CompanyID {\n\t\treturn model.User{}, eh.NewError(eh.ErrUserUpdate, \"User %s does not belong to your company \", usr.Email)\n\n\t}\n\tresult, err := dlUpdate(reqCtx, id, usr)\n\tif err != nil {\n\t\treturn model.User{}, eh.NewError(eh.ErrUserUpdate, \"DB Error: \"+err.Error())\n\t}\n\treturn result, err\n}", "title": "" }, { "docid": "112a163fcfa6ae41f103d4528f752853", "score": "0.4367467", "text": "func (p *Patcher) Patch(current runtime.Object, modified []byte, source, namespace, name string, errOut io.Writer) ([]byte, runtime.Object, error) {\n\tvar getErr error\n\tpatchBytes, patchObject, err := p.patchSimple(current, modified, namespace, name, errOut)\n\tif p.Retries == 0 {\n\t\tp.Retries = maxPatchRetry\n\t}\n\tfor i := 1; i <= p.Retries && apierrors.IsConflict(err); i++ {\n\t\tif i > triesBeforeBackOff {\n\t\t\tp.BackOff.Sleep(backOffPeriod)\n\t\t}\n\t\tcurrent, getErr = p.Helper.Get(namespace, name)\n\t\tif getErr != nil {\n\t\t\treturn nil, nil, getErr\n\t\t}\n\t\tpatchBytes, patchObject, err = p.patchSimple(current, modified, namespace, name, errOut)\n\t}\n\tif err != nil {\n\t\tif (apierrors.IsConflict(err) || apierrors.IsInvalid(err)) && p.Force {\n\t\t\tpatchBytes, patchObject, err = p.deleteAndCreate(current, modified, namespace, name)\n\t\t} else {\n\t\t\terr = cmdutil.AddSourceToErr(\"patching\", source, err)\n\t\t}\n\t}\n\treturn patchBytes, patchObject, err\n}", "title": "" } ]
a9f9eec34e55f32e22ea051e2b676fc3
NewOrderingInstitution returns a new OrderingInstitution
[ { "docid": "bbeed262dfc249ca7421402f6aa5d6ed", "score": "0.80312777", "text": "func NewOrderingInstitution() *OrderingInstitution {\n\toi := &OrderingInstitution{\n\t\ttag: TagOrderingInstitution,\n\t}\n\treturn oi\n}", "title": "" } ]
[ { "docid": "f6a4144ed6f950093d89290d0caee365", "score": "0.50963366", "text": "func NewAuthorityTemplate()(*AuthorityTemplate) {\n m := &AuthorityTemplate{\n FilePlanDescriptorTemplate: *NewFilePlanDescriptorTemplate(),\n }\n return m\n}", "title": "" }, { "docid": "d1b13df7c05af9e688910e41e108d9c0", "score": "0.5006639", "text": "func NewINDUSTRIAL(config configuration_pkg.CONFIGURATION) *INDUSTRIAL_IMPL {\r\n client := new(INDUSTRIAL_IMPL)\r\n client.config = config\r\n return client\r\n}", "title": "" }, { "docid": "85e82945728faa33f88f9704310bd18a", "score": "0.4953062", "text": "func NewExternalGroup()(*ExternalGroup) {\n m := &ExternalGroup{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "36424eba250b099e980418035f516169", "score": "0.49297982", "text": "func New() *IR {\n\treturn &IR{\n\t\tOrders: make([]Order, 0),\n\t}\n}", "title": "" }, { "docid": "67ad5bcb8202228510f42a3f3ff6da41", "score": "0.47811362", "text": "func (i InputStorePaymentPremiumSubscription) construct() InputStorePaymentPurposeClass { return &i }", "title": "" }, { "docid": "83c9dea75d89af036e0a54b976b4612c", "score": "0.4771212", "text": "func mockInstitutionAccount() *InstitutionAccount {\n\tiAccount := NewInstitutionAccount()\n\tiAccount.CoverPayment.SwiftFieldTag = \"Swift Field Tag\"\n\tiAccount.CoverPayment.SwiftLineOne = \"Swift Line One\"\n\tiAccount.CoverPayment.SwiftLineTwo = \"Swift Line Two\"\n\tiAccount.CoverPayment.SwiftLineThree = \"Swift Line Three\"\n\tiAccount.CoverPayment.SwiftLineFour = \"Swift Line Four\"\n\tiAccount.CoverPayment.SwiftLineFive = \"Swift Line Five\"\n\treturn iAccount\n}", "title": "" }, { "docid": "5f96c416ff50ae6d13f12aeb20a26a81", "score": "0.47477144", "text": "func newTranslator() ut.Translator {\n\t// NOTE: ommitting allot of error checking for brevity\n\ten := en.New()\n\tuni := ut.New(en, en)\n\n\t// this is usually know or extracted from http 'Accept-Language' header\n\t// also see uni.FindTranslator(...)\n\ttrans, _ := uni.GetTranslator(\"en\")\n\treturn trans\n}", "title": "" }, { "docid": "765cacda825cd17a9852d211d7fd61e3", "score": "0.4725788", "text": "func (i InputStorePaymentGiftPremium) construct() InputStorePaymentPurposeClass { return &i }", "title": "" }, { "docid": "24d97c555fd9fa3ad892a4a9249b4cd5", "score": "0.47204283", "text": "func (c *Client) NewAuthorization(accountKey interface{}, typ, val string) (auth Authorization, authURL string, err error) {\n\ttype Identifier struct {\n\t\tType string `json:\"type\"`\n\t\tValue string `json:\"value\"`\n\t}\n\n\tdata := struct {\n\t\tResource string `json:\"resource\"`\n\t\tIdentifier Identifier `json:\"identifier\"`\n\t}{\n\t\tresourceNewAuthorization,\n\t\tIdentifier{typ, val},\n\t}\n\tpayload, err := c.signObject(accountKey, &data)\n\tif err != nil {\n\t\treturn auth, \"\", err\n\t}\n\tresp, err := c.client.Post(c.resources.NewAuthorization, jwsContentType, strings.NewReader(payload))\n\tif err != nil {\n\t\treturn auth, \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tif err = checkHTTPError(resp, http.StatusCreated); err != nil {\n\t\treturn auth, \"\", err\n\t}\n\n\tif err := json.NewDecoder(resp.Body).Decode(&auth); err != nil {\n\t\treturn auth, \"\", fmt.Errorf(\"decoding response body: %v\", err)\n\t}\n\treturn auth, resp.Header.Get(\"Location\"), nil\n}", "title": "" }, { "docid": "0415cc1611ee7c27990719b11d84bce0", "score": "0.4715948", "text": "func New() *Upstream { return &Upstream{} }", "title": "" }, { "docid": "e09ff21aec2adf90d4520fa792ddc2cb", "score": "0.4669462", "text": "func NewCountryNamedLocation()(*CountryNamedLocation) {\n m := &CountryNamedLocation{\n NamedLocation: *NewNamedLocation(),\n }\n return m\n}", "title": "" }, { "docid": "f5867b1844f71c4838530cb1b0408dac", "score": "0.4648766", "text": "func NewEducationSynchronizationProfile()(*EducationSynchronizationProfile) {\n m := &EducationSynchronizationProfile{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "6e7b1593adeaaaa6ad6c2b1fd004b67e", "score": "0.4635495", "text": "func NewEducationSynchronizationCustomization()(*EducationSynchronizationCustomization) {\n m := &EducationSynchronizationCustomization{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "5911dc8f5af5732ba6bfefa78b56ddfd", "score": "0.46214715", "text": "func NewTran() fairy.ITran {\n\treturn base.NewTran(&wsTran{})\n}", "title": "" }, { "docid": "6c3cb39db32a41eb3030d0e3812f3ac6", "score": "0.46166778", "text": "func NewIdentity()(*Identity) {\n m := &Identity{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "5d083934f454309b1f50002525a2b7b8", "score": "0.46011624", "text": "func newSUT() *provider {\n\treturn New()\n}", "title": "" }, { "docid": "fe7d51b608a8a0c86969e342e2922ddd", "score": "0.45883834", "text": "func newApiGateways(c *CwV1alphaClient, namespace string) *apiGateways {\n\treturn &apiGateways{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "title": "" }, { "docid": "6514d736d110c0c2242be97f4df4ecde", "score": "0.45837268", "text": "func (univ *Universe) NewInnovation() (innovation *Innovation) {\r\n\tv := Innovation(univ.Innovation)\r\n\tinnovation = &v\r\n\tuniv.Innovation++\r\n\treturn innovation\r\n}", "title": "" }, { "docid": "a8bcb8fd4529cb3fb1996bffdf3ec17e", "score": "0.45650813", "text": "func NewOrigIter(location *nav.Location) *origIterator {\n\treturn &origIterator{\n\t\tlocation: location,\n\t}\n}", "title": "" }, { "docid": "8b250df06e797bdf05083828d222069f", "score": "0.4553298", "text": "func newUniversalTranslator() *UniversalTranslator {\n\treturn &UniversalTranslator{\n\t\ttranslators: make(translators),\n\t\ttranslatorsLowercase: make(translators),\n\t}\n}", "title": "" }, { "docid": "4876c8c7ae824af7fcdc856352efddc9", "score": "0.45522848", "text": "func NewISubscription(address common.Address, backend bind.ContractBackend) (*ISubscription, error) {\n\tcontract, err := bindISubscription(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ISubscription{ISubscriptionCaller: ISubscriptionCaller{contract: contract}, ISubscriptionTransactor: ISubscriptionTransactor{contract: contract}, ISubscriptionFilterer: ISubscriptionFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "77aff5c558b08d1832845c1e134f1c6d", "score": "0.45324185", "text": "func NewAlien(name string, city *City) *Alien {\n\talien := &Alien{\n\t\tname: name,\n\t\tcity: city,\n\t\tdestroyed: false,\n\t}\n\n\talien.city.AddResident(alien)\n\treturn alien\n}", "title": "" }, { "docid": "d49b4642cc8bab8d2199328ab8c2d6f7", "score": "0.45311782", "text": "func (p *Population) NewGateway(owner *ttnpb.OrganizationOrUserIdentifiers) *ttnpb.Gateway {\n\ti := len(p.Gateways) + 1\n\tgtw := &ttnpb.Gateway{\n\t\tIds: &ttnpb.GatewayIdentifiers{\n\t\t\tGatewayId: fmt.Sprintf(\"gtw-%02d\", i),\n\t\t},\n\t\tName: fmt.Sprintf(\"Gateway %02d\", i),\n\t}\n\tp.Gateways = append(p.Gateways, gtw)\n\tif owner != nil {\n\t\tgtw.AdministrativeContact = owner\n\t\tgtw.TechnicalContact = owner\n\t\tp.NewMembership(owner, gtw.GetEntityIdentifiers(), ttnpb.Right_RIGHT_ALL)\n\t}\n\treturn gtw\n}", "title": "" }, { "docid": "60b86bdc61735c87823f30b6d81404d8", "score": "0.45296428", "text": "func NewDomainRegistrant()(*DomainRegistrant) {\n m := &DomainRegistrant{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "38ab3e0b27631bbf68d4b87e7f28ef4f", "score": "0.4501404", "text": "func (oi *OrderingInstitution) Validate() error {\n\tif err := oi.fieldInclusion(); err != nil {\n\t\treturn err\n\t}\n\tif oi.tag != TagOrderingInstitution {\n\t\treturn fieldError(\"tag\", ErrValidTagForType, oi.tag)\n\t}\n\tif err := oi.isAlphanumeric(oi.CoverPayment.SwiftFieldTag); err != nil {\n\t\treturn fieldError(\"SwiftFieldTag\", err, oi.CoverPayment.SwiftFieldTag)\n\t}\n\tif err := oi.isAlphanumeric(oi.CoverPayment.SwiftLineOne); err != nil {\n\t\treturn fieldError(\"SwiftLineOne\", err, oi.CoverPayment.SwiftLineOne)\n\t}\n\tif err := oi.isAlphanumeric(oi.CoverPayment.SwiftLineTwo); err != nil {\n\t\treturn fieldError(\"SwiftLineTwo\", err, oi.CoverPayment.SwiftLineTwo)\n\t}\n\tif err := oi.isAlphanumeric(oi.CoverPayment.SwiftLineThree); err != nil {\n\t\treturn fieldError(\"SwiftLineThree\", err, oi.CoverPayment.SwiftLineThree)\n\t}\n\tif err := oi.isAlphanumeric(oi.CoverPayment.SwiftLineFour); err != nil {\n\t\treturn fieldError(\"SwiftLineFour\", err, oi.CoverPayment.SwiftLineFour)\n\t}\n\tif err := oi.isAlphanumeric(oi.CoverPayment.SwiftLineFive); err != nil {\n\t\treturn fieldError(\"SwiftLineFive\", err, oi.CoverPayment.SwiftLineFive)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6263bce7a9c6eb264b3a53d7d03f4307", "score": "0.44857913", "text": "func newAssociatedStations(vres *stationviews.AssociatedStationsView) *AssociatedStations {\n\tres := &AssociatedStations{}\n\tif vres.Stations != nil {\n\t\tres.Stations = newAssociatedStationCollection(vres.Stations)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "dd8564b3d096f781d65309a91f4857a3", "score": "0.44835496", "text": "func (b *Backend) NewTransaction(t *Transaction) error {\n\t/*\n\t\t// TODO: only chronologically sorted transactions\n\t\t// and splits are supported right now.\n\t\tif err := b.Ledger.balanceTransaction(t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tb.Ledger.Transactions = append(b.Ledger.Transactions, t)\n\t\tfor _, s := range t.Splits {\n\t\t\ts.Balance = make(Balance)\n\t\t\tif len(s.Account.Splits) > 0 {\n\t\t\t\ts.Balance = s.Account.Splits[len(s.Account.Splits)-1].Balance\n\t\t\t}\n\t\t\ts.Balance[s.Value.Currency] += s.Value.Amount\n\t\t\ts.Account.Splits = append(s.Account.Splits, s)\n\t\t}\n\t*/\n\treturn nil\n}", "title": "" }, { "docid": "16555f049db066c3bc0c977cf8f7e096", "score": "0.44817904", "text": "func (c *AuthorizationClient) New(ctx context.Context, idempotencyKey string, paymentID string, params *AuthorizationParams, clientInfo *ClientInfo) (*Authorization, error) {\n\tauthorization := &Authorization{}\n\n\theaders := map[string]string{headerIdempotencyKey: idempotencyKey}\n\n\tif clientInfo != nil {\n\t\theaders[headerClientIPAddress] = clientInfo.IPAddress\n\t\theaders[headerClientUserAgent] = clientInfo.UserAgent\n\t}\n\n\tif err := c.Caller.Call(ctx, \"POST\", c.authorizationsPath(paymentID), headers, params, authorization); err != nil {\n\t\treturn nil, err\n\t}\n\treturn authorization, nil\n}", "title": "" }, { "docid": "795e928d538068b4e4520e54331b3bc8", "score": "0.44790965", "text": "func NewLicenceTransaction(\n\torderID string,\n\tp price.Price,\n\tby admin.Creator,\n\tcurrLic licence.ExpandedLicence,\n) LicenceTransaction {\n\tvar k enum.OrderKind\n\tif currLic.ID == \"\" {\n\t\tk = enum.OrderKindCreate\n\t} else {\n\t\tk = enum.OrderKindRenew\n\t}\n\n\treturn LicenceTransaction{\n\t\tID: ids.TxnID(),\n\t\tKind: k,\n\t\tLicenceToRenew: ExpandedLicenceJSON{currLic},\n\t\tOrderID: orderID,\n\t\tPriceID: p.ID,\n\t\tCreator: by,\n\t\tCreatedUTC: chrono.TimeNow(),\n\t\tFinalizedUTC: chrono.Time{},\n\t}\n}", "title": "" }, { "docid": "a2b1a02708bcf6fb2ba7f3da9f1027b6", "score": "0.44789192", "text": "func New(publicKey ed25519.PublicKey) *Identity {\n\treturn &Identity{\n\t\tid: NewID(publicKey),\n\t\tpublicKey: publicKey,\n\t}\n}", "title": "" }, { "docid": "9b0601b3f9f603d34b8aec270c150671", "score": "0.44779375", "text": "func NewIntuneBrand()(*IntuneBrand) {\n m := &IntuneBrand{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "1e7b0325ab0e7e321d503d967610d664", "score": "0.44732705", "text": "func newSubscription(csvName, namespace string,\n\topts ...func(*operatorsv1alpha1.Subscription)) *operatorsv1alpha1.Subscription {\n\tsub := &operatorsv1alpha1.Subscription{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: operatorsv1alpha1.SchemeGroupVersion.String(),\n\t\t\tKind: operatorsv1alpha1.SubscriptionKind,\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: getSubscriptionName(csvName),\n\t\t\tNamespace: namespace,\n\t\t},\n\t}\n\tfor _, opt := range opts {\n\t\topt(sub)\n\t}\n\treturn sub\n}", "title": "" }, { "docid": "b520a993bf1d128fcd5f4311e81a171d", "score": "0.44693202", "text": "func (fgen *funcGen) newAllocaInst(ident ir.LocalIdent, old *ast.AllocaInst) (*ir.InstAlloca, error) {\n\telemType, err := fgen.gen.irType(old.ElemType())\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tinst := &ir.InstAlloca{LocalIdent: ident, ElemType: elemType}\n\t// Cache inst.Typ.\n\tinst.Type()\n\treturn inst, nil\n}", "title": "" }, { "docid": "30b3ae20221c100f4fafedc60682cbe6", "score": "0.4460818", "text": "func (p *Population) NewOrganization(owner *ttnpb.OrganizationOrUserIdentifiers) *ttnpb.Organization {\n\ti := len(p.Organizations) + 1\n\torg := &ttnpb.Organization{\n\t\tIds: &ttnpb.OrganizationIdentifiers{\n\t\t\tOrganizationId: fmt.Sprintf(\"org-%02d\", i),\n\t\t},\n\t\tName: fmt.Sprintf(\"Organization %02d\", i),\n\t}\n\tp.Organizations = append(p.Organizations, org)\n\tif owner != nil {\n\t\torg.AdministrativeContact = owner\n\t\torg.TechnicalContact = owner\n\t\tp.NewMembership(owner, org.GetEntityIdentifiers(), ttnpb.Right_RIGHT_ALL)\n\t}\n\treturn org\n}", "title": "" }, { "docid": "f3eaf9c70100d0ac13c135d07dc575c7", "score": "0.4457407", "text": "func newCountryWeights() *countryWeights {\n\tcountryWeights := new(countryWeights)\n\tcountryWeights.Countries = make([]string,0,100)\n\treturn countryWeights\n}", "title": "" }, { "docid": "7709b60ec438be3ee6a6de97d8d0d1f9", "score": "0.44566613", "text": "func NewSurplusAuction(seller string, lot sdk.Coin, bidDenom string, endTime time.Time) SurplusAuction {\n\tauction := SurplusAuction{BaseAuction{\n\t\t// no ID\n\t\tInitiator: seller,\n\t\tLot: lot,\n\t\tBidder: nil,\n\t\tBid: sdk.NewInt64Coin(bidDenom, 0),\n\t\tHasReceivedBids: false, // new auctions don't have any bids\n\t\tEndTime: endTime,\n\t\tMaxEndTime: endTime,\n\t}}\n\treturn auction\n}", "title": "" }, { "docid": "ac28eb56e2d67b7e3ef48b4cfb0d675a", "score": "0.44543573", "text": "func NewLocationConstraint()(*LocationConstraint) {\n m := &LocationConstraint{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "1ce9e470041d81e96fdc7afee74e665e", "score": "0.44534987", "text": "func New(conf Config) (*Integration, error) {\n\treturn &Integration{\n\t\tconfig: conf,\n\t\tgeolocationURI: \"https://gls.loracloud.com\",\n\t}, nil\n}", "title": "" }, { "docid": "bb5c4df0dc2a082ee214e1a0023178f6", "score": "0.44424218", "text": "func NewComplianceInformation()(*ComplianceInformation) {\n m := &ComplianceInformation{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "6f8abf6b052f7b2604bfefc076f54f5f", "score": "0.44374776", "text": "func newCspaceOrganism(vres *organismsviews.CspaceOrganismView) *CspaceOrganism {\n\tres := &CspaceOrganism{\n\t\tDescription: vres.Description,\n\t\tDeactivated: vres.Deactivated,\n\t\tPath: vres.Path,\n\t}\n\tif vres.ID != nil {\n\t\tres.ID = *vres.ID\n\t}\n\tif vres.Title != nil {\n\t\tres.Title = *vres.Title\n\t}\n\tif vres.Properties != nil {\n\t\tres.Properties = make(map[string]string, len(vres.Properties))\n\t\tfor key, val := range vres.Properties {\n\t\t\ttk := key\n\t\t\ttv := val\n\t\t\tres.Properties[tk] = tv\n\t\t}\n\t}\n\tif vres.Refs != nil {\n\t\tres.Refs = make([]string, len(vres.Refs))\n\t\tfor i, val := range vres.Refs {\n\t\t\tres.Refs[i] = val\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "3f030c0c1d0bac954a2dcd69ea53668f", "score": "0.44340217", "text": "func newSort() *sort {\n\treturn &sort{}\n}", "title": "" }, { "docid": "81ea7d73a8f53f93716fffa6a8cd3bb2", "score": "0.44320846", "text": "func NewDerivative() *Derivative {\n\treturn &Derivative{0.2}\n}", "title": "" }, { "docid": "a70e78d71212c9afd108a45e4d7f1c67", "score": "0.4418409", "text": "func NewOrganisationStore(region, tableName string) (us OrganisationStore, err error) {\n\tsess, err := session.NewSession(&aws.Config{Region: aws.String(region)})\n\tif err != nil {\n\t\treturn\n\t}\n\tus.Client = dynamodb.New(sess)\n\tus.TableName = aws.String(tableName)\n\tus.Now = func() time.Time {\n\t\treturn time.Now().UTC()\n\t}\n\treturn\n}", "title": "" }, { "docid": "761a5563183395f0db3d5781d717ce5b", "score": "0.4413453", "text": "func NewInformationProtection()(*InformationProtection) {\n m := &InformationProtection{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "3fba939e7fb765908ac676878b4d2d4a", "score": "0.44115052", "text": "func NewInterview() (Interview, error) {\n\tinterview := &akobiInterview{\n\t\tid: \"blah\",\n\t\texpectedClients: make(map[ClientRole]map[string]string),\n\t\texpectedApplications: make(map[string]Application),\n\t\tstartTime: nil,\n\t\tduration: nil,\n\t}\n\n\tinterview.expectedClients[Interviewer] = make(map[string]string)\n\tinterview.expectedClients[Interviewee] = make(map[string]string)\n\n\treturn interview, nil\n}", "title": "" }, { "docid": "1f5d8c071adb6b365e87238206c13df8", "score": "0.44113964", "text": "func NewDepartment()(*Department) {\n m := &Department{\n FilePlanDescriptorBase: *NewFilePlanDescriptorBase(),\n }\n return m\n}", "title": "" }, { "docid": "285c1049879c433e7c6c5975593de9c5", "score": "0.43995294", "text": "func NewEducationSubmission()(*EducationSubmission) {\n m := &EducationSubmission{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "65acf153f4648bc332119eca5cc6ff97", "score": "0.43994614", "text": "func NewOrganisation() *Organisation {\n\treturn &Organisation{\n\t\troles: make(map[int]Role),\n\t\troleTree: make(map[int][]int),\n\t\tusers: make(map[int]User),\n\t\tusersInRole: make(map[int][]User),\n\t}\n}", "title": "" }, { "docid": "8163db0561901d9ae4c41259ca732c3f", "score": "0.43943715", "text": "func newSUT() *instance {\n\treturn New()\n}", "title": "" }, { "docid": "5ced9d466bd978b217f3055b4069acc6", "score": "0.43875003", "text": "func NewIntegration(ctx *pulumi.Context,\n\tname string, args *IntegrationArgs, opts ...pulumi.ResourceOption) (*Integration, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.ClientEmail == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ClientEmail'\")\n\t}\n\tif args.ClientId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ClientId'\")\n\t}\n\tif args.PrivateKey == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'PrivateKey'\")\n\t}\n\tif args.PrivateKeyId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'PrivateKeyId'\")\n\t}\n\tif args.ProjectId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ProjectId'\")\n\t}\n\tif args.PrivateKey != nil {\n\t\targs.PrivateKey = pulumi.ToSecret(args.PrivateKey).(pulumi.StringInput)\n\t}\n\tsecrets := pulumi.AdditionalSecretOutputs([]string{\n\t\t\"privateKey\",\n\t})\n\topts = append(opts, secrets)\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Integration\n\terr := ctx.RegisterResource(\"datadog:gcp/integration:Integration\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "1635ae1bebef2531afd9a9653210143e", "score": "0.4384817", "text": "func NewELECTRONICEQUIPMENTINSURANCE(config configuration_pkg.CONFIGURATION) *ELECTRONICEQUIPMENTINSURANCE_IMPL {\r\n client := new(ELECTRONICEQUIPMENTINSURANCE_IMPL)\r\n client.config = config\r\n return client\r\n}", "title": "" }, { "docid": "89502d035acad209616b6ebb4646a59b", "score": "0.43803957", "text": "func NewInstitutionManager(confDir string) (*InstitutionManager, error) {\n\tpath := filepath.Join(confDir, \"institutions.json\")\n\n\tvar institutions institutions\n\terr := files.Unmarshal(path, \"institutions\", &institutions)\n\tif err != nil && !errors.Is(err, os.ErrNotExist) { // ignore ErrNotExist\n\t\treturn nil, err\n\t}\n\n\t// if there was no file, unmarshal failed, but that's fine:\n\t// we would only have an empty institutions map anyway, so just continue\n\treturn &InstitutionManager{\n\t\tpath: path,\n\t\tinstitutions: institutions,\n\t}, nil\n}", "title": "" }, { "docid": "bca91de61029c74003f48eea3ac6d687", "score": "0.43675235", "text": "func NewTransactionParty(iban *iban.IBAN, name *string) TransactionParty {\n\treturn TransactionParty{\n\t\tIBAN: utils.EmptyIBANOrValue(iban),\n\t\tHasIBAN: iban != nil,\n\t\tName: utils.EmptyStringOrValue(name),\n\t\tHasName: name != nil,\n\t}\n}", "title": "" }, { "docid": "7ca68c4b58aa45c8d20d2838a3b8ee0c", "score": "0.43606758", "text": "func newTransactionId(creator []byte) (*TransactionId, error) {\n\tnonce, err := generateRandomBytes(24)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tid := generateTxId(nonce, creator)\n\treturn &TransactionId{Creator: creator, Nonce: nonce, TransactionId: id}, nil\n}", "title": "" }, { "docid": "8a1442ef37741d1b7b0d157670155d35", "score": "0.43412343", "text": "func newSeatingArrangement(a, b visitor, scenario *tableScenario) (seatingArrangement, error) {\n\t// do things...\n\tresult := seatingArrangement{}\n\tresult.basis = scenario\n\tvar err error\n\tif result.happiness, err = result.basis.get(a, b); err != nil {\n\t\treturn result, errors.Wrapf(err, \"could not arrange %v and %v together\", a, b)\n\t}\n\tresult.raw = []visitor{a, b}\n\tresult.remaining = excludeVisitors(result.basis.visitors, a, b)\n\n\treturn result, nil\n}", "title": "" }, { "docid": "9183c89b0dd529841ccc4194f057f4dd", "score": "0.4338819", "text": "func newProviderIndex(address string, papi ProviderDownloaderAPI) *providerIndex {\n\tversions := make(map[string]*ProviderVersion)\n\treturn &providerIndex{\n\t\taddress: address,\n\t\tversions: versions,\n\t\tpapi: papi,\n\t}\n}", "title": "" }, { "docid": "f4d444c8523ef3f7a813e780e4b00abb", "score": "0.43366936", "text": "func NewInternet(ctx *pulumi.Context,\n\tname string, args *InternetArgs, opts ...pulumi.ResourceOption) (*Internet, error) {\n\tif args == nil {\n\t\targs = &InternetArgs{}\n\t}\n\n\tvar resource Internet\n\terr := ctx.RegisterResource(\"sakuracloud:index/internet:Internet\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "46a55dfdb186bff3483c1825ac5d525d", "score": "0.43327948", "text": "func createNewspaper(name string, pages int, publisher string) iPublication {\n\n}", "title": "" }, { "docid": "b701bec6ca1cb8256b506c6a9edcdc7c", "score": "0.4331361", "text": "func New(nice bool) Strategy {\n\tvar stratFunc strategyFunc\n\tif nice {\n\t\tstratFunc = yesManStrategy\n\t} else {\n\t\tstratFunc = standardStrategy\n\t}\n\treturn &strategist{\n\t\tledgerMap: ledgerMap{},\n\t\tstrategyFunc: stratFunc,\n\t}\n}", "title": "" }, { "docid": "181f56c56498cea18dad7d9ee49bcca3", "score": "0.4330418", "text": "func newSubscription(b *bus, key *ari.Key, eTypes ...string) *subscription {\n\treturn &subscription{\n\t\tkey: key,\n\t\tb: b,\n\t\tevents: eTypes,\n\t\tC: make(chan ari.Event, subscriptionEventBufferSize),\n\t}\n}", "title": "" }, { "docid": "fa4f982f95f4a6745bc7498eb2017bcc", "score": "0.4327494", "text": "func NewIncrementation(typer IncrementTyper, branchName string, buildEnv Env) (*Incrementation, error) {\n\treturn &Incrementation{\n\t\tbranch: branchName,\n\t\tenv: buildEnv,\n\t\ttyper: typer,\n\t}, nil\n}", "title": "" }, { "docid": "101899444e5c2a0d5b7e0c90678dc9de", "score": "0.43254727", "text": "func (this *Asset) basisNew() {\n\tthis.S.Basis.I = -this.S.NetCF.I\n\tthis.L.Basis.I = -this.L.NetCF.I\n}", "title": "" }, { "docid": "1b58ebb7a365f75f26ebd9cd2e8d57d2", "score": "0.43232462", "text": "func newAggrAgreement() *AggrAgreement {\n\treturn &AggrAgreement{\n\t\tAgreement: *newAgreement(),\n\t\tBitset: uint64(0),\n\t\tAggrSig: make([]byte, 48), // TODO: Use of hardcoded constant is discouraged\n\t}\n}", "title": "" }, { "docid": "acc387635dfab8be90d8e6764c68f9d2", "score": "0.4316004", "text": "func NewRegistration() (record *Registration) {\n\treturn new(Registration)\n}", "title": "" }, { "docid": "cf54ac38a6b490a652a2f07b7b0d62ad", "score": "0.43094626", "text": "func NewModule(ID string) (Module, error) {\n\tmodule := Module{}\n\tfieldList := \"`id`, `title`, `content`, `code`, `credits`, `year`, `institution`\"\n\tsql := \"SELECT \" + fieldList + \" FROM `institution_module` WHERE id=? \"\n\tquery, err := database.Connection.Prepare(sql)\n\tif err != nil {\n\t\treturn module, err\n\t}\n\terr = query.QueryRow(ID).Scan(&module.id, &module.title, &module.content, &module.code, &module.credits, &module.year, &module.institution)\n\treturn module, err\n}", "title": "" }, { "docid": "7bb6f367fb626f1cd7325c58a2d1f301", "score": "0.43092203", "text": "func newOperator(req *pb.HandleSQLsRequest, reg *regexp.Regexp) *Operator {\n\treturn &Operator{\n\t\tuuid: uuid.NewV4().String(),\n\t\tReq: req,\n\t\treg: reg,\n\t}\n}", "title": "" }, { "docid": "d1e8752f36ad9f6aa202550c3a304c7e", "score": "0.4304455", "text": "func newBucket(opts RateOpts) *bucket {\n\treturn &bucket{\n\t\topts: opts,\n\t}\n}", "title": "" }, { "docid": "56fa854c21cc1e4d9f9108696e35e7fd", "score": "0.43044087", "text": "func NewInitiator()(*Initiator) {\n m := &Initiator{\n Identity: *NewIdentity(),\n }\n odataTypeValue := \"#microsoft.graph.initiator\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "title": "" }, { "docid": "620cfe3e643849380dfab2d85ec6031a", "score": "0.42911237", "text": "func (s Metadata_license) NewNotices() (util.LocalizedText, error) {\n\tss, err := util.NewLocalizedText(s.Struct.Segment())\n\tif err != nil {\n\t\treturn util.LocalizedText{}, err\n\t}\n\terr = s.Struct.SetPtr(6, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "620cfe3e643849380dfab2d85ec6031a", "score": "0.42911237", "text": "func (s Metadata_license) NewNotices() (util.LocalizedText, error) {\n\tss, err := util.NewLocalizedText(s.Struct.Segment())\n\tif err != nil {\n\t\treturn util.LocalizedText{}, err\n\t}\n\terr = s.Struct.SetPtr(6, ss.Struct.ToPtr())\n\treturn ss, err\n}", "title": "" }, { "docid": "c361086be107fae26c7f0e2c700d7519", "score": "0.42906553", "text": "func NewEducationStudent()(*EducationStudent) {\n m := &EducationStudent{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "ca54aa24de52c4cb87197f22ad249123", "score": "0.42875928", "text": "func newIndexedSequence(idx int, seq string) *indexedSequence {\n\tis := indexedSequence{idx, seq}\n\treturn &is\n}", "title": "" }, { "docid": "8f5af008f1f0a1234ecda74999dbb67e", "score": "0.4280866", "text": "func NewInf(s string) E {\n\treturn newInfrastructure(s, 1)\n}", "title": "" }, { "docid": "8c141b61a6e53c3b0fa15caf40035603", "score": "0.42705226", "text": "func NewAccounting(symbol string, precision int, thousand, decimal, format, formatNegative, formatZero string) *Accounting {\n\tac := &Accounting{\n\t\tSymbol: symbol,\n\t\tPrecision: precision,\n\t\tThousand: thousand,\n\t\tDecimal: decimal,\n\t\tFormat: format,\n\t\tFormatNegative: formatNegative,\n\t\tFormatZero: formatZero,\n\t}\n\tac.isInitialized = true\n\treturn ac\n}", "title": "" }, { "docid": "eda18079e7958818befd3fcad8b47c25", "score": "0.42544568", "text": "func newInterval(g graph.Directed, head graph.Node) *Interval {\n\treturn &Interval{\n\t\tg: g,\n\t\tHead: head,\n\t\tnodes: map[int64]graph.Node{\n\t\t\thead.ID(): head,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "f6289c9004a0deaa2ed529d11caca2e2", "score": "0.4251877", "text": "func (o *LinkCallbackMetadata) SetInstitution(v LinkDeliveryInstitution) {\n\to.Institution = &v\n}", "title": "" }, { "docid": "d6c31d60ad25e57f980a014c1793fd92", "score": "0.42516682", "text": "func newEquipment(head, neck, torso, righthand, lefthand,\n\tpants *Item) *equipment {\n\n\t// Return the address of the new equipment object.\n\treturn &equipment{head, neck, torso, righthand, lefthand, pants}\n}", "title": "" }, { "docid": "28c286d137c0b87bb58c3a84beaef348", "score": "0.42498386", "text": "func newInstTracer() *instTracer {\n\tt := &instTracer{\n\t\tinflightInst: map[string]tracing.Task{},\n\t}\n\treturn t\n}", "title": "" }, { "docid": "e5cbe605197653054d86a60bdc28c38c", "score": "0.42492777", "text": "func newSUT(writer io.Writer) *publisher {\n\treturn New(writer)\n}", "title": "" }, { "docid": "781350adb3e7e32e375111553fb1159d", "score": "0.42486596", "text": "func New(accountReference insolar.Reference) (*Wallet, error) {\n\tif accountReference.IsEmpty() {\n\t\treturn nil, fmt.Errorf(\"reference is empty\")\n\t}\n\taccounts := make(foundation.StableMap)\n\t// TODO: Think about creating of new types of assets and initial balance\n\taccounts[XNS] = accountReference.String()\n\n\treturn &Wallet{\n\t\tAccounts: accounts,\n\t}, nil\n}", "title": "" }, { "docid": "e80884255adc3a533edc53a791098cd1", "score": "0.42450684", "text": "func New(ID string, g game.Game, p player.Player) Authorization {\n\treturn Authorization{ID: ID, Game: g, Player: p}\n}", "title": "" }, { "docid": "12b4e6c2081a3cfd090e518026e2eb5f", "score": "0.42409164", "text": "func newWithIOTA(seed string, depth uint64, mwm uint64, sdk sdk.Contract) *publisher {\n\treturn &publisher{\n\t\tseed: seed,\n\t\tdepth: depth,\n\t\tmwm: mwm,\n\t\tsdk: sdk,\n\t}\n}", "title": "" }, { "docid": "04a224ebae36a24d9b7c59ae14a483be", "score": "0.4240142", "text": "func New(oc *clusterinfo.OpenShift, infraStatus *config.InfrastructureStatus) (*Provider, error) {\n\treturn &Provider{\n\t\toc: oc,\n\t\tInfrastructureStatus: infraStatus,\n\t}, nil\n}", "title": "" }, { "docid": "27e82173fd81edfb26284cab52777872", "score": "0.42395824", "text": "func NewOperation(location, name, description string, size int, recentUnit, unit time.Duration, provider counter.Provider) Operation {\n\tnewCounter := func() window.Operation { return window.NewOperation(size, recentUnit, unit, provider) }\n\treturn Operation{\n\t\tIdentity: Identity{\n\t\t\tLocation: location,\n\t\t\tDescription: description,\n\t\t\tName: name,\n\t\t},\n\t\tOperation: newCounter(),\n\t\treset: newCounter,\n\t}\n}", "title": "" }, { "docid": "7814dd81f7ed1825be3fbdeb39f4a257", "score": "0.42395025", "text": "func NewGate(g string) (Gate, error) {\n\tg = strings.ToLower(g)\n\n\tswitch gate := Gate(g); gate {\n\tcase GateBitcoin, GateEthereum:\n\t\treturn gate, nil\n\t}\n\n\treturn \"\", ErrUnknownGate\n}", "title": "" }, { "docid": "0a4eb5a536d2f0142dde97b9074337b9", "score": "0.4235585", "text": "func NewCitationTemplate()(*CitationTemplate) {\n m := &CitationTemplate{\n FilePlanDescriptorTemplate: *NewFilePlanDescriptorTemplate(),\n }\n return m\n}", "title": "" }, { "docid": "5d1531c1890e2b8376f0e9c8d87a4885", "score": "0.42337173", "text": "func (d *driver) NewGraph(ctx context.Context, id string) (storage.Graph, error) {\n\terr := d.db.Update(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(graphBucket))\n\t\tif b == nil {\n\t\t\treturn fmt.Errorf(\"inconsistent driver failed to retrieve top bucket %q\", graphBucket)\n\t\t}\n\t\t_, err := b.CreateBucket([]byte(id))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create new graph %q with error %v\", id, err)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &graph{\n\t\tid: id,\n\t\tdb: d.db,\n\t\tlb: d.lb,\n\t}, nil\n}", "title": "" }, { "docid": "5e876f39076b63a38bd8f45f4226623c", "score": "0.4231158", "text": "func newNetworks(c *ArchonClient, namespace string) *networks {\n\treturn &networks{\n\t\tclient: c.RESTClient(),\n\t\tns: namespace,\n\t}\n}", "title": "" }, { "docid": "59ac2ba486c68c893ddd55c0c565e75f", "score": "0.42292482", "text": "func NewITellor(address common.Address, backend bind.ContractBackend) (*ITellor, error) {\n\tcontract, err := bindITellor(address, backend, backend, backend)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &ITellor{ITellorCaller: ITellorCaller{contract: contract}, ITellorTransactor: ITellorTransactor{contract: contract}, ITellorFilterer: ITellorFilterer{contract: contract}}, nil\n}", "title": "" }, { "docid": "eb2835caa830fba02e1c4fe6c990c00f", "score": "0.42264715", "text": "func New() *Ordercron {\n return NewWithLocation(time.Now().Location())\n}", "title": "" }, { "docid": "17597aab881bda561f085fd40647e27d", "score": "0.4225874", "text": "func newAssociatedStation(vres *stationviews.AssociatedStationView) *AssociatedStation {\n\tres := &AssociatedStation{}\n\tif vres.Hidden != nil {\n\t\tres.Hidden = *vres.Hidden\n\t}\n\tif vres.Project != nil {\n\t\tres.Project = make([]*AssociatedViaProject, len(vres.Project))\n\t\tfor i, val := range vres.Project {\n\t\t\tres.Project[i] = transformStationviewsAssociatedViaProjectViewToAssociatedViaProject(val)\n\t\t}\n\t}\n\tif vres.Location != nil {\n\t\tres.Location = make([]*AssociatedViaLocation, len(vres.Location))\n\t\tfor i, val := range vres.Location {\n\t\t\tres.Location[i] = transformStationviewsAssociatedViaLocationViewToAssociatedViaLocation(val)\n\t\t}\n\t}\n\tif vres.Manual != nil {\n\t\tres.Manual = make([]*AssociatedViaManual, len(vres.Manual))\n\t\tfor i, val := range vres.Manual {\n\t\t\tres.Manual[i] = transformStationviewsAssociatedViaManualViewToAssociatedViaManual(val)\n\t\t}\n\t}\n\tif vres.Station != nil {\n\t\tres.Station = newStationFull(vres.Station)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "f1b9a9c6a6c0d26377465260501b0dff", "score": "0.42235607", "text": "func (c *Client) NewRegistration(accountKey interface{}) (reg Registration, err error) {\n\treg, err = c.registration(accountKey, Registration{}, resourceNewRegistration, c.resources.NewRegistration)\n\tif err != nil || reg.Agreement == c.Terms() {\n\t\treturn\n\t}\n\treg.Agreement = c.Terms()\n\treg, err = c.UpdateRegistration(accountKey, reg)\n\treturn reg, err\n}", "title": "" }, { "docid": "d3de0b18661afa2ae130575e2495f911", "score": "0.42196837", "text": "func NewPublication(domain string, prettyName string) *Publication {\n\tif prettyName == \"\" {\n\t\tprettyName = strippedDomain(domain)\n\t}\n\tpub := &Publication{}\n\tpub.Domains = []string{domain}\n\tpub.PrettyName = prettyName\n\tpub.ShortName = genShortName(pub.PrettyName)\n\n\t// strip leading \"the\"s for more natural sort order\n\tpub.SortName = stripThePat.ReplaceAllLiteralString(strings.ToLower(pub.PrettyName), \"\")\n\n\tpub.HomeURL = \"http://\" + domain\n\n\treturn pub\n}", "title": "" }, { "docid": "322da72ee4569b0b8c1aa73ba7eb771b", "score": "0.421659", "text": "func NewUPC() Provider {\n\treturn &gtin{\n\t\tdigit: 12,\n\t\tisPositionCorrection: true,\n\t}\n}", "title": "" }, { "docid": "9d339a15b5d2dd5014bd006f350e78fa", "score": "0.4215948", "text": "func CreateNewOrganization(id string, name string, url string) Organization {\n\treturn Organization{\n\t\tID: id,\n\t\tName: name,\n\t\tURL: url,\n\t}\n}", "title": "" }, { "docid": "4438adc1e20a233b00d6f9b3a877dd56", "score": "0.42117694", "text": "func NewBackend(ctx *pulumi.Context,\n\tname string, args *BackendArgs, opts ...pulumi.ResourceOption) (*Backend, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.BackendName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'BackendName'\")\n\t}\n\tif args.BackendType == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'BackendType'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Backend\n\terr := ctx.RegisterResource(\"alicloud:apigateway/backend:Backend\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "097fd564e2a7a7f924e52632016a2a4a", "score": "0.42085722", "text": "func New(src string, dest string) Unxz {\n\treturn Unxz{src, dest}\n}", "title": "" }, { "docid": "e89be827a0dbd18c6eabc043d708e3af", "score": "0.42062664", "text": "func (t *Transport) NewOutbound(chooser peer.Chooser, opts ...OutboundOption) *Outbound {\n\to := &Outbound{\n\t\tonce: lifecycle.NewOnce(),\n\t\tchooser: chooser,\n\t\turlTemplate: defaultURLTemplate,\n\t\ttracer: t.tracer,\n\t\ttransport: t,\n\t\tbothResponseError: true,\n\t}\n\tfor _, opt := range opts {\n\t\topt(o)\n\t}\n\n\tclient := t.client\n\tif o.tlsConfig != nil {\n\t\tclient = createTLSClient(o)\n\t\t// Create a copy of the url template to avoid scheme changes impacting\n\t\t// other outbounds as the base url template is shared across http\n\t\t// outbounds.\n\t\tut := *o.urlTemplate\n\t\tut.Scheme = \"https\"\n\t\to.urlTemplate = &ut\n\t}\n\to.client = client\n\to.sender = &transportSender{Client: client}\n\treturn o\n}", "title": "" }, { "docid": "2c3bfaf04f1a10196d767ca66ccf27ff", "score": "0.42052844", "text": "func (t *trie) putPatriciaNew(ptr patricia) error {\n\tvalue, err := ptr.serialize()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to encode patricia node\")\n\t}\n\tkey := ptr.hash()\n\tlogger.Debug().Hex(\"key\", key[:8]).Msg(\"putnew\")\n\treturn t.cb.PutIfNotExists(t.bucket, key[:], value, \"failed to put non-existing key = %x\", key)\n}", "title": "" }, { "docid": "ac4b24733437374d7ae8b7bb44c4192c", "score": "0.42047116", "text": "func newRelease(a Artist) int {\n\ta.Songs++\n\treturn a.Songs\n}", "title": "" } ]
82dcc637b2356538d2f4d17e4760b2c2
NewGetPacketAnalyzerParamsWithContext creates a new GetPacketAnalyzerParams object with the ability to set a context for a request.
[ { "docid": "17ad35a810a7ab55d4a850890b3b1cc8", "score": "0.85942715", "text": "func NewGetPacketAnalyzerParamsWithContext(ctx context.Context) *GetPacketAnalyzerParams {\n\treturn &GetPacketAnalyzerParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" } ]
[ { "docid": "543611b1ae5e5a4979ca52e9ac838742", "score": "0.7212432", "text": "func NewGetPacketAnalyzerParams() *GetPacketAnalyzerParams {\n\treturn &GetPacketAnalyzerParams{\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "763850d7c4f5800e6c5e54e212acebbd", "score": "0.69999534", "text": "func (o *GetPacketAnalyzerParams) WithContext(ctx context.Context) *GetPacketAnalyzerParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "af8c4d9671b32742f17c0a42bf28af51", "score": "0.66413116", "text": "func NewGetPacketAnalyzerParamsWithHTTPClient(client *http.Client) *GetPacketAnalyzerParams {\n\treturn &GetPacketAnalyzerParams{\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "2b2ec6c1bfa10bf864cdb027cde801de", "score": "0.6192225", "text": "func NewGetPacketAnalyzerParamsWithTimeout(timeout time.Duration) *GetPacketAnalyzerParams {\n\treturn &GetPacketAnalyzerParams{\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "f235afc602d51fe48fdefdcceb77fdb4", "score": "0.54189926", "text": "func (o *GetPacketAnalyzerParams) WithTimeout(timeout time.Duration) *GetPacketAnalyzerParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "ce38600a219d78835d87b41b42335037", "score": "0.54129505", "text": "func NewGetPolicyParamsWithContext(ctx context.Context) *GetPolicyParams {\n\treturn &GetPolicyParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "0802f6b7cdd51c84150c54bbbaed80a8", "score": "0.5373147", "text": "func NewGetParamsWithContext(ctx context.Context) *GetParams {\n\tvar ()\n\treturn &GetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "fcbf445934e43d8d7ec734fa17c40563", "score": "0.52534777", "text": "func NewGetVlansParamsWithContext(ctx context.Context) *GetVlansParams {\n\treturn &GetVlansParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "c074e29bde5d858babc8e48cebd2ff5b", "score": "0.5244069", "text": "func (o *GetPacketAnalyzerParams) WithHTTPClient(client *http.Client) *GetPacketAnalyzerParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "a68b8d74b775c4851080b4394ca9a8ea", "score": "0.5209978", "text": "func NewGetStateParamsWithContext(ctx context.Context) *GetStateParams {\n\tvar ()\n\treturn &GetStateParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "9e19105f9699f56be641773e7d73c018", "score": "0.51974785", "text": "func NewHealthGetParamsWithContext(ctx context.Context) *HealthGetParams {\n\n\treturn &HealthGetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "6ed19c4bbec7dc34697e57306619ea5d", "score": "0.51759326", "text": "func NewGetBancorInfoParamsWithContext(ctx context.Context) *GetBancorInfoParams {\n\tvar ()\n\treturn &GetBancorInfoParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "24e6a0a720ab6c6a5396ef04aec49314", "score": "0.51668", "text": "func NewGetAccountParamsWithContext(ctx context.Context) *GetAccountParams {\n\tvar ()\n\treturn &GetAccountParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "6c50dca7ccf9e35da8c65e58c4f63377", "score": "0.51356554", "text": "func (o *GetPacketAnalyzerParams) WithDefaults() *GetPacketAnalyzerParams {\n\to.SetDefaults()\n\treturn o\n}", "title": "" }, { "docid": "b08a21d245e18137b225bc0dd3d7ef0d", "score": "0.50583696", "text": "func NewGetStatsParamsWithContext(ctx context.Context) *GetStatsParams {\n\tvar (\n\t\tlimitDefault = int32(20)\n\t\toffsetDefault = int32(0)\n\t)\n\treturn &GetStatsParams{\n\t\tLimit: &limitDefault,\n\t\tOffset: &offsetDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "258bb1f434d33d97f99d26e0767ebb8b", "score": "0.50040054", "text": "func NewGetAddressSuggestionsUsingGETParamsWithContext(ctx context.Context) *GetAddressSuggestionsUsingGETParams {\n\tvar ()\n\treturn &GetAddressSuggestionsUsingGETParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "3b90db688272634d7d022637ec08bc75", "score": "0.4995935", "text": "func (o *GetPacketAnalyzerParams) WithID(id string) *GetPacketAnalyzerParams {\n\to.SetID(id)\n\treturn o\n}", "title": "" }, { "docid": "808847bd7e9b87fa61ede06eb7cdeda3", "score": "0.49883664", "text": "func NewGetPaymentMethodParamsWithContext(ctx context.Context) *GetPaymentMethodParams {\n\tvar ()\n\treturn &GetPaymentMethodParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "001b16ecf86e06906d91b60da2f424c5", "score": "0.49647593", "text": "func NewGetGatewayPackageParamsWithContext(ctx context.Context) *GetGatewayPackageParams {\n\tvar (\n\t\tgwDefault = string(\"default\")\n\t\ttidDefault = string(\"default\")\n\t)\n\treturn &GetGatewayPackageParams{\n\t\tGw: gwDefault,\n\t\tTid: tidDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "af8d03bc6ba9d179f432b97e486a6e21", "score": "0.49509537", "text": "func NewStreamManagerMetricsIncomingGetParamsWithContext(ctx context.Context) *StreamManagerMetricsIncomingGetParams {\n\n\treturn &StreamManagerMetricsIncomingGetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "53d86e532aaa03d6b5c7e6bd0d89316d", "score": "0.49410713", "text": "func NewGetDashboardsParamsWithContext(ctx context.Context) *GetDashboardsParams {\n\n\treturn &GetDashboardsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "f0d0be4b8ffbd71123dd11a90ca85f00", "score": "0.48788732", "text": "func (c *IoTWireless) GetNetworkAnalyzerConfigurationWithContext(ctx aws.Context, input *GetNetworkAnalyzerConfigurationInput, opts ...request.Option) (*GetNetworkAnalyzerConfigurationOutput, error) {\n\treq, out := c.GetNetworkAnalyzerConfigurationRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "cca8b833492ded254c09a6f248692278", "score": "0.48702848", "text": "func NewGetSopPaymentRequestDetailsUsingGETParamsWithContext(ctx context.Context) *GetSopPaymentRequestDetailsUsingGETParams {\n\tvar (\n\t\textendedMerchantCallbackDefault = bool(false)\n\t\tfieldsDefault = string(\"DEFAULT\")\n\t)\n\treturn &GetSopPaymentRequestDetailsUsingGETParams{\n\t\tExtendedMerchantCallback: &extendedMerchantCallbackDefault,\n\t\tFields: &fieldsDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "d24f2c962d4f91ae7de72cc0972c80e6", "score": "0.48699164", "text": "func NewGetAuthNetgroupParamsWithContext(ctx context.Context) *GetAuthNetgroupParams {\n\tvar ()\n\treturn &GetAuthNetgroupParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "a457c96436620592301f1bab76b9ab26", "score": "0.48542947", "text": "func NewVscanGetParamsWithContext(ctx context.Context) *VscanGetParams {\n\treturn &VscanGetParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "3c0676381b328d90ec6ba4efc15c1b0c", "score": "0.4853449", "text": "func NewGetCapabilityParamsWithContext(ctx context.Context) *GetCapabilityParams {\n\tvar ()\n\treturn &GetCapabilityParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "5fd095f1cda920d70de26f9a6607871d", "score": "0.48149154", "text": "func NewGetLoginJwtTokenParamsWithContext(ctx context.Context) *GetLoginJwtTokenParams {\n\treturn &GetLoginJwtTokenParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "f4c161ee5214f9a7828d30accece8a88", "score": "0.4788541", "text": "func NewVersionGetParamsWithContext(ctx context.Context) *VersionGetParams {\n\n\treturn &VersionGetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "c7b76e8eceffff7cc254a7283ea7f9ad", "score": "0.47600666", "text": "func NewGetTaskParamsWithContext(ctx context.Context) *GetTaskParams {\n\tvar ()\n\treturn &GetTaskParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "a666f1ba93f12ea584b6a8813b400952", "score": "0.47563422", "text": "func NewGetZoneParamsWithContext(ctx context.Context) *GetZoneParams {\n\tvar ()\n\treturn &GetZoneParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "4ea6ac612bb4ad46333bad189f876035", "score": "0.47350848", "text": "func NewGetProcessParamsWithContext(ctx context.Context) *GetProcessParams {\n\tvar ()\n\treturn &GetProcessParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "0756f716b07fed3539f3a21bb81852b0", "score": "0.47302777", "text": "func NewGetMappingDumpParamsWithContext(ctx context.Context) *GetMappingDumpParams {\n\tvar ()\n\treturn &GetMappingDumpParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "dbbc410bb6147108a3a5c1a04c0ed393", "score": "0.47223285", "text": "func NewGetPackagesParamsWithContext(ctx context.Context) *GetPackagesParams {\n\tvar ()\n\treturn &GetPackagesParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "3af367becfbe76858120aa5e0ce9e34e", "score": "0.4688694", "text": "func NewGetImagesParamsWithContext(ctx context.Context) *GetImagesParams {\n\treturn &GetImagesParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "84ebc28fe5f8ee17bdd8baa7b76bac50", "score": "0.4676955", "text": "func NewGetCheckMetricDataParamsWithContext(ctx context.Context) *GetCheckMetricDataParams {\n\treturn &GetCheckMetricDataParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "cfba440e1ea6cdf6a0cd11094c1f33c8", "score": "0.4658407", "text": "func NewWorkflowsGetByInstanceIDParamsWithContext(ctx context.Context) *WorkflowsGetByInstanceIDParams {\n\tvar ()\n\treturn &WorkflowsGetByInstanceIDParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "dd109990d96d558c0eb20fef2ad74c51", "score": "0.46550515", "text": "func NewGetNetworkNetflowSettingsParamsWithContext(ctx context.Context) *GetNetworkNetflowSettingsParams {\n\tvar ()\n\treturn &GetNetworkNetflowSettingsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "b38004f704be163e788e44f89f699f4b", "score": "0.46482766", "text": "func NewGetTagsParamsWithContext(ctx context.Context) *GetTagsParams {\n\n\treturn &GetTagsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "9df554e81483609ac25860e0c331cb24", "score": "0.4643999", "text": "func NewGetCDNIpsParamsWithContext(ctx context.Context) *GetCDNIpsParams {\n\tvar (\n\t\tfilterDefault = string(\"ALL\")\n\t\tresponseTypeDefault = string(\"JSON\")\n\t)\n\treturn &GetCDNIpsParams{\n\t\tFilter: &filterDefault,\n\t\tResponseType: &responseTypeDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "58786d0ff1e56486901424b309f9b65c", "score": "0.4643454", "text": "func NewCifsDomainGetParamsWithContext(ctx context.Context) *CifsDomainGetParams {\n\treturn &CifsDomainGetParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "4835e6e29b5b1a9a2797a31fdb48af75", "score": "0.4629226", "text": "func NewGetNamespaceParamsWithContext(ctx context.Context) *GetNamespaceParams {\n\tvar ()\n\treturn &GetNamespaceParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "ed539aa41c3a1decd0830c2c0f6ab317", "score": "0.4619081", "text": "func NewGetPublicGetInstrumentsParamsWithContext(ctx context.Context) *GetPublicGetInstrumentsParams {\n\tvar (\n\t\texpiredDefault = bool(false)\n\t)\n\treturn &GetPublicGetInstrumentsParams{\n\t\tExpired: &expiredDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "240ce53fb8a430bbab2356e648ea7796", "score": "0.46032", "text": "func NewGetEventsParamsWithContext(ctx context.Context) *GetEventsParams {\n\tvar (\n\t\tcontextIdDefault = string(\"_default\")\n\t\tcountDefault = int32(10)\n\t\tindexDefault = int32(0)\n\t\tkeywordsDefault = string(\"\")\n\t\treportDefault = string(\"\")\n\t\ttransformDefault = string(\"\")\n\t)\n\treturn &GetEventsParams{\n\t\tContextID: &contextIdDefault,\n\t\tCount: &countDefault,\n\t\tIndex: &indexDefault,\n\t\tKeywords: &keywordsDefault,\n\t\tReport: &reportDefault,\n\t\tTransform: &transformDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "ae8f2586339af802490b48ca176d39d3", "score": "0.4587723", "text": "func NewTranslationsGetParamsWithContext(ctx context.Context) *TranslationsGetParams {\n\tvar ()\n\treturn &TranslationsGetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "153ec70fc5c4564a4fb04494c88a15d6", "score": "0.4584276", "text": "func NewGetKubeConfigUsingGETParamsWithContext(ctx context.Context) *GetKubeConfigUsingGETParams {\n\treturn &GetKubeConfigUsingGETParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "d24adc6af22a113e672530e4a9c2a882", "score": "0.45709017", "text": "func NewRouteGetByParamsParamsWithContext(ctx context.Context) *RouteGetByParamsParams {\n\treturn &RouteGetByParamsParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "642e42434813ea8f3eb096ff47703de0", "score": "0.45703822", "text": "func NewGetSampleV2ParamsWithContext(ctx context.Context) *GetSampleV2Params {\n\treturn &GetSampleV2Params{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "fe3b666f70bf881814967f90131d8793", "score": "0.4558091", "text": "func NewGetPositionsParamsWithContext(ctx context.Context) *GetPositionsParams {\n\n\treturn &GetPositionsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "30438000a9a3868398dbeea8398270e2", "score": "0.45541403", "text": "func NewGetFeedParamsWithContext(ctx context.Context) *GetFeedParams {\n\tvar ()\n\treturn &GetFeedParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "051ce13aafa8d0fee8093ee1462bf7ec", "score": "0.45525864", "text": "func (o *GetPolicyParams) WithContext(ctx context.Context) *GetPolicyParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "e0607372a529abab21e34b9ab851ab22", "score": "0.45358944", "text": "func NewGetAllRoutingInstancesUsingGETParamsWithContext(ctx context.Context) *GetAllRoutingInstancesUsingGETParams {\n\tvar (\n\t\tpageNumberDefault = int32(1)\n\t\tpageSizeDefault = int32(900)\n\t)\n\treturn &GetAllRoutingInstancesUsingGETParams{\n\t\tPageNumber: pageNumberDefault,\n\t\tPageSize: pageSizeDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "ed19887480892b99d88e6e1ed74b8160", "score": "0.45186076", "text": "func NewGetOctopusPackageMetadataParamsWithContext(ctx context.Context) *GetOctopusPackageMetadataParams {\n\tvar ()\n\treturn &GetOctopusPackageMetadataParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "dd94726fb4bdcbbd0fe592f6c0938817", "score": "0.45182326", "text": "func NewGetSitesParamsWithContext(ctx context.Context) *GetSitesParams {\n\treturn &GetSitesParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "e3fe4d28dd8e591a790ffd40939f5626", "score": "0.4505058", "text": "func NewGetPolicyParams() *GetPolicyParams {\n\treturn &GetPolicyParams{\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "b771f14d6e0b89e7b7df8bd2160edd04", "score": "0.44786328", "text": "func NewGetPrivatesStackParamsWithContext(ctx context.Context) *GetPrivatesStackParams {\n\n\treturn &GetPrivatesStackParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "d33a6286681905febdf34277f30b7d1a", "score": "0.44698653", "text": "func NewGetSmbLogLevelFilterParamsWithContext(ctx context.Context) *GetSmbLogLevelFilterParams {\n\tvar ()\n\treturn &GetSmbLogLevelFilterParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "a260fe43fce46a641d46b82409f33807", "score": "0.44636208", "text": "func NewGetCwfParamsWithContext(ctx context.Context) *GetCwfParams {\n\n\treturn &GetCwfParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "bbe776efc4247f4f89835b2ac6f16ed8", "score": "0.44482723", "text": "func NewGetMitreReportParamsWithContext(ctx context.Context) *GetMitreReportParams {\n\treturn &GetMitreReportParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "b6532198e237185c2282275a7b6b4989", "score": "0.4430664", "text": "func NewGetNetworkPoolsParamsWithContext(ctx context.Context) *GetNetworkPoolsParams {\n\tvar ()\n\treturn &GetNetworkPoolsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "f4db7fd104cdc57d138603128e27b51c", "score": "0.4414258", "text": "func (o *GetParams) WithContext(ctx context.Context) *GetParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "2f990d13f5b5fc585a8e2b669db52ee8", "score": "0.44133687", "text": "func NewGetTrustedCACertificatesUsingGETParamsWithContext(ctx context.Context) *GetTrustedCACertificatesUsingGETParams {\n\tvar ()\n\treturn &GetTrustedCACertificatesUsingGETParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "abd9547cca8d69d3e9099cf7c12809f2", "score": "0.43970662", "text": "func NewGetRuntimeMapEntryParamsWithContext(ctx context.Context) *GetRuntimeMapEntryParams {\n\tvar ()\n\treturn &GetRuntimeMapEntryParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "5bf1f4b8a76f0894264862f338e67eaf", "score": "0.43900576", "text": "func NewGetTvlpResultParamsWithContext(ctx context.Context) *GetTvlpResultParams {\n\treturn &GetTvlpResultParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "60087446cb581bb014964244c5e9bc19", "score": "0.4389538", "text": "func NewGetIngredientsParamsWithContext(ctx context.Context) *GetIngredientsParams {\n\tvar (\n\t\tlimitDefault = int64(50)\n\t\tpageDefault = int64(1)\n\t)\n\treturn &GetIngredientsParams{\n\t\tLimit: &limitDefault,\n\t\tPage: &pageDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "5626a85f6bdf64dbf0326bf30c38b6b0", "score": "0.4382953", "text": "func NewGetScopeHostnamesParamsWithContext(ctx context.Context) *GetScopeHostnamesParams {\n\tvar ()\n\treturn &GetScopeHostnamesParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "66deb2b2c4d1ef5d014dd0ed118b0b00", "score": "0.43798774", "text": "func NewGetAddonConfigParamsWithContext(ctx context.Context) *GetAddonConfigParams {\n\tvar ()\n\treturn &GetAddonConfigParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "75ced02ad63e479cf16208e414886e7a", "score": "0.43797725", "text": "func NewGetWidgetsParamsWithContext(ctx context.Context) *GetWidgetsParams {\n\tvar (\n\t\tacceptDefault = string(\"application/json\")\n\t\tcontentTypeDefault = string(\"application/json\")\n\t)\n\treturn &GetWidgetsParams{\n\t\tAccept: &acceptDefault,\n\t\tContentType: &contentTypeDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "b05d5d9cd12f0c896aa46913fe5f6fda", "score": "0.4372883", "text": "func NewGetIssueUsingGETParamsWithContext(ctx context.Context) *GetIssueUsingGETParams {\n\tvar ()\n\treturn &GetIssueUsingGETParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "d8795ff0944164c7b2227d72e1e6c9f3", "score": "0.4369949", "text": "func NewGetAppParams() GetAppParams {\n\n\treturn GetAppParams{}\n}", "title": "" }, { "docid": "486534e6e1f0dd0b2cb6a2bb8244f952", "score": "0.43588325", "text": "func NewGetDecisionsUsingGETParamsWithContext(ctx context.Context) *GetDecisionsUsingGETParams {\n\tvar ()\n\treturn &GetDecisionsUsingGETParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8f74888ec0c0a58ead7fd61aa5772cc8", "score": "0.43557253", "text": "func NewGetLdapGroupsSearchParamsWithContext(ctx context.Context) *GetLdapGroupsSearchParams {\n\tvar ()\n\treturn &GetLdapGroupsSearchParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "aa5821eebc4d0f9cc6194e7e0a5905c3", "score": "0.43433616", "text": "func NewGetByPluginAssetsByPathParamsWithContext(ctx context.Context) *GetByPluginAssetsByPathParams {\n\tvar ()\n\treturn &GetByPluginAssetsByPathParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "4f3809c72c2cc7b30a4c6cb5d39c1f9e", "score": "0.43422624", "text": "func NewSvmMigrationVolumeGetParamsWithContext(ctx context.Context) *SvmMigrationVolumeGetParams {\n\treturn &SvmMigrationVolumeGetParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "94874343ee61b85de21b0a6b751c50af", "score": "0.43379623", "text": "func NewGetAllPluginConfigurationParamsWithContext(ctx context.Context) *GetAllPluginConfigurationParams {\n\treturn &GetAllPluginConfigurationParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "e4ce45117f0c2960e8115abb18c3bcff", "score": "0.43293515", "text": "func NewGetRegistrationRequestParamsWithContext(ctx context.Context) *GetRegistrationRequestParams {\n\n\treturn &GetRegistrationRequestParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "3329aded2bc4e714155e06757ce8cf95", "score": "0.43141434", "text": "func (c *APIGateway) GetRequestValidatorsWithContext(ctx aws.Context, input *GetRequestValidatorsInput, opts ...request.Option) (*GetRequestValidatorsOutput, error) {\n\treq, out := c.GetRequestValidatorsRequest(input)\n\treq.SetContext(ctx)\n\treq.ApplyOptions(opts...)\n\treturn out, req.Send()\n}", "title": "" }, { "docid": "6a60006aea36d5b7c89f753e2409de24", "score": "0.43044287", "text": "func NewRbacPermissionsGetParamsWithContext(ctx context.Context) *RbacPermissionsGetParams {\n\tvar ()\n\treturn &RbacPermissionsGetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "6cd4f369e8bad9d2aa14ef765662b2a4", "score": "0.42814875", "text": "func NewGetZonesParamsWithContext(ctx context.Context) *GetZonesParams {\n\treturn &GetZonesParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8278e85279e9248135e5a05b0ef6f7de", "score": "0.4272105", "text": "func NewAPIKeyEnableParamsWithContext(ctx context.Context) *APIKeyEnableParams {\n\tvar ()\n\treturn &APIKeyEnableParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8636986ba30115821d86d3c512dd320f", "score": "0.42500544", "text": "func NewLunCollectionGetParamsWithContext(ctx context.Context) *LunCollectionGetParams {\n\treturn &LunCollectionGetParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "3ba05ce9c2540b51d251012d5a33b251", "score": "0.42485347", "text": "func NewGetAccountParams() *GetAccountParams {\n\tvar ()\n\treturn &GetAccountParams{\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "48722e1fbd364207641521050410ebb3", "score": "0.42435187", "text": "func NewGetNetworksNetworkIDPrometheusAlertConfigParamsWithContext(ctx context.Context) *GetNetworksNetworkIDPrometheusAlertConfigParams {\n\tvar ()\n\treturn &GetNetworksNetworkIDPrometheusAlertConfigParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "262a30c4cc12a3f4a7fc0d18108dfd7d", "score": "0.42432246", "text": "func NewSMSInboundAutomationGetParamsWithContext(ctx context.Context) *SMSInboundAutomationGetParams {\n\tvar ()\n\treturn &SMSInboundAutomationGetParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "a5bca85a463255c93ebb7cda9b39eb25", "score": "0.42398843", "text": "func NewGetNamespaceUsingGETParamsWithContext(ctx context.Context) *GetNamespaceUsingGETParams {\n\treturn &GetNamespaceUsingGETParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "8081d230d36a77d64f77bf0f6ef8ac7e", "score": "0.42243767", "text": "func NewGetTagParamsWithContext(ctx context.Context) *GetTagParams {\n\tvar ()\n\treturn &GetTagParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "c574041a9f0ad5360a32f5dd22013203", "score": "0.4224188", "text": "func NewGetNetStatusParamsWithContext(ctx context.Context) *GetNetStatusParams {\n\tvar ()\n\treturn &GetNetStatusParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "cda626729d5b22b37be6b34d8deff088", "score": "0.41902524", "text": "func NewGetAppcompsParamsWithContext(ctx context.Context) *GetAppcompsParams {\n\tvar ()\n\treturn &GetAppcompsParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "5e820471b204185e6b73736d0a422b1c", "score": "0.41824743", "text": "func NewGetAPIFeaturesParamsWithContext(ctx context.Context) *GetAPIFeaturesParams {\n\tvar ()\n\treturn &GetAPIFeaturesParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "219efa5e27590ab5e95a9e9c886f14c2", "score": "0.41795275", "text": "func NewGetWorkItemParamsWithContext(ctx context.Context) *GetWorkItemParams {\n\tvar ()\n\treturn &GetWorkItemParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "f9a9d8fde230be04d7b56167e639dcb7", "score": "0.41785282", "text": "func NewHelloWorldParamsWithContext(ctx context.Context) *HelloWorldParams {\n\n\treturn &HelloWorldParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "714d73f079c17d43aa9a5317822d04ca", "score": "0.41766348", "text": "func NewGetAdmissionPluginsParamsWithContext(ctx context.Context) *GetAdmissionPluginsParams {\n\treturn &GetAdmissionPluginsParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "d8ad92f6f257b638893f5f24c47aab13", "score": "0.41627342", "text": "func NewGetTriggerParamsWithContext(ctx context.Context) *GetTriggerParams {\n\tvar ()\n\treturn &GetTriggerParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "95dc80319d23b8218a67b023a94aa1d5", "score": "0.41605937", "text": "func NewGetQuotaQuotaParamsWithContext(ctx context.Context) *GetQuotaQuotaParams {\n\tvar ()\n\treturn &GetQuotaQuotaParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "4e1a40507cde590f6e7484b24b5eb96e", "score": "0.4158109", "text": "func (m *MockLambdaAPI) GetCodeSigningConfigWithContext(arg0 context.Context, arg1 *lambda.GetCodeSigningConfigInput, arg2 ...request.Option) (*lambda.GetCodeSigningConfigOutput, 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, \"GetCodeSigningConfigWithContext\", varargs...)\n\tret0, _ := ret[0].(*lambda.GetCodeSigningConfigOutput)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "f2001bec544099eb511e27332c9adc15", "score": "0.4149496", "text": "func NewLunAttributeDeleteParamsWithContext(ctx context.Context) *LunAttributeDeleteParams {\n\treturn &LunAttributeDeleteParams{\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "c487b7e3b83e3d72a52b6ab8bcb4a075", "score": "0.4144105", "text": "func NewGetPolicyParamsWithTimeout(timeout time.Duration) *GetPolicyParams {\n\treturn &GetPolicyParams{\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "27dfb7832ecc594715bb341ab0f02b9b", "score": "0.41424865", "text": "func NewGetOrganizationAccessParamsWithContext(ctx context.Context) *GetOrganizationAccessParams {\n\tvar (\n\t\torganizationIdDefault = int32(0)\n\t\tpageDefault = int32(1)\n\t\tpageSizeDefault = int32(10000)\n\t)\n\treturn &GetOrganizationAccessParams{\n\t\tOrganizationID: &organizationIdDefault,\n\t\tPage: &pageDefault,\n\t\tPageSize: &pageSizeDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "d30acd311318c282157a8173e7fcd839", "score": "0.41379276", "text": "func NewGetStickTablesParamsWithContext(ctx context.Context) *GetStickTablesParams {\n\tvar ()\n\treturn &GetStickTablesParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "c769da114a53df6b3f7f254f7114947e", "score": "0.41375545", "text": "func NewGetRequirementSettingParamsWithContext(ctx context.Context) *GetRequirementSettingParams {\n\tvar ()\n\treturn &GetRequirementSettingParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "1d495082ad13d29210b5856d93b6ddf9", "score": "0.41340324", "text": "func NewGetResourceActionsUsingGETParamsWithContext(ctx context.Context) *GetResourceActionsUsingGETParams {\n\tvar ()\n\treturn &GetResourceActionsUsingGETParams{\n\n\t\tContext: ctx,\n\t}\n}", "title": "" } ]
1d15e6544196d3ff1696b9b9a96edcee
BuildAddModeJSON helps building trivial JSON strings. The template is the template string or filepath. Every odd data argument is a variablename, every even one the previous variable's value
[ { "docid": "802aa20ba415cc7b18eaebfcc44c866f", "score": "0.8770476", "text": "func BuildAddModeJSON(template string, data ...string) string {\n\tbuff := bytes.NewBuffer([]byte{})\n\tbuff.WriteString(`{\"template\":\"`)\n\tbuff.WriteString(template)\n\tbuff.WriteString(`\"`)\n\tif len(data) != 0 && len(data)%2 == 0 {\n\t\tbuff.WriteString(`, \"variables\": {`)\n\t\tfor i, d := range data {\n\t\t\tbuff.WriteString(`\"`)\n\t\t\tbuff.WriteString(strings.Replace(tabRegex.ReplaceAllString(d, \"\\\\t\"), `\"`, `\\\"`, -1))\n\t\t\tif i%2 == 0 {\n\t\t\t\tbuff.WriteString(`\":`)\n\t\t\t} else if i+1 == len(data) {\n\t\t\t\tbuff.WriteString(`\"}`)\n\t\t\t} else {\n\t\t\t\tbuff.WriteString(`\",`)\n\t\t\t}\n\t\t}\n\n\t}\n\tbuff.WriteString(\"}\")\n\treturn buff.String()\n}", "title": "" } ]
[ { "docid": "c06913fa89aa00751f4919b1381de466", "score": "0.6543165", "text": "func BuildSetModeJSON(data ...string) string {\n\tbuff := bytes.NewBuffer([]byte{})\n\tif len(data)%2 != 0 {\n\t\tbuff.WriteString(\"{}\")\n\t} else {\n\t\tbuff.WriteString(\"{\")\n\t\tfor i, d := range data {\n\t\t\tbuff.WriteString(`\"`)\n\t\t\tbuff.WriteString(strings.Replace(tabRegex.ReplaceAllString(d, \"\\\\t\"), `\"`, `\\\"`, -1))\n\t\t\tif i%2 == 0 {\n\t\t\t\tbuff.WriteString(`\":`)\n\t\t\t} else if i+1 == len(data) {\n\t\t\t\tbuff.WriteString(`\"}`)\n\t\t\t} else {\n\t\t\t\tbuff.WriteString(`\",`)\n\t\t\t}\n\t\t}\n\t}\n\treturn buff.String()\n}", "title": "" }, { "docid": "7b574b58ece33ce3e8c3901040b29efa", "score": "0.5712152", "text": "func BuildReadModeJSON(eventListener string, properties ...string) string {\n\tbuff := bytes.NewBuffer([]byte{})\n\tbuff.WriteString(`{\"eventListener\":\"`)\n\tbuff.WriteString(eventListener)\n\tbuff.WriteString(`\"`)\n\tif len(properties) != 0 {\n\t\tbuff.WriteString(`, \"properties\":[`)\n\t\tfor i, p := range properties {\n\t\t\tbuff.WriteString(`\"`)\n\t\t\tbuff.WriteString(strings.Replace(tabRegex.ReplaceAllString(p, \"\\\\t\"), `\"`, `\\\"`, -1))\n\t\t\tbuff.WriteString(`\"`)\n\t\t\tif i+1 != len(properties) {\n\t\t\t\tbuff.WriteString(\",\")\n\t\t\t}\n\t\t}\n\t\tbuff.WriteString(`]`)\n\t}\n\tbuff.WriteString(\"}\")\n\treturn buff.String()\n}", "title": "" }, { "docid": "fccd45324c0c77d9cb9ede4d02806c6b", "score": "0.53963184", "text": "func buildJSONString(key string, value string) string {\n\tif key != \"tags\" {\n\t\treturn `\"` + key + `\": \"` + value + `\"`\n\t}\n\n\t// Handle value list\n\tvalue = strings.Trim(value, \"[]\")\n\ttags := strings.Split(value, \",\")\n\n\tvalueJSON := \"[\"\n\n\tfor i, tag := range tags {\n\t\ttags[i] = `\"` + strings.TrimSpace(tag) + `\"`\n\t}\n\tvalueJSON += strings.Join(tags, \",\")\n\tvalueJSON += \"]\"\n\n\treturn `\"` + key + `\": ` + valueJSON\n}", "title": "" }, { "docid": "837fd4ce52287b36bcf9060e31325b35", "score": "0.5296326", "text": "func SwaggerJsonTemplate() string {\n\tvar tmpl = \"{\\n\" +\n\t\t\" \\\"consumes\\\": [\\n\" +\n\t\t\" \\\"application/json\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"produces\\\": [\\n\" +\n\t\t\" \\\"application/json\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"swagger\\\": \\\"2.0\\\",\\n\" +\n\t\t\" \\\"info\\\": {\\n\" +\n\t\t\" \\\"title\\\": \\\"pkg/api/event.proto\\\",\\n\" +\n\t\t\" \\\"version\\\": \\\"version not set\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"paths\\\": {\\n\" +\n\t\t\" \\\"/v1/job-set/{queue}/{id}\\\": {\\n\" +\n\t\t\" \\\"post\\\": {\\n\" +\n\t\t\" \\\"produces\\\": [\\n\" +\n\t\t\" \\\"application/ndjson-stream\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"tags\\\": [\\n\" +\n\t\t\" \\\"Event\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"operationId\\\": \\\"GetJobSetEvents\\\",\\n\" +\n\t\t\" \\\"parameters\\\": [\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"name\\\": \\\"queue\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"path\\\",\\n\" +\n\t\t\" \\\"required\\\": true\\n\" +\n\t\t\" },\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"name\\\": \\\"id\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"path\\\",\\n\" +\n\t\t\" \\\"required\\\": true\\n\" +\n\t\t\" },\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"name\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"required\\\": true,\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSetRequest\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"responses\\\": {\\n\" +\n\t\t\" \\\"200\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A successful response.(streaming responses)\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"file\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Stream result of apiEventStreamMessage\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"error\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeStreamError\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"result\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiEventStreamMessage\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"default\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An unexpected error response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeError\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"/v1/job/cancel\\\": {\\n\" +\n\t\t\" \\\"post\\\": {\\n\" +\n\t\t\" \\\"tags\\\": [\\n\" +\n\t\t\" \\\"Submit\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"operationId\\\": \\\"CancelJobs\\\",\\n\" +\n\t\t\" \\\"parameters\\\": [\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"name\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"required\\\": true,\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobCancelRequest\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"responses\\\": {\\n\" +\n\t\t\" \\\"200\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A successful response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiCancellationResult\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"default\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An unexpected error response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeError\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"/v1/job/submit\\\": {\\n\" +\n\t\t\" \\\"post\\\": {\\n\" +\n\t\t\" \\\"tags\\\": [\\n\" +\n\t\t\" \\\"Submit\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"operationId\\\": \\\"SubmitJobs\\\",\\n\" +\n\t\t\" \\\"parameters\\\": [\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"name\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"required\\\": true,\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSubmitRequest\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"responses\\\": {\\n\" +\n\t\t\" \\\"200\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A successful response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSubmitResponse\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"default\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An unexpected error response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeError\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"/v1/queue/{name}\\\": {\\n\" +\n\t\t\" \\\"get\\\": {\\n\" +\n\t\t\" \\\"tags\\\": [\\n\" +\n\t\t\" \\\"Submit\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"operationId\\\": \\\"GetQueueInfo\\\",\\n\" +\n\t\t\" \\\"parameters\\\": [\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"name\\\": \\\"name\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"path\\\",\\n\" +\n\t\t\" \\\"required\\\": true\\n\" +\n\t\t\" }\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"responses\\\": {\\n\" +\n\t\t\" \\\"200\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A successful response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiQueueInfo\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"default\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An unexpected error response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeError\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"put\\\": {\\n\" +\n\t\t\" \\\"tags\\\": [\\n\" +\n\t\t\" \\\"Submit\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"operationId\\\": \\\"CreateQueue\\\",\\n\" +\n\t\t\" \\\"parameters\\\": [\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"name\\\": \\\"name\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"path\\\",\\n\" +\n\t\t\" \\\"required\\\": true\\n\" +\n\t\t\" },\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"name\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"body\\\",\\n\" +\n\t\t\" \\\"required\\\": true,\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiQueue\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"responses\\\": {\\n\" +\n\t\t\" \\\"200\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A successful response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {}\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"default\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An unexpected error response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeError\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"delete\\\": {\\n\" +\n\t\t\" \\\"tags\\\": [\\n\" +\n\t\t\" \\\"Submit\\\"\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"operationId\\\": \\\"DeleteQueue\\\",\\n\" +\n\t\t\" \\\"parameters\\\": [\\n\" +\n\t\t\" {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"name\\\": \\\"name\\\",\\n\" +\n\t\t\" \\\"in\\\": \\\"path\\\",\\n\" +\n\t\t\" \\\"required\\\": true\\n\" +\n\t\t\" }\\n\" +\n\t\t\" ],\\n\" +\n\t\t\" \\\"responses\\\": {\\n\" +\n\t\t\" \\\"200\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A successful response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {}\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"default\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An unexpected error response.\\\",\\n\" +\n\t\t\" \\\"schema\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/runtimeError\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"definitions\\\": {\\n\" +\n\t\t\" \\\"apiCancellationResult\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"cancelledIds\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiCause\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"default\\\": \\\"Error\\\",\\n\" +\n\t\t\" \\\"enum\\\": [\\n\" +\n\t\t\" \\\"Error\\\",\\n\" +\n\t\t\" \\\"Evicted\\\",\\n\" +\n\t\t\" \\\"OOM\\\"\\n\" +\n\t\t\" ]\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiContainerStatus\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"cause\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiCause\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"exitCode\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"message\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"reason\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiEventMessage\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"cancelled\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobCancelledEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"cancelling\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobCancellingEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"failed\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobFailedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"leaseExpired\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobLeaseExpiredEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"leaseReturned\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobLeaseReturnedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"leased\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobLeasedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"pending\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobPendingEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queued\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobQueuedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"reprioritized\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobReprioritizedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"running\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobRunningEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"submitted\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSubmittedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"succeeded\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSucceededEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminated\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobTerminatedEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"unableToSchedule\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobUnableToScheduleEvent\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"utilisation\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobUtilisationEvent\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiEventStreamMessage\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"id\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"message\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiEventMessage\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJob\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"annotations\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"clientId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"id\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"labels\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"namespace\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"owner\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podSpec\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodSpec\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podSpecs\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodSpec\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"priority\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"number\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"double\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"requiredNodeLabels\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobCancelRequest\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobCancelledEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobCancellingEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobFailedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"cause\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiCause\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"containerStatuses\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiContainerStatus\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"exitCodes\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kubernetesId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeName\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podNumber\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"reason\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobLeaseExpiredEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobLeaseReturnedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"reason\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobLeasedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobPendingEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kubernetesId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podNumber\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobQueuedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobReprioritizedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobRunningEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kubernetesId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeName\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podNumber\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSetInfo\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"leasedJobs\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queuedJobs\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSetRequest\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fromMessageId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"id\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"watch\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSubmitRequest\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"jobRequestItems\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSubmitRequestItem\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSubmitRequestItem\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"annotations\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"clientId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"labels\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"namespace\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podSpec\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodSpec\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podSpecs\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodSpec\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"priority\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"number\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"double\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"requiredNodeLabels\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSubmitResponse\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"jobResponseItems\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSubmitResponseItem\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSubmitResponseItem\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"error\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSubmittedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"job\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJob\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobSucceededEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kubernetesId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeName\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podNumber\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobTerminatedEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobUnableToScheduleEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kubernetesId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeName\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podNumber\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"reason\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiJobUtilisationEvent\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"MaxResourcesForPeriod\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/resourceQuantity\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"clusterId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"created\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"date-time\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"jobSetId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kubernetesId\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeName\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podNumber\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"queue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiQueue\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"groupOwners\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"priorityFactor\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"number\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"double\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resourceLimits\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"number\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"double\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"userOwners\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"apiQueueInfo\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"swagger:model\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"activeJobSets\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/apiJobSetInfo\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"intstrIntOrString\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"+protobuf=true\\\\n+protobuf.options.(gogoproto.goproto_stringer)=false\\\\n+k8s:openapi-gen=true\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"IntOrString is a type that can hold an int32 or a string. When used in\\\\nJSON or YAML marshalling and unmarshalling, it produces or consumes the\\\\ninner type. This allows you to have, for example, a JSON field that can\\\\naccept a name or number.\\\\nTODO: Rename to Int32OrString\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"IntVal\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"StrVal\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"Type\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/intstrType\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/apimachinery/pkg/util/intstr\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"intstrType\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Type represents the stored type of IntOrString.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/apimachinery/pkg/util/intstr\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"protobufAny\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"typeUrl\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"value\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"byte\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resourceQuantity\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The serialization format is:\\\\n\\\\n\\\\u003cquantity\\\\u003e ::= \\\\u003csignedNumber\\\\u003e\\\\u003csuffix\\\\u003e\\\\n(Note that \\\\u003csuffix\\\\u003e may be empty, from the \\\\\\\"\\\\\\\" case in \\\\u003cdecimalSI\\\\u003e.)\\\\n\\\\u003cdigit\\\\u003e ::= 0 | 1 | ... | 9\\\\n\\\\u003cdigits\\\\u003e ::= \\\\u003cdigit\\\\u003e | \\\\u003cdigit\\\\u003e\\\\u003cdigits\\\\u003e\\\\n\\\\u003cnumber\\\\u003e ::= \\\\u003cdigits\\\\u003e | \\\\u003cdigits\\\\u003e.\\\\u003cdigits\\\\u003e | \\\\u003cdigits\\\\u003e. | .\\\\u003cdigits\\\\u003e\\\\n\\\\u003csign\\\\u003e ::= \\\\\\\"+\\\\\\\" | \\\\\\\"-\\\\\\\"\\\\n\\\\u003csignedNumber\\\\u003e ::= \\\\u003cnumber\\\\u003e | \\\\u003csign\\\\u003e\\\\u003cnumber\\\\u003e\\\\n\\\\u003csuffix\\\\u003e ::= \\\\u003cbinarySI\\\\u003e | \\\\u003cdecimalExponent\\\\u003e | \\\\u003cdecimalSI\\\\u003e\\\\n\\\\u003cbinarySI\\\\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\\\\n(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\\\\n\\\\u003cdecimalSI\\\\u003e ::= m | \\\\\\\"\\\\\\\" | k | M | G | T | P | E\\\\n(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\\\\n\\\\u003cdecimalExponent\\\\u003e ::= \\\\\\\"e\\\\\\\" \\\\u003csignedNumber\\\\u003e | \\\\\\\"E\\\\\\\" \\\\u003csignedNumber\\\\u003e\\\\n\\\\nNo matter which of the three exponent forms is used, no quantity may represent\\\\na number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal\\\\nplaces. Numbers larger or more precise will be capped or rounded up.\\\\n(E.g.: 0.1m will rounded up to 1m.)\\\\nThis may be extended in the future if we require larger or smaller quantities.\\\\n\\\\nWhen a Quantity is parsed from a string, it will remember the type of suffix\\\\nit had, and will use the same type again when it is serialized.\\\\n\\\\nBefore serializing, Quantity will be put in \\\\\\\"canonical form\\\\\\\".\\\\nThis means that Exponent/suffix will be adjusted up or down (with a\\\\ncorresponding increase or decrease in Mantissa) such that:\\\\na. No precision is lost\\\\nb. No fractional digits will be emitted\\\\nc. The exponent (or suffix) is as large as possible.\\\\nThe sign will be omitted unless the number is negative.\\\\n\\\\nExamples:\\\\n1.5 will be serialized as \\\\\\\"1500m\\\\\\\"\\\\n1.5Gi will be serialized as \\\\\\\"1536Mi\\\\\\\"\\\\n\\\\nNote that the quantity will NEVER be internally represented by a\\\\nfloating point number. That is the whole point of this exercise.\\\\n\\\\nNon-canonical values will still parse as long as they are well formed,\\\\nbut will be re-emitted in their canonical form. (So always use canonical\\\\nform, or don't diff.)\\\\n\\\\nThis format is intended to make it difficult to use these numbers without\\\\nwriting some sort of special handling code in the hopes that that will\\\\ncause implementors to also use a fixed point implementation.\\\\n\\\\n+protobuf=true\\\\n+protobuf.embed=string\\\\n+protobuf.options.marshal=false\\\\n+protobuf.options.(gogoproto.goproto_stringer)=false\\\\n+k8s:deepcopy-gen=true\\\\n+k8s:openapi-gen=true\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Quantity is a fixed-point representation of a number.\\\\nIt provides convenient marshaling/unmarshaling in JSON and YAML,\\\\nin addition to String() and AsInt64() accessors.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/apimachinery/pkg/api/resource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runtimeError\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"code\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"details\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/protobufAny\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"error\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"message\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runtimeStreamError\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"details\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/protobufAny\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"grpcCode\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"httpCode\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"httpStatus\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"message\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1AWSElasticBlockStoreVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An AWS EBS disk must exist before mounting to a container. The disk\\\\nmust also be in the same AWS zone as the kubelet. An AWS EBS disk\\\\ncan only be mounted as read/write once. AWS EBS volumes support\\\\nownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Persistent Disk resource in AWS.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type of the volume that you want to mount.\\\\nTip: Ensure that the filesystem type is supported by the host operating system.\\\\nExamples: \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore\\\\nTODO: how do we prevent errors in the filesystem from compromising the machine\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"partition\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The partition in the volume that you want to mount.\\\\nIf omitted, the default is to mount by volume name.\\\\nExamples: For volume /dev/sda1, you specify the partition as \\\\\\\"1\\\\\\\".\\\\nSimilarly, the volume partition for /dev/sda is \\\\\\\"0\\\\\\\" (or you can leave the property empty).\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Partition\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify \\\\\\\"true\\\\\\\" to force and set the ReadOnly property in VolumeMounts to \\\\\\\"true\\\\\\\".\\\\nIf omitted, the default is \\\\\\\"false\\\\\\\".\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Unique ID of the persistent disk resource in AWS (Amazon EBS volume).\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeID\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Affinity\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Affinity is a group of affinity scheduling rules.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"nodeAffinity\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeAffinity\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podAffinity\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodAffinity\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"podAntiAffinity\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodAntiAffinity\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1AzureDataDiskCachingMode\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1AzureDataDiskKind\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1AzureDiskVolumeSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"cachingMode\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AzureDataDiskCachingMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"diskName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The Name of the data disk in the blob storage\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DiskName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"diskURI\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The URI the data disk in the blob storage\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DataDiskURI\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"kind\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AzureDataDiskKind\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1AzureFileVolumeSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"the name of secret that contains Azure Storage Account Name and Key\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SecretName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"shareName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Share Name\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ShareName\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1CSIVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Represents a source location of a volume to mount, managed by an external CSI driver\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"driver\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Driver is the name of the CSI driver that handles this volume.\\\\nConsult with your admin for the correct name as registered in the cluster.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Driver\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount. Ex. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\".\\\\nIf not provided, the empty value is passed to the associated CSI driver\\\\nwhich will determine the default filesystem to apply.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodePublishSecretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specifies a read-only configuration for the volume.\\\\nDefaults to false (read/write).\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeAttributes\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"VolumeAttributes stores driver-specific properties that are passed to the CSI\\\\ndriver. Consult your driver's documentation for supported values.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeAttributes\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Capabilities\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Adds and removes POSIX capabilities from running containers.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"add\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Added capabilities\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Capability\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Add\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"drop\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Removed capabilities\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Capability\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Drop\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Capability\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Capability represent POSIX capabilities type\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1CephFSVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Represents a Ceph Filesystem mount that lasts the lifetime of a pod\\\\nCephfs volumes do not support ownership management or SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"monitors\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Required: Monitors is a collection of Ceph monitors\\\\nMore info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Monitors\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Used as the mounted root, rather than the full Ceph tree, default is /\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\nMore info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretFile\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret\\\\nMore info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SecretFile\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"user\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: User is the rados user name, default is admin\\\\nMore info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"User\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1CinderVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A Cinder volume must exist before mounting to a container.\\\\nThe volume must also be in the same region as the kubelet.\\\\nCinder volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a cinder volume resource in Openstack.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nExamples: \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\nMore info: https://examples.k8s.io/mysql-cinder-pd/README.md\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\nMore info: https://examples.k8s.io/mysql-cinder-pd/README.md\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"volume id used to identify the volume in cinder.\\\\nMore info: https://examples.k8s.io/mysql-cinder-pd/README.md\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeID\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ConfigMapEnvSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The contents of the target ConfigMap's Data field will represent the\\\\nkey-value pairs as environment variables.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"ConfigMapEnvSource selects a ConfigMap to populate the environment\\\\nvariables with.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the ConfigMap must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ConfigMapKeySelector\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Selects a key from a ConfigMap.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"key\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The key to select.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Key\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the ConfigMap or its key must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ConfigMapProjection\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The contents of the target ConfigMap's Data field will be presented in a\\\\nprojected volume as files using the keys in the Data field as the file names,\\\\nunless the items element is populated with specific mappings of keys to paths.\\\\nNote that this is identical to a configmap volume source without the default\\\\nmode.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Adapts a ConfigMap into a projected volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If unspecified, each key-value pair in the Data field of the referenced\\\\nConfigMap will be projected into the volume as a file whose name is the\\\\nkey and content is the value. If specified, the listed keys will be\\\\nprojected into the specified paths, and unlisted keys will not be\\\\npresent. If a key is specified which is not present in the ConfigMap,\\\\nthe volume setup will error unless it is marked optional. Paths must be\\\\nrelative and may not contain the '..' path or start with '..'.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1KeyToPath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Items\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the ConfigMap or its keys must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ConfigMapVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The contents of the target ConfigMap's Data field will be presented in a\\\\nvolume as files using the keys in the Data field as the file names, unless\\\\nthe items element is populated with specific mappings of keys to paths.\\\\nConfigMap volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Adapts a ConfigMap into a volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"defaultMode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: mode bits to use on created files by default. Must be a\\\\nvalue between 0 and 0777. Defaults to 0644.\\\\nDirectories within the path are not affected by this setting.\\\\nThis might be in conflict with other options that affect the file\\\\nmode, like fsGroup, and the result can be other mode bits set.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DefaultMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If unspecified, each key-value pair in the Data field of the referenced\\\\nConfigMap will be projected into the volume as a file whose name is the\\\\nkey and content is the value. If specified, the listed keys will be\\\\nprojected into the specified paths, and unlisted keys will not be\\\\npresent. If a key is specified which is not present in the ConfigMap,\\\\nthe volume setup will error unless it is marked optional. Paths must be\\\\nrelative and may not contain the '..' path or start with '..'.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1KeyToPath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Items\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the ConfigMap or its keys must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Container\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"A single application container that you want to run within a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"args\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Arguments to the entrypoint.\\\\nThe docker image's CMD is used if this is not provided.\\\\nVariable references $(VAR_NAME) are expanded using the container's environment. If a variable\\\\ncannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax\\\\ncan be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\\\\nregardless of whether the variable exists or not.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Args\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"command\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Entrypoint array. Not executed within a shell.\\\\nThe docker image's ENTRYPOINT is used if this is not provided.\\\\nVariable references $(VAR_NAME) are expanded using the container's environment. If a variable\\\\ncannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax\\\\ncan be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\\\\nregardless of whether the variable exists or not.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Command\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"env\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of environment variables to set in the container.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvVar\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Env\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"envFrom\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of sources to populate environment variables in the container.\\\\nThe keys defined within a source must be a C_IDENTIFIER. All invalid keys\\\\nwill be reported as an event when the container is starting. When a key exists in multiple\\\\nsources, the value associated with the last source will take precedence.\\\\nValues defined by an Env with a duplicate key will take precedence.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvFromSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"EnvFrom\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"image\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Docker image name.\\\\nMore info: https://kubernetes.io/docs/concepts/containers/images\\\\nThis field is optional to allow higher level config management to default or override\\\\ncontainer images in workload controllers like Deployments and StatefulSets.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Image\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"imagePullPolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PullPolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"lifecycle\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Lifecycle\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"livenessProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the container specified as a DNS_LABEL.\\\\nEach container in a pod must have a unique name (DNS_LABEL).\\\\nCannot be updated.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"ports\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of ports to expose from the container. Exposing a port here gives\\\\nthe system additional information about the network connections a\\\\ncontainer uses, but is primarily informational. Not specifying a port here\\\\nDOES NOT prevent that port from being exposed. Any port which is\\\\nlistening on the default \\\\\\\"0.0.0.0\\\\\\\" address inside a container will be\\\\naccessible from the network.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=containerPort\\\\n+patchStrategy=merge\\\\n+listType=map\\\\n+listMapKey=containerPort\\\\n+listMapKey=protocol\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ContainerPort\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Ports\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readinessProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resources\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceRequirements\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"securityContext\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecurityContext\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"startupProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"stdin\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container should allocate a buffer for stdin in the container runtime. If this\\\\nis not set, reads from stdin in the container will always result in EOF.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Stdin\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"stdinOnce\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether the container runtime should close the stdin channel after it has been opened by\\\\na single attach. When stdin is true the stdin stream will remain open across multiple attach\\\\nsessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the\\\\nfirst client attaches to stdin, and then remains open and accepts data until the client disconnects,\\\\nat which time stdin is closed and remains closed until the container is restarted. If this\\\\nflag is false, a container processes that reads from stdin will never receive an EOF.\\\\nDefault is false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StdinOnce\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationMessagePath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Path at which the file to which the container's termination message\\\\nwill be written is mounted into the container's filesystem.\\\\nMessage written is intended to be brief final status, such as an assertion failure message.\\\\nWill be truncated by the node if greater than 4096 bytes. The total message length across\\\\nall containers will be limited to 12kb.\\\\nDefaults to /dev/termination-log.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TerminationMessagePath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationMessagePolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TerminationMessagePolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tty\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TTY\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeDevices\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"volumeDevices is the list of block devices to be used by the container.\\\\nThis is a beta feature.\\\\n+patchMergeKey=devicePath\\\\n+patchStrategy=merge\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeDevice\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeDevices\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeMounts\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Pod volumes to mount into the container's filesystem.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=mountPath\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeMount\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeMounts\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"workingDir\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Container's working directory.\\\\nIf not specified, the container runtime's default will be used, which\\\\nmight be configured in the container image.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"WorkingDir\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ContainerPort\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"ContainerPort represents a network port in a single container.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"containerPort\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Number of port to expose on the pod's IP address.\\\\nThis must be a valid port number, 0 \\\\u003c x \\\\u003c 65536.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ContainerPort\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostIP\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"What host IP to bind the external port to.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HostIP\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostPort\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Number of port to expose on the host.\\\\nIf specified, this must be a valid port number, 0 \\\\u003c x \\\\u003c 65536.\\\\nIf HostNetwork is specified, this must match ContainerPort.\\\\nMost containers do not need this.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HostPort\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each\\\\nnamed port in a pod must have a unique name. Name for the port that can be\\\\nreferred to by services.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"protocol\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Protocol\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1DNSPolicy\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"DNSPolicy defines how a pod's DNS will be configured.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1DownwardAPIProjection\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Note that this is identical to a downwardAPI volume source without the default\\\\nmode.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents downward API info for projecting into a projected volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Items is a list of DownwardAPIVolume file\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1DownwardAPIVolumeFile\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Items\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1DownwardAPIVolumeFile\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"DownwardAPIVolumeFile represents information to create the file containing the pod field\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fieldRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ObjectFieldSelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"mode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: mode bits to use on this file, must be a value between 0\\\\nand 0777. If not specified, the volume defaultMode will be used.\\\\nThis might be in conflict with other options that affect the file\\\\nmode, like fsGroup, and the result can be other mode bits set.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Mode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resourceFieldRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceFieldSelector\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1DownwardAPIVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Downward API volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"DownwardAPIVolumeSource represents a volume containing downward API info.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"defaultMode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: mode bits to use on created files by default. Must be a\\\\nvalue between 0 and 0777. Defaults to 0644.\\\\nDirectories within the path are not affected by this setting.\\\\nThis might be in conflict with other options that affect the file\\\\nmode, like fsGroup, and the result can be other mode bits set.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DefaultMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Items is a list of downward API volume file\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1DownwardAPIVolumeFile\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Items\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1EmptyDirVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Empty directory volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents an empty directory for a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"medium\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1StorageMedium\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"sizeLimit\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/resourceQuantity\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1EnvFromSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"EnvFromSource represents the source of a set of ConfigMaps\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"configMapRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ConfigMapEnvSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"prefix\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Prefix\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecretEnvSource\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1EnvVar\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"EnvVar represents an environment variable present in a Container.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the environment variable. Must be a C_IDENTIFIER.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"value\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Variable references $(VAR_NAME) are expanded\\\\nusing the previous defined environment variables in the container and\\\\nany service environment variables. If a variable cannot be resolved,\\\\nthe reference in the input string will be unchanged. The $(VAR_NAME)\\\\nsyntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped\\\\nreferences will never be expanded, regardless of whether the variable\\\\nexists or not.\\\\nDefaults to \\\\\\\"\\\\\\\".\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Value\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"valueFrom\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvVarSource\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1EnvVarSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"EnvVarSource represents a source for the value of an EnvVar.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"configMapKeyRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ConfigMapKeySelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fieldRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ObjectFieldSelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resourceFieldRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceFieldSelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretKeyRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecretKeySelector\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1EphemeralContainer\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An EphemeralContainer is a container that may be added temporarily to an existing pod for\\\\nuser-initiated activities such as debugging. Ephemeral containers have no resource or\\\\nscheduling guarantees, and they will not be restarted when they exit or when a pod is\\\\nremoved or restarted. If an ephemeral container causes a pod to exceed its resource\\\\nallocation, the pod may be evicted.\\\\nEphemeral containers may not be added by directly updating the pod spec. They must be added\\\\nvia the pod's ephemeralcontainers subresource, and they will appear in the pod spec\\\\nonce added.\\\\nThis is an alpha feature enabled by the EphemeralContainers feature flag.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"args\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Arguments to the entrypoint.\\\\nThe docker image's CMD is used if this is not provided.\\\\nVariable references $(VAR_NAME) are expanded using the container's environment. If a variable\\\\ncannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax\\\\ncan be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\\\\nregardless of whether the variable exists or not.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Args\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"command\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Entrypoint array. Not executed within a shell.\\\\nThe docker image's ENTRYPOINT is used if this is not provided.\\\\nVariable references $(VAR_NAME) are expanded using the container's environment. If a variable\\\\ncannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax\\\\ncan be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\\\\nregardless of whether the variable exists or not.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Command\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"env\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of environment variables to set in the container.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvVar\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Env\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"envFrom\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of sources to populate environment variables in the container.\\\\nThe keys defined within a source must be a C_IDENTIFIER. All invalid keys\\\\nwill be reported as an event when the container is starting. When a key exists in multiple\\\\nsources, the value associated with the last source will take precedence.\\\\nValues defined by an Env with a duplicate key will take precedence.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvFromSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"EnvFrom\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"image\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Docker image name.\\\\nMore info: https://kubernetes.io/docs/concepts/containers/images\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Image\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"imagePullPolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PullPolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"lifecycle\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Lifecycle\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"livenessProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the ephemeral container specified as a DNS_LABEL.\\\\nThis name must be unique among all containers, init containers and ephemeral containers.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"ports\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Ports are not allowed for ephemeral containers.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ContainerPort\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Ports\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readinessProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resources\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceRequirements\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"securityContext\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecurityContext\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"startupProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"stdin\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container should allocate a buffer for stdin in the container runtime. If this\\\\nis not set, reads from stdin in the container will always result in EOF.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Stdin\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"stdinOnce\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether the container runtime should close the stdin channel after it has been opened by\\\\na single attach. When stdin is true the stdin stream will remain open across multiple attach\\\\nsessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the\\\\nfirst client attaches to stdin, and then remains open and accepts data until the client disconnects,\\\\nat which time stdin is closed and remains closed until the container is restarted. If this\\\\nflag is false, a container processes that reads from stdin will never receive an EOF.\\\\nDefault is false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StdinOnce\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"targetContainerName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If set, the name of the container from PodSpec that this ephemeral container targets.\\\\nThe ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.\\\\nIf not set then the ephemeral container is run in whatever namespaces are shared\\\\nfor the pod. Note that the container runtime must support this feature.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TargetContainerName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationMessagePath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Path at which the file to which the container's termination message\\\\nwill be written is mounted into the container's filesystem.\\\\nMessage written is intended to be brief final status, such as an assertion failure message.\\\\nWill be truncated by the node if greater than 4096 bytes. The total message length across\\\\nall containers will be limited to 12kb.\\\\nDefaults to /dev/termination-log.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TerminationMessagePath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationMessagePolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TerminationMessagePolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tty\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TTY\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeDevices\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"volumeDevices is the list of block devices to be used by the container.\\\\nThis is a beta feature.\\\\n+patchMergeKey=devicePath\\\\n+patchStrategy=merge\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeDevice\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeDevices\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeMounts\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Pod volumes to mount into the container's filesystem.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=mountPath\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeMount\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeMounts\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"workingDir\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Container's working directory.\\\\nIf not specified, the container runtime's default will be used, which\\\\nmight be configured in the container image.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"WorkingDir\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1EphemeralContainerCommon\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"EphemeralContainerCommon is a copy of all fields in Container to be inlined in\\\\nEphemeralContainer. This separate type allows easy conversion from EphemeralContainer\\\\nto Container and allows separate documentation for the fields of EphemeralContainer.\\\\nWhen a new field is added to Container it must be added here as well.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"args\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Arguments to the entrypoint.\\\\nThe docker image's CMD is used if this is not provided.\\\\nVariable references $(VAR_NAME) are expanded using the container's environment. If a variable\\\\ncannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax\\\\ncan be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\\\\nregardless of whether the variable exists or not.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Args\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"command\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Entrypoint array. Not executed within a shell.\\\\nThe docker image's ENTRYPOINT is used if this is not provided.\\\\nVariable references $(VAR_NAME) are expanded using the container's environment. If a variable\\\\ncannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax\\\\ncan be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,\\\\nregardless of whether the variable exists or not.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Command\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"env\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of environment variables to set in the container.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvVar\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Env\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"envFrom\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of sources to populate environment variables in the container.\\\\nThe keys defined within a source must be a C_IDENTIFIER. All invalid keys\\\\nwill be reported as an event when the container is starting. When a key exists in multiple\\\\nsources, the value associated with the last source will take precedence.\\\\nValues defined by an Env with a duplicate key will take precedence.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EnvFromSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"EnvFrom\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"image\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Docker image name.\\\\nMore info: https://kubernetes.io/docs/concepts/containers/images\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Image\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"imagePullPolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PullPolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"lifecycle\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Lifecycle\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"livenessProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the ephemeral container specified as a DNS_LABEL.\\\\nThis name must be unique among all containers, init containers and ephemeral containers.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"ports\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Ports are not allowed for ephemeral containers.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ContainerPort\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Ports\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readinessProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resources\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceRequirements\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"securityContext\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecurityContext\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"startupProbe\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Probe\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"stdin\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container should allocate a buffer for stdin in the container runtime. If this\\\\nis not set, reads from stdin in the container will always result in EOF.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Stdin\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"stdinOnce\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether the container runtime should close the stdin channel after it has been opened by\\\\na single attach. When stdin is true the stdin stream will remain open across multiple attach\\\\nsessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the\\\\nfirst client attaches to stdin, and then remains open and accepts data until the client disconnects,\\\\nat which time stdin is closed and remains closed until the container is restarted. If this\\\\nflag is false, a container processes that reads from stdin will never receive an EOF.\\\\nDefault is false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StdinOnce\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationMessagePath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Path at which the file to which the container's termination message\\\\nwill be written is mounted into the container's filesystem.\\\\nMessage written is intended to be brief final status, such as an assertion failure message.\\\\nWill be truncated by the node if greater than 4096 bytes. The total message length across\\\\nall containers will be limited to 12kb.\\\\nDefaults to /dev/termination-log.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TerminationMessagePath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationMessagePolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TerminationMessagePolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tty\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TTY\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeDevices\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"volumeDevices is the list of block devices to be used by the container.\\\\nThis is a beta feature.\\\\n+patchMergeKey=devicePath\\\\n+patchStrategy=merge\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeDevice\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeDevices\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeMounts\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Pod volumes to mount into the container's filesystem.\\\\nCannot be updated.\\\\n+optional\\\\n+patchMergeKey=mountPath\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeMount\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeMounts\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"workingDir\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Container's working directory.\\\\nIf not specified, the container runtime's default will be used, which\\\\nmight be configured in the container image.\\\\nCannot be updated.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"WorkingDir\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ExecAction\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"ExecAction describes a \\\\\\\"run in container\\\\\\\" action.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"command\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Command is the command line to execute inside the container, the working directory for the\\\\ncommand is root ('/') in the container's filesystem. The command is simply exec'd, it is\\\\nnot run inside a shell, so traditional shell instructions ('|', etc) won't work. To use\\\\na shell, you need to explicitly call out to that shell.\\\\nExit status of 0 is treated as live/healthy and non-zero is unhealthy.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Command\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1FCVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Fibre Channel volumes can only be mounted as read/write once.\\\\nFibre Channel volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Fibre Channel volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\nTODO: how do we prevent errors in the filesystem from compromising the machine\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"lun\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: FC target lun number\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Lun\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"targetWWNs\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: FC target worldwide names (WWNs)\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TargetWWNs\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"wwids\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: FC volume world wide identifiers (wwids)\\\\nEither wwids or combination of targetWWNs and lun must be set, but not both simultaneously.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"WWIDs\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1FlexVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"FlexVolume represents a generic volume resource that is\\\\nprovisioned/attached using an exec based plugin.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"driver\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Driver is the name of the driver to use for this volume.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Driver\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". The default filesystem depends on FlexVolume script.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"options\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Extra command options if any.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Options\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1FlockerVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"One and only one of datasetName and datasetUUID should be set.\\\\nFlocker volumes do not support ownership management or SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Flocker volume mounted by the Flocker agent.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"datasetName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the dataset stored as metadata -\\\\u003e name on the dataset for Flocker\\\\nshould be considered as deprecated\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DatasetName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"datasetUUID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"UUID of the dataset. This is unique identifier of a Flocker dataset\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DatasetUUID\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1GCEPersistentDiskVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A GCE PD must exist before mounting to a container. The disk must\\\\nalso be in the same GCE project and zone as the kubelet. A GCE PD\\\\ncan only be mounted as read/write once or read-only many times. GCE\\\\nPDs support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Persistent Disk resource in Google Compute Engine.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type of the volume that you want to mount.\\\\nTip: Ensure that the filesystem type is supported by the host operating system.\\\\nExamples: \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk\\\\nTODO: how do we prevent errors in the filesystem from compromising the machine\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"partition\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The partition in the volume that you want to mount.\\\\nIf omitted, the default is to mount by volume name.\\\\nExamples: For volume /dev/sda1, you specify the partition as \\\\\\\"1\\\\\\\".\\\\nSimilarly, the volume partition for /dev/sda is \\\\\\\"0\\\\\\\" (or you can leave the property empty).\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Partition\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"pdName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Unique name of the PD resource in GCE. Used to identify the disk in GCE.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PDName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ReadOnly here will force the ReadOnly setting in VolumeMounts.\\\\nDefaults to false.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1GitRepoVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an\\\\nEmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir\\\\ninto the Pod's container.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a volume that is populated with the contents of a git repository.\\\\nGit repo volumes do not support ownership management.\\\\nGit repo volumes support SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"directory\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Target directory name.\\\\nMust not contain or start with '..'. If '.' is supplied, the volume directory will be the\\\\ngit repository. Otherwise, if specified, the volume will contain the git repository in\\\\nthe subdirectory with the given name.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Directory\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"repository\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Repository URL\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Repository\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"revision\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Commit hash for the specified revision.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Revision\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1GlusterfsVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Glusterfs volumes do not support ownership management or SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Glusterfs mount that lasts the lifetime of a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"endpoints\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"EndpointsName is the endpoint name that details Glusterfs topology.\\\\nMore info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"EndpointsName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path is the Glusterfs volume path.\\\\nMore info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions.\\\\nDefaults to false.\\\\nMore info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1HTTPGetAction\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"HTTPGetAction describes an action based on HTTP Get requests.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"host\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Host name to connect to, defaults to the pod IP. You probably want to set\\\\n\\\\\\\"Host\\\\\\\" in httpHeaders instead.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Host\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"httpHeaders\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Custom headers to set in the request. HTTP allows repeated headers.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HTTPHeader\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HTTPHeaders\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path to access on the HTTP server.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"port\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/intstrIntOrString\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"scheme\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1URIScheme\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1HTTPHeader\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"HTTPHeader describes a custom header to be used in HTTP probes\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The header field name\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"value\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The header field value\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Value\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Handler\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Handler defines a specific action that should be taken\\\\nTODO: pass structured data to these actions, and document that data here.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"exec\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ExecAction\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"httpGet\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HTTPGetAction\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tcpSocket\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TCPSocketAction\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1HostAlias\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the\\\\npod's hosts file.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"hostnames\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Hostnames for the above IP address.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Hostnames\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"ip\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"IP address of the host file entry.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"IP\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1HostPathType\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1HostPathVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Host path volumes do not support ownership management or SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a host path mapped into a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path of the directory on the host.\\\\nIf the path is a symlink, it will follow the link to the real path.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"type\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HostPathType\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ISCSIVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ISCSI volumes can only be mounted as read/write once.\\\\nISCSI volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents an ISCSI disk.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"chapAuthDiscovery\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"whether support iSCSI Discovery CHAP authentication\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DiscoveryCHAPAuth\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"chapAuthSession\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"whether support iSCSI Session CHAP authentication\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SessionCHAPAuth\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type of the volume that you want to mount.\\\\nTip: Ensure that the filesystem type is supported by the host operating system.\\\\nExamples: \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi\\\\nTODO: how do we prevent errors in the filesystem from compromising the machine\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"initiatorName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Custom iSCSI Initiator Name.\\\\nIf initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface\\\\n\\\\u003ctarget portal\\\\u003e:\\\\u003cvolume name\\\\u003e will be created for the connection.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"InitiatorName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"iqn\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Target iSCSI Qualified Name.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"IQN\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"iscsiInterface\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"iSCSI Interface Name that uses an iSCSI transport.\\\\nDefaults to 'default' (tcp).\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ISCSIInterface\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"lun\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"iSCSI Target Lun number.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Lun\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"portals\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port\\\\nis other than default (typically TCP ports 860 and 3260).\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Portals\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ReadOnly here will force the ReadOnly setting in VolumeMounts.\\\\nDefaults to false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"targetPortal\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port\\\\nis other than default (typically TCP ports 860 and 3260).\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TargetPortal\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1KeyToPath\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Maps a string key to a path within a volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"key\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The key to project.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Key\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"mode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: mode bits to use on this file, must be a value between 0\\\\nand 0777. If not specified, the volume defaultMode will be used.\\\\nThis might be in conflict with other options that affect the file\\\\nmode, like fsGroup, and the result can be other mode bits set.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Mode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The relative path of the file to map the key to.\\\\nMay not be an absolute path.\\\\nMay not contain the path element '..'.\\\\nMay not start with the string '..'.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1LabelSelector\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A label selector is a label query over a set of resources. The result of matchLabels and\\\\nmatchExpressions are ANDed. An empty label selector matches all objects. A null\\\\nlabel selector matches no objects.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"matchExpressions\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"matchExpressions is a list of label selector requirements. The requirements are ANDed.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LabelSelectorRequirement\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"MatchExpressions\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"matchLabels\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\\\\nmap is equivalent to an element of matchExpressions, whose key field is \\\\\\\"key\\\\\\\", the\\\\noperator is \\\\\\\"In\\\\\\\", and the values array contains only \\\\\\\"value\\\\\\\". The requirements are ANDed.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"MatchLabels\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/apimachinery/pkg/apis/meta/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1LabelSelectorOperator\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"A label selector operator is the set of operators that can be used in a selector requirement.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/apimachinery/pkg/apis/meta/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1LabelSelectorRequirement\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A label selector requirement is a selector that contains values, a key, and an operator that\\\\nrelates the key and values.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"key\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"key is the label key that the selector applies to.\\\\n+patchMergeKey=key\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Key\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"operator\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LabelSelectorOperator\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"values\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"values is an array of string values. If the operator is In or NotIn,\\\\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\\\\nthe values array must be empty. This array is replaced during a strategic\\\\nmerge patch.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Values\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/apimachinery/pkg/apis/meta/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Lifecycle\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Lifecycle describes actions that the management system should take in response to container lifecycle\\\\nevents. For the PostStart and PreStop lifecycle handlers, management of the container blocks\\\\nuntil the action is complete, unless the container process fails, in which case the handler is aborted.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"postStart\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Handler\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"preStop\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Handler\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1LocalObjectReference\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"LocalObjectReference contains enough information to let you locate the\\\\nreferenced object inside the same namespace.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1MountPropagationMode\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"MountPropagationMode describes mount propagation.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1NFSVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"NFS volumes do not support ownership management or SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents an NFS mount that lasts the lifetime of a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path that is exported by the NFS server.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#nfs\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ReadOnly here will force\\\\nthe NFS export to be mounted with read-only permissions.\\\\nDefaults to false.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#nfs\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"server\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Server is the hostname or IP address of the NFS server.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#nfs\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Server\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1NodeAffinity\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Node affinity is a group of node affinity scheduling rules.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"preferredDuringSchedulingIgnoredDuringExecution\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The scheduler will prefer to schedule pods to nodes that satisfy\\\\nthe affinity expressions specified by this field, but it may choose\\\\na node that violates one or more of the expressions. The node that is\\\\nmost preferred is the one with the greatest sum of weights, i.e.\\\\nfor each node that meets all of the scheduling requirements (resource\\\\nrequest, requiredDuringScheduling affinity expressions, etc.),\\\\ncompute a sum by iterating through the elements of this field and adding\\\\n\\\\\\\"weight\\\\\\\" to the sum if the node matches the corresponding matchExpressions; the\\\\nnode(s) with the highest sum are the most preferred.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PreferredSchedulingTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PreferredDuringSchedulingIgnoredDuringExecution\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"requiredDuringSchedulingIgnoredDuringExecution\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeSelector\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1NodeSelector\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A node selector represents the union of the results of one or more label queries\\\\nover a set of nodes; that is, it represents the OR of the selectors represented\\\\nby the node selector terms.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"nodeSelectorTerms\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Required. A list of node selector terms. The terms are ORed.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeSelectorTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"NodeSelectorTerms\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1NodeSelectorOperator\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A node selector operator is the set of operators that can be used in\\\\na node selector requirement.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1NodeSelectorRequirement\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A node selector requirement is a selector that contains values, a key, and an operator\\\\nthat relates the key and values.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"key\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The label key that the selector applies to.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Key\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"operator\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeSelectorOperator\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"values\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An array of string values. If the operator is In or NotIn,\\\\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\\\\nthe values array must be empty. If the operator is Gt or Lt, the values\\\\narray must have a single element, which will be interpreted as an integer.\\\\nThis array is replaced during a strategic merge patch.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Values\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1NodeSelectorTerm\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A null or empty node selector term matches no objects. The requirements of\\\\nthem are ANDed.\\\\nThe TopologySelectorTerm type implements a subset of the NodeSelectorTerm.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"matchExpressions\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A list of node selector requirements by node's labels.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeSelectorRequirement\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"MatchExpressions\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"matchFields\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A list of node selector requirements by node's fields.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeSelectorRequirement\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"MatchFields\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ObjectFieldSelector\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"ObjectFieldSelector selects an APIVersioned field of an object.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"apiVersion\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Version of the schema the FieldPath is written in terms of, defaults to \\\\\\\"v1\\\\\\\".\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"APIVersion\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fieldPath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path of the field to select in the specified API version.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FieldPath\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PersistentVolumeClaimVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"This volume finds the bound PV and mounts that volume for the pod. A\\\\nPersistentVolumeClaimVolumeSource is, essentially, a wrapper around another\\\\ntype of volume that is owned by someone else (the system).\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"claimName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ClaimName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Will force the ReadOnly setting in VolumeMounts.\\\\nDefault false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PhotonPersistentDiskVolumeSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Photon Controller persistent disk resource.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"pdID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ID that identifies Photon Controller persistent disk\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PdID\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodAffinity\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Pod affinity is a group of inter pod affinity scheduling rules.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"preferredDuringSchedulingIgnoredDuringExecution\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The scheduler will prefer to schedule pods to nodes that satisfy\\\\nthe affinity expressions specified by this field, but it may choose\\\\na node that violates one or more of the expressions. The node that is\\\\nmost preferred is the one with the greatest sum of weights, i.e.\\\\nfor each node that meets all of the scheduling requirements (resource\\\\nrequest, requiredDuringScheduling affinity expressions, etc.),\\\\ncompute a sum by iterating through the elements of this field and adding\\\\n\\\\\\\"weight\\\\\\\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the\\\\nnode(s) with the highest sum are the most preferred.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1WeightedPodAffinityTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PreferredDuringSchedulingIgnoredDuringExecution\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"requiredDuringSchedulingIgnoredDuringExecution\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If the affinity requirements specified by this field are not met at\\\\nscheduling time, the pod will not be scheduled onto the node.\\\\nIf the affinity requirements specified by this field cease to be met\\\\nat some point during pod execution (e.g. due to a pod label update), the\\\\nsystem may or may not try to eventually evict the pod from its node.\\\\nWhen there are multiple elements, the lists of nodes corresponding to each\\\\npodAffinityTerm are intersected, i.e. all terms must be satisfied.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodAffinityTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RequiredDuringSchedulingIgnoredDuringExecution\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodAffinityTerm\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Defines a set of pods (namely those matching the labelSelector\\\\nrelative to the given namespace(s)) that this pod should be\\\\nco-located (affinity) or not co-located (anti-affinity) with,\\\\nwhere co-located is defined as running on a node whose value of\\\\nthe label with key \\\\u003ctopologyKey\\\\u003e matches that of any node on which\\\\na pod of the set of pods is running\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"labelSelector\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LabelSelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"namespaces\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"namespaces specifies which namespaces the labelSelector applies to (matches against);\\\\nnull or empty list means \\\\\\\"this pod's namespace\\\\\\\"\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Namespaces\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"topologyKey\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching\\\\nthe labelSelector in the specified namespaces, where co-located is defined as running on a node\\\\nwhose value of the label with key topologyKey matches that of any node on which any of the\\\\nselected pods is running.\\\\nEmpty topologyKey is not allowed.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TopologyKey\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodAntiAffinity\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Pod anti affinity is a group of inter pod anti affinity scheduling rules.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"preferredDuringSchedulingIgnoredDuringExecution\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The scheduler will prefer to schedule pods to nodes that satisfy\\\\nthe anti-affinity expressions specified by this field, but it may choose\\\\na node that violates one or more of the expressions. The node that is\\\\nmost preferred is the one with the greatest sum of weights, i.e.\\\\nfor each node that meets all of the scheduling requirements (resource\\\\nrequest, requiredDuringScheduling anti-affinity expressions, etc.),\\\\ncompute a sum by iterating through the elements of this field and adding\\\\n\\\\\\\"weight\\\\\\\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the\\\\nnode(s) with the highest sum are the most preferred.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1WeightedPodAffinityTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PreferredDuringSchedulingIgnoredDuringExecution\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"requiredDuringSchedulingIgnoredDuringExecution\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If the anti-affinity requirements specified by this field are not met at\\\\nscheduling time, the pod will not be scheduled onto the node.\\\\nIf the anti-affinity requirements specified by this field cease to be met\\\\nat some point during pod execution (e.g. due to a pod label update), the\\\\nsystem may or may not try to eventually evict the pod from its node.\\\\nWhen there are multiple elements, the lists of nodes corresponding to each\\\\npodAffinityTerm are intersected, i.e. all terms must be satisfied.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodAffinityTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RequiredDuringSchedulingIgnoredDuringExecution\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodConditionType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"PodConditionType is a valid value for PodCondition.Type\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodDNSConfig\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"PodDNSConfig defines the DNS parameters of a pod in addition to\\\\nthose generated from DNSPolicy.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"nameservers\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A list of DNS name server IP addresses.\\\\nThis will be appended to the base nameservers generated from DNSPolicy.\\\\nDuplicated nameservers will be removed.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Nameservers\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"options\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A list of DNS resolver options.\\\\nThis will be merged with the base options generated from DNSPolicy.\\\\nDuplicated entries will be removed. Resolution options given in Options\\\\nwill override those that appear in the base DNSPolicy.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodDNSConfigOption\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Options\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"searches\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A list of DNS search domains for host-name lookup.\\\\nThis will be appended to the base search paths generated from DNSPolicy.\\\\nDuplicated search paths will be removed.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Searches\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodDNSConfigOption\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"PodDNSConfigOption defines DNS resolver options of a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Required.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"value\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Value\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodReadinessGate\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"PodReadinessGate contains the reference to a pod condition\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"conditionType\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodConditionType\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodSecurityContext\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Some fields are also present in container.securityContext. Field values of\\\\ncontainer.securityContext take precedence over field values of PodSecurityContext.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"PodSecurityContext holds pod-level security attributes and common container settings.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsGroup\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A special supplemental group that applies to all containers in a pod.\\\\nSome volume types allow the Kubelet to change the ownership of that volume\\\\nto be owned by the pod:\\\\n\\\\n1. The owning GID will be the FSGroup\\\\n2. The setgid bit is set (new files created in the volume will be owned by FSGroup)\\\\n3. The permission bits are OR'd with rw-rw----\\\\n\\\\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSGroup\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsGroup\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The GID to run the entrypoint of the container process.\\\\nUses runtime default if unset.\\\\nMay also be set in SecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence\\\\nfor that container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsGroup\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsNonRoot\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Indicates that the container must run as a non-root user.\\\\nIf true, the Kubelet will validate the image at runtime to ensure that it\\\\ndoes not run as UID 0 (root) and fail to start the container if it does.\\\\nIf unset or false, no such validation will be performed.\\\\nMay also be set in SecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsNonRoot\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsUser\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The UID to run the entrypoint of the container process.\\\\nDefaults to user specified in image metadata if unspecified.\\\\nMay also be set in SecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence\\\\nfor that container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsUser\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"seLinuxOptions\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SELinuxOptions\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"supplementalGroups\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A list of groups applied to the first process run in each container, in addition\\\\nto the container's primary GID. If unspecified, no groups will be added to\\\\nany container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SupplementalGroups\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"sysctls\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported\\\\nsysctls (by the container runtime) might fail to launch.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Sysctl\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Sysctls\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"windowsOptions\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1WindowsSecurityContextOptions\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PodSpec\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"PodSpec is a description of a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"activeDeadlineSeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional duration in seconds the pod may be active on the node relative to\\\\nStartTime before the system will actively try to mark it failed and kill associated containers.\\\\nValue must be a positive integer.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ActiveDeadlineSeconds\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"affinity\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Affinity\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"automountServiceAccountToken\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"AutomountServiceAccountToken\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"containers\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of containers belonging to the pod.\\\\nContainers cannot currently be added or removed.\\\\nThere must be at least one container in a Pod.\\\\nCannot be updated.\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Container\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Containers\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"dnsConfig\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodDNSConfig\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"dnsPolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1DNSPolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"enableServiceLinks\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"EnableServiceLinks indicates whether information about services should be injected into pod's\\\\nenvironment variables, matching the syntax of Docker links.\\\\nOptional: Defaults to true.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"EnableServiceLinks\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"ephemeralContainers\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing\\\\npod to perform user-initiated actions such as debugging. This list cannot be specified when\\\\ncreating a pod, and it cannot be modified by updating the pod spec. In order to add an\\\\nephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.\\\\nThis field is alpha-level and is only honored by servers that enable the EphemeralContainers feature.\\\\n+optional\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EphemeralContainer\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"EphemeralContainers\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostAliases\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts\\\\nfile if specified. This is only valid for non-hostNetwork pods.\\\\n+optional\\\\n+patchMergeKey=ip\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HostAlias\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HostAliases\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostIPC\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Use the host's ipc namespace.\\\\nOptional: Default to false.\\\\n+k8s:conversion-gen=false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HostIPC\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostNetwork\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Host networking requested for this pod. Use the host's network namespace.\\\\nIf this option is set, the ports that will be used must be specified.\\\\nDefault to false.\\\\n+k8s:conversion-gen=false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HostNetwork\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostPID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Use the host's pid namespace.\\\\nOptional: Default to false.\\\\n+k8s:conversion-gen=false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"HostPID\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostname\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specifies the hostname of the Pod\\\\nIf not specified, the pod's hostname will be set to a system-defined value.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Hostname\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"imagePullSecrets\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.\\\\nIf specified, these secrets will be passed to individual puller implementations for them to use. For example,\\\\nin the case of docker, only DockerConfig type secrets are honored.\\\\nMore info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\\\\n+optional\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ImagePullSecrets\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"initContainers\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of initialization containers belonging to the pod.\\\\nInit containers are executed in order prior to containers being started. If any\\\\ninit container fails, the pod is considered to have failed and is handled according\\\\nto its restartPolicy. The name for an init container or normal container must be\\\\nunique among all containers.\\\\nInit containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.\\\\nThe resourceRequirements of an init container are taken into account during scheduling\\\\nby finding the highest request/limit for each resource type, and then using the max of\\\\nof that value or the sum of the normal containers. Limits are applied to init containers\\\\nin a similar fashion.\\\\nInit containers cannot currently be added or removed.\\\\nCannot be updated.\\\\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Container\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"InitContainers\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"NodeName is a request to schedule this pod onto a specific node. If it is non-empty,\\\\nthe scheduler simply schedules this pod onto that node, assuming that it fits resource\\\\nrequirements.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"NodeName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nodeSelector\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"NodeSelector is a selector which must be true for the pod to fit on a node.\\\\nSelector which must match a node's labels for the pod to be scheduled on that node.\\\\nMore info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"NodeSelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"overhead\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceList\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"preemptionPolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PreemptionPolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"priority\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The priority value. Various system components use this field to find the\\\\npriority of the pod. When Priority Admission Controller is enabled, it\\\\nprevents users from setting this field. The admission controller populates\\\\nthis field from PriorityClassName.\\\\nThe higher the value, the higher the priority.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Priority\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"priorityClassName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If specified, indicates the pod's priority. \\\\\\\"system-node-critical\\\\\\\" and\\\\n\\\\\\\"system-cluster-critical\\\\\\\" are two special keywords which indicate the\\\\nhighest priorities with the former being the highest priority. Any other\\\\nname must be defined by creating a PriorityClass object with that name.\\\\nIf not specified, the pod priority will be default or zero if there is no\\\\ndefault.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PriorityClassName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readinessGates\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If specified, all readiness gates will be evaluated for pod readiness.\\\\nA pod is ready when all its containers are ready AND\\\\nall conditions specified in the readiness gates have status equal to \\\\\\\"True\\\\\\\"\\\\nMore info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodReadinessGate\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadinessGates\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"restartPolicy\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1RestartPolicy\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runtimeClassName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used\\\\nto run this pod. If no RuntimeClass resource matches the named class, the pod will not be run.\\\\nIf unset or empty, the \\\\\\\"legacy\\\\\\\" RuntimeClass will be used, which is an implicit class with an\\\\nempty definition that uses the default runtime handler.\\\\nMore info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md\\\\nThis is a beta feature as of Kubernetes v1.14.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RuntimeClassName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"schedulerName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If specified, the pod will be dispatched by specified scheduler.\\\\nIf not specified, the pod will be dispatched by default scheduler.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SchedulerName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"securityContext\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodSecurityContext\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"serviceAccount\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.\\\\nDeprecated: Use serviceAccountName instead.\\\\n+k8s:conversion-gen=false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DeprecatedServiceAccount\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"serviceAccountName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ServiceAccountName is the name of the ServiceAccount to use to run this pod.\\\\nMore info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ServiceAccountName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"shareProcessNamespace\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Share a single process namespace between all of the containers in a pod.\\\\nWhen this is set containers will be able to view and signal processes from other containers\\\\nin the same pod, and the first process in each container will not be assigned PID 1.\\\\nHostPID and ShareProcessNamespace cannot both be set.\\\\nOptional: Default to false.\\\\n+k8s:conversion-gen=false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ShareProcessNamespace\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"subdomain\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If specified, the fully qualified Pod hostname will be \\\\\\\"\\\\u003chostname\\\\u003e.\\\\u003csubdomain\\\\u003e.\\\\u003cpod namespace\\\\u003e.svc.\\\\u003ccluster domain\\\\u003e\\\\\\\".\\\\nIf not specified, the pod will not have a domainname at all.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Subdomain\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"terminationGracePeriodSeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.\\\\nValue must be non-negative integer. The value zero indicates delete immediately.\\\\nIf this value is nil, the default grace period will be used instead.\\\\nThe grace period is the duration in seconds after the processes running in the pod are sent\\\\na termination signal and the time when the processes are forcibly halted with a kill signal.\\\\nSet this value longer than the expected cleanup time for your process.\\\\nDefaults to 30 seconds.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TerminationGracePeriodSeconds\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tolerations\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If specified, the pod's tolerations.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Toleration\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Tolerations\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"topologySpreadConstraints\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"TopologySpreadConstraints describes how a group of pods ought to spread across topology\\\\ndomains. Scheduler will schedule pods in a way which abides by the constraints.\\\\nThis field is alpha-level and is only honored by clusters that enables the EvenPodsSpread\\\\nfeature.\\\\nAll topologySpreadConstraints are ANDed.\\\\n+optional\\\\n+patchMergeKey=topologyKey\\\\n+patchStrategy=merge\\\\n+listType=map\\\\n+listMapKey=topologyKey\\\\n+listMapKey=whenUnsatisfiable\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TopologySpreadConstraint\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TopologySpreadConstraints\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumes\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"List of volumes that can be mounted by containers belonging to the pod.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes\\\\n+optional\\\\n+patchMergeKey=name\\\\n+patchStrategy=merge,retainKeys\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Volume\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Volumes\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PortworxVolumeSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"PortworxVolumeSource represents a Portworx volume resource.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"FSType represents the filesystem type to mount\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"VolumeID uniquely identifies a Portworx volume\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeID\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PreemptionPolicy\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"PreemptionPolicy describes a policy for if/when to preempt a pod.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PreferredSchedulingTerm\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"An empty preferred scheduling term matches all objects with implicit weight 0\\\\n(i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"preference\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NodeSelectorTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"weight\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Weight\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Probe\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Probe describes a health check to be performed against a container to determine whether it is\\\\nalive or ready to receive traffic.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"exec\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ExecAction\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"failureThreshold\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Minimum consecutive failures for the probe to be considered failed after having succeeded.\\\\nDefaults to 3. Minimum value is 1.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FailureThreshold\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"httpGet\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HTTPGetAction\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"initialDelaySeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Number of seconds after the container has started before liveness probes are initiated.\\\\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"InitialDelaySeconds\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"periodSeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"How often (in seconds) to perform the probe.\\\\nDefault to 10 seconds. Minimum value is 1.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"PeriodSeconds\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"successThreshold\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Minimum consecutive successes for the probe to be considered successful after having failed.\\\\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SuccessThreshold\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tcpSocket\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TCPSocketAction\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"timeoutSeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Number of seconds after which the probe times out.\\\\nDefaults to 1 second. Minimum value is 1.\\\\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TimeoutSeconds\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ProcMountType\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ProjectedVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Represents a projected volume source\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"defaultMode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Mode bits to use on created files by default. Must be a value between\\\\n0 and 0777.\\\\nDirectories within the path are not affected by this setting.\\\\nThis might be in conflict with other options that affect the file\\\\nmode, like fsGroup, and the result can be other mode bits set.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DefaultMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"sources\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"list of volume projections\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VolumeProjection\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Sources\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Protocol\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Protocol defines network protocols supported for things like container ports.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1PullPolicy\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"PullPolicy describes a policy for if/when to pull a container image\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1QuobyteVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Quobyte volumes do not support ownership management or SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Quobyte mount that lasts the lifetime of a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"group\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Group to map volume access to\\\\nDefault is no group\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Group\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ReadOnly here will force the Quobyte volume to be mounted with read-only permissions.\\\\nDefaults to false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"registry\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Registry represents a single or multiple Quobyte Registry services\\\\nspecified as a string as host:port pair (multiple entries are separated with commas)\\\\nwhich acts as the central registry for volumes\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Registry\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tenant\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Tenant owning the given Quobyte volume in the Backend\\\\nUsed with dynamically provisioned Quobyte volumes, value is set by the plugin\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Tenant\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"user\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"User to map volume access to\\\\nDefaults to serivceaccount user\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"User\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volume\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Volume is a string that references an already created Quobyte volume by name.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Volume\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1RBDVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"RBD volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a Rados Block Device mount that lasts the lifetime of a pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type of the volume that you want to mount.\\\\nTip: Ensure that the filesystem type is supported by the host operating system.\\\\nExamples: \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#rbd\\\\nTODO: how do we prevent errors in the filesystem from compromising the machine\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"image\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The rados image name.\\\\nMore info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RBDImage\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"keyring\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Keyring is the path to key ring for RBDUser.\\\\nDefault is /etc/ceph/keyring.\\\\nMore info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Keyring\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"monitors\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"A collection of Ceph monitors.\\\\nMore info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"CephMonitors\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"pool\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The rados pool name.\\\\nDefault is rbd.\\\\nMore info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RBDPool\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ReadOnly here will force the ReadOnly setting in VolumeMounts.\\\\nDefaults to false.\\\\nMore info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"user\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The rados user name.\\\\nDefault is admin.\\\\nMore info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RadosUser\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ResourceFieldSelector\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ResourceFieldSelector represents container resources (cpu, memory) and their output format\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"containerName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Container name: required for volumes, optional for env vars\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ContainerName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"divisor\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/resourceQuantity\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"resource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Required: resource to select\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Resource\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ResourceList\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"ResourceList is a set of (resource name, quantity) pairs.\\\",\\n\" +\n\t\t\" \\\"additionalProperties\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/resourceQuantity\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ResourceRequirements\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"ResourceRequirements describes the compute resource requirements.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"limits\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceList\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"requests\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ResourceList\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1RestartPolicy\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Only one of the following restart policies may be specified.\\\\nIf none of the following policies is specified, the default one\\\\nis RestartPolicyAlways.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"RestartPolicy describes how the container should be restarted.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1SELinuxOptions\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"SELinuxOptions are the labels to be applied to the container\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"level\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Level is SELinux level label that applies to the container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Level\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"role\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Role is a SELinux role label that applies to the container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Role\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"type\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Type is a SELinux type label that applies to the container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Type\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"user\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"User is a SELinux user label that applies to the container.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"User\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ScaleIOVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ScaleIOVolumeSource represents a persistent ScaleIO volume\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\".\\\\nDefault is \\\\\\\"xfs\\\\\\\".\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"gateway\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The host address of the ScaleIO API Gateway.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Gateway\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"protectionDomain\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The name of the ScaleIO Protection Domain for the configured storage.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ProtectionDomain\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"sslEnabled\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Flag to enable/disable SSL communication with Gateway, default false\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SSLEnabled\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"storageMode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.\\\\nDefault is ThinProvisioned.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StorageMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"storagePool\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The ScaleIO Storage Pool associated with the protection domain.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StoragePool\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"system\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The name of the storage system as configured in ScaleIO.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"System\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The name of a volume already created in the ScaleIO system\\\\nthat is associated with this volume source.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeName\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1SecretEnvSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The contents of the target Secret's Data field will represent the\\\\nkey-value pairs as environment variables.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"SecretEnvSource selects a Secret to populate the environment\\\\nvariables with.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the Secret must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1SecretKeySelector\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"SecretKeySelector selects a key of a Secret.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"key\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The key of the secret to select from. Must be a valid secret key.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Key\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the Secret or its key must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1SecretProjection\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The contents of the target Secret's Data field will be presented in a\\\\nprojected volume as files using the keys in the Data field as the file names.\\\\nNote that this is identical to a secret volume source without the default\\\\nmode.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Adapts a secret into a projected volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If unspecified, each key-value pair in the Data field of the referenced\\\\nSecret will be projected into the volume as a file whose name is the\\\\nkey and content is the value. If specified, the listed keys will be\\\\nprojected into the specified paths, and unlisted keys will not be\\\\npresent. If a key is specified which is not present in the Secret,\\\\nthe volume setup will error unless it is marked optional. Paths must be\\\\nrelative and may not contain the '..' path or start with '..'.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1KeyToPath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Items\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the referent.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\\nTODO: Add other useful fields. apiVersion, kind, uid?\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the Secret or its key must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1SecretVolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The contents of the target Secret's Data field will be presented in a volume\\\\nas files using the keys in the Data field as the file names.\\\\nSecret volumes support ownership management and SELinux relabeling.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Adapts a Secret into a volume.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"defaultMode\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: mode bits to use on created files by default. Must be a\\\\nvalue between 0 and 0777. Defaults to 0644.\\\\nDirectories within the path are not affected by this setting.\\\\nThis might be in conflict with other options that affect the file\\\\nmode, like fsGroup, and the result can be other mode bits set.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DefaultMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"If unspecified, each key-value pair in the Data field of the referenced\\\\nSecret will be projected into the volume as a file whose name is the\\\\nkey and content is the value. If specified, the listed keys will be\\\\nprojected into the specified paths, and unlisted keys will not be\\\\npresent. If a key is specified which is not present in the Secret,\\\\nthe volume setup will error unless it is marked optional. Paths must be\\\\nrelative and may not contain the '..' path or start with '..'.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"array\\\",\\n\" +\n\t\t\" \\\"items\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1KeyToPath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Items\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"optional\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Specify whether the Secret or its keys must be defined\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Optional\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of the secret in the pod's namespace to use.\\\\nMore info: https://kubernetes.io/docs/concepts/storage/volumes#secret\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SecretName\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1SecurityContext\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Some fields are present in both SecurityContext and PodSecurityContext. When both\\\\nare set, the values in SecurityContext take precedence.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"SecurityContext holds security configuration that will be applied to a container.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"allowPrivilegeEscalation\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"AllowPrivilegeEscalation controls whether a process can gain more\\\\nprivileges than its parent process. This bool directly controls if\\\\nthe no_new_privs flag will be set on the container process.\\\\nAllowPrivilegeEscalation is true always when the container is:\\\\n1) run as Privileged\\\\n2) has CAP_SYS_ADMIN\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"AllowPrivilegeEscalation\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"capabilities\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1Capabilities\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"privileged\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Run container in privileged mode.\\\\nProcesses in privileged containers are essentially equivalent to root on the host.\\\\nDefaults to false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Privileged\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"procMount\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ProcMountType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnlyRootFilesystem\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Whether this container has a read-only root filesystem.\\\\nDefault is false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnlyRootFilesystem\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsGroup\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The GID to run the entrypoint of the container process.\\\\nUses runtime default if unset.\\\\nMay also be set in PodSecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsGroup\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsNonRoot\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Indicates that the container must run as a non-root user.\\\\nIf true, the Kubelet will validate the image at runtime to ensure that it\\\\ndoes not run as UID 0 (root) and fail to start the container if it does.\\\\nIf unset or false, no such validation will be performed.\\\\nMay also be set in PodSecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsNonRoot\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsUser\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The UID to run the entrypoint of the container process.\\\\nDefaults to user specified in image metadata if unspecified.\\\\nMay also be set in PodSecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsUser\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"seLinuxOptions\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SELinuxOptions\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"windowsOptions\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1WindowsSecurityContextOptions\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1ServiceAccountTokenProjection\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ServiceAccountTokenProjection represents a projected service account token\\\\nvolume. This projection can be used to insert a service account token into\\\\nthe pods runtime filesystem for use against APIs (Kubernetes API Server or\\\\notherwise).\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"audience\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Audience is the intended audience of the token. A recipient of a token\\\\nmust identify itself with an identifier specified in the audience of the\\\\ntoken, and otherwise should reject the token. The audience defaults to the\\\\nidentifier of the apiserver.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Audience\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"expirationSeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"ExpirationSeconds is the requested duration of validity of the service\\\\naccount token. As the token approaches expiration, the kubelet volume\\\\nplugin will proactively rotate the service account token. The kubelet will\\\\nstart trying to rotate the token if the token is older than 80 percent of\\\\nits time to live or if the token is older than 24 hours.Defaults to 1 hour\\\\nand must be at least 10 minutes.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ExpirationSeconds\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"path\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path is the path relative to the mount point of the file to project the\\\\ntoken into.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Path\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1StorageMedium\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"StorageMedium defines ways that storage can be allocated to a volume.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1StorageOSVolumeSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a StorageOS persistent volume resource.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Defaults to false (read/write). ReadOnly here will force\\\\nthe ReadOnly setting in VolumeMounts.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secretRef\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LocalObjectReference\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"VolumeName is the human-readable name of the StorageOS volume. Volume\\\\nnames are only unique within a namespace.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumeNamespace\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"VolumeNamespace specifies the scope of the volume within StorageOS. If no\\\\nnamespace is specified then the Pod's namespace will be used. This allows the\\\\nKubernetes name scoping to be mirrored within StorageOS for tighter integration.\\\\nSet VolumeName to any name to override the default behaviour.\\\\nSet to \\\\\\\"default\\\\\\\" if you are not using namespaces within StorageOS.\\\\nNamespaces that do not pre-exist within StorageOS will be created.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumeNamespace\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Sysctl\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Sysctl defines a kernel parameter to be set\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Name of a property to set\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"value\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Value of a property to set\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Value\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1TCPSocketAction\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"TCPSocketAction describes an action based on opening a socket\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"host\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Optional: Host name to connect to, defaults to the pod IP.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Host\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"port\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/intstrIntOrString\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1TaintEffect\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1TerminationMessagePolicy\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"TerminationMessagePolicy describes how termination messages are retrieved from a container.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Toleration\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The pod this Toleration is attached to tolerates any taint that matches\\\\nthe triple \\\\u003ckey,value,effect\\\\u003e using the matching operator \\\\u003coperator\\\\u003e.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"effect\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TaintEffect\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"key\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Key is the taint key that the toleration applies to. Empty means match all taint keys.\\\\nIf the key is empty, operator must be Exists; this combination means to match all values and all keys.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Key\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"operator\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1TolerationOperator\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"tolerationSeconds\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"TolerationSeconds represents the period of time the toleration (which must be\\\\nof effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,\\\\nit is not set, which means tolerate the taint forever (do not evict). Zero and\\\\nnegative values will be treated as 0 (evict immediately) by the system.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int64\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TolerationSeconds\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"value\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Value is the taint value the toleration matches to.\\\\nIf the operator is Exists, the value should be empty, otherwise just a regular string.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Value\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1TolerationOperator\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"A toleration operator is the set of operators that can be used in a toleration.\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1TopologySpreadConstraint\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"TopologySpreadConstraint specifies how to spread matching pods among the given topology.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"labelSelector\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1LabelSelector\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"maxSkew\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"MaxSkew describes the degree to which pods may be unevenly distributed.\\\\nIt's the maximum permitted difference between the number of matching pods in\\\\nany two topology domains of a given topology type.\\\\nFor example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same\\\\nlabelSelector spread as 1/1/0:\\\\n+-------+-------+-------+\\\\n zone1 | zone2 | zone3 |\\\\n+-------+-------+-------+\\\\n P | P | |\\\\n+-------+-------+-------+\\\\nif MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1;\\\\nscheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2)\\\\nviolate MaxSkew(1).\\\\nif MaxSkew is 2, incoming pod can be scheduled onto any zone.\\\\nIt's a required field. Default value is 1 and 0 is not allowed.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"MaxSkew\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"topologyKey\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"TopologyKey is the key of node labels. Nodes that have a label with this key\\\\nand identical values are considered to be in the same topology.\\\\nWe consider each \\\\u003ckey, value\\\\u003e as a \\\\\\\"bucket\\\\\\\", and try to put balanced number\\\\nof pods into each bucket.\\\\nIt's a required field.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"TopologyKey\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"whenUnsatisfiable\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1UnsatisfiableConstraintAction\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1URIScheme\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"URIScheme identifies the scheme used for connection to a host for Get actions\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1UnsatisfiableConstraintAction\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1Volume\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Volume represents a named volume in a pod that may be accessed by any container in the pod.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"awsElasticBlockStore\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AWSElasticBlockStoreVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"azureDisk\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AzureDiskVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"azureFile\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AzureFileVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"cephfs\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1CephFSVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"cinder\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1CinderVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"configMap\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ConfigMapVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"csi\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1CSIVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"downwardAPI\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1DownwardAPIVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"emptyDir\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EmptyDirVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fc\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1FCVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"flexVolume\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1FlexVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"flocker\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1FlockerVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"gcePersistentDisk\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1GCEPersistentDiskVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"gitRepo\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1GitRepoVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"glusterfs\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1GlusterfsVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostPath\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HostPathVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"iscsi\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ISCSIVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Volume's name.\\\\nMust be a DNS_LABEL and unique within the pod.\\\\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nfs\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NFSVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"persistentVolumeClaim\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PersistentVolumeClaimVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"photonPersistentDisk\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PhotonPersistentDiskVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"portworxVolume\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PortworxVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"projected\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ProjectedVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"quobyte\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1QuobyteVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"rbd\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1RBDVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"scaleIO\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ScaleIOVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secret\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecretVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"storageos\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1StorageOSVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"vsphereVolume\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VsphereVirtualDiskVolumeSource\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1VolumeDevice\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"volumeDevice describes a mapping of a raw block device within a container.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"devicePath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"devicePath is the path inside of the container that the device will be mapped to.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"DevicePath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"name must match the name of a persistentVolumeClaim in the pod\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1VolumeMount\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"VolumeMount describes a mounting of a Volume within a container.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"mountPath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path within the container at which the volume should be mounted. Must\\\\nnot contain ':'.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"MountPath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"mountPropagation\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1MountPropagationMode\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"name\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"This must match the Name of a Volume.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Name\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"readOnly\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Mounted read-only if true, read-write otherwise (false or unspecified).\\\\nDefaults to false.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"boolean\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"ReadOnly\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"subPath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path within the volume from which the container's volume should be mounted.\\\\nDefaults to \\\\\\\"\\\\\\\" (volume's root).\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SubPath\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"subPathExpr\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Expanded path within the volume from which the container's volume should be mounted.\\\\nBehaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.\\\\nDefaults to \\\\\\\"\\\\\\\" (volume's root).\\\\nSubPathExpr and SubPath are mutually exclusive.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"SubPathExpr\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1VolumeProjection\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Projection that may be projected along with other supported volume types\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"configMap\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ConfigMapProjection\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"downwardAPI\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1DownwardAPIProjection\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secret\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecretProjection\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"serviceAccountToken\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ServiceAccountTokenProjection\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1VolumeSource\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Only one of its members may be specified.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents the source of a volume to mount.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"awsElasticBlockStore\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AWSElasticBlockStoreVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"azureDisk\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AzureDiskVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"azureFile\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1AzureFileVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"cephfs\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1CephFSVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"cinder\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1CinderVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"configMap\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ConfigMapVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"csi\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1CSIVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"downwardAPI\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1DownwardAPIVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"emptyDir\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1EmptyDirVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"fc\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1FCVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"flexVolume\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1FlexVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"flocker\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1FlockerVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"gcePersistentDisk\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1GCEPersistentDiskVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"gitRepo\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1GitRepoVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"glusterfs\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1GlusterfsVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"hostPath\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1HostPathVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"iscsi\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ISCSIVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"nfs\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1NFSVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"persistentVolumeClaim\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PersistentVolumeClaimVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"photonPersistentDisk\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PhotonPersistentDiskVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"portworxVolume\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PortworxVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"projected\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ProjectedVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"quobyte\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1QuobyteVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"rbd\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1RBDVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"scaleIO\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1ScaleIOVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"secret\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1SecretVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"storageos\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1StorageOSVolumeSource\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"vsphereVolume\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1VsphereVirtualDiskVolumeSource\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1VsphereVirtualDiskVolumeSource\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"Represents a vSphere volume resource.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"fsType\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Filesystem type to mount.\\\\nMust be a filesystem type supported by the host operating system.\\\\nEx. \\\\\\\"ext4\\\\\\\", \\\\\\\"xfs\\\\\\\", \\\\\\\"ntfs\\\\\\\". Implicitly inferred to be \\\\\\\"ext4\\\\\\\" if unspecified.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"FSType\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"storagePolicyID\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StoragePolicyID\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"storagePolicyName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Storage Policy Based Management (SPBM) profile name.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"StoragePolicyName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"volumePath\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"Path that identifies vSphere volume vmdk\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"VolumePath\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1WeightedPodAffinityTerm\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"podAffinityTerm\\\": {\\n\" +\n\t\t\" \\\"$ref\\\": \\\"#/definitions/v1PodAffinityTerm\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"weight\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"weight associated with matching the corresponding podAffinityTerm,\\\\nin the range 1-100.\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"integer\\\",\\n\" +\n\t\t\" \\\"format\\\": \\\"int32\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"Weight\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"v1WindowsSecurityContextOptions\\\": {\\n\" +\n\t\t\" \\\"type\\\": \\\"object\\\",\\n\" +\n\t\t\" \\\"title\\\": \\\"WindowsSecurityContextOptions contain Windows-specific options and credentials.\\\",\\n\" +\n\t\t\" \\\"properties\\\": {\\n\" +\n\t\t\" \\\"gmsaCredentialSpec\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"GMSACredentialSpec is where the GMSA admission webhook\\\\n(https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the\\\\nGMSA credential spec named by the GMSACredentialSpecName field.\\\\nThis field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"GMSACredentialSpec\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"gmsaCredentialSpecName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"GMSACredentialSpecName is the name of the GMSA credential spec to use.\\\\nThis field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"GMSACredentialSpecName\\\"\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"runAsUserName\\\": {\\n\" +\n\t\t\" \\\"description\\\": \\\"The UserName in Windows to run the entrypoint of the container process.\\\\nDefaults to the user specified in image metadata if unspecified.\\\\nMay also be set in PodSecurityContext. If set in both SecurityContext and\\\\nPodSecurityContext, the value specified in SecurityContext takes precedence.\\\\nThis field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.\\\\n+optional\\\",\\n\" +\n\t\t\" \\\"type\\\": \\\"string\\\",\\n\" +\n\t\t\" \\\"x-go-name\\\": \\\"RunAsUserName\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" },\\n\" +\n\t\t\" \\\"x-go-package\\\": \\\"k8s.io/api/core/v1\\\"\\n\" +\n\t\t\" }\\n\" +\n\t\t\" }\\n\" +\n\t\t\"}\"\n\treturn tmpl\n}", "title": "" }, { "docid": "929b903f1ad0c9ccc8f6b8ba3c92df68", "score": "0.5284295", "text": "func GenerateBuildJSONFile(m *manifest1.Manifest, appName, buildID, description string) ([]byte, error) {\n\tif m == nil {\n\t\treturn nil, fmt.Errorf(\"m cannot be nil\")\n\t}\n\n\tbuild := &structs.Build{\n\t\tId: buildID,\n\t\tApp: appName,\n\t\tDescription: description,\n\t\tRelease: buildID,\n\t}\n\n\tmanifestYaml, err := yaml.Marshal(m)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\tbuild.Manifest = string(manifestYaml)\n\n\trez, err := json.Marshal(build)\n\tif err != nil {\n\t\treturn []byte{}, err\n\t}\n\n\treturn rez, nil\n}", "title": "" }, { "docid": "230f93118c3bdec998ec3527ca0bb86b", "score": "0.527939", "text": "func GenerateWithJSON(opt interface{}, logger func(i ...interface{})) (exit bool) {\n\treturn generateWithFile(opt, logger, json.Marshal, json.Unmarshal)\n\n}", "title": "" }, { "docid": "2ac21dfd38c1067400b64035819b6414", "score": "0.5239163", "text": "func createJSON(c string) ([]byte, error) {\n\t//var indentedJSON bytes.Buffer\n\tdataBytes := json.RawMessage(c)\n\tdata, err := json.MarshalIndent(dataBytes, \" \", \"\\t\")\n\tif err != nil {\n\t\tfmt.Println(\"err while indenting:\", err)\n\t\treturn nil, err\n\t}\n\t\n\treturn data, nil\n}", "title": "" }, { "docid": "1ae66043bafb97f1a49f4680bad40d03", "score": "0.5228012", "text": "func JSON(key string) VariableOption {\n\treturn func(v *Variable) { v.keys[SourceTypeJSON] = key }\n}", "title": "" }, { "docid": "45498b9a6b581f84e404bd74ae67ece4", "score": "0.520845", "text": "func NextJsonStr(params ...interface{}) (string, error) {\n\tjsonTempl := `\n{\n \"name\": \"{{.Name}}\",\n \"game\": \"game-name\",\n \"image\": \"redis:alpine\",\n \"toleration\": \"game-name\",\n \"ports\": [\n {\n \"containerPort\": 8080,\n \"protocol\": \"TCP\",\n \"name\": \"tcp\"\n }\n ],\n \"limits\": {\n \"memory\": \"10Mi\",\n \"cpu\": \"10m\"\n },\n \"requests\": {\n \"memory\": \"10Mi\",\n \"cpu\": \"10m\"\n },\n \"occupiedTimeout\": 300,\n \"shutdownTimeout\": 100,\n \"autoscaling\": {\n \"min\": 2,\n \"up\": {\n \"delta\": 1,\n \"trigger\": {\n \"usage\": 70,\n \"time\": 3,\n \"threshold\": 80,\n \"limit\": 90\n },\n \"cooldown\": 1\n },\n \"down\": {\n \"delta\": {{.DownDelta}},\n \"trigger\": {\n \"usage\": 50,\n \"time\": 3,\n \"threshold\": 80\n },\n \"cooldown\": 1\n }\n }\n}`\n\n\tvar jsonStr string\n\tindex := struct {\n\t\tName string\n\t\tDownDelta int\n\t}{}\n\n\ttmpl, err := template.New(\"json\").Parse(jsonTempl)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tindex.Name = fmt.Sprintf(\"maestro-test-%s\", uuid.NewV4())\n\n\tif len(params) == 0 {\n\t\tindex.DownDelta = 1\n\t} else {\n\t\tindex.DownDelta = params[0].(int)\n\t}\n\n\tbuf := new(bytes.Buffer)\n\terr = tmpl.Execute(buf, index)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tjsonStr = buf.String()\n\treturn jsonStr, nil\n}", "title": "" }, { "docid": "f3235445022366177d7676c1c7e5f368", "score": "0.51928365", "text": "func JSONDataWithTemplate(f *framework.Framework) (string, func(*framework.TestCase)) {\n\treturn \"[common] should sync json secrets with template\", func(tc *framework.TestCase) {\n\t\tsecretKey1 := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, \"one\")\n\t\tsecretKey2 := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, \"other\")\n\t\tsecretValue1 := \"{\\\"foo1\\\":\\\"foo1-val\\\",\\\"bar1\\\":\\\"bar1-val\\\"}\"\n\t\tsecretValue2 := \"{\\\"foo2\\\":\\\"foo2-val\\\",\\\"bar2\\\":\\\"bar2-val\\\"}\"\n\t\ttc.Secrets = map[string]string{\n\t\t\tsecretKey1: secretValue1,\n\t\t\tsecretKey2: secretValue2,\n\t\t}\n\t\ttc.ExpectedSecret = &v1.Secret{\n\t\t\tType: v1.SecretTypeOpaque,\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\"example\": \"annotation\",\n\t\t\t\t},\n\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\"example\": \"label\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tData: map[string][]byte{\n\t\t\t\t\"my-data\": []byte(`executed: foo1-val|bar2-val`),\n\t\t\t},\n\t\t}\n\t\ttc.ExternalSecret.Spec.Target.Template = &esv1alpha1.ExternalSecretTemplate{\n\t\t\tMetadata: esv1alpha1.ExternalSecretTemplateMetadata{\n\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\"example\": \"annotation\",\n\t\t\t\t},\n\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\"example\": \"label\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tData: map[string]string{\n\t\t\t\t\"my-data\": \"executed: {{ .one | toString }}|{{ .two | toString }}\",\n\t\t\t},\n\t\t}\n\t\ttc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{\n\t\t\t{\n\t\t\t\tSecretKey: \"one\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: secretKey1,\n\t\t\t\t\tProperty: \"foo1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tSecretKey: \"two\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: secretKey2,\n\t\t\t\t\tProperty: \"bar2\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f3235445022366177d7676c1c7e5f368", "score": "0.51928365", "text": "func JSONDataWithTemplate(f *framework.Framework) (string, func(*framework.TestCase)) {\n\treturn \"[common] should sync json secrets with template\", func(tc *framework.TestCase) {\n\t\tsecretKey1 := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, \"one\")\n\t\tsecretKey2 := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, \"other\")\n\t\tsecretValue1 := \"{\\\"foo1\\\":\\\"foo1-val\\\",\\\"bar1\\\":\\\"bar1-val\\\"}\"\n\t\tsecretValue2 := \"{\\\"foo2\\\":\\\"foo2-val\\\",\\\"bar2\\\":\\\"bar2-val\\\"}\"\n\t\ttc.Secrets = map[string]string{\n\t\t\tsecretKey1: secretValue1,\n\t\t\tsecretKey2: secretValue2,\n\t\t}\n\t\ttc.ExpectedSecret = &v1.Secret{\n\t\t\tType: v1.SecretTypeOpaque,\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\"example\": \"annotation\",\n\t\t\t\t},\n\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\"example\": \"label\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tData: map[string][]byte{\n\t\t\t\t\"my-data\": []byte(`executed: foo1-val|bar2-val`),\n\t\t\t},\n\t\t}\n\t\ttc.ExternalSecret.Spec.Target.Template = &esv1alpha1.ExternalSecretTemplate{\n\t\t\tMetadata: esv1alpha1.ExternalSecretTemplateMetadata{\n\t\t\t\tAnnotations: map[string]string{\n\t\t\t\t\t\"example\": \"annotation\",\n\t\t\t\t},\n\t\t\t\tLabels: map[string]string{\n\t\t\t\t\t\"example\": \"label\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tData: map[string]string{\n\t\t\t\t\"my-data\": \"executed: {{ .one | toString }}|{{ .two | toString }}\",\n\t\t\t},\n\t\t}\n\t\ttc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{\n\t\t\t{\n\t\t\t\tSecretKey: \"one\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: secretKey1,\n\t\t\t\t\tProperty: \"foo1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tSecretKey: \"two\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: secretKey2,\n\t\t\t\t\tProperty: \"bar2\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6b27c783d0635149774c2489986c2986", "score": "0.518443", "text": "func exercise5() {\n\tfmt.Println(\"=== Exercise 5: Building JSON ===\\n\")\n\n\tfmt.Println()\n}", "title": "" }, { "docid": "5d7fef53e1556740df3b4912141324a7", "score": "0.51702285", "text": "func createJSONFormat(data interface{}) (string, error) {\n\n\t// We want to pretty print the json reply. We need to wrap:\n\t// json.NewEncoder(http_reply).Encode(reply)\n\t// with the following code:\n\n\tbuffer := new(bytes.Buffer)\n\tencoder := json.NewEncoder(buffer)\n\tencoder.SetIndent(\"\", \" \") // tells how much to indent \" \" spaces.\n\terr := encoder.Encode(data)\n\n\tif err != nil {\n\t\treturn \"\", err\n\t} else {\n\t\treturn buffer.String(), nil\n\t}\n}", "title": "" }, { "docid": "c79f9522af57117d035bd811e5a92387", "score": "0.51637244", "text": "func BuildJSONFormat(loggerName LoggerName) string {\n\treturn fmt.Sprintf(\"{&quot;agent&quot;:&quot;%s&quot;,&quot;time&quot;:&quot;%%Date(%s)&quot;,&quot;level&quot;:&quot;%%LEVEL&quot;,&quot;file&quot;:&quot;%%ShortFilePath&quot;,&quot;line&quot;:&quot;%%Line&quot;,&quot;func&quot;:&quot;%%FuncShort&quot;,&quot;msg&quot;:&quot;%%Msg&quot;}%%n\", strings.ToLower(string(loggerName)), logDateFormat)\n}", "title": "" }, { "docid": "bf8998b6c15df38856773387e200bffa", "score": "0.5146258", "text": "func CreateFileJSON(date string, out OutputJSON) {\n\tf, err := os.OpenFile(\"./gochopchop_\"+date+\".json\", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfile, _ := json.MarshalIndent(&out, \"\", \" \")\n\n\t_, err = f.Write([]byte(file))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(\"Output as json :\" + \"./gochopchop_\" + date + \".json\")\n\tf.Close()\n}", "title": "" }, { "docid": "22250bdaffd8314b08d3ae62bec7775f", "score": "0.5003612", "text": "func JSON(c cbConfig.Config, str string) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, req *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tio.WriteString(w, str)\n\t}\n}", "title": "" }, { "docid": "edc96c03b7b2eee3a7ea2568f6222358", "score": "0.5000678", "text": "func AddStringToJsonStructure (buf bytes.Buffer, key, value string) bytes.Buffer {\n if IsStringEmpty(key) {\n return buf\n }\n // key\n buf.WriteString(\"\\\"\")\n buf.WriteString(key)\n buf.WriteString(\"\\\": \")\n // value\n if IsStringEmpty(value) {\n buf.WriteString(\"null\")\n } else {\n buf.WriteString(\"\\\"\")\n buf.WriteString(value)\n buf.WriteString(\"\\\",\")\n }\n return buf\n}", "title": "" }, { "docid": "e1ee3abdbb8203eac953f353d9f6c08f", "score": "0.49955988", "text": "func bpAddJSON(item bpTableItem, defs bpDef, jsonString *string) {\n\ttable, _ := defs.tableByName(item.Name)\n\n\t// Start this table\n\tif item.Root {\n\t\t*jsonString = fmt.Sprintf(jsonObjectStart)\n\t\t*jsonString += fmt.Sprintf(jsonField, strings.ToLower(item.Name+\"UUID\"))\n\t\t*jsonString += fmt.Sprintf(jsonValue, RandomUUID())\n\t\t*jsonString += fmt.Sprintf(jsonSeperator)\n\t} else {\n\t\t*jsonString += fmt.Sprintf(jsonField, strings.ToLower(item.Name))\n\t\tif item.IsList {\n\t\t\t*jsonString += fmt.Sprintf(jsonListStart)\n\t\t}\n\t\t*jsonString += fmt.Sprintf(jsonObjectStart)\n\t}\n\n\t// Add this tables attributes\n\tnumCol := len(table.Columns)\n\tm := mappedTypes{}\n\tfor idx, col := range table.Columns {\n\n\t\t*jsonString += fmt.Sprintf(jsonField, strings.ToLower(col.Name))\n\t\t*jsonString += fmt.Sprintf(\"%v\", m.randomJSONData(col.Type))\n\t\tif idx < numCol-1 {\n\t\t\t*jsonString += fmt.Sprintf(jsonSeperator)\n\t\t} else {\n\t\t\t*jsonString += fmt.Sprintf(\"\\n\")\n\t\t}\n\t}\n\n\t// See if there are any children\n\tprocessed := 0\n\ttoProcess := len(item.Children)\n\tif processed > 0 {\n\t\t*jsonString += fmt.Sprintf(jsonSeperator)\n\t\t// Add child tables first\n\t\tfor _, child := range item.Children {\n\t\t\tbpAddJSON(*child, defs, jsonString)\n\t\t\tprocessed += 1\n\t\t}\n\t}\n\n\t// Close and append to bpData.SwaggerGeneratedStructs\n\t*jsonString += jsonObjectEnd\n\tif item.IsList {\n\t\t*jsonString += fmt.Sprintf(jsonListEnd)\n\t}\n\n\t// If more objects or list add a comma\n\tif toProcess < processed {\n\t\t*jsonString += \",\"\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "ec74f706ea0b3f0eaf3cac6a8dee227a", "score": "0.4899988", "text": "func fnCreate(in io.Reader, out io.Writer, eout io.Writer, args []string, flagSet *flag.FlagSet) int {\n\tvar (\n\t\tcName string\n\t\tkey string\n\t\tsrc []byte\n\t\terr error\n\t)\n\n\terr = flagSet.Parse(args)\n\tif err != nil {\n\t\tfmt.Fprintf(eout, \"%s\\n\", err)\n\t\treturn 1\n\t}\n\targs = flagSet.Args()\n\n\tswitch len(args) {\n\tcase 0:\n\t\tfmt.Fprintf(eout, \"Missing collection name, key and JSON source\\n\")\n\t\treturn 1\n\tcase 1:\n\t\tfmt.Fprintf(eout, \"Missing key and JSON source\\n\")\n\t\treturn 1\n\tcase 2:\n\t\tcName, key = args[0], args[1]\n\t\tif inputFName == \"-\" || inputFName == \"\" {\n\t\t\tsrc, err = ioutil.ReadAll(in)\n\t\t} else {\n\t\t\tsrc, err = ioutil.ReadFile(inputFName)\n\t\t}\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(eout, \"%s\\n\", err)\n\t\t\treturn 1\n\t\t}\n\tcase 3:\n\t\tcName, key = args[0], args[1]\n\t\t// Need to decide if args[2] is JSON source or filename\n\t\tif strings.HasPrefix(args[2], \"{\") && strings.HasSuffix(args[2], \"}\") {\n\t\t\tsrc = []byte(args[2])\n\t\t} else {\n\t\t\tsrc, err = ioutil.ReadFile(args[2])\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintf(eout, \"Can't read %s, %s\\n\", args[2], err)\n\t\t\t\treturn 1\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintf(eout, \"Too many parameters, %s\\n\", strings.Join(args, \" \"))\n\t\treturn 1\n\t}\n\tif strings.HasSuffix(key, \".json\") {\n\t\tkey = strings.TrimSuffix(key, \".json\")\n\t}\n\n\tm := map[string]interface{}{}\n\tif err := dataset.DecodeJSON(src, &m); err != nil {\n\t\tfmt.Fprintf(eout, \"%s must be a valid JSON Object, %s\", key, err)\n\t\treturn 1\n\t}\n\tif dataset.KeyExists(cName, key) == true && overwrite == true {\n\t\tif err := dataset.UpdateJSON(cName, key, src); err != nil {\n\t\t\tfmt.Fprintf(eout, \"failed to update %q in %s, %s\\n\", key, cName, err)\n\t\t\treturn 1\n\t\t}\n\t\tif quiet == false {\n\t\t\tfmt.Fprintf(out, \"OK\")\n\t\t}\n\t\treturn 0\n\t}\n\n\tif err := dataset.CreateJSON(cName, key, src); err != nil {\n\t\tfmt.Fprintf(eout, \"failed to create %q in %s, %s\\n\", key, cName, err)\n\t\treturn 1\n\t}\n\tif quiet == false {\n\t\tfmt.Fprintf(out, \"OK\")\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "7e621994595a1b34ae273018abde8275", "score": "0.48863056", "text": "func generateInitProjectJSON(dir string) error {\n\tcontent := []byte(\n\t\t`{\n \"version\": \"0.1.0-*\",\n\n \"dependencies\": {\n \"Google.Apis.Auth\": \"*\"\n },\n\n \"frameworks\": {\n \"dnx451\": {\n \"frameworkAssemblies\": {\n \"System.Runtime\": \"\"\n }\n }\n }\n}\n`)\n\treturn ioutil.WriteFile(filepath.Join(dir, \"project.json\"), content, 0755)\n}", "title": "" }, { "docid": "9b3cc0d864796ecc8e67a06f05e4ae25", "score": "0.48724252", "text": "func generateCheckProjectJSON(tstDir string, libs []string) error {\n\tvar libsContent bytes.Buffer\n\tfor _, lib := range libs {\n\t\tfmt.Fprintf(&libsContent, \" \\\"%s\\\": \\\"*\\\",\\n\", lib)\n\t}\n\tcontent := []byte(\n\t\t`{\n \"version\": \"0.1.0-*\",\n\n \"dependencies\": {\n` + libsContent.String() + `\n \"Google.Apis.Auth\": \"*\"\n },\n\n \"frameworks\": {\n \"dnx451\": {\n \"frameworkAssemblies\": {\n \"System.Runtime\": \"\"\n }\n }\n }\n}\n`)\n\treturn ioutil.WriteFile(filepath.Join(tstDir, \"project.json\"), content, 0755)\n}", "title": "" }, { "docid": "5004bb0e11fa1b9e850053a01dd81104", "score": "0.48497474", "text": "func genjson(w io.Writer, f Feed) {\n\tb, err := json.Marshal(f)\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"%v\\n\", err)\n\t\treturn\n\t}\n\tfmt.Fprintf(w, \"%v\\n\", string(b))\n}", "title": "" }, { "docid": "f207b3484e1bdd455f455d34b3a8a140", "score": "0.48433915", "text": "func genFuncs(wr io.Writer) {\n\tconst text = `\n{{/* regionalKeyFiller denotes the keyword to use when invoking the regional API for the resource*/}}\n{{$regionalKeyFiller := \"\"}}\n{{/* globalKeyFiller denotes the keyword to use when invoking the global API for the resource*/}}\n{{$globalKeyFiller := \"\"}}\n{{$onlyZonalKeySupported := false}}\n\n{{$All := .All}}\n{{$Versions := .Versions}}\n\n{{range $type := $All}}\n{{if .IsDefaultZonalService}}\n\t{{$onlyZonalKeySupported = true}}\n{{else if .IsDefaultRegionalService}}\n\t{{$regionalKeyFiller = \"\"}}\n\t{{$globalKeyFiller = \"Global\"}}\n\t{{$onlyZonalKeySupported = false}}\n{{else}}\n\t{{$regionalKeyFiller = \"Region\"}}\n\t{{$globalKeyFiller = \"\"}}\n\t{{$onlyZonalKeySupported = false}}\n{{- end}} {{/* IsDefaultZonalService */}}\n\t{{if .IsMainService}}\n\t\t{{if .HasCRUD}}\nfunc Create{{.Name}}(gceCloud *gce.Cloud, key *meta.Key, {{.VarName}} *{{.Name}}) error {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"create\", key.Region, key.Zone, string({{.VarName}}.Version))\n\n\t{{- if $onlyZonalKeySupported}}\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n\t\treturn fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\n\tswitch {{.VarName}}.Version {\n\tcase meta.VersionAlpha:\n\t\talpha, err := {{.VarName}}.ToAlpha()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Creating alpha zonal {{.Name}} %v\", alpha.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Alpha{{.GetCloudProviderName}}().Insert(ctx, key, alpha))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Creating alpha region {{.Name}} %v\", alpha.Name)\n\t\t\talpha.Region = key.Region\n\t\t\treturn mc.Observe(gceCloud.Compute().Alpha{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Insert(ctx, key, alpha))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Creating alpha {{.Name}} %v\", alpha.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Alpha{{$globalKeyFiller}}{{.GetCloudProviderName}}().Insert(ctx, key, alpha))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tcase meta.VersionBeta:\n\t\tbeta, err := {{.VarName}}.ToBeta()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Creating beta zonal {{.Name}} %v\", beta.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Beta{{.GetCloudProviderName}}().Insert(ctx, key, beta))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Creating beta region {{.Name}} %v\", beta.Name)\n\t\t\tbeta.Region = key.Region\n\t\t\treturn mc.Observe(gceCloud.Compute().Beta{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Insert(ctx, key, beta))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Creating beta {{.Name}} %v\", beta.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Beta{{$globalKeyFiller}}{{.GetCloudProviderName}}().Insert(ctx, key, beta))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tdefault:\n\t\tga, err := {{.VarName}}.ToGA()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Creating ga zonal {{.Name}} %v\", ga.Name)\n\t\treturn mc.Observe(gceCloud.Compute().{{.GetCloudProviderName}}().Insert(ctx, key, ga))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Creating ga region {{.Name}} %v\", ga.Name)\n\t\t\tga.Region = key.Region\n\t\t\treturn mc.Observe(gceCloud.Compute().{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Insert(ctx, key, ga))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Creating ga {{.Name}} %v\", ga.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().{{$globalKeyFiller}}{{.GetCloudProviderName}}().Insert(ctx, key, ga))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\t}\n}\n\n{{if .HasUpdate}}\nfunc Update{{.Name}}(gceCloud *gce.Cloud, key *meta.Key, {{.VarName}} *{{.Name}}) error {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"update\", key.Region, key.Zone, string({{.VarName}}.Version))\n\n\t{{- if $onlyZonalKeySupported}}\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n\t\treturn fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tswitch {{.VarName}}.Version {\n\tcase meta.VersionAlpha:\n\t\talpha, err := {{.VarName}}.ToAlpha()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Updating alpha zonal {{.Name}} %v\", alpha.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Alpha{{.GetCloudProviderName}}().Update(ctx, key, alpha))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Updating alpha region {{.Name}} %v\", alpha.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Alpha{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Update(ctx, key, alpha))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Updating alpha {{.Name}} %v\", alpha.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Alpha{{$globalKeyFiller}}{{.GetCloudProviderName}}().Update(ctx, key, alpha))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tcase meta.VersionBeta:\n\t\tbeta, err := {{.VarName}}.ToBeta()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Updating beta zonal {{.Name}} %v\", beta.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Beta{{.GetCloudProviderName}}().Update(ctx, key, beta))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t klog.V(3).Infof(\"Updating beta region {{.Name}} %v\", beta.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Beta{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Update(ctx, key, beta))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Updating beta {{.Name}} %v\", beta.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Beta{{$globalKeyFiller}}{{.GetCloudProviderName}}().Update(ctx, key, beta))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tdefault:\n\t\tga, err := {{.VarName}}.ToGA()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Updating ga zonal {{.Name}} %v\", ga.Name)\n\t\treturn mc.Observe(gceCloud.Compute().{{.GetCloudProviderName}}().Update(ctx, key, ga))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Updating ga region {{.Name}} %v\", ga.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Update(ctx, key, ga))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Updating ga {{.Name}} %v\", ga.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().{{$globalKeyFiller}}{{.GetCloudProviderName}}().Update(ctx, key, ga))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\t}\n}\n{{- end}} {{/*HasUpdate*/}}\n\nfunc Delete{{.Name}}(gceCloud *gce.Cloud, key *meta.Key, version meta.Version) error {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"delete\", key.Region, key.Zone, string(version))\n\n\t{{- if $onlyZonalKeySupported}}\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n\t\treturn fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Deleting alpha zonal {{.Name}} %v\", key.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Alpha{{.GetCloudProviderName}}().Delete(ctx, key))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Deleting alpha region {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Alpha{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Delete(ctx, key))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Deleting alpha {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Alpha{{$globalKeyFiller}}{{.GetCloudProviderName}}().Delete(ctx, key))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tcase meta.VersionBeta:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Deleting beta zonal {{.Name}} %v\", key.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Beta{{.GetCloudProviderName}}().Delete(ctx, key))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t klog.V(3).Infof(\"Deleting beta region {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Beta{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Delete(ctx, key))\n\t\tdefault:\n\t\t klog.V(3).Infof(\"Deleting beta {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().Beta{{$globalKeyFiller}}{{.GetCloudProviderName}}().Delete(ctx, key))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tdefault:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Deleting ga zonal {{.Name}} %v\", key.Name)\n\t\treturn mc.Observe(gceCloud.Compute().{{.GetCloudProviderName}}().Delete(ctx, key))\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Deleting ga region {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Delete(ctx, key))\n\t\tdefault:\n\t\t\tklog.V(3).Infof(\"Deleting ga {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().{{$globalKeyFiller}}{{.GetCloudProviderName}}().Delete(ctx, key))\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\t}\n}\n\nfunc Get{{.Name}}(gceCloud *gce.Cloud, key *meta.Key, version meta.Version) (*{{.Name}}, error) {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"get\", key.Region, key.Zone, string(version))\n\n\tvar gceObj interface{}\n\tvar err error\n\n\t{{- if $onlyZonalKeySupported}}\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Getting alpha zonal {{.Name}} %v\", key.Name)\n\t\tgceObj, err = gceCloud.Compute().Alpha{{.GetCloudProviderName}}().Get(ctx, key)\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Getting alpha region {{.Name}} %v\", key.Name)\n\t\t\tgceObj, err = gceCloud.Compute().Alpha{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Get(ctx, key)\n\t\tdefault:\n\t\t \tklog.V(3).Infof(\"Getting alpha {{.Name}} %v\", key.Name)\n\t\t\tgceObj, err = gceCloud.Compute().Alpha{{$globalKeyFiller}}{{.GetCloudProviderName}}().Get(ctx, key)\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tcase meta.VersionBeta:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Getting beta zonal {{.Name}} %v\", key.Name)\n\t\tgceObj, err = gceCloud.Compute().Beta{{.GetCloudProviderName}}().Get(ctx, key)\n\t{{else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t \tklog.V(3).Infof(\"Getting beta region {{.Name}} %v\", key.Name)\n\t\t\tgceObj, err = gceCloud.Compute().Beta{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Get(ctx, key)\n\t\tdefault:\n\t\t \tklog.V(3).Infof(\"Getting beta {{.Name}} %v\", key.Name)\n\t\t\tgceObj, err = gceCloud.Compute().Beta{{$globalKeyFiller}}{{.GetCloudProviderName}}().Get(ctx, key)\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tdefault:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Getting ga zonal {{.Name}} %v\", key.Name)\n\t\tgceObj, err = gceCloud.Compute().{{.GetCloudProviderName}}().Get(ctx, key)\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n \t\tklog.V(3).Infof(\"Getting ga region {{.Name}} %v\", key.Name)\n\t\tgceObj, err = gceCloud.Compute().{{$regionalKeyFiller}}{{.GetCloudProviderName}}().Get(ctx, key)\n\t\tdefault:\n \t\tklog.V(3).Infof(\"Getting ga {{.Name}} %v\", key.Name)\n\t\tgceObj, err = gceCloud.Compute().{{$globalKeyFiller}}{{.GetCloudProviderName}}().Get(ctx, key)\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\t}\n\tif err != nil {\n\t\treturn nil, mc.Observe(err)\n\t}\n\tcompositeType, err := to{{.Name}}(gceObj)\n \tif err != nil {\n \treturn nil, err\n \t}\n\n\t{{- if $onlyZonalKeySupported}}\n\tcompositeType.Scope = meta.Zonal\n\t{{- else if .IsDefaultRegionalService}}\n\tif key.Type() == meta.Regional {\n\t\tcompositeType.Scope = meta.Regional\n\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n \tcompositeType.Version = version\n \treturn compositeType, nil\n}\n\nfunc List{{.GetCloudProviderName}}(gceCloud *gce.Cloud, key *meta.Key, version meta.Version) ([]*{{.Name}}, error) {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"list\", key.Region, key.Zone, string(version))\n\n\tvar gceObjs interface{}\n\tvar err error\n\n\t{{- if $onlyZonalKeySupported}}\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Listing alpha zone{{.Name}}\")\n\t\tgceObjs, err = gceCloud.Compute().Alpha{{.GetCloudProviderName}}().List(ctx, key.Zone, filter.None)\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t\tklog.V(3).Infof(\"Listing alpha region {{.Name}}\")\n\t\t\tgceObjs, err = gceCloud.Compute().Alpha{{$regionalKeyFiller}}{{.GetCloudProviderName}}().List(ctx, key.Region, filter.None)\n\t\tdefault:\n\t\t \tklog.V(3).Infof(\"Listing alpha {{.Name}}\")\n\t\t\tgceObjs, err = gceCloud.Compute().Alpha{{$globalKeyFiller}}{{.GetCloudProviderName}}().List(ctx, filter.None)\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tcase meta.VersionBeta:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Listing beta zone{{.Name}}\")\n\t\tgceObjs, err = gceCloud.Compute().Beta{{.GetCloudProviderName}}().List(ctx, key.Zone, filter.None)\n\t{{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n\t\t \tklog.V(3).Infof(\"Listing beta region {{.Name}}\")\n\t\t\tgceObjs, err = gceCloud.Compute().Beta{{$regionalKeyFiller}}{{.GetCloudProviderName}}().List(ctx, key.Region, filter.None)\n\t\tdefault:\n\t\t \tklog.V(3).Infof(\"Listing beta {{.Name}}\")\n\t\t\tgceObjs, err = gceCloud.Compute().Beta{{$globalKeyFiller}}{{.GetCloudProviderName}}().List(ctx, filter.None)\n\t\t}\n\t{{- end}} {{/* $onlyZonalKeySupported*/}}\n\tdefault:\n\t{{- if $onlyZonalKeySupported}}\n\t\tklog.V(3).Infof(\"Listing ga zone{{.Name}}\")\n\t\tgceObjs, err = gceCloud.Compute().{{.GetCloudProviderName}}().List(ctx, key.Zone, filter.None)\n {{- else}}\n\t\tswitch key.Type() {\n\t\tcase meta.Regional:\n \t\t\tklog.V(3).Infof(\"Listing ga region {{.Name}}\")\n\t\t\tgceObjs, err = gceCloud.Compute().{{$regionalKeyFiller}}{{.GetCloudProviderName}}().List(ctx, key.Region, filter.None)\n\t\tdefault:\n \t\t\tklog.V(3).Infof(\"Listing ga {{.Name}}\")\n\t\t\tgceObjs, err = gceCloud.Compute().{{$globalKeyFiller}}{{.GetCloudProviderName}}().List(ctx, filter.None)\n\t\t}\n {{- end}} {{/* $onlyZonalKeySupported*/}}\n\t}\n\tif err != nil {\n\t\treturn nil, mc.Observe(err)\n\t}\n\n\tcompositeObjs, err := to{{.Name}}List(gceObjs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, obj := range compositeObjs {\n\t\tobj.Version = version\n\t}\n\treturn compositeObjs, nil\n}\n\n{{if .IsGroupResourceService}}\nfunc {{.GetGroupResourceInfo.AttachFuncName}}(gceCloud *gce.Cloud, key *meta.Key, version meta.Version, req *{{.GetGroupResourceInfo.AttachReqName}}) error {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"attach\", key.Region, key.Zone, string(version))\n\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n return fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t\talphareq, err := req.ToAlpha()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n klog.V(3).Infof(\"Attaching to alpha zonal {{.Name}} %v\", key.Name)\n return mc.Observe(gceCloud.Compute().Alpha{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.AttachFuncName}}(ctx, key, alphareq))\n\tcase meta.VersionBeta:\n\t\tbetareq, err := req.ToBeta()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tklog.V(3).Infof(\"Attaching to beta zonal {{.Name}} %v\", key.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Beta{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.AttachFuncName}}(ctx, key, betareq))\n\tdefault:\n\t\tgareq, err := req.ToGA()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t klog.V(3).Infof(\"Attaching to ga zonal {{.Name}} %v\", key.Name)\n\t\t\treturn mc.Observe(gceCloud.Compute().{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.AttachFuncName}}(ctx, key, gareq))\n\t}\n}\n\nfunc {{.GetGroupResourceInfo.DetachFuncName}}(gceCloud *gce.Cloud, key *meta.Key, version meta.Version, req *{{.GetGroupResourceInfo.DetachReqName}}) error {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"detach\", key.Region, key.Zone, string(version))\n\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n return fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t\talphareq, err := req.ToAlpha()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n klog.V(3).Infof(\"Detaching from alpha zonal {{.Name}} %v\", key.Name)\n return mc.Observe(gceCloud.Compute().Alpha{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.DetachFuncName}}(ctx, key, alphareq))\n\tcase meta.VersionBeta:\n\t\tbetareq, err := req.ToBeta()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tklog.V(3).Infof(\"Detaching from beta zonal {{.Name}} %v\", key.Name)\n\t\treturn mc.Observe(gceCloud.Compute().Beta{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.DetachFuncName}}(ctx, key, betareq))\n\tdefault:\n\t\tgareq, err := req.ToGA()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tklog.V(3).Infof(\"Detaching from ga zonal {{.Name}} %v\", key.Name)\n\t\treturn mc.Observe(gceCloud.Compute().{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.DetachFuncName}}(ctx, key, gareq))\n\t}\n}\n\nfunc {{.GetGroupResourceInfo.ListFuncName}}(gceCloud *gce.Cloud, key *meta.Key, version meta.Version, req *{{.GetGroupResourceInfo.ListReqName}}) ([]*{{.GetGroupResourceInfo.ListRespName}}, error) {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"list\", key.Region, key.Zone, string(version))\n\n\tvar gceObjs interface{}\n\tvar err error\n\n\tswitch key.Type() {\n\tcase meta.Zonal:\n\tdefault:\n return nil, fmt.Errorf(\"Key %v not valid for zonal resource {{.Name}} %v\", key, key.Name)\n\t}\n\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t\talphareq, reqerr := req.ToAlpha()\n\t\tif reqerr != nil {\n\t\t\treturn nil, reqerr\n\t\t}\n klog.V(3).Infof(\"Listing alpha zonal {{.Name}} %v\", key.Name)\n gceObjs, err = gceCloud.Compute().Alpha{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.ListFuncName}}(ctx, key, alphareq, filter.None)\n\tcase meta.VersionBeta:\n\t\tbetareq, reqerr := req.ToBeta()\n\t\tif reqerr != nil {\n\t\t\treturn nil, reqerr\n\t\t}\n\t\tklog.V(3).Infof(\"Listing beta zonal {{.Name}} %v\", key.Name)\n\t\tgceObjs, err = gceCloud.Compute().Beta{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.ListFuncName}}(ctx, key, betareq, filter.None)\n\tdefault:\n\t\tgareq, reqerr := req.ToGA()\n\t\tif reqerr != nil {\n\t\t\treturn nil, reqerr\n\t\t}\n\t\t klog.V(3).Infof(\"Listing ga zonal {{.Name}} %v\", key.Name)\n\t\t\tgceObjs, err = gceCloud.Compute().{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.ListFuncName}}(ctx, key, gareq, filter.None)\n\t}\n\tif err != nil {\n\t\treturn nil, mc.Observe(err)\n\t}\n\n\tcompositeObjs, err := to{{.GetGroupResourceInfo.ListRespName}}List(gceObjs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, obj := range compositeObjs {\n\t\tobj.Version = version\n\t}\n\treturn compositeObjs, nil\n}\n\nfunc {{.GetGroupResourceInfo.AggListFuncName}}{{.GetGroupResourceInfo.AggListRespName}}(gceCloud *gce.Cloud, version meta.Version) (map[*meta.Key]*{{.GetGroupResourceInfo.AggListRespName}}, error) {\n\tctx, cancel := cloudprovider.ContextWithCallTimeout()\n\tdefer cancel()\n\tmc := compositemetrics.NewMetricContext(\"{{.Name}}\", \"aggregateList\", \"\", \"\", string(version))\n\n\tcompositeMap := make(map[*meta.Key]*{{.GetGroupResourceInfo.AggListRespName}})\n\tvar gceObjs interface{}\n\n\tswitch version {\n\tcase meta.VersionAlpha:\n\t\tklog.V(3).Infof(\"Aggregate List of alpha zonal {{.Name}}\")\n\t\talphaMap, err := gceCloud.Compute().Alpha{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.AggListFuncName}}(ctx, filter.None)\n\t\tif err != nil {\n\t\t\treturn nil, mc.Observe(err)\n\t\t}\n\t\t// Convert from map to list\n\t\talphaList := []*computealpha.{{.GetGroupResourceInfo.AggListRespName}}{}\n\t\tfor _, val := range alphaMap {\n\t\t\talphaList = append(alphaList, val...)\n\t\t}\n\t\tgceObjs = alphaList\n\tcase meta.VersionBeta:\n\t\tklog.V(3).Infof(\"Aggregate List of beta zonal {{.Name}}\")\n\t\tbetaMap, err := gceCloud.Compute().Beta{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.AggListFuncName}}(ctx, filter.None)\n\t\tif err != nil {\n\t\t\treturn nil, mc.Observe(err)\n\t\t}\n\t\t// Convert from map to list\n\t\tbetaList := []*computebeta.{{.GetGroupResourceInfo.AggListRespName}}{}\n\t\tfor _, val := range betaMap {\n\t\t\tbetaList = append(betaList, val...)\n\t\t}\n\t\tgceObjs = betaList\n\tdefault:\n\t\tklog.V(3).Infof(\"Aggregate List of ga zonal {{.Name}}\")\n\t\tgaMap, err := gceCloud.Compute().{{.GetCloudProviderName}}().{{.GetGroupResourceInfo.AggListFuncName}}(ctx, filter.None)\n\t\tif err != nil {\n\t\t\treturn nil, mc.Observe(err)\n\t\t}\n\t\t// Convert from map to list\n\t\tgaList := []*compute.{{.GetGroupResourceInfo.AggListRespName}}{}\n\t\tfor _, val := range gaMap {\n\t\t\tgaList = append(gaList, val...)\n\t\t}\n\t\tgceObjs = gaList\n\t}\n\tcompositeObjs, err := to{{.GetGroupResourceInfo.AggListRespName}}List(gceObjs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, obj := range compositeObjs {\n\t\tobj.Version = version\n\t\tresourceID, err := cloudprovider.ParseResourceURL(obj.SelfLink)\n\t\tif err != nil || resourceID == nil || resourceID.Key == nil {\n\t\t\tklog.Errorf(\"Failed to parse SelfLink - %s for obj %v, err %v\", obj.SelfLink, obj, err)\n\t\t\tcontinue\n\t\t}\n\t\tcompositeMap[resourceID.Key] = obj\n\t}\n\n\treturn compositeMap, nil\n}\n{{end}} {{/*IsGroupResourceService*/}}\n{{- end}} {{/*HasCRUD*/}}\n\n// to{{.Name}}List converts a list of compute alpha, beta or GA\n// {{.Name}} into a list of our composite type.\nfunc to{{.Name}}List(objs interface{}) ([]*{{.Name}}, error) {\n\tresult := []*{{.Name}}{}\n\n\terr := copyViaJSON(&result, objs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not copy object %v to %T via JSON: %v\", objs, result, err)\n\t}\n\treturn result, nil\n}\n\n// to{{.Name}} is for package internal use only (not type-safe).\nfunc to{{.Name}}(obj interface{}) (*{{.Name}}, error) {\n\tx := &{{.Name}}{}\n\terr := copyViaJSON(x, obj)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not copy object %+v to %T via JSON: %v\", obj, x, err)\n\t}\n\treturn x, nil\n}\n\n// Users external to the package need to pass in the correct type to create a\n// composite.\n\n{{- range $version, $extension := $.Versions}}\n\n// {{$version}}To{{$type.Name}} convert to a composite type.\nfunc {{$version}}To{{$type.Name}}(obj *compute{{$extension}}.{{$type.Name}}) (*{{$type.Name}}, error) {\n\tx := &{{$type.Name}}{}\n\terr := copyViaJSON(x, obj)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not copy object %+v to %T via JSON: %v\", obj, x, err)\n\t}\n\treturn x, nil\n}\n\n{{- end}} {{/* range versions */}}\n\n{{- range $version, $extension := $.Versions}}\n{{$lower := $version | ToLower}}\n// To{{$version}} converts our composite type into an {{$lower}} type.\n// This {{$lower}} type can be used in GCE API calls.\nfunc ({{$type.VarName}} *{{$type.Name}}) To{{$version}}() (*compute{{$extension}}.{{$type.Name}}, error) {\n\t{{$lower}} := &compute{{$extension}}.{{$type.Name}}{}\n\terr := copyViaJSON({{$lower}}, {{$type.VarName}})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error converting %T to compute {{$lower}} type via JSON: %v\", {{$type.VarName}}, err)\n\t}\n\n\t{{- if eq $type.Name \"BackendService\"}}\n\t// Set force send fields. This is a temporary hack.\n\tif {{$lower}}.CdnPolicy != nil {\n\t\tif {{$lower}}.CdnPolicy.CacheKeyPolicy != nil {\n\t\t{{$lower}}.CdnPolicy.CacheKeyPolicy.ForceSendFields = []string{\"IncludeHost\", \"IncludeProtocol\", \"IncludeQueryString\", \"QueryStringBlacklist\", \"QueryStringWhitelist\"}\n\t\t}\n\t\t{{$lower}}.CdnPolicy.ForceSendFields = append({{$type.VarName}}.CdnPolicy.ForceSendFields, []string{\"NegativeCaching\", \"RequestCoalescing\",\"SignedUrlCacheMaxAgeSec\",\"ServeWhileStale\"}...)\n\t}\n\tif {{$lower}}.Iap != nil {\n\t\t{{$lower}}.Iap.ForceSendFields = []string{\"Enabled\", \"Oauth2ClientId\", \"Oauth2ClientSecret\"}\n\t}\n\tif {{$lower}}.LogConfig != nil {\n\t\t{{$lower}}.LogConfig.ForceSendFields = []string{\"Enable\"}\n\t\tif {{$lower}}.LogConfig.Enable {\n\t\t\t{{$lower}}.LogConfig.ForceSendFields = []string{\"Enable\", \"SampleRate\"}\n\t\t}\n\t}\n\t{{- end}}\n\n\treturn {{$lower}}, nil\n}\n{{- end}} {{/* range versions */}}\n{{- end}} {{/* isMainType */}}\n{{- end}} {{/* range */}}\n`\n\tdata := struct {\n\t\tAll []compositemeta.ApiService\n\t\tVersions map[string]string\n\t}{compositemeta.AllApiServices, compositemeta.Versions}\n\n\tfuncMap := template.FuncMap{\n\t\t\"ToLower\": strings.ToLower,\n\t}\n\n\ttmpl := template.Must(template.New(\"funcs\").Funcs(funcMap).Parse(text))\n\tif err := tmpl.Execute(wr, data); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "49a2909d3a944724a9a22f5d05f2f1ac", "score": "0.48337924", "text": "func main() {\n\t/*\n * flags for creating json object from cli\n * - readDir <read_dir> = directory where script should find files one would like to jsonify\n * - jsonFileName <json_file_name> = output file name one would like jsonified objects to be written to\n\t */\n\n\t// flag start\n\treadDir := flag.String(\"read_dir\", \"/Users/azim/Documents/2DGAMEASSETS/DungeonCrawl32px/player/base\", \"directory where script should find files one would like to jsonify\")\n\tjsonFileName := flag.String(\"json_file_name\", \"output.json\", \"output file name one would like jsonified stuff to be written to\")\n\n\tflag.Parse()\n\t// flag end\n\n\t\n\tfiles, err := ioutil.ReadDir(*readDir)\n if err != nil {\n log.Fatal(err)\n }\n var jsonDocumentString = \"\"\n log.Printf(\"directory count: %d\", len(files))\n for index, f := range files {\n fmt.Printf(\"[%d]: %s\", index, f.Name())\n fmt.Println()\n // tmpFileName := fmt.Sprintf(\"%s/%s\",searchDir,f.Name())\n var tmpItem = Item{}\n\t\ttmpItem.Name = f.Name()\n\t\ttmpItem.Id = 0\n\t\ttmpItem.Description = \"\"\n\t\ttmpItem.SimpleDescription = \"\"\n\t\ttmpItem.TileId = 0\n\t\ttmpItem.DirectoryIndex = index\n\n\n itemJson, _ := json.MarshalIndent(tmpItem,\"\", \" \")\n switch index {\n \tcase 0:\n \t\tjsonDocumentString += fmt.Sprintf(\"[%s\\n,\", itemJson)\n \t\tbreak\n \tcase (len(files) - 1):\n \t\tjsonDocumentString += fmt.Sprintf(\"%s]\\n\", itemJson)\n \t\tbreak\n \tdefault:\n \t\tjsonDocumentString += fmt.Sprintf(\"%s,\\n\", itemJson)\n \t\tbreak\n }\n \n\n }\n\t\n writingFile, err := os.OpenFile(*jsonFileName, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)\n\tif err != nil {\n\t panic(err)\n\t}\n\n\tdefer writingFile.Close()\n\n\tif _, err = writingFile.WriteString(jsonDocumentString); err != nil {\n\t panic(err)\n\t}\n}", "title": "" }, { "docid": "f8177d8e5e2cc452c45e23f2709d1efe", "score": "0.48120672", "text": "func JSONFormat(data []byte) string {\n\tnjson := string(data)\n\t// njson = strings.Replace(njson, \" \", \"\", -1)\n\tnjson = strings.Replace(njson, \"},{\\\"\", \"\\n},\\n{\\n\\\"\", -1)\n\tnjson = strings.Replace(njson, \"},\\\"\", \"\\n},\\n\\\"\", -1)\n\tnjson = strings.Replace(njson, \"{\\\"\", \"{\\n\\\"\", -1)\n\tnjson = strings.Replace(njson, \",\\\"\", \",\\n\\\"\", -1)\n\tnjsons := strings.Split(njson, \"\\n\")\n\n\tfor i, line := range njsons {\n\t\tline = strings.Replace(line, \"\\\":\", \"\\\": \", 1)\n\t\tif !strings.Contains(line, `\\\"`) && len(line) > 2 {\n\t\t\t// line = strings.Replace(line, \"{\", \"\\n{\", -1)\n\t\t\tline = strings.Replace(line, \"}\", \"\\n}\", -1)\n\t\t\t// line = strings.Replace(line, \"[\", \"\\n[\", -1)\n\t\t\tline = strings.Replace(line, \"[\", \"[\\n\", -1)\n\t\t\tline = strings.Replace(line, \"]\", \"\\n]\", -1)\n\t\t}\n\t\tif strings.HasSuffix(line, `\"}`) && !strings.HasSuffix(line, `\\\"}`) {\n\t\t\tline = strings.TrimSuffix(line, `}`) + \"\\n}\"\n\t\t}\n\t\tnjsons[i] = line\n\t}\n\n\tnjson = strings.Join(njsons, \"\\n\")\n\tnjsons = strings.Split(njson, \"\\n\")\n\tlevel := 0\n\tfor i, line := range njsons {\n\t\tnjsons[i] = strings.Repeat(\" \", level) + line\n\t\tif strings.HasPrefix(line, \"{\") || strings.HasSuffix(line, \"{\") || strings.HasPrefix(line, \"[\") || strings.HasSuffix(line, \"[\") {\n\t\t\tlevel++\n\t\t\t// log.Warning(\"add %d\", level)\n\t\t} else if strings.HasSuffix(line, \"}\") || strings.HasSuffix(line, \"},\") || strings.HasSuffix(line, \"]\") || strings.HasSuffix(line, \"],\") {\n\t\t\tlevel--\n\t\t\t// log.Warning(\"sub %d\", level)\n\t\t\tnjsons[i] = strings.Repeat(\" \", level*2) + line\n\t\t} else {\n\t\t}\n\t\t// fmt.Println(\"----------\" + njsons[i])\n\t}\n\tnjson = strings.Join(njsons, \"\\n\")\n\t// njson = strings.Replace(njson, \"\", \"\", -1)\n\treturn njson\n}", "title": "" }, { "docid": "38ad92b285e5d3b727ba34aafe5d783d", "score": "0.47956", "text": "func createJSONFile(filename string, smis []StockMarketIndex) {\n\tdata, _ := json.MarshalIndent(smis, \"\", \"\t\")\n\n\tif err := ioutil.WriteFile(filename, data, os.ModePerm); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "daaba25dcb64b465750519fdea211024", "score": "0.47770405", "text": "func createJSONFile(bucketName, folderName string, objects []*s3.Object) string {\n\tvar json = `{\"files\" : [`\n\tfor idx, obj := range objects {\n\t\tfileName := strings.TrimPrefix(*obj.Key, folderName+\"/\")\n\t\tif fileName != \"index.html\" && fileName != \"photos.json\" && !strings.Contains(fileName, \"_thumb.jpg\") {\n\t\t\tif idx != 0 {\n\t\t\t\tjson += \", \"\n\t\t\t}\n\t\t\tjson += `\"` + fileName + `\"`\n\t\t}\n\t}\n\tjson += `]}`\n\treturn json\n}", "title": "" }, { "docid": "a95612712bf558aa0cae4658e44fd577", "score": "0.4745597", "text": "func DataPropertyDockerconfigJSON(f *framework.Framework) (string, func(*framework.TestCase)) {\n\treturn \"[common] should sync docker configurated json secrets with template\", func(tc *framework.TestCase) {\n\t\tcloudSecretName := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, dockerConfigExampleName)\n\t\tdockerconfigString := `\"{\\\"auths\\\":{\\\"https://index.docker.io/v1/\\\": {\\\"auth\\\": \\\"c3R...zE2\\\"}}}\"`\n\t\tdockerconfig := `{\"auths\":{\"https://index.docker.io/v1/\": {\"auth\": \"c3R...zE2\"}}}`\n\t\tcloudSecretValue := fmt.Sprintf(`{\"dockerconfig\": %s}`, dockerconfigString)\n\t\ttc.Secrets = map[string]string{\n\t\t\tcloudSecretName: cloudSecretValue,\n\t\t}\n\n\t\ttc.ExpectedSecret = &v1.Secret{\n\t\t\tType: v1.SecretTypeDockerConfigJson,\n\t\t\tData: map[string][]byte{\n\t\t\t\tdockerConfigJSONKey: []byte(dockerconfig),\n\t\t\t},\n\t\t}\n\n\t\ttc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{\n\t\t\t{\n\t\t\t\tSecretKey: \"mysecret\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: cloudSecretName,\n\t\t\t\t\tProperty: \"dockerconfig\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\ttc.ExternalSecret.Spec.Target.Template = &esv1alpha1.ExternalSecretTemplate{\n\t\t\tType: v1.SecretTypeDockerConfigJson,\n\t\t\tData: map[string]string{\n\t\t\t\tdockerConfigJSONKey: mysecretToStringTemplating,\n\t\t\t},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b96543bd3ffad5876d8283a1d848f9f5", "score": "0.47356597", "text": "func CreateJsonfy(cfg setting.Config) func(string) []map[string]string {\n\tdataFieldsMapping := cfg.BuildDataFieldsMapping()\n\theadingFieldsMapping := cfg.BuildHeadingFieldsMapping()\n\tnameFieldsMapping := cfg.BuildNameFieldsMapping()\n\n\tgetFieldNameByIndex := func(index int) string {\n\t\treturn dataFieldsMapping[strconv.Itoa(index)]\n\t}\n\n\textractFieldsFromFileName := func(name string) map[string]string {\n\t\tfields := make(map[string]string)\n\n\t\tfor _, mapping := range nameFieldsMapping {\n\t\t\tparts := strings.Split(name, mapping.Separator)\n\n\t\t\tfields[mapping.FieldName] = parts[mapping.FieldPosition-1]\n\t\t}\n\t\treturn fields\n\t}\n\n\tcopyToMap := func(from map[string]string, to map[string]string) {\n\t\tfor k, v := range from {\n\t\t\tto[k] = v\n\t\t}\n\t}\n\n\treturn func(filePath string) []map[string]string {\n\n\t\tstat, err := os.Stat(filePath)\n\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn nil\n\t\t}\n\n\t\tnotValidFile := stat.IsDir() || path.Ext(filePath) != cfg.File.Extension\n\t\tif notValidFile == true {\n\t\t\tlog.Printf(\"Skipping file %s. Reason: Not a CSV file\\n\", stat.Name())\n\t\t\treturn nil\n\t\t}\n\n\t\tlog.Printf(\"Processing: %s\\n\", stat.Name())\n\t\tfile, err := os.Open(filePath)\n\n\t\t//if err != nil {\n\t\t//\tlog.Println(err)\n\t\t//\treturn nil\n\t\t//}\n\t\tdefer file.Close()\n\n\t\tvar ret []map[string]string\n\n\t\tnameFields := extractFieldsFromFileName(stat.Name())\n\t\theaderFields := make(map[string]string)\n\t\tline := 0\n\t\tscanner := bufio.NewScanner(file)\n\t\tfor scanner.Scan() {\n\t\t\tline++\n\t\t\tlineText := scanner.Text()\n\t\t\temptyLine := strings.TrimSpace(lineText) == \"\"\n\n\t\t\tif emptyLine {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif cfg.File.Data.HeaderPrefix != \"\" {\n\t\t\t\theaderDetected := strings.HasPrefix(lineText, cfg.File.Data.HeaderPrefix)\n\t\t\t\tif headerDetected {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfields := strings.Split(lineText, \",\")\n\n\t\t\theadingFieldsConfig := headingFieldsMapping[strconv.Itoa(line)]\n\t\t\theaderLineDetected := headingFieldsConfig != (setting.HeadingFieldConfig{})\n\n\t\t\tif headerLineDetected {\n\t\t\t\tvalue := strings.Split(lineText, headingFieldsConfig.Separator)[headingFieldsConfig.FieldPosition-1]\n\t\t\t\theaderFields[headingFieldsConfig.FieldName] = value\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tm := make(map[string]string)\n\n\t\t\tfor i := 0; i < len(fields); i++ {\n\t\t\t\tfieldName := getFieldNameByIndex(i + 1)\n\n\t\t\t\tm[fieldName] = strings.TrimSpace(fields[i])\n\t\t\t}\n\n\t\t\tcopyToMap(headerFields, m)\n\t\t\tcopyToMap(nameFields, m)\n\n\t\t\tret = append(ret, m)\n\t\t}\n\n\t\treturn ret\n\t}\n}", "title": "" }, { "docid": "affc79fac5c917a4110950ca2ee0b191", "score": "0.47353727", "text": "func bpJSONData(defs bpDef, output *bpData) error {\n\tvar jsonString string\n\torder := defs.devineOrder()\n\tbpAddJSON(order, defs, &jsonString)\n\n\t//Make it pretty\n\tvar pj bytes.Buffer\n\terr := json.Indent(&pj, []byte(jsonString), \"\", \"\\t\")\n\tif err != nil {\n\t\tlog.Fatal(\"Failed to generate json data with \", jsonString)\n\t}\n\toutput.PostJSON = string(pj.String())\n\toutput.PutJSON = string(pj.String())\n\n\treturn nil\n}", "title": "" }, { "docid": "46eda3c8e60d0656bda03d3e2f3fc0af", "score": "0.46916783", "text": "func buildValueJSONObject(file_obj Params_struct,permission string) string {\n\n\tval := file_obj.Value\n\t\n\t\n\tt := time.Now().In(time.UTC)\n\t\n\tvar s string = t.Format(\"01/02/2006,15:04:05\")\n\n\t// var p string= getPermission(file_obj)\n\t\t\n\t// size := strconv.Itoa(getSizeInBytes(val)) +\"bytes\"\n\tsize := getSizeInBytes(val) +\"bytes\"\n\n\t\n\tvar valueObj *ValueType_struct\n\tvalueObj = &ValueType_struct{\n\t\t\t\t\t\t\t\tContent:val,\n\t\t\t\t\t\t\t\tSize:size,\n\t\t\t\t\t\t\t\tCreated: s,\n\t\t\t\t\t\t\t\tAccessed: s,\n\t\t\t\t\t\t\t\tModified: s,\n\t\t\t\t\t\t\t\tPermission: permission }\t\t\n\n\t\n\tfile_obj.Value = *valueObj\n\tb,_:=json.Marshal(file_obj)\n\t// fmt.Println(\"Value JSON String is : \",string(b))\n\n\treturn string(b)\n\n\n}", "title": "" }, { "docid": "e8cf6715a7bb9200113ec56452cffece", "score": "0.46833137", "text": "func gen(exel_name, dict_name string) {\n\tdefer wg.Done()\n\n\tfile := execl_path + exel_name + \".xlsx\"\n\tout := dict_path + dict_name + \".json\"\n\n\txlfile, err := xlsx.OpenFile(file)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\t// only deal with Sheet 0\n\tsh := xlfile.Sheets[0]\n\tif sh == nil {\n\t\tfmt.Println(\"cant find sheet, must something wrong happen.\")\n\t\treturn\n\t}\n\n\tnrows := len(sh.Rows)\n\tif nrows < 3 {\n\t\tfmt.Println(\"wrong fmt.\")\n\t\treturn\n\t}\n\n\tlbrace, rbrace := \"{\", \"}\"\n\tlbraket, rbraket := \"[\", \"]\"\n\n\tvar json_content string\n\tjson_start := true\n\tjson_content = lbraket\n\n\trows := sh.Rows\n\n\tfor ri, row := range rows {\n\t\tif ri >= 3 {\n\t\t\tvar object string\n\n\t\t\tobject = lbrace\n\t\t\tobject += \"\\r\\n\"\n\n\t\t\tbegin := true\n\t\t\tend := true\n\n\t\t\tfor _, cell := range row.Cells {\n\t\t\t\tif str, _ := cell.String(); str != \"\" {\n\t\t\t\t\tend = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif end {\n\t\t\t\t// fmt.Printf(\"%v end.\\n\", dict_name)\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tfor ci, cell := range row.Cells {\n\t\t\t\tvar item string\n\t\t\t\tk, _ := sh.Cell(0, ci).String()\n\t\t\t\tif k == \"\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tt, _ := sh.Cell(1, ci).String()\n\n\t\t\t\ttext, _ := cell.String()\n\n\t\t\t\tif text == \"\" {\n\t\t\t\t\tif t == \"int\" {\n\t\t\t\t\t\ttext = \"0\"\n\t\t\t\t\t} else if t == \"float\" {\n\t\t\t\t\t\ttext = \"0.0\"\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tk = \"\\\"\" + k + \"\\\"\"\n\n\t\t\t\tif t == \"string\" {\n\t\t\t\t\ttext = \"\\\"\" + text + \"\\\"\"\n\t\t\t\t}\n\n\t\t\t\titem = k + \":\" + text\n\n\t\t\t\tif !begin {\n\t\t\t\t\tobject += \",\"\n\t\t\t\t\tobject += \"\\r\\n\"\n\n\t\t\t\t} else {\n\t\t\t\t\tbegin = false\n\t\t\t\t}\n\n\t\t\t\tobject += \"\\t\\t\"\n\t\t\t\tobject += item\n\t\t\t}\n\n\t\t\tobject += \"\\r\\n\"\n\t\t\tobject += \"\\t\"\n\t\t\tobject += rbrace\n\n\t\t\tif json_start {\n\t\t\t\tjson_content += \"\\r\\n\"\n\t\t\t\tjson_start = false\n\t\t\t} else {\n\t\t\t\tjson_content += \",\"\n\t\t\t\tjson_content += \"\\r\\n\"\n\t\t\t}\n\n\t\t\tjson_content += \"\\t\"\n\t\t\tjson_content += object\n\t\t}\n\t}\n\n\tjson_content += \"\\r\\n\"\n\tjson_content += rbraket\n\n\tf, err := os.OpenFile(out, os.O_RDWR|os.O_CREATE, 0755)\n\tif err != nil {\n\t\tfmt.Printf(\"open out file fail, err: %v\\n\", err)\n\t\treturn\n\t}\n\n\tdefer f.Close()\n\n\tf.WriteString(json_content)\n\n\tfmt.Printf(\"generate %v, rows %v\\n\", dict_name, nrows)\n}", "title": "" }, { "docid": "eb0438e0fb4c5e3c61d1cb306a782632", "score": "0.4646703", "text": "func formatJson(msg logMessage) string {\n\tvar text string\n\n\tbuf, _ := json.Marshal(msg.fields)\n\ttext = strings.TrimRight(string(buf), \"}\")\n\tbuf, _ = json.Marshal(msg.tags)\n\ttext += \",\\\"tags\\\":\"\n\ttext += string(buf)\n\ttext += \"}\"\n\n\ttext = strings.ReplaceAll(text, \"\\\\\\\"\", \"\\\"\")\n\n\treturn text\n}", "title": "" }, { "docid": "4ae6ad373f9c847dc7dac5a46f568486", "score": "0.4635335", "text": "func CreateJSON(cName string, key string, src []byte) error {\n\tif cMap == nil || IsOpen(cName) == false {\n\t\tif err := Open(cName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif c, found := cMap.collections[cName]; found {\n\t\tc.objectMutex.Lock()\n\t\terr := c.CreateJSON(key, src)\n\t\tc.objectMutex.Unlock()\n\t\treturn err\n\t}\n\treturn fmt.Errorf(\"%q not available\", cName)\n}", "title": "" }, { "docid": "baa62ed47450d141a8ce17d0b6e72653", "score": "0.46300322", "text": "func DockerJSONConfig(f *framework.Framework) (string, func(*framework.TestCase)) {\n\treturn \"[common] should sync docker configurated json secrets with template simple\", func(tc *framework.TestCase) {\n\t\tcloudSecretName := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, dockerConfigExampleName)\n\t\tdockerconfig := `{\"auths\":{\"https://index.docker.io/v1/\": {\"auth\": \"c3R...zE2\"}}}`\n\t\tcloudSecretValue := fmt.Sprintf(`{\"dockerconfig\": %s}`, dockerconfig)\n\t\ttc.Secrets = map[string]string{\n\t\t\tcloudSecretName: cloudSecretValue,\n\t\t}\n\n\t\ttc.ExpectedSecret = &v1.Secret{\n\t\t\tType: v1.SecretTypeOpaque,\n\t\t\tData: map[string][]byte{\n\t\t\t\tdockerConfigJSONKey: []byte(dockerconfig),\n\t\t\t},\n\t\t}\n\n\t\ttc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{\n\t\t\t{\n\t\t\t\tSecretKey: \"mysecret\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: cloudSecretName,\n\t\t\t\t\tProperty: \"dockerconfig\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\ttc.ExternalSecret.Spec.Target.Template = &esv1alpha1.ExternalSecretTemplate{\n\t\t\tData: map[string]string{\n\t\t\t\tdockerConfigJSONKey: mysecretToStringTemplating,\n\t\t\t},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e109905111a97244b5026f50378923d5", "score": "0.45983523", "text": "func (tctx *TestContext) JSON(funcName string, iargs ...interface{}) map[string]interface{} {\n\treturn tctx.Rmap(funcName, iargs...).Mapa\n}", "title": "" }, { "docid": "312b48f2dcf4457e5961110892ab43a2", "score": "0.45930356", "text": "func handlerJSON(action, column, path, value string, opt bool) Builder {\n\treturn PrepareFunc(func(q Query) error {\n\t\tq.WriteString(\" \")\n\t\tq.WriteString(column)\n\t\tq.WriteString(\" = \")\n\t\tq.WriteString(action)\n\t\tq.WriteString(\"(\")\n\t\tq.WriteString(column)\n\t\tq.WriteString(\",\")\n\t\tq.WriteString(path)\n\t\tq.WriteString(\"::text[],\")\n\t\tq.WriteString(value)\n\t\tq.WriteString(\",\")\n\t\tq.WriteString(fmt.Sprintf(\"%v\", opt))\n\t\tq.WriteString(\") \")\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "aa610f03eb78c1411e050c44dc2a6637", "score": "0.45809183", "text": "func buildTemplate(fn string) (string, error) {\n\tbuf, err := ioutil.ReadFile(fn)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(buf), nil\n}", "title": "" }, { "docid": "29550269fc1080a6c9231e464fada794", "score": "0.45759466", "text": "func appendTemplate(typ string, v *vars, w io.Writer) error {\n\tf, ok := formats[typ]\n\tif !ok {\n\t\treturn errors.New(\"unsupported format type: \" + typ)\n\t}\n\treturn f.appendTemplate(v, w)\n}", "title": "" }, { "docid": "bdeab94fe5d17d3d280e1324eedaa293", "score": "0.4569249", "text": "func CreateMconfigJSON(network *storage.Network, graph *storage.EntityGraph, gatewayID string) (*protos.GatewayConfigs, error) {\n\tbuilders, err := GetBuilders()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tconfigs := map[string]*any.Any{}\n\tfor _, b := range builders {\n\t\tpartialConfig, err := b.Build(network, graph, gatewayID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"mconfig builder %+v error: %w\", b, err)\n\t\t}\n\t\tfor key, config := range partialConfig {\n\t\t\t_, ok := configs[key]\n\t\t\tif ok {\n\t\t\t\treturn nil, fmt.Errorf(\"received partial config for key %v from multiple mconfig builders\", key)\n\t\t\t}\n\t\t\tconfigBytes := &wrappers.BytesValue{Value: config}\n\t\t\tconfigAny, err := ptypes.MarshalAny(configBytes)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tconfigs[key] = configAny\n\t\t}\n\t}\n\n\tmconfig := &protos.GatewayConfigs{\n\t\tMetadata: &protos.GatewayConfigsMetadata{CreatedAt: uint64(time.Now().Unix())},\n\t\tConfigsByKey: configs,\n\t}\n\n\treturn mconfig, nil\n}", "title": "" }, { "docid": "95418ca7148b7c978bf5ab134bd4b7e9", "score": "0.4568485", "text": "func (params CloudProviderConfig) JSON() (string, error) {\n\tbuff := &bytes.Buffer{}\n\tencoder := json.NewEncoder(buff)\n\tencoder.SetIndent(\"\", \"\\t\")\n\tif err := encoder.Encode(params); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buff.String(), nil\n}", "title": "" }, { "docid": "fb050fe2316bcc70299ac8f306f0312c", "score": "0.45598447", "text": "func (tp *testPlugin) MarshalJSON() ([]byte, error) {\n\tnormalizedPath := strings.TrimPrefix(strings.Replace(tp.Path, \"\\\\\", \"/\", -1), \"/\")\n\n\tp := map[string]any{\n\t\tfmt.Sprintf(\"file:///%s#%s\", normalizedPath, strings.TrimSpace(tp.versionTag)): map[string]string{\n\t\t\t\"settings\": \"blah\",\n\t\t},\n\t}\n\tb, err := json.Marshal(&p)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "03108a4849af56fabe58a25eef072eed", "score": "0.45573908", "text": "func (c *Config) JSON(pp bool) (string, error) {\n\tvar b []byte\n\tvar err error\n\n\tif pp {\n\t\tb, err = json.MarshalIndent(c, \"\", \" \")\n\t} else {\n\t\tb, err = json.Marshal(c)\n\t}\n\n\treturn string(b), err\n}", "title": "" }, { "docid": "98f824aaca68415e25552b0236990829", "score": "0.45444405", "text": "func PackJson(cmd BufferEx, theMap map[string]interface{}) (int, error) {\n\treturn __PackJsonMap(cmd, theMap)\n}", "title": "" }, { "docid": "9d877fae3371e61374b304d1e0e15399", "score": "0.45323807", "text": "func MakeJSON(baseKey string, content interface{}) map[string]interface{} {\n\tresult := map[string]interface{}{\n\t\tbaseKey: content,\n\t}\n\treturn result\n}", "title": "" }, { "docid": "31c6fd39417418655eea4bcc336752d6", "score": "0.4526642", "text": "func latestVersionTag(w http.ResponseWriter, r *http.Request) {\n\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\ttag := map[string]string{\"build\": buildTag}\n\tjson.NewEncoder(w).Encode(tag)\n\n}", "title": "" }, { "docid": "40627a209759c91d84c0082e7c43a0f7", "score": "0.45195898", "text": "func makeJsonTestMetric(index int) string {\n\treturn fmt.Sprintf(`{\"server\":\"main\",\"category\":\"maintenance\",\"case\":\"%v\"}`, index)\n}", "title": "" }, { "docid": "32bb084a336a1b37de7368da26a86a59", "score": "0.45154607", "text": "func createJSON(r interface{}) ([]byte, error) {\n\tjsonResp, err := json.Marshal(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn jsonResp, nil\n}", "title": "" }, { "docid": "3aa44dd2c28610151f84ff461ba0faeb", "score": "0.45140633", "text": "func (p *Form) Build() string {\n\treturn \"{\" + strings.Join(p.JsonStr, \",\") + \"}\"\n}", "title": "" }, { "docid": "c43ad56925069bc41c57c05c60a02c6a", "score": "0.45008346", "text": "func init() {\n\t\tpackr.PackJSONBytes(\"../goth/templates\", \"actions/auth.go.tmpl\", \"\\\"H4sIAAAAAAAA/9RTzW7bPBA8i0+xH5EAJKCPcoueCuRgOEb/UDuwm0NPBS2vJMISqZCrOIWgdy8oKz9FAOfci0RqhjOzwrDV+UGXCDon42xgzDSt8wSCJbxoiLOEu8AZS3hpqOp2KndNVrpdVxS6dtn05n/jjfaHnSYMWemoOguOD5NzlvS917ZEUK1392aPPsD/w3D27BMz63vYu6PNdUBQMAycAfQ92v2oIRkrOpuDsYaEhJ4lJ1e1JecRrmDetkKqLYZgnB0/shNH3Qa8eXQRzyEvjN3jQwoXWGMDH69epe57UwDeTQSuO6pm/BF6ijqiw6BWeBQuqE9IaO8F7/uufYn/+rb8yWUK5yjb5WKz/BFZRUNq23pjqRD8MlwGnk4DfnaBUuBZTJO9jpHluq53Oj+85XW9/j7/snoz0WJ9s+RSpnFkrAP+O+NPmaf6vFxKNkxlmndULaYTIofpJqiFs4QPJAG9dz52rQvo07iNPZmKt3BNWyPhbUAfhUSuNhhaZwMKmULc3XUYSEjJktgk7+G/K7CmjoqJR+q8hVwto4n4MHs3GkiWDCzJMrh2EFyDVBlbwtFQBVQhnII0+vcOwWNpAqGPQJMFU9pxBcayZ/UN2j168X42S8Grr9v1SkQNGX/CnwAAAP//zZFqvjkEAAA=\\\"\")\n}", "title": "" }, { "docid": "626fa30f59e092f98b0acb5f954ac15f", "score": "0.44966555", "text": "func genHandler(w http.ResponseWriter, r *http.Request) {\n\ttype Options struct {\n\t\tCfg string `json:\"cfg\"`\n\t\tCfgPath string `json:\"cfgpath\"`\n\t\tAPI string `json:\"api\"`\n\t\tAuth string `json:\"auth\"`\n\n\t\tTarget string `json:\"target\"`\n\t\tNoAuth bool `json:\"noauth\"`\n\t\tNoReplay bool `json:\"noreplay\"`\n\t\tIgnoreMethods []string `json:\"ignoremethods\"`\n\t\tADO bool `json:\"ado\"`\n\t}\n\tvar opts Options\n\n\tusage := `Usage via POST method:\n\n\n__OPTIONS__\n\n\n{\n\t\"cfgpath\": string, // URL for CFG file\n\t\"cfg\": string, // Literal CFG file string\n\t\"api\": string, // URL for OpenAPI JSON specification file\n\t\"auth\": string, // Authorization: Bearer [thispart]\n\t\"target\": string, // Hostname to replay built requests to\n\t\"noauth\": bool, // Strip Authorization: and Cookie: headers\n\t\"noreplay\": bool, // Do not replay built requests\n\t\"ignoremethods\": array of string, // HTTP methods to ignore (PUT, PATCH, etc.)\n\t\"ado\": bool // Use ADO output format for warnings, errors, etc. \n}\n\nRequired fields: (cfg ⊻ cfgpath) ∧ (auth ⊻ noauth) ∧ api\n\n\n__EXAMPLES__\n\n\nMinimum required fields:\n\n{\n\t\"cfgpath\":\"http://somewhere/path/to.cfg\",\n\t\"api\":\"http://somewhere/path/to/api.json\",\n\t\"auth\":\"eyzSomeKindOfOauthKeyForAuth\"\n}\n\nPass the literal CFG, change the target, don't use any auth:\n\n{\n\t\"cfg\":\"a=b\\nc=d\",\n\t\"api\":\"http://somewhere/path/to/api.json\",\n\t\"auth\":\"\",\n\t\"noauth\": true,\n\t\"target\": \"1.2.3.4\"\n}\n\nDon't replay and ignore PUT and PATCH methods:\n\n{\n\t\"cfgpath\":\"http://somewhere/path/to.cfg\",\n\t\"api\":\"http://somewhere/path/to/api.json\",\n\t\"auth\":\"eyzSomeKindOfOauthKeyForAuth\",\n\t\"noreplay\": true,\n\t\"ignoremethods\": [\"PUT\", \"PATCH\"]\n}\n\n\n__RESPONSE FORMAT__\n\n\nJSON scheme:\n\n{\n\t\"Info\": {\n\t\t\"Server\": \"somewhere/something\",\n\t\t\"Missed\":{\"someThing\":4,\"aValue\":1}\n\t},\n\t\"Conformant\": [\n\t\t{\n\t\t\"Method\": \"GET\",\n\t\t\"HTTPCode\": 401,\n\t\t\"Path\": \"/firstpath/orange\",\n\t\t\"Body\": \"\"\n\t\t},\n\t\t{\n\t\t\"Method\": \"POST\",\n\t\t\"HTTPCode\": 500,\n\t\t\"Path\": \"/secondpath/banana\",\n\t\t\"Body\": \"don't mind me\"\n\t\t},\n\t],\n\t\"Suspicious\": [\n\t\t{\n\t\t\t\"Method\": \"GET\",\n\t\t\t\"HTTPCode\": 200,\n\t\t\t\"Path\": \"/thirdpath/dubious/call\",\n\t\t\t\"Body\": \"\"\n\t\t},\n\t\t{\n\t\t\t\"Method\": \"POST\",\n\t\t\t\"HTTPCode\": 200,\n\t\t\t\"Path\": \"/fourthpath/account/update\",\n\t\t\t\"Body\": \"some kind of body\"\n\t\t},\n\t]\n} \n\n`\n\t// We only allow POST\n\tif r.Method != \"POST\" {\n\t\tw.WriteHeader(http.StatusMethodNotAllowed)\n\t\tfmt.Fprint(w, usage)\n\t\treturn\n\t}\n\n\t// Read POST body\n\tdec := json.NewDecoder(r.Body)\n\terr := dec.Decode(&opts)\n\tif err != nil && err != io.EOF {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Error:\", err, \"\\n\\n\")\n\t\tfmt.Fprintln(w, usage)\n\t\treturn\n\t}\n\n\t// Combinatorics\n\tif (opts.CfgPath == \"\" && opts.Cfg == \"\") || opts.API == \"\" || (opts.Auth == \"\" && !opts.NoAuth) {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Error: all JSON fields are mandatory (cfg ⊻ cfgPath)\\n\\n\")\n\t\tfmt.Fprintln(w, usage)\n\t\treturn\n\t}\n\n\t// We _need_ a CFG\n\tif opts.Cfg != \"\" && opts.CfgPath != \"\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Error: provide cfg ⊻ cfgPath\\n\\n\")\n\t\tfmt.Fprintln(w, usage)\n\t\treturn\n\t}\n\n\t/* Valid request format */\n\n\t// If we got a CfgPath, call out and read into response.Cfg\n\tvar dbr io.Reader\n\tif opts.Cfg == \"\" {\n\t\tresp, err := http.Get(opts.CfgPath)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"Error: request for cfgPath failed → \"+err.Error()+\"\\n\\n\")\n\t\t\tfmt.Fprintln(w, usage)\n\t\t\treturn\n\t\t}\n\t\t// If we don't get a 200 OK\n\t\tif resp.StatusCode != 200 {\n\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\tbuf, _ := ioutil.ReadAll(resp.Body)\n\t\t\tcontents := string(buf)\n\t\t\tfmt.Fprint(w, \"Error: request for cfgPath denied → \"+contents+\"\\n\\n\")\n\t\t\tlog.Println(\"fail: cfg request → \", contents)\n\t\t\treturn\n\t\t}\n\n\t\tdbr = resp.Body\n\n\t} else {\n\t\t// Got full Cfg\n\t\tdbr = strings.NewReader(opts.Cfg)\n\t}\n\n\t// Load DB via cfg\n\tdb, err := cfg.Load(dbr)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"cfg load failed → \"+err.Error()+\"\\n\\n\")\n\t\tfmt.Fprintln(w, usage)\n\t\treturn\n\t}\n\n\t// Expose response.API URL to a io.Reader\n\tresp, err := http.Get(opts.API)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tfmt.Fprint(w, \"Error: request for API JSON failed → \"+err.Error()+\"\\n\\n\")\n\t\tfmt.Fprintln(w, usage)\n\t\treturn\n\t}\n\t// If we don't get a 200 OK\n\tif resp.StatusCode != 200 {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tbuf, _ := ioutil.ReadAll(resp.Body)\n\t\tcontents := string(buf)\n\t\tfmt.Fprint(w, \"Error: request for API JSON denied → \"+contents+\"\\n\\n\")\n\t\tlog.Println(\"fail: api request → \", contents)\n\t\treturn\n\t}\n\n\t// Load openapi spec\n\tapi, err := openapi.Parse(resp.Body)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"Error: parsing OpenAPI specification failed → \"+err.Error()+\"\\n\\n\")\n\t\treturn\n\t}\n\n\t// Override target\n\tif opts.Target != \"\" {\n\t\tapi.Servers = []openapi.Server{{URL: opts.Target}}\n\t}\n\n\t// Remove relevant methods from API signatures\n\tfor _, method := range opts.IgnoreMethods {\n\t\tfor _, methods := range api.Paths {\n\n\t\t\tdown := strings.ToLower(method)\n\t\t\tdelete(methods, down)\n\t\t}\n\t}\n\n\t// Insert auth to db\n\tif !opts.NoAuth {\n\t\tdb.Records = append(db.Records, &cfg.Record{Tuples: []*cfg.Tuple{{Attributes: []*cfg.Attribute{{Name: \"Authorization\", Value: \"Bearer \" + opts.Auth}}}}})\n\t}\n\tdb.BuildMap()\n\n\t// Invoke generator\n\trequests, missed, totalPossible, err := generate(api, db)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"Error: generation failed → \"+err.Error()+\"\\n\\n\")\n\t\tfmt.Fprintln(w, usage)\n\t\treturn\n\t}\n\tif requests == nil {\n\t\trequests = []*Request{}\n\t}\n\n\t// Return built requests if we don't want to replay\n\tif *&opts.NoReplay {\n\t\tenc := json.NewEncoder(w)\n\t\terr = enc.Encode([]interface{}{requests2strings(requests), missed, totalPossible})\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tfmt.Fprint(w, \"Error: response JSON encode failed → \"+err.Error()+\"\\n\\n\")\n\t\t\tfmt.Fprintln(w, usage)\n\t\t\treturn\n\t\t}\n\t\treturn\n\t}\n\n\t// Optionally replay requests\n\tresults := make(map[*Request]*Response)\n\tfor _, request := range requests {\n\t\tresp := replay(request.Request, nil)\n\t\tresults[request] = &resp\n\t}\n\n\tsus, ok, err := validate(results)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"Error: could not parse expected code → \"+err.Error()+\"\\n\\n\")\n\t\treturn\n\t}\n\n\tif opts.ADO {\n\t\tw.Header().Add(\"Content-Type\", \"text/plain\")\n\t\tprintADO(w, requests, missed, sus, ok)\n\t\treturn\n\t}\n\n\t// Emit JSON by default for HTTP\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\terr = printJSON(w, requests, missed, sus, ok)\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"Error: could not marshal requests → \"+err.Error()+\"\\n\\n\")\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "85ef51fdb6c033f231a371094a7c12aa", "score": "0.44943914", "text": "func makeJSONInputField(graph *core.BuildGraph, unnamed []string, named map[string][]core.BuildInput) interface{} {\n\tif len(named) == 0 {\n\t\tif len(unnamed) == 0 {\n\t\t\treturn nil\n\t\t}\n\t\treturn unnamed\n\t}\n\tnamedInputs := make(map[string][]string, len(named))\n\tfor name, srcs := range named {\n\t\tnamedInputs[name] = buildInputsToStrings(graph, srcs)\n\t}\n\treturn namedInputs\n}", "title": "" }, { "docid": "096f203161c669dc477bf83d67d7e991", "score": "0.44858524", "text": "func toJSON(ec *EvalCtx, args []Value, opts map[string]Value) {\n\titerate := ScanArgsAndOptionalIterate(ec, args)\n\tTakeNoOpt(opts)\n\n\tout := ec.ports[1].File\n\n\tenc := json.NewEncoder(out)\n\titerate(func(v Value) {\n\t\terr := enc.Encode(v)\n\t\tmaybeThrow(err)\n\t})\n}", "title": "" }, { "docid": "7aedf7ba62fe7e0cea36aabf00543cb8", "score": "0.44857866", "text": "func init() {\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"README.md.tmpl\", \"\\\"IyBXZWxjb21lIHRvIEJ1ZmZhbG8hCgpUaGFuayB5b3UgZm9yIGNob29zaW5nIEJ1ZmZhbG8gZm9yIHlvdXIgd2ViIGRldmVsb3BtZW50IG5lZWRzLgoKe3sgaWYgLm9wdHMuV2l0aFBvcCAtfX0KIyMgRGF0YWJhc2UgU2V0dXAKCkl0IGxvb2tzIGxpa2UgeW91IGNob3NlIHRvIHNldCB1cCB5b3VyIGFwcGxpY2F0aW9uIHVzaW5nIGEge3sub3B0cy5EQlR5cGV9fSBkYXRhYmFzZSEgRmFudGFzdGljIQoKVGhlIGZpcnN0IHRoaW5nIHlvdSBuZWVkIHRvIGRvIGlzIG9wZW4gdXAgdGhlICJkYXRhYmFzZS55bWwiIGZpbGUgYW5kIGVkaXQgaXQgdG8gdXNlIHRoZSBjb3JyZWN0IHVzZXJuYW1lcywgcGFzc3dvcmRzLCBob3N0cywgZXRjLi4uIHRoYXQgYXJlIGFwcHJvcHJpYXRlIGZvciB5b3VyIGVudmlyb25tZW50LgoKWW91IHdpbGwgYWxzbyBuZWVkIHRvIG1ha2Ugc3VyZSB0aGF0ICoqeW91Kiogc3RhcnQvaW5zdGFsbCB0aGUgZGF0YWJhc2Ugb2YgeW91ciBjaG9pY2UuIEJ1ZmZhbG8gKip3b24ndCoqIGluc3RhbGwgYW5kIHN0YXJ0IHt7Lm9wdHMuREJUeXBlfX0gZm9yIHlvdS4KCiMjIyBDcmVhdGUgWW91ciBEYXRhYmFzZXMKCk9rLCBzbyB5b3UndmUgZWRpdGVkIHRoZSAiZGF0YWJhc2UueW1sIiBmaWxlIGFuZCBzdGFydGVkIHt7Lm9wdHMuREJUeXBlfX0sIG5vdyBCdWZmYWxvIGNhbiBjcmVhdGUgdGhlIGRhdGFiYXNlcyBpbiB0aGF0IGZpbGUgZm9yIHlvdToKCgkkIGJ1ZmZhbG8gZGIgY3JlYXRlIC1hCgp7e2VuZCAtfX0KCiMjIFN0YXJ0aW5nIHRoZSBBcHBsaWNhdGlvbgoKQnVmZmFsbyBzaGlwcyB3aXRoIGEgY29tbWFuZCB0aGF0IHdpbGwgd2F0Y2ggeW91ciBhcHBsaWNhdGlvbiBhbmQgYXV0b21hdGljYWxseSByZWJ1aWxkIHRoZSBHbyBiaW5hcnkgYW5kIGFueSBhc3NldHMgZm9yIHlvdS4gVG8gZG8gdGhhdCBydW4gdGhlICJidWZmYWxvIGRldiIgY29tbWFuZDoKCgkkIGJ1ZmZhbG8gZGV2CgpJZiB5b3UgcG9pbnQgeW91ciBicm93c2VyIHRvIFtodHRwOi8vMTI3LjAuMC4xOjMwMDBdKGh0dHA6Ly8xMjcuMC4wLjE6MzAwMCkgeW91IHNob3VsZCBzZWUgYSAiV2VsY29tZSB0byBCdWZmYWxvISIgcGFnZS4KCioqQ29uZ3JhdHVsYXRpb25zISoqIFlvdSBub3cgaGF2ZSB5b3VyIEJ1ZmZhbG8gYXBwbGljYXRpb24gdXAgYW5kIHJ1bm5pbmcuCgojIyBXaGF0IE5leHQ/CgpXZSByZWNvbW1lbmQgeW91IGhlYWRpbmcgb3ZlciB0byBbaHR0cDovL2dvYnVmZmFsby5pb10oaHR0cDovL2dvYnVmZmFsby5pbykgYW5kIHJldmlld2luZyBhbGwgb2YgdGhlIGdyZWF0IGRvY3VtZW50YXRpb24gdGhlcmUuCgpHb29kIGx1Y2shCgpbUG93ZXJlZCBieSBCdWZmYWxvXShodHRwOi8vZ29idWZmYWxvLmlvKQo=\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"actions/actions_test.go.tmpl\", \"\\\"cGFja2FnZSBhY3Rpb25zCgppbXBvcnQgKAoJInRlc3RpbmciCgoJImdpdGh1Yi5jb20vZ29idWZmYWxvL3BhY2tyIgoJImdpdGh1Yi5jb20vZ29idWZmYWxvL3N1aXRlIgopCgp0eXBlIEFjdGlvblN1aXRlIHN0cnVjdCB7Cgkqc3VpdGUuQWN0aW9uCn0KCmZ1bmMgVGVzdF9BY3Rpb25TdWl0ZSh0ICp0ZXN0aW5nLlQpIHsKCWFjdGlvbiwgZXJyIDo9IHN1aXRlLk5ld0FjdGlvbldpdGhGaXh0dXJlcyhBcHAoKSwgcGFja3IuTmV3Qm94KCIuLi9maXh0dXJlcyIpKQoJaWYgZXJyICE9IG5pbCB7CgkJdC5GYXRhbChlcnIpCgl9CgoJYXMgOj0gJkFjdGlvblN1aXRlewoJCUFjdGlvbjogYWN0aW9uLAoJfQoJc3VpdGUuUnVuKHQsIGFzKQp9Cg==\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"actions/app.go.tmpl\", \"\\\"cGFja2FnZSBhY3Rpb25zCgppbXBvcnQgKAogICJnaXRodWIuY29tL2dvYnVmZmFsby9lbnZ5IgogICJnaXRodWIuY29tL2dvYnVmZmFsby9idWZmYWxvIgogIGZvcmNlc3NsICJnaXRodWIuY29tL2dvYnVmZmFsby9tdy1mb3JjZXNzbCIKICBwYXJhbWxvZ2dlciAiZ2l0aHViLmNvbS9nb2J1ZmZhbG8vbXctcGFyYW1sb2dnZXIiCiAgImdpdGh1Yi5jb20vdW5yb2xsZWQvc2VjdXJlIgoKICB7eyBpZiAub3B0cy5XaXRoUG9wIH19CiAgInt7Lm9wdHMuTW9kZWxzUGtnfX0iCiAgImdpdGh1Yi5jb20vZ29idWZmYWxvL2J1ZmZhbG8tcG9wL3BvcC9wb3BtdyIKICB7eyBlbmQgLX19CgogIHt7IGlmIC5vcHRzLkFzV2ViIC19fQogIGNzcmYgImdpdGh1Yi5jb20vZ29idWZmYWxvL213LWNzcmYiCiAgaTE4biAiZ2l0aHViLmNvbS9nb2J1ZmZhbG8vbXctaTE4biIKICAiZ2l0aHViLmNvbS9nb2J1ZmZhbG8vcGFja3IiCiAge3sgZW5kIC19fQoKICB7eyBpZiAub3B0cy5Bc0FQSSAtfX0KICAiZ2l0aHViLmNvbS9ycy9jb3JzIgogICJnaXRodWIuY29tL2dvYnVmZmFsby94L3Nlc3Npb25zIgogIGNvbnRlbnR0eXBlICJnaXRodWIuY29tL2dvYnVmZmFsby9tdy1jb250ZW50dHlwZSIKICB7eyBlbmQgLX19CikKCi8vIEVOViBpcyB1c2VkIHRvIGhlbHAgc3dpdGNoIHNldHRpbmdzIGJhc2VkIG9uIHdoZXJlIHRoZQovLyBhcHBsaWNhdGlvbiBpcyBiZWluZyBydW4uIERlZmF1bHQgaXMgImRldmVsb3BtZW50Ii4KdmFyIEVOViA9IGVudnkuR2V0KCJHT19FTlYiLCAiZGV2ZWxvcG1lbnQiKQp2YXIgYXBwICpidWZmYWxvLkFwcAp7eyBpZiAub3B0cy5Bc1dlYiAtfX0KdmFyIFQgKmkxOG4uVHJhbnNsYXRvcgp7eyBlbmQgfX0KCi8vIEFwcCBpcyB3aGVyZSBhbGwgcm91dGVzIGFuZCBtaWRkbGV3YXJlIGZvciBidWZmYWxvCi8vIHNob3VsZCBiZSBkZWZpbmVkLiBUaGlzIGlzIHRoZSBuZXJ2ZSBjZW50ZXIgb2YgeW91cgovLyBhcHBsaWNhdGlvbi4KLy8KLy8gUm91dGluZywgbWlkZGxld2FyZSwgZ3JvdXBzLCBldGMuLi4gYXJlIGRlY2xhcmVkIFRPUCAtPiBET1dOLgovLyBUaGlzIG1lYW5zIGlmIHlvdSBhZGQgYSBtaWRkbGV3YXJlIHRvIGBhcHBgICphZnRlciogZGVjbGFyaW5nIGEKLy8gZ3JvdXAsIHRoYXQgZ3JvdXAgd2lsbCBOT1QgaGF2ZSB0aGF0IG5ldyBtaWRkbGV3YXJlLiBUaGUgc2FtZQovLyBpcyB0cnVlIG9mIHJlc291cmNlIGRlY2xhcmF0aW9ucyBhcyB3ZWxsLgovLwovLyBJdCBhbHNvIG1lYW5zIHRoYXQgcm91dGVzIGFyZSBjaGVja2VkIGluIHRoZSBvcmRlciB0aGV5IGFyZSBkZWNsYXJlZC4KLy8gYFNlcnZlRmlsZXNgIGlzIGEgQ0FUQ0gtQUxMIHJvdXRlLCBzbyBpdCBzaG91bGQgYWx3YXlzIGJlCi8vIHBsYWNlZCBsYXN0IGluIHRoZSByb3V0ZSBkZWNsYXJhdGlvbnMsIGFzIGl0IHdpbGwgcHJldmVudCByb3V0ZXMKLy8gZGVjbGFyZWQgYWZ0ZXIgaXQgdG8gbmV2ZXIgYmUgY2FsbGVkLgpmdW5jIEFwcCgpICpidWZmYWxvLkFwcCB7CiAgaWYgYXBwID09IG5pbCB7CiAgICBhcHAgPSBidWZmYWxvLk5ldyhidWZmYWxvLk9wdGlvbnN7CiAgICAgIEVudjogRU5WLAogICAgICB7eyBpZiAub3B0cy5Bc0FQSSAtfX0KICAgICAgU2Vzc2lvblN0b3JlOiBzZXNzaW9ucy5OdWxse30sCiAgICAgIFByZVdhcmVzOiBbXWJ1ZmZhbG8uUHJlV2FyZXsKICAgICAgICBjb3JzLkRlZmF1bHQoKS5IYW5kbGVyLAogICAgICB9LAogICAgICB7eyBlbmQgLX19CiAgICAgIFNlc3Npb25OYW1lOiAiX3t7Lm9wdHMuTmFtZS5GaWxlfX1fc2Vzc2lvbiIsCiAgICB9KQoKICAgIC8vIEF1dG9tYXRpY2FsbHkgcmVkaXJlY3QgdG8gU1NMCiAgICBhcHAuVXNlKGZvcmNlU1NMKCkpCgogICAgLy8gTG9nIHJlcXVlc3QgcGFyYW1ldGVycyAoZmlsdGVycyBhcHBseSkuCiAgICBhcHAuVXNlKHBhcmFtbG9nZ2VyLlBhcmFtZXRlckxvZ2dlcikKCiAgICB7eyBpZiAub3B0cy5Bc0FQSSAtfX0KICAgIC8vIFNldCB0aGUgcmVxdWVzdCBjb250ZW50IHR5cGUgdG8gSlNPTgogICAgYXBwLlVzZShjb250ZW50dHlwZS5TZXQoImFwcGxpY2F0aW9uL2pzb24iKSkKICAgIHt7IGVuZCB9fQoKICAgIHt7IGlmIC5vcHRzLkFzV2ViIC19fQogICAgLy8gUHJvdGVjdCBhZ2FpbnN0IENTUkYgYXR0YWNrcy4gaHR0cHM6Ly93d3cub3dhc3Aub3JnL2luZGV4LnBocC9Dcm9zcy1TaXRlX1JlcXVlc3RfRm9yZ2VyeV8oQ1NSRikKICAgIC8vIFJlbW92ZSB0byBkaXNhYmxlIHRoaXMuCiAgICBhcHAuVXNlKGNzcmYuTmV3KQogICAge3sgZW5kIH19CgogICAge3sgaWYgLm9wdHMuV2l0aFBvcCB9fQogICAgLy8gV3JhcHMgZWFjaCByZXF1ZXN0IGluIGEgdHJhbnNhY3Rpb24uCiAgICAvLyAgYy5WYWx1ZSgidHgiKS4oKnBvcC5Db25uZWN0aW9uKQogICAgLy8gUmVtb3ZlIHRvIGRpc2FibGUgdGhpcy4KICAgIGFwcC5Vc2UocG9wbXcuVHJhbnNhY3Rpb24obW9kZWxzLkRCKSkKICAgIHt7IGVuZCB9fQoKICAgIHt7IGlmIC5vcHRzLkFzV2ViIC19fQogICAgLy8gU2V0dXAgYW5kIHVzZSB0cmFuc2xhdGlvbnM6CiAgICBhcHAuVXNlKHRyYW5zbGF0aW9ucygpKQogICAge3sgZW5kIH19CgogICAgYXBwLkdFVCgiLyIsIEhvbWVIYW5kbGVyKQoKICAgIHt7IGlmIC5vcHRzLkFzV2ViIC19fQogICAgYXBwLlNlcnZlRmlsZXMoIi8iLCBhc3NldHNCb3gpIC8vIHNlcnZlIGZpbGVzIGZyb20gdGhlIHB1YmxpYyBkaXJlY3RvcnkKICAgIHt7IGVuZCAtfX0KICB9CgogIHJldHVybiBhcHAKfQoKe3sgaWYgLm9wdHMuQXNXZWIgLX19Ci8vIHRyYW5zbGF0aW9ucyB3aWxsIGxvYWQgbG9jYWxlIGZpbGVzLCBzZXQgdXAgdGhlIHRyYW5zbGF0b3IgYGFjdGlvbnMuVGAsCi8vIGFuZCB3aWxsIHJldHVybiBhIG1pZGRsZXdhcmUgdG8gdXNlIHRvIGxvYWQgdGhlIGNvcnJlY3QgbG9jYWxlIGZvciBlYWNoCi8vIHJlcXVlc3QuCi8vIGZvciBtb3JlIGluZm9ybWF0aW9uOiBodHRwczovL2dvYnVmZmFsby5pby9lbi9kb2NzL2xvY2FsaXphdGlvbgpmdW5jIHRyYW5zbGF0aW9ucygpIGJ1ZmZhbG8uTWlkZGxld2FyZUZ1bmMgewogIHZhciBlcnIgZXJyb3IKICBpZiBULCBlcnIgPSBpMThuLk5ldyhwYWNrci5OZXdCb3goIi4uL2xvY2FsZXMiKSwgImVuLVVTIik7IGVyciAhPSBuaWwgewogICAgYXBwLlN0b3AoZXJyKQogIH0KICByZXR1cm4gVC5NaWRkbGV3YXJlKCkKfQp7eyBlbmQgfX0KCi8vIGZvcmNlU1NMIHdpbGwgcmV0dXJuIGEgbWlkZGxld2FyZSB0aGF0IHdpbGwgcmVkaXJlY3QgYW4gaW5jb21pbmcgcmVxdWVzdAovLyBpZiBpdCBpcyBub3QgSFRUUFMuICJodHRwOi8vZXhhbXBsZS5jb20iID0+ICJodHRwczovL2V4YW1wbGUuY29tIi4KLy8gVGhpcyBtaWRkbGV3YXJlIGRvZXMgKipub3QqKiBlbmFibGUgU1NMLiBmb3IgeW91ciBhcHBsaWNhdGlvbi4gVG8gZG8gdGhhdAovLyB3ZSByZWNvbW1lbmQgdXNpbmcgYSBwcm94eTogaHR0cHM6Ly9nb2J1ZmZhbG8uaW8vZW4vZG9jcy9wcm94eQovLyBmb3IgbW9yZSBpbmZvcm1hdGlvbjogaHR0cHM6Ly9naXRodWIuY29tL3Vucm9sbGVkL3NlY3VyZS8KZnVuYyBmb3JjZVNTTCgpIGJ1ZmZhbG8uTWlkZGxld2FyZUZ1bmMgewogIHJldHVybiBmb3JjZXNzbC5NaWRkbGV3YXJlKHNlY3VyZS5PcHRpb25zewogICAgU1NMUmVkaXJlY3Q6ICAgICBFTlYgPT0gInByb2R1Y3Rpb24iLAogICAgU1NMUHJveHlIZWFkZXJzOiBtYXBbc3RyaW5nXXN0cmluZ3siWC1Gb3J3YXJkZWQtUHJvdG8iOiAiaHR0cHMifSwKICB9KQp9Cg==\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"actions/home.go.tmpl\", \"\\\"cGFja2FnZSBhY3Rpb25zCgppbXBvcnQgImdpdGh1Yi5jb20vZ29idWZmYWxvL2J1ZmZhbG8iCgovLyBIb21lSGFuZGxlciBpcyBhIGRlZmF1bHQgaGFuZGxlciB0byBzZXJ2ZSB1cAovLyBhIGhvbWUgcGFnZS4KZnVuYyBIb21lSGFuZGxlcihjIGJ1ZmZhbG8uQ29udGV4dCkgZXJyb3IgewogIHt7IGlmIC5vcHRzLkFzV2ViIC19fQoJcmV0dXJuIGMuUmVuZGVyKDIwMCwgci5IVE1MKCJpbmRleC5odG1sIikpCiAge3sgZW5kIC19fQogIHt7IGlmIC5vcHRzLkFzQVBJIC19fQogIHJldHVybiBjLlJlbmRlcigyMDAsIHIuSlNPTihtYXBbc3RyaW5nXXN0cmluZ3sibWVzc2FnZSI6ICJXZWxjb21lIHRvIEJ1ZmZhbG8hIn0pKQogIHt7IGVuZCAtfX0KfQo=\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"actions/home_test.go.tmpl\", \"\\\"cGFja2FnZSBhY3Rpb25zCgpmdW5jIChhcyAqQWN0aW9uU3VpdGUpIFRlc3RfSG9tZUhhbmRsZXIoKSB7CiAge3sgaWYgLm9wdHMuQXNXZWIgLX19CglyZXMgOj0gYXMuSFRNTCgiLyIpLkdldCgpCiAge3sgZW5kIC19fQogIHt7IGlmIC5vcHRzLkFzQVBJIC19fQoJcmVzIDo9IGFzLkpTT04oIi8iKS5HZXQoKQogIHt7IGVuZCAtfX0KCglhcy5FcXVhbCgyMDAsIHJlcy5Db2RlKQoJYXMuQ29udGFpbnMocmVzLkJvZHkuU3RyaW5nKCksICJXZWxjb21lIHRvIEJ1ZmZhbG8iKQp9Cg==\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"actions/render.go.tmpl\", \"\\\"cGFja2FnZSBhY3Rpb25zCgppbXBvcnQgKAogIHt7IGlmIC5vcHRzLkFzV2ViIC19fQogICJnaXRodWIuY29tL2dvYnVmZmFsby9wYWNrciIKICB7eyBlbmQgLX19CiAgImdpdGh1Yi5jb20vZ29idWZmYWxvL2J1ZmZhbG8vcmVuZGVyIgopCgp2YXIgciAqcmVuZGVyLkVuZ2luZQp7eyBpZiAub3B0cy5Bc1dlYiAtfX0KdmFyIGFzc2V0c0JveCA9IHBhY2tyLk5ld0JveCgiLi4vcHVibGljIikKe3sgZW5kIC19fQoKZnVuYyBpbml0KCkgewogIHIgPSByZW5kZXIuTmV3KHJlbmRlci5PcHRpb25zewogICAge3sgaWYgLm9wdHMuQXNBUEkgLX19CiAgICAgIERlZmF1bHRDb250ZW50VHlwZTogImFwcGxpY2F0aW9uL2pzb24iLAogICAge3sgZW5kIC19fQogICAge3sgaWYgLm9wdHMuQXNXZWIgLX19CiAgICAgIC8vIEhUTUwgbGF5b3V0IHRvIGJlIHVzZWQgZm9yIGFsbCBIVE1MIHJlcXVlc3RzOgogICAgICBIVE1MTGF5b3V0OiAgICAgImFwcGxpY2F0aW9uLmh0bWwiLAoKICAgICAgLy8gQm94IGNvbnRhaW5pbmcgYWxsIG9mIHRoZSB0ZW1wbGF0ZXM6CiAgICAgIFRlbXBsYXRlc0JveDogcGFja3IuTmV3Qm94KCIuLi90ZW1wbGF0ZXMiKSwKICAgICAgQXNzZXRzQm94OiAgICBhc3NldHNCb3gsCgogICAgICAvLyBBZGQgdGVtcGxhdGUgaGVscGVycyBoZXJlOgogICAgICBIZWxwZXJzOiByZW5kZXIuSGVscGVyc3sKICAgICAgLy8gdW5jb21tZW50IGZvciBub24tQm9vdHN0cmFwIGZvcm0gaGVscGVyczoKICAgICAgLy8gImZvcm0iOiAgICAgcGx1c2guRm9ybUhlbHBlciwKICAgICAgLy8gImZvcm1fZm9yIjogcGx1c2guRm9ybUZvckhlbHBlciwKICAgICAgfSwKICAgIHt7IGVuZCAtfX0KICB9KQp9Cg==\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"dot-codeclimate.yml.tmpl\", \"\\\"ZW5naW5lczoKICBmaXhtZToKICAgIGVuYWJsZWQ6IHRydWUKICBnb2ZtdDoKICAgIGVuYWJsZWQ6IHRydWUKICBnb2xpbnQ6CiAgICBlbmFibGVkOiB0cnVlCiAgZ292ZXQ6CiAgICBlbmFibGVkOiB0cnVlCmV4Y2x1ZGVfcGF0aHM6CiAgLSBncmlmdHMvKiovKgogIC0gIioqLypfdGVzdC5nbyIKICAtICIqX3Rlc3QuZ28iCiAgLSAiKipfdGVzdC5nbyIKICAtIGxvZ3MvKgogIC0gcHVibGljLyoKICAtIHRlbXBsYXRlcy8qCnJhdGluZ3M6CiAgcGF0aHM6CiAgICAtICIqKi5nbyIK\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"dot-env.tmpl\", \"\\\"IyBUaGlzIC5lbnYgZmlsZSB3YXMgZ2VuZXJhdGVkIGJ5IGJ1ZmZhbG8sIGFkZCBoZXJlIHRoZSBlbnYgdmFyaWFibGVzIHlvdSBuZWVkIAojIGJ1ZmZhbG8gdG8gbG9hZCBpbnRvIHRoZSBFTlYgb24gYXBwbGljYXRpb24gc3RhcnR1cCBzbyB5b3VyIGFwcGxpY2F0aW9uIHdvcmtzIGNvcnJlY3RseS4KIyBUbyBhZGQgdmFyaWFibGVzIHVzZSBLRVk9VkFMVUUgZm9ybWF0LCB5b3UgY2FuIGxhdGVyIHJldHJpZXZlIHRoaXMgaW4geW91ciBhcHBsaWNhdGlvbgojIGJ5IHVzaW5nIG9zLkdldGVudigiS0VZIikuCiMKIyBFeGFtcGxlOgojIERBVEFCQVNFX1BBU1NXT1JEPVhYWFhYWFhYWAojIFNFU1NJT05fU0VDUkVUPVhYWFhYWFhYWAojIFNNVFBfU0VSVkVSPVhYWFhYWFhYWAo=\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"fixtures/sample.toml.tmpl\", \"\\\"W1tzY2VuYXJpb11dCm5hbWUgPSAibG90cyBvZiB3aWRnZXRzIgoKICBbW3NjZW5hcmlvLnRhYmxlXV0KICAgIG5hbWUgPSAid2lkZ2V0cyIKCiAgICBbW3NjZW5hcmlvLnRhYmxlLnJvd11dCiAgICAgIGlkID0gIjwlPSB1dWlkTmFtZWQoIndpZGdldCIpICU+IgogICAgICBuYW1lID0gIlRoaXMgaXMgd2lkZ2V0ICMxIgogICAgICBib2R5ID0gInNvbWUgd2lkZ2V0IGJvZHkiCiAgICAgIGNyZWF0ZWRfYXQgPSAiPCU9IG5vdygpICU+IgogICAgICB1cGRhdGVkX2F0ID0gIjwlPSBub3coKSAlPiIKCiAgICBbW3NjZW5hcmlvLnRhYmxlLnJvd11dCiAgICAgIGlkID0gIjwlPSB1dWlkKCkgJT4iCiAgICAgIG5hbWUgPSAiVGhpcyBpcyB3aWRnZXQgIzIiCiAgICAgIGJvZHkgPSAic29tZSB3aWRnZXQgYm9keSIKICAgICAgY3JlYXRlZF9hdCA9ICI8JT0gbm93KCkgJT4iCiAgICAgIHVwZGF0ZWRfYXQgPSAiPCU9IG5vdygpICU+IgoKICBbW3NjZW5hcmlvLnRhYmxlXV0KICAgIG5hbWUgPSAidXNlcnMiCgogICAgW1tzY2VuYXJpby50YWJsZS5yb3ddXQogICAgICBpZCA9ICI8JT0gdXVpZCgpICU+IgogICAgICBuYW1lID0gIk1hcmsgQmF0ZXMiCiAgICAgIGFkbWluID0gdHJ1ZQogICAgICBhZ2UgPSA0MQogICAgICB3aWRnZXRfaWQgPSAiPCU9IHV1aWROYW1lZCgid2lkZ2V0IikgJT4iCiAgICAgIGNyZWF0ZWRfYXQgPSAiPCU9IG5vdygpICU+IgogICAgICB1cGRhdGVkX2F0ID0gIjwlPSBub3coKSAlPiIKCg==\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"go.mod.tmpl\", \"\\\"bW9kdWxlIHt7Lm9wdHMuQXBwLlBhY2thZ2VQa2d9fQo=\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"grifts/init.go.tmpl\", \"\\\"cGFja2FnZSBncmlmdHMKCmltcG9ydCAoCiAgImdpdGh1Yi5jb20vZ29idWZmYWxvL2J1ZmZhbG8iCgkie3sgLm9wdHMuQWN0aW9uc1BrZyB9fSIKKQoKZnVuYyBpbml0KCkgewogIGJ1ZmZhbG8uR3JpZnRzKGFjdGlvbnMuQXBwKCkpCn0K\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"inflections.json.tmpl\", \"\\\"ewogICJzaW5ndWxhciI6ICJwbHVyYWwiCn0K\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"locales/all.en-us.yaml.tmpl\", \"\\\"IyBGb3IgbW9yZSBpbmZvcm1hdGlvbiBvbiB1c2luZyBpMThuIHNlZTogaHR0cHM6Ly9naXRodWIuY29tL25pY2tzbnlkZXIvZ28taTE4bgotIGlkOiB3ZWxjb21lX2dyZWV0aW5nCiAgdHJhbnNsYXRpb246ICJXZWxjb21lIHRvIEJ1ZmZhbG8gKEVOKSIK\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"main.go.tmpl\", \"\\\"cGFja2FnZSBtYWluCgppbXBvcnQgKAogICJsb2ciCgogICJ7eyAub3B0cy5BY3Rpb25zUGtnIH19IgopCgovLyBtYWluIGlzIHRoZSBzdGFydGluZyBwb2ludCBmb3IgeW91ciBCdWZmYWxvIGFwcGxpY2F0aW9uLgovLyBZb3UgY2FuIGZlZWwgZnJlZSBhbmQgYWRkIHRvIHRoaXMgYG1haW5gIG1ldGhvZCwgY2hhbmdlCi8vIHdoYXQgaXQgZG9lcywgZXRjLi4uCi8vIEFsbCB3ZSBhc2sgaXMgdGhhdCwgYXQgc29tZSBwb2ludCwgeW91IG1ha2Ugc3VyZSB0bwovLyBjYWxsIGBhcHAuU2VydmUoKWAsIHVubGVzcyB5b3UgZG9uJ3Qgd2FudCB0byBzdGFydCB5b3VyCi8vIGFwcGxpY2F0aW9uIHRoYXQgaXMuIDopCmZ1bmMgbWFpbigpIHsKICBhcHAgOj0gYWN0aW9ucy5BcHAoKQogIGlmIGVyciA6PSBhcHAuU2VydmUoKTsgZXJyICE9IG5pbCB7CiAgICBsb2cuRmF0YWwoZXJyKQogIH0KfQoKLyoKIyBOb3RlcyBhYm91dCBgbWFpbi5nb2AKCiMjIFNTTCBTdXBwb3J0CgpXZSByZWNvbW1lbmQgcGxhY2luZyB5b3VyIGFwcGxpY2F0aW9uIGJlaGluZCBhIHByb3h5LCBzdWNoIGFzCkFwYWNoZSBvciBOZ2lueCBhbmQgbGV0dGluZyB0aGVtIGRvIHRoZSBTU0wgaGVhdnkgbGlmdGluZwpmb3IgeW91LiBodHRwczovL2dvYnVmZmFsby5pby9lbi9kb2NzL3Byb3h5CgojIyBCdWZmYWxvIEJ1aWxkCgpXaGVuIGBidWZmYWxvIGJ1aWxkYCBpcyBydW4gdG8gY29tcGlsZSB5b3VyIGJpbmFyeSwgdGhpcyBgbWFpbmAKZnVuY3Rpb24gd2lsbCBiZSBhdCB0aGUgaGVhcnQgb2YgdGhhdCBiaW5hcnkuIEl0IGlzIGV4cGVjdGVkCnRoYXQgeW91ciBgbWFpbmAgZnVuY3Rpb24gd2lsbCBzdGFydCB5b3VyIGFwcGxpY2F0aW9uIHVzaW5nCnRoZSBgYXBwLlNlcnZlKClgIG1ldGhvZC4KCiovCg==\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"public/robots.txt.tmpl\", \"\\\"VXNlci1hZ2VudDogKgpEaXNhbGxvdzogLwo=\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"templates/_flash.html.tmpl\", \"\\\"PGRpdiBjbGFzcz0icm93Ij4KICA8ZGl2IGNsYXNzPSJjb2wtbWQtMTIiPgogICAgPCU9IGZvciAoaywgbWVzc2FnZXMpIGluIGZsYXNoIHsgJT4KICAgICAgPCU9IGZvciAobXNnKSBpbiBtZXNzYWdlcyB7ICU+CiAgICAgICAgPGRpdiBjbGFzcz0iYWxlcnQgYWxlcnQtPCU9IGsgJT4iIHJvbGU9ImFsZXJ0Ij4KICAgICAgICAgIDwlPSBtc2cgJT4KICAgICAgICAgIDxidXR0b24gdHlwZT0iYnV0dG9uIiBjbGFzcz0iY2xvc2UiIGRhdGEtZGlzbWlzcz0iYWxlcnQiIGFyaWEtbGFiZWw9IkNsb3NlIj4KICAgICAgICAgICAgPHNwYW4gYXJpYS1oaWRkZW49InRydWUiPiZ0aW1lczs8L3NwYW4+CiAgICAgICAgICA8L2J1dHRvbj4KICAgICAgICA8L2Rpdj4KICAgICAgPCUgfSAlPgogICAgPCUgfSAlPgogIDwvZGl2Pgo8L2Rpdj4K\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"templates/application.html.tmpl\", \"\\\"PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCwgaW5pdGlhbC1zY2FsZT0xIj4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KICAgIDx0aXRsZT5CdWZmYWxvIC0ge3sgLm9wdHMuTmFtZS5UaXRsZSB9fTwvdGl0bGU+CiAge3stIGlmIG5vdCAub3B0cy5XaXRoV2VicGFjayB9fQogICAge3stIGlmIGVxIC5vcHRzLkJvb3RzdHJhcCAzIH19CiAgICA8bGluayByZWw9InN0eWxlc2hlZXQiIGhyZWY9Imh0dHBzOi8vbWF4Y2RuLmJvb3RzdHJhcGNkbi5jb20vYm9vdHN0cmFwLzMuMy43L2Nzcy9ib290c3RyYXAubWluLmNzcyIgaW50ZWdyaXR5PSJzaGEzODQtQlZZaWlTSUZlSzFkR21KUkFreWN1SEFIUmczMk9tVWN3dzdvbjNSWWRnNFZhK1BtU1Rzei9LNjh2YmRFamg0dSIgY3Jvc3NvcmlnaW49ImFub255bW91cyI+CiAgICB7ey0gZWxzZSB9fQogICAgPGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBocmVmPSJodHRwczovL3N0YWNrcGF0aC5ib290c3RyYXBjZG4uY29tL2Jvb3RzdHJhcC80LjEuMC9jc3MvYm9vdHN0cmFwLm1pbi5jc3MiIGludGVncml0eT0ic2hhMzg0LTlnVlE0ZFlGd3dXU2pJRFpuTEVXbnhDamVTV0ZwaEppd0dQWHIxamRkSWhPZWdpdTFGd081cVJHdkZYT2RKWjQiIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiPgogICAge3stIGVuZCB9fQogICAgCiAgICA8JT0gc3R5bGVzaGVldFRhZygiYnVmZmFsby5jc3MiKSAlPgogIHt7LSBlbmQgfX0KICAgIDwlPSBzdHlsZXNoZWV0VGFnKCJhcHBsaWNhdGlvbi5jc3MiKSAlPgogICAgPG1ldGEgbmFtZT0iY3NyZi1wYXJhbSIgY29udGVudD0iYXV0aGVudGljaXR5X3Rva2VuIiAvPgogICAgPG1ldGEgbmFtZT0iY3NyZi10b2tlbiIgY29udGVudD0iPCU9IGF1dGhlbnRpY2l0eV90b2tlbiAlPiIgLz4KICAgIDxsaW5rIHJlbD0iaWNvbiIgaHJlZj0iPCU9IGFzc2V0UGF0aCgiaW1hZ2VzL2Zhdmljb24uaWNvIikgJT4iPgogIDwvaGVhZD4KICA8Ym9keT4KCiAgICA8ZGl2IGNsYXNzPSJjb250YWluZXIiPgogICAgICA8JT0gcGFydGlhbCgiZmxhc2guaHRtbCIpICU+CiAgICAgIDwlPSB5aWVsZCAlPgogICAgPC9kaXY+CgogICAgPCU9IGphdmFzY3JpcHRUYWcoImFwcGxpY2F0aW9uLmpzIikgJT4KICA8L2JvZHk+CjwvaHRtbD4K\\\"\")\n\tpackr.PackJSONBytes(\"../newapp/templates\", \"templates/index.html.tmpl\", \"\\\"PGhlYWRlcj4KICA8ZGl2IGNsYXNzPSJjb250YWluZXIiPgogICAgPGRpdiBjbGFzcz0icm93Ij4KICAgICAgPGRpdiBjbGFzcz0iY29sLW1kLTEgY29sLXNtLTIgY29sLXhzLTIgbG9nbyI+CiAgICAgICAgPGEgaHJlZj0iPCU9IHJvb3RQYXRoKCkgJT4iPjxpbWcgc3JjPSI8JT0gcm9vdFBhdGgoKSAlPmFzc2V0cy9pbWFnZXMvbG9nby5zdmciIGFsdD0iIj48L2E+CiAgICAgIDwvZGl2PgogICAgICA8ZGl2IGNsYXNzPSJjb2wtbWQtOSBjb2wtc20tOSBjb2wteHMtMTAgdGl0bGVzIj4KICAgICAgICA8aDE+PCU9IHQoIndlbGNvbWVfZ3JlZXRpbmciKSAlPjwvaDE+CiAgICAgICAgPGgyPgogICAgICAgICAgPGEgaHJlZj0iaHR0cHM6Ly9naXRodWIuY29tL2dvYnVmZmFsby9idWZmYWxvIj48aSBjbGFzcz0iZmEgZmEtZ2l0aHViIiBhcmlhLWhpZGRlbj0idHJ1ZSI+PC9pPiBodHRwczovL2dpdGh1Yi5jb20vZ29idWZmYWxvL2J1ZmZhbG88L2E+CiAgICAgICAgPC9oMj4KICAgICAgICA8aDIgY2xhc3M9ImRvY3VtZW50YXRpb24iPgogICAgICAgICAgPGEgaHJlZj0iaHR0cDovL2dvYnVmZmFsby5pby8iPjxpIGNsYXNzPSJmYSBmYS1ib29rIiBhcmlhLWhpZGRlbj0idHJ1ZSI+PC9pPiBEb2N1bWVudGF0aW9uPC9hPgogICAgICAgIDwvaDI+CiAgICAgIDwvZGl2PgogICAgPC9kaXY+CiAgPC9kaXY+Cgo8L2hlYWRlcj4KCjxkaXYgY2xhc3M9InJvdyI+CiAgPGRpdiBjbGFzcz0iY29sLW1kLTEyIj4KICAgIDxkaXYgY2xhc3M9InN1YnRpdGxlIj4KICAgICAgPGRpdiBjbGFzcz0iY29udGFpbmVyIj4KICAgICAgICA8aDM+RGVmaW5lZCBSb3V0ZXM8L2gzPgogICAgICA8L2Rpdj4KICAgIDwvZGl2PgogICAgPGRpdiBjbGFzcz0idGFibGUtcmVzcG9uc2l2ZSI+CiAgICAgIDx0YWJsZSBjbGFzcz0idGFibGUgdGFibGUtc3RyaXBlZCI+CiAgICAgICAgPHRoZWFkPgogICAgICAgICAgPHRyIHRleHQtYWxpZ249ImxlZnQiPgogICAgICAgICAgICA8dGggY2xhc3M9ImNlbnRlcmVkIj5NRVRIT0Q8L3RoPgogICAgICAgICAgICA8dGg+UEFUSDwvdGg+CiAgICAgICAgICAgIDx0aD5OQU1FPC90aD4KICAgICAgICAgICAgPHRoPkhBTkRMRVI8L3RoPgogICAgICAgICAgPC90cj4KICAgICAgICA8L3RoZWFkPgogICAgICAgIDx0Ym9keT4KCiAgICAgICAgICA8JT0gZm9yIChyKSBpbiByb3V0ZXMgeyAlPgogICAgICAgICAgICA8dHI+CiAgICAgICAgICAgICAgPHRkIGNsYXNzPSJjZW50ZXJlZCI+CiAgICAgICAgICAgICAgICA8JT0gci5NZXRob2QgJT4KICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgIDx0ZD4KICAgICAgICAgICAgICAgIDwlPSBpZiAoci5NZXRob2QgIT0gIkdFVCIgfHwgci5QYXRoIH49ICJ7IikgeyAlPgogICAgICAgICAgICAgICAgICA8JT0gci5QYXRoICU+CiAgICAgICAgICAgICAgICA8JSB9IGVsc2UgeyAlPgogICAgICAgICAgICAgICAgICA8YSBocmVmPSI8JT0gci5QYXRoICU+Ij48JT0gci5QYXRoICU+PC9hPgogICAgICAgICAgICAgICAgPCUgfSAlPgogICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgICAgPHRkPgogICAgICAgICAgICAgICAgPCU9IHIuUGF0aE5hbWUgJT4KICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgIDx0ZD48Y29kZT48JT0gci5IYW5kbGVyTmFtZSAlPjwvY29kZT48L3RkPgogICAgICAgICAgICA8L3RyPgogICAgICAgICAgPCUgfSAlPgoKICAgICAgICA8L3Rib2R5PgogICAgICA8L3RhYmxlPgogICAgPC9kaXY+CiAgPC9kaXY+CjwvZGl2Pgo8ZGl2IGNsYXNzPSJmb290Ij4gPHNwYW4+IFBvd2VyZWQgYnkgPGEgaHJlZj0iaHR0cDovL2dvYnVmZmFsby5pby8iPmdvYnVmZmFsby5pbzwvYT48L3NwYW4+IDwvZGl2Pgo=\\\"\")\n}", "title": "" }, { "docid": "aa82bae838f0aca2eaaf4af8f5991d61", "score": "0.44802055", "text": "func (f Faker) Json() Json {\n\treturn Json{&f}\n}", "title": "" }, { "docid": "c63ee4da82cee3e446d35815a03514d5", "score": "0.44796392", "text": "func modifyJSON(sys *types.SystemContext, editor func(fileContents *dockerConfigFile) (bool, string, error)) (string, error) {\n\tpath, _, err := getPathToAuth(sys)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif path.legacyFormat {\n\t\treturn \"\", fmt.Errorf(\"writes to %s using legacy format are not supported\", path.path)\n\t}\n\n\tdir := filepath.Dir(path.path)\n\tif err = os.MkdirAll(dir, 0700); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfileContents, err := path.parse()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"reading JSON file %q: %w\", path.path, err)\n\t}\n\n\tupdated, description, err := editor(&fileContents)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"updating %q: %w\", path.path, err)\n\t}\n\tif updated {\n\t\tnewData, err := json.MarshalIndent(fileContents, \"\", \"\\t\")\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"marshaling JSON %q: %w\", path.path, err)\n\t\t}\n\n\t\tif err = ioutils.AtomicWriteFile(path.path, newData, 0600); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"writing to file %q: %w\", path.path, err)\n\t\t}\n\t}\n\n\tif description == \"\" {\n\t\tdescription = path.path\n\t}\n\treturn description, nil\n}", "title": "" }, { "docid": "6a1d863875e9acc95bdabac74d94f646", "score": "0.44785738", "text": "func easyjson(pkgs []string) error {\n\tlogf(\"RUNNING: easyjson\")\n\teg, _ := errgroup.WithContext(context.Background())\n\tfor _, k := range pkgs {\n\t\teg.Go(func(n string) func() error {\n\t\t\treturn func() error {\n\t\t\t\tn = filepath.Join(*flagOut, n)\n\t\t\t\tp := parser.Parser{AllStructs: true}\n\t\t\t\tif err := p.Parse(n, true); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tg := bootstrap.Generator{\n\t\t\t\t\tOutName: filepath.Join(n, easyjsonGo),\n\t\t\t\t\tPkgPath: p.PkgPath,\n\t\t\t\t\tPkgName: p.PkgName,\n\t\t\t\t\tTypes: p.StructNames,\n\t\t\t\t\tNoFormat: true,\n\t\t\t\t}\n\t\t\t\treturn g.Run()\n\t\t\t}\n\t\t}(k))\n\t}\n\treturn eg.Wait()\n}", "title": "" }, { "docid": "09434adcb6edc8cb6038a540af2de7d2", "score": "0.44751558", "text": "func (v ObjectID) BuildJSONSchema() (map[string]interface{}, error) {\n\treturn map[string]interface{}{\n\t\t\"type\": \"string\",\n\t\t\"pattern\": \"^[0-9a-fA-F]{24}$\",\n\t}, nil\n}", "title": "" }, { "docid": "04bd2b9cd58164812fb761808f28b19c", "score": "0.445619", "text": "func (g *FeatureCollection) AppendJSON(dst []byte) []byte {\n\tdst = append(dst, `{\"type\":\"FeatureCollection\",\"features\":[`...)\n\tfor i := 0; i < len(g.children); i++ {\n\t\tif i > 0 {\n\t\t\tdst = append(dst, ',')\n\t\t}\n\t\tdst = g.children[i].AppendJSON(dst)\n\t}\n\tdst = append(dst, ']')\n\tif g.extra != nil {\n\t\tdst = g.extra.appendJSONExtra(dst, false)\n\t}\n\tdst = append(dst, '}')\n\tstrings.Index(\"\", \" \")\n\treturn dst\n}", "title": "" }, { "docid": "d40bb615649bd3c0d01f572234b41a4f", "score": "0.44539738", "text": "func (params CloudConfig) JSON() (string, error) {\n\tbuff := &bytes.Buffer{}\n\tencoder := json.NewEncoder(buff)\n\tencoder.SetIndent(\"\", \"\\t\")\n\tif err := encoder.Encode(params); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buff.String(), nil\n}", "title": "" }, { "docid": "da6dd561841e6f16e8945b2b112be069", "score": "0.44520128", "text": "func CreateCardJSON() int {\n\tlevelDirs, err := ioutil.ReadDir(ImgPath)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif val, _ := exists(DataPath + jsonName); val {\n\t\tos.RemoveAll(DataPath + jsonName)\n\t}\n\n\tlevels := GenerateLevels(levelDirs)\n\tstatMap := ParseStats(DataPath + \"stats.txt\")\n\n\tcards := make([]deck.Card, 0, 110)\n\tfor _, level := range levels {\n\t\tfor _, cardName := range level.cards {\n\t\t\tcard := deck.Card{ImgName: cardName, Level: level.level, Name: cardName[2 : len(cardName)-4], CardID: len(cards)}\n\t\t\tAddStats(&card, statMap)\n\t\t\tcards = append(cards, card)\n\t\t}\n\t}\n\n\tbytes, err := json.MarshalIndent(cards, \"\", \"\\t\")\n\terr = ioutil.WriteFile(DataPath+jsonName, bytes, os.ModePerm)\n\n\treturn len(cards)\n}", "title": "" }, { "docid": "4c8a51609010542b992a43d49f9ca1f9", "score": "0.44466317", "text": "func Build(function string) (interface{}, []declarative.Widget) {\n\tswitch function {\n\tcase \"CreateJson\":\n\t\treturn new(CreateJsonDatabinder), CreateJsonTemplate\n\tcase \"JsonToDictionary\":\n\t\treturn new(JsonToDictionaryDatabinder), JsonToDictionaryTemplate\n\tcase \"SaveJson\":\n\t\treturn new(SaveJsonDatabinder), SaveJsonTemplate\n\t}\n\tfmt.Println(\"GOTOMATE ERROR: Unable to find the function for instruction building\")\n\treturn nil, nil\n}", "title": "" }, { "docid": "28af81c738f47e363c743c8bbb49e99f", "score": "0.44429502", "text": "func NewJSON(out io.Writer, level Level, timeLayout string) Logger {\n\ta := newLogger(out, level, timeLayout)\n\ta.writeFunc = a.writeJSON\n\tgo a.run()\n\treturn a\n}", "title": "" }, { "docid": "53ebefce28ad0e7915d14aa2b02f7c54", "score": "0.44389212", "text": "func (b *MapBuilder) ApplyTemplates(existingJSON []byte, input []byte, appendTemplates bool) ([]byte, error) {\n\tvar err error\n\tif len(existingJSON) == 0 {\n\t\texistingJSON = []byte(\"{}\")\n\t}\n\texistingJSON = bytes.TrimSpace(existingJSON)\n\n\timports, err := b.getTemplateVariablesJsonnet(existingJSON, input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttemplates := []string{}\n\tfor _, template := range b.templates {\n\t\ttemplates = append(templates, strings.TrimSpace(template))\n\t}\n\n\tif appendTemplates {\n\t\ttemplates = append([]string{string(existingJSON)}, templates...)\n\t} else {\n\t\ttemplates = append(templates, string(existingJSON))\n\t}\n\n\tvar mergedJSON string\n\tmergedJSON, err = evaluateJsonnet(imports, templates...)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to merge json. %w\", err)\n\t}\n\n\treturn []byte(mergedJSON), nil\n}", "title": "" }, { "docid": "64bb13171e36f86b3804352f61ea4fe5", "score": "0.44362226", "text": "func (j *Json) Append(pattern string, value interface{}) error {\n p := j.getPointerByPattern(pattern)\n if p == nil {\n return j.Set(fmt.Sprintf(\"%s.0\", pattern), value)\n }\n switch (*p).(type) {\n case []interface{}:\n return j.Set(fmt.Sprintf(\"%s.%d\", pattern, len((*p).([]interface{}))), value)\n }\n return fmt.Errorf(\"invalid variable type of %s\", pattern)\n}", "title": "" }, { "docid": "24b6a1894ffd39915d70a6348107a915", "score": "0.4434732", "text": "func jsonMarshal(v interface{}, JSONFileName string, path string) error {\n\tdata, err := json.MarshalIndent(v, \"\", \"\\t\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn err\n\t}\n\tfile, err := os.OpenFile(path+JSONFileName, os.O_APPEND|os.O_CREATE, 0644)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn err\n\t}\n\t_, err = file.Write(data)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tfile.Close()\n\t\treturn err\n\t}\n\terr = file.Close()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn err\n\t}\n\treturn err\n\n}", "title": "" }, { "docid": "ead3b5b0a7ef86a2e83842bc64be0380", "score": "0.4425941", "text": "func BeginObjectJsonStructure (buf bytes.Buffer, key string) bytes.Buffer {\n if IsStringEmpty(key) {\n return buf\n }\n // add the key and open \"{\"\n buf.WriteString(\"\\\"\")\n buf.WriteString(key)\n buf.WriteString(\"\\\": {\")\n\n return buf\n}", "title": "" }, { "docid": "298dd7ecc869a927dc13110a6cdda2a9", "score": "0.4417184", "text": "func Json(context *macaron.Context, res bool) *jsonContext {\n\tc := new(jsonContext)\n\tc.context = context\n\tc.data = make(map[string]interface{})\n\tc.data[\"res\"] = res\n\treturn c\n}", "title": "" }, { "docid": "548ea1c35794231d3da88460480f473c", "score": "0.4414311", "text": "func createPVCJSONFile(newVolumeCreateRequest *VolumeCreateRequest, PVCJSONFileName string, path string) error {\n\n\tfor i := 0; i < len(newVolumeCreateRequest.VolumeNames); i++ {\n\t\tVolumeName := newVolumeCreateRequest.VolumeNames[i]\n\n\t\tpvc := PVC{\n\t\t\tApiversion: \"v1\",\n\t\t\tKind: \"PersistentVolumeClaim\",\n\t\t\tMetadata: MetadataPVC{\n\t\t\t\tName: VolumeName,\n\t\t\t},\n\t\t\tSpec: SpecPVC{\n\t\t\t\tAccessModes: []string{newVolumeCreateRequest.AccessModes},\n\t\t\t\tResources: ResourcesPVC{\n\t\t\t\t\tRequests: RequestsPVC{\n\t\t\t\t\t\tStorage: newVolumeCreateRequest.VolSize,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStorageClassName: strings.ToLower(newVolumeCreateRequest.ServiceLevel) + \"-sc\",\n\t\t\t},\n\t\t}\n\n\t\terr := jsonMarshal(pvc, PVCJSONFileName, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "07237b6d9346aad7817e18b48f1386fc", "score": "0.4408906", "text": "func JSONFileVia(flagName string) ParseOption {\n\treturn func(f *FlagSet) error {\n\t\tif f.configFile != nil {\n\t\t\treturn f.failf(\"error handling %v flag, config file already set\", flagName)\n\t\t}\n\n\t\tflag := f.Lookup(flagName)\n\n\t\tf.configFile = &jsonConfigFile{\n\t\t\tfs: f,\n\t\t\tfileNameFlag: flag,\n\t\t}\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "d5c122ae86d699dfc3ad7cf27f205866", "score": "0.4407074", "text": "func BuildPatch(p map[string]string) ([]byte, error) {\n\tpatches := []JSONPatch{}\n\tfor p, v := range p {\n\t\tpatch := JSONPatch{\n\t\t\tOp: \"replace\",\n\t\t\tPath: p,\n\t\t\tValue: v,\n\t\t}\n\n\t\tpatches = append(patches, patch)\n\n\t}\n\n\tpatchesBytes, err := json.Marshal(patches)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn patchesBytes, nil\n}", "title": "" }, { "docid": "c09a4addfc91a1bcc2f65342602c9620", "score": "0.44040495", "text": "func (builder JSONTagBuilder) Build(column *Column) string {\n\treturn fmt.Sprintf(\"json:\\\"%s\\\"\", column.Name)\n}", "title": "" }, { "docid": "12d30e4cff69dedcc364da2e6086ffbd", "score": "0.43984076", "text": "func makeJSONWithLongNote(t *testing.T) []byte {\n\tsuperLongFilter := frontend.IgnoreRuleBody{\n\t\tDuration: \"1w\",\n\t\tFilter: \"a=b\",\n\t\tNote: strings.Repeat(\"really long note \", 1000),\n\t}\n\tsuperLongFilterBytes, err := json.Marshal(superLongFilter)\n\trequire.NoError(t, err)\n\treturn superLongFilterBytes\n}", "title": "" }, { "docid": "ea00e70fde97c93f7e08d253e83ac464", "score": "0.4387753", "text": "func (tc testCase) netConfJSON(dataDir string) string {\n\tconf := fmt.Sprintf(netConfStr, tc.cniVersion, BRNAME)\n\tif tc.vlan != 0 {\n\t\tconf += fmt.Sprintf(vlan, tc.vlan)\n\n\t\tif tc.removeDefaultVlan {\n\t\t\tconf += preserveDefaultVlan\n\t\t}\n\t}\n\n\tif tc.isLayer2 && tc.vlanTrunk != nil {\n\t\tconf += vlanTrunkStartStr\n\t\tfor i, vlan := range tc.vlanTrunk {\n\t\t\tif i > 0 {\n\t\t\t\tconf += \",\"\n\t\t\t}\n\t\t\tif vlan.ID != nil {\n\t\t\t\tconf += fmt.Sprintf(vlanTrunk, *vlan.ID)\n\t\t\t}\n\t\t\tif vlan.MinID != nil && vlan.MaxID != nil {\n\t\t\t\tconf += fmt.Sprintf(vlanTrunkRange, *vlan.MinID, *vlan.MaxID)\n\t\t\t}\n\t\t}\n\t\tconf += vlanTrunkEndStr\n\t}\n\n\tif tc.ipMasq {\n\t\tconf += tc.ipMasqConfig()\n\t}\n\tif tc.args.cni.mac != \"\" {\n\t\tconf += fmt.Sprintf(argsFormat, tc.args.cni.mac)\n\t}\n\tif tc.runtimeConfig.mac != \"\" {\n\t\tconf += fmt.Sprintf(runtimeConfig, tc.runtimeConfig.mac)\n\t}\n\tif tc.macspoofchk {\n\t\tconf += fmt.Sprintf(macspoofchkFormat, tc.macspoofchk)\n\t}\n\n\tif !tc.isLayer2 {\n\t\tconf += netDefault\n\t\tif tc.subnet != \"\" || tc.ranges != nil {\n\t\t\tconf += ipamStartStr\n\t\t\tif dataDir != \"\" {\n\t\t\t\tconf += fmt.Sprintf(ipamDataDirStr, dataDir)\n\t\t\t}\n\t\t\tif tc.subnet != \"\" {\n\t\t\t\tconf += tc.subnetConfig()\n\t\t\t}\n\t\t\tif tc.ranges != nil {\n\t\t\t\tconf += tc.rangesConfig()\n\t\t\t}\n\t\t\tif tc.resolvConf != \"\" {\n\t\t\t\tconf += tc.resolvConfConfig()\n\t\t\t}\n\t\t\tconf += ipamEndStr\n\t\t}\n\t} else {\n\t\tconf += `,\n\t\"ipam\": {}`\n\t}\n\treturn \"{\" + conf + \"\\n}\"\n}", "title": "" }, { "docid": "884ee37694287592aa23c6c39dc34df5", "score": "0.43830478", "text": "func writeJSON(data []job) {\r\n\tfile, err := json.MarshalIndent(data, \"\", \" \")\r\n\tif err != nil {\r\n\t\tlog.Println(\"Unable to create json file\")\r\n\t\treturn\r\n\t}\r\n\t_ = ioutil.WriteFile(\"jobs.json\", file, 0644)\r\n}", "title": "" }, { "docid": "425bc0a907d8a663d1cd1e184b8f3e4c", "score": "0.43762556", "text": "func jsonRules() []edit.Rule {\n\treturn []edit.Rule{\n\t\tmustCompile(`\"(\\\\.|[^\"])*?\":`, keywordID),\n\t\tmustCompile(`\"(\\\\.|[^\"])*?\"`, literalID),\n\t\tmustCompile(`\\b(true|false|null)\\b`, literalID),\n\t\tmustCompile(`\\b(\\d+\\.\\d*|\\d*\\.\\d+|\\d+)([Ee][+-]?\\d+)?\\b`, literalID),\n\t}\n}", "title": "" }, { "docid": "1c5754308779c5a1611e45e5d4aba84c", "score": "0.43655306", "text": "func TestReadJson(t *testing.T) {\n\n\ts := pkg.Script{}\n\tj := s.JSON\n\n\tj.LoopDelay = 20\n\tj.Log = \"/tmp/mem.log\"\n\tj.LogSizeLimit = 40000\n\tj.Command = `./cmd.sh`\n\tj.Command = `body() { IFS= read -r header; printf '%s %s\\n %s\\n' $(date \"+%Y-%m-%d %H:%M:%S\") \"$header\"; \"$@\"; } && ps aux| body sort -n -r -k 4|head -n4`\n\n\tj.ArchiveLog = \"/tmp/archive.log\"\n\tj.DieAfterHours = 200\n\n\todata, err := json.Marshal(j)\n\tif err != nil {\n\t\tlog.Printf(\"ejson: %s\\n\", err)\n\t}\n\n\tfile := \".script\"\n\n\tlog.Println(string(odata))\n\n\tn, err := jsonconfig.WriteFile(string(odata),\n\t\tfile)\n\tif err != nil {\n\t\tlog.Printf(\"error: %v, %v\\n\", n, err)\n\t\tt.Fail()\n\t}\n\n\tj = pkg.JSON{}\n\terr = jsonconfig.ReadJSON(file, &j)\n\tif err != nil {\n\t\tt.Fatalf(\"s=%v\", s)\n\t}\n}", "title": "" }, { "docid": "11c2177bf048ce2e57bff42f9259af14", "score": "0.43435508", "text": "func (a *ArgVars) MarshalJSON() ([]byte, error) {\n\n\t// Return arg regardless of whether it's empty or not:\n\t// we have to return *something*\n\tif len(a.vars) == 0 {\n\t\t// Want empty string, i.e. \"\", not null\n\t\tvar arg string\n\t\tif a.arg != nil {\n\t\t\targ = *a.arg\n\t\t}\n\t\treturn json.Marshal(arg)\n\t}\n\n\treturn json.Marshal(&struct {\n\t\tRoot interface{} `json:\"alfredworkflow\"`\n\t}{\n\t\tRoot: &struct {\n\t\t\tArg *string `json:\"arg,omitempty\"`\n\t\t\tVars map[string]string `json:\"variables\"`\n\t\t}{\n\t\t\tArg: a.arg,\n\t\t\tVars: a.vars,\n\t\t},\n\t})\n}", "title": "" }, { "docid": "3b9a1fc057269b858e1a664ab6d9d0a9", "score": "0.4341963", "text": "func JSON(path string, config interface{}) error {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\n\tdecoder := json.NewDecoder(file)\n\n\terr = decoder.Decode(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7ccb36533ee39fc22f5f45ac19f162bc", "score": "0.433612", "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": "414af53a26cd884ce8125d5b5423b311", "score": "0.43338788", "text": "func (f *formatter) render(base, args []interface{}) []byte {\n\tbuf := bytes.NewBuffer(make([]byte, 0, 1024))\n\tif f.opts.jsonOutput {\n\t\tbuf.WriteByte('{')\n\t}\n\tf.flatten(buf, base, false, false)\n\tf.flatten(buf, args, len(base) > 0, true)\n\tif f.opts.jsonOutput {\n\t\tbuf.WriteByte('}')\n\t}\n\tbuf.WriteByte('\\n')\n\treturn buf.Bytes()\n}", "title": "" }, { "docid": "2cb48ecb248e8dcaa8dc4895d98d7f2c", "score": "0.43245447", "text": "func Frock_jmap( jif interface{} ) ( json string ) {\n\tjmap := make( map[string]interface{}, 1024 )\n\t\n\tjmap, ok := jif.( map[string]interface{} )\t\t\t// right now we only support a jmap\n\tif ! ok {\n\t\treturn \"\"\n\t}\n\n\tjstr := \"{\"\n\tsep := \" \"\n\n\tfor k, v := range jmap {\n\t\tjstr += fmt.Sprintf( \"%s%q: \", sep, k )\n\t\tjstr += frock_if( v )\n\t\tsep = \", \"\n\t}\n\n\tjstr += \"}\"\n\treturn jstr\n}", "title": "" }, { "docid": "c487a36505d0315b85b24215cbe5d4ef", "score": "0.43239167", "text": "func Format(configurations map[string]interface{}) (string, error) {\n\tvar output string\n\tfor file, config := range configurations {\n\t\toutput += file + \"\\n\"\n\n\t\tcurrent, err := format(config)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"marshal output to json: %w\", err)\n\t\t}\n\n\t\toutput += current\n\t}\n\n\treturn output, nil\n}", "title": "" }, { "docid": "93f9a1a9083b980ea0aaea7bce96bf58", "score": "0.432051", "text": "func TemplateFunc(args ...interface{}) (interface{}, error) {\n\tf := &Formatter{}\n\tfor i := 0; i < len(args)-1; i += 2 {\n\t\tkey := args[i]\n\t\tstrValue := fmt.Sprint(args[i+1])\n\n\t\tswitch key {\n\t\tcase \"GroupSeparator\":\n\t\t\tf.GroupSeparator = strValue\n\t\tcase \"GroupSize\":\n\t\t\tn, err := strconv.ParseInt(strValue, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tf.GroupSize = int(n)\n\t\tcase \"DecimalSeparator\":\n\t\t\tf.DecimalSeparator = strValue\n\t\tcase \"RoundPlaces\":\n\t\t\tn, err := strconv.ParseInt(strValue, 10, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif f.Rounder == nil {\n\t\t\t\tf.Rounder = &Rounder{}\n\t\t\t}\n\t\t\tf.Rounder.Places = int32(n)\n\t\tcase \"Shift\":\n\t\t\tn, err := strconv.ParseInt(strValue, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tf.Shift = int32(n)\n\t\tcase \"MinDecimalPlaces\":\n\t\t\tn, err := strconv.ParseInt(strValue, 10, 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tf.MinDecimalPlaces = int32(n)\n\t\tcase \"Template\":\n\t\t\tf.Template = strValue\n\t\tcase \"NegativeTemplate\":\n\t\t\tf.NegativeTemplate = strValue\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown key: %s\", key)\n\t\t}\n\t}\n\n\tif len(args)%2 == 1 {\n\t\treturn f.Format(args[len(args)-1]), nil\n\t}\n\n\treturn f.Format, nil\n}", "title": "" }, { "docid": "41add03b7f0fb1ff4addaea36c7dc39e", "score": "0.43161356", "text": "func (fps *CreateNotificationChannelRequest_FieldSubPath) JSONString() string {\n\treturn strcase.ToLowerCamel(fps.selector.String()) + \".\" + fps.subPath.JSONString()\n}", "title": "" }, { "docid": "fce9a732f9d08ca792c996984d96f694", "score": "0.4294431", "text": "func JSONDataWithoutTargetName(f *framework.Framework) (string, func(*framework.TestCase)) {\n\treturn \"[common] should sync with empty target name, using json.\", func(tc *framework.TestCase) {\n\t\tsecretKey := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, \"one\")\n\t\tsecretValue := \"{\\\"foo\\\":\\\"foo-val\\\",\\\"bar\\\":\\\"bar-val\\\"}\"\n\t\ttc.Secrets = map[string]string{\n\t\t\tsecretKey: secretValue,\n\t\t}\n\t\ttc.ExpectedSecret = &v1.Secret{\n\t\t\tType: v1.SecretTypeOpaque,\n\t\t\tData: map[string][]byte{\n\t\t\t\tsecretKey: []byte(\"foo-val\"),\n\t\t\t},\n\t\t}\n\t\ttc.ExternalSecret.Spec.Target.Name = \"\"\n\t\ttc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{\n\t\t\t{\n\t\t\t\tSecretKey: secretKey,\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: secretKey,\n\t\t\t\t\tProperty: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c99253e7cfee1afd4dd19eff22d3cc2f", "score": "0.42923403", "text": "func buildBody(url, suffix string, port int) ([]byte, error) {\n var body struct{\n url string `json:\"url\"`\n port int `json:\"port\"`\n suffix string `json:\"suffix\"`\n }\n body.url = url\n body.port = port\n body.suffix = suffix\n return json.Marshal(body)\n}", "title": "" }, { "docid": "7cbf42b073fb9fdc2f2d938d9e853d31", "score": "0.4289705", "text": "func json_pack(json_string string, outgoing_message OutgoingMessage) {\n\n\tencoded_json, err := json.Marshal(json_string)\n}", "title": "" }, { "docid": "1b900a1c2cc4cc1e050a3b3d7634d246", "score": "0.42855066", "text": "func goTemplateMarshal(v interface{}) ([]byte, error) {\n\tt := argTemplate\n\n\tif !strings.Contains(t, \"{{\") {\n\t\tif *flagRange {\n\t\t\tt = \"{{ range . }}{{\" + t + \"}}{{ end }}\"\n\t\t} else if *flagSimple {\n\t\t\tt = \"{{\" + t + \"}}\"\n\t\t}\n\t}\n\n\ttpl, err := template.New(\"base\").Funcs(funcMap()).Parse(t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf := new(bytes.Buffer)\n\tif err := tpl.Execute(buf, v); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}", "title": "" }, { "docid": "d79a867f310f63477611cb8b661e5966", "score": "0.42853236", "text": "func makeJSONWithLongFilter(t *testing.T) []byte {\n\tsuperLongFilter := frontend.IgnoreRuleBody{\n\t\tDuration: \"1w\",\n\t\tFilter: strings.Repeat(\"a=b&\", 10000),\n\t\tNote: \"really long filter\",\n\t}\n\tsuperLongFilterBytes, err := json.Marshal(superLongFilter)\n\trequire.NoError(t, err)\n\treturn superLongFilterBytes\n}", "title": "" }, { "docid": "9b74e3ae0762039ad596adf16ebe0109", "score": "0.42818394", "text": "func AboutPost(c *gin.Context) {\n c.JSON(http.StatusOK, gin.H{\n \"name\": \"Tormag\",\n \"mode\": setting.Mode,\n \"build\": map[string]string{\n \"time\": setting.BuildTime,\n \"hash\": setting.BuildHash,\n },\n })\n}", "title": "" }, { "docid": "05318a7b1a8c9f75740d47a6ce94ba68", "score": "0.42685542", "text": "func Json() *Config {\n\treturn NewConfig(\n\t\tJSON{},\n\t\tfunc (req http.Request, param string) (*http.Status, interface{}) {\n\t\t\treturn nil, param\n\t\t},\n\t\tfunc (req http.Request, param interface{}) (*http.Status, interface{}) {\n\t\t\ts, ok := param.(string); if !ok { return req.Respond(400, ERR_NOT_STRING), nil }\n\t\t\treturn nil, s\n\t\t},\n\t)\n}", "title": "" }, { "docid": "a33eec7b66c7e72e57730f730cab6e0c", "score": "0.42656276", "text": "func bFwrite(sb []byte, jsonPath string) {\n\terr := ioutil.WriteFile(jsonPath, sb, 0777)\n\tif err != nil {\n\t\tfmt.Println(err, \"!!! aFwriteJson()\")\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "75e7cef8d80d194618a45ae4946dbb3d", "score": "0.4260836", "text": "func (p *Perceptron) JSON(filename string) error {\n\tb, err := json.Marshal(p.export())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = ioutil.WriteFile(filename, b, 0666); err != nil {\n\t\treturn err\n\t}\n\tfmt.Printf(\"Perceptron Configuration:\\n%s\\n\", string(b))\n\treturn nil\n}", "title": "" }, { "docid": "f51d57925038316f67a3d0ce2b084e68", "score": "0.42606506", "text": "func (s *Service) GenerateJSONDoc(w io.Writer) {\n\t// fmt.Println(len(s.routes))\n\t// r := s.routes[0]\n\t// fmt.Printf(\"%#v\\n\", r)\n\t// j, err := json.Marshal(r)\n\t// if err != nil {\n\t// \tfmt.Println(err)\n\t// \treturn\n\t// }\n\t// fmt.Println(j)\n\tjson.NewEncoder(w).Encode(s.routes)\n}", "title": "" }, { "docid": "b9a54b76fe4c10c696a9498b88399f8b", "score": "0.4258378", "text": "func CreateBinaryJSON(in interface{}) BinaryJSON {\n\tbj, err := CreateBinaryJSONWithCheck(in)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn bj\n}", "title": "" }, { "docid": "fd29cf6dfa81baf87b0fef649b1054a0", "score": "0.42534786", "text": "func marshalJSON(val interface{}) template.JS {\n\tretv := []byte{}\n\tretv, _ = json.Marshal(val)\n\n\treturn template.JS(retv)\n}", "title": "" }, { "docid": "9480bf563728da21009b8b974233f2c9", "score": "0.42431974", "text": "func newSource(n, p string, ops []string, js []byte) (s *cfg.Source, err error) {\n\tvar (\n\t\tkind reflect.Kind\n\t\tfile *cfg.File\n\t\tdata interface{}\n\t\tmap_ map[string]interface{}\n\t\topts = make([]func(*mergo.Config), 0, len(ops))\n\t)\n\n\tp = strings.Trim(p, \"/\")\n\n\tif err = json.Unmarshal(js, &data); err != nil {\n\t\treturn\n\t}\n\n\tkind = reflect.TypeOf(data).Kind()\n\n\tif p == \"\" && kind != reflect.Map {\n\t\treturn nil, fmt.Errorf(\"json must be an object if path is omitted\")\n\t} else if p != \"\" {\n\t\tmap_ = cfg.PointerToMap(p, data)\n\t} else {\n\t\tmap_ = data.(map[string]interface{})\n\t}\n\n\tfile = &cfg.File{\n\t\tPath: n,\n\t\tData: map_,\n\t}\n\n\tfor _, op := range ops {\n\t\tswitch op {\n\t\tcase \"a\":\n\t\t\topts = append(opts, mergo.WithOverride, mergo.WithAppendSlice)\n\t\tcase \"m\":\n\t\t\topts = append(opts, mergo.WithOverride)\n\t\t}\n\t}\n\n\treturn &cfg.Source{\n\t\tFile: file,\n\t\tOptions: opts,\n\t}, nil\n}", "title": "" }, { "docid": "c30a382d5a80d9901d5d5a49cb00b4d6", "score": "0.42431167", "text": "func (e *e1para) MarshalJSON() ([]byte, error) {\r\n\tvar outd string\r\n\tif len(e.Parameters) > 0 {\r\n\t\tif regexp.MustCompile(`^[+-]?[0-9]*[\\.]?[0-9]+$`).Match([]byte(e.Parameters[0].(string))) ||\r\n\t\t\tregexp.MustCompile(`^\\[|\\]$`).Match([]byte(e.Parameters[0].(string))) ||\r\n\t\t\tregexp.MustCompile(\"^{|}$\").Match([]byte(e.Parameters[0].(string))) {\r\n\t\t\toutd = fmt.Sprintf(\"{\\\"devMode\\\":%t, \\\"parameters\\\":%v, \\\"function\\\":%q}\", e.DevMode, e.Parameters, e.Function)\r\n\t\t} else if regexp.MustCompile(\"([a-zA-Z]|[0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])\").Match([]byte(e.Parameters[0].(string))) {\r\n\t\t\toutd = fmt.Sprintf(\"{\\\"devMode\\\":%t, \\\"parameters\\\":%q, \\\"function\\\":%q}\", e.DevMode, e.Parameters, e.Function)\r\n\t\t}\r\n\t} else {\r\n\t\toutd = fmt.Sprintf(\"{\\\"devMode\\\":%t, \\\"function\\\":%q}\", e.DevMode, e.Function)\r\n\t}\r\n\treturn []byte(outd), nil\r\n}", "title": "" }, { "docid": "c66bc020287c8239b27c7993eaf3f88e", "score": "0.42400333", "text": "func generateRequestJSONString(\n\tendpoint string,\n\tmethod string,\n\tjsonString string,\n\th func(http.ResponseWriter, *http.Request)) (rr *httptest.ResponseRecorder, r *http.Request) {\n\n\tbody := strings.NewReader(jsonString)\n\n\tr, _ = http.NewRequest(method, endpoint, body)\n\n\trr = httptest.NewRecorder()\n\thandler := http.HandlerFunc(h)\n\thandler.ServeHTTP(rr, r)\n\n\treturn rr, r\n}", "title": "" } ]
5f31cd896f20fd270337e464293e72a8
NotDone returns true if the enumeration should be started or is not yet complete.
[ { "docid": "fdfe0a6dd7efec0d4d6412601e7ad1dc", "score": "0.0", "text": "func (iter ManagedInstancePrivateLinkListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" } ]
[ { "docid": "c7626109aab2bf5ccda5e6067601db5b", "score": "0.75401723", "text": "func (page SyncAgentListResultPage) NotDone() bool {\n\treturn !page.salr.IsEmpty()\n}", "title": "" }, { "docid": "d413c58b38a329f4e5344ddc89c17a44", "score": "0.74114156", "text": "func (iter SyncAgentListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "975cc20ffdc401e6453072c9921b3d68", "score": "0.740354", "text": "func (page WaitStatisticsResultListPage) NotDone() bool {\n\treturn !page.wsrl.IsEmpty()\n}", "title": "" }, { "docid": "e903d1e4d093563d9ea5fca4b3c2e398", "score": "0.73728555", "text": "func (page OperationListPage) NotDone() bool {\n\treturn !page.ol.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "046287ceeff4a32745fd01b186484a1b", "score": "0.73696244", "text": "func (page OperationListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "9344a80785020d8f85176274c5ba0bac", "score": "0.7356558", "text": "func (iter OperationListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "62e9518286fa9da75460657e9bd9aae1", "score": "0.7354116", "text": "func (page OperationsHealthListResultPage) NotDone() bool {\n\treturn !page.ohlr.IsEmpty()\n}", "title": "" }, { "docid": "292b3a246dd18ca63ace52702f3cdab0", "score": "0.7343234", "text": "func (page EHNamespaceListResultPage) NotDone() bool {\n\treturn !page.enlr.IsEmpty()\n}", "title": "" }, { "docid": "c6247fc79fe4f1361aab3cbf5705b8c9", "score": "0.7341402", "text": "func (page ArmDisasterRecoveryListResultPage) NotDone() bool {\n\treturn !page.adrlr.IsEmpty()\n}", "title": "" }, { "docid": "c6247fc79fe4f1361aab3cbf5705b8c9", "score": "0.7341402", "text": "func (page ArmDisasterRecoveryListResultPage) NotDone() bool {\n\treturn !page.adrlr.IsEmpty()\n}", "title": "" }, { "docid": "345b22fad5880fbe02f15e8ae8857e93", "score": "0.7339194", "text": "func (page SyncMemberListResultPage) NotDone() bool {\n\treturn !page.smlr.IsEmpty()\n}", "title": "" }, { "docid": "a411e883c83d97d0d98ed7d472279959", "score": "0.73331195", "text": "func (page ManagedInstanceOperationListResultPage) NotDone() bool {\n\treturn !page.miolr.IsEmpty()\n}", "title": "" }, { "docid": "f059157d19c92bb6e07c4df12cbf074a", "score": "0.7326346", "text": "func (page DescendantListResultPage) NotDone() bool {\n\treturn !page.dlr.IsEmpty()\n}", "title": "" }, { "docid": "d0b3a8f1331f5510b038770f271b64d8", "score": "0.7318563", "text": "func (page EnabledResourceTypesListResultPage) NotDone() bool {\n\treturn !page.ertlr.IsEmpty()\n}", "title": "" }, { "docid": "98a96084f5d0cb065a7f6f9669bb740f", "score": "0.7314975", "text": "func (iter ResourceProviderOperationListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "b542fd5d1a4d4f5e1dac8c521baa14d1", "score": "0.73137873", "text": "func (page DatabaseOperationListResultPage) NotDone() bool {\n\treturn !page.dolr.IsEmpty()\n}", "title": "" }, { "docid": "1d95816f0b9d2d3f5a786172e8f225ff", "score": "0.7306925", "text": "func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool {\n\treturn !page.sfsplr.IsEmpty()\n}", "title": "" }, { "docid": "86190b2d9227a82142ef30b6c907e9c5", "score": "0.73066217", "text": "func (page DataWarehouseUserActivitiesListResultPage) NotDone() bool {\n\treturn !page.dwualr.IsEmpty()\n}", "title": "" }, { "docid": "5b7ef8f52f983ef02a81fdac4cadb19f", "score": "0.7296946", "text": "func (page SyncGroupListResultPage) NotDone() bool {\n\treturn !page.sglr.IsEmpty()\n}", "title": "" }, { "docid": "ed48b31a33f4ccb8991c718848d9f8e2", "score": "0.72939456", "text": "func (page ImportExportExtensionsOperationListResultPage) NotDone() bool {\n\treturn !page.ieeolr.IsEmpty()\n}", "title": "" }, { "docid": "2ce3f081a5cadd8d0975555f3b827172", "score": "0.7291945", "text": "func (page ManagedInstanceListResultPage) NotDone() bool {\n\treturn !page.milr.IsEmpty()\n}", "title": "" }, { "docid": "718029fb48b69ef16bfe09e14208bd2c", "score": "0.7289096", "text": "func (page UsageListResultPage) NotDone() bool {\n\treturn !page.ulr.IsEmpty()\n}", "title": "" }, { "docid": "39c8ba37617001a5656c3e8504fc44b7", "score": "0.72888726", "text": "func (iter WaitStatisticsResultListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "db8a7bc84b7b6b447ec86fb2faefaaf9", "score": "0.7281792", "text": "func (page ManagedInstanceQueryStatisticsPage) NotDone() bool {\n\treturn !page.miqs.IsEmpty()\n}", "title": "" }, { "docid": "5b636a72cf4b5c48e719db3e9fb48806", "score": "0.7279703", "text": "func (iter OperationsHealthListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "fd2c4abcf36383be7bd37612ecc070b7", "score": "0.72736907", "text": "func (page ManagedTransparentDataEncryptionListResultPage) NotDone() bool {\n\treturn !page.mtdelr.IsEmpty()\n}", "title": "" }, { "docid": "079369425cb96f299a483ae63df99859", "score": "0.7270153", "text": "func (page OperationsListResultPage) NotDone() bool {\n\treturn !page.olr.IsEmpty()\n}", "title": "" }, { "docid": "d90c5eb8833b019505353ead45614b59", "score": "0.72608453", "text": "func (page SyncDatabaseIDListResultPage) NotDone() bool {\n\treturn !page.sdilr.IsEmpty()\n}", "title": "" }, { "docid": "b629953bea3e49b46e708640caf8462e", "score": "0.7258506", "text": "func (page ManagedDatabaseListResultPage) NotDone() bool {\n\treturn !page.mdlr.IsEmpty()\n}", "title": "" }, { "docid": "2953e7ba5f3fc0994fc614567d4de3a4", "score": "0.7257541", "text": "func (page RecommendationActionsResultListPage) NotDone() bool {\n\treturn !page.rarl.IsEmpty()\n}", "title": "" }, { "docid": "21fe5cdacecb5cdfa95fde896e627ef0", "score": "0.7252496", "text": "func (page OrderItemResourceListPage) NotDone() bool {\n\treturn !page.oirl.IsEmpty()\n}", "title": "" }, { "docid": "2cc34722d9867af78a622faab31d47d7", "score": "0.7250467", "text": "func (page WorkloadClassifierListResultPage) NotDone() bool {\n\treturn !page.wclr.IsEmpty()\n}", "title": "" }, { "docid": "deb5dda7daf4b46790db3d3937300e96", "score": "0.72497225", "text": "func (page JobAgentListResultPage) NotDone() bool {\n\treturn !page.jalr.IsEmpty()\n}", "title": "" }, { "docid": "2af69b1e9bfd311d04d9d0ae50083db6", "score": "0.7249549", "text": "func (page MessagingRegionsListResultPage) NotDone() bool {\n\treturn !page.mrlr.IsEmpty()\n}", "title": "" }, { "docid": "03d7690c4c2de125a107da50412574ec", "score": "0.7238232", "text": "func (page EventHubListResultPage) NotDone() bool {\n\treturn !page.ehlr.IsEmpty()\n}", "title": "" }, { "docid": "9d7d07a9d03f1a26bb37d4a401a2d377", "score": "0.7231729", "text": "func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool {\n\treturn !page.saldlr.IsEmpty()\n}", "title": "" }, { "docid": "859b4097c8a634a633632f810252deb4", "score": "0.7228482", "text": "func (page EntityListResultPage) NotDone() bool {\n\treturn !page.elr.IsEmpty()\n}", "title": "" }, { "docid": "f926c482bfd8ac152aabcb1220d3665b", "score": "0.7224908", "text": "func (page FailoverGroupListResultPage) NotDone() bool {\n\treturn !page.fglr.IsEmpty()\n}", "title": "" }, { "docid": "d00f2b63b74610db6d4260904226d094", "score": "0.7222055", "text": "func (page RecoverableManagedDatabaseListResultPage) NotDone() bool {\n\treturn !page.rmdlr.IsEmpty()\n}", "title": "" }, { "docid": "367c6d635e4b809d56d58920107f7a21", "score": "0.7222012", "text": "func (page ListResultPage) NotDone() bool {\n\treturn !page.lr.IsEmpty()\n}", "title": "" }, { "docid": "367c6d635e4b809d56d58920107f7a21", "score": "0.7222012", "text": "func (page ListResultPage) NotDone() bool {\n\treturn !page.lr.IsEmpty()\n}", "title": "" }, { "docid": "367c6d635e4b809d56d58920107f7a21", "score": "0.7222012", "text": "func (page ListResultPage) NotDone() bool {\n\treturn !page.lr.IsEmpty()\n}", "title": "" }, { "docid": "94ce61ccec54f9608d5f46d5837e64e3", "score": "0.7217017", "text": "func (page AdministratorListResultPage) NotDone() bool {\n\treturn !page.alr.IsEmpty()\n}", "title": "" }, { "docid": "4a82d89681cedf32b0a0a7116abe9fa0", "score": "0.72150505", "text": "func IsDone() bool {\r\n\treturn !IsPending()\r\n}", "title": "" }, { "docid": "9d11b6ac144b35ff129af809cbf24014", "score": "0.721392", "text": "func (page ManagedBackupShortTermRetentionPolicyListResultPage) NotDone() bool {\n\treturn !page.mbstrplr.IsEmpty()\n}", "title": "" }, { "docid": "b785cb639c19266739d663f5e1930b81", "score": "0.721294", "text": "func (page RecordSetListResultPage) NotDone() bool {\n\treturn !page.rslr.IsEmpty()\n}", "title": "" }, { "docid": "e27f83d093bad3fffa14943a65d05411", "score": "0.7211627", "text": "func (page NetworkRuleSetListResultPage) NotDone() bool {\n\treturn !page.nrslr.IsEmpty()\n}", "title": "" }, { "docid": "e27f83d093bad3fffa14943a65d05411", "score": "0.7211627", "text": "func (page NetworkRuleSetListResultPage) NotDone() bool {\n\treturn !page.nrslr.IsEmpty()\n}", "title": "" }, { "docid": "f8de38429c489f3f042a46bad860041a", "score": "0.72102976", "text": "func (page JobStepListResultPage) NotDone() bool {\n\treturn !page.jslr.IsEmpty()\n}", "title": "" }, { "docid": "6f0574cbcc5ce15b078648a44f7441b2", "score": "0.72072476", "text": "func (page WorkloadGroupListResultPage) NotDone() bool {\n\treturn !page.wglr.IsEmpty()\n}", "title": "" }, { "docid": "21c6554666532d720794646d9693a5c8", "score": "0.72042006", "text": "func (page EngineBaseResourceListPage) NotDone() bool {\n\treturn !page.ebrl.IsEmpty()\n}", "title": "" }, { "docid": "c1b5664a8cecc948ad73080f413c3fe9", "score": "0.7203412", "text": "func (page ConsumerGroupListResultPage) NotDone() bool {\n\treturn !page.cglr.IsEmpty()\n}", "title": "" }, { "docid": "dd22a84a32c3c1386c41ccd702b4ee25", "score": "0.720285", "text": "func (iter RecommendationActionsResultListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "c28f86880be52b81b608574b73b9a9a0", "score": "0.72027504", "text": "func (iter JobAgentListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "19227fa597e912cc92d91aed94e556e6", "score": "0.7201926", "text": "func (iter SecurityEventCollectionIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "4f76ea2e97a792d0b58c09c0149603f1", "score": "0.71958256", "text": "func (page WebTestListResultPage) NotDone() bool {\n\treturn !page.wtlr.IsEmpty()\n}", "title": "" }, { "docid": "aca5f1dab39e4842fe707aa46f471682", "score": "0.718476", "text": "func (page ScopeAssignmentListResultPage) NotDone() bool {\n\treturn !page.salr.IsEmpty()\n}", "title": "" }, { "docid": "a8e2bd1b9a580ca3adde2c982702f79d", "score": "0.71844923", "text": "func (page FirewallRuleListResultPage) NotDone() bool {\n\treturn !page.frlr.IsEmpty()\n}", "title": "" }, { "docid": "7bebfec350a0e76ea57c23a04de1f543", "score": "0.7183438", "text": "func (page InstanceFailoverGroupListResultPage) NotDone() bool {\n\treturn !page.ifglr.IsEmpty()\n}", "title": "" }, { "docid": "988934c51fa4f4d15bfbb0ed3e1fd981", "score": "0.71819437", "text": "func (page DatabaseTableListResultPage) NotDone() bool {\n\treturn !page.dtlr.IsEmpty()\n}", "title": "" }, { "docid": "7d845e6c53b90718549bff5dbe257b1b", "score": "0.7172711", "text": "func (page OutboundFirewallRuleListResultPage) NotDone() bool {\n\treturn !page.ofrlr.IsEmpty()\n}", "title": "" }, { "docid": "fd1a81d470ddac003bc8247c010bb345", "score": "0.71723485", "text": "func (iter EventHubListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "dd1b9e5383b3962ffd7cecd3e6a535c4", "score": "0.71694386", "text": "func (page BackupShortTermRetentionPolicyListResultPage) NotDone() bool {\n\treturn !page.bstrplr.IsEmpty()\n}", "title": "" }, { "docid": "23c2f889b7eed9386cf928831395fa43", "score": "0.7165892", "text": "func (iter WorkloadProtectableItemResourceListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "8fcea992ce34365b0b2414924be5c7e8", "score": "0.716552", "text": "func (page RuleListResultPage) NotDone() bool {\n\treturn !page.rlr.IsEmpty()\n}", "title": "" }, { "docid": "292180218d0df0e1d64b3e56a583fccc", "score": "0.71590173", "text": "func (iter SyncSetListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "b0ab65f2ed60b1a48d0820fefbf95e7a", "score": "0.7154995", "text": "func (iter SyncMemberListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "66b0ff88fe7b1e5d01ff0d592dc94c5a", "score": "0.7154379", "text": "func (page SBAuthorizationRuleListResultPage) NotDone() bool {\n\treturn !page.sarlr.IsEmpty()\n}", "title": "" }, { "docid": "5b9219a7b6b4544f1f751f9a932fb330", "score": "0.71537304", "text": "func (page ServerDNSAliasListResultPage) NotDone() bool {\n\treturn !page.sdalr.IsEmpty()\n}", "title": "" }, { "docid": "0f151ada2a4001ffd8b65505e2d7945c", "score": "0.7152448", "text": "func (page ResourceProviderOperationListPage) NotDone() bool {\n\treturn !page.rpol.IsEmpty()\n}", "title": "" }, { "docid": "bae4399cc46ff9f2f7e3f2acc5837245", "score": "0.71523833", "text": "func (iter ManagedInstanceQueryStatisticsIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "088a069b4028f82a546f68b6ffc2fd11", "score": "0.71507937", "text": "func (page RestorePointListResultPage) NotDone() bool {\n\treturn !page.rplr.IsEmpty()\n}", "title": "" }, { "docid": "3e9e207f0d40676baf9e1ad07783c2e7", "score": "0.71468145", "text": "func (page SBNamespaceListResultPage) NotDone() bool {\n\treturn !page.snlr.IsEmpty()\n}", "title": "" }, { "docid": "ac0460cc6dfdf0d547bbd97fbb1454a8", "score": "0.71463656", "text": "func (page AdvisorsResultListPage) NotDone() bool {\n\treturn !page.arl.IsEmpty()\n}", "title": "" }, { "docid": "bd7716dbc0b126974cbc75c0fa79f9cc", "score": "0.71439254", "text": "func (page SyncIdentityProviderListPage) NotDone() bool {\n\treturn !page.sipl.IsEmpty()\n}", "title": "" }, { "docid": "c2ea7b644748a68055336383ce7dff8d", "score": "0.7142571", "text": "func (iter JobStepListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "51da3a69f04d3d1e2e94b598c26dad8d", "score": "0.7141776", "text": "func (iter EventDataCollectionIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "462a834e5e05937496dddbdc7134d39e", "score": "0.71390116", "text": "func (iter RestorableDroppedManagedDatabaseListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "6e184ade3fedfc43deb2c5643bf815ac", "score": "0.7137718", "text": "func (page TopQueryStatisticsResultListPage) NotDone() bool {\n\treturn !page.tqsrl.IsEmpty()\n}", "title": "" }, { "docid": "643db5d902d6b1e79fc5e69dd0a4227d", "score": "0.7137682", "text": "func (iter ManagedInstanceOperationListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "4464e4f830dc3cc991445fa9e22c7e56", "score": "0.7135904", "text": "func (page JobTargetGroupListResultPage) NotDone() bool {\n\treturn !page.jtglr.IsEmpty()\n}", "title": "" }, { "docid": "da00b8cea6bb115b3dee5967f16a4b76", "score": "0.71300036", "text": "func (page ApplicationInsightsComponentListResultPage) NotDone() bool {\n\treturn !page.aiclr.IsEmpty()\n}", "title": "" }, { "docid": "d491f0c93a6f61db6c3f6f7cc0b23a9f", "score": "0.71289736", "text": "func (page ManagedInstanceLongTermRetentionPolicyListResultPage) NotDone() bool {\n\treturn !page.miltrplr.IsEmpty()\n}", "title": "" }, { "docid": "d06cc0d9e0d2e10642fa8797d8c038a0", "score": "0.712895", "text": "func (iter SyncIdentityProviderListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "0ce1ccad748f5b6f489585172050d692", "score": "0.71282655", "text": "func (page DatabaseUsageListResultPage) NotDone() bool {\n\treturn !page.dulr.IsEmpty()\n}", "title": "" }, { "docid": "73c40d8c50543562c3e39b5f12a2c318", "score": "0.71259886", "text": "func (iter EngineBaseResourceListIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "115171a978380e7481c6e5bdf668e7be", "score": "0.7122589", "text": "func (page RestorableDroppedManagedDatabaseListResultPage) NotDone() bool {\n\treturn !page.rdmdlr.IsEmpty()\n}", "title": "" }, { "docid": "248a090468bef84c22ad9e5b447dcb59", "score": "0.7121252", "text": "func (page AuthorizationRuleListResultPage) NotDone() bool {\n\treturn !page.arlr.IsEmpty()\n}", "title": "" }, { "docid": "6d05b05b2c6255628d60d7631c004bfb", "score": "0.7118312", "text": "func (iter ManagedTransparentDataEncryptionListResultIterator) NotDone() bool {\n\treturn iter.page.NotDone() && iter.i < len(iter.page.Values())\n}", "title": "" }, { "docid": "4e8fef3f7a5230ad9d290bc85987adcf", "score": "0.71178895", "text": "func (page JobExecutionListResultPage) NotDone() bool {\n\treturn !page.jelr.IsEmpty()\n}", "title": "" }, { "docid": "85bef64a0982d58775fad5b16da56d0c", "score": "0.71164024", "text": "func (page LongTermRetentionPolicyListResultPage) NotDone() bool {\n\treturn !page.ltrplr.IsEmpty()\n}", "title": "" } ]
63d2071814629bc63b89d3d71784d044
NewV2DeregisterClusterNoContent creates a V2DeregisterClusterNoContent with default headers values
[ { "docid": "243b9550f0885e2b4732c65cb947b47f", "score": "0.70805794", "text": "func NewV2DeregisterClusterNoContent() *V2DeregisterClusterNoContent {\n\treturn &V2DeregisterClusterNoContent{}\n}", "title": "" } ]
[ { "docid": "bf1badc40530ffca496f1c17a609b569", "score": "0.71734154", "text": "func NewV2DeregisterClusterNoContent() *V2DeregisterClusterNoContent {\n\n\treturn &V2DeregisterClusterNoContent{}\n}", "title": "" }, { "docid": "db2cd8f6b4f799dc48f88cf16f149492", "score": "0.60884553", "text": "func (o *V2DeregisterClusterNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses\n\n\trw.WriteHeader(204)\n}", "title": "" }, { "docid": "67a287aa2b7a5d1886e2d82c234e5bdc", "score": "0.6069812", "text": "func NewV2DeregisterClusterUnauthorized() *V2DeregisterClusterUnauthorized {\n\n\treturn &V2DeregisterClusterUnauthorized{}\n}", "title": "" }, { "docid": "b6381119abcd4a99e0e8af0a38fa6512", "score": "0.59747684", "text": "func NewV2DeregisterClusterUnauthorized() *V2DeregisterClusterUnauthorized {\n\treturn &V2DeregisterClusterUnauthorized{}\n}", "title": "" }, { "docid": "e27ac45cc678d874d88dcfd3db8ad8d8", "score": "0.5690938", "text": "func NewV2DeregisterClusterMethodNotAllowed() *V2DeregisterClusterMethodNotAllowed {\n\n\treturn &V2DeregisterClusterMethodNotAllowed{}\n}", "title": "" }, { "docid": "7a7b1843297a4d32e52226d1230be928", "score": "0.563695", "text": "func NewV2DeregisterClusterForbidden() *V2DeregisterClusterForbidden {\n\n\treturn &V2DeregisterClusterForbidden{}\n}", "title": "" }, { "docid": "6498029276d000a7f36c4187e1ffd419", "score": "0.5583568", "text": "func NewDeleteClusterNoContent() *DeleteClusterNoContent {\n\treturn &DeleteClusterNoContent{}\n}", "title": "" }, { "docid": "b7ffdde24690e02e65bcd366126c4d42", "score": "0.55417514", "text": "func NewV2DeregisterClusterMethodNotAllowed() *V2DeregisterClusterMethodNotAllowed {\n\treturn &V2DeregisterClusterMethodNotAllowed{}\n}", "title": "" }, { "docid": "313d1db15f80ba8ce22f4c72bcd91bba", "score": "0.55034816", "text": "func NewV2DeregisterClusterForbidden() *V2DeregisterClusterForbidden {\n\treturn &V2DeregisterClusterForbidden{}\n}", "title": "" }, { "docid": "83a7fead91bc5aebc834fab73bbdd225", "score": "0.5367442", "text": "func NewV2DeregisterClusterNotFound() *V2DeregisterClusterNotFound {\n\n\treturn &V2DeregisterClusterNotFound{}\n}", "title": "" }, { "docid": "74cba165f029952668921122d1420b05", "score": "0.5262236", "text": "func NewRegisterClusterUnauthorized() *RegisterClusterUnauthorized {\n\treturn &RegisterClusterUnauthorized{}\n}", "title": "" }, { "docid": "2a94e1125f63888f4eb59b4caa70192e", "score": "0.5258553", "text": "func (o *V2DeregisterClusterInternalServerError) WithPayload(payload *models.Error) *V2DeregisterClusterInternalServerError {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "a4a73c36d1f3c0f156e4fb5d9fc62d77", "score": "0.5240226", "text": "func NewV2DeregisterClusterNotFound() *V2DeregisterClusterNotFound {\n\treturn &V2DeregisterClusterNotFound{}\n}", "title": "" }, { "docid": "71bc16be6a4f96b06447f0107426750d", "score": "0.5234489", "text": "func NewV2RegisterClusterUnauthorized() *V2RegisterClusterUnauthorized {\n\n\treturn &V2RegisterClusterUnauthorized{}\n}", "title": "" }, { "docid": "f41e62126599abf2396e7dc392db18a5", "score": "0.520123", "text": "func NewV2DeregisterClusterConflict() *V2DeregisterClusterConflict {\n\n\treturn &V2DeregisterClusterConflict{}\n}", "title": "" }, { "docid": "8de5dd842353a9c46901f9e2849ee767", "score": "0.51368624", "text": "func (o *V2DeregisterClusterUnauthorized) WithPayload(payload *models.InfraError) *V2DeregisterClusterUnauthorized {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "c155ba2925dccb325ff04d119bee04dc", "score": "0.50428414", "text": "func NewV2DeregisterClusterConflict() *V2DeregisterClusterConflict {\n\treturn &V2DeregisterClusterConflict{}\n}", "title": "" }, { "docid": "45018e1a5831b6de8a494913c4220bc8", "score": "0.49888024", "text": "func (o *V2DeregisterClusterForbidden) WithPayload(payload *models.InfraError) *V2DeregisterClusterForbidden {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "454ae8d4f32f9293054f0eb7d02d1238", "score": "0.49188158", "text": "func NewPostClusterBadRequest() *PostClusterBadRequest {\n\treturn &PostClusterBadRequest{\n\t\tConfigurationVersion: 0,\n\t}\n}", "title": "" }, { "docid": "a16c2869aab290285b41a13113fcd99d", "score": "0.4893751", "text": "func NewRegisterClusterMethodNotAllowed() *RegisterClusterMethodNotAllowed {\n\treturn &RegisterClusterMethodNotAllowed{}\n}", "title": "" }, { "docid": "c0b999a3bd692d02d45524c931590900", "score": "0.4874437", "text": "func NewRegisterClusterForbidden() *RegisterClusterForbidden {\n\treturn &RegisterClusterForbidden{}\n}", "title": "" }, { "docid": "daf079f4cfadb51054c472a5dcba3b75", "score": "0.48522407", "text": "func NewCreateClusterManifestUnauthorized() *CreateClusterManifestUnauthorized {\n\n\treturn &CreateClusterManifestUnauthorized{}\n}", "title": "" }, { "docid": "c2f2fa2afaffdb36e13c419fedf1fffb", "score": "0.48361257", "text": "func NewCreateClusterAddRemainingNodeDefault(code int) *CreateClusterAddRemainingNodeDefault {\n\treturn &CreateClusterAddRemainingNodeDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "08653581bec962d63ecdddfac036349e", "score": "0.48040548", "text": "func (o *V2DeregisterClusterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {\n\tswitch response.Code() {\n\tcase 204:\n\t\tresult := NewV2DeregisterClusterNoContent()\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\tcase 401:\n\t\tresult := NewV2DeregisterClusterUnauthorized()\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\tcase 403:\n\t\tresult := NewV2DeregisterClusterForbidden()\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\tcase 404:\n\t\tresult := NewV2DeregisterClusterNotFound()\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\tcase 405:\n\t\tresult := NewV2DeregisterClusterMethodNotAllowed()\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\tcase 409:\n\t\tresult := NewV2DeregisterClusterConflict()\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\tcase 500:\n\t\tresult := NewV2DeregisterClusterInternalServerError()\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\tdefault:\n\t\treturn nil, runtime.NewAPIError(\"response status code does not match any response statuses defined for this endpoint in the swagger spec\", response, response.Code())\n\t}\n}", "title": "" }, { "docid": "3bc0c34d060315fa12b5471d3c34cac5", "score": "0.4798379", "text": "func (o *V2DeregisterClusterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(404)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6d152cbef760172ef2c69e45dbdb2834", "score": "0.4764362", "text": "func GetDefaultACKCreateClusterConfig(config KubernetesClusterConfig) CreateClusterConfig {\n\tdefaultAckVersion := os.Getenv(\"DEFAULT_ACK_VERSION\")\n\tif defaultAckVersion == \"\" {\n\t\tdefaultAckVersion = \"1.18.8-aliyun.1\"\n\t}\n\tkubernetesVersion := defaultAckVersion\n\tif config.KubernetesVersion != \"\" && strings.Contains(config.KubernetesVersion, \"aliyun\") {\n\t\tkubernetesVersion = config.KubernetesVersion\n\t}\n\tdockerVersion := \"19.03.5\"\n\tif config.DockerVersion != \"\" {\n\t\tdockerVersion = config.DockerVersion\n\t}\n\tserviceClusterIPRange := \"172.21.0.0/20\"\n\tpodIPRange := \"172.20.0.0/16\"\n\tif config.ServiceCIDR != \"\" {\n\t\tif _, _, err := net.ParseCIDR(config.ServiceCIDR); err == nil {\n\t\t\tserviceClusterIPRange = config.ServiceCIDR\n\t\t}\n\t}\n\tif config.ClusterCIDR != \"\" {\n\t\tif _, _, err := net.ParseCIDR(config.ClusterCIDR); err == nil {\n\t\t\tpodIPRange = config.ClusterCIDR\n\t\t}\n\t}\n\treturn &AckClusterConfig{\n\t\tName: config.ClusterName,\n\t\tDisableRollback: true,\n\t\tClusterType: ManagedKubernetes,\n\t\tTimeoutMins: 60,\n\t\tKubernetesVersion: kubernetesVersion,\n\t\tRegionID: config.Region,\n\t\tSNATEntry: true,\n\t\tCloudMonitorFlags: true,\n\t\tEndpointPublicAccess: true,\n\t\tDeletionProtection: true,\n\t\tNodeCidrMask: \"25\",\n\t\tProxyMode: \"ipvs\",\n\t\tTags: []string{},\n\t\tAddons: []Addon{\n\t\t\t{\n\t\t\t\tName: \"flananel\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"csi-plugin\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"csi-provisioner\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: \"nginx-ingress-controller\",\n\t\t\t\tDisable: true,\n\t\t\t},\n\t\t},\n\t\tOSType: \"Linux\",\n\t\tPlatform: \"CentOS\",\n\t\tRuntime: Runtime{\n\t\t\tName: \"docker\",\n\t\t\tVersion: dockerVersion,\n\t\t},\n\t\tWorkerInstanceType: []string{config.InstanceType},\n\t\tNumOfNodes: func() int {\n\t\t\tif config.WorkerNodeNum < 2 {\n\t\t\t\treturn 2\n\t\t\t}\n\t\t\treturn config.WorkerNodeNum\n\t\t}(),\n\t\tWorkerSystemDiskCategory: \"cloud_efficiency\",\n\t\tWorkerSystemDiskSize: 120,\n\t\tWorkerDataDisks: []WorkerDataDisk{\n\t\t\t{\n\t\t\t\tCategory: \"cloud_efficiency\",\n\t\t\t\tSize: \"200\",\n\t\t\t\tEncrypted: \"false\",\n\t\t\t},\n\t\t},\n\t\tWorkerInstanceChargeType: \"PostPaid\",\n\t\tContainerCIDR: podIPRange,\n\t\tServiceCIDR: serviceClusterIPRange,\n\t\tCPUPolicy: \"none\",\n\t\tVPCID: config.VpcID,\n\t\tVSwitchIDs: []string{config.VSwitchID},\n\t\tLoginPassword: \"RootPassword123!\",\n\t}\n}", "title": "" }, { "docid": "6e54871bc4b1cd0a07f0b4c3e9e42025", "score": "0.47473326", "text": "func CreateDestroyClusterResponse() (response *DestroyClusterResponse) {\n\tresponse = &DestroyClusterResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "296fdd37e3e456169f7cf8f1cf12e732", "score": "0.4745263", "text": "func (*UnregClusterRequest) Descriptor() ([]byte, []int) {\n\treturn file_ras_messages_v1_clusters_messages_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "14a126d3afcc0f08fa46c4af319ad04e", "score": "0.47426692", "text": "func NewV2RegisterClusterMethodNotAllowed() *V2RegisterClusterMethodNotAllowed {\n\n\treturn &V2RegisterClusterMethodNotAllowed{}\n}", "title": "" }, { "docid": "6f3bd4e118be00ac03d962434eddafd5", "score": "0.4739918", "text": "func New(logger logrus.FieldLogger, metadata *types.ClusterMetadata) (destroy.Destroyer, error) {\n\treturn &ClusterUninstaller{\n\t\tLibvirtURI: metadata.ClusterPlatformMetadata.Libvirt.URI,\n\t\tFilter: AlwaysTrueFilter(), //TODO: change to ClusterNamePrefixFilter when all resources are prefixed.\n\t\tLogger: logger,\n\t}, nil\n}", "title": "" }, { "docid": "6eab79c702443de95213a5f1d453a047", "score": "0.47356078", "text": "func (o *V2DeregisterClusterInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(500)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e1155d91d1e36c4051e5dadc4beb7d8c", "score": "0.47188208", "text": "func NewCluster_Override(c Cluster, scope awscdk.Construct, id *string, props *ClusterProps) {\n\t_init_.Initialize()\n\n\t_jsii_.Create(\n\t\t\"monocdk.aws_eks_legacy.Cluster\",\n\t\t[]interface{}{scope, id, props},\n\t\tc,\n\t)\n}", "title": "" }, { "docid": "699c1448cc7a0412097e2c0646f849bf", "score": "0.47100627", "text": "func NewRegisterClusterBadRequest() *RegisterClusterBadRequest {\n\treturn &RegisterClusterBadRequest{}\n}", "title": "" }, { "docid": "c17b945649dafec28a6ff33660529a67", "score": "0.47013262", "text": "func (c *Client) Deregister(req *string, reply *string) error {\n\tgo func() {\n\t\ttime.Sleep(1000 * time.Millisecond)\n\t\tc.gracefulStop()\n\t}()\n\t*reply = \"Deregistering and stopping...\"\n\treturn nil\n}", "title": "" }, { "docid": "515160309854bf0069013404444547b5", "score": "0.4692859", "text": "func (o *V2DeregisterClusterMethodNotAllowed) WithPayload(payload *models.Error) *V2DeregisterClusterMethodNotAllowed {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "11034fe6fce296aab0cbe0062507076f", "score": "0.4678458", "text": "func (o *V2DeregisterClusterNotFound) WithPayload(payload *models.Error) *V2DeregisterClusterNotFound {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "fd6a41909b6d51166e416e00eea6cee9", "score": "0.467013", "text": "func NewV2CreateClusterManifestUnauthorized() *V2CreateClusterManifestUnauthorized {\n\treturn &V2CreateClusterManifestUnauthorized{}\n}", "title": "" }, { "docid": "6960e8d9d1ac416e70ff5f6c333abbb4", "score": "0.46615624", "text": "func (base *SLXBase) UndeployCluster(client *client.NetconfClient, clusterName string, clusterID string) (string, error) {\n\tvar mctCluster = map[string]interface{}{\"cluster_name\": clusterName, \"cluster_id\": clusterID}\n\n\tconfig, templateErr := base.GetStringFromTemplate(mctClusterUndeploy, mctCluster)\n\tif templateErr != nil {\n\t\treturn \"\", templateErr\n\t}\n\n\tresp, err := client.EditConfig(config)\n\treturn resp, err\n}", "title": "" }, { "docid": "99c0610c01d935e88b9070aa6c292f11", "score": "0.46590555", "text": "func NewPostClusterDefault(code int) *PostClusterDefault {\n\treturn &PostClusterDefault{\n\t\t_statusCode: code,\n\t\tConfigurationVersion: 0,\n\t}\n}", "title": "" }, { "docid": "6871ab51db358bc5feda06b4c335c9fd", "score": "0.46365646", "text": "func NewDeleteGroupNoContent() *DeleteGroupNoContent {\n\treturn &DeleteGroupNoContent{}\n}", "title": "" }, { "docid": "0857ed2760fbb18e875a6a4ad1bc0f2a", "score": "0.4624207", "text": "func NewUpdateClusterUnauthorized() *UpdateClusterUnauthorized {\n\n\treturn &UpdateClusterUnauthorized{}\n}", "title": "" }, { "docid": "2f81c4e0495dc25e2b567a29fb844097", "score": "0.46129718", "text": "func NewLegacyCluster(config LegacyClusterConfig) (*LegacyCluster, error) {\n\tif config.G8sClient == nil {\n\t\treturn nil, microerror.Maskf(invalidConfigError, \"%T.G8sClient must not be empty\", config)\n\t}\n\n\tvar err error\n\n\tvar crdClient *k8scrdclient.CRDClient\n\t{\n\t\tc := k8scrdclient.Config{\n\t\t\tK8sExtClient: config.K8sExtClient,\n\t\t\tLogger: config.Logger,\n\t\t}\n\n\t\tcrdClient, err = k8scrdclient.New(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar newInformer *informer.Informer\n\t{\n\t\tc := informer.Config{\n\t\t\tLogger: config.Logger,\n\t\t\tWatcher: config.G8sClient.CoreV1alpha1().AzureClusterConfigs(\"\"),\n\t\t}\n\n\t\tnewInformer, err = informer.New(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v13ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v13.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t}\n\n\t\tv13ResourceSet, err = v13.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v14ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v14.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv14ResourceSet, err = v14.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v14patch1ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v14patch1.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv14patch1ResourceSet, err = v14patch1.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v15ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v15.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv15ResourceSet, err = v15.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v16ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v16.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv16ResourceSet, err = v16.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v17ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v17.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv17ResourceSet, err = v17.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v18ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v18.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv18ResourceSet, err = v18.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v19ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v19.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tProvider: config.Provider,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv19ResourceSet, err = v19.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar v20ResourceSet *controller.ResourceSet\n\t{\n\t\tc := v20.ResourceSetConfig{\n\t\t\tApprClient: config.ApprClient,\n\t\t\tBaseClusterConfig: config.BaseClusterConfig,\n\t\t\tCertSearcher: config.CertSearcher,\n\t\t\tFs: config.Fs,\n\t\t\tG8sClient: config.G8sClient,\n\t\t\tK8sClient: config.K8sClient,\n\t\t\tLogger: config.Logger,\n\t\t\tTenant: config.Tenant,\n\n\t\t\tCalicoAddress: config.CalicoAddress,\n\t\t\tCalicoPrefixLength: config.CalicoPrefixLength,\n\t\t\tClusterIPRange: config.ClusterIPRange,\n\t\t\tProjectName: config.ProjectName,\n\t\t\tProvider: config.Provider,\n\t\t\tRegistryDomain: config.RegistryDomain,\n\t\t\tResourceNamespace: config.ResourceNamespace,\n\t\t}\n\n\t\tv20ResourceSet, err = v20.NewResourceSet(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tvar clusterController *controller.Controller\n\t{\n\t\tc := controller.Config{\n\t\t\tCRD: v1alpha1.NewAzureClusterConfigCRD(),\n\t\t\tCRDClient: crdClient,\n\t\t\tInformer: newInformer,\n\t\t\tLogger: config.Logger,\n\t\t\tResourceSets: []*controller.ResourceSet{\n\t\t\t\tv13ResourceSet,\n\t\t\t\tv14ResourceSet,\n\t\t\t\tv14patch1ResourceSet,\n\t\t\t\tv15ResourceSet,\n\t\t\t\tv16ResourceSet,\n\t\t\t\tv17ResourceSet,\n\t\t\t\tv18ResourceSet,\n\t\t\t\tv19ResourceSet,\n\t\t\t\tv20ResourceSet,\n\t\t\t},\n\t\t\tRESTClient: config.G8sClient.CoreV1alpha1().RESTClient(),\n\n\t\t\tName: config.ProjectName,\n\t\t}\n\n\t\tclusterController, err = controller.New(c)\n\t\tif err != nil {\n\t\t\treturn nil, microerror.Mask(err)\n\t\t}\n\t}\n\n\tc := &LegacyCluster{\n\t\tController: clusterController,\n\t}\n\n\treturn c, nil\n}", "title": "" }, { "docid": "867ece7d44cb7c747e59d0b52e715e9f", "score": "0.46057966", "text": "func NewCreateKubeClusterDefault(code int) *CreateKubeClusterDefault {\n\tif code <= 0 {\n\t\tcode = 500\n\t}\n\n\treturn &CreateKubeClusterDefault{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "28903f0b9ca737129492954688841d7c", "score": "0.45962128", "text": "func NewCfnCluster_Override(c CfnCluster, scope constructs.Construct, id *string, props *CfnClusterProps) {\n\t_init_.Initialize()\n\n\t_jsii_.Create(\n\t\t\"aws-cdk-lib.aws_redshift.CfnCluster\",\n\t\t[]interface{}{scope, id, props},\n\t\tc,\n\t)\n}", "title": "" }, { "docid": "c6d0c0f79c4c6f21f2a0f74d5b482fc9", "score": "0.4594923", "text": "func newInfraCluster(namespace string, cluster *clusterv1.Cluster) client.Object {\n\treturn &vmwarev1.VSphereCluster{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: cluster.Name,\n\t\t\tNamespace: namespace,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "c9cdfec8f3fb516de664826898775857", "score": "0.4592597", "text": "func NewV2RegisterClusterForbidden() *V2RegisterClusterForbidden {\n\n\treturn &V2RegisterClusterForbidden{}\n}", "title": "" }, { "docid": "f6888dda5d4f1079bf3e7ea540981860", "score": "0.4589486", "text": "func (o *V2DeregisterClusterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(401)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2df2916aacfcbbe01f48bea51a3134be", "score": "0.4587075", "text": "func (s *ClusterService) NewDisableOutOfBandManagementForClusterParams(clusterid string) *DisableOutOfBandManagementForClusterParams {\n\tp := &DisableOutOfBandManagementForClusterParams{}\n\tp.p = make(map[string]interface{})\n\tp.p[\"clusterid\"] = clusterid\n\treturn p\n}", "title": "" }, { "docid": "279a6c93513913816ec1565827bef4d3", "score": "0.4579262", "text": "func NewDeregisterLocalServerNoContent() *DeregisterLocalServerNoContent {\n\treturn &DeregisterLocalServerNoContent{}\n}", "title": "" }, { "docid": "52684432d7a508ecbe5f667d37e9917c", "score": "0.4572038", "text": "func (a *Client) DeleteClusterV2(params *DeleteClusterV2Params, authInfo runtime.ClientAuthInfoWriter) (*DeleteClusterV2OK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewDeleteClusterV2Params()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"deleteClusterV2\",\n\t\tMethod: \"DELETE\",\n\t\tPathPattern: \"/api/v2/projects/{project_id}/clusters/{cluster_id}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &DeleteClusterV2Reader{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\tsuccess, ok := result.(*DeleteClusterV2OK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*DeleteClusterV2Default)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "f8e0e5be92f14af7adc8e936a11dac4a", "score": "0.45629892", "text": "func NewDeleteConsumerGroupRequestWithoutParam() *DeleteConsumerGroupRequest {\n\n return &DeleteConsumerGroupRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/regions/{regionId}/consumerGroup\",\n Method: \"DELETE\",\n Header: nil,\n Version: \"v1\",\n },\n }\n}", "title": "" }, { "docid": "53ffde95df571db843fc3fb6739b95b4", "score": "0.45628467", "text": "func (o *V2DeregisterClusterForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(403)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9383f623dec42a7b3343ff6b94f7bced", "score": "0.4560434", "text": "func NewCfnCluster_Override(c CfnCluster, scope awscdk.Construct, id *string, props *CfnClusterProps) {\n\t_init_.Initialize()\n\n\t_jsii_.Create(\n\t\t\"monocdk.aws_eks_legacy.CfnCluster\",\n\t\t[]interface{}{scope, id, props},\n\t\tc,\n\t)\n}", "title": "" }, { "docid": "48e3c69700e9430f52964c5584a95985", "score": "0.45456728", "text": "func (m *MockRegistrationAPI) DeregisterCluster(ctx context.Context, c *models.Cluster) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DeregisterCluster\", ctx, c)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "e50d62e3c14f56acfe2089eaa01a2fa1", "score": "0.45362818", "text": "func NewGetClusterUnauthorized() *GetClusterUnauthorized {\n\treturn &GetClusterUnauthorized{}\n}", "title": "" }, { "docid": "a1ee63d183daac93f54221c8be832578", "score": "0.45361903", "text": "func NewDescribeMigrationsRequestWithoutParam() *DescribeMigrationsRequest {\n\n return &DescribeMigrationsRequest{\n JDCloudRequest: core.JDCloudRequest{\n URL: \"/regions/{regionId}/instance\",\n Method: \"GET\",\n Header: nil,\n Version: \"v2\",\n },\n }\n}", "title": "" }, { "docid": "e6278be78934e952a7f32c5efb224a37", "score": "0.45303544", "text": "func NewDeleteNfsExportNoContent() *DeleteNfsExportNoContent {\n\treturn &DeleteNfsExportNoContent{}\n}", "title": "" }, { "docid": "cfdca4b6abb7f5221365020251e56d2f", "score": "0.45278785", "text": "func newAnonInfraCluster(namespace string) client.Object {\n\treturn &vmwarev1.VSphereCluster{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tGenerateName: \"test-\",\n\t\t\tNamespace: namespace,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "5f94ae5c22f81096fce6ecf36d0f536c", "score": "0.452337", "text": "func NewRepairClusterV2Default(code int) *RepairClusterV2Default {\n\treturn &RepairClusterV2Default{\n\t\t_statusCode: code,\n\t}\n}", "title": "" }, { "docid": "80e0fbe778d9f757292af96469e9229e", "score": "0.45144048", "text": "func NewCreateClusterManifestMethodNotAllowed() *CreateClusterManifestMethodNotAllowed {\n\n\treturn &CreateClusterManifestMethodNotAllowed{}\n}", "title": "" }, { "docid": "0edbfe8b11740d17d02adaecc137e1f3", "score": "0.45131895", "text": "func NewUnsubscribeNoContent() *UnsubscribeNoContent {\n\treturn &UnsubscribeNoContent{}\n}", "title": "" }, { "docid": "c9ee8c6eecc01abe85e0380fa8deae4e", "score": "0.45089915", "text": "func GenerateOutsideClusterConfig(kubeConfigPath string) *Config {\n\treturn &Config{IsInsideCluster: false, KubeConfigPath: kubeConfigPath}\n}", "title": "" }, { "docid": "8b1f6fc3f53b55d8df807ae726a2cf3d", "score": "0.45089355", "text": "func CreateDestroyClusterRequest() (request *DestroyClusterRequest) {\n\trequest = &DestroyClusterRequest{\n\t\tRoaRequest: &requests.RoaRequest{},\n\t}\n\trequest.InitWithApiInfo(\"foas\", \"2018-11-11\", \"DestroyCluster\", \"/api/v2/clusters/[clusterId]\", \"foas\", \"openAPI\")\n\trequest.Method = requests.DELETE\n\treturn\n}", "title": "" }, { "docid": "8747f9b846a45bae8aff5d8df81d0878", "score": "0.44931278", "text": "func (s *ClusterService) DisableOutOfBandManagementForCluster(p *DisableOutOfBandManagementForClusterParams) (*DisableOutOfBandManagementForClusterResponse, error) {\n\tresp, err := s.cs.newRequest(\"disableOutOfBandManagementForCluster\", p.toURLValues())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar r DisableOutOfBandManagementForClusterResponse\n\tif err := json.Unmarshal(resp, &r); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// If we have a async client, we need to wait for the async result\n\tif s.cs.async {\n\t\tb, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)\n\t\tif err != nil {\n\t\t\tif err == AsyncTimeoutErr {\n\t\t\t\treturn &r, err\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\n\t\tb, err = getRawValue(b)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := json.Unmarshal(b, &r); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn &r, nil\n}", "title": "" }, { "docid": "b80666664195dbb384ccf839f23cb365", "score": "0.44930336", "text": "func (base *SLXBase) DeleteCluster(client *client.NetconfClient, clusterName string, clusterID string) (string, error) {\n\tvar mctCluster = map[string]interface{}{\"cluster_name\": clusterName, \"cluster_id\": clusterID}\n\n\tconfig, templateError := base.GetStringFromTemplate(mctClusterDelete, mctCluster)\n\tif templateError != nil {\n\t\treturn \"\", templateError\n\t}\n\n\tresp, err := client.EditConfig(config)\n\treturn resp, err\n}", "title": "" }, { "docid": "dade685f17e089fed4f54ffb57af988e", "score": "0.44893697", "text": "func (m *MockAPI) DeregisterCluster(ctx context.Context, c *models.Cluster) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"DeregisterCluster\", ctx, c)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "941e2b075e9c7898c531b2dc22f91e98", "score": "0.4488996", "text": "func newClusterCreateRequest(config *gkev1.GKEClusterConfig) *gkeapi.CreateClusterRequest {\n\n\tenableKubernetesAlpha := config.Spec.EnableKubernetesAlpha != nil && *config.Spec.EnableKubernetesAlpha\n\trequest := &gkeapi.CreateClusterRequest{\n\t\tCluster: &gkeapi.Cluster{\n\t\t\tName: config.Spec.ClusterName,\n\t\t\tDescription: config.Spec.Description,\n\t\t\tResourceLabels: config.Spec.Labels,\n\t\t\tInitialClusterVersion: *config.Spec.KubernetesVersion,\n\t\t\tEnableKubernetesAlpha: enableKubernetesAlpha,\n\t\t\tClusterIpv4Cidr: *config.Spec.ClusterIpv4CidrBlock,\n\t\t\tLoggingService: *config.Spec.LoggingService,\n\t\t\tMonitoringService: *config.Spec.MonitoringService,\n\t\t\tIpAllocationPolicy: &gkeapi.IPAllocationPolicy{\n\t\t\t\tClusterIpv4CidrBlock: config.Spec.IPAllocationPolicy.ClusterIpv4CidrBlock,\n\t\t\t\tClusterSecondaryRangeName: config.Spec.IPAllocationPolicy.ClusterSecondaryRangeName,\n\t\t\t\tCreateSubnetwork: config.Spec.IPAllocationPolicy.CreateSubnetwork,\n\t\t\t\tNodeIpv4CidrBlock: config.Spec.IPAllocationPolicy.NodeIpv4CidrBlock,\n\t\t\t\tServicesIpv4CidrBlock: config.Spec.IPAllocationPolicy.ServicesIpv4CidrBlock,\n\t\t\t\tServicesSecondaryRangeName: config.Spec.IPAllocationPolicy.ServicesSecondaryRangeName,\n\t\t\t\tSubnetworkName: config.Spec.IPAllocationPolicy.SubnetworkName,\n\t\t\t\tUseIpAliases: config.Spec.IPAllocationPolicy.UseIPAliases,\n\t\t\t},\n\t\t\tAddonsConfig: &gkeapi.AddonsConfig{},\n\t\t\tNodePools: []*gkeapi.NodePool{},\n\t\t\tLocations: config.Spec.Locations,\n\t\t\tMaintenancePolicy: &gkeapi.MaintenancePolicy{},\n\t\t},\n\t}\n\n\tif *config.Spec.MaintenanceWindow != \"\" {\n\t\trequest.Cluster.MaintenancePolicy.Window = &gkeapi.MaintenanceWindow{\n\t\t\tDailyMaintenanceWindow: &gkeapi.DailyMaintenanceWindow{\n\t\t\t\tStartTime: *config.Spec.MaintenanceWindow,\n\t\t\t},\n\t\t}\n\t}\n\n\taddons := config.Spec.ClusterAddons\n\trequest.Cluster.AddonsConfig.HttpLoadBalancing = &gkeapi.HttpLoadBalancing{Disabled: !addons.HTTPLoadBalancing}\n\trequest.Cluster.AddonsConfig.HorizontalPodAutoscaling = &gkeapi.HorizontalPodAutoscaling{Disabled: !addons.HorizontalPodAutoscaling}\n\trequest.Cluster.AddonsConfig.NetworkPolicyConfig = &gkeapi.NetworkPolicyConfig{Disabled: !addons.NetworkPolicyConfig}\n\n\trequest.Cluster.NodePools = make([]*gkeapi.NodePool, 0, len(config.Spec.NodePools))\n\n\tfor _, np := range config.Spec.NodePools {\n\t\tnodePool := newGKENodePoolFromConfig(&np, config)\n\t\trequest.Cluster.NodePools = append(request.Cluster.NodePools, nodePool)\n\t}\n\n\tif config.Spec.MasterAuthorizedNetworksConfig != nil {\n\t\tblocks := make([]*gkeapi.CidrBlock, len(config.Spec.MasterAuthorizedNetworksConfig.CidrBlocks))\n\t\tfor _, b := range config.Spec.MasterAuthorizedNetworksConfig.CidrBlocks {\n\t\t\tblocks = append(blocks, &gkeapi.CidrBlock{\n\t\t\t\tCidrBlock: b.CidrBlock,\n\t\t\t\tDisplayName: b.DisplayName,\n\t\t\t})\n\t\t}\n\t\trequest.Cluster.MasterAuthorizedNetworksConfig = &gkeapi.MasterAuthorizedNetworksConfig{\n\t\t\tEnabled: config.Spec.MasterAuthorizedNetworksConfig.Enabled,\n\t\t\tCidrBlocks: blocks,\n\t\t}\n\t}\n\n\tif config.Spec.Network != nil {\n\t\trequest.Cluster.Network = *config.Spec.Network\n\t}\n\tif config.Spec.Subnetwork != nil {\n\t\trequest.Cluster.Subnetwork = *config.Spec.Subnetwork\n\t}\n\n\tif config.Spec.NetworkPolicyEnabled != nil {\n\t\trequest.Cluster.NetworkPolicy = &gkeapi.NetworkPolicy{\n\t\t\tEnabled: *config.Spec.NetworkPolicyEnabled,\n\t\t}\n\t}\n\n\tif config.Spec.PrivateClusterConfig != nil {\n\t\trequest.Cluster.PrivateClusterConfig = &gkeapi.PrivateClusterConfig{\n\t\t\tEnablePrivateEndpoint: config.Spec.PrivateClusterConfig.EnablePrivateEndpoint,\n\t\t\tEnablePrivateNodes: config.Spec.PrivateClusterConfig.EnablePrivateNodes,\n\t\t\tMasterIpv4CidrBlock: config.Spec.PrivateClusterConfig.MasterIpv4CidrBlock,\n\t\t}\n\t}\n\n\treturn request\n}", "title": "" }, { "docid": "6d2b16674141f5be74fd2e323377b601", "score": "0.44786507", "text": "func CreateCluster(namespace string, req *app.ClusterReq) (*model.Cluster, error) {\n\n\t// validate a namespace\n\tif err := verifyNamespace(namespace); err != nil {\n\t\treturn nil, err\n\t}\n\t// ibm, cloudit 일 경우에는 현재 haproxy만 사용하도록 함. 추후 지원 예정\n\tif req.Config.Kubernetes.Loadbalancer != app.LB_HAPROXY {\n\t\tconnection := tumblebug.NewConnection(req.ControlPlane[0].Connection)\n\t\texists, _ := connection.GET()\n\t\tif exists {\n\t\t\tif strings.ToLower(connection.ProviderName) == string(app.CSP_IBM) || strings.ToLower(connection.ProviderName) == string(app.CSP_NCP) {\n\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"%s does not yet supported nlb loadbalancer.\", strings.ToLower(connection.ProviderName)))\n\t\t\t}\n\t\t\tif strings.ToLower(connection.ProviderName) == string(app.CSP_NCPVPC) {\n\t\t\t\tif !strings.Contains(connection.RegionName, \"sgn\") && !strings.Contains(connection.RegionName, \"jpn\") {\n\t\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"To use nlb in %s, must use SGN, JPN region\", strings.ToLower(connection.ProviderName)))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tk8sVersion := fmt.Sprintf(\"%s-00\", req.Config.Kubernetes.Version)\n\n\t// validate prameters\n\tif req.ControlPlane[0].Count < 1 {\n\t\treturn nil, errors.New(\"Control-Plane count must be at least one.\")\n\t}\n\tif len(req.Worker) < 1 {\n\t\treturn nil, errors.New(\"Worker must be at least one.\")\n\t} else {\n\t\tfor _, worker := range req.Worker {\n\t\t\tif worker.Count < 1 {\n\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"Worker count must be at least one. (connection=%s)\", worker.Connection))\n\t\t\t}\n\t\t}\n\t}\n\n\tif req.ServiceType == app.ST_SINGLE {\n\t\tconnection := req.ControlPlane[0].Connection\n\n\t\t/*\n\t\t\t// Currently, cb-spider can only support a load balancer in public subnet that are available only SGN and JPN region.\n\t\t\tif strings.ToLower(connection.ProviderName) == string(app.CSP_NCPVPC) {\n\t\t\t\tif !strings.Contains(strings.ToLower(connection.RegionName), \"sgn\") && !strings.Contains(strings.ToLower(connection.RegionName), \"jpn\") {\n\t\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"To use single cloud type in %s, must use SGN, JPN region\", strings.ToLower(connection.ProviderName)))\n\t\t\t\t}\n\t\t\t}\n\t\t*/\n\n\t\tfor _, worker := range req.Worker {\n\t\t\tif worker.Connection != connection {\n\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"All nodes must be the same connection config. (connection=%s)\", worker.Connection))\n\t\t\t}\n\t\t}\n\t}\n\n\tclusterName := req.Name\n\tmcisName := clusterName\n\n\t// validate exists & clean-up cluster\n\tcluster := model.NewCluster(namespace, clusterName)\n\tif exists, err := cluster.Select(); err != nil {\n\t\treturn nil, err\n\t} else if exists == true {\n\t\t// clean-up if \"exists\" & \"failed-status\"\n\t\tif cluster.Status.Phase == model.ClusterPhaseFailed {\n\t\t\tlogger.Infof(\"[%s.%s] Clean up a cluster (phase=%s, reason=%s, cause='cluster is already exists') \", namespace, clusterName, cluster.Status.Phase, cluster.Status.Reason)\n\t\t\t_, err = DeleteCluster(namespace, clusterName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, errors.New(fmt.Sprintf(\"The cluster '%s' already exists. (namespace=%s)\", clusterName, namespace))\n\t\t}\n\t}\n\tlogger.Infof(\"[%s.%s] Validation & clean-up has been completed.\", namespace, clusterName)\n\n\t// set cluster paramaters\n\tcluster.Version = k8sVersion\n\tcluster.NetworkCni = req.Config.Kubernetes.NetworkCni\n\tcluster.Label = req.Label\n\tcluster.InstallMonAgent = req.Config.InstallMonAgent\n\tcluster.Loadbalancer = req.Config.Kubernetes.Loadbalancer\n\tcluster.Etcd = req.Config.Kubernetes.Etcd\n\tcluster.Description = req.Description\n\tcluster.ServiceType = req.ServiceType\n\tprovisioner := provision.NewProvisioner(cluster)\n\n\t//update phase(provisioning)\n\tif err := cluster.UpdatePhase(model.ClusterPhaseProvisioning); err != nil {\n\t\treturn nil, err\n\t}\n\tlogger.Infof(\"[%s.%s] The phase update has been completed.\", namespace, clusterName)\n\n\t// validate exists a MCIS\n\tmcis := tumblebug.NewMCIS(namespace, mcisName)\n\tif exists, err := mcis.GET(); err != nil {\n\t\tcluster.FailReason(model.GetMCISFailedReason, err.Error())\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t} else if exists {\n\t\tcluster.FailReason(model.AlreadyExistMCISFailedReason, fmt.Sprintf(\"MCIS already exists. (namespace=%s, mcis=%s)\", namespace, mcisName))\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t}\n\tlogger.Infof(\"[%s.%s] MCIS validation has been completed. (mcis=%s)\", namespace, clusterName, mcisName)\n\n\tvar cpLeaderCSP app.CSP\n\n\t// create a MCIR - \"vpc, f/w, sshkey, image, spec\" - with vlidations\n\tmcir := NewMCIR(namespace, app.CONTROL_PLANE, *req.ControlPlane[0])\n\n\treason, msg := mcir.CreateIfNotExist()\n\tif reason != \"\" {\n\t\tcluster.FailReason(reason, msg)\n\t\treturn nil, errors.New(msg)\n\t} else {\n\t\tcpLeaderCSP = mcir.csp\n\n\t\t// make mics reuqest & provisioner data\n\t\tname := lang.GenerateNewNodeName(string(app.CONTROL_PLANE), 1)\n\t\tcluster.CpGroup = name\n\t\tmcis.VMs = append(mcis.VMs, mcir.NewVM(namespace, name, mcisName, strconv.Itoa(req.ControlPlane[0].Count), req.ControlPlane[0].RootDisk.Type, req.ControlPlane[0].RootDisk.Size))\n\t}\n\tlogger.Infof(\"[%s.%s] MCIR(control-plane) creation has been completed.\", namespace, clusterName)\n\n\tidx := 0\n\tfor _, worker := range req.Worker {\n\t\tmcir := NewMCIR(namespace, app.WORKER, *worker)\n\t\treason, msg := mcir.CreateIfNotExist()\n\t\tif reason != \"\" {\n\t\t\tcluster.FailReason(reason, msg)\n\t\t\treturn nil, errors.New(msg)\n\t\t} else {\n\t\t\t// make mics reuqest & provisioner data\n\t\t\tfor i := 0; i < mcir.vmCount; i++ {\n\t\t\t\tname := lang.GenerateNewNodeName(string(app.WORKER), idx+1)\n\t\t\t\tmcis.VMs = append(mcis.VMs, mcir.NewVM(namespace, name, mcisName, \"\", worker.RootDisk.Type, worker.RootDisk.Size))\n\t\t\t\tprovisioner.AppendWorkerNodeMachine(name+\"-1\", mcir.csp, mcir.region, mcir.zone, mcir.credential)\n\t\t\t\tidx = idx + 1\n\t\t\t}\n\t\t}\n\t}\n\tlogger.Infof(\"[%s.%s] MCIR(worker nodes) creation has been completed.\", namespace, clusterName)\n\n\t// create a MCIS (contains vm)\n\tmcis.Label = app.MCIS_LABEL\n\tmcis.InstallMonAgent = cluster.InstallMonAgent\n\tmcis.SystemLabel = app.MCIS_SYSTEMLABEL\n\tif err := mcis.POST(); err != nil {\n\t\tcluster.FailReason(model.CreateMCISFailedReason, fmt.Sprintf(\"Failed to create a MCIS. (cause='%v')\", err))\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t} else {\n\t\tlogger.Debugf(\"[%s.%s] MCIS status is '%s' & vms='%v'\", namespace, clusterName, mcis.Status, mcis.VMs)\n\t}\n\tcluster.MCIS = mcisName\n\tlogger.Infof(\"[%s.%s] MCIS creation has been completed.\", namespace, clusterName)\n\tcluster.CpLeader = mcis.VMs[0].Name\n\n\tfor i, vm := range mcis.VMs {\n\t\tmcis.VMs[i].Namespace = mcis.Namespace\n\t\tmcis.VMs[i].McisName = mcis.Name\n\t\tif cluster.CpGroup == vm.VmGroupId {\n\t\t\tprovisioner.AppendControlPlaneMachine(vm.Name, mcir.csp, mcir.region, mcir.zone, mcir.credential)\n\t\t}\n\t}\n\n\t//create a NLB (contains control-plane)\n\tif cluster.Loadbalancer != app.LB_HAPROXY {\n\t\tNLB := mcir.NewNLB(namespace, mcisName, cluster.CpGroup)\n\t\tif exists, err := NLB.GET(); err != nil {\n\t\t\tcluster.FailReason(model.CreateNLBFailedReason, err.Error())\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t} else if !exists {\n\t\t\tif err := NLB.POST(); err != nil {\n\t\t\t\tcluster.FailReason(model.CreateNLBFailedReason, fmt.Sprintf(\"Failed to create a NLB. (cause='%v')\", NLB))\n\t\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t\t}\n\t\t\tlogger.Infof(\"[%s] NLB creation has been completed. (%s)\", req.ControlPlane[0].Connection, NLB.TargetGroup.VmGroupId)\n\t\t}\n\t}\n\n\t// update received data & save nodes metadata\n\tif nodes, err := provisioner.BindVM(mcis.VMs); err != nil {\n\t\tcluster.FailReason(model.AddNodeEntityFailedReason, err.Error())\n\t\tcleanUpCluster(*cluster, mcis)\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t} else {\n\t\tcluster.Nodes = nodes\n\t\tif err := cluster.PutStore(); err != nil {\n\t\t\tcluster.FailReason(model.AddNodeEntityFailedReason, fmt.Sprintf(\"Failed to add node entity. (cause='%v')\", err))\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t}\n\t}\n\n\t// kubernetes provisioning : bootstrap\n\ttime.Sleep(2 * time.Second)\n\tif err := provisioner.Bootstrap(); err != nil {\n\t\tcluster.FailReason(model.SetupBoostrapFailedReason, fmt.Sprintf(\"Bootstrap failed. (cause='%v')\", err))\n\t\tcleanUpCluster(*cluster, mcis)\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t}\n\tlogger.Infof(\"[%s.%s] Bootstrap has been completed.\", namespace, clusterName)\n\n\tif cluster.Loadbalancer == app.LB_HAPROXY {\n\t\t// kubernetes provisioning : haproxy\n\t\tif err := provisioner.InstallHAProxy(); err != nil {\n\t\t\tcluster.FailReason(model.SetupHaproxyFailedReason, fmt.Sprintf(\"Failed to install haproxy. (cause='%v')\", err))\n\t\t\tcleanUpCluster(*cluster, mcis)\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t}\n\t\tlogger.Infof(\"[%s.%s] HAProxy installation has been completed.\", namespace, clusterName)\n\t}\n\n\tif cluster.Etcd == app.ETCD_EXTERNAL {\n\t\ttime.Sleep(2 * time.Second)\n\t\tif err := provisioner.InitExternalEtcd(); err != nil {\n\t\t\tcluster.FailReason(model.InitExternalEtcdFailedReason, fmt.Sprintf(\"Failed to initialize External etcd. (cause='%v')\", err))\n\t\t\tcleanUpCluster(*cluster, mcis)\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t}\n\t\tlogger.Infof(\"[%s.%s] External etcd initialize has been completed.\", namespace, clusterName)\n\t}\n\n\t// kubernetes provisioning :control-plane init\n\tvar joinCmds []string\n\tjoinCmds, kubeconfig, err := provisioner.InitControlPlane(req.Config.Kubernetes)\n\tif err != nil {\n\t\tcluster.FailReason(model.InitControlPlaneFailedReason, fmt.Sprintf(\"Fail to initialize Control-plane. (cause='%v')\", err))\n\t\tcleanUpCluster(*cluster, mcis)\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t}\n\tcluster.ClusterConfig = kubeconfig\n\tlogger.Infof(\"[%s.%s] Control-Plane initialize has been completed.\", namespace, clusterName)\n\n\t// kubernetes provisioning : control-plane join\n\tfor _, machine := range provisioner.ControlPlaneMachines {\n\t\tif provisioner.Cluster.CpLeader != machine.Name {\n\t\t\tif err := machine.JoinControlPlane(&joinCmds[0]); err != nil {\n\t\t\t\tcluster.FailReason(model.JoinControlPlaneFailedReason, fmt.Sprintf(\"Fail to control-plane join. (node=%s)\", machine.Name))\n\t\t\t\tcleanUpCluster(*cluster, mcis)\n\t\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t\t}\n\t\t}\n\t}\n\tlogger.Infof(\"[%s.%s] Control-Plane join has been completed.\", namespace, clusterName)\n\n\t// kubernetes provisioning : worker node join\n\tfor _, machine := range provisioner.WorkerNodeMachines {\n\t\tif err := machine.JoinWorker(&joinCmds[1]); err != nil {\n\t\t\tcluster.FailReason(model.JoinWorkerFailedReason, fmt.Sprintf(\"Fail to worker-node join. (node=%s)\", machine.Name))\n\t\t\tcleanUpCluster(*cluster, mcis)\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t}\n\t}\n\tlogger.Infof(\"[%s.%s] Woker-nodes join has been completed.\", namespace, clusterName)\n\n\t// assign node labels (topology.cloud-barista.github.io/csp , topology.kubernetes.io/region, topology.kubernetes.io/zone)\n\tif err = provisioner.AssignNodeLabelAnnotation(); err != nil {\n\t\tlogger.Warnf(\"[%s.%s] Failed to assign node labels (cause='%v')\", namespace, clusterName, err)\n\t} else {\n\t\tlogger.Infof(\"[%s.%s] Node label assignment has been completed.\", namespace, clusterName)\n\t}\n\n\t// kubernetes provisioning : deploy network-cni\n\tif err = provisioner.InstallNetworkCni(); err != nil {\n\t\tcluster.FailReason(model.SetupNetworkCNIFailedReason, fmt.Sprintf(\"Failed to install network-cni. (cni=%s)\", req.Config.Kubernetes.NetworkCni))\n\t\tcleanUpCluster(*cluster, mcis)\n\t\treturn nil, errors.New(cluster.Status.Message)\n\t}\n\tlogger.Infof(\"[%s.%s] CNI installation has been completed.\", namespace, clusterName)\n\n\t// kubernetes provisioning : setting storageclass\n\tif req.Config.Kubernetes.StorageClass.Nfs.Server != \"\" && req.Config.Kubernetes.StorageClass.Nfs.Path != \"\" {\n\t\tif err = provisioner.InstallStorageClassNFS(req.Config.Kubernetes.StorageClass.Nfs); err != nil {\n\t\t\tcluster.FailReason(model.SetupStorageClassFailedReason, fmt.Sprintf(\"Failed to install storageclass. (cause='%v')\", err))\n\t\t\tcleanUpCluster(*cluster, mcis)\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t}\n\t\tlogger.Infof(\"[%s.%s] Storageclass installation has been completed.\", namespace, clusterName)\n\t}\n\n\t// kubernetes provision : deploy cloud-controller-manager when service_type is single\n\tif cluster.ServiceType == app.ST_SINGLE {\n\t\tvar bFail bool = false\n\t\tvar cloudConfig string\n\n\t\tif cpLeaderCSP == app.CSP_AWS {\n\t\t\t// check whether AWS IAM roles exists and are same\n\t\t\tvar bEmptyOrDiff bool = false\n\t\t\tvar awsCpRole, awsWorkerRole string\n\n\t\t\tawsCpRole = req.ControlPlane[0].Role\n\t\t\tawsWorkerRole = req.Worker[0].Role\n\t\t\tif awsCpRole == \"\" || awsWorkerRole == \"\" {\n\t\t\t\tbEmptyOrDiff = true\n\t\t\t}\n\n\t\t\tif bEmptyOrDiff == false {\n\t\t\t\tfor _, cp := range req.ControlPlane {\n\t\t\t\t\tif awsCpRole != cp.Role {\n\t\t\t\t\t\tbEmptyOrDiff = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif bEmptyOrDiff == false {\n\t\t\t\tfor _, worker := range req.Worker {\n\t\t\t\t\tif awsWorkerRole != worker.Role {\n\t\t\t\t\t\tbEmptyOrDiff = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif bEmptyOrDiff == true {\n\t\t\t\tbFail = true\n\t\t\t\tcluster.FailReason(model.SetupCCMFailedReason, fmt.Sprintf(\"Failed to prepare cloud-controller-manager: role should be assigned\"))\n\t\t\t} else {\n\t\t\t\tif err := awsPrepareCCM(req.ControlPlane[0].Connection, clusterName, mcis.VMs, provisioner, awsCpRole, awsWorkerRole); err != nil {\n\t\t\t\t\tbFail = true\n\t\t\t\t\tcluster.FailReason(model.SetupCCMFailedReason, fmt.Sprintf(\"Failed to prepare cloud-controller-manager: %v\", err))\n\t\t\t\t} else {\n\t\t\t\t\tif cloudConfig, err = awsBuildCloudConfig(req.ControlPlane[0].Connection); err != nil {\n\t\t\t\t\t\tbFail = true\n\t\t\t\t\t\tcluster.FailReason(model.SetupCCMFailedReason, fmt.Sprintf(\"Failed to get cloud config: %v\", err))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Success\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else if cpLeaderCSP == app.CSP_OPENSTACK {\n\t\t\tvar configLB []spider.KeyValue\n\n\t\t\tcpVm := mcis.FindVM(cluster.CpLeader)\n\t\t\tif cpVm != nil {\n\t\t\t\tconfigLB = append(configLB, spider.KeyValue{\"subnet-id\", cpVm.CspViewVmDetail.SubnetIID.SystemId})\n\t\t\t}\n\n\t\t\tif cloudConfig, err = openstackBuildCloudConfig(req.ControlPlane[0].Connection, configLB); err != nil {\n\t\t\t\tbFail = true\n\t\t\t\tcluster.FailReason(model.SetupCCMFailedReason, fmt.Sprintf(\"Failed to get cloud config: %v\", err))\n\t\t\t} else {\n\t\t\t\t// Success\n\t\t\t}\n\t\t} else if cpLeaderCSP == app.CSP_NCPVPC {\n\t\t\tif cloudConfig, err = ncpvpcBuildCloudConfig(req.ControlPlane[0].Connection, nil); err != nil {\n\t\t\t\tbFail = true\n\t\t\t\tcluster.FailReason(model.SetupCCMFailedReason, fmt.Sprintf(\"Failed to get cloud config: %v\", err))\n\t\t\t} else {\n\t\t\t\t// Success\n\t\t\t}\n\n\t\t} else {\n\t\t\t// Not supported CSP\n\t\t}\n\n\t\t// deploy cloud-controller-manager\n\t\tif bFail == false {\n\t\t\tif err = provisioner.InstallCcm(cloudConfig); err != nil {\n\t\t\t\tbFail = true\n\t\t\t\tcluster.FailReason(model.SetupCCMFailedReason, fmt.Sprintf(\"Failed to install cloud-controller-manager: %v\", err))\n\t\t\t} else {\n\t\t\t\t// Success\n\t\t\t}\n\t\t}\n\n\t\tif bFail == true {\n\t\t\tcleanUpCluster(*cluster, mcis)\n\t\t\treturn nil, errors.New(cluster.Status.Message)\n\t\t} else {\n\t\t\tlogger.Infof(\"[%s.%s] CCM installation has been completed.\", namespace, clusterName)\n\t\t}\n\t}\n\n\t// save nodes metadata & update status\n\tfor _, node := range cluster.Nodes {\n\t\tnode.CreatedTime = lang.GetNowUTC()\n\t}\n\tcluster.UpdatePhase(model.ClusterPhaseProvisioned)\n\tlogger.Infof(\"[%s.%s] Cluster creation has been completed.\", namespace, clusterName)\n\treturn cluster, nil\n}", "title": "" }, { "docid": "6b4a35d734aff9a32a3c05fa304c40c6", "score": "0.44604453", "text": "func NewCluster(ctx *pulumi.Context,\n\tname string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) {\n\tif args == nil || args.HsmType == nil {\n\t\treturn nil, errors.New(\"missing required argument 'HsmType'\")\n\t}\n\tif args == nil || args.SubnetIds == nil {\n\t\treturn nil, errors.New(\"missing required argument 'SubnetIds'\")\n\t}\n\tif args == nil {\n\t\targs = &ClusterArgs{}\n\t}\n\tvar resource Cluster\n\terr := ctx.RegisterResource(\"aws:cloudhsmv2/cluster:Cluster\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "82a543f15301eecaa8f7ae78ef6d6356", "score": "0.4459064", "text": "func NewV2RegisterClusterBadRequest() *V2RegisterClusterBadRequest {\n\n\treturn &V2RegisterClusterBadRequest{}\n}", "title": "" }, { "docid": "542496dedab469b93b5d1b7efacdef12", "score": "0.44542715", "text": "func NewInstallClusterUnauthorized() *InstallClusterUnauthorized {\n\treturn &InstallClusterUnauthorized{}\n}", "title": "" }, { "docid": "cca97a62a5e6b2155a723983b0d827fd", "score": "0.44525346", "text": "func (o *V2DeregisterClusterConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(409)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7db5c9934f563e879e6e3d8b8b4623d1", "score": "0.44489163", "text": "func NewDeleteClusterUnauthorized() *DeleteClusterUnauthorized {\n\treturn &DeleteClusterUnauthorized{}\n}", "title": "" }, { "docid": "6a69143ca06a50f8991d2d33a8790759", "score": "0.44479677", "text": "func (a *Actuator) Delete(cluster *clusterv1.Cluster) error {\n\tlog.Printf(\"Deleting cluster %v.\", cluster.Name)\n\n\tclusterKey := types.NamespacedName{\n\t\tNamespace: cluster.Namespace,\n\t\tName: cluster.Name,\n\t}\n\n\tstatus, err := util.ToClusterProviderStatus(&cluster.Status)\n\tif err != nil {\n\t\treturn errors.Errorf(\"decode cluster provider status for cluster %v: %w\", clusterKey, err)\n\t}\n\n\tnewStatus := status.DeepCopy()\n\tnewStatus.ProjectID = \"\"\n\n\tutil.UpdateClusterProviderStatus(a.client, clusterKey, newStatus)\n\tif err != nil {\n\t\treturn errors.Errorf(\"update status of cluster %v\", clusterKey, err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "847726d6c36350bebc676004b92493ae", "score": "0.44410628", "text": "func NewCluster(config *rest.Config, applier Applier, version string, logger log.Logger) (*Cluster, error) {\n\tclient, err := k8sclient.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc := &Cluster{\n\t\tconfig: config,\n\t\tclient: extendedClient{client.Discovery(), client.Core(), client.Extensions()},\n\t\tapplier: applier,\n\t\tactionc: make(chan func()),\n\t\tversion: version,\n\t\tlogger: logger,\n\t}\n\tgo c.loop()\n\treturn c, nil\n}", "title": "" }, { "docid": "6994fbb757385d1f4a882403352a4470", "score": "0.44397917", "text": "func NewCreateClusterManifestForbidden() *CreateClusterManifestForbidden {\n\n\treturn &CreateClusterManifestForbidden{}\n}", "title": "" }, { "docid": "1a2b8f60ab1a35b26ab6414caee79f98", "score": "0.44370222", "text": "func NewDeleteFamilyNoContent() *DeleteFamilyNoContent {\n\treturn &DeleteFamilyNoContent{}\n}", "title": "" }, { "docid": "8be857fe19451872a467b28cd144e75d", "score": "0.4436869", "text": "func (a *Client) CreateClusterV2(params *CreateClusterV2Params, authInfo runtime.ClientAuthInfoWriter) (*CreateClusterV2Created, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateClusterV2Params()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"createClusterV2\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/api/v2/projects/{project_id}/clusters\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &CreateClusterV2Reader{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\tsuccess, ok := result.(*CreateClusterV2Created)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*CreateClusterV2Default)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "68d8b76db120fdf6e37aa07f3501bbc6", "score": "0.44344464", "text": "func popCluster(f cmdutil.Factory, name string) (*federationapi.Cluster, error) {\n\t// Boilerplate to create the secret in the host cluster.\n\tmapper, typer := f.Object()\n\tgvks, _, err := typer.ObjectKinds(&federationapi.Cluster{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgvk := gvks[0]\n\tmapping, err := mapper.RESTMapping(schema.GroupKind{Group: gvk.Group, Kind: gvk.Kind}, gvk.Version)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient, err := f.ClientForMapping(mapping)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trh := resource.NewHelper(client, mapping)\n\tobj, err := rh.Get(\"\", name, false)\n\n\tif isNotFound(err) {\n\t\t// Cluster isn't registered, there isn't anything to be done here.\n\t\treturn nil, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\tcluster, ok := obj.(*federationapi.Cluster)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unexpected object type: expected \\\"federation/v1beta1.Cluster\\\", got %T: obj: %#v\", obj, obj)\n\t}\n\n\t// Remove the cluster resource in the federation API server by\n\t// calling rh.Delete()\n\treturn cluster, rh.Delete(\"\", name)\n}", "title": "" }, { "docid": "59cc6c763da0aae276b728eeed8bc514", "score": "0.44295603", "text": "func NewClusterRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {\n\tvar command = &cobra.Command{\n\t\tUse: \"rm CLUSTER\",\n\t\tShort: \"Remove cluster credentials\",\n\t\tRun: func(c *cobra.Command, args []string) {\n\t\t\tif len(args) == 0 {\n\t\t\t\tc.HelpFunc()(c, args)\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\tconn, clusterIf := argocdclient.NewClientOrDie(clientOpts).NewClusterClientOrDie()\n\t\t\tdefer util.Close(conn)\n\n\t\t\t// clientset, err := kubernetes.NewForConfig(conf)\n\t\t\t// errors.CheckError(err)\n\n\t\t\tfor _, clusterName := range args {\n\t\t\t\t// TODO(jessesuen): find the right context and remove manager RBAC artifacts\n\t\t\t\t// err := clusterauth.UninstallClusterManagerRBAC(clientset)\n\t\t\t\t// errors.CheckError(err)\n\t\t\t\t_, err := clusterIf.Delete(context.Background(), &clusterpkg.ClusterQuery{Server: clusterName})\n\t\t\t\terrors.CheckError(err)\n\t\t\t}\n\t\t},\n\t}\n\treturn command\n}", "title": "" }, { "docid": "ef0b6560d9cedb61427327013c701641", "score": "0.44266132", "text": "func NewDeleteHostNoContent() *DeleteHostNoContent {\n\n\treturn &DeleteHostNoContent{}\n}", "title": "" }, { "docid": "3ae5b82cd0c14452c7b365fa5281e155", "score": "0.44257665", "text": "func newUpdateClusterUpdateClusterRequest(ctx context.Context, f *Cluster, c *Client) (map[string]interface{}, error) {\n\treq := map[string]interface{}{}\n\n\tif v := f.Labels; !dcl.IsEmptyValueIndirect(v) {\n\t\treq[\"labels\"] = v\n\t}\n\treturn req, nil\n}", "title": "" }, { "docid": "566ebc58972a3b4fb4e575b20b6a9d62", "score": "0.44205636", "text": "func NewShutdownServerNoContent() *ShutdownServerNoContent {\n\treturn &ShutdownServerNoContent{}\n}", "title": "" }, { "docid": "467cb2efe4be5dec95b23e227c3ffbe7", "score": "0.44113502", "text": "func (a *Client) CreateXcluster(params *CreateXclusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateXclusterOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewCreateXclusterParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"create_xcluster\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/api/v1/customers/{cUUID}/universes/{uniUUID}/xcluster_replication\",\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: &CreateXclusterReader{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, err\n\t}\n\tsuccess, ok := result.(*CreateXclusterOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for create_xcluster: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "d24bd2d2e691b618bf15b6c587674b7a", "score": "0.44095132", "text": "func (o *V2DeregisterClusterConflict) WithPayload(payload *models.Error) *V2DeregisterClusterConflict {\n\to.Payload = payload\n\treturn o\n}", "title": "" }, { "docid": "a4dfad3c625eef9c0e184ca592d49398", "score": "0.44023374", "text": "func ForbidClusterIDHeader(inner http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tclusterID := r.Header.Get(\"X-Limes-Cluster-Id\")\n\t\tif clusterID != \"\" && clusterID != \"current\" {\n\t\t\thttp.Error(w, \"multi-cluster support is removed: the X-Limes-Cluster-Id header is not allowed anymore\", http.StatusBadRequest)\n\t\t} else {\n\t\t\tinner.ServeHTTP(w, r)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "f62b7749567d7b71aeda70773ec6d12e", "score": "0.43979365", "text": "func NewInitializeGroupBackupDeletionNoContent() *InitializeGroupBackupDeletionNoContent {\n\treturn &InitializeGroupBackupDeletionNoContent{}\n}", "title": "" }, { "docid": "3127af031da14bdf56eb9c30bb9de592", "score": "0.437995", "text": "func (o *V2DeregisterClusterMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {\n\n\trw.WriteHeader(405)\n\tif o.Payload != nil {\n\t\tpayload := o.Payload\n\t\tif err := producer.Produce(rw, payload); err != nil {\n\t\t\tpanic(err) // let the recovery middleware deal with this\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1b080171cbeb24661bed68ffc0afbb26", "score": "0.43789238", "text": "func newOutOfClusterSwfClient() (*SwfClient, error) {\n\thome := homedir.HomeDir()\n\tif home == \"\" {\n\t\treturn nil, errors.New(\"Cannot get home dir\")\n\t}\n\n\tdefaultKubeConfigPath := filepath.Join(home, \".kube\", \"config\")\n\t// use the current context in kubeconfig\n\tconfig, err := clientcmd.BuildConfigFromFlags(\"\", defaultKubeConfigPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// create the clientset\n\tswfClientSet, err := swfclient.NewForConfig(config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create swf client set: %w\", err)\n\t}\n\n\treturn &SwfClient{swfClientSet.ScheduledworkflowV1beta1()}, nil\n}", "title": "" }, { "docid": "10665b31dcd85c14d05fc072a498aad1", "score": "0.4376177", "text": "func NewNoContent() ErrorHandled {\n\treturn factory(http.StatusNoContent, nil)\n}", "title": "" }, { "docid": "406da1d33e793db19884a3c1df33fa62", "score": "0.4372815", "text": "func (client *ExtensionsClient) disableMonitoringCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientBeginDisableMonitoringOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring\"\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 clusterName == \"\" {\n\t\treturn nil, errors.New(\"parameter clusterName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{clusterName}\", url.PathEscape(clusterName))\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-04-15-preview\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, nil\n}", "title": "" }, { "docid": "47857803b5fd9f404c306c3ce60de0f1", "score": "0.4370408", "text": "func (a *Client) DeleteXcluster(params *DeleteXclusterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteXclusterOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewDeleteXclusterParams()\n\t}\n\top := &runtime.ClientOperation{\n\t\tID: \"delete_xcluster\",\n\t\tMethod: \"DELETE\",\n\t\tPathPattern: \"/api/v1/customers/{cUUID}/universes/{uniUUID}/xcluster_replication\",\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: &DeleteXclusterReader{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, err\n\t}\n\tsuccess, ok := result.(*DeleteXclusterOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for delete_xcluster: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "78cbc60b67d2f29a136ab446dd23363c", "score": "0.436982", "text": "func (*DeleteClusterRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_edgecontainer_v1_service_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "0fa613845ac5bfa518d7d3a668beb599", "score": "0.43533674", "text": "func (x *fastReflection_MsgCancelUnbondingDelegationResponse) New() protoreflect.Message {\n\treturn new(fastReflection_MsgCancelUnbondingDelegationResponse)\n}", "title": "" }, { "docid": "7ba9b5a68b5888e92adf389bbd2b0b3c", "score": "0.43512338", "text": "func NewCluster(addr string) (*Cluster, error) {\n\treturn NewClusterTimeout(addr, time.Duration(0))\n}", "title": "" }, { "docid": "d307d87ed01e04745ddd4a9d0dd43f93", "score": "0.43454182", "text": "func (p *Registrar) Deregister() {\n\tif err := p.client.Deregister(p.registration); err != nil {\n\t\tfmt.Println(\"err\", err)\n\t} else {\n\t\tfmt.Println(\"action\", \"deregister\")\n\t}\n}", "title": "" }, { "docid": "5ea0faa58c0bfcd0c536fe1e02d83975", "score": "0.43440697", "text": "func (httpAPI *API) ForgetCluster(params martini.Params, r render.Render, req *http.Request, user auth.User) {\n\tif !isAuthorizedForAction(req, user) {\n\t\tRespond(r, &APIResponse{Code: ERROR, Message: \"Unauthorized\"})\n\t\treturn\n\t}\n\tclusterName, err := figureClusterName(getClusterHint(params))\n\tif err != nil {\n\t\tRespond(r, &APIResponse{Code: ERROR, Message: fmt.Sprintf(\"%+v\", err)})\n\t\treturn\n\t}\n\n\tif orcraft.IsRaftEnabled() {\n\t\t_, _ = orcraft.PublishCommand(\"forget-cluster\", clusterName)\n\t} else {\n\t\t_ = inst.ForgetCluster(clusterName)\n\t}\n\tRespond(r, &APIResponse{Code: OK, Message: fmt.Sprintf(\"Cluster forgotten: %+v\", clusterName)})\n}", "title": "" }, { "docid": "2fba8b12a54184d95347e467afdd7f3d", "score": "0.4339273", "text": "func NewUnregisterNodesRequest(requestHeader ExtensionObjectDefinition, noOfNodesToUnregister int32, nodesToUnregister []NodeId) *_UnregisterNodesRequest {\n\t_result := &_UnregisterNodesRequest{\n\t\tRequestHeader: requestHeader,\n\t\tNoOfNodesToUnregister: noOfNodesToUnregister,\n\t\tNodesToUnregister: nodesToUnregister,\n\t\t_ExtensionObjectDefinition: NewExtensionObjectDefinition(),\n\t}\n\t_result._ExtensionObjectDefinition._ExtensionObjectDefinitionChildRequirements = _result\n\treturn _result\n}", "title": "" }, { "docid": "5500e30c17024a5b766a563ad55c125c", "score": "0.432812", "text": "func TestGetClustersNoMatchingClusters(t *testing.T) {\n\tjson := `{\n\t\t\"kind\": \"ClusterList\",\n\t\t\"page\": 0,\n\t\t\"size\": 0,\n\t\t\"total\": 0,\n\t\t\"items\": []\n\t}`\n\tgetRequestFunc = func(*http.Request) (*http.Response, error) {\n\t\treturn &http.Response{\n\t\t\tStatusCode: http.StatusOK,\n\t\t\tBody: ioutil.NopCloser(strings.NewReader(json)),\n\t\t}, nil\n\t}\n\trestclient.ClusterHTTPClient = &getClientMock{} //without this line, the real api is fired\n\n\tresponse, err := ClusterProvider.GetClusters(cluster_domain.ClusterRequest{\n\t\tFilter: discoveryv1.Filter{\n\t\t\tLastActive: 1,\n\t\t},\n\t})\n\tassert.NotNil(t, response)\n\tassert.Nil(t, err)\n}", "title": "" }, { "docid": "384915554ecfae03889cf52473db1d79", "score": "0.4326637", "text": "func NewV2CreateClusterManifestMethodNotAllowed() *V2CreateClusterManifestMethodNotAllowed {\n\treturn &V2CreateClusterManifestMethodNotAllowed{}\n}", "title": "" } ]
e9554a93f85fb403947d8c70a36434e1
AddRule inserts a rule into a network firewall policy.
[ { "docid": "87477c9b2fdf39d3e6042460948e057e", "score": "0.70735425", "text": "func (c *regionNetworkFirewallPoliciesRESTClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error) {\n\tm := protojson.MarshalOptions{AllowPartial: true}\n\tbody := req.GetFirewallPolicyRuleResource()\n\tjsonReq, err := m.Marshal(body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/compute/v1/projects/%v/regions/%v/firewallPolicies/%v/addRule\", req.GetProject(), req.GetRegion(), req.GetFirewallPolicy())\n\n\tparams := url.Values{}\n\tif req != nil && req.MaxPriority != nil {\n\t\tparams.Add(\"maxPriority\", fmt.Sprintf(\"%v\", req.GetMaxPriority()))\n\t}\n\tif req != nil && req.MinPriority != nil {\n\t\tparams.Add(\"minPriority\", fmt.Sprintf(\"%v\", req.GetMinPriority()))\n\t}\n\tif req != nil && req.RequestId != nil {\n\t\tparams.Add(\"requestId\", fmt.Sprintf(\"%v\", req.GetRequestId()))\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&%s=%v&%s=%v\", \"project\", url.QueryEscape(req.GetProject()), \"region\", url.QueryEscape(req.GetRegion()), \"firewall_policy\", url.QueryEscape(req.GetFirewallPolicy()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\topts = append((*c.CallOptions).AddRule[0:len((*c.CallOptions).AddRule):len((*c.CallOptions).AddRule)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &computepb.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(\"POST\", baseUrl.String(), bytes.NewReader(jsonReq))\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\top := &Operation{\n\t\t&regionOperationsHandle{\n\t\t\tc: c.operationClient,\n\t\t\tproto: resp,\n\t\t\tproject: req.GetProject(),\n\t\t\tregion: req.GetRegion(),\n\t\t},\n\t}\n\treturn op, nil\n}", "title": "" } ]
[ { "docid": "392c3be0ae544eac3a598cf09c179dd4", "score": "0.81337696", "text": "func (c *NetworkFirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error) {\n\treturn c.internalClient.AddRule(ctx, req, opts...)\n}", "title": "" }, { "docid": "56433192ea48e7df758243ec073b6ded", "score": "0.80616426", "text": "func (n *NetworkSimulator) AddRule(rule NetworkSimulatorRule) {\n\tif n.haveCalledConnect {\n\t\tutils.Bug(\"must call AddRule() before any call of Connect()\")\n\t}\n\tn.rules = append(n.rules, &rule)\n}", "title": "" }, { "docid": "126dab43cf1e3604777f380f27c67f26", "score": "0.7802156", "text": "func AddRule(appPort, metadataAddress, hostInterface, hostIP string) error {\n\n\tif err := checkInterfaceExists(hostInterface); err != nil {\n\t\treturn err\n\t}\n\n\tif hostIP == \"\" {\n\t\treturn errors.New(\"--host-ip must be set\")\n\t}\n\n\tipt, err := iptables.New()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ipt.AppendUnique(\n\t\t\"nat\", \"PREROUTING\", \"-p\", \"tcp\", \"-d\", metadataAddress, \"--dport\", \"80\",\n\t\t\"-j\", \"DNAT\", \"--to-destination\", hostIP+\":\"+appPort, \"-i\", hostInterface,\n\t)\n}", "title": "" }, { "docid": "e206f1348653f4297b9fe4a774d06c14", "score": "0.7766386", "text": "func (d *DefaultRulesEngine) AddRule(rule api.Rule) {\n\td.rules = append(d.rules, rule)\n}", "title": "" }, { "docid": "bead3ab5ab0800ce30ac639c7b4259ce", "score": "0.77663857", "text": "func AddRule(c *gophercloud.ServiceClient, id string, opts InsertRuleOptsBuilder) (r InsertRuleResult) {\n\tb, err := opts.ToFirewallPolicyInsertRuleMap()\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn\n\t}\n\tresp, err := c.Put(insertURL(c, id), b, &r.Body, &gophercloud.RequestOpts{\n\t\tOkCodes: []int{200},\n\t})\n\t_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)\n\treturn\n}", "title": "" }, { "docid": "d5693082f32b22887b44aa6bfe4da617", "score": "0.7714855", "text": "func (f *Firewall) AddRule(containerID string, ip string, pp PortProto) error {\n\trulespec := []string{\n\t\t\"-j\", \"ACCEPT\",\n\t\t\"-p\", pp.Proto,\n\t\t\"-d\", ip,\n\t\t\"--dport\", pp.Port,\n\t\t\"-m\", \"comment\", \"--comment\", containerID,\n\t}\n\n\tlog.Printf(\"Ensure rule: %v\", rulespec)\n\treturn f.InsertUnique(f.ChainName, rulespec...)\n}", "title": "" }, { "docid": "128f312c209e0194e1a05f0c020ffd36", "score": "0.76747644", "text": "func (c *RegionNetworkFirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error) {\n\treturn c.internalClient.AddRule(ctx, req, opts...)\n}", "title": "" }, { "docid": "481c048ecd5044b8bf7aa43bcde88afe", "score": "0.75385606", "text": "func (gp *EpgPolicy) AddRule(rule *contivModel.Rule) error {\n\tvar dirs []string\n\n\t// check if the rule exists already\n\tif gp.RuleMaps[rule.Key] != nil {\n\t\t// FIXME: see if we can update the rule\n\t\treturn core.Errorf(\"Rule already exists\")\n\t}\n\n\t// Figure out all the directional rules we need to install\n\tswitch rule.Direction {\n\tcase \"in\":\n\t\tif (rule.Protocol == \"udp\" || rule.Protocol == \"tcp\") && rule.Port != 0 {\n\t\t\tdirs = []string{\"inRx\", \"inTx\"}\n\t\t} else {\n\t\t\tdirs = []string{\"inRx\"}\n\t\t}\n\tcase \"out\":\n\t\tif (rule.Protocol == \"udp\" || rule.Protocol == \"tcp\") && rule.Port != 0 {\n\t\t\tdirs = []string{\"outRx\", \"outTx\"}\n\t\t} else {\n\t\t\tdirs = []string{\"outTx\"}\n\t\t}\n\tcase \"both\":\n\t\tif (rule.Protocol == \"udp\" || rule.Protocol == \"tcp\") && rule.Port != 0 {\n\t\t\tdirs = []string{\"inRx\", \"inTx\", \"outRx\", \"outTx\"}\n\t\t} else {\n\t\t\tdirs = []string{\"inRx\", \"outTx\"}\n\t\t}\n\n\t}\n\n\t// create a ruleMap\n\truleMap := new(RuleMap)\n\truleMap.OfnetRules = make(map[string]*ofnet.OfnetPolicyRule)\n\truleMap.Rule = rule\n\n\t// Create ofnet rules\n\tfor _, dir := range dirs {\n\t\tofnetRule, err := gp.createOfnetRule(rule, dir)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error creating %s ofnet rule for {%+v}. Err: %v\", dir, rule, err)\n\t\t\treturn err\n\t\t}\n\n\t\t// add it to the rule map\n\t\truleMap.OfnetRules[ofnetRule.RuleId] = ofnetRule\n\t}\n\n\t// save the rulemap\n\tgp.RuleMaps[rule.Key] = ruleMap\n\n\treturn nil\n}", "title": "" }, { "docid": "9a5e5853b43d9c36b24d4ee17112944f", "score": "0.75085294", "text": "func (eng *Engine) AddRule(name, condition, action string) (*Rule, error) {\n\tr, err := compileRule(name, condition, action)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\teng.rules = append(eng.rules, r)\n\treturn r, nil\n}", "title": "" }, { "docid": "8ab0ba0f1346ec74e1811158bf059558", "score": "0.746951", "text": "func (c *Config) AddRule(rule *schema.Rule) {\n\tnftable := schema.Nftable{Rule: rule}\n\tc.Nftables = append(c.Nftables, nftable)\n}", "title": "" }, { "docid": "150cd8091492ae7912d98af1f9811b71", "score": "0.7412052", "text": "func (h *Handle) RuleAdd(rule *Rule) error {\n\treq := h.newNetlinkRequest(unix.RTM_NEWRULE, unix.NLM_F_CREATE|unix.NLM_F_EXCL|unix.NLM_F_ACK)\n\treturn ruleHandle(rule, req)\n}", "title": "" }, { "docid": "0a0c15bf91b2071beb4bc15435053fca", "score": "0.74018884", "text": "func (ipt *IPTableRules) AddRule(port int, podIP string) error {\n\truleSpec := []string{\n\t\t\"-p\", \"tcp\", \"-m\", \"tcp\", \"--dport\",\n\t\tfmt.Sprint(port), \"-j\", \"DNAT\", \"--to-destination\", podIP,\n\t}\n\terr := ipt.table.EnsureRule(iptables.NATTable, NodePortLocalChain, ruleSpec)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"IPTABLES rule creation failed for NPL with error: %v\", err)\n\t}\n\tklog.Infof(\"successfully added rule for Pod %s: %d\", podIP, port)\n\treturn nil\n}", "title": "" }, { "docid": "6894ff747da33ba536d168171cb33e2e", "score": "0.7343014", "text": "func (s *Service) AddRule(ctx context.Context, req *svpb.AddRuleRequest) (*emptypb.Empty, error) {\n\tif err := s.store.AddRule(ctx, resources.ProtoToRule(req.GetRule())); err != nil {\n\t\treturn &emptypb.Empty{}, status.Errorf(codes.Internal, \"failed to add rule: %v\", err)\n\t}\n\treturn &emptypb.Empty{}, nil\n}", "title": "" }, { "docid": "8dc5096afe89b72e3bb231c805e5e68a", "score": "0.73395085", "text": "func (gen *NinjaGenerator) AddRule(rule *NinjaRule) {\n\tgen.Rules = append(gen.Rules, rule)\n}", "title": "" }, { "docid": "c787a384ba47569efa94a6ef791db7bf", "score": "0.7265566", "text": "func (c *networkFirewallPoliciesRESTClient) AddRule(ctx context.Context, req *computepb.AddRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error) {\n\tm := protojson.MarshalOptions{AllowPartial: true}\n\tbody := req.GetFirewallPolicyRuleResource()\n\tjsonReq, err := m.Marshal(body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbaseUrl, err := url.Parse(c.endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbaseUrl.Path += fmt.Sprintf(\"/compute/v1/projects/%v/global/firewallPolicies/%v/addRule\", req.GetProject(), req.GetFirewallPolicy())\n\n\tparams := url.Values{}\n\tif req != nil && req.MaxPriority != nil {\n\t\tparams.Add(\"maxPriority\", fmt.Sprintf(\"%v\", req.GetMaxPriority()))\n\t}\n\tif req != nil && req.MinPriority != nil {\n\t\tparams.Add(\"minPriority\", fmt.Sprintf(\"%v\", req.GetMinPriority()))\n\t}\n\tif req != nil && req.RequestId != nil {\n\t\tparams.Add(\"requestId\", fmt.Sprintf(\"%v\", req.GetRequestId()))\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&%s=%v\", \"project\", url.QueryEscape(req.GetProject()), \"firewall_policy\", url.QueryEscape(req.GetFirewallPolicy()))}\n\n\thds = append(c.xGoogHeaders, hds...)\n\thds = append(hds, \"Content-Type\", \"application/json\")\n\theaders := gax.BuildHeaders(ctx, hds...)\n\topts = append((*c.CallOptions).AddRule[0:len((*c.CallOptions).AddRule):len((*c.CallOptions).AddRule)], opts...)\n\tunm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}\n\tresp := &computepb.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(\"POST\", baseUrl.String(), bytes.NewReader(jsonReq))\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\top := &Operation{\n\t\t&globalOperationsHandle{\n\t\t\tc: c.operationClient,\n\t\t\tproto: resp,\n\t\t\tproject: req.GetProject(),\n\t\t},\n\t}\n\treturn op, nil\n}", "title": "" }, { "docid": "09eaa6619d52c8be5dada9c860af2bd6", "score": "0.7229995", "text": "func (l *List) AddRule(r *Rule) error {\n\tl.rules[r.Value] = r\n\treturn nil\n}", "title": "" }, { "docid": "8bc5ecefa34860ad10c0e8d948d7b242", "score": "0.7143147", "text": "func (m *Manager) AddRule(key string, r *Rule) {\n\tm.Lock()\n\tm.hash.WriteString(key)\n\tm.rules[m.hash.Sum64()] = r\n\tm.hash.Reset()\n\tm.Unlock()\n}", "title": "" }, { "docid": "e0aa20ab7867f400b3d8e2989c08bc53", "score": "0.7077975", "text": "func (m *Mapping) AddRule(rule *Rule) error {\n\treturn m.addOrUpdateRule(rule, false)\n}", "title": "" }, { "docid": "17af3a2d10604d77b99898831cdfa3b9", "score": "0.69357765", "text": "func (store *Store) AddStreamRule(rule *graylog.StreamRule) error {\n\tif rule == nil {\n\t\treturn fmt.Errorf(\"rule is nil\")\n\t}\n\tstreamID := rule.StreamID\n\tif streamID == \"\" {\n\t\treturn fmt.Errorf(\"stream id is empty\")\n\t}\n\n\tstore.imutex.Lock()\n\tdefer store.imutex.Unlock()\n\n\tstream, ok := store.streams[streamID]\n\tif !ok {\n\t\treturn fmt.Errorf(`stream \"%s\" is not found`, streamID)\n\t}\n\n\tif rule.ID == \"\" {\n\t\trule.ID = st.NewObjectID()\n\t}\n\tstream.Rules = append(stream.Rules, *rule)\n\tstore.streams[streamID] = stream\n\treturn nil\n}", "title": "" }, { "docid": "a813dec50af6a443022c45042e8c2283", "score": "0.6838866", "text": "func (r *Route) AddRule(rule *Rule) *Rule {\n\tdomainAndUri := rule.pattern\n\tmethod := \"\"\n\tfor _, method = range rule.method {\n\n\t\tif _, ok := r.rules[method]; !ok {\n\t\t\tr.rules[method] = map[string]*Rule{\n\t\t\t\tdomainAndUri: rule,\n\t\t\t}\n\t\t} else {\n\t\t\tr.rules[method][domainAndUri] = rule\n\t\t}\n\n\t}\n\n\tif r.allRules == nil {\n\t\tr.allRules = map[string]*Rule{}\n\t}\n\tr.allRules[method+domainAndUri] = rule\n\n\treturn rule\n}", "title": "" }, { "docid": "864c6f56ff83b07987f7c38b4415aaf6", "score": "0.6800096", "text": "func (rm *Controller) Add(rule netlink.Rule) error {\n\trm.mu.Lock()\n\tdefer rm.mu.Unlock()\n\t// check if we are already managing this route and if so, no-op\n\tfor _, existingRule := range rm.rules {\n\t\tif areNetlinkRulesEqual(existingRule.rule, &rule) {\n\t\t\treturn nil\n\t\t}\n\t}\n\trm.rules = append(rm.rules, ipRule{rule: &rule})\n\treturn rm.reconcile()\n}", "title": "" }, { "docid": "c8dc9b2ec735f9683407a50d5b832b33", "score": "0.67273146", "text": "func (b *RoutesBuilder) AddRule(n string, m ServiceMatcher,\n\ttoRoutes func([]swarm.Service) (map[ingress.Vhost][]loadbalancer.Route, error)) *RoutesBuilder {\n\n\tb.lock.Lock()\n\tdefer b.lock.Unlock()\n\n\tif b.matchers == nil {\n\t\tb.matchers = []*matcher{}\n\t}\n\tb.matchers = append(b.matchers, &matcher{name: n, matchFunc: m, toRoutes: toRoutes})\n\treturn b\n}", "title": "" }, { "docid": "5bd9cfeda524fc17804dfb0101f4f72a", "score": "0.6702996", "text": "func (r *Rule) Add() error {\n\turl := config.URL.RulesEngine + clients.ApiBase + \"/rule\"\n\t_, err := clients.PostJsonRequest(url, r, context.TODO())\n\t// TODO make explicit: silently ignore duplicate rules\n\tif err != nil && err.(*types.ErrServiceClient).StatusCode != 409 {\n\t\treturn fmt.Errorf(\"couldn't send rule to rules engine: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "98e5811856733d73c60660f3d365685a", "score": "0.66433215", "text": "func PolicyAddRule(policy *contivModel.Policy, rule *contivModel.Rule) error {\n\t// Dont install policies in ACI mode\n\tif !isPolicyEnabled() {\n\t\treturn nil\n\t}\n\n\t// Walk all associated endpoint groups\n\tfor epgKey := range policy.LinkSets.EndpointGroups {\n\t\tgpKey := epgKey + \":\" + policy.Key\n\n\t\t// Find the epg policy\n\t\tgp := mastercfg.FindEpgPolicy(gpKey)\n\t\tif gp == nil {\n\t\t\tlog.Errorf(\"Failed to find the epg policy %s\", gpKey)\n\t\t\treturn core.Errorf(\"epg policy not found\")\n\t\t}\n\n\t\t// Add the Rule\n\t\terr := gp.AddRule(rule)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error adding the rule %s to epg policy %s. Err: %v\", rule.Key, gpKey, err)\n\t\t\treturn err\n\t\t}\n\n\t\t// Save the policy state\n\t\terr = gp.Write()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "857540205aed8e520240f8f97792a236", "score": "0.6634446", "text": "func (rg *RuleGroup) Add(rule *Rule) error {\n\tif rule == nil {\n\t\t// this is an ugly solution but chains should not return rules\n\t\treturn nil\n\t}\n\n\tif rg.FindById(rule.Id) != nil && rule.Id != 0 {\n\t\treturn fmt.Errorf(\"there is a another rule with id %d\", rule.Id)\n\t}\n\trg.rules = append(rg.rules, rule)\n\treturn nil\n}", "title": "" }, { "docid": "2d46c9bcd4c852e246a87bed778eb62e", "score": "0.6517056", "text": "func (c *StnConfigurator) Add(rule *modelStn.STN_Rule) error {\n\t// Check stn data\n\tstnRule, doVPPCall, err := c.checkStn(rule, c.ifIndexes)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !doVPPCall {\n\t\tc.log.Debugf(\"There is no interface for rule: %v. Waiting for interface.\", rule.Interface)\n\t\tc.indexSTNRule(rule, true)\n\t} else {\n\t\t// Create and register new stn\n\t\tif err := c.stnHandler.AddStnRule(stnRule.IfaceIdx, &stnRule.IPAddress); err != nil {\n\t\t\treturn errors.Errorf(\"failed to add STN rule %s: %v\", rule.RuleName, err)\n\t\t}\n\t\tc.indexSTNRule(rule, false)\n\n\t\tc.log.Infof(\"STN rule %s configured\", rule.RuleName)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8dab6a8ad879327c8532e19ecec704ed", "score": "0.6515522", "text": "func (r *RewriterAddr) AddRule(rule string) error {\n\tsplittedRule := strings.Split(rule, \":\")\n\tif len(splittedRule) != 3 && len(splittedRule) != 4 {\n\t\treturn ErrInvalidErrorRule\n\t}\n\n\t// Parse source port (PORT[-PORT])\n\tsplittedSrcPort := strings.Split(splittedRule[1], \"-\")\n\tif len(splittedSrcPort) != 1 && len(splittedSrcPort) != 2 {\n\t\treturn ErrInvalidErrorRule\n\t}\n\n\tsrcPortBegin, err := ParseUint16(splittedSrcPort[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Invalid source port %q: %s\", splittedRule[1], err.Error())\n\t}\n\n\tsrcPortEnd := srcPortBegin\n\tif len(splittedSrcPort) == 2 {\n\t\tport, err := ParseUint16(splittedSrcPort[1])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Invalid end source port %q: %s\", splittedRule[1], err.Error())\n\t\t}\n\t\tif srcPortBegin > port {\n\t\t\treturn fmt.Errorf(\"Invalid end source port %q: should be lower than %d\", splittedRule[1], srcPortBegin)\n\t\t}\n\t\tsrcPortEnd = uint16(port)\n\t}\n\n\t// Parse Destination\n\tip := net.ParseIP(splittedRule[2])\n\tif ip == nil {\n\t\treturn fmt.Errorf(\"Invalid destination IP %q\", splittedRule[2])\n\t}\n\tdstPortBegin := srcPortBegin\n\tif len(splittedRule) == 4 {\n\t\tport, err := ParseUint16(splittedRule[3])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Invalid destination port %q: %s\", splittedRule[3], err.Error())\n\t\t}\n\t\tdstPortBegin = port\n\t}\n\n\tfor srcPort, dstPort := srcPortBegin, dstPortBegin; srcPort <= srcPortEnd; srcPort, dstPort = srcPort+1, dstPort+1 {\n\t\tr.Rules[fmt.Sprintf(\"%s:%d\", splittedRule[0], srcPort)] = RewriteDest{\n\t\t\tIP: ip,\n\t\t\tPort: int(dstPort),\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "63ead7bac94462db9bc382eebc1fdc06", "score": "0.6493251", "text": "func (c *Chain) Add(rule Rule) *Chain {\n\tc.lock.Lock()\n\tc.Rules = append(c.Rules, rule)\n\tc.lock.Unlock()\n\treturn c\n}", "title": "" }, { "docid": "22594efc85da72bb6641f97a54d7da5d", "score": "0.64630395", "text": "func (b *BigIP) AddRuleToPolicy(policyName string, rule PolicyRule) error {\n\treturn b.post(rule, uriLtm, uriPolicy, policyName, uriRules)\n}", "title": "" }, { "docid": "8f8a78f7d293758eab630bc0ea9f6408", "score": "0.64299244", "text": "func RuleAdd(rule *Rule) error {\n\treturn pkgHandle.RuleAdd(rule)\n}", "title": "" }, { "docid": "37200915350556ed1ffdf05acf4f9bea", "score": "0.639428", "text": "func (r *regexpTokenizerBuilder) addRule(regex string, action actionFunc) {\n\tr.rules = append(r.rules, rule{regex, action})\n}", "title": "" }, { "docid": "cbf5edab77de0857def13e2428d1bc7e", "score": "0.6385859", "text": "func (r Ruleset) AddRule(t Transition, guards ...Guard) {\n\tfor _, guard := range guards {\n\t\tr[t] = append(r[t], guard)\n\t}\n}", "title": "" }, { "docid": "45be83e4c7eb63cdd19b66cbda52dd4e", "score": "0.63355094", "text": "func (l *Lexer) AddRule(tokenType, regexv string) {\n\t// \"^\" is added as a prefix to all the regular expressions to match at the front\n\tl.lexRules[tokenType] = regexp.MustCompile(\"^\" + regexv)\n\tl.lexRulesKeyOrder = append(l.lexRulesKeyOrder, tokenType)\n}", "title": "" }, { "docid": "7e9649cd5a513afb33ee0168fcdfaeb2", "score": "0.6011851", "text": "func (manager *Manager) InsertRule(rule RejectRule) (ID int, err error) {\n\t//Verify data consistency\n\tif rule.Expr == nil {\n\t\trule.Expr, err = regexp.Compile(rule.Rule)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tquery := \"INSERT INTO \" + RuleTable + \" (name, rule) VALUES ($1, $2) RETURNING id;\"\n\terr = manager.Database.QueryRow(query, rule.Name, rule.Rule).Scan(&ID)\n\treturn\n}", "title": "" }, { "docid": "df7b42d80a1269eaa34d994b16777e5a", "score": "0.59878826", "text": "func (o *CdnCreateScopeRuleResponse) SetRule(v CdnScopeRule) {\n\to.Rule = &v\n}", "title": "" }, { "docid": "37e6fb6357f5b27de0e94bfb54006592", "score": "0.5969489", "text": "func (p *PoliciesService) CreatePolicyRule(id string, rule interface{}) (*Rule, *Response, error) {\n\tu := fmt.Sprintf(\"policies/%v/rules\", id)\n\treq, err := p.client.NewRequest(\"POST\", u, rule)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tnewRule := new(Rule)\n\tresp, err := p.client.Do(req, newRule)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newRule, resp, err\n}", "title": "" }, { "docid": "a8425c4c3832984c09f7b82c0173fcaa", "score": "0.5967384", "text": "func (conn *dbusConn) InsertMatchRule(rule string) (err error) {\n\t// duplicates are not allowed\n\tif conn.dbus != nil && !conn.matchRules[rule] {\n\t\tcall := conn.dbus.BusObject().Call(\"org.freedesktop.DBus.AddMatch\", 0, rule)\n\t\terr = call.Err\n\n\t\t// add rule to the matchRules set\n\t\tif err == nil {\n\t\t\tconn.matchRules[rule] = true\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "03c0318c2b96daa96dd205fb36c5be67", "score": "0.5924742", "text": "func (app *application) putRule(chain string, ipv4 string) error {\n\truleString := createRuleString(ipv4)\n\terr := app.ipt.AppendUnique(app.iptTbl, chain, ruleString...)\n\n\tapp.debLog.Printf(\"Returning from putRule with chain=%s, ipv4=%s\", chain, ipv4)\n\treturn err\n}", "title": "" }, { "docid": "68437fc9d752b00d74934995ee3ce806", "score": "0.59176177", "text": "func CreateRule(c *gophercloud.ServiceClient, policyID string, opts CreateRuleOpts) (r CreateRuleResult) {\n\tb, err := opts.ToRuleCreateMap()\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn\n\t}\n\tresp, err := c.Post(ruleRootURL(c, policyID), b, &r.Body, nil)\n\t_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)\n\treturn\n}", "title": "" }, { "docid": "4f4ecbf540c01e3cd1d247033c4f9605", "score": "0.59070456", "text": "func (c *Client) CreateFirewallRule(ctx context.Context, newFirewallRule FirewallRuleOptions) (*FirewallRule, error) {\n\treturn apiPost[FirewallRule](ctx, c, firewallruleAPIPath, newFirewallRule)\n}", "title": "" }, { "docid": "147fbfcb856806cd0ac2b5bf48bca833", "score": "0.58387184", "text": "func NewCreateRule(sectionId int, etag string, rule *Rule) *CreateFirewallRuleAPI {\n\tthis := new(CreateFirewallRuleAPI)\n\trule.SectionId = sectionId\n\tif rule.PacketType == \"\" {\n\t\trule.PacketType = \"any\"\n\t}\n\tif rule.Action == \"\" {\n\t\trule.Action = Allow\n\t}\n\tif rule.AppliedToList == nil || rule.AppliedToList.Elements == nil || len(rule.AppliedToList.Elements) == 0 {\n\t\trule.AppliedToList = &AppliedToList{\n\t\t\tElements: []Element{\n\t\t\t\t{\n\t\t\t\t\tType: DISTRIBUTED_FIREWALL,\n\t\t\t\t\tValue: string(DISTRIBUTED_FIREWALL),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\n\tthis.BaseAPI = api.NewBaseAPI(http.MethodPost,\n\t\tfmt.Sprintf(\"/api/4.0/firewall/globalroot-0/config/layer3sections/%d/rules\", sectionId),\n\t\trule, new(Rule))\n\tthis.SetRequestHeader(\"If-Match\", etag)\n\n\treturn this\n}", "title": "" }, { "docid": "e831a326e036004bf07234d1cc55a09a", "score": "0.57948387", "text": "func CreateRule(t *testing.T, client *gophercloud.ServiceClient) (*rules.Rule, error) {\n\truleName := tools.RandomString(\"TESTACC-\", 8)\n\tsourceAddress := fmt.Sprintf(\"192.168.1.%d\", tools.RandomInt(1, 100))\n\tsourcePort := strconv.Itoa(tools.RandomInt(1, 100))\n\tdestinationAddress := fmt.Sprintf(\"192.168.2.%d\", tools.RandomInt(1, 100))\n\tdestinationPort := strconv.Itoa(tools.RandomInt(1, 100))\n\n\tt.Logf(\"Attempting to create rule %s with source %s:%s and destination %s:%s\",\n\t\truleName, sourceAddress, sourcePort, destinationAddress, destinationPort)\n\n\tcreateOpts := rules.CreateOpts{\n\t\tName: ruleName,\n\t\tProtocol: rules.ProtocolTCP,\n\t\tAction: \"allow\",\n\t\tSourceIPAddress: sourceAddress,\n\t\tSourcePort: sourcePort,\n\t\tDestinationIPAddress: destinationAddress,\n\t\tDestinationPort: destinationPort,\n\t}\n\n\trule, err := rules.Create(client, createOpts).Extract()\n\tif err != nil {\n\t\treturn rule, err\n\t}\n\n\tt.Logf(\"Rule %s successfully created\", ruleName)\n\n\treturn rule, nil\n}", "title": "" }, { "docid": "5da9eed54355ae47a5a028fb60c5b017", "score": "0.5764006", "text": "func (g *Grammar) PushRule(key string, rules ...string) {\n\top := parse.Strings(rules)\n\tg.Push(key, op)\n}", "title": "" }, { "docid": "050a8ba4d1d5131fa686e43f23f3245b", "score": "0.5747714", "text": "func (c *Client) CreateFirewallRule(ruleOptions *FirewallRuleOptions) (*FirewallRule, error) {\n\trule := new(FirewallRule)\n\t_, err := c.MakeApiRequest(\"POST\", \"/1.0/firewall_rules\", ruleOptions, &rule)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn rule, nil\n}", "title": "" }, { "docid": "80449261d9b623c6c16ea99798769f70", "score": "0.57237923", "text": "func (g *GroupRuleService) Add(groupRuleName string, groupRuleCondition string, groupToAddAction []string) (*GroupRule, *Response, error) {\n\n\tif groupRuleName == \"\" {\n\t\treturn nil, nil, errors.New(\"groupRuleName parameter is required for ADD\")\n\t}\n\tif groupRuleCondition == \"\" {\n\t\treturn nil, nil, errors.New(\"groupRuleCondition parameter is required for ADD\")\n\t}\n\tnewGroupRule := newGroupRule{}\n\tnewGroupRule.Status = groupRuleStatus\n\tnewGroupRule.Type = groupRuleTypeFilter\n\tnewGroupRule.Name = groupRuleName\n\tnewGroupRule.Conditions.Expression.Value = groupRuleCondition\n\tnewGroupRule.Conditions.Expression.Type = groupRuleExpressionType\n\tnewGroupRule.Actions.AssignUserToGroups.GroupIds = groupToAddAction\n\n\tu := fmt.Sprintf(\"groups/rules\")\n\n\treq, err := g.client.NewRequest(\"POST\", u, newGroupRule)\n\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tgrouprule := new(GroupRule)\n\n\tresp, err := g.client.Do(req, grouprule)\n\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn grouprule, resp, err\n}", "title": "" }, { "docid": "7b690525d9c0684208c75f63fa8c2bfd", "score": "0.57184863", "text": "func (o *TestCustomRuleParams) SetRule(rule *models.TestCustomRuleInput) {\n\to.Rule = rule\n}", "title": "" }, { "docid": "11902a2ca3036088fb2d13f70c1aa839", "score": "0.57131493", "text": "func (rs Rules) Add(rule Rule) Rules {\n\tif rs == nil {\n\t\treturn Rules{rule}\n\t}\n\treturn Rules{rs, rule}\n}", "title": "" }, { "docid": "e6160c8da5f81cf3e847a3c8781d7fa4", "score": "0.5709215", "text": "func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error {\n\tline := a.savePolicyLine(ptype, rule)\n\terr := a.db.Create(&line).Error\n\treturn err\n}", "title": "" }, { "docid": "52ceb5c2f227aa6963875b45b6e05ed0", "score": "0.56984353", "text": "func NewRule(ctx *pulumi.Context,\n\tname string, args *RuleArgs, opts ...pulumi.ResourceOption) (*Rule, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.EndpointId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'EndpointId'\")\n\t}\n\tif args.ForwardIps == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ForwardIps'\")\n\t}\n\tif args.RuleName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'RuleName'\")\n\t}\n\tif args.ZoneName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'ZoneName'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Rule\n\terr := ctx.RegisterResource(\"alicloud:pvtz/rule:Rule\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "8354bede8dd8af256680132220d1610d", "score": "0.569573", "text": "func (b *PolicyReportResultApplyConfiguration) WithRule(value string) *PolicyReportResultApplyConfiguration {\n\tb.Rule = &value\n\treturn b\n}", "title": "" }, { "docid": "88edf601d369abff9abd66fd02195827", "score": "0.566125", "text": "func (client *TransparentVlanEndpointClient) AddVnetRules(epInfo *EndpointInfo) error {\n\t// iptables -t mangle -I PREROUTING -j MARK --set-mark <TUNNELING MARK>\n\tmarkOption := fmt.Sprintf(\"MARK --set-mark %d\", tunnelingMark)\n\tif err := iptables.InsertIptableRule(iptables.V4, \"mangle\", \"PREROUTING\", \"\", markOption); err != nil {\n\t\treturn errors.Wrap(err, \"unable to insert iptables rule mark all packets not entering on vlan interface\")\n\t}\n\t// iptables -t mangle -I PREROUTING -j ACCEPT -i <VLAN IF>\n\tmatch := fmt.Sprintf(\"-i %s\", client.vlanIfName)\n\tif err := iptables.InsertIptableRule(iptables.V4, \"mangle\", \"PREROUTING\", match, \"ACCEPT\"); err != nil {\n\t\treturn errors.Wrap(err, \"unable to insert iptables rule accept all incoming from vlan interface\")\n\t}\n\t// Packets that are marked should go to the tunneling table\n\tnewRule := vishnetlink.NewRule()\n\tnewRule.Mark = tunnelingMark\n\tnewRule.Table = tunnelingTable\n\trules, err := vishnetlink.RuleList(vishnetlink.FAMILY_V4)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to get existing ip rule list\")\n\t}\n\t// Check if rule exists already\n\truleExists := false\n\tfor index := range rules {\n\t\tif rules[index].Mark == newRule.Mark {\n\t\t\truleExists = true\n\t\t}\n\t}\n\tif !ruleExists {\n\t\tif err := vishnetlink.RuleAdd(newRule); err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to add rule that forwards packet with mark to tunneling routing table\")\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "dc4c0427436e8f54345ab03e21c0f7a7", "score": "0.5634674", "text": "func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error {\n\tline := savePolicyLine(ptype, rule)\n\terr := a.db.Create(&line).Error\n\treturn err\n}", "title": "" }, { "docid": "38d10bcaad2a23d51137868c410e2339", "score": "0.56116027", "text": "func (a *TAdapter) AddPolicy(sec string, ptype string, rule []string) error {\n\tline := savePolicyLine(ptype, rule)\n\terr := a.db.Create(&line).Error\n\tif err != nil {\n\t\tLog.Error(err)\n\t}\n\treturn err\n}", "title": "" }, { "docid": "9dfb539ee7f613c2e59e96da40f90a36", "score": "0.56104726", "text": "func AddRules(RuleSet []proxy.ReverseProxyRoutingRule) []proxy.ReverseProxyRoutingRule {\n\tnext := true\n\n\tfmt.Print(\"Adding new routing rules to the rules file...\\n\")\n\n\tfor next {\n\t\tfmt.Print(\"\\n\")\n\t\tif NewRule, err := GetRuleToAdd(); err == nil {\n\t\t\tRuleSet = append(RuleSet, *NewRule)\n\t\t} else {\n\t\t\tfmt.Printf(\"Error: Invalid Rule ignored - %s.\\n\", err)\n\t\t}\n\t\tnext = Continue()\n\t}\n\n\tfmt.Print(\"Finished adding new routing rules to the rules file!\\n\\n\")\n\n\treturn RuleSet\n}", "title": "" }, { "docid": "52cc12d84565324748bd6bcaaa2b14ad", "score": "0.55926263", "text": "func (a *GormAdapter) AddPolicy(sec string, ptype string, rule []string) error {\n\tline := savePolicyLine(ptype, rule)\n\tdo := a.o.Save(&line)\n\treturn do.Error\n}", "title": "" }, { "docid": "0ff831d1d19fe789f0b286e0141fcde0", "score": "0.5567975", "text": "func (c *Client) CreateRule(ctx context.Context, params *CreateRuleInput, optFns ...func(*Options)) (*CreateRuleOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateRuleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateRule\", params, optFns, c.addOperationCreateRuleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateRuleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "0ff831d1d19fe789f0b286e0141fcde0", "score": "0.5567975", "text": "func (c *Client) CreateRule(ctx context.Context, params *CreateRuleInput, optFns ...func(*Options)) (*CreateRuleOutput, error) {\n\tif params == nil {\n\t\tparams = &CreateRuleInput{}\n\t}\n\n\tresult, metadata, err := c.invokeOperation(ctx, \"CreateRule\", params, optFns, c.addOperationCreateRuleMiddlewares)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tout := result.(*CreateRuleOutput)\n\tout.ResultMetadata = metadata\n\treturn out, nil\n}", "title": "" }, { "docid": "170b8f2757a2e81fd0fc9b61add527bb", "score": "0.5543874", "text": "func (m *PolicyResource) CreatePolicyRule(ctx context.Context, policyId string, body PolicyRule) (*PolicyRule, *Response, error) {\n\turl := fmt.Sprintf(\"/api/v1/policies/%v/rules\", policyId)\n\n\trq := m.client.CloneRequestExecutor()\n\n\treq, err := rq.WithAccept(\"application/json\").WithContentType(\"application/json\").NewRequest(\"POST\", url, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policyRule *PolicyRule\n\n\tresp, err := rq.Do(ctx, req, &policyRule)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policyRule, resp, nil\n}", "title": "" }, { "docid": "ef61e12a1230bd7320b0937da12aee42", "score": "0.5534305", "text": "func (i *iptablesRunner) AddLoopbackRule(addr netip.Addr) error {\n\tif err := i.getIPTByAddr(addr).Insert(\"filter\", \"ts-input\", 1, \"-i\", \"lo\", \"-s\", addr.String(), \"-j\", \"ACCEPT\"); err != nil {\n\t\treturn fmt.Errorf(\"adding loopback allow rule for %q: %w\", addr, err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "de33271a2e7c577a97a54e117daa198d", "score": "0.5490896", "text": "func (h *Connection) CreateRule(name string, conditions []RuleConditions, actions []RuleActions) error {\n\t// Error checking\n\tif strings.Trim(name, \" \") == \"\" {\n\t\treturn errors.New(\"Name must not be empty\")\n\t}\n\n\tbodyStr := fmt.Sprintf(\"{\\\"name\\\": \\\"%s\\\"\", name)\n\n\tif len(conditions) > 0 && (strings.Trim(conditions[0].Address, \" \") != \"\" || strings.Trim(conditions[0].Operator, \" \") != \"\" || strings.Trim(conditions[0].Value, \" \") != \"\") {\n\t\tbodyStr += fmt.Sprintf(\", \\\"conditions\\\": %s\", h.formatStruct(conditions))\n\t}\n\n\tif len(actions) > 0 && (strings.Trim(actions[0].Address, \" \") != \"\" || strings.Trim(actions[0].Method, \" \") != \"\") {\n\t\tbodyStr += fmt.Sprintf(\", \\\"actions\\\": %s\", h.formatStruct(actions))\n\t}\n\n\tbodyStr += \"}\"\n\n\treqBody := strings.NewReader(bodyStr)\n\treq, err := http.NewRequest(\"POST\", fmt.Sprintf(\"%s/rules\", h.baseURL), reqBody)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = h.execute(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "abb0723b2504db4a21e82b842e999503", "score": "0.5474503", "text": "func (plugin *Plugin) addTproxyRouterRule(proto iptables.Protocol) error {\n\thandle, err := netlink.NewHandle()\n\tif err != nil {\n\t\tlog.Errorf(\"Creating a new handle failed: %v\", err)\n\t\treturn err\n\t}\n\n\trule := netlink.NewRule()\n\trule.Family = plugin.getRuleFamily(proto)\n\trule.Mark = tproxyRouteMarker\n\trule.Table = tproxyRouteTable\n\n\tif err := handle.RuleAdd(rule); err != nil {\n\t\tlog.Errorf(\"Add IP rule %v failed : %v\", rule, err)\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e74f3d58a4d19823bb6e994cd7d4da7c", "score": "0.54670006", "text": "func CreateRule(t *testing.T, client *gophercloud.ServiceClient) (*rules.Rule, error) {\n\truleName := tools.RandomString(\"TESTACC-\", 8)\n\tsourceAddress := fmt.Sprintf(\"192.168.1.%d\", tools.RandomInt(1, 100))\n\tsourcePort := strconv.Itoa(tools.RandomInt(1, 100))\n\tdestinationAddress := fmt.Sprintf(\"192.168.2.%d\", tools.RandomInt(1, 100))\n\tdestinationPort := strconv.Itoa(tools.RandomInt(1, 100))\n\n\tt.Logf(\"Attempting to create rule %s with source %s:%s and destination %s:%s\",\n\t\truleName, sourceAddress, sourcePort, destinationAddress, destinationPort)\n\n\tcreateOpts := rules.CreateOpts{\n\t\tName: ruleName,\n\t\tProtocol: rules.ProtocolTCP,\n\t\tAction: rules.ActionAllow,\n\t\tSourceIPAddress: sourceAddress,\n\t\tSourcePort: sourcePort,\n\t\tDestinationIPAddress: destinationAddress,\n\t\tDestinationPort: destinationPort,\n\t}\n\n\trule, err := rules.Create(client, createOpts).Extract()\n\tif err != nil {\n\t\treturn rule, err\n\t}\n\n\tt.Logf(\"Rule %s successfully created\", ruleName)\n\n\tth.AssertEquals(t, rule.Name, ruleName)\n\tth.AssertEquals(t, rule.Protocol, string(rules.ProtocolTCP))\n\tth.AssertEquals(t, rule.Action, string(rules.ActionAllow))\n\tth.AssertEquals(t, rule.SourceIPAddress, sourceAddress)\n\tth.AssertEquals(t, rule.SourcePort, sourcePort)\n\tth.AssertEquals(t, rule.DestinationIPAddress, destinationAddress)\n\tth.AssertEquals(t, rule.DestinationPort, destinationPort)\n\n\treturn rule, nil\n}", "title": "" }, { "docid": "434ab11ec7418c73dc33ad689d971a7e", "score": "0.5452984", "text": "func (pi *PolicyInfo) AddRuleInfos(rules []*RuleInfo) {\n\tif !RulesSuccesfuly(rules) {\n\t\tpi.success = false\n\t}\n\n\tpi.Rules = append(pi.Rules, rules...)\n}", "title": "" }, { "docid": "a89ec133683ec030cfb8eda342d8cccb", "score": "0.54526776", "text": "func Register(rule Rule) {\n\tRuleList = append(RuleList, rule)\n}", "title": "" }, { "docid": "47d20ea9f4419ee87aa5581db1db705d", "score": "0.5444837", "text": "func (c *Chain) Insert(rule Rule) *Chain {\n\tc.lock.Lock()\n\tc.Rules = append([]Rule{rule}, c.Rules...)\n\tc.lock.Unlock()\n\treturn c\n}", "title": "" }, { "docid": "e46e4c7f02c61f317b73dac8d4e66925", "score": "0.54390514", "text": "func (c *NetworkFirewallPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error) {\n\treturn c.internalClient.PatchRule(ctx, req, opts...)\n}", "title": "" }, { "docid": "bb85ee1d2672bde88936a95fde6408f3", "score": "0.54194623", "text": "func (b *UpdateRequestSpecApplyConfiguration) WithRule(value string) *UpdateRequestSpecApplyConfiguration {\n\tb.Rule = &value\n\treturn b\n}", "title": "" }, { "docid": "ea55a31ec0a74e8942f2c5e1691da8ff", "score": "0.5390227", "text": "func (e *Engine) Register(rule Rule) {\n\te.Rules = append(e.Rules, rule)\n}", "title": "" }, { "docid": "3318cb83b0a6874293eca6fa64c1c145", "score": "0.53780234", "text": "func (t *rules) AddRules(body string, dryRun bool) (*rulesResponse, error) {\n\tres, err := t.httpClient.AddRules(func() string {\n\t\tif dryRun {\n\t\t\treturn \"?dry_run=true\"\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}(), body)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer res.Body.Close()\n\tdata := new(rulesResponse)\n\n\terr = json.NewDecoder(res.Body).Decode(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "84581fce842c38e07603b6469978027e", "score": "0.5374494", "text": "func (c *Operator) handleRuleAdd(obj interface{}) {\n\to, ok := c.getObject(obj)\n\tif ok {\n\t\tlevel.Debug(c.logger).Log(\"msg\", \"PrometheusRule added\")\n\t\tc.triggerByCounter.WithLabelValues(monitoringv1.PrometheusRuleKind, \"add\").Inc()\n\n\t\tc.enqueueForNamespace(o.GetNamespace())\n\t}\n}", "title": "" }, { "docid": "9ade3cfd010552562dd3890286898817", "score": "0.5311953", "text": "func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error {\n\treturn nil\n}", "title": "" }, { "docid": "9a9694368886e7aeebe4efff35919dc1", "score": "0.5310209", "text": "func NewRule(rawRule RawRule) Rule {\n\tvar portsList = filters.PortRules{\n\t\tWhitelistedPorts: filters.PortRanges{},\n\t\tBlacklistedPorts: filters.PortRanges{},\n\t}\n\n\tvar ipsList = filters.IPRules{\n\t\tWhitelistedIPs: filters.IPRanges{},\n\t\tBlacklistedIPs: filters.IPRanges{},\n\t}\n\n\tipsList.ParseRules(rawRule.Whitelist.IPs, rawRule.Blacklist.IPs)\n\tportsList.ParseRules(rawRule.Whitelist.Ports, rawRule.Blacklist.Ports)\n\n\tparsedIPProtocol, err := rawRule.IPProtocol.ParseList()\n\tif err != nil {\n\t\tlogging.Errors.Printf(\"failed to parse rule '%s' : %s\", rawRule.Metadata.ID, err)\n\t\treturn Rule{}\n\t}\n\n\trule := Rule{\n\t\tTags: rawRule.Tags,\n\t\tIPProtocol: parsedIPProtocol,\n\t\tID: rawRule.Metadata.ID,\n\t\tLayer: rawRule.Layer,\n\t\tPorts: portsList,\n\t\tIPs: ipsList,\n\t\tMetadata: rawRule.Metadata,\n\t\tAdditional: rawRule.Additional,\n\t}\n\n\treturn rule\n}", "title": "" }, { "docid": "15f4f27ee0bc627f5915f2891eb65699", "score": "0.5297319", "text": "func NewRule() RuleBuilder {\n\treturn &ruleBuilder{}\n}", "title": "" }, { "docid": "fb33c5a0d596c45b19d0ea848b1bfd28", "score": "0.5291516", "text": "func (c *NetworkFirewallPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleNetworkFirewallPolicyRequest, opts ...gax.CallOption) (*Operation, error) {\n\treturn c.internalClient.RemoveRule(ctx, req, opts...)\n}", "title": "" }, { "docid": "a9ec3b7b4d64e62ebd5b037bccc74934", "score": "0.5290887", "text": "func (i *Inflector) AddPluralizationRule(pattern *regexp.Regexp, replacement string) {\n\ti.PluralizationRules = append(i.PluralizationRules, &PluralizationRule{pattern, replacement})\n}", "title": "" }, { "docid": "765d4b35dde1db6511db3fca9193353d", "score": "0.5280625", "text": "func WriteRuleLine(buf *bytes.Buffer, chainName string, words ...string) {\n\tif len(words) == 0 {\n\t\treturn\n\t}\n\tbuf.WriteString(\"-A \")\n\tbuf.WriteString(chainName)\n\tbuf.WriteByte(' ')\n\tWriteLine(buf, words...)\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.5277507", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.5277507", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.5277507", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.5277507", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "a4d9797b6dac7a5cb6f32fc5ee55feda", "score": "0.5277507", "text": "func (in *Rule) DeepCopy() *Rule {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(Rule)\n\tin.DeepCopyInto(out)\n\treturn out\n}", "title": "" }, { "docid": "39b1ca23e366709528a814849cef200a", "score": "0.52763486", "text": "func (s *ScalewayAPI) PostSecurityGroupRule(SecurityGroupID string, rules ScalewayNewSecurityGroupRule) error {\n\tresp, err := s.PostResponse(s.computeAPI, fmt.Sprintf(\"security_groups/%s/rules\", SecurityGroupID), rules)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\t_, err = s.handleHTTPError([]int{http.StatusCreated}, resp)\n\treturn err\n}", "title": "" }, { "docid": "7b7162a7389511c31fd51ea27371920d", "score": "0.527497", "text": "func (s *RedisStore) SaveRule(r *Rule) error {\n\treturn s.save(\"rules\", ruleKey(r.Code), r)\n}", "title": "" }, { "docid": "8005f52b8bd0fc6662d0e78de599cb30", "score": "0.52424425", "text": "func (a CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error {\n\treturn nil\n}", "title": "" }, { "docid": "77ca0534ca653afb5b5a732a3e103a63", "score": "0.52376556", "text": "func InsertMatchRule(url string , headerValue string ,serviceName string , port int32, routeSpec *IngressRouteSpec) {\n\tmatchString := fmt.Sprintf(\"Host(`%s`) && Headers (`%s`,`%s`)\",url,HEADER_KEY,headerValue)\n\tservices := []Service{{LoadBalancerSpec{Name: serviceName, Port: port}}}\n\troute := Route{Match: matchString,Kind: KIND,Services: services }\n\trouteSpec.Routes = append(routeSpec.Routes, route)\n}", "title": "" }, { "docid": "c48d59ee4373d6ebc3c038d706faddbc", "score": "0.52320784", "text": "func (c *Client) ensureRule(table string, chain string, ruleSpec []string) error {\n\texist, err := c.ipt.Exists(table, chain, ruleSpec...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error checking if rule %v exists in table %s chain %s: %v\", ruleSpec, table, chain, err)\n\t}\n\tif exist {\n\t\treturn nil\n\t}\n\tif err := c.ipt.Append(table, chain, ruleSpec...); err != nil {\n\t\treturn fmt.Errorf(\"error appending rule %v to table %s chain %s: %v\", ruleSpec, table, chain, err)\n\t}\n\tklog.V(2).Infof(\"Appended rule %v to table %s chain %s\", ruleSpec, table, chain)\n\treturn nil\n}", "title": "" }, { "docid": "cab2026afef85ee802174332a829653f", "score": "0.5231367", "text": "func (c *RuleBuilder) NewRule(configBuilder ConfigBuilder, categories []string) (*Rule, error) {\n\tpurpose, err := c.newPurpose(configBuilder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcheck, err := c.newCheck(configBuilder)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newRule(\n\t\tc.id,\n\t\tcategories,\n\t\tpurpose,\n\t\tcheck,\n\t), nil\n}", "title": "" }, { "docid": "c4fa2c818d41be26f8699031820cf624", "score": "0.52215815", "text": "func (a *CasbinGoroseAdapter) AddPolicy(sec string, ptype string, rule []string) error {\n\tvar cr = a.builCasbinRule(ptype, rule)\n\t// insert to db\n\tvar db = a.Engin.NewOrm()\n\taff,err := db.Insert(&cr)\n\tif err!=nil {\n\t\treturn err\n\t}\n\tif aff==0 {\n\t\treturn errors.New(\"insert db error\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "32e90bb27e2329eeca1d0d3b6845c7e8", "score": "0.5219126", "text": "func (s *taskSchedulerServiceImpl) AddSkipTaskRule(ctx context.Context, req *AddSkipTaskRuleRequest) (*AddSkipTaskRuleResponse, error) {\n\tuser, err := s.GetEditor(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trule := &skip_tasks.Rule{\n\t\tAddedBy: user,\n\t\tTaskSpecPatterns: req.TaskSpecPatterns,\n\t\tCommits: req.Commits,\n\t\tDescription: req.Description,\n\t\tName: req.Name,\n\t}\n\tif len(rule.Commits) == 2 {\n\t\trangeRule, err := skip_tasks.NewCommitRangeRule(context.Background(), rule.Name, rule.AddedBy, rule.Description, rule.TaskSpecPatterns, rule.Commits[0], rule.Commits[1], s.repos)\n\t\tif err != nil {\n\t\t\tsklog.Error(err)\n\t\t\treturn nil, twirp.InvalidArgumentError(\"commits\", \"Failed to create commit range rule\")\n\t\t}\n\t\trule = rangeRule\n\t}\n\tif err := s.skipTasks.AddRule(ctx, rule, s.repos); err != nil {\n\t\tsklog.Error(err)\n\t\treturn nil, twirp.InternalError(\"Failed to add skip task rule\")\n\t}\n\treturn &AddSkipTaskRuleResponse{\n\t\tRules: s.getSkipTaskRules(),\n\t}, nil\n}", "title": "" }, { "docid": "90758a9183e215af041af4eccfb0d065", "score": "0.5213698", "text": "func (c *CasbinAdapterService) AddPolicy(sec string, ptype string, rule []string) error {\n\treturn nil\n}", "title": "" }, { "docid": "19ee3c67d08bb268aaa0a1285bd158f8", "score": "0.5213412", "text": "func UpdateRule(c *gophercloud.ServiceClient, policyID string, ruleID string, opts UpdateRuleOptsBuilder) (r UpdateRuleResult) {\n\tb, err := opts.ToRuleUpdateMap()\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn\n\t}\n\tresp, err := c.Put(ruleResourceURL(c, policyID, ruleID), b, &r.Body, &gophercloud.RequestOpts{\n\t\tOkCodes: []int{200, 201, 202},\n\t})\n\t_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)\n\treturn\n}", "title": "" }, { "docid": "f9d271c1637f04dbf658a5dbf49cf3a9", "score": "0.5196632", "text": "func (o *TestCustomRuleParams) WithRule(rule *models.TestCustomRuleInput) *TestCustomRuleParams {\n\to.SetRule(rule)\n\treturn o\n}", "title": "" }, { "docid": "4d90a5896f012a89611de019060a4623", "score": "0.5174296", "text": "func RemoveRule(c *gophercloud.ServiceClient, id, ruleID string) (r RemoveRuleResult) {\n\tb := map[string]interface{}{\"firewall_rule_id\": ruleID}\n\tresp, err := c.Put(removeURL(c, id), b, &r.Body, &gophercloud.RequestOpts{\n\t\tOkCodes: []int{200},\n\t})\n\t_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)\n\treturn\n}", "title": "" }, { "docid": "cbb141a55d38e95896eea8324fdc028a", "score": "0.51718104", "text": "func CreateRule(os *OpenStack, rule RuleCreateOpts) (*rules.SecGroupRule, error) {\n\tname, opts, err := rule.ToCreateOpts()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Detect the security group\n\tgroup, err := GetGroup(os, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\topts.SecGroupID = group.ID\n\n\trt := rules.Create(os.Network, opts)\n\tif rt.Err != nil {\n\t\treturn nil, rt.Err\n\t}\n\treturn rt.Extract()\n}", "title": "" }, { "docid": "69d3d4baa8f5519932389aa6960ad781", "score": "0.5110182", "text": "func (m *TiFlashReplicaManagerCtx) SetPlacementRule(ctx context.Context, rule placement.TiFlashRule) error {\n\tr := encodeRule(m.codec, &rule)\n\treturn m.doSetPlacementRule(ctx, r)\n}", "title": "" }, { "docid": "75fd2501af31a0362c6b3ac7e0b6c8c5", "score": "0.509602", "text": "func AddRemoteSubnetPolicy(network *hcn.HostComputeNetwork, settings *hcn.RemoteSubnetRoutePolicySetting) error {\n\tjson, err := json.Marshal(settings)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshall remote subnet route policy settings: %v\", err)\n\t}\n\n\tnetwork.AddPolicy(hcn.PolicyNetworkRequest{\n\t\tPolicies: []hcn.NetworkPolicy{{\n\t\t\tType: hcn.RemoteSubnetRoute,\n\t\t\tSettings: json,\n\t\t}},\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "13e0b032c2ac05347fae167658b08c83", "score": "0.5071137", "text": "func (s *ScalewayAPI) PutSecurityGroupRule(rules ScalewayNewSecurityGroupRule, securityGroupID, RuleID string) error {\n\tresp, err := s.PutResponse(s.computeAPI, fmt.Sprintf(\"security_groups/%s/rules/%s\", securityGroupID, RuleID), rules)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\t_, err = s.handleHTTPError([]int{http.StatusOK}, resp)\n\treturn err\n}", "title": "" }, { "docid": "cc82d2aeeb09a883fb02a7d323ff89f3", "score": "0.50566137", "text": "func AddPolicy(hnsEndpointID string, policy Policy) error {\n\tif err := validatePolicy(policy); err != nil {\n\t\treturn err\n\t}\n\n\t// TCP is the default protocol and is the only supported one anyway.\n\tpolicy.Protocol = TCP\n\n\tpolicySetting := hcn.L4ProxyPolicySetting{\n\t\tProxyType: hcn.ProxyTypeWFP,\n\t\tPort: strconv.Itoa(int(policy.ProxyPort)),\n\t\tUserSID: policy.UserSID,\n\t\tCompartmentID: policy.CompartmentID,\n\t\tFilterTuple: hcn.FiveTuple{\n\t\t\tLocalAddresses: formatIP(policy.LocalAddr),\n\t\t\tRemoteAddresses: formatIP(policy.RemoteAddr),\n\t\t\tProtocols: strconv.Itoa(int(policy.Protocol)),\n\t\t\tPriority: uint16(policy.Priority),\n\t\t},\n\t}\n\n\tpolicyJSON, err := json.Marshal(policySetting)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tendpointPolicy := hcn.EndpointPolicy{\n\t\tType: hcn.L4Proxy,\n\t\tSettings: policyJSON,\n\t}\n\n\trequest := hcn.PolicyEndpointRequest{\n\t\tPolicies: []hcn.EndpointPolicy{endpointPolicy},\n\t}\n\n\tendpoint, err := hcn.GetEndpointByID(hnsEndpointID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn endpoint.ApplyPolicy(hcn.RequestTypeAdd, request)\n}", "title": "" }, { "docid": "24005a03a9c7b68d69b0bfedcdad9be5", "score": "0.50555015", "text": "func add(mgr manager.Manager, r reconcile.Reconciler) error {\n\t// Create a new controller\n\tc, err := controller.New(\"webapplicationfirewallrule-controller\", mgr, controller.Options{Reconciler: r})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Watch for changes to WebApplicationFirewallRule\n\terr = c.Watch(&source.Kind{Type: &crdsv1alpha1.WebApplicationFirewallRule{}}, &handler.EnqueueRequestForObject{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgeneratedClient := kubernetes.NewForConfigOrDie(mgr.GetConfig())\n\tgeneratedInformers := kubeinformers.NewSharedInformerFactory(generatedClient, time.Minute)\n\terr = mgr.Add(manager.RunnableFunc(func(s <-chan struct{}) error {\n\t\tgeneratedInformers.Start(s)\n\t\t<-s\n\t\treturn nil\n\t}))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cc248d96856a04348d99634d3993e7f7", "score": "0.50549746", "text": "func AddDiscountRuleHook(hookPoint boil.HookPoint, discountRuleHook DiscountRuleHook) {\n\tswitch hookPoint {\n\tcase boil.BeforeInsertHook:\n\t\tdiscountRuleBeforeInsertHooks = append(discountRuleBeforeInsertHooks, discountRuleHook)\n\tcase boil.BeforeUpdateHook:\n\t\tdiscountRuleBeforeUpdateHooks = append(discountRuleBeforeUpdateHooks, discountRuleHook)\n\tcase boil.BeforeDeleteHook:\n\t\tdiscountRuleBeforeDeleteHooks = append(discountRuleBeforeDeleteHooks, discountRuleHook)\n\tcase boil.BeforeUpsertHook:\n\t\tdiscountRuleBeforeUpsertHooks = append(discountRuleBeforeUpsertHooks, discountRuleHook)\n\tcase boil.AfterInsertHook:\n\t\tdiscountRuleAfterInsertHooks = append(discountRuleAfterInsertHooks, discountRuleHook)\n\tcase boil.AfterSelectHook:\n\t\tdiscountRuleAfterSelectHooks = append(discountRuleAfterSelectHooks, discountRuleHook)\n\tcase boil.AfterUpdateHook:\n\t\tdiscountRuleAfterUpdateHooks = append(discountRuleAfterUpdateHooks, discountRuleHook)\n\tcase boil.AfterDeleteHook:\n\t\tdiscountRuleAfterDeleteHooks = append(discountRuleAfterDeleteHooks, discountRuleHook)\n\tcase boil.AfterUpsertHook:\n\t\tdiscountRuleAfterUpsertHooks = append(discountRuleAfterUpsertHooks, discountRuleHook)\n\t}\n}", "title": "" } ]
9100b1608dd13a4015e3d176ec21f591
NewTLSConfig returns a tls.Config using the given ceClient cert, ceClient key, and CA certificate. If none are appropriate, a nil tls.Config is returned.
[ { "docid": "a62e45fc1c8737549e078c2c21b5b1a7", "score": "0.7558114", "text": "func NewTLSConfig(clientCert, clientKey, caCert string, unsafeSsl bool) (*tls.Config, error) {\n\treturn NewTLSConfigWithPassword(clientCert, clientKey, \"\", caCert, unsafeSsl)\n}", "title": "" } ]
[ { "docid": "ee0857d2d04d40c281ecc63f321421bd", "score": "0.7786085", "text": "func NewTLSConfig(clientCertFile, clientKeyFile, caCertFile string) (*tls.Config, error) {\n\ttlsConfig := tls.Config{}\n\n\t// Load client cert\n\tcert, err := tls.LoadX509KeyPair(clientCertFile, clientKeyFile)\n\tif err != nil {\n\t\treturn &tlsConfig, err\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{cert}\n\n\t// Load CA cert\n\tcaCert, err := ioutil.ReadFile(caCertFile)\n\tif err != nil {\n\t\treturn &tlsConfig, err\n\t}\n\tcaCertPool := x509.NewCertPool()\n\tcaCertPool.AppendCertsFromPEM(caCert)\n\ttlsConfig.RootCAs = caCertPool\n\n\ttlsConfig.BuildNameToCertificate()\n\treturn &tlsConfig, err\n}", "title": "" }, { "docid": "918de32c9897644a5175f50b66ddee85", "score": "0.7404768", "text": "func NewTLSConfig(cert, key, caCert string, insecureTr, skipVerify bool, endpoints []string) *TLSConfig {\n\treturn &TLSConfig{\n\t\tcert: cert,\n\t\tkey: key,\n\t\tcaCert: caCert,\n\t\tinsecureTr: insecureTr,\n\t\tskipVerify: skipVerify,\n\t\tendpoints: endpoints,\n\t}\n}", "title": "" }, { "docid": "854accea710c8f11c6e83e18c4d301e3", "score": "0.729411", "text": "func (c *ClientTLS) CreateTLSConfig() (*tls.Config, error) {\n\tif c == nil {\n\t\treturn nil, nil\n\t}\n\n\tvar err error\n\tcaPool := x509.NewCertPool()\n\tclientAuth := tls.NoClientCert\n\tif c.CA != \"\" {\n\t\tvar ca []byte\n\t\tif _, errCA := os.Stat(c.CA); errCA == nil {\n\t\t\tca, err = ioutil.ReadFile(c.CA)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to read CA. %w\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tca = []byte(c.CA)\n\t\t}\n\n\t\tif !caPool.AppendCertsFromPEM(ca) {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse CA\")\n\t\t}\n\n\t\tif c.CAOptional {\n\t\t\tclientAuth = tls.VerifyClientCertIfGiven\n\t\t} else {\n\t\t\tclientAuth = tls.RequireAndVerifyClientCert\n\t\t}\n\t}\n\n\tcert := tls.Certificate{}\n\t_, errKeyIsFile := os.Stat(c.Key)\n\n\tif !c.InsecureSkipVerify && (len(c.Cert) == 0 || len(c.Key) == 0) {\n\t\treturn nil, fmt.Errorf(\"TLS Certificate or Key file must be set when TLS configuration is created\")\n\t}\n\n\tif len(c.Cert) > 0 && len(c.Key) > 0 {\n\t\tif _, errCertIsFile := os.Stat(c.Cert); errCertIsFile == nil {\n\t\t\tif errKeyIsFile == nil {\n\t\t\t\tcert, err = tls.LoadX509KeyPair(c.Cert, c.Key)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to load TLS keypair: %w\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, fmt.Errorf(\"tls cert is a file, but tls key is not\")\n\t\t\t}\n\t\t} else {\n\t\t\tif errKeyIsFile != nil {\n\t\t\t\tcert, err = tls.X509KeyPair([]byte(c.Cert), []byte(c.Key))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to load TLS keypair: %w\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, fmt.Errorf(\"TLS key is a file, but tls cert is not\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tRootCAs: caPool,\n\t\tInsecureSkipVerify: c.InsecureSkipVerify, // nolint:gosec\n\t\tClientAuth: clientAuth,\n\t}, nil\n}", "title": "" }, { "docid": "d5e6b82af4e829213c28a19e11fb7dc4", "score": "0.71576077", "text": "func (clientTLS *ClientTLS) CreateTLSConfig() (*tls.Config, error) {\n\tvar err error\n\tif clientTLS == nil {\n\t\tlog.Warnf(\"clientTLS is nil\")\n\t\treturn nil, nil\n\t}\n\tcaPool := x509.NewCertPool()\n\tif clientTLS.CA != \"\" {\n\t\tvar ca []byte\n\t\tif _, errCA := os.Stat(clientTLS.CA); errCA == nil {\n\t\t\tca, err = ioutil.ReadFile(clientTLS.CA)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Failed to read CA. %s\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tca = []byte(clientTLS.CA)\n\t\t}\n\t\tcaPool.AppendCertsFromPEM(ca)\n\t}\n\n\tcert := tls.Certificate{}\n\t_, errKeyIsFile := os.Stat(clientTLS.Key)\n\n\tif _, errCertIsFile := os.Stat(clientTLS.Cert); errCertIsFile == nil {\n\t\tif errKeyIsFile == nil {\n\t\t\tcert, err = tls.LoadX509KeyPair(clientTLS.Cert, clientTLS.Key)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Failed to load TLS keypair: %v\", err)\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"tls cert is a file, but tls key is not\")\n\t\t}\n\t} else {\n\t\tif errKeyIsFile != nil {\n\t\t\tcert, err = tls.X509KeyPair([]byte(clientTLS.Cert), []byte(clientTLS.Key))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Failed to load TLS keypair: %v\", err)\n\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"tls key is a file, but tls cert is not\")\n\t\t}\n\t}\n\n\tTLSConfig := &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tRootCAs: caPool,\n\t\tInsecureSkipVerify: clientTLS.InsecureSkipVerify,\n\t}\n\treturn TLSConfig, nil\n}", "title": "" }, { "docid": "85b7f0c31a20e7f66a9b6f0cb17457e3", "score": "0.710734", "text": "func NewTLSConfig(pemFiles PemFiles) (*tls.Config, error) {\n\ttlsConfig := tls.Config{}\n\n\t// Load client cert\n\tcert, err := tls.LoadX509KeyPair(pemFiles.ClientCert, pemFiles.ClientKey)\n\tif err != nil {\n\t\treturn &tlsConfig, err\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{cert}\n\n\t// Load CA cert\n\tcaCert, err := ioutil.ReadFile(pemFiles.CACert)\n\tif err != nil {\n\t\treturn &tlsConfig, err\n\t}\n\tcaCertPool := x509.NewCertPool()\n\tcaCertPool.AppendCertsFromPEM(caCert)\n\ttlsConfig.RootCAs = caCertPool\n\n\ttlsConfig.BuildNameToCertificate()\n\treturn &tlsConfig, err\n}", "title": "" }, { "docid": "422479e6f1535dad7bacd0d2e75b051e", "score": "0.70778406", "text": "func (clientTLS *ClientTLS) CreateTLSConfig(ctx context.Context) (*tls.Config, error) {\n\tif clientTLS == nil {\n\t\tlog.FromContext(ctx).Warnf(\"clientTLS is nil\")\n\t\treturn nil, nil\n\t}\n\n\tcaPool := x509.NewCertPool()\n\tclientAuth := tls.NoClientCert\n\tif clientTLS.CA != \"\" {\n\t\tvar ca []byte\n\t\tif _, errCA := os.Stat(clientTLS.CA); errCA == nil {\n\t\t\tvar err error\n\t\t\tca, err = ioutil.ReadFile(clientTLS.CA)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to read CA. %s\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tca = []byte(clientTLS.CA)\n\t\t}\n\n\t\tif !caPool.AppendCertsFromPEM(ca) {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse CA\")\n\t\t}\n\n\t\tif clientTLS.CAOptional {\n\t\t\tclientAuth = tls.VerifyClientCertIfGiven\n\t\t} else {\n\t\t\tclientAuth = tls.RequireAndVerifyClientCert\n\t\t}\n\t}\n\n\tif !clientTLS.InsecureSkipVerify && (len(clientTLS.Cert) == 0 || len(clientTLS.Key) == 0) {\n\t\treturn nil, fmt.Errorf(\"TLS Certificate or Key file must be set when TLS configuration is created\")\n\t}\n\n\tcert := tls.Certificate{}\n\t_, errKeyIsFile := os.Stat(clientTLS.Key)\n\n\tif len(clientTLS.Cert) > 0 && len(clientTLS.Key) > 0 {\n\t\tvar err error\n\t\tif _, errCertIsFile := os.Stat(clientTLS.Cert); errCertIsFile == nil {\n\t\t\tif errKeyIsFile == nil {\n\t\t\t\tcert, err = tls.LoadX509KeyPair(clientTLS.Cert, clientTLS.Key)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to load TLS keypair: %v\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, fmt.Errorf(\"TLS cert is a file, but tls key is not\")\n\t\t\t}\n\t\t} else {\n\t\t\tif errKeyIsFile != nil {\n\t\t\t\tcert, err = tls.X509KeyPair([]byte(clientTLS.Cert), []byte(clientTLS.Key))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"failed to load TLS keypair: %v\", err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, fmt.Errorf(\"TLS key is a file, but tls cert is not\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tRootCAs: caPool,\n\t\tInsecureSkipVerify: clientTLS.InsecureSkipVerify,\n\t\tClientAuth: clientAuth,\n\t}, nil\n}", "title": "" }, { "docid": "263d6e209db960d6e7532f3e54cb4420", "score": "0.7047862", "text": "func NewConfig(caPath, certPath, keyPath string, clientAuth bool) (*tls.Config, error) {\n\tcaCertBytes, err := os.ReadFile(caPath)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"fail to read CA cert file %v\", caPath)\n\t}\n\n\tcert, err := tls.LoadX509KeyPair(certPath, keyPath)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"fail to load certificate %v\", certPath)\n\t}\n\n\tpool := x509.NewCertPool()\n\tpool.AppendCertsFromPEM(caCertBytes)\n\n\tconfig := &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tClientCAs: pool,\n\t\tRootCAs: pool,\n\t}\n\n\tif clientAuth {\n\t\tconfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t}\n\n\tconfig.Rand = rand.Reader\n\treturn config, nil\n}", "title": "" }, { "docid": "a37fe653c70764b78a22a5eff4376c56", "score": "0.7023694", "text": "func NewTLSConfig(cafile string) (*tls.Config, error) {\n\t// Import trusted certificates from CAfile.pem.\n\n\tcert, err := ioutil.ReadFile(cafile)\n\tif err != nil {\n\t\tlog.Errorf(\"mqtt: couldn't load cafile: %s\", err)\n\t\treturn nil, err\n\t}\n\n\tcertpool := x509.NewCertPool()\n\tcertpool.AppendCertsFromPEM(cert)\n\n\t// Create tls.Config with desired tls properties\n\treturn &tls.Config{\n\t\t// RootCAs = certs used to verify server cert.\n\t\tRootCAs: certpool,\n\t}, nil\n}", "title": "" }, { "docid": "b59eae2ef6d139642811b12cc3684d03", "score": "0.7001295", "text": "func NewClientTLSConfig(\n\tcontainer appname.Container,\n\texternalClientTLSConfig ExternalClientTLSConfig,\n) (*tls.Config, error) {\n\topts := []TLSOption{}\n\tswitch t := strings.ToLower(strings.TrimSpace(externalClientTLSConfig.Use)); t {\n\tcase \"systemandlocal\":\n\t\topts = append(opts, WithSystemCertPool())\n\t\tfallthrough\n\tcase \"local\":\n\t\trootCertFilePaths := externalClientTLSConfig.RootCertFilePaths\n\t\tif len(rootCertFilePaths) == 0 {\n\t\t\trootCertFilePaths = []string{\n\t\t\t\tfilepath.Join(\n\t\t\t\t\tcontainer.ConfigDirPath(),\n\t\t\t\t\t\"tls\",\n\t\t\t\t\t\"root.pem\",\n\t\t\t\t),\n\t\t\t}\n\t\t}\n\t\topts = append(opts, WithRootCertFilePaths(rootCertFilePaths...))\n\t\treturn NewClientTLS(opts...)\n\tcase \"\", \"system\":\n\t\treturn NewClientTLS(WithSystemCertPool())\n\tcase \"false\":\n\t\treturn nil, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown tls.use: %q\", t)\n\t}\n}", "title": "" }, { "docid": "dca660da6450330296b2aad5547bc90a", "score": "0.6949835", "text": "func TLSConfig(tlsConfig *tls.Config, caCertPath string, clientCertPath string, clientKeyPath string) (*tls.Config, error) {\n\tcerts, err := CertPool()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif caCertPath != \"\" && certs != nil {\n\t\tif err := AugmentCertPoolFromCAFile(certs, caCertPath); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tvar clientCerts []tls.Certificate\n\n\tif clientCertPath != \"\" && clientKeyPath != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(clientCertPath, clientKeyPath)\n\t\tif err != nil {\n\t\t\treturn nil, errors.WithMessage(err,\n\t\t\t\tfmt.Sprintf(\"Client cert/key could not be loaded from %s/%s\",\n\t\t\t\t\tclientKeyPath, clientCertPath))\n\t\t}\n\t\tclientCerts = append(clientCerts, cert)\n\t\tlog.Infof(\"Configured TLS client cert in %s with key %s\", clientCertPath, clientKeyPath)\n\t}\n\n\ttlsConfig.Certificates = clientCerts\n\ttlsConfig.RootCAs = certs\n\ttlsConfig.BuildNameToCertificate()\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "6f974e1d071aca4a6b264168c94f89ba", "score": "0.6916215", "text": "func NewTLSConfig(config *schema.TLS, rootCAs *x509.CertPool) (tlsConfig *tls.Config) {\n\tvar certificates []tls.Certificate\n\n\tif config.PrivateKey != nil && config.CertificateChain.HasCertificates() {\n\t\tcertificates = []tls.Certificate{\n\t\t\t{\n\t\t\t\tCertificate: config.CertificateChain.CertificatesRaw(),\n\t\t\t\tLeaf: config.CertificateChain.Leaf(),\n\t\t\t\tPrivateKey: config.PrivateKey,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn &tls.Config{\n\t\tServerName: config.ServerName,\n\t\tInsecureSkipVerify: config.SkipVerify, //nolint:gosec // Informed choice by user. Off by default.\n\t\tMinVersion: config.MinimumVersion.MinVersion(),\n\t\tMaxVersion: config.MaximumVersion.MaxVersion(),\n\t\tRootCAs: rootCAs,\n\t\tCertificates: certificates,\n\t}\n}", "title": "" }, { "docid": "06a01b6ff0cf40497692d511fa6aecda", "score": "0.6905833", "text": "func NewTLSConfig(certstore string) *tls.Config {\n\n\t// Import root CA\n\tcertpool := x509.NewCertPool()\n\tpemCerts, err := ioutil.ReadFile(certstore)\n\tif err == nil {\n\t\tcertpool.AppendCertsFromPEM(pemCerts)\n\t}\n\n\treturn &tls.Config{\n\t\tRootCAs: certpool,\n\t\tClientAuth: tls.NoClientCert,\n\t\tClientCAs: nil,\n\t\tInsecureSkipVerify: true,\n\t}\n}", "title": "" }, { "docid": "ffb39fec4fd3058c06accb30ee1f14e5", "score": "0.671676", "text": "func newTLSConfig(certPath, keyPath, caPath, serverName string, insecure bool) (*tls.Config, error) {\n\tif certPath != \"\" && keyPath == \"\" || certPath == \"\" && keyPath != \"\" {\n\t\treturn nil, errors.New(\"either both cert and key or none must be provided\")\n\t}\n\tvar certificates []tls.Certificate\n\tif certPath != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(certPath, keyPath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not load TLS cert: %w\", err)\n\t\t}\n\t\tcertificates = append(certificates, cert)\n\t}\n\troots, err := loadRoots(caPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &tls.Config{\n\t\tCertificates: certificates,\n\t\tRootCAs: roots,\n\t\tInsecureSkipVerify: insecure,\n\t\tServerName: serverName,\n\t}, nil\n}", "title": "" }, { "docid": "07e32301dc2d8735eb69862885894fe0", "score": "0.6658243", "text": "func NewTLSConfigWithPassword(clientCert, clientKey, clientKeyPassword, caCert string, unsafeSsl bool) (*tls.Config, error) {\n\tconfig := CreateTLSClientConfig(unsafeSsl)\n\n\tif clientCert != \"\" && clientKey != \"\" {\n\t\tkey := []byte(clientKey)\n\t\tif clientKeyPassword != \"\" {\n\t\t\tvar err error\n\t\t\tkey, err = decryptClientKey(clientKey, clientKeyPassword)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error decrypt X509Key: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\tcert, err := tls.X509KeyPair([]byte(clientCert), key)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parse X509KeyPair: %w\", err)\n\t\t}\n\t\tconfig.Certificates = []tls.Certificate{cert}\n\t}\n\n\tif caCert != \"\" {\n\t\tconfig.RootCAs.AppendCertsFromPEM([]byte(caCert))\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "880181d94b79eb3214ccb58aca74af10", "score": "0.66421664", "text": "func ConfigClientTLS(cacert, chain, key string) *tls.Config {\n\ttlsClientConfig := &tls.Config{\n\t\tRootCAs: x509.NewCertPool(),\n\t}\n\n\tcaCert, err := ioutil.ReadFile(cacert)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif ok := tlsClientConfig.RootCAs.AppendCertsFromPEM(caCert); !ok {\n\t\tlog.Fatal(fmt.Errorf(\"failed to append CA certificate\"))\n\t}\n\n\tcert, err := tls.LoadX509KeyPair(chain, key)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ttlsClientConfig.Certificates = []tls.Certificate{cert}\n\treturn tlsClientConfig\n}", "title": "" }, { "docid": "ea06a08a9bed9ca24ae0cf0722efbecc", "score": "0.65809464", "text": "func NewClientTLS(certFile, keyFile, caFile string, insecureSkipVerify bool) (*tls.Config, error) {\n\treturn newTLSConfigCommon(certFile, keyFile, caFile, insecureSkipVerify)\n}", "title": "" }, { "docid": "599c88aae470aa322c10bac65de2d06e", "score": "0.65609443", "text": "func (c *Config) TLSConfig() *tls.Config {\n\tcfg := &tls.Config{}\n\n\tif !c.UseTLS {\n\t\treturn nil\n\t}\n\tcertPath := c.CertPath\n\tkeyPath := c.KeyPath\n\n\tif certPath == \"\" || keyPath == \"\" {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error setting up TLS configuration. Either cert or \"+\n\t\t\t\t\"key path not specified.\",\n\t\t)\n\t\treturn nil\n\t}\n\n\tcertContent, err := ioutil.ReadFile(certPath)\n\tif err != nil {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error getting cert content: %v\",\n\t\t\terr,\n\t\t)\n\t\treturn nil\n\t}\n\n\tkeyContent, err := ioutil.ReadFile(keyPath)\n\tif err != nil {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error getting key content: %v\",\n\t\t\terr,\n\t\t)\n\t\treturn nil\n\t}\n\n\tkp, err := tls.X509KeyPair(certContent, keyContent)\n\tif err != nil {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error setting up TLS cert: %v.\",\n\t\t\terr,\n\t\t)\n\t\treturn nil\n\t}\n\n\tcfg.MinVersion = tls.VersionTLS10\n\tcfg.InsecureSkipVerify = false\n\tcfg.Certificates = []tls.Certificate{kp}\n\treturn cfg\n}", "title": "" }, { "docid": "599c88aae470aa322c10bac65de2d06e", "score": "0.65609443", "text": "func (c *Config) TLSConfig() *tls.Config {\n\tcfg := &tls.Config{}\n\n\tif !c.UseTLS {\n\t\treturn nil\n\t}\n\tcertPath := c.CertPath\n\tkeyPath := c.KeyPath\n\n\tif certPath == \"\" || keyPath == \"\" {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error setting up TLS configuration. Either cert or \"+\n\t\t\t\t\"key path not specified.\",\n\t\t)\n\t\treturn nil\n\t}\n\n\tcertContent, err := ioutil.ReadFile(certPath)\n\tif err != nil {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error getting cert content: %v\",\n\t\t\terr,\n\t\t)\n\t\treturn nil\n\t}\n\n\tkeyContent, err := ioutil.ReadFile(keyPath)\n\tif err != nil {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error getting key content: %v\",\n\t\t\terr,\n\t\t)\n\t\treturn nil\n\t}\n\n\tkp, err := tls.X509KeyPair(certContent, keyContent)\n\tif err != nil {\n\t\tfmt.Fprintf(\n\t\t\tos.Stderr,\n\t\t\t\"error setting up TLS cert: %v.\",\n\t\t\terr,\n\t\t)\n\t\treturn nil\n\t}\n\n\tcfg.MinVersion = tls.VersionTLS10\n\tcfg.InsecureSkipVerify = false\n\tcfg.Certificates = []tls.Certificate{kp}\n\treturn cfg\n}", "title": "" }, { "docid": "4770d70dd1ac1ee65cfe5e693258db57", "score": "0.65276384", "text": "func GetTLSConfig() *tls.Config {\n\tcert := C.pactffi_get_tls_ca_certificate()\n\tdefer libRustFree(cert)\n\n\tgoCert := C.GoString(cert)\n\tcertPool := x509.NewCertPool()\n\tcertPool.AppendCertsFromPEM([]byte(goCert))\n\n\treturn &tls.Config{\n\t\tRootCAs: certPool,\n\t}\n}", "title": "" }, { "docid": "0be99b267c69d857dc90c76941f3a1af", "score": "0.65005386", "text": "func GetTLSConfig(opts ...Options) (*tls.Config, error) {\n\tclientOpts := createOptions(opts...)\n\tif clientOpts.TLS == nil {\n\t\t// #nosec\n\t\treturn &tls.Config{}, nil\n\t}\n\n\ttlsOpts := clientOpts.TLS\n\n\t// #nosec\n\tconfig := &tls.Config{\n\t\tInsecureSkipVerify: tlsOpts.InsecureSkipVerify,\n\t\tServerName: tlsOpts.ServerName,\n\t}\n\n\tif len(tlsOpts.CACertificate) > 0 {\n\t\tcaPool := x509.NewCertPool()\n\t\tok := caPool.AppendCertsFromPEM([]byte(tlsOpts.CACertificate))\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"failed to parse TLS CA PEM certificate\")\n\t\t}\n\t\tconfig.RootCAs = caPool\n\t}\n\n\tif len(tlsOpts.ClientCertificate) > 0 && len(tlsOpts.ClientKey) > 0 {\n\t\tcert, err := tls.X509KeyPair([]byte(tlsOpts.ClientCertificate), []byte(tlsOpts.ClientKey))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconfig.Certificates = []tls.Certificate{cert}\n\t}\n\n\tif tlsOpts.MinVersion > 0 {\n\t\tconfig.MinVersion = tlsOpts.MinVersion\n\t}\n\n\tif tlsOpts.MaxVersion > 0 {\n\t\tconfig.MaxVersion = tlsOpts.MaxVersion\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "c4ae00c819c1d71cf761615abb30c858", "score": "0.6478813", "text": "func TLSClientConfig(info *Info) (*tls.Config, error) {\n\tkeypair := info.KeyPair()\n\tca := info.CA()\n\n\tconfig := InitTLSConfig()\n\tconfig.Certificates = []tls.Certificate{\n\t\tkeypair,\n\t}\n\tconfig.RootCAs = x509.NewCertPool()\n\tif ca != nil {\n\t\tconfig.RootCAs.AddCert(ca)\n\t}\n\n\t// Since the same cluster keypair is used both as server and as client\n\t// cert, let's add it to the CA pool to make it trusted.\n\tcert, err := x509.ParseCertificate(keypair.Certificate[0])\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\tcert.IsCA = true\n\tcert.KeyUsage = x509.KeyUsageCertSign\n\tconfig.RootCAs.AddCert(cert)\n\n\tif cert.DNSNames != nil {\n\t\tconfig.ServerName = cert.DNSNames[0]\n\t}\n\treturn config, nil\n}", "title": "" }, { "docid": "54abc878dabcddd549bc3994bf2672d2", "score": "0.6433633", "text": "func (cfg *ClientConfig) GetTLSConfig() (*tls.Config, error) {\n\tif cfg.CertPath != \"\" && cfg.KeyPath != \"\" && cfg.CAPath != \"\" {\n\t\tclientCert, err := tls.LoadX509KeyPair(cfg.CertPath, cfg.KeyPath)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"failed to load TLS certificate %s,%s\", cfg.CertPath, cfg.KeyPath)\n\t\t}\n\n\t\tvar caCertPool *x509.CertPool\n\t\tcaCert, err := ioutil.ReadFile(cfg.CAPath)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"error loading ca cert: %s\", cfg.CAPath)\n\t\t}\n\t\tcaCertPool = x509.NewCertPool()\n\t\tcaCertPool.AppendCertsFromPEM(caCert)\n\t\tif len(clientCert.Certificate) > 0 && caCertPool != nil {\n\t\t\treturn &tls.Config{\n\t\t\t\tInsecureSkipVerify: true,\n\t\t\t\tCertificates: []tls.Certificate{clientCert},\n\t\t\t\tRootCAs: caCertPool,\n\t\t\t}, nil\n\t\t}\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "dc480c06ac5740f2d53062853fb193e7", "score": "0.6388528", "text": "func NewTLS(caFile, certFile, keyFile string) (*tls.Config, error) {\n\ttlsCfg := &tls.Config{ServerName: \"GoAlert\"}\n\n\tcert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttlsCfg.Certificates = append(tlsCfg.Certificates, cert)\n\n\tif caFile != \"\" {\n\t\t// If CA file is specified, require client auth\n\t\tcaBytes, err := os.ReadFile(caFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tpool := x509.NewCertPool()\n\t\tif !pool.AppendCertsFromPEM(caBytes) {\n\t\t\treturn nil, errors.New(\"failed to append CA certs from PEM\")\n\t\t}\n\n\t\ttlsCfg.ClientAuth = tls.RequireAndVerifyClientCert\n\t\ttlsCfg.RootCAs = pool\n\t\ttlsCfg.ClientCAs = pool\n\t}\n\n\treturn tlsCfg, nil\n}", "title": "" }, { "docid": "06a52fdad8acea62ecc61754986d9a2a", "score": "0.6349412", "text": "func (c *Client) configTLS() (tc *tls.Config, tlsErr error) {\n\tif err := checkTLSFile(c.CaPemPath); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := checkTLSFile(c.ClientKeyPath); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := checkTLSFile(c.ClientPemPath); err != nil {\n\t\treturn nil, err\n\t}\n\ttlsConfig := new(tls.Config)\n\ttlsConfig.Renegotiation = tls.RenegotiateNever\n\ttlsConfig.InsecureSkipVerify = c.InsecureSkipVerify\n\tcaPem, err := ioutil.ReadFile(c.CaPemPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcertPool := x509.NewCertPool()\n\tcertPool.AppendCertsFromPEM(caPem)\n\ttlsConfig.RootCAs = certPool\n\n\tclientPem, err := tls.LoadX509KeyPair(c.ClientPemPath, c.ClientKeyPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{clientPem}\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "69690637fd740e94b93d1f02248cb7a5", "score": "0.6349191", "text": "func getTLSConfig() *tls.Config {\n\t// Import trusted certificates from CAfile.pem.\n\t// Alternatively, manually add CA certificates to\n\t// default openssl CA bundle.\n\tcertpool := x509.NewCertPool()\n\tpemCerts, err := ioutil.ReadFile(\"/etc/cooktroller/ca.cert\")\n\tif err == nil {\n\t\tcertpool.AppendCertsFromPEM(pemCerts)\n\t}\n\n\t// Import client certificate/key pair\n\tcert, err := tls.LoadX509KeyPair(\"/etc/cooktroller/cert.pem\", \"/etc/cooktroller/key.pem\")\n\tif err != nil {\n\t\tfmt.Println(\"Could not load X509 Key pair\")\n\t\treturn nil\n\t}\n\n\t// Just to print out the client certificate..\n\tcert.Leaf, err = x509.ParseCertificate(cert.Certificate[0])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t//log.Println(cert.Leaf)\n\n\t// Create tls.Config with desired tls properties\n\treturn &tls.Config{\n\t\t// RootCAs = certs used to verify server cert.\n\t\tRootCAs: certpool,\n\t\t// ClientAuth = whether to request cert from server.\n\t\t// Since the server is set up for SSL, this happens\n\t\t// anyways.\n\t\tClientAuth: tls.NoClientCert,\n\t\t// ClientCAs = certs used to validate client cert.\n\t\tClientCAs: nil,\n\t\t// InsecureSkipVerify = verify that cert contents\n\t\t// match server. IP matches what is in cert etc.\n\t\tInsecureSkipVerify: true,\n\t\t// Certificates = list of certs client sends to server.\n\t\tCertificates: []tls.Certificate{cert},\n\t}\n}", "title": "" }, { "docid": "5a38bcbf8fa881237f168b1b4f822de6", "score": "0.6339864", "text": "func (ca *CertificateRequest) TLSConfigWithClientCA(clientCAPool *x509.CertPool, verifyClient bool) (*tls.Config, error) {\n\ttlsCert, err := ca.TLSCert()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar tlsConfig tls.Config\n\ttlsConfig.MinVersion = tls.VersionTLS12\n\ttlsConfig.Certificates = append(tlsConfig.Certificates, tlsCert)\n\ttlsConfig.ClientCAs = clientCAPool\n\n\tif verifyClient {\n\t\ttlsConfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t}\n\n\treturn &tlsConfig, nil\n}", "title": "" }, { "docid": "48e1e83e56656be29b6761c88486d6cb", "score": "0.6296683", "text": "func clientTLSConfig(cert string, serverName string) (*tls.Config, error) {\n\n\tclientCAPool := x509.NewCertPool()\n\n\tcertBytes, err := ioutil.ReadFile(cert)\n\tif err == nil {\n\t\tif loadPEMCert(clientCAPool, certBytes) {\n\t\t\ttlsConfig := &tls.Config{\n\t\t\t\tRootCAs: clientCAPool,\n\t\t\t\tInsecureSkipVerify: true,\n\t\t\t\tServerName: serverName,\n\t\t\t}\n\n\t\t\treturn tlsConfig, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"Error loading CA cert %s: %s\", cert, err)\n}", "title": "" }, { "docid": "76eb558bfc7557c0b0f97561f4c8b900", "score": "0.6294463", "text": "func createTlsConfiguration(certFile *string, keyFile *string, caFile *string, verifySsl *bool) (t *tls.Config) {\n\tif *certFile != \"\" && *keyFile != \"\" && *caFile != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(*certFile, *keyFile)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tcaCert, err := ioutil.ReadFile(*caFile)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tcaCertPool := x509.NewCertPool()\n\t\tcaCertPool.AppendCertsFromPEM(caCert)\n\n\t\tt = &tls.Config{\n\t\t\tCertificates: []tls.Certificate{cert},\n\t\t\tRootCAs: caCertPool,\n\t\t\tInsecureSkipVerify: *verifySsl,\n\t\t}\n\t}\n\t// will be nil by default if nothing is provided\n\treturn t\n}", "title": "" }, { "docid": "3dc5296c0c2182f8ace89d51c8d9bd33", "score": "0.6256052", "text": "func GetTLSConfig(CAFile string) (*tls.Config, error) {\n\tcaCert, err := ioutil.ReadFile(CAFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcaCertPool := x509.NewCertPool()\n\tif ok := caCertPool.AppendCertsFromPEM(caCert); !ok {\n\t\treturn nil, errors.New(\"Failed to add CA to pool\")\n\t}\n\n\ttlsConfig := &tls.Config{\n\t\tRootCAs: caCertPool,\n\t}\n\ttlsConfig.BuildNameToCertificate()\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "cd826a01fdf391ed1c92727032bd7c5b", "score": "0.62392557", "text": "func PrepareTLSConfig(caFile, certFile, keyFile string) (*tls.Config, error) {\n\tconfig := new(tls.Config)\n\n\tif len(certFile) != 0 || len(keyFile) != 0 {\n\t\tif len(certFile) == 0 || len(keyFile) == 0 {\n\t\t\treturn nil, errors.New(\"cert file and key file must be both specified\")\n\t\t}\n\n\t\tcert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"TLS file load error: %v\", err)\n\t\t}\n\n\t\tconfig.Certificates = []tls.Certificate{cert}\n\t}\n\n\tif len(caFile) != 0 {\n\t\tca, err := ioutil.ReadFile(caFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"TLS CA file load error: %v\", err)\n\t\t}\n\n\t\tcp := x509.NewCertPool()\n\t\tif !cp.AppendCertsFromPEM(ca) {\n\t\t\treturn nil, fmt.Errorf(\"TLS credentials: failed to append ca\")\n\t\t}\n\n\t\tconfig.RootCAs = cp\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "6871c1613674a9ba2cac8121bd94c8ff", "score": "0.6237003", "text": "func (c *SessionContext) ClientTLSConfig(clusterName ...string) (*tls.Config, error) {\n\tvar certPool *x509.CertPool\n\tif len(clusterName) == 0 {\n\t\tcertAuthorities, err := c.parent.proxyClient.GetCertAuthorities(services.HostCA, false)\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t\tcertPool, err = services.CertPoolFromCertAuthorities(certAuthorities)\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t} else {\n\t\tcertAuthority, err := c.parent.proxyClient.GetCertAuthority(services.CertAuthID{\n\t\t\tType: services.HostCA,\n\t\t\tDomainName: clusterName[0],\n\t\t}, false)\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t\tcertPool, err = services.CertPool(certAuthority)\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t}\n\n\ttlsConfig := utils.TLSConfig()\n\ttlsCert, err := tls.X509KeyPair(c.sess.GetTLSCert(), c.sess.GetPriv())\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"failed to parse TLS cert and key\")\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{tlsCert}\n\ttlsConfig.RootCAs = certPool\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "725f819a683a23a02049873cb21f35c5", "score": "0.6235435", "text": "func newTLSConfigCommon(certFile, keyFile, caFile string, insecureSkipVerify bool) (*tls.Config, error) {\n\tconfig := tls.Config{\n\t\tInsecureSkipVerify: insecureSkipVerify,\n\t}\n\n\tif certFile != \"\" && keyFile != \"\" {\n\t\tcert, err := tlsutil.CertFromFilePair(certFile, keyFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconfig.Certificates = []tls.Certificate{*cert}\n\t}\n\n\tif !insecureSkipVerify && caFile != \"\" {\n\t\tcp, err := tlsutil.CertPoolFromFile(caFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconfig.RootCAs = cp\n\t}\n\n\treturn &config, nil\n}", "title": "" }, { "docid": "cb9b71067fee49f80920c0601ff6a67e", "score": "0.61921555", "text": "func ClientVerifyingTLSConfig(certFile string) (*tls.Config, error) {\n\t// Test cert file\n\tvar cert *x509.Certificate\n\tif certBytes, err := ioutil.ReadFile(certFile); err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read cert file: %v\", err)\n\t} else if block, _ := pem.Decode(certBytes); block == nil {\n\t\treturn nil, fmt.Errorf(\"could not get cert pem block: %v\", err)\n\t} else if cert, err = x509.ParseCertificate(block.Bytes); err != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse cert: %v\", err)\n\t}\n\tcas := x509.NewCertPool()\n\tcas.AddCert(cert)\n\treturn &tls.Config{\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t\tClientCAs: cas,\n\t}, nil\n}", "title": "" }, { "docid": "926d10bf4fa414f04fab530a423324f6", "score": "0.61827165", "text": "func NewTLSConfig(fipsMode bool) *tls.Config {\n\tlog.WithField(\"BuiltWithBoringCrypto\", BuiltWithBoringCrypto).\n\t\tWithField(\"fipsMode\", fipsMode).\n\t\tDebug(\"creating a TLS config\")\n\n\tcfg := &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tMaxVersion: tls.VersionTLS13,\n\t}\n\n\tif fipsMode {\n\t\tcfg.CurvePreferences = []tls.CurveID{tls.CurveP384, tls.CurveP256}\n\t\tcfg.CipherSuites = tls12CiphersFIPS\n\t\t// Our certificate for FIPS validation not mention validation for v1.3.\n\t\tcfg.MaxVersion = tls.VersionTLS12\n\t\tcfg.Renegotiation = tls.RenegotiateNever\n\t} else {\n\t\tcfg.CipherSuites = tls12Ciphers\n\t\tcfg.CipherSuites = append(cfg.CipherSuites, tls13Ciphers...)\n\t}\n\treturn cfg\n}", "title": "" }, { "docid": "ebe6a7573005314db80c26e697a56bdc", "score": "0.6180487", "text": "func NewTLSConfig(certPath string) (*tls.Config, error) {\n\ttcg := new(tlsConfigX509Getter)\n\treturn newTLSConfig(tcg, certPath)\n}", "title": "" }, { "docid": "ca3e97e782e8d20ae75fe2e3d826f5fe", "score": "0.6169553", "text": "func GetTLSConfig(name string) *tls.Config {\n\tcertFile := name + \".crt\"\n\tkeyFile := name + \".key\"\n\n\tfmt.Printf(\"Loading keypair key=%s, cert=%s\\n\", keyFile, certFile)\n\n\tcert, err := tls.LoadX509KeyPair(name+\".crt\", name+\".key\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcaBytes, err := ioutil.ReadFile(\"ca.crt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tpool := x509.NewCertPool()\n\tif !pool.AppendCertsFromPEM(caBytes) {\n\t\tpanic(err)\n\t}\n\n\tconfig := &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tClientCAs: pool,\n\t\tRootCAs: pool,\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t}\n\n\treturn config\n}", "title": "" }, { "docid": "699cc43a9e9c02b4a27d1807b3916af7", "score": "0.6166546", "text": "func (f TLSFiles) TLSConfig() (*tls.Config, error) {\n\tcert, err := tls.LoadX509KeyPair(f.ClientCert, f.ClientKey)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"tls.LoadX509KeyPair: %s\", err)\n\t}\n\n\tcaCert, err := ioutil.ReadFile(f.RootCert)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcaCertPool := x509.NewCertPool()\n\tcaCertPool.AppendCertsFromPEM(caCert)\n\n\ttlsConfig := &tls.Config{\n\t\tRootCAs: caCertPool,\n\t\tClientCAs: caCertPool,\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t\tCertificates: []tls.Certificate{cert},\n\t}\n\ttlsConfig.BuildNameToCertificate()\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "f3a872abc799c902238c276cedbbe667", "score": "0.61617655", "text": "func generateTLSConfig(certPath, keyPath, caCertPath string) (*tls.Config, error) {\n\t// Load certificate\n\tcertificate, err := tls.LoadX509KeyPair(certPath, keyPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create certificate pool\n\tcertPool := x509.NewCertPool()\n\trootCert, err := ioutil.ReadFile(caCertPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Append cert to cert pool\n\tif ok := certPool.AppendCertsFromPEM(rootCert); !ok {\n\t\treturn nil, errCertNotAppended\n\t}\n\n\treturn &tls.Config{\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t\tCertificates: []tls.Certificate{certificate},\n\t\tClientCAs: certPool,\n\t}, nil\n}", "title": "" }, { "docid": "07e9599e2778b1bbb3cfe76bd5a1a0c5", "score": "0.6154486", "text": "func (info TLSInfo) ClientConfig() (cfg *tls.Config, err error) {\n\tif !info.Empty() {\n\t\tcfg, err = info.baseConfig()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tcfg = &tls.Config{}\n\t}\n\n\tif info.CAFile != \"\" {\n\t\tcfg.RootCAs, err = newCertPool(info.CAFile)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "aba5c8aadff106c5e2b7a22158bb79c7", "score": "0.61503226", "text": "func tlsConfig(c *cli.Context) (*tls.Config, error) {\n\tvar tlsConfig *tls.Config\n\tvar err error\n\tcaCertFlag := c.GlobalString(\"tlscacert\")\n\tcertFlag := c.GlobalString(\"tlscert\")\n\tkeyFlag := c.GlobalString(\"tlskey\")\n\n\tif c.GlobalBool(\"tls\") || c.GlobalBool(\"tlsverify\") {\n\t\ttlsConfig = &tls.Config{\n\t\t\tInsecureSkipVerify: !c.GlobalBool(\"tlsverify\"),\n\t\t}\n\n\t\t// Load CA cert\n\t\tif caCertFlag != \"\" {\n\t\t\tvar caCert []byte\n\n\t\t\tif strings.HasPrefix(caCertFlag, \"/\") {\n\t\t\t\tcaCert, err = ioutil.ReadFile(caCertFlag)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcaCert = []byte(caCertFlag)\n\t\t\t}\n\n\t\t\tcaCertPool := x509.NewCertPool()\n\t\t\tcaCertPool.AppendCertsFromPEM(caCert)\n\n\t\t\ttlsConfig.RootCAs = caCertPool\n\t\t}\n\n\t\t// Load client certificate\n\t\tif certFlag != \"\" && keyFlag != \"\" {\n\t\t\tvar cert tls.Certificate\n\n\t\t\tif strings.HasPrefix(certFlag, \"/\") && strings.HasPrefix(keyFlag, \"/\") {\n\t\t\t\tcert, err = tls.LoadX509KeyPair(certFlag, keyFlag)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcert, err = tls.X509KeyPair([]byte(certFlag), []byte(keyFlag))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\ttlsConfig.Certificates = []tls.Certificate{cert}\n\t\t}\n\t}\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "aba5c8aadff106c5e2b7a22158bb79c7", "score": "0.61503226", "text": "func tlsConfig(c *cli.Context) (*tls.Config, error) {\n\tvar tlsConfig *tls.Config\n\tvar err error\n\tcaCertFlag := c.GlobalString(\"tlscacert\")\n\tcertFlag := c.GlobalString(\"tlscert\")\n\tkeyFlag := c.GlobalString(\"tlskey\")\n\n\tif c.GlobalBool(\"tls\") || c.GlobalBool(\"tlsverify\") {\n\t\ttlsConfig = &tls.Config{\n\t\t\tInsecureSkipVerify: !c.GlobalBool(\"tlsverify\"),\n\t\t}\n\n\t\t// Load CA cert\n\t\tif caCertFlag != \"\" {\n\t\t\tvar caCert []byte\n\n\t\t\tif strings.HasPrefix(caCertFlag, \"/\") {\n\t\t\t\tcaCert, err = ioutil.ReadFile(caCertFlag)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcaCert = []byte(caCertFlag)\n\t\t\t}\n\n\t\t\tcaCertPool := x509.NewCertPool()\n\t\t\tcaCertPool.AppendCertsFromPEM(caCert)\n\n\t\t\ttlsConfig.RootCAs = caCertPool\n\t\t}\n\n\t\t// Load client certificate\n\t\tif certFlag != \"\" && keyFlag != \"\" {\n\t\t\tvar cert tls.Certificate\n\n\t\t\tif strings.HasPrefix(certFlag, \"/\") && strings.HasPrefix(keyFlag, \"/\") {\n\t\t\t\tcert, err = tls.LoadX509KeyPair(certFlag, keyFlag)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcert, err = tls.X509KeyPair([]byte(certFlag), []byte(keyFlag))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\ttlsConfig.Certificates = []tls.Certificate{cert}\n\t\t}\n\t}\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "a661781972779d0396f34ed465e4bd39", "score": "0.6135361", "text": "func (c *ClusterConfiguration) ClientTLSConfig(src TrustedSource) (*tls.Config, error) {\n\tpool, err := c.trustRoot(src)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn makeConfig(func(config *tls.Config) {\n\t\tconfig.RootCAs = pool\n\t}), nil\n}", "title": "" }, { "docid": "0310320ac8fbfb5b5acdfe91593d6106", "score": "0.6135269", "text": "func tlsConfig(certFile, keyFile string) (*tls.Config, error) {\n\tif certFile == \"\" || keyFile == \"\" {\n\t\tcertFile, keyFile = defaultCertFile, defaultKeyFile\n\t}\n\n\tcert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tls.Config{Certificates: []tls.Certificate{cert}}, nil\n}", "title": "" }, { "docid": "2482013c48eb4bfaf7b1ee37d94d2a70", "score": "0.61236143", "text": "func GetTLSConfig() *tls.Config {\n\tcert, err := tls.LoadX509KeyPair(GetCertificatePaths())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t}\n}", "title": "" }, { "docid": "243f11020f79dbafce76b6fb5bb58d72", "score": "0.61045873", "text": "func GetTlsConfig(opts Options) (*tls.Config, error) {\n\n\trootCAs, err := x509.SystemCertPool()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif rootCAs == nil {\n\t\trootCAs = x509.NewCertPool()\n\t}\n\n\tfor name, cert := range opts.Certificates {\n\t\tif strings.HasPrefix(name, \"extra_ca_certs/\") || strings.HasPrefix(name, \"extra_ca_cert_\") {\n\t\t\tif ok := rootCAs.AppendCertsFromPEM(cert); !ok {\n\t\t\t\tlog.Warningf(\"Could not load extra ca cert file: %s. Skipping.\", name)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &tls.Config{RootCAs: rootCAs}, nil\n}", "title": "" }, { "docid": "241b8de94399efa7a3dc85b0b81c53c6", "score": "0.6076155", "text": "func LoadTLSConfig(config *Config) (*TLSConfig, error) {\n\tif !config.IsEnabled() {\n\t\treturn nil, nil\n\t}\n\n\tfail := multierror.Errors{}\n\tlogFail := func(es ...error) {\n\t\tfor _, e := range es {\n\t\t\tif e != nil {\n\t\t\t\tfail = append(fail, e)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar cipherSuites []uint16\n\tfor _, suite := range config.CipherSuites {\n\t\tcipherSuites = append(cipherSuites, uint16(suite))\n\t}\n\n\tvar curves []tls.CurveID\n\tfor _, id := range config.CurveTypes {\n\t\tcurves = append(curves, tls.CurveID(id))\n\t}\n\n\tcert, err := LoadCertificate(&config.Certificate)\n\tlogFail(err)\n\n\tcas, errs := LoadCertificateAuthorities(config.CAs)\n\tlogFail(errs...)\n\n\t// fail, if any error occurred when loading certificate files\n\tif err = fail.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar certs []tls.Certificate\n\tif cert != nil {\n\t\tcerts = []tls.Certificate{*cert}\n\t}\n\n\t// return config if no error occurred\n\treturn &TLSConfig{\n\t\tVersions: config.Versions,\n\t\tVerification: config.VerificationMode,\n\t\tCertificates: certs,\n\t\tRootCAs: cas,\n\t\tCipherSuites: cipherSuites,\n\t\tCurvePreferences: curves,\n\t\tRenegotiation: tls.RenegotiationSupport(config.Renegotiation),\n\t}, nil\n}", "title": "" }, { "docid": "19e569eb7f32047a3024eaf3beb8f8b3", "score": "0.606547", "text": "func TLSConfig(certFile, keyFile string) (*tls.Config, error) {\n\tcert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tRand: rand.Reader,\n\t}, nil\n}", "title": "" }, { "docid": "52e3dedaf4b89ba18b517220fc18c4e0", "score": "0.604961", "text": "func tlsConfig() *tls.Config {\n\tcrt, err := ioutil.ReadFile(certPublicKeyPath)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tkey, err := ioutil.ReadFile(certPrivateKeyPath)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tcert, err := tls.X509KeyPair(crt, key)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn &tls.Config{\n\t\tCertificates: []tls.Certificate{cert},\n\t\tServerName: serverName,\n\t}\n}", "title": "" }, { "docid": "3d75f6ef145ed3f40fecc805e100baf9", "score": "0.6043475", "text": "func clientTLSConfig() *tls.Config {\n\ttlsConfig := &tls.Config{\n\t\tClientSessionCache: tls.NewLRUClientSessionCache(1000),\n\t\tSuppressServerNameInClientHandshake: true,\n\t}\n\t// Note - we need to suppress the sending of the ServerName in the client\n\t// handshake to make host-spoofing work with Fastly. If the client Hello\n\t// includes a server name, Fastly checks to make sure that this matches the\n\t// Host header in the HTTP request and if they don't match, it returns a\n\t// 400 Bad Request error.\n\tif *rootCA != \"\" {\n\t\tcaCert, err := keyman.LoadCertificateFromPEMBytes([]byte(*rootCA))\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Unable to load root ca cert: %s\", err)\n\t\t}\n\t\ttlsConfig.RootCAs = caCert.PoolContainingCert()\n\t}\n\treturn tlsConfig\n}", "title": "" }, { "docid": "160ce0cc10b3d7c64e3058017b72ae2f", "score": "0.6038089", "text": "func (s *Server) createTLSConfig() (*tls.Config, error) {\n\tcfg := s.conf.Network(s.networkID)\n\n\tdoTLS, _ := cfg.TLS()\n\tif !doTLS {\n\t\treturn nil, nil\n\t}\n\n\tca, caOk := cfg.TLSCACert()\n\tcert, certOk := cfg.TLSCert()\n\tkey, keyOk := cfg.TLSKey()\n\tinsecure, _ := cfg.TLSInsecureSkipVerify()\n\n\tconf := new(tls.Config)\n\n\tif caOk {\n\t\tcaCertBytes, err := ioutil.ReadFile(ca)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to read ca cert\")\n\t\t}\n\n\t\tcertPool := new(x509.CertPool)\n\t\tcertPool.AppendCertsFromPEM(caCertBytes)\n\t\tconf.RootCAs = certPool\n\t}\n\n\tif certOk && keyOk {\n\t\tcertificate, err := tls.LoadX509KeyPair(cert, key)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tconf.Certificates = append(conf.Certificates, certificate)\n\t}\n\n\tif insecure {\n\t\tconf.InsecureSkipVerify = true\n\t}\n\n\treturn conf, nil\n}", "title": "" }, { "docid": "01e4c75b8abd5763a27c13fc4d043a9e", "score": "0.6029366", "text": "func TLSConfig(certPemPath, keyPemPath, caCertPath string) (*tls.Config, error) {\n\tvar caCertParsed *x509.Certificate\n\tif caCertPath != \"\" {\n\t\tpemBytes, err := ioutil.ReadFile(caCertPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcertDERBlock, _ := pem.Decode(pemBytes)\n\t\tif certDERBlock == nil {\n\t\t\treturn nil, errors.New(\"No certificate data read from PEM\")\n\t\t}\n\t\tcaCertParsed, err = x509.ParseCertificate(certDERBlock.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tgTLSConfig := &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tCurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},\n\t\tPreferServerCipherSuites: true,\n\t\tCipherSuites: []uint16{\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_RSA_WITH_AES_256_GCM_SHA384,\n\t\t\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\t},\n\t\tVerifyPeerCertificate: func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error {\n\t\t\tif caCertParsed == nil {\n\t\t\t\treturn nil //perform no verification\n\t\t\t}\n\t\t\tfor _, c := range rawCerts {\n\t\t\t\tparsedCert, err := x509.ParseCertificate(c)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcertErr := parsedCert.CheckSignatureFrom(caCertParsed)\n\t\t\t\tif parsedCert.NotAfter.Before(time.Now()) || parsedCert.NotBefore.After(time.Now()) {\n\t\t\t\t\tcertErr = errors.New(\"Certificate expired or used too soon\")\n\t\t\t\t}\n\t\t\t\tif certErr == nil {\n\t\t\t\t\tif crlErr := cert.CheckCRL(parsedCert); crlErr != nil {\n\t\t\t\t\t\tcertErr = crlErr\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"Remote presented certificate %d with time bounds (%v-%v). Verification error for certificate: %+v\", parsedCert.SerialNumber, parsedCert.NotBefore, parsedCert.NotAfter, certErr)\n\t\t\t\treturn certErr\n\t\t\t}\n\t\t\treturn errors.New(\"Expected certificate which would pass, none presented\")\n\t\t},\n\t\tInsecureSkipVerify: true,\n\t}\n\n\tif certPemPath != \"\" {\n\t\tmainCert, err := tls.LoadX509KeyPair(certPemPath, keyPemPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tgTLSConfig.Certificates = []tls.Certificate{mainCert}\n\t}\n\n\tif caCertPath == \"\" {\n\t\tlog.Println(\"Warning: No CA certificate specified. Skipping TLS verification of server. This is bad!\")\n\t} else {\n\t\tgTLSConfig.ClientAuth = tls.RequestClientCert\n\t}\n\n\treturn gTLSConfig, nil\n}", "title": "" }, { "docid": "160de39894b8361ea9358df6204e4bb8", "score": "0.59981227", "text": "func createTLSConfig(t *testing.T, certFile, password string) *tls.Config {\n\t// Get the SystemCertPool, continue with an empty pool on error\n\tcerts, err := x509.SystemCertPool()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Read in the cert file\n\tcert, err := ioutil.ReadFile(certFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Append our cert to the system pool\n\tok := certs.AppendCertsFromPEM(cert)\n\tif !ok {\n\t\tt.Fatal(\"No certs appended\")\n\t}\n\t// Trust the augmented cert pool in our client\n\treturn &tls.Config{\n\t\tInsecureSkipVerify: false,\n\t\tRootCAs: certs,\n\t}\n}", "title": "" }, { "docid": "e71c31dd292f952d768e68b07a50c9cb", "score": "0.5994383", "text": "func MakeTLSConfig(cert *tls.Certificate) (TLSClientConfig, error) {\n\tif cert == nil {\n\t\treturn TLSClientConfig{}, nil\n\t}\n\tvar content bytes.Buffer\n\tfor _, c := range cert.Certificate {\n\t\tif err := pem.Encode(&content, &pem.Block{\n\t\t\tType: \"CERTIFICATE\",\n\t\t\tBytes: c,\n\t\t}); err != nil {\n\t\t\treturn TLSClientConfig{}, errors.Wrap(err, \"failed to encode PEM\")\n\t\t}\n\t}\n\n\tleaf, err := x509.ParseCertificate(cert.Certificate[0])\n\tif err != nil {\n\t\treturn TLSClientConfig{}, errors.Wrap(err, \"failed to parse certificate\")\n\t}\n\tcertName := \"\"\n\tif len(leaf.DNSNames) > 0 {\n\t\tcertName = leaf.DNSNames[0]\n\t} else if len(leaf.IPAddresses) > 0 {\n\t\tcertName = leaf.IPAddresses[0].String()\n\t}\n\n\treturn TLSClientConfig{\n\t\tEnabled: true,\n\t\tCertBytes: content.Bytes(),\n\t\tCertificateName: certName,\n\t}, nil\n}", "title": "" }, { "docid": "b021bb6dd4cc9c794d99ee5a037c38ee", "score": "0.5979164", "text": "func (c *Config) InitTLSConfig(certAndKey ...string) *Config {\n\tswitch len(certAndKey) {\n\tcase 2:\n\t\tc.TLSKeyFile = certAndKey[1]\n\t\tfallthrough\n\tcase 1:\n\t\tc.TLSCertFile = certAndKey[0]\n\t}\n\tc.TLSConfig = new(tls.Config)\n\tif len(c.TLSCertFile) > 0 && len(c.TLSKeyFile) > 0 {\n\t\tcert, err := tls.LoadX509KeyPair(c.TLSCertFile, c.TLSKeyFile)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tc.TLSConfig.Certificates = append(c.TLSConfig.Certificates, cert)\n\t}\n\tif !c.DisableHTTP2 {\n\t\tc.TLSConfig.NextProtos = append(c.TLSConfig.NextProtos, \"h2\")\n\t}\n\treturn c\n}", "title": "" }, { "docid": "881b8a30acbf355376be791fa8fab996", "score": "0.5964475", "text": "func (ca *CertificateRequest) TLSConfigWithRootCA(rootCAPool *x509.CertPool, verifyClient bool) (*tls.Config, error) {\n\ttlsCert, err := ca.TLSCert()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar tlsConfig tls.Config\n\ttlsConfig.MinVersion = tls.VersionTLS12\n\ttlsConfig.Certificates = append(tlsConfig.Certificates, tlsCert)\n\ttlsConfig.RootCAs = rootCAPool\n\n\tif verifyClient {\n\t\ttlsConfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t}\n\n\treturn &tlsConfig, nil\n}", "title": "" }, { "docid": "05985298ddb3096ac3bca85d7f113e9c", "score": "0.59639275", "text": "func NewServerTLSConfig(clientCaCrt []byte, provider ServerCertificateProvider, protos []string) *tls.Config {\n\tcaCrtPool := x509.NewCertPool()\n\tcaCrtPool.AppendCertsFromPEM(clientCaCrt)\n\n\treturn &tls.Config{\n\t\tMinVersion: tls.VersionTLS13,\n\t\tGetCertificate: provider.GetCert,\n\t\tClientCAs: caCrtPool,\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t\tNextProtos: protos,\n\t}\n}", "title": "" }, { "docid": "db98d087e29232a047c57920e698df96", "score": "0.5939727", "text": "func (ca *CertificateRequest) TLSServerConfig(verifyClient bool) (*tls.Config, error) {\n\tpool, err := ca.TLSCertPool()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ca.TLSConfigWithClientCA(pool, verifyClient)\n}", "title": "" }, { "docid": "cfe0a7609b1da7310f3859dcacb35f5e", "score": "0.59264565", "text": "func GetTLSConfigMem(\n\ttlsClientCert,\n\ttlsClientKey,\n\ttlsClientCA,\n\ttlsRemoteCertPEM string,\n\tinsecureSkipVerify bool,\n) (*tls.Config, error) {\n\ttlsConfig := InitTLSConfig()\n\ttlsConfig.InsecureSkipVerify = insecureSkipVerify\n\t// Client authentication\n\tif tlsClientCert != \"\" && tlsClientKey != \"\" {\n\t\tcert, err := tls.X509KeyPair([]byte(tlsClientCert), []byte(tlsClientKey))\n\t\tif err != nil {\n\t\t\treturn nil, errors.WithStack(err)\n\t\t}\n\t\ttlsConfig.Certificates = []tls.Certificate{\n\t\t\tcert,\n\t\t}\n\t}\n\n\tvar tlsRemoteCert *x509.Certificate\n\tif tlsRemoteCertPEM != \"\" {\n\t\t// Ignore any content outside of the PEM bytes we care about\n\t\tcertBlock, _ := pem.Decode([]byte(tlsRemoteCertPEM))\n\t\tif certBlock == nil {\n\t\t\treturn nil, errors.Errorf(\"Invalid remote certificate\")\n\t\t}\n\n\t\tvar err error\n\t\ttlsRemoteCert, err = x509.ParseCertificate(certBlock.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, errors.WithStack(err)\n\t\t}\n\t}\n\n\tif tlsClientCA != \"\" {\n\t\tcaPool := x509.NewCertPool()\n\t\tcaPool.AppendCertsFromPEM([]byte(tlsClientCA))\n\n\t\ttlsConfig.RootCAs = caPool\n\t}\n\n\tfinalizeTLSConfig(tlsConfig, tlsRemoteCert)\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "2882cfe869c87830d9e6dd7952b39702", "score": "0.5926381", "text": "func createTLSConfigWithCipher(t *testing.T, certFile, password string, ciphers []uint16) *tls.Config {\n\t// Get the SystemCertPool, continue with an empty pool on error\n\tcerts, err := x509.SystemCertPool()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Read in the cert file\n\tcert, err := ioutil.ReadFile(certFile)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Append our cert to the system pool\n\tok := certs.AppendCertsFromPEM(cert)\n\tif !ok {\n\t\tt.Fatal(\"No certs appended\")\n\t}\n\t// Trust the augmented cert pool in our client\n\treturn &tls.Config{\n\t\tInsecureSkipVerify: false,\n\t\tRootCAs: certs,\n\t\tCipherSuites: ciphers,\n\t}\n}", "title": "" }, { "docid": "1db9c1503e3b6b53bb62f193cd7a6aa4", "score": "0.59140164", "text": "func NewTLSConfig(s *TLSSettings) (*tls.Config, error) {\n\t// Parse min and max TLS versions\n\tvar min, max uint16\n\tvar err error\n\n\tif s.MinVersion == \"\" {\n\t\tmin = tls.VersionTLS10\n\t} else if min, err = ParseTLSVersion(s.MinVersion); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif s.MaxVersion == \"\" {\n\t\tmax = tls.VersionTLS12\n\t} else if max, err = ParseTLSVersion(s.MaxVersion); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar css []uint16\n\tif len(s.CipherSuites) == 0 {\n\t\tcss = []uint16{\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\n\t\t\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_RSA_WITH_AES_128_CBC_SHA,\n\t\t}\n\t} else {\n\t\tcss = make([]uint16, len(s.CipherSuites))\n\t\tfor i, suite := range s.CipherSuites {\n\t\t\tcs, err := ParseCipherSuite(suite)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcss[i] = cs\n\t\t}\n\t}\n\n\tvar cache tls.ClientSessionCache\n\tif !s.SessionTicketsDisabled {\n\t\tcache, err = NewTLSSessionCache(&s.SessionCache)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn &tls.Config{\n\t\tMinVersion: min,\n\t\tMaxVersion: max,\n\n\t\tSessionTicketsDisabled: s.SessionTicketsDisabled,\n\t\tClientSessionCache: cache,\n\n\t\tPreferServerCipherSuites: s.PreferServerCipherSuites,\n\t\tCipherSuites: css,\n\n\t\tInsecureSkipVerify: s.InsecureSkipVerify,\n\t}, nil\n}", "title": "" }, { "docid": "dc3cd3c5c4f776da6dd7751b82ab0a67", "score": "0.59085685", "text": "func (ca *CertificateRequest) TLSClientConfig() (*tls.Config, error) {\n\tpool, err := ca.TLSCertPool()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ca.TLSConfigWithRootCA(pool, false)\n}", "title": "" }, { "docid": "fab9590197920788de058c3dfffded7e", "score": "0.59068155", "text": "func (ctx *Context) GetClientTLSConfig() (*tls.Config, error) {\n\t// Early out.\n\tif ctx.Insecure {\n\t\treturn nil, nil\n\t}\n\n\tctx.clientTLSConfig.once.Do(func() {\n\t\tif ctx.SSLCert != \"\" {\n\t\t\tctx.clientTLSConfig.tlsConfig, ctx.clientTLSConfig.err = security.LoadClientTLSConfig(\n\t\t\t\tctx.SSLCA, ctx.SSLCert, ctx.SSLCertKey)\n\t\t\tif ctx.clientTLSConfig.err != nil {\n\t\t\t\tctx.clientTLSConfig.err = errors.Errorf(\"error setting up client TLS config: %s\", ctx.clientTLSConfig.err)\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Println(\"no certificates specified: using insecure TLS\")\n\t\t\tctx.clientTLSConfig.tlsConfig = security.LoadInsecureClientTLSConfig()\n\t\t}\n\t})\n\n\treturn ctx.clientTLSConfig.tlsConfig, ctx.clientTLSConfig.err\n}", "title": "" }, { "docid": "c05d617b301b5d79a2c804144384bb69", "score": "0.5901258", "text": "func (tc *TeleportClient) LoadTLSConfig() (*tls.Config, error) {\n\tif tc.TLS != nil {\n\t\treturn tc.TLS.Clone(), nil\n\t}\n\n\ttlsKey, err := tc.localAgent.GetCoreKey()\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"failed to fetch TLS key for %v\", tc.Username)\n\t}\n\n\tvar clusters []string\n\tif tc.LoadAllCAs {\n\t\tclusters, err = tc.localAgent.GetClusterNames()\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t} else {\n\t\trootCluster, err := tlsKey.RootClusterName()\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err)\n\t\t}\n\t\tclusters = []string{rootCluster}\n\t\tif tc.SiteName != \"\" && rootCluster != tc.SiteName {\n\t\t\t// In case of establishing connection to leaf cluster the client validate\n\t\t\t// ssh cert against root cluster proxy cert and leaf cluster cert.\n\t\t\tclusters = append(clusters, tc.SiteName)\n\t\t}\n\t}\n\n\ttlsConfig, err := tlsKey.TeleportClientTLSConfig(nil /* cipherSuites */, clusters)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"failed to generate client TLS config\")\n\t}\n\ttlsConfig.InsecureSkipVerify = tc.InsecureSkipVerify\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "b732114be8682da1167f5957c85d4898", "score": "0.5893351", "text": "func (i *Identity) TLSConfig(cipherSuites []uint16) (*tls.Config, error) {\n\ttlsConfig := utils.TLSConfig(cipherSuites)\n\tif !i.HasTLSConfig() {\n\t\treturn nil, trace.NotFound(\"no TLS credentials setup for this identity\")\n\t}\n\n\ttlsCert, err := keys.X509KeyPair(i.TLSCertBytes, i.KeyBytes)\n\tif err != nil {\n\t\treturn nil, trace.BadParameter(\"failed to parse private key: %v\", err)\n\t}\n\tcertPool := x509.NewCertPool()\n\tfor j := range i.TLSCACertsBytes {\n\t\tparsedCert, err := tlsca.ParseCertificatePEM(i.TLSCACertsBytes[j])\n\t\tif err != nil {\n\t\t\treturn nil, trace.Wrap(err, \"failed to parse CA certificate\")\n\t\t}\n\t\tcertPool.AddCert(parsedCert)\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{tlsCert}\n\ttlsConfig.RootCAs = certPool\n\ttlsConfig.ClientCAs = certPool\n\ttlsConfig.ServerName = apiutils.EncodeClusterName(i.ClusterName)\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "733580cc7ea68e8db36ddc337471c4b6", "score": "0.58623284", "text": "func (p *Pkcs11Security) ClientTLSConfig() (*tls.Config, error) {\n\treturn p.TLSConfig()\n}", "title": "" }, { "docid": "1654be708a2b3c65064ccec7ec9fddc3", "score": "0.5805449", "text": "func (p *Pkcs11Security) TLSConfig() (*tls.Config, error) {\n\tcaCert, err := os.ReadFile(p.conf.CAFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcaCertPool := x509.NewCertPool()\n\tcaCertPool.AppendCertsFromPEM(caCert)\n\n\ttlsc := &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tCertificates: []tls.Certificate{*p.cert},\n\t\tGetClientCertificate: func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {\n\t\t\treturn p.cert, nil\n\t\t},\n\t\tClientCAs: caCertPool,\n\t\tRootCAs: caCertPool,\n\t}\n\n\tif p.conf.DisableTLSVerify {\n\t\ttlsc.InsecureSkipVerify = true\n\t}\n\n\treturn tlsc, nil\n}", "title": "" }, { "docid": "3cc055c41e102df54af42cd2dd4fc53c", "score": "0.58029026", "text": "func SetupTLSConfig(cfg TLSConfig) (*tls.Config, error) {\n\t// REVIEW\n\tvar err error\n\ttlsConfig := &tls.Config{}\n\tif cfg.CertFile != \"\" && cfg.KeyFile != \"\" {\n\t\ttlsConfig.Certificates = make([]tls.Certificate, 1)\n\t\ttlsConfig.Certificates[0], err = tls.LoadX509KeyPair(\n\t\t\tcfg.CertFile,\n\t\t\tcfg.KeyFile,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif cfg.CAFile != \"\" {\n\t\tb, err := ioutil.ReadFile(cfg.CAFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tca := x509.NewCertPool()\n\t\tok := ca.AppendCertsFromPEM([]byte(b))\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"failed to parse root certificate: %q\",\n\t\t\t\tcfg.CAFile,\n\t\t\t)\n\t\t}\n\t\tif cfg.Server {\n\t\t\ttlsConfig.ClientCAs = ca\n\t\t\ttlsConfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t\t} else {\n\t\t\ttlsConfig.RootCAs = ca\n\t\t}\n\t\ttlsConfig.ServerName = cfg.ServerAddress\n\t}\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "7555f90bb5966e5b88f04b953963a4ea", "score": "0.5755606", "text": "func ServerTLSConfig(cert *shared.CertInfo) *tls.Config {\n\tconfig := shared.InitTLSConfig()\n\tconfig.ClientAuth = tls.RequestClientCert\n\tconfig.Certificates = []tls.Certificate{cert.KeyPair()}\n\tconfig.NextProtos = []string{\"h2\"} // Required by gRPC\n\n\tif cert.CA() != nil {\n\t\tpool := x509.NewCertPool()\n\t\tpool.AddCert(cert.CA())\n\t\tconfig.RootCAs = pool\n\t\tconfig.ClientCAs = pool\n\n\t\tlogger.Infof(\"LXD is in CA mode, only CA-signed certificates will be allowed\")\n\t}\n\n\treturn config\n}", "title": "" }, { "docid": "27fea2861f0db7a99b69ccdeb76364fa", "score": "0.574535", "text": "func getTLSConfig() *tls.Config {\n\treturn &tls.Config{\n\t\tClientAuth: tls.NoClientCert,\n\t\tClientCAs: nil,\n\t\tInsecureSkipVerify: true,\n\t}\n}", "title": "" }, { "docid": "045b64e0050f731a7de8d4e68a21e260", "score": "0.5742331", "text": "func (p *CMDBasedProvider) GetClientTLSConfig(serverName string) (*tls.Config, error) {\n\treturn p.getClientTLSConfig(serverName)\n}", "title": "" }, { "docid": "4e69f209b48d5f25eae282f5527c407d", "score": "0.5741843", "text": "func LoadMTLSConfig(caPath, certPath, keyPath string, isServer bool) (*tls.Config, error) {\n\ttlsCertFilePath := filepath.Clean(certPath)\n\ttlsKeyFilePath := filepath.Clean(keyPath)\n\tcertificate, err := tls.LoadX509KeyPair(tlsCertFilePath, tlsKeyFilePath)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, errLoadCert)\n\t}\n\n\tcaCertFilePath := filepath.Clean(caPath)\n\tca, err := os.ReadFile(caCertFilePath)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, errLoadCA)\n\t}\n\n\tpool := x509.NewCertPool()\n\tif !pool.AppendCertsFromPEM(ca) {\n\t\treturn nil, errors.New(errInvalidCA)\n\t}\n\n\ttlsConfig := &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tCertificates: []tls.Certificate{certificate},\n\t}\n\n\tif isServer {\n\t\ttlsConfig.ClientCAs = pool\n\t\ttlsConfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t} else {\n\t\ttlsConfig.RootCAs = pool\n\t}\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "9ddb9b661d22b73440b235295b46f12f", "score": "0.57263786", "text": "func (c *ClusterConfiguration) ServerTLSConfig(creds Credentials, vc VerifyClient) (*tls.Config, io.Closer, error) {\n\tvar pool *x509.CertPool\n\tvar err error\n\tif vc.Source != AnySource {\n\t\tpool, err = c.trustRoot(vc.Source)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\treloader, err := util.NewCertReloader(util.ReloadConfig{\n\t\tKeyFile: creds.KeyFile,\n\t\tCertFile: creds.CertFile,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"create cert reloader\")\n\t}\n\treturn makeConfig(func(conf *tls.Config) {\n\t\tconf.ClientCAs = pool\n\t\tconf.GetCertificate = func(_ *tls.ClientHelloInfo) (*tls.Certificate, error) {\n\t\t\treturn reloader.GetLatestCertificate()\n\t\t}\n\t\tconf.VerifyPeerCertificate = getVerifier(vc.Allow)\n\t\tif vc.Source == AnySource && vc.Allow == nil {\n\t\t\tconf.ClientAuth = tls.VerifyClientCertIfGiven\n\t\t} else {\n\t\t\tconf.ClientAuth = tls.RequireAndVerifyClientCert\n\t\t}\n\t}), reloader, nil\n}", "title": "" }, { "docid": "191aab69811c873c848af3740402f42c", "score": "0.56944484", "text": "func NewTLSConfig(cfg config.TLS) (*tls.Config, error) {\n\tt := &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tCurvePreferences: []tls.CurveID{\n\t\t\ttls.CurveP521,\n\t\t\ttls.CurveP384,\n\t\t\ttls.CurveP256,\n\t\t\ttls.X25519,\n\t\t},\n\t\tSessionTicketsDisabled: true,\n\t\t// PreferServerCipherSuites: true,\n\t\t// CipherSuites: []uint16{\n\t\t// tls.TLS_RSA_WITH_RC4_128_SHA,\n\t\t// tls.TLS_RSA_WITH_AES_128_CBC_SHA,\n\t\t// tls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\t// tls.TLS_RSA_WITH_AES_128_CBC_SHA256,\n\t\t// tls.TLS_RSA_WITH_AES_128_GCM_SHA256,\n\t\t// tls.TLS_RSA_WITH_AES_256_GCM_SHA384,\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\t\t// tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,\n\t\t// tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\t\t// tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,\n\t\t// tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,\n\t\t// tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,\n\t\t// tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\t\t// tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, // Maybe this is work on TLS 1.2\n\t\t// tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, // TLS1.3 Feature\n\t\t// tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, // TLS1.3 Feature\n\t\t// tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, // Go 1.8 only\n\t\t// tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, // Go 1.8 only\n\t\t// },\n\t\tClientAuth: tls.NoClientCert,\n\t}\n\n\tcert := config.GetActualValue(cfg.CertPath)\n\tkey := config.GetActualValue(cfg.KeyPath)\n\tca := config.GetActualValue(cfg.CAPath)\n\n\tif cert != \"\" && key != \"\" {\n\t\tcrt, err := tls.LoadX509KeyPair(cert, key)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"tls.LoadX509KeyPair(cert, key)\")\n\t\t}\n\t\tt.Certificates = make([]tls.Certificate, 1)\n\t\tt.Certificates[0] = crt\n\t}\n\n\tif ca != \"\" {\n\t\tpool, err := NewX509CertPool(ca)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"NewX509CertPool(ca)\")\n\t\t}\n\t\tt.ClientCAs = pool\n\t\tt.ClientAuth = tls.RequireAndVerifyClientCert\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "946a7f651e9a509e7911dcd9db50c221", "score": "0.56875426", "text": "func (opt *ServerOptions) GetClientTLS() (*tls.Config, error) {\n\tif len(opt.CertConfig.CAFile) != 0 && len(opt.CertConfig.ClientCertFile) == 0 {\n\t\t//work with CA, and verify Server certification\n\t\tconfig, err := ssl.ClientTslConfVerityServer(opt.CertConfig.CAFile)\n\t\tif err != nil {\n\t\t\tblog.Errorf(\"gateway-discovery tls with only CA failed, %s\", err.Error())\n\t\t\treturn nil, err\n\t\t}\n\t\treturn config, nil\n\t}\n\t//tls with CA/ClientCert/ClientKey\n\tif len(opt.CertConfig.CAFile) != 0 && len(opt.CertConfig.ClientCertFile) != 0 &&\n\t\tlen(opt.CertConfig.ClientKeyFile) != 0 {\n\t\tconfig, err := ssl.ClientTslConfVerity(opt.CertConfig.CAFile, opt.CertConfig.ClientCertFile,\n\t\t\topt.CertConfig.ClientKeyFile, static.ClientCertPwd)\n\t\tif err != nil {\n\t\t\tblog.Errorf(\"gateway-discovery tls with CA/Cert/Key failed, %s\", err.Error())\n\t\t\treturn nil, err\n\t\t}\n\t\treturn config, nil\n\t}\n\treturn nil, fmt.Errorf(\"tls config error, only setting CA or setting CA/ClientCert/ClientKey\")\n}", "title": "" }, { "docid": "c28535e2b8d7a2ed9f1fc1cfc3dc1e4e", "score": "0.56612104", "text": "func (id *ID) ClientTLSConfig() *tls.Config {\n\ttlsConfig := &tls.Config{\n\t\tRootCAs: id.ca,\n\t}\n\n\ttlsConfig.GetClientCertificate = func(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {\n\t\treturn id.GetClientCertificate(tlsConfig, info)\n\t}\n\n\treturn tlsConfig\n}", "title": "" }, { "docid": "094d2ba23ea391f657694c8c9ab0b293", "score": "0.5661151", "text": "func ServerTLSConfig(cert *Info, logger log.Logger) *tls.Config {\n\tconfig := InitTLSConfig()\n\tconfig.ClientAuth = tls.RequestClientCert\n\tconfig.Certificates = []tls.Certificate{cert.KeyPair()}\n\tconfig.NextProtos = []string{\"h2\"} // Required by gRPC\n\n\tif cert.CA() != nil {\n\t\tpool := x509.NewCertPool()\n\t\tpool.AddCert(cert.CA())\n\t\tconfig.RootCAs = pool\n\t\tconfig.ClientCAs = pool\n\n\t\tlevel.Info(logger).Log(\"msg\", \"CA mode, only CA-signed certificates will be allowed\")\n\t}\n\n\tconfig.BuildNameToCertificate()\n\treturn config\n}", "title": "" }, { "docid": "170b1df661b4e404a56854e11f731760", "score": "0.56568515", "text": "func NewConfig(api, userCode, appCode, puk, prk, mspDir, cert string) (*Config, error) {\n\n\tconfig := &Config{\n\t\tnodeApi: api,\n\t\tmspDir: mspDir,\n\t\thttpCert: cert,\n\t\tappCert: certInfo{AppPublicCert: puk, UserAppPrivateCert: prk},\n\t\tuser: userInfo{UserCode: userCode},\n\t\tapp: appInfo{AppCode: appCode},\n\t}\n\terr := config.Init()\n\treturn config, err\n}", "title": "" }, { "docid": "8555e4556c3f17e2775a7ec217b611ab", "score": "0.5633692", "text": "func configureTLS(c *transportConfig) (*tls.Config, error) {\n\ttlsConfig := utils.TLSConfig(c.cipherSuites)\n\n\t// Configure the pool of certificates that will be used to verify the\n\t// identity of the server. This allows the client to verify the identity of\n\t// the server it is connecting to.\n\tca, err := c.accessPoint.GetCertAuthority(context.TODO(), types.CertAuthID{\n\t\tType: types.HostCA,\n\t\tDomainName: c.identity.RouteToApp.ClusterName,\n\t}, false)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tcertPool, err := services.CertPool(ca)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\ttlsConfig.RootCAs = certPool\n\n\t// Configure the identity that will be used to connect to the server. This\n\t// allows the server to verify the identity of the caller.\n\tcertificate, err := tls.X509KeyPair(c.ws.GetTLSCert(), c.ws.GetPriv())\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"failed to parse certificate or key\")\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{certificate}\n\n\t// Use SNI to tell the other side which cluster signed the CA so it doesn't\n\t// have to fetch all CAs when verifying the cert.\n\ttlsConfig.ServerName = apiutils.EncodeClusterName(c.clusterName)\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "8555e4556c3f17e2775a7ec217b611ab", "score": "0.5633692", "text": "func configureTLS(c *transportConfig) (*tls.Config, error) {\n\ttlsConfig := utils.TLSConfig(c.cipherSuites)\n\n\t// Configure the pool of certificates that will be used to verify the\n\t// identity of the server. This allows the client to verify the identity of\n\t// the server it is connecting to.\n\tca, err := c.accessPoint.GetCertAuthority(context.TODO(), types.CertAuthID{\n\t\tType: types.HostCA,\n\t\tDomainName: c.identity.RouteToApp.ClusterName,\n\t}, false)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tcertPool, err := services.CertPool(ca)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\ttlsConfig.RootCAs = certPool\n\n\t// Configure the identity that will be used to connect to the server. This\n\t// allows the server to verify the identity of the caller.\n\tcertificate, err := tls.X509KeyPair(c.ws.GetTLSCert(), c.ws.GetPriv())\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"failed to parse certificate or key\")\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{certificate}\n\n\t// Use SNI to tell the other side which cluster signed the CA so it doesn't\n\t// have to fetch all CAs when verifying the cert.\n\ttlsConfig.ServerName = apiutils.EncodeClusterName(c.clusterName)\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "688d2233f56e6033b96170efe6955576", "score": "0.5633167", "text": "func (c Config) NewETCDConfig() (*monitoring.ETCDConfig, error) {\n\tetcdConfig := &monitoring.ETCDConfig{\n\t\tEndpoints: c.ETCDConfig.Endpoints,\n\t\tCAFile: c.ETCDConfig.CAFile,\n\t\tCertFile: c.ETCDConfig.CertFile,\n\t\tKeyFile: c.ETCDConfig.KeyFile,\n\t}\n\ttransport, err := etcdConfig.NewHTTPTransport()\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tetcdConfig.Client = &http.Client{\n\t\tTransport: transport,\n\t\tTimeout: c.HTTPTimeout,\n\t}\n\treturn etcdConfig, nil\n}", "title": "" }, { "docid": "1d65b9dc2d9b86e6d009e46f5f3565a1", "score": "0.55901164", "text": "func NewServerConfig(logger log.Logger, certFile, keyFile, clientCAFile, minVersion string, cipherSuites []string) (*tls.Config, error) {\n\tif certFile == \"\" && keyFile == \"\" {\n\t\tif clientCAFile != \"\" {\n\t\t\treturn nil, errors.New(\"when a client CA is used a server key and certificate must also be provided\")\n\t\t}\n\n\t\tlevel.Info(logger).Log(\"msg\", \"TLS disabled key and cert must be set to enable\")\n\n\t\treturn nil, nil\n\t}\n\n\tlevel.Info(logger).Log(\"msg\", \"enabling server side TLS\")\n\n\ttlsCert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"server credentials: %w\", err)\n\t}\n\n\ttlsCfg := &tls.Config{}\n\ttlsCfg.Certificates = []tls.Certificate{tlsCert}\n\n\tversion, err := flag.TLSVersion(minVersion)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"TLS version invalid: %w\", err)\n\t}\n\n\ttlsCfg.MinVersion = version\n\n\tcipherSuiteIDs, err := flag.TLSCipherSuites(cipherSuites)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"TLS cipher suite name to ID conversion: %v\", err)\n\t}\n\n\t// A list of supported cipher suites for TLS versions up to TLS 1.2.\n\t// If CipherSuites is nil, a default list of secure cipher suites is used.\n\t// Note that TLS 1.3 ciphersuites are not configurable.\n\ttlsCfg.CipherSuites = cipherSuiteIDs\n\n\tif clientCAFile != \"\" {\n\t\tcaPEM, err := ioutil.ReadFile(clientCAFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"reading client CA: %w\", err)\n\t\t}\n\n\t\tcertPool := x509.NewCertPool()\n\t\tif !certPool.AppendCertsFromPEM(caPEM) {\n\t\t\treturn nil, errors.New(\"parsing client CA failed\")\n\t\t}\n\n\t\ttlsCfg.ClientCAs = certPool\n\t\ttlsCfg.ClientAuth = tls.RequireAndVerifyClientCert\n\n\t\tlevel.Info(logger).Log(\"msg\", \"server TLS client verification enabled\")\n\t}\n\n\treturn tlsCfg, nil\n}", "title": "" }, { "docid": "7009577e244b96b2ff08fae706d333d8", "score": "0.5577942", "text": "func configureTLS(a *api.AuthInfo, c *api.Cluster) (*tls.Config, error) {\n\n\ttlsConfig := &tls.Config{\n\t\tInsecureSkipVerify: c.InsecureSkipTLSVerify,\n\t}\n\n\t// Load CA from file\n\tif c.CertificateAuthority != \"\" {\n\t\tcaCert, err := ioutil.ReadFile(c.CertificateAuthority)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcaCertPool := x509.NewCertPool()\n\t\tcaCertPool.AppendCertsFromPEM(caCert)\n\t\ttlsConfig.RootCAs = caCertPool\n\t}\n\n\t// Load CA from block\n\tif c.CertificateAuthorityData != nil {\n\t\tcaCertPool := x509.NewCertPool()\n\t\tcaCertPool.AppendCertsFromPEM(c.CertificateAuthorityData)\n\t\ttlsConfig.RootCAs = caCertPool\n\t}\n\n\t// Load certs from file\n\tif a.ClientCertificate != \"\" && a.ClientKey != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(a.ClientCertificate, a.ClientKey)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttlsConfig.Certificates = []tls.Certificate{cert}\n\t\ttlsConfig.BuildNameToCertificate()\n\t}\n\n\t// Load certs from block\n\tif a.ClientCertificateData != nil && a.ClientKeyData != nil {\n\t\tcert, err := tls.X509KeyPair(a.ClientCertificateData, a.ClientKeyData)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttlsConfig.Certificates = []tls.Certificate{cert}\n\t\ttlsConfig.BuildNameToCertificate()\n\t}\n\n\treturn tlsConfig, nil\n}", "title": "" }, { "docid": "83e7ce946082371827d27487c40d1ac4", "score": "0.5576224", "text": "func getTLSConfig() (*tls.Config, error) {\n\n\tvar n int\n\tif viper.GetString(\"tls-cert-file\") != \"\" {\n\t\tn += 0b0001\n\t}\n\tif viper.GetString(\"tls-key-file\") != \"\" {\n\t\tn += 0b0010\n\t}\n\tif viper.GetString(\"tls-cert-data\") != \"\" {\n\t\tn += 0b0100\n\t}\n\tif viper.GetString(\"tls-key-data\") != \"\" {\n\t\tn += 0b1000\n\t}\n\n\tvar cert tls.Certificate\n\tvar err error\n\tswitch n {\n\tcase 0b0011: // file mode\n\t\tcert, err = tls.LoadX509KeyPair(viper.GetString(\"tls-cert-file\"), viper.GetString(\"tls-key-file\"))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"load tls cert files\")\n\t\t}\n\tcase 0b1100: // data mode\n\t\tcert, err = tls.X509KeyPair([]byte(viper.GetString(\"tls-cert-data\")), []byte(viper.GetString(\"tls-key-data\")))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"parse tls cert\")\n\t\t}\n\tcase 0: // no flags set\n\t\tif viper.GetString(\"listen-tls\") == \"\" {\n\t\t\treturn nil, nil\n\t\t}\n\t\tfallthrough\n\tdefault:\n\t\treturn nil, errors.New(\"--tls-cert-file and --tls-key-file OR --tls-cert-data and --tls-key-data must be specified\")\n\t}\n\n\treturn &tls.Config{Certificates: []tls.Certificate{cert}, NextProtos: []string{\"h2\", \"http/1.1\"}}, nil\n}", "title": "" }, { "docid": "464f8638b612f35bb73229369bba018c", "score": "0.55587554", "text": "func generateTLSConfig() *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, &template, &template, &key.PublicKey, key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tkeyPEM := pem.EncodeToMemory(&pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(key)})\n\tcertPEM := pem.EncodeToMemory(&pem.Block{Type: \"CERTIFICATE\", Bytes: certDER})\n\n\ttlsCert, err := tls.X509KeyPair(certPEM, keyPEM)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &tls.Config{Certificates: []tls.Certificate{tlsCert}}\n}", "title": "" }, { "docid": "464f8638b612f35bb73229369bba018c", "score": "0.55587554", "text": "func generateTLSConfig() *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, &template, &template, &key.PublicKey, key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tkeyPEM := pem.EncodeToMemory(&pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(key)})\n\tcertPEM := pem.EncodeToMemory(&pem.Block{Type: \"CERTIFICATE\", Bytes: certDER})\n\n\ttlsCert, err := tls.X509KeyPair(certPEM, keyPEM)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &tls.Config{Certificates: []tls.Certificate{tlsCert}}\n}", "title": "" }, { "docid": "464f8638b612f35bb73229369bba018c", "score": "0.55587554", "text": "func generateTLSConfig() *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, &template, &template, &key.PublicKey, key)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tkeyPEM := pem.EncodeToMemory(&pem.Block{Type: \"RSA PRIVATE KEY\", Bytes: x509.MarshalPKCS1PrivateKey(key)})\n\tcertPEM := pem.EncodeToMemory(&pem.Block{Type: \"CERTIFICATE\", Bytes: certDER})\n\n\ttlsCert, err := tls.X509KeyPair(certPEM, keyPEM)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &tls.Config{Certificates: []tls.Certificate{tlsCert}}\n}", "title": "" }, { "docid": "1b9ce2044c71b9690934367cb54bc4b0", "score": "0.5550281", "text": "func getTLSConfig(certsDir string) (*tls.Config, error) {\n\t// TLS config\n\tvar tlsConfig tls.Config\n\n\tcaCert, err := fetchFile(certsDir, os.Getenv(\"SWARM_CA\"))\n\tcert, err := fetchFile(certsDir, os.Getenv(\"SWARM_CERT\"))\n\tkey, err := fetchFile(certsDir, os.Getenv(\"SWARM_KEY\"))\n\n\ttlsConfig.InsecureSkipVerify = true\n\tcertPool := x509.NewCertPool()\n\n\tcertPool.AppendCertsFromPEM(caCert)\n\ttlsConfig.RootCAs = certPool\n\tkeypair, err := tls.X509KeyPair(cert, key)\n\tif err != nil {\n\t\treturn &tlsConfig, err\n\t}\n\ttlsConfig.Certificates = []tls.Certificate{keypair}\n\n\treturn &tlsConfig, nil\n}", "title": "" }, { "docid": "cfd2d355d9e37a45d365725a82b6dc95", "score": "0.5548904", "text": "func buildConfig(keystorePath, keystorePass, caBundlePath string) (*tls.Config, error) {\n\tcaBundleBytes, err := ioutil.ReadFile(caBundlePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcaBundle := x509.NewCertPool()\n\tcaBundle.AppendCertsFromPEM(caBundleBytes)\n\n\tkeystoreBytes, err := ioutil.ReadFile(keystorePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcertPEM, keyPEM, err := parseKeystore(keystoreBytes, keystorePass)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse keystore: %v\", err)\n\t}\n\n\tcertAndKey, err := tls.X509KeyPair(certPEM, keyPEM)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse key pair: %v\", err)\n\t}\n\n\tcertAndKey.Leaf, err = x509.ParseCertificate(certAndKey.Certificate[0])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse leaf cert: %v\", err)\n\t}\n\n\treturn &tls.Config{\n\t\t// Certificates\n\t\tCertificates: []tls.Certificate{certAndKey},\n\t\tRootCAs: caBundle,\n\t\tClientCAs: caBundle,\n\n\t\tPreferServerCipherSuites: true,\n\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t\tMinVersion: tls.VersionTLS12,\n\t\tCipherSuites: []uint16{\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "4b28a681449314c162d0dd195db9ed3d", "score": "0.55315584", "text": "func (info TLSInfo) ServerConfig() (*tls.Config, error) {\n\tcfg, err := info.baseConfig()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif info.CAFile != \"\" {\n\t\tcfg.ClientAuth = tls.RequireAndVerifyClientCert\n\t\tcp, err := newCertPool(info.CAFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcfg.ClientCAs = cp\n\t} else {\n\t\tcfg.ClientAuth = tls.NoClientCert\n\t}\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "06ce08b6dba4680897723e1a909af8be", "score": "0.5487911", "text": "func tlsConfig(insecure bool, certf, keyf string, rootCerts []string) (*tls.Config, error) {\n var err error\n files := map[string][]byte{}\n filenames := append([]string{certf, keyf}, rootCerts...)\n for _, f := range filenames {\n if f != \"\" {\n if files[f], err = ioutil.ReadFile(f); err != nil {\n return nil, err\n }\n }\n }\n\n c := tls.Config{InsecureSkipVerify: insecure}\n if cert, ok := files[certf]; ok {\n key, ok := files[keyf]\n if !ok {\n key = cert\n }\n\n certificate, err := tls.X509KeyPair(cert, key)\n if err != nil {\n return nil, err\n }\n\n c.Certificates = append(c.Certificates, certificate)\n c.BuildNameToCertificate()\n }\n\n if len(rootCerts) > 0 {\n c.RootCAs = x509.NewCertPool()\n for _, f := range rootCerts {\n if !c.RootCAs.AppendCertsFromPEM(files[f]) {\n return nil, errBadCert\n }\n }\n }\n\n return &c, nil\n}", "title": "" }, { "docid": "217fa98d2ecec209f0eaa6e765a28ed8", "score": "0.5482899", "text": "func CreateTLSClientConfig(unsafeSsl bool) *tls.Config {\n\treturn &tls.Config{\n\t\tInsecureSkipVerify: unsafeSsl,\n\t\tRootCAs: getRootCAs(),\n\t\tMinVersion: GetMinTLSVersion(),\n\t}\n}", "title": "" }, { "docid": "dbce6f97b87c75b0ee9fe006a4ea9296", "score": "0.5474083", "text": "func (c *Config) buildStandardTLSConfig() error {\n\tif !c.Enabled {\n\t\treturn nil\n\t}\n\n\tconfig := new(tls.Config)\n\n\tciphersAdded := make(map[uint16]struct{})\n\tcurvesAdded := make(map[tls.CurveID]struct{})\n\n\t// add cipher suites\n\tfor _, ciph := range c.Ciphers {\n\t\tif _, ok := ciphersAdded[ciph]; !ok {\n\t\t\tciphersAdded[ciph] = struct{}{}\n\t\t\tconfig.CipherSuites = append(config.CipherSuites, ciph)\n\t\t}\n\t}\n\n\tconfig.PreferServerCipherSuites = c.PreferServerCipherSuites\n\n\t// add curve preferences\n\tfor _, curv := range c.CurvePreferences {\n\t\tif _, ok := curvesAdded[curv]; !ok {\n\t\t\tcurvesAdded[curv] = struct{}{}\n\t\t\tconfig.CurvePreferences = append(config.CurvePreferences, curv)\n\t\t}\n\t}\n\n\t// ensure ALPN includes the ACME TLS-ALPN protocol\n\tvar alpnFound bool\n\tfor _, a := range c.ALPN {\n\t\tif a == tlsalpn01.ACMETLS1Protocol {\n\t\t\talpnFound = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !alpnFound {\n\t\tc.ALPN = append(c.ALPN, tlsalpn01.ACMETLS1Protocol)\n\t}\n\n\tconfig.MinVersion = c.ProtocolMinVersion\n\tconfig.MaxVersion = c.ProtocolMaxVersion\n\tconfig.ClientAuth = c.ClientAuth\n\tconfig.NextProtos = c.ALPN\n\tconfig.GetCertificate = c.Manager.GetCertificate\n\n\t// set up client authentication if enabled\n\tif config.ClientAuth != tls.NoClientCert {\n\t\tpool := x509.NewCertPool()\n\t\tclientCertsAdded := make(map[string]struct{})\n\n\t\tfor _, caFile := range c.ClientCerts {\n\t\t\t// don't add cert to pool more than once\n\t\t\tif _, ok := clientCertsAdded[caFile]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tclientCertsAdded[caFile] = struct{}{}\n\n\t\t\t// Any client with a certificate from this CA will be allowed to connect\n\t\t\tcaCrt, err := ioutil.ReadFile(caFile)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !pool.AppendCertsFromPEM(caCrt) {\n\t\t\t\treturn fmt.Errorf(\"error loading client certificate '%s': no certificates were successfully parsed\", caFile)\n\t\t\t}\n\t\t}\n\n\t\tconfig.ClientCAs = pool\n\t}\n\n\t// default cipher suites\n\tif len(config.CipherSuites) == 0 {\n\t\tconfig.CipherSuites = getPreferredDefaultCiphers()\n\t}\n\n\t// for security, ensure TLS_FALLBACK_SCSV is always included first\n\tif len(config.CipherSuites) == 0 || config.CipherSuites[0] != tls.TLS_FALLBACK_SCSV {\n\t\tconfig.CipherSuites = append([]uint16{tls.TLS_FALLBACK_SCSV}, config.CipherSuites...)\n\t}\n\n\t// store the resulting new tls.Config\n\tc.tlsConfig = config\n\n\treturn nil\n}", "title": "" }, { "docid": "f38fd092d993f0bc875a9457a005db01", "score": "0.5466267", "text": "func (t *TLSOptions) ToTLSConfig() (*tls.Config, error) {\n\tcfg := tls.Config{}\n\n\tif t.CertFile != \"\" || t.KeyFile != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(t.CertFile, t.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error loading tls client certificate: %s\", err)\n\t\t}\n\n\t\tcfg.Certificates = []tls.Certificate{cert}\n\t}\n\n\tcfg.BuildNameToCertificate()\n\tcfg.CipherSuites = DefaultCipherSuites\n\n\t// Tell the server to prefer its cipher suite ordering over what the client\n\t// prefers.\n\tcfg.PreferServerCipherSuites = true\n\n\treturn &cfg, nil\n}", "title": "" }, { "docid": "80de6f71a92ac31e80424a3700512ae2", "score": "0.5463874", "text": "func TLSClientConfig(bundle x509bundle.Source, authorizer Authorizer, opts ...Option) *tls.Config {\n\tconfig := newTLSConfig()\n\tHookTLSClientConfig(config, bundle, authorizer, opts...)\n\treturn config\n}", "title": "" }, { "docid": "a7b68130ad8e8fef6b245994c0cf734d", "score": "0.54611564", "text": "func buildConfig(opts tlsConfig) (*tls.Config, error) {\n\tcaBundleBytes, err := ioutil.ReadFile(opts.Ca)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcaBundle := x509.NewCertPool()\n\tcaBundle.AppendCertsFromPEM(caBundleBytes)\n\n\tconfig := &tls.Config{\n\t\tRootCAs: caBundle,\n\t\tClientCAs: caBundle,\n\t\tClientAuth: tls.RequireAndVerifyClientCert,\n\t\tMinVersion: tls.VersionTLS12,\n\t}\n\n\tif ver, ok := tlsVersionMap[opts.MinVersion]; ok {\n\t\tconfig.MinVersion = ver\n\t} else if opts.MinVersion != \"\" {\n\t\treturn nil, fmt.Errorf(\"unknown TLS version: %s\", opts.MinVersion)\n\t}\n\n\tif opts.Cert != \"\" {\n\t\t// Setup client certificates\n\t\tcerts, err := tls.LoadX509KeyPair(opts.Cert, opts.Key)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconfig.Certificates = []tls.Certificate{certs}\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "c306a6adbec7d97cf545d4c3282328a8", "score": "0.54572177", "text": "func (d *dialer) tlsConfig(masquerade *Masquerade) *tls.Config {\n\td.tlsConfigsMutex.Lock()\n\tdefer d.tlsConfigsMutex.Unlock()\n\n\tserverName := d.Host\n\tif masquerade != nil {\n\t\tserverName = masquerade.Domain\n\t}\n\ttlsConfig := d.tlsConfigs[serverName]\n\tif tlsConfig == nil {\n\t\ttlsConfig = &tls.Config{\n\t\t\tClientSessionCache: tls.NewLRUClientSessionCache(1000),\n\t\t\tInsecureSkipVerify: d.InsecureSkipVerify,\n\t\t\tServerName: serverName,\n\t\t\tRootCAs: d.RootCAs,\n\t\t}\n\t\td.tlsConfigs[serverName] = tlsConfig\n\t}\n\n\treturn tlsConfig\n}", "title": "" }, { "docid": "53950bba3442156104582731254fd5a2", "score": "0.5431519", "text": "func (t *TLSOptions) ToTLSClientConfig() (*tls.Config, error) {\n\tcfg := tls.Config{}\n\tcfg.InsecureSkipVerify = t.InsecureSkipVerify\n\n\tif t.TrustedCAFile != \"\" {\n\t\tcaCertPool, err := LoadCACerts(t.TrustedCAFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcfg.RootCAs = caCertPool\n\t}\n\n\tif t.CertFile != \"\" || t.KeyFile != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(t.CertFile, t.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error loading tls client certificate: %s\", err)\n\t\t}\n\n\t\tcfg.Certificates = []tls.Certificate{cert}\n\t}\n\n\tcfg.CipherSuites = DefaultCipherSuites\n\n\treturn &cfg, nil\n}", "title": "" }, { "docid": "3cc209b843d64824205da39e59c5be1a", "score": "0.5418478", "text": "func (c *ClusterConfiguration) ClientTLSConfigWithCreds(creds Credentials, src TrustedSource) (*tls.Config, io.Closer, error) {\n\tpool, err := c.trustRoot(src)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treloader, err := util.NewCertReloader(util.ReloadConfig{\n\t\tKeyFile: creds.KeyFile,\n\t\tCertFile: creds.CertFile,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrap(err, \"create cert reloader\")\n\t}\n\treturn makeConfig(func(conf *tls.Config) {\n\t\tconf.RootCAs = pool\n\t\tconf.GetClientCertificate = func(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) {\n\t\t\treturn reloader.GetLatestCertificate()\n\t\t}\n\t}), reloader, nil\n}", "title": "" }, { "docid": "a8d4031020587bff9fd4e0dbbd1ac62f", "score": "0.54105467", "text": "func (p *pack) makeTLSConfig(t *testing.T, publicAddr, clusterName string) *tls.Config {\n\tprivateKey, publicKey, err := native.GenerateKeyPair()\n\trequire.NoError(t, err)\n\n\tws, err := p.tc.CreateAppSession(context.Background(), types.CreateAppSessionRequest{\n\t\tUsername: p.user.GetName(),\n\t\tPublicAddr: publicAddr,\n\t\tClusterName: clusterName,\n\t})\n\trequire.NoError(t, err)\n\n\tcertificate, err := p.rootCluster.Process.GetAuthServer().GenerateUserAppTestCert(\n\t\tauth.AppTestCertRequest{\n\t\t\tPublicKey: publicKey,\n\t\t\tUsername: p.user.GetName(),\n\t\t\tTTL: time.Hour,\n\t\t\tPublicAddr: publicAddr,\n\t\t\tClusterName: clusterName,\n\t\t\tSessionID: ws.GetName(),\n\t\t})\n\trequire.NoError(t, err)\n\n\ttlsCert, err := tls.X509KeyPair(certificate, privateKey)\n\trequire.NoError(t, err)\n\n\treturn &tls.Config{\n\t\tRootCAs: p.rootCertPool,\n\t\tCertificates: []tls.Certificate{tlsCert},\n\t\tInsecureSkipVerify: true,\n\t}\n}", "title": "" }, { "docid": "39ce7ccc50913cde202d645f61f63a77", "score": "0.54046994", "text": "func InitTLSConfig() *tls.Config {\n\treturn &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tMaxVersion: tls.VersionTLS12,\n\t\tCipherSuites: []uint16{\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\t\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\t\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\t\t},\n\t\tPreferServerCipherSuites: true,\n\t}\n}", "title": "" } ]
7dbf82d3483865dee1677e939878150a
FindBaseAutomationLineTestId finds record id by querying it with criteria.
[ { "docid": "6ceda24a2c33383d09f19c4320df4b52", "score": "0.88683724", "text": "func (c *Client) FindBaseAutomationLineTestId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(BaseAutomationLineTestModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"base.automation.line.test was not found\")\n}", "title": "" } ]
[ { "docid": "22fa0184478c10d75ddd819cd3310722", "score": "0.7896882", "text": "func (c *Client) FindBaseAutomationLeadTestId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(BaseAutomationLeadTestModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"base.automation.lead.test was not found\")\n}", "title": "" }, { "docid": "2dc8066a22d4f4f2fd7be4d089d5cf64", "score": "0.7726303", "text": "func (c *Client) FindBaseAutomationLineTestIds(criteria *Criteria, options *Options) ([]int64, error) {\n\tids, err := c.Search(BaseAutomationLineTestModel, criteria, options)\n\tif err != nil {\n\t\treturn []int64{}, err\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "1f59723749b950f517b6ee355440fb37", "score": "0.7539304", "text": "func (c *Client) FindBaseAutomationLineTest(criteria *Criteria) (*BaseAutomationLineTest, error) {\n\tbalts := &BaseAutomationLineTests{}\n\tif err := c.SearchRead(BaseAutomationLineTestModel, criteria, NewOptions().Limit(1), balts); err != nil {\n\t\treturn nil, err\n\t}\n\tif balts != nil && len(*balts) > 0 {\n\t\treturn &((*balts)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"base.automation.line.test was not found\")\n}", "title": "" }, { "docid": "ad0370a17e1b8f11eff186cbf3346f69", "score": "0.68003625", "text": "func (c *Client) FindBaseAutomationLineTests(criteria *Criteria, options *Options) (*BaseAutomationLineTests, error) {\n\tbalts := &BaseAutomationLineTests{}\n\tif err := c.SearchRead(BaseAutomationLineTestModel, criteria, options, balts); err != nil {\n\t\treturn nil, err\n\t}\n\treturn balts, nil\n}", "title": "" }, { "docid": "18c94f42cf89acbe67c294559f6eb546", "score": "0.6775933", "text": "func (c *Client) FindBaseAutomationLeadTestIds(criteria *Criteria, options *Options) ([]int64, error) {\n\tids, err := c.Search(BaseAutomationLeadTestModel, criteria, options)\n\tif err != nil {\n\t\treturn []int64{}, err\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "21ccea0f12e0a20ff6afde24c180a48d", "score": "0.6563343", "text": "func (c *Client) GetBaseAutomationLineTest(id int64) (*BaseAutomationLineTest, error) {\n\tbalts, err := c.GetBaseAutomationLineTests([]int64{id})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif balts != nil && len(*balts) > 0 {\n\t\treturn &((*balts)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"id %v of base.automation.line.test not found\", id)\n}", "title": "" }, { "docid": "f5475a4e44420dcd73626970265df43e", "score": "0.65200365", "text": "func (c *Client) FindBaseAutomationLeadTest(criteria *Criteria) (*BaseAutomationLeadTest, error) {\n\tbalts := &BaseAutomationLeadTests{}\n\tif err := c.SearchRead(BaseAutomationLeadTestModel, criteria, NewOptions().Limit(1), balts); err != nil {\n\t\treturn nil, err\n\t}\n\tif balts != nil && len(*balts) > 0 {\n\t\treturn &((*balts)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"base.automation.lead.test was not found\")\n}", "title": "" }, { "docid": "da38a9e0e3c03d0f419036f9e32f18aa", "score": "0.6321215", "text": "func (c *Client) FindBaseImportTestsModelsPreviewId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(BaseImportTestsModelsPreviewModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"base_import.tests.models.preview was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "ff7455fcba8f76d4d9c990916d4e1780", "score": "0.58316886", "text": "func (c *Client) GetBaseAutomationLineTests(ids []int64) (*BaseAutomationLineTests, error) {\n\tbalts := &BaseAutomationLineTests{}\n\tif err := c.Read(BaseAutomationLineTestModel, ids, nil, balts); err != nil {\n\t\treturn nil, err\n\t}\n\treturn balts, nil\n}", "title": "" }, { "docid": "50d769c15d1ec4275107dd2b013465a6", "score": "0.57188857", "text": "func (c *Client) FindBaseLanguageExportId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(BaseLanguageExportModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"base.language.export was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "165bd88004733402ca32fc2d665f0389", "score": "0.5673516", "text": "func (c *Client) FindBaseAutomationLeadTests(criteria *Criteria, options *Options) (*BaseAutomationLeadTests, error) {\n\tbalts := &BaseAutomationLeadTests{}\n\tif err := c.SearchRead(BaseAutomationLeadTestModel, criteria, options, balts); err != nil {\n\t\treturn nil, err\n\t}\n\treturn balts, nil\n}", "title": "" }, { "docid": "3847bd8a6f59c9f4d39d6236e88c1481", "score": "0.5620739", "text": "func (c *Client) FindAccountAnalyticLineId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(AccountAnalyticLineModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"account.analytic.line was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "5a6d4e080d236d619b213764fff3135c", "score": "0.53675365", "text": "func (v *DecisionTaskTimedOutEventAttributes) GetBaseRunId() (o string) {\n\tif v != nil && v.BaseRunId != nil {\n\t\treturn *v.BaseRunId\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "738bc6303894bef1c3b1d6735d30f84b", "score": "0.5366592", "text": "func (v *DecisionTaskFailedEventAttributes) GetBaseRunId() (o string) {\n\tif v != nil && v.BaseRunId != nil {\n\t\treturn *v.BaseRunId\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a8338a6dfb2587510a4a1829576031cd", "score": "0.5361917", "text": "func (c *Client) GetBaseAutomationLeadTest(id int64) (*BaseAutomationLeadTest, error) {\n\tbalts, err := c.GetBaseAutomationLeadTests([]int64{id})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif balts != nil && len(*balts) > 0 {\n\t\treturn &((*balts)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"id %v of base.automation.lead.test not found\", id)\n}", "title": "" }, { "docid": "d8b4a30fcef7f4aece66c68bd078a104", "score": "0.5238091", "text": "func (c *Client) DeleteBaseAutomationLineTest(id int64) error {\n\treturn c.DeleteBaseAutomationLineTests([]int64{id})\n}", "title": "" }, { "docid": "1ff99c5868813b4050a707d2c3c96612", "score": "0.52038836", "text": "func (mod *Module) findIdentityBase(baseStr string) (*resolvedIdentity, []error) {\n\tvar base resolvedIdentity\n\tvar ok bool\n\tvar errs []error\n\n\tbasePrefix, baseName := getPrefix(baseStr)\n\trootPrefix := mod.GetPrefix()\n\tsource := Source(mod)\n\ttypeDict := mod.Modules.typeDict\n\n\tswitch basePrefix {\n\tcase \"\", rootPrefix:\n\t\t// This is a local identity which is defined within the current\n\t\t// module\n\t\tkeyName := fmt.Sprintf(\"%s:%s\", module(mod).Name, baseName)\n\t\tbase, ok = typeDict.identities.dict[keyName]\n\t\tif !ok {\n\t\t\terrs = append(errs, fmt.Errorf(\"%s: can't resolve the local base %s as %s\", source, baseStr, keyName))\n\t\t}\n\tdefault:\n\t\t// This is an identity which is defined within another module\n\t\textmod := FindModuleByPrefix(mod, basePrefix)\n\t\tif extmod == nil {\n\t\t\terrs = append(errs,\n\t\t\t\tfmt.Errorf(\"%s: can't find external module with prefix %s\", source, basePrefix))\n\t\t\tbreak\n\t\t}\n\t\t// The identity we are looking for is modulename:basename.\n\t\tif id, ok := typeDict.identities.dict[fmt.Sprintf(\"%s:%s\", module(extmod).Name, baseName)]; ok {\n\t\t\tbase = id\n\t\t\tbreak\n\t\t}\n\n\t\t// Error if we did not find the identity that had the name specified in\n\t\t// the module it was expected to be in.\n\t\tif base.isEmpty() {\n\t\t\terrs = append(errs, fmt.Errorf(\"%s: can't resolve remote base %s\", source, baseStr))\n\t\t}\n\t}\n\treturn &base, errs\n}", "title": "" }, { "docid": "c4fa86ee2c67edfad81b4e688d7508df", "score": "0.5184015", "text": "func (c *Client) FindBaseImportTestsModelsPreviewIds(criteria *Criteria, options *Options) ([]int64, error) {\n\tids, err := c.Search(BaseImportTestsModelsPreviewModel, criteria, options)\n\tif err != nil {\n\t\treturn []int64{}, err\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "5367b7f32474e71f98f7e7f81aa9fa46", "score": "0.5162662", "text": "func FindBaseShipmentLineItem(code string) bool {\n\tfor _, item := range BaseShipmentLineItemCodes() {\n\t\tif code == item {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "18b517db024fc1bc86c5b90d7b3ef774", "score": "0.492266", "text": "func (c *Client) FindDecimalPrecisionId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(DecimalPrecisionModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"decimal.precision was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "ebf6f59774629610d6c7bf6c5fb53b5b", "score": "0.48647588", "text": "func GetBaselineID() string {\n\treturn baselineID\n}", "title": "" }, { "docid": "32ceb11f62c6faafd6b3dc6383ba72aa", "score": "0.48576835", "text": "func (c *Client) CreateBaseAutomationLineTest(balt *BaseAutomationLineTest) (int64, error) {\n\treturn c.Create(BaseAutomationLineTestModel, balt)\n}", "title": "" }, { "docid": "7ebdbaf959198bb5251a6a6a9a7e2f4a", "score": "0.482681", "text": "func Test_FindByID(t *testing.T) {\n\t// Connects to the database.\n\tdatabase := DatabaseInit(\"TestTracks\")\n\n\t// Expected results from the database.\n\tvar expected []Track\n\texpected = append(expected,\n\t\tTrack{1, 11, time.Now(), \"pilot1\", \"glider1\", \"glider_id1\", 20.1, \"http://test1.test\"})\n\n\t// Test data.\n\tdatabase.Insert(Track{1, 11, time.Now(), \"pilot1\", \"glider1\", \"glider_id1\", 20.1, \"http://test1.test\"})\n\n\t// Check if correct track was returned, when given the ID 1.\n\tactual, _ := database.FindByID(1)\n\n\tif actual != nil && (actual[0].ID != expected[0].ID) {\n\t\tt.Errorf(\"Method did not return the correct track ID: got %v want %v\",\n\t\t\tactual[0].ID, expected[0].ID)\n\t}\n\n\t// Deletes all from the database.\n\tdatabase.DeleteAll()\n\n\t// Closes the database session.\n\tdefer MDB.Session.Close()\n}", "title": "" }, { "docid": "93f8e96c3b6231dd586413a2100bad91", "score": "0.47772506", "text": "func (c *Client) GetBaseAutomationLeadTests(ids []int64) (*BaseAutomationLeadTests, error) {\n\tbalts := &BaseAutomationLeadTests{}\n\tif err := c.Read(BaseAutomationLeadTestModel, ids, nil, balts); err != nil {\n\t\treturn nil, err\n\t}\n\treturn balts, nil\n}", "title": "" }, { "docid": "5b47f59a97cdbfa6f6af24c60f2e908a", "score": "0.4748567", "text": "func (c *Client) DeleteBaseAutomationLineTests(ids []int64) error {\n\treturn c.Delete(BaseAutomationLineTestModel, ids)\n}", "title": "" }, { "docid": "64fc7c0ffa0594b8cd1cdc403f04ee02", "score": "0.47431982", "text": "func (c *Client) FindMailWizardInviteId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(MailWizardInviteModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"mail.wizard.invite was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "b9976e5bd04318cdcb29eb89c34e351d", "score": "0.4713258", "text": "func (r *testIntModelRepository) FindById(id int) (*TestIntModel, error) {\n\trow, err := r.data.FindById(id)\n\tif row != nil {\n\t\treturn row.(*TestIntModel), err\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "31c8ec902661a0f204407302c90850d5", "score": "0.46691585", "text": "func (db *PgDB) ExperimentIDByTrialID(trialID int) (int, error) {\n\tvar experimentID int\n\tif err := db.sql.Get(&experimentID, `\nSELECT experiment_id FROM trials where id = $1\n`, trialID); err != nil {\n\t\treturn 0, errors.Wrapf(err, \"querying for experiment id for trial %v\", trialID)\n\t}\n\treturn experimentID, nil\n}", "title": "" }, { "docid": "35fc935378e292c7c8e55558abf4612e", "score": "0.46638405", "text": "func (c *Client) FindPosOrderLineId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(PosOrderLineModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"pos.order.line was not found\")\n}", "title": "" }, { "docid": "12558a77eef4d7ee5153649307408917", "score": "0.4656609", "text": "func TestCouchFindById(t *testing.T) {\n\tif cdatabase.Count() > 0 {\n\t\tidString := cdatabase.Read()[0].Get(\"_id\").(string)\n\t\tif cdatabase.FindById(idString) == nil {\n\t\t\tt.Fatalf(\"Error when reading record with specified id\")\n\t\t}\n\t}\n if cdatabase.FindById(\"invalidid\") != nil {\n t.Fatalf(\"Error when reading record with specified id\")\n }\n}", "title": "" }, { "docid": "8748e52eb5bdcac4d2780533101caf39", "score": "0.46261802", "text": "func (p *DigitalOceanProvider) getRecordID(records []godo.DomainRecord, record godo.DomainRecord) int {\n\tfor _, zoneRecord := range records {\n\t\tif zoneRecord.Name == record.Name && zoneRecord.Type == record.Type {\n\t\t\treturn zoneRecord.ID\n\t\t}\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "5a3126af08310380c98192891ef26da7", "score": "0.4613382", "text": "func (m *Match) Base() int64 {\n\treturn int64(m.cptr.base)\n}", "title": "" }, { "docid": "b679f9aa77e6c5078697d7fc76e9fae9", "score": "0.46132338", "text": "func BuildTestRowid(a, b int64) (ret Rowid) {\n\tcopy(ret[0:8], EncodeInt64(&a))\n\tcopy(ret[8:16], EncodeInt64(&b))\n\tcopy(ret[20:], EncodeInt64(&b))\n\treturn\n}", "title": "" }, { "docid": "a6042ee2948ae6079a629d96cb8e83c8", "score": "0.46079734", "text": "func (_m *Repo) FindById(_a0 int) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "be46d1c008f71789f35b2c2e6c6e8b19", "score": "0.45787042", "text": "func (m *MockWorkflowExecutionDao) FindById(arg0 uint, arg1 *gorm.DB) *model.WorkflowExecution {\n\tret := m.ctrl.Call(m, \"FindById\", arg0, arg1)\n\tret0, _ := ret[0].(*model.WorkflowExecution)\n\treturn ret0\n}", "title": "" }, { "docid": "9e600f4d59abe951c7e709535b32c049", "score": "0.4566753", "text": "func (c *Client) FindID(externalID string, queryparams map[string]string) (Find, error) {\n\tvar f Find\n\tdata, err := c.doRequest(http.MethodGet, fmt.Sprintf(\"/%s/%s\", FindEndpoint, externalID), nil, queryparams)\n\tif err != nil {\n\t\treturn f, err\n\t}\n\terr = json.Unmarshal(data, &f)\n\tif err != nil {\n\t\treturn f, errors.Wrap(err, \"failed to unmarshal find response\")\n\t}\n\n\treturn f, nil\n}", "title": "" }, { "docid": "4a5c74fc7df15e498715a9811cb0f42d", "score": "0.4563816", "text": "func (c *Client) FindAccountPaymentTermLineId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(AccountPaymentTermLineModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"account.payment.term.line was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "59a0298dc02c0e79be27bf6e69e1039f", "score": "0.45308176", "text": "func (c *Client) FindBaseImportTestsModelsPreview(criteria *Criteria) (*BaseImportTestsModelsPreview, error) {\n\tbtmps := &BaseImportTestsModelsPreviews{}\n\tif err := c.SearchRead(BaseImportTestsModelsPreviewModel, criteria, NewOptions().Limit(1), btmps); err != nil {\n\t\treturn nil, err\n\t}\n\tif btmps != nil && len(*btmps) > 0 {\n\t\treturn &((*btmps)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"base_import.tests.models.preview was not found with criteria %v\", criteria)\n}", "title": "" }, { "docid": "1091789c863ca8c29e670a73a9fdce36", "score": "0.4525221", "text": "func BaselineGroupID(v string) predicate.BaselineGroup {\n\treturn predicate.BaselineGroup(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldBaselineGroupID), v))\n\t})\n}", "title": "" }, { "docid": "672b8b2ec7c4a0b1c0c41ff0af65eb91", "score": "0.45241445", "text": "func (c *Client) UpdateBaseAutomationLineTest(balt *BaseAutomationLineTest) error {\n\treturn c.UpdateBaseAutomationLineTests([]int64{balt.Id.Get()}, balt)\n}", "title": "" }, { "docid": "dd64d8cced63c17c9471ee5bfa1b47de", "score": "0.45087734", "text": "func GetBaseExercise(id int) *model.BaseExercise {\n\tbaseEx := model.BaseExercise{}\n\tstorage.DB.Find(&baseEx, id)\n\n\tbaseEx.GetBaseExerciseAssociations()\n\n\treturn &baseEx\n}", "title": "" }, { "docid": "5aeba5f9993ea595a415717d8720cd7a", "score": "0.45049345", "text": "func (c *Client) FindAccountAnalyticLine(criteria *Criteria) (*AccountAnalyticLine, error) {\n\taals := &AccountAnalyticLines{}\n\tif err := c.SearchRead(AccountAnalyticLineModel, criteria, NewOptions().Limit(1), aals); err != nil {\n\t\treturn nil, err\n\t}\n\tif aals != nil && len(*aals) > 0 {\n\t\treturn &((*aals)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"account.analytic.line was not found with criteria %v\", criteria)\n}", "title": "" }, { "docid": "bb968a3ff1b5be238c2166e8ce0a80fc", "score": "0.44854724", "text": "func FindRecord(model *Model, id int64) (*Record, os.Error) {\n\n\tkey := model.NewKeyWithID(id)\n\treturn FindRecordByKey(model, key)\n\n}", "title": "" }, { "docid": "460882f5c52c85ef14454b3603077f00", "score": "0.44734773", "text": "func findBasepoint(d []byte) (*jubjub.Point, error) {\n\t// TODO: Fix API. This cannot ever return an error.\n\tgh, _ := grouphash.NewGroupHasher(ZcashDiversifyPersonality)\n\treturn gh.Hash(d)\n}", "title": "" }, { "docid": "c2ba02efc6524a8ccd24ed0f3f184c8d", "score": "0.4457087", "text": "func (c *Client) FindCrmLeadId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(CrmLeadModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"crm.lead was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "249a0b9c4309b2b9db1170aa4a913c01", "score": "0.44516283", "text": "func (c *Client) FindIrQwebFieldRelativeId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(IrQwebFieldRelativeModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"ir.qweb.field.relative was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "5165e05fcb54a45ce2071f6a47d0e214", "score": "0.44473702", "text": "func (d SQLiteDictionary) FindScenarioByID(scenarioID int64) (int64, error) {\n\terr := d.client.QueryRow(\"select id from scenarios where id = $1\", scenarioID).Scan(&scenarioID)\n\tif err == sql.ErrNoRows {\n\t\treturn 0, nil\n\t} else if err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn scenarioID, nil\n}", "title": "" }, { "docid": "e4518c646b466ea435e833e92ca692c3", "score": "0.44388074", "text": "func artifactRunID(path string) (int, error) {\n\tif m := testRunSubdirRe.FindStringSubmatch(path); m != nil {\n\t\treturn strconv.Atoi(m[1])\n\t}\n\n\t// No retry_<i> subdirectory, so assume it's the first/0th run.\n\treturn 0, nil\n}", "title": "" }, { "docid": "939cc4b8fa5e1e22ec9c42fb55bf57ab", "score": "0.44327983", "text": "func (c *SQLServer) FindByID(tableName string, id interface{}) (base.RecordData, error) {\n\tdata := *base.ZeroRecordData()\n\trows, err := queryDB(c.session, fmt.Sprintf(\n\t\t\"SELECT * FROM %s WHERE ID = %v\",\n\t\ttableName, id,\n\t))\n\n\tif err != nil {\n\t\treturn data, err\n\t}\n\n\terr = fetchSingleRecord(rows, &data)\n\n\tif err != nil {\n\t\tdata.Zero()\n\t\treturn data, err\n\t}\n\n\treturn data, err\n}", "title": "" }, { "docid": "be9b216c8ab4be7c461b4f70c93a5f3b", "score": "0.44306177", "text": "func (c *Client) FindBaseLanguageExportIds(criteria *Criteria, options *Options) ([]int64, error) {\n\tids, err := c.Search(BaseLanguageExportModel, criteria, options)\n\tif err != nil {\n\t\treturn []int64{}, err\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "f66d445403fc6bdc124e515fadf48711", "score": "0.44095394", "text": "func (c *Client) FindResPartnerId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(ResPartnerModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"res.partner was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "e15706e4c26332b2e79bd8f292628692", "score": "0.44068918", "text": "func (c *Client) FindBaseLanguageExport(criteria *Criteria) (*BaseLanguageExport, error) {\n\tbles := &BaseLanguageExports{}\n\tif err := c.SearchRead(BaseLanguageExportModel, criteria, NewOptions().Limit(1), bles); err != nil {\n\t\treturn nil, err\n\t}\n\tif bles != nil && len(*bles) > 0 {\n\t\treturn &((*bles)[0]), nil\n\t}\n\treturn nil, fmt.Errorf(\"base.language.export was not found with criteria %v\", criteria)\n}", "title": "" }, { "docid": "64c947bbdb26611a1bc385a417ef31db", "score": "0.43988302", "text": "func DevTestVirtualMachineID(input string) (*DevTestVirtualMachineId, error) {\n\tid, err := resourceids.ParseAzureResourceID(input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresourceId := DevTestVirtualMachineId{\n\t\tSubscriptionId: id.SubscriptionID,\n\t\tResourceGroup: id.ResourceGroup,\n\t}\n\n\tif resourceId.SubscriptionId == \"\" {\n\t\treturn nil, fmt.Errorf(\"ID was missing the 'subscriptions' element\")\n\t}\n\n\tif resourceId.ResourceGroup == \"\" {\n\t\treturn nil, fmt.Errorf(\"ID was missing the 'resourceGroups' element\")\n\t}\n\n\tif resourceId.LabName, err = id.PopSegment(\"labs\"); err != nil {\n\t\treturn nil, err\n\t}\n\tif resourceId.VirtualMachineName, err = id.PopSegment(\"virtualMachines\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := id.ValidateNoEmptySegments(input); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &resourceId, nil\n}", "title": "" }, { "docid": "7aba0c65b29f767dd8298de50d846655", "score": "0.43766153", "text": "func FindID(ip string) string {\n\treturn strings.Split(strings.Split(ip, \".\")[3], \":\")[0]\n}", "title": "" }, { "docid": "7aba0c65b29f767dd8298de50d846655", "score": "0.43766153", "text": "func FindID(ip string) string {\n\treturn strings.Split(strings.Split(ip, \".\")[3], \":\")[0]\n}", "title": "" }, { "docid": "c3f20f31e04e34c04f15574fcdd8306e", "score": "0.43658888", "text": "func (c *Client) FindReportAccountReportTrialbalanceId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(ReportAccountReportTrialbalanceModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"report.account.report_trialbalance was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "26be8b1132bc80088051298096a000ec", "score": "0.436024", "text": "func BaseLine(lf *lidario.LasFile) []int {\n\tc := &counter.Counter{}\n\tc.Init(lf.Header.MinX, lf.Header.MinY, lf.Header.MaxX, lf.Header.MaxY, 1)\n\tread := counter.Reader{}\n\tgo read.Serve(c.ReadStream, c)\n\twrite := counter.Writer{}\n\tgo write.Serve(c.WriteStream, c)\n\t//counter start counting\n\twg := &sync.WaitGroup{}\n\twg.Add(1)\n\tgo c.Count(0, lf.Header.NumberPoints, lf, wg)\n\twg.Wait()\n\tfmt.Printf(\"Baseline Total Point %d \\n\", c.NumberOfPoint)\n\treturn c.DensityMap\n}", "title": "" }, { "docid": "213900934f43f2d0279b1f8435099d34", "score": "0.43596283", "text": "func TestID(name string) ID {\n\treturn ID(RootDir{path: name})\n}", "title": "" }, { "docid": "84ec5c2f64af19cb0a22250dfe7cd30b", "score": "0.4349183", "text": "func (c *Client) UpdateBaseAutomationLineTests(ids []int64, balt *BaseAutomationLineTest) error {\n\treturn c.Update(BaseAutomationLineTestModel, ids, balt)\n}", "title": "" }, { "docid": "44f86320d83beac6116c67c0e3d5fe8f", "score": "0.43382147", "text": "func findLine(data []byte, offset int64) (line int) {\n\tfmt.Println(\"in findLine\")\n\tline = 1\n\tfor i, r := range string(data) {\n\t\tif int64(i) >= offset {\n\t\t\treturn\n\t\t}\n\t\tif r == '\\n' {\n\t\t\tline++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "35cc80a18d6ce3a922e052606cea5f33", "score": "0.43358082", "text": "func Test_FindByID_Empty(t *testing.T) {\n\t// Connects to the database.\n\tdatabase := DatabaseInit(\"TestTracks\")\n\n\t_, err := database.FindByID(1)\n\tif err == nil {\n\t\tt.Errorf(\"Method returned wrong error: got %v want %v\",\n\t\t\t\"not found\", err)\n\t}\n\n\t// Closes the database session.\n\tdefer MDB.Session.Close()\n}", "title": "" }, { "docid": "e35143b289f0e72411651cad26ba027b", "score": "0.43349954", "text": "func (q *TestModelQuery) FindByID(v ...int64) *TestModelQuery {\n\tif len(v) == 0 {\n\t\treturn q\n\t}\n\tvalues := make([]interface{}, len(v))\n\tfor i, val := range v {\n\t\tvalues[i] = val\n\t}\n\treturn q.Where(kallax.In(Schema.TestModel.ID, values...))\n}", "title": "" }, { "docid": "4d299b0efd227b088a13045bb3013ed2", "score": "0.4321859", "text": "func recordSpecByID(cmd *cobra.Command, recordSpecID types.MetadataAddress) error {\n\tif !recordSpecID.IsRecordSpecificationAddress() {\n\t\treturn fmt.Errorf(\"id %s is not a record specification metadata address\", recordSpecID)\n\t}\n\n\tclientCtx, err := client.GetClientQueryContext(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tqueryClient := types.NewQueryClient(clientCtx)\n\tres, err := queryClient.RecordSpecificationByID(\n\t\tcontext.Background(),\n\t\t&types.RecordSpecificationByIDRequest{RecordSpecificationId: recordSpecID.String()},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res == nil || res.RecordSpecification == nil {\n\t\treturn fmt.Errorf(\"no record specification found with id %s\", recordSpecID)\n\t}\n\treturn clientCtx.PrintProto(res.RecordSpecification)\n}", "title": "" }, { "docid": "26620885adb606b609d3fbaf8487c465", "score": "0.43070588", "text": "func (m *PstnCallLogRow) GetId()(*string) {\n val, err := m.GetBackingStore().Get(\"id\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "07ff1e859414631c267380b3add9cb74", "score": "0.43032396", "text": "func (iff MtInterface) GetOidForInterface(oidBase string) string {\n\toidIdx := strconv.Itoa(iff._index)\n\tif !strings.HasSuffix(oidBase, \".\") {\n\t\toidBase += \".\"\n\t}\n\treturn oidBase + oidIdx\n}", "title": "" }, { "docid": "9af3882db329f4cbc2e3438fa12b23d4", "score": "0.4283027", "text": "func (jr *JWTRepository) FindIDByAccessUUID(au string) (int, error) {\n\tidStr, err := jr.ConnRedis.Get(au).Result()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tvar id int\n\tid, err = strconv.Atoi(idStr)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn id, nil\n}", "title": "" }, { "docid": "b10475f60846cbd05f09f654e1538b58", "score": "0.42768484", "text": "func recordByID(cmd *cobra.Command, recordID types.MetadataAddress) error {\n\tif !recordID.IsRecordAddress() {\n\t\treturn fmt.Errorf(\"id %s is not a record metadata address\", recordID)\n\t}\n\tscopeUUID, err := recordID.ScopeUUID()\n\tif err != nil {\n\t\treturn err\n\t}\n\tclientCtx, err := client.GetClientQueryContext(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tqueryClient := types.NewQueryClient(clientCtx)\n\tres, err := queryClient.Scope(context.Background(), &types.ScopeRequest{ScopeUuid: scopeUUID.String()})\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar record *types.Record = nil\n\tfor _, r := range res.Records {\n\t\tif recordID.Equals(types.RecordMetadataAddress(scopeUUID, r.Name)) {\n\t\t\trecord = r\n\t\t\tbreak\n\t\t}\n\t}\n\tif record == nil {\n\t\treturn fmt.Errorf(\"no records with id %s found in scope with uuid %s\", recordID, scopeUUID)\n\t}\n\treturn clientCtx.PrintProto(record)\n}", "title": "" }, { "docid": "b8448e030a63851feccbb39bfeefcc6c", "score": "0.42754236", "text": "func (p *Patcher) FindBaseAddress(find []byte) error {\n\tif len(find) > len(p.buf) {\n\t\treturn errors.New(\"FindBaseAddress: length of bytes to find greater than buf\")\n\t}\n\ti := bytes.Index(p.buf, find)\n\tif i < 0 {\n\t\treturn errors.New(\"FindBaseAddress: could not find bytes\")\n\t}\n\tp.cur = int32(i)\n\treturn nil\n}", "title": "" }, { "docid": "3115376a318c5bd71dc27b3133d99ff1", "score": "0.425799", "text": "func (it *schemareplicantBlock) RebaseAutoID(ctx stochastikctx.Context, newBase int64, isSetStep bool, tp autoid.SlabPredictorType) error {\n\treturn causet.ErrUnsupportedOp\n}", "title": "" }, { "docid": "8c682497eaa22d7455c067dfebc72da9", "score": "0.42511058", "text": "func (co ContactRepository) GetIDByData(clientid string, language string, identifier string) int {\n\n\tquery := `\n\tSELECT contactid FROM contact \n\tWHERE clientid = $1 AND language = $2 AND identifier = $3`\n\n\tvar contactid int\n\n\terr := co.queryable.QueryRow(query, clientid, language, identifier).Scan(&contactid)\n\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn contactid\n}", "title": "" }, { "docid": "f5d8ddf64b9822cdcc58f5efb31eacc4", "score": "0.42443296", "text": "func (s *ClientRequestLogPostgresStorage) FindByID(ctx *context.Context, clientRequestLogID int) *client.ClientRequestLog {\n\tvar clientRequestLog client.ClientRequestLog\n\terr := s.repository.FindByID(ctx, &clientRequestLog, clientRequestLogID)\n\tif err != nil {\n\t\tfmt.Printf(`Error while collecting \"clientRequestLog\": %v`, types.Error{\n\t\t\tPath: \".ClientRequestLogPostgresStorage->FindByID()\",\n\t\t\tMessage: err.Error(),\n\t\t\tError: err,\n\t\t\tType: \"pq-error\",\n\t\t})\n\t\treturn nil\n\t}\n\treturn &clientRequestLog\n}", "title": "" }, { "docid": "188b8f6d5c3a24db90e925ac8d26eb46", "score": "0.4244077", "text": "func FindInstrumentSource(exec boil.Executor, id int16, selectCols ...string) (*InstrumentSource, error) {\n\tinstrumentSourceObj := &InstrumentSource{}\n\n\tsel := \"*\"\n\tif len(selectCols) > 0 {\n\t\tsel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), \",\")\n\t}\n\tquery := fmt.Sprintf(\n\t\t\"select %s from \\\"instruments\\\".\\\"instrument_source\\\" where \\\"id\\\"=$1\", sel,\n\t)\n\n\tq := queries.Raw(exec, query, id)\n\n\terr := q.Bind(instrumentSourceObj)\n\tif err != nil {\n\t\tif errors.Cause(err) == sql.ErrNoRows {\n\t\t\treturn nil, sql.ErrNoRows\n\t\t}\n\t\treturn nil, errors.Wrap(err, \"models: unable to select from instrument_source\")\n\t}\n\n\treturn instrumentSourceObj, nil\n}", "title": "" }, { "docid": "c278bf94e84408870f3e04d6bf75ad49", "score": "0.4242513", "text": "func (sessionRepositoryMock *SessionRepositoryMock) FindByID(id string) (*entities.Session, error) {\n\treturn sessionRepositoryMock.FindByIDImpl(id)\n}", "title": "" }, { "docid": "af1ef483bdbdbff0b53e62c839fe0d81", "score": "0.42343584", "text": "func (r *baseRepository) FindOneByID(v interface{}, id int64) (err error) {\n\treturn r.WithinTransaction(func(tx *gorm.DB) error {\n\t\tif err = tx.Last(v, id).Error; err != nil {\n\t\t\ttx.Rollback() // rollback db transaction\n\t\t\treturn err\n\t\t}\n\t\treturn err\n\t})\n}", "title": "" }, { "docid": "9a70b15f0a77703ee432a88df66b71d1", "score": "0.42328492", "text": "func AaaaRecordID(input string) (*AaaaRecordId, error) {\n\tid, err := azure.ParseAzureResourceID(input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresourceId := AaaaRecordId{\n\t\tSubscriptionId: id.SubscriptionID,\n\t\tResourceGroup: id.ResourceGroup,\n\t}\n\n\tif resourceId.SubscriptionId == \"\" {\n\t\treturn nil, fmt.Errorf(\"ID was missing the 'subscriptions' element\")\n\t}\n\n\tif resourceId.ResourceGroup == \"\" {\n\t\treturn nil, fmt.Errorf(\"ID was missing the 'resourceGroups' element\")\n\t}\n\n\tif resourceId.PrivateDnsZoneName, err = id.PopSegment(\"privateDnsZones\"); err != nil {\n\t\treturn nil, err\n\t}\n\tif resourceId.AAAAName, err = id.PopSegment(\"AAAA\"); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := id.ValidateNoEmptySegments(input); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &resourceId, nil\n}", "title": "" }, { "docid": "45f98f95ddf1fb4b3c2d03678fd15157", "score": "0.42309034", "text": "func findLine(data []byte, offset int64) (line int) {\n\tline = 1\n\tfor i, r := range string(data) {\n\t\tif int64(i) >= offset {\n\t\t\treturn\n\t\t}\n\t\tif r == '\\n' {\n\t\t\tline++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "45f98f95ddf1fb4b3c2d03678fd15157", "score": "0.42309034", "text": "func findLine(data []byte, offset int64) (line int) {\n\tline = 1\n\tfor i, r := range string(data) {\n\t\tif int64(i) >= offset {\n\t\t\treturn\n\t\t}\n\t\tif r == '\\n' {\n\t\t\tline++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "45f98f95ddf1fb4b3c2d03678fd15157", "score": "0.42309034", "text": "func findLine(data []byte, offset int64) (line int) {\n\tline = 1\n\tfor i, r := range string(data) {\n\t\tif int64(i) >= offset {\n\t\t\treturn\n\t\t}\n\t\tif r == '\\n' {\n\t\t\tline++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "45f98f95ddf1fb4b3c2d03678fd15157", "score": "0.42309034", "text": "func findLine(data []byte, offset int64) (line int) {\n\tline = 1\n\tfor i, r := range string(data) {\n\t\tif int64(i) >= offset {\n\t\t\treturn\n\t\t}\n\t\tif r == '\\n' {\n\t\t\tline++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "45f98f95ddf1fb4b3c2d03678fd15157", "score": "0.42309034", "text": "func findLine(data []byte, offset int64) (line int) {\n\tline = 1\n\tfor i, r := range string(data) {\n\t\tif int64(i) >= offset {\n\t\t\treturn\n\t\t}\n\t\tif r == '\\n' {\n\t\t\tline++\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "6ac80d60f5489ca268fad964eeafbac2", "score": "0.42249092", "text": "func (arm accountRepositoryMock) FindOneByID(id uint64) (*entity.Account, error) {\n\tif arm.err != nil {\n\t\treturn nil, arm.err\n\t}\n\n\treturn arm.acc, nil\n}", "title": "" }, { "docid": "dfd405398f8f9169c8597e840d1b1a28", "score": "0.421883", "text": "func findLineToInsertCommandTo(path string) (int, error) {\n\tval, err := FindLineToInsertCommandTo(path, BASE_COMMAND_INSERT_LINE)\n\tcheck(err)\n\treturn val, nil\n}", "title": "" }, { "docid": "58f5a769f90bb7ed5ee3debc3c3bd00f", "score": "0.42114937", "text": "func (c *Client) FindAccountAnalyticLineIds(criteria *Criteria, options *Options) ([]int64, error) {\n\tids, err := c.Search(AccountAnalyticLineModel, criteria, options)\n\tif err != nil {\n\t\treturn []int64{}, err\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "c8159226d28d60d68a21670533eac6e9", "score": "0.42104053", "text": "func computeBaseRow(subSquare int) (int, error) {\n\tif subSquare < 0 || subSquare > numSubSquares {\n\t\treturn -1, errors.New(fmt.Sprintf(\"INVALID SUB SQUARE: %d\", subSquare))\n\t}\n\n\tsubSquare = (subSquare / subGridRows) * subGridRows\n\treturn subSquare, nil\n}", "title": "" }, { "docid": "0ce75a40415ac28a6bd59220068b4e15", "score": "0.4206771", "text": "func BenchmarkFindById(b *testing.B) {\n\ttestingSetUp()\n\tdefer testingTearDown()\n\n\t// create some models\n\tms, err := newBasicModels(1000)\n\tif err != nil {\n\t\tb.Error(err)\n\t}\n\tMSave(Models(ms))\n\tids := make([]string, len(ms))\n\tfor i, p := range ms {\n\t\tids[i] = p.Id\n\t}\n\tb.ResetTimer()\n\n\t// run the actual test\n\tfor i := 0; i < b.N; i++ {\n\t\tb.StopTimer()\n\t\tindex := randInt(0, len(ms)-1)\n\t\tid := ids[index]\n\t\tb.StartTimer()\n\t\tFindById(\"basicModel\", id)\n\t}\n}", "title": "" }, { "docid": "06eae5e6cf0b98a2e73f7534e856d7bf", "score": "0.42057973", "text": "func FindLatestRecording(arch *archive.Archive, channel string, stream int32) (*codecs.RecordingDescriptor, error) {\n\tdescriptors, err := arch.ListRecordingsForUri(0, 100, \"\", stream)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(descriptors) == 0 {\n\t\treturn nil, fmt.Errorf(\"no recordings found\")\n\t}\n\n\tdescriptor := descriptors[len(descriptors)-1]\n\tif descriptor.StopPosition == 0 {\n\t\treturn nil, fmt.Errorf(\"recording length zero\")\n\t}\n\n\t// Return the last recordingID\n\treturn descriptor, nil\n}", "title": "" }, { "docid": "ce2b3aaa284cf4ed12e8519e41463f20", "score": "0.42035693", "text": "func (_BaasEscrow *BaasEscrowCaller) CurrentCapitalRaiseId(opts *bind.CallOpts) (*big.Int, error) {\n\tvar (\n\t\tret0 = new(*big.Int)\n\t)\n\tout := ret0\n\terr := _BaasEscrow.contract.Call(opts, out, \"currentCapitalRaiseId\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "de57db57e89b8b260e0ad08c91e15389", "score": "0.41956344", "text": "func getTraceID(t *testing.T, client *lib.Client, loggerPodName string) string {\n\tlogs, err := client.GetLog(loggerPodName)\n\tif err != nil {\n\t\tt.Fatalf(\"Error getting logs: %v\", err)\n\t}\n\t// This is the format that the eventdetails image prints headers.\n\tre := regexp.MustCompile(\"\\nGot Header X-B3-Traceid: ([a-zA-Z0-9]{32})\\n\")\n\tmatches := re.FindStringSubmatch(logs)\n\tif len(matches) != 2 {\n\t\tt.Fatalf(\"Unable to extract traceID: %q\", logs)\n\t}\n\ttraceID := matches[1]\n\treturn traceID\n}", "title": "" }, { "docid": "b8c5f0b8f7e0c01d712de0907a6e91e4", "score": "0.41926393", "text": "func retrieveTestCaseIds(tcs []lookupTestCase, index, field string) error {\n\tpql := fmt.Sprintf(\"Extract(All(), Rows(%s))\", field)\n\n\teResp, err := idktest.DoExtractQuery(pql, index)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif eResp.Results[0].Columns == nil {\n\t\treturn errors.Errorf(\"no data in Extract response\")\n\t}\n\n\t// Correlate PilosaVal to assign corresponding IDs.\n\tfor n, tc := range tcs {\n\t\tfor _, col := range eResp.Results[0].Columns {\n\t\t\t// ?? panic: interface conversion: interface {} is float64, not uint64\n\t\t\tif uint64(col.Rows[0].(float64)) == tc.uniquePilosaVal {\n\t\t\t\ttcs[n].externalId = uint64(col.ColumnID)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif tcs[n].externalId == 0 {\n\t\t\t// NOTE This assumes an ID of 0 will not be used by the Nexter.\n\t\t\treturn errors.Errorf(\"no externalID found for test case with uniquePilosaVal=%d\", tc.uniquePilosaVal)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "af6c88068cb0c0e7ea859cf42ab640fc", "score": "0.41784057", "text": "func (m *Mongo) FindID(id any) Crud {\n\tclone := m.clone()\n\n\tres := clone.m.Collection(clone.param.Table).FindOne(context.TODO(), bson.M{\"_id\": id.(primitive.ObjectID)})\n\tm.err = res.Err()\n\tif m.err == nil {\n\t\tm.err = res.Decode(clone.param.Data)\n\t}\n\treturn clone\n}", "title": "" }, { "docid": "0700250c3765c83f76df10876cd671ab", "score": "0.41733423", "text": "func (model *Agent) FindbyID(id uint64) error {\n\terr := basemodel.FindbyID(&model, id)\n\treturn err\n}", "title": "" }, { "docid": "f2ef36d66bc71df06601bf53e9b2f75e", "score": "0.41535142", "text": "func (c *Client) FindLinkTrackerCodeId(criteria *Criteria, options *Options) (int64, error) {\n\tids, err := c.Search(LinkTrackerCodeModel, criteria, options)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tif len(ids) > 0 {\n\t\treturn ids[0], nil\n\t}\n\treturn -1, fmt.Errorf(\"link.tracker.code was not found with criteria %v and options %v\", criteria, options)\n}", "title": "" }, { "docid": "eee70236a17aebbc8bd7155ee3c03aca", "score": "0.41502443", "text": "func (s *SynapseTracker) FindID(src, dst IDType) (IDType, error) {\n\tfor synID := range s.srcMap[src] {\n\t\tif s.idMap[synID].dst == dst {\n\t\t\treturn synID, nil\n\t\t}\n\t}\n\n\treturn 0, fmt.Errorf(\"non-existent synapse src=%d,dst=%d\", src, dst)\n}", "title": "" }, { "docid": "70bfc787069c7f8820f2f43dc4b771a4", "score": "0.41487938", "text": "func FindById(id int, table string) (int, error) {\n\tvar (\n\t\tname string\n\t\tSql = \"SELECT `name` FROM \" + table + \" WHERE id = ? AND deleted_at = '0000-01-01 00:00:00'\"\n\t)\n\terr := ConnDB().QueryRow(Sql, id).Scan(&name)\n\t// not found\n\tif err == sql.ErrNoRows {\n\t\treturn -1, nil\n\t}\n\t// error\n\tif err != nil {\n\t\treturn 1, err\n\t}\n\treturn 0, nil\n}", "title": "" }, { "docid": "7ab401f21a187cef11b38b87d460fe45", "score": "0.41435167", "text": "func TestFindByIdFail(t *testing.T) {\n\tsession := testSetup()\n\tdefer testTearDown(session)\n\tmanager, err := um.Open(\"postgres\", c_testDns)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer manager.Close()\n\n\tuser, err := manager.FindById(1000)\n\tif !(err != nil && user == nil) {\n\t\tt.Error(\"FindById must return an error and a nil-um.User\")\n\t\tt.FailNow()\n\t}\n}", "title": "" }, { "docid": "fd46e4bbee11025ed37e70c7e5ca37bf", "score": "0.41396737", "text": "func (b *DeviceManagementUserExperienceAnalyticsBaselinesCollectionRequestBuilder) ID(id string) *UserExperienceAnalyticsBaselineRequestBuilder {\n\tbb := &UserExperienceAnalyticsBaselineRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}\n\tbb.baseURL += \"/\" + id\n\treturn bb\n}", "title": "" }, { "docid": "3229db597480803009e9d88b3f6a57c1", "score": "0.41392127", "text": "func ID(id int) predicate.BaselineGroup {\n\treturn predicate.BaselineGroup(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldID), id))\n\t})\n}", "title": "" }, { "docid": "4c35269e5c1c1b6aebb42b0ebfe479d6", "score": "0.41380927", "text": "func getDNSRecordID(ctx context.Context, domainName, recType, content string) (string, error) {\n\tquery := \"?type=\" + recType + \"&name=\" + url.QueryEscape(domainName)\n\tif content != \"\" {\n\t\tquery = query + \"&content=\" + content\n\t}\n\n\tresponse, err := sendDNSRequest(ctx, \"GET\", query, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tresult := response[\"result\"].([]interface{})\n\tif len(result) == 0 {\n\t\treturn \"\", nil\n\t}\n\trec := result[0].(map[string]interface{})\n\treturn rec[\"id\"].(string), nil\n}", "title": "" }, { "docid": "5dee9e970d4d85a3f0f7fed19d1a24ce", "score": "0.4128946", "text": "func TestFindByIdSuccess(t *testing.T) {\n\tsession := testSetup()\n\tdefer testTearDown(session)\n\tmanager, err := um.Open(\"postgres\", c_testDns)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer manager.Close()\n\n\tuser, err := manager.FindById(1)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif user == nil {\n\t\tt.Error(\"FindById did not return a valid user for ID #1\")\n\t\tt.FailNow()\n\t}\n\tif id := user.Id(); id != 1 {\n\t\tt.Errorf(\"User ID returns %d, but 1 is expected\", id)\n\t\tt.Fail()\n\t}\n\tif emailAddr := user.EmailAddr(); emailAddr != \"fixtureuser1@example.com\" {\n\t\tt.Errorf(\"Email address returns '%s', but 'fixtureuser1@example.com' is expected\", emailAddr)\n\t\tt.Fail()\n\t}\n\tif displayName := user.DisplayName(); displayName != \"Fixture User 1\" {\n\t\tt.Errorf(\"Display name is '%s' but 'Fixture User 1' is expected\", displayName)\n\t\tt.Fail()\n\t}\n}", "title": "" }, { "docid": "93f3ebb9e9670ef9d27bfdd2e4e5bcad", "score": "0.41164663", "text": "func (evt IdentifyEvent) GetBase() BaseEvent {\n\treturn evt.BaseEvent\n}", "title": "" } ]
93d671419ff28795d25b977089bfcc36
Validate validates s against the YANG schema corresponding to its type.
[ { "docid": "36ec5baaa35b7ee16a874ff78e174fe8", "score": "0.0", "text": "func (t *SrlNokiaSystem_System_JsonRpcServer_UnixSocket) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaSystem_System_JsonRpcServer_UnixSocket\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "251f203dfcef9b125c8244e559a19563", "score": "0.66918874", "text": "func validateString(schema *yang.Entry, value interface{}) error {\n\t// Check that the schema itself is valid.\n\tif err := validateStringSchema(schema); err != nil {\n\t\treturn err\n\t}\n\n\tvv := reflect.ValueOf(value)\n\n\t// Check that type of value is the type expected from the schema.\n\tif vv.Kind() != reflect.String {\n\t\treturn fmt.Errorf(\"non string type %T with value %v for schema %s\", value, value, schema.Name)\n\t}\n\n\t// This value could be a union typedef string, so convert it to make\n\t// sure it's the primitive string type.\n\tstringVal := vv.Convert(reflect.TypeOf(\"\")).Interface().(string)\n\n\t// Check that the length is within the allowed range.\n\tallowedRanges := schema.Type.Length\n\tstrLen := uint64(utf8.RuneCountInString(stringVal))\n\tif !lengthOk(allowedRanges, strLen) {\n\t\treturn fmt.Errorf(\"length %d is outside range %v for schema %s\", strLen, allowedRanges, schema.Name)\n\t}\n\n\t// Check that the value satisfies any regex patterns.\n\tpatterns, isPOSIX := util.SanitizedPattern(schema.Type)\n\tfor _, p := range patterns {\n\t\tvar r *regexp.Regexp\n\t\tvar err error\n\t\tif isPOSIX {\n\t\t\tr, err = regexp.CompilePOSIX(p)\n\t\t} else {\n\t\t\tr, err = regexp.Compile(p)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !r.MatchString(stringVal) {\n\t\t\treturn fmt.Errorf(\"%q does not match regular expression pattern %q for schema %s\", stringVal, r, schema.Name)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6d29d6b06ed79d27c7ff6aff4f111f51", "score": "0.6312151", "text": "func validateStringSchema(schema *yang.Entry) error {\n\tif schema == nil {\n\t\treturn fmt.Errorf(\"string schema is nil\")\n\t}\n\tif schema.Type == nil {\n\t\treturn fmt.Errorf(\"string schema %s Type is nil\", schema.Name)\n\t}\n\tif schema.Type.Kind != yang.Ystring {\n\t\treturn fmt.Errorf(\"string schema %s has wrong type %v\", schema.Name, schema.Type.Kind)\n\t}\n\n\tpatterns, isPOSIX := util.SanitizedPattern(schema.Type)\n\tfor _, p := range patterns {\n\t\tvar err error\n\t\tif isPOSIX {\n\t\t\t_, err = regexp.CompilePOSIX(p)\n\t\t} else {\n\t\t\t_, err = regexp.Compile(p)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error generating regexp %s %v for schema %s\", p, err, schema.Name)\n\t\t}\n\t}\n\n\treturn validateLengthSchema(schema)\n}", "title": "" }, { "docid": "00e41bc756964483eba15dc95a439df5", "score": "0.61309063", "text": "func (v *Validator) Validate(s interface{}) error {\n\treturn v.validator.Struct(s)\n}", "title": "" }, { "docid": "7bb08f1f8826430e8ca5f992dffa8a8c", "score": "0.60911846", "text": "func (m MessageS) Validate() error {\n\terr, _ := m.Value.(error)\n\treturn err\n}", "title": "" }, { "docid": "d9155c4ced5749272e118e867b0b3be4", "score": "0.57544684", "text": "func validateType(t Type) error {\n\tif ToType(string(t)) == UnknownType {\n\t\treturn skerr.Wrapf(ErrInvalidScrapType, \"got: %q\", t)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ae0cd8da02f743d57c4c11dfc2430ac", "score": "0.5729637", "text": "func (c *isType) Validate(value interface{}) error {\n\tif !c.theType.AssignableTo(reflect.TypeOf(value)) {\n\t\treturn fmt.Errorf(TypeMessage, c.theType.String())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "69d47f1c0e537a6dd704186009370687", "score": "0.57275325", "text": "func (t MessageType) Validate() (ok bool) {\n\t_, ok = typeToString[t]\n\treturn\n}", "title": "" }, { "docid": "261c45735622d80295628041bda9d5e5", "score": "0.5659264", "text": "func isValidType(s string) bool {\n\ts = strings.ToLower(s)\n\tif s == \"event\" ||\n\t\ts == \"bool\" ||\n\t\ts == \"byte\" ||\n\t\ts == \"word\" ||\n\t\ts == \"dword\" ||\n\t\ts == \"lword\" ||\n\t\ts == \"sint\" ||\n\t\ts == \"usint\" ||\n\t\ts == \"int\" ||\n\t\ts == \"uint\" ||\n\t\ts == \"dint\" ||\n\t\ts == \"udint\" ||\n\t\ts == \"lint\" ||\n\t\ts == \"ulint\" ||\n\t\ts == \"real\" ||\n\t\ts == \"lreal\" ||\n\t\ts == \"time\" ||\n\t\ts == \"dtimer\" ||\n\t\ts == \"rtimer\" ||\n\t\ts == \"any\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "3d1bf7720b1c03c67df50dfd3a3a983d", "score": "0.5640427", "text": "func Validate(v interface{}) error {\n\tif reflect.TypeOf(v).Kind() == reflect.String {\n\t\treturn nil\n\t}\n\tval := reflect.ValueOf(v)\n\tif val.Kind() == reflect.Ptr && !val.IsNil() {\n\t\tswitch val.Elem().Kind() {\n\t\tcase reflect.String, reflect.Slice:\n\t\t\treturn nil\n\t\t}\n\t}\n\tif DefaultValidator == nil {\n\t\tDefaultValidator = NewDefaultValidator()\n\t}\n\treturn DefaultValidator.Struct(v)\n}", "title": "" }, { "docid": "fc80b94e8a0ae26c156e9910003367b3", "score": "0.559415", "text": "func (m *CsrType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateCsrDer(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateDuration(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": "403b517e263b68024a088c161c2e657b", "score": "0.5564539", "text": "func ValidateStruct(s interface{}) error {\n\treturn DefaultValidator().ValidateStruct(s)\n}", "title": "" }, { "docid": "fe3b4da1609b02882ec92186c14f128b", "score": "0.55547017", "text": "func validateSchema(schema string) error {\n\tvar sc spec.Schema\n\terr := sc.UnmarshalJSON([]byte(schema))\n\tif err != nil {\n\t\treturn errors.Errorf(\"unable to parse schema: %v\", err)\n\t}\n\treturn validateSchemaTypes(&sc)\n}", "title": "" }, { "docid": "d81b8f8b9f0d6f8f1e725138592f841e", "score": "0.55276996", "text": "func (pTypeDef *StringTest) Validate() error {\n\tif pTypeDef.Name == \"\" {\n\t\treturn fmt.Errorf(\"StringTest: Missing required field: name\")\n\t}\n\tif pTypeDef.Parent == \"\" {\n\t\treturn fmt.Errorf(\"StringTest: Missing required field: parent\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "68516aa2ace93e043f2c7b624439bac0", "score": "0.5516445", "text": "func (s *JSONSchema) Validate(data map[string]interface{}) error {\n\tres, err := s.s.Validate(gojsonschema.NewGoLoader(data))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !res.Valid() {\n\t\treturn errors.New(res.Errors()[0].String())\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dac9d004ff35d73f86eb6c711e82e785", "score": "0.5514449", "text": "func (v Validate) ValidateStruct(s interface{}) []models.ValidationError {\n\tt := reflect.TypeOf(s)\n\tvl := reflect.ValueOf(s)\n\n\tvar sMetaData []models.StructMetaData\n\t// initial(root) tag value is empty\n\tmetaData := getStructInfo(t, vl, sMetaData, \"\")\n\n\tvar vErr []models.ValidationError\n\tfor _, m := range metaData {\n\t\ttagArray := strings.Split(m.ValidationType, \",\")\n\t\ter := validate(tagArray, m)\n\t\tif len(er) != 0 {\n\t\t\tvErr = append(vErr, er...)\n\t\t}\n\t}\n\n\treturn vErr\n}", "title": "" }, { "docid": "1f5cc14f7694380770f0cd590fbe4d18", "score": "0.54675806", "text": "func (mt *Sample) Validate() (err error) {\n\n\tif mt.StringType == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"stringType\"))\n\t}\n\tif mt.Email == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"email\"))\n\t}\n\tif mt.EnumType == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"enumType\"))\n\t}\n\tif mt.DefaultType == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"defaultType\"))\n\t}\n\tif mt.Reg == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`response`, \"reg\"))\n\t}\n\treturn\n}", "title": "" }, { "docid": "010fff6b331b8e8e4788aa1e5c2fc076", "score": "0.5447624", "text": "func (m *MeasurementTypeName) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "18e6717f85f52ad9ca516fbc0eb456ee", "score": "0.54365635", "text": "func ValidateStruct(strct interface{}) []domain.NuxError {\n\treturn internal.ValidateStruct(strct)\n}", "title": "" }, { "docid": "e8e05ff62d9d0b9ca7829a573888bcf3", "score": "0.5422699", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "54f221e3c578da808ae4e5899d79dba6", "score": "0.5419619", "text": "func (m *Schema) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateClasses(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validateMaintainer(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": "f171e62343c7c50ff47a427f7950ec6e", "score": "0.5409118", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Lsdb_LsaTypes_LsaType) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Lsdb_LsaTypes_LsaType\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c47c122d3ef2fb504c6d019d8df1351f", "score": "0.54075146", "text": "func validateSchemaTypes(sc *spec.Schema) error {\n\tif len(sc.Type) > 1 {\n\t\treturn errors.Errorf(\"only one type is supported: %s\", strings.Join(sc.Type, \", \"))\n\t}\n\n\tif len(sc.Type) == 1 {\n\t\tt := sc.Type[0]\n\t\tvar match bool\n\t\tfor _, validType := range validTypeValues {\n\t\t\tif t == validType {\n\t\t\t\tmatch = true\n\t\t\t}\n\t\t}\n\t\tif !match {\n\t\t\treturn errors.Errorf(\"type %q is not supported. Must be one of: %s\",\n\t\t\t\tt, strings.Join(validTypeValues, \", \"))\n\t\t}\n\t}\n\n\tif items := sc.Items; items != nil {\n\t\tif items.Schema != nil {\n\t\t\terr := validateSchemaTypes(items.Schema)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor i := range items.Schemas {\n\t\t\tschema := items.Schemas[i]\n\t\t\terr := validateSchemaTypes(&schema)\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": "ac0d42729735f45e7904ab8fe7ac8f5f", "score": "0.54017955", "text": "func (m *BitString) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "813ae0d2c387d0fd75bba05a571fb546", "score": "0.5401411", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas_Lsa_AsExternalLsa_TypesOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas_Lsa_AsExternalLsa_TypesOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dc5693ac9ecef3f2da3410b20cfc1536", "score": "0.5398268", "text": "func (m HealthCheckType) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "47af65825149c0b2d7f474b2ba8cc8cd", "score": "0.5397571", "text": "func (s Schema) Validate() diag.Diagnostics {\n\treturn s.ValidateImplementation(context.Background())\n}", "title": "" }, { "docid": "8187ae6f4ca2b8371575ca6e24a38548", "score": "0.5392418", "text": "func (v *StringRule) Validate(value interface{}) (code int, args []interface{}) {\n\tvalue, isNil := Indirect(value)\n\tif isNil || IsEmpty(value) {\n\t\treturn\n\t}\n\tstr, code := EnsureString(value)\n\tif code != 0 {\n\t\treturn\n\t}\n\n\tif v.validate(str) {\n\t\treturn\n\t}\n\tcode = v.code\n\treturn\n}", "title": "" }, { "docid": "105d7aac973902a881bd916abc1c0fae", "score": "0.5387502", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cb17aa5b6f6aaec960e8c319115f990b", "score": "0.53742385", "text": "func (m StyleType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateStyleTypeEnum(\"\", \"body\", m); 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": "95990b2bd02e5bee88af563d830ddd70", "score": "0.53685653", "text": "func (t PKEType) Validate(_ map[string]string) error {\n\treturn nil\n}", "title": "" }, { "docid": "7cd9fd641cac55c0c7a7de9211844bf0", "score": "0.53633493", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_SummaryLsa_TypesOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_SummaryLsa_TypesOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "38a8b04804b8434db2a7ddb06d6a77d2", "score": "0.5362505", "text": "func (s *IndicesExistsTypeService) Validate() error {\n\tvar invalid []string\n\tif len(s.index) == 0 {\n\t\tinvalid = append(invalid, \"Index\")\n\t}\n\tif len(s.typ) == 0 {\n\t\tinvalid = append(invalid, \"Type\")\n\t}\n\tif len(invalid) > 0 {\n\t\treturn fmt.Errorf(\"missing required fields: %v\", invalid)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ad21f90475593c79041fa0331c74659e", "score": "0.53599644", "text": "func Validate(input []byte) error {\n\n\tvar schema string\n\tvar ok bool\n\tif schema, ok = schemas[Version]; !ok {\n\t\treturn errors.New(\"Can't load schema\")\n\t}\n\n\trs := &jsonschema.RootSchema{}\n\tif err := json.Unmarshal([]byte(schema), rs); err != nil {\n\t\treturn err\n\t}\n\n\tif errors, _ := rs.ValidateBytes(input); len(errors) > 0 {\n\t\treturn errors[0]\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3d0f36fdc220d8a345e13c1110c9501f", "score": "0.5348948", "text": "func (s *Schema) Validate(rec Record) error {\n\tvar i int\n\n\terr := rec.Iterate(func(f field.Field) error {\n\t\tif i >= len(s.Fields) {\n\t\t\treturn errors.New(\"record contains too many fields\")\n\t\t}\n\n\t\tsf := s.Fields[i]\n\t\tif sf.Name != f.Name || sf.Type != f.Type {\n\t\t\treturn fmt.Errorf(\"field should be '%s' of type '%d', got '%s' of type '%d'\", sf.Name, sf.Type, f.Name, f.Type)\n\t\t}\n\n\t\ti++\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif i < len(s.Fields) {\n\t\treturn errors.New(\"record contains too few fields\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7829d9cf266cfbcf3c042cc1d6f69994", "score": "0.5331803", "text": "func MATypeValidation(t string) error {\n\tswitch t {\n\tcase SMAName, EMAName, WMAName:\n\t\treturn nil\n\tdefault:\n\t\treturn ErrMATypeInvalid\n\t}\n}", "title": "" }, { "docid": "ad6f0ecd30678e74518b903a25c229d7", "score": "0.5304865", "text": "func (v *Validator) ValidateStruct(s interface{}) error {\n\treturn v.ValidateStructContext(context.Background(), s)\n}", "title": "" }, { "docid": "b885965199fd324667d5e20c9df8df40", "score": "0.52600765", "text": "func (schema *PropertySchema) Validate() error {\n\tif schema == nil {\n\t\treturn nil\n\t}\n\tif len(schema.Types) > 0 {\n\t\ttypeFound := make(map[string]bool, len(schema.Types))\n\t\tfor _, schemaType := range schema.Types {\n\t\t\ttypeFound[schemaType] = false\n\t\t\tfor _, t := range validTypes {\n\t\t\t\tif t == schemaType {\n\t\t\t\t\ttypeFound[schemaType] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor schemaType, found := range typeFound {\n\t\t\tif !found {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"invalid type '%s'. valid types are %v\",\n\t\t\t\t\tschemaType,\n\t\t\t\t\tvalidTypes,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\tif schema.Format != \"\" {\n\t\tfound := false\n\t\tfor _, f := range validFormats {\n\t\t\tif f == schema.Format {\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\treturn fmt.Errorf(\n\t\t\t\t\"invalid format '%s'. valid formats are %v\",\n\t\t\t\tschema.Format,\n\t\t\t\tvalidFormats,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "11b6125bc5b5fa4af80d3613534c473f", "score": "0.52591777", "text": "func (m *MeasurementType) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "c90a4ffe37e56ca3aff9954dfcda6894", "score": "0.52568126", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas_Lsa_AsExternalLsa_TypesOfService_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas_Lsa_AsExternalLsa_TypesOfService_TypeOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34fd4ad18d2fa89cc416fb3ad98fe219", "score": "0.52535", "text": "func (s *Telemetry) Validate() error {\n\tif err := ytypes.Validate(SchemaTree[\"Telemetry\"], s); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fc7cb12c4c4b64dfabcaaafc507d90ea", "score": "0.52532893", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "67d1ee7f4aa7192ab642339abfb0c211", "score": "0.5243446", "text": "func (v *Validator) Validate(s interface{}) error {\n\tq := queue.New(40)\n\tq.Put(QueueItem{value: reflect.ValueOf(s), path: \"root\"}) //nolint:errcheck // TODO: Legacy code, consider refactoring time permitting.\n\n\tfor !q.Empty() {\n\t\tval, err := q.Get(1)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\titem, ok := val[0].(QueueItem)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"Cannot convert item into QueueItem\")\n\t\t}\n\n\t\tv.validateOne(item, q) //nolint:errcheck // TODO: Legacy code, consider refactoring time permitting.\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d1495d27fd8793168eba2ded92cb8ef2", "score": "0.5242531", "text": "func (t regexpType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics {\n\tvar diags diag.Diagnostics\n\n\tif !in.Type().Is(tftypes.String) {\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"Regexp Type Validation Error\",\n\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+\n\t\t\t\tfmt.Sprintf(\"Expected String value, received %T with value: %v\", in, in),\n\t\t)\n\t\treturn diags\n\t}\n\n\tif !in.IsKnown() || in.IsNull() {\n\t\treturn diags\n\t}\n\n\tvar value string\n\terr := in.As(&value)\n\tif err != nil {\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"Regexp Type Validation Error\",\n\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+\n\t\t\t\tfmt.Sprintf(\"Cannot convert value to string: %s\", err),\n\t\t)\n\t\treturn diags\n\t}\n\n\tif _, err := regexp.Compile(value); err != nil {\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"Regexp Type Validation Error\",\n\t\t\tfmt.Sprintf(\"Value %q cannot be parsed as a regular expression: %s\", value, err),\n\t\t)\n\t\treturn diags\n\t}\n\n\treturn diags\n}", "title": "" }, { "docid": "e351e92824c9ec1ddbc947f9f19fe2a9", "score": "0.5219827", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_NssaExternalLsa_TypesOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_NssaExternalLsa_TypesOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "591fa0ed2b346a69258b958211e6ac6c", "score": "0.5197111", "text": "func Validate(v interface{}) error {\n\treturn validate.Struct(v)\n}", "title": "" }, { "docid": "5cdc6df8f7e07d5d8183a88a57b57eda", "score": "0.5185113", "text": "func (s StringCheck) Validate() []string {\n\tvar errs []string\n\tif s.Name == \"\" {\n\t\terrs = append(errs, \"name::is_required\")\n\t}\n\tif utf8.RuneCountInString(s.Name) < 1 {\n\t\terrs = append(errs, \"name::min_length_is::1\")\n\t}\n\tif utf8.RuneCountInString(s.Name) > 20 {\n\t\terrs = append(errs, \"name::max_length_is::20\")\n\t}\n\tif utf8.RuneCountInString(s.Name) != 10 {\n\t\terrs = append(errs, \"name::length_is_not::10\")\n\t}\n\tif s.NameRef == nil || len(*s.NameRef) == 0 {\n\t\terrs = append(errs, \"name_ref::is_required\")\n\t}\n\tif s.NameRef != nil && utf8.RuneCountInString(*s.NameRef) < 1 {\n\t\terrs = append(errs, \"name_ref::min_length_is::1\")\n\t}\n\tif s.NameRef != nil && utf8.RuneCountInString(*s.NameRef) > 20 {\n\t\terrs = append(errs, \"name_ref::max_length_is::20\")\n\t}\n\tif s.SurnameRef != nil && utf8.RuneCountInString(*s.SurnameRef) < 1 {\n\t\terrs = append(errs, \"surname_ref::min_length_is::1\")\n\t}\n\tif s.SurnameRef != nil && utf8.RuneCountInString(*s.SurnameRef) > 20 {\n\t\terrs = append(errs, \"surname_ref::max_length_is::20\")\n\t}\n\tif s.SurnameRef != nil && utf8.RuneCountInString(*s.SurnameRef) != 100 {\n\t\terrs = append(errs, \"surname_ref::length_is_not::100\")\n\t}\n\tif s.IdRef != nil && utf8.RuneCountInString(*s.IdRef) < 1 {\n\t\terrs = append(errs, \"id_ref::min_length_is::1\")\n\t}\n\tif s.IdRef != nil && utf8.RuneCountInString(*s.IdRef) > 1000 {\n\t\terrs = append(errs, \"id_ref::max_length_is::1000\")\n\t}\n\tif s.IdRef != nil && utf8.RuneCountInString(*s.IdRef) != 100 {\n\t\terrs = append(errs, \"id_ref::length_is_not::100\")\n\t}\n\tif s.NumberStringRef == nil || len(*s.NumberStringRef) == 0 {\n\t\terrs = append(errs, \"number_string_ref::is_required\")\n\t}\n\tif s.NumberStringRef != nil {\n\t\tfor _, n := range *s.NumberStringRef {\n\t\t\tif !unicode.IsDigit(n) {\n\t\t\t\terrs = append(errs, \"number_string_ref::is_not_digit\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif s.NumberString == \"\" {\n\t\terrs = append(errs, \"number_string::is_required\")\n\t}\n\tif utf8.RuneCountInString(s.NumberString) != 5 {\n\t\terrs = append(errs, \"number_string::length_is_not::5\")\n\t}\n\tif s.StringAllnumRef == nil || len(*s.StringAllnumRef) == 0 {\n\t\terrs = append(errs, \"string_allnum_ref::is_required\")\n\t}\n\tif s.StringAllnumRef != nil {\n\t\tfor _, n := range *s.StringAllnumRef {\n\t\t\tif !unicode.IsLetter(n) && !unicode.IsDigit(n) && !unicode.IsPunct(n) && !unicode.IsSpace(n) {\n\t\t\t\terrs = append(errs, \"string_allnum_ref::is_not_word\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif s.StringAllnum == \"\" {\n\t\terrs = append(errs, \"string_allnum::is_required\")\n\t}\n\tfor _, n := range s.StringAllnum {\n\t\tif !unicode.IsLetter(n) && !unicode.IsDigit(n) && !unicode.IsPunct(n) && !unicode.IsSpace(n) {\n\t\t\terrs = append(errs, \"string_allnum::is_not_word\")\n\t\t\tbreak\n\t\t}\n\t}\n\tif s.Test != \"\" {\n\t\tif _, err := uuid.Parse(s.Test); err != nil {\n\t\t\terrs = append(errs, \"test::is_not_uuid\")\n\t\t}\n\t}\n\tif s.TestRef != nil {\n\t\tif _, err := uuid.Parse(*s.TestRef); err != nil {\n\t\t\terrs = append(errs, \"test_ref::is_not_uuid\")\n\t\t}\n\t}\n\tif s.UTest == nil || len(s.UTest) == 0 {\n\t\terrs = append(errs, \"utest::is_required\")\n\t}\n\tfor i, v := range s.UTest {\n\t\tif v != \"\" {\n\t\t\tif _, err := uuid.Parse(v); err != nil {\n\t\t\t\terrs = append(errs, fmt.Sprintf(\"utest_%v::is_not_uuid\", i))\n\t\t\t}\n\t\t}\n\t}\n\tif s.UTestRef == nil || len(s.UTestRef) == 0 {\n\t\terrs = append(errs, \"utest_ref::is_required\")\n\t}\n\tfor i, v := range s.UTestRef {\n\t\tif v != nil {\n\t\t\tif _, err := uuid.Parse(*v); err != nil {\n\t\t\t\terrs = append(errs, fmt.Sprintf(\"utest_ref_%v::is_not_uuid\", i))\n\t\t\t}\n\t\t}\n\t}\n\tif s.WTest == nil || len(s.WTest) == 0 {\n\t\terrs = append(errs, \"wtest::is_required\")\n\t}\n\tfor i, v := range s.WTest {\n\t\tfor _, n := range v {\n\t\t\tif !unicode.IsLetter(n) && !unicode.IsDigit(n) && !unicode.IsPunct(n) && !unicode.IsSpace(n) {\n\t\t\t\terrs = append(errs, fmt.Sprintf(\"wtest_%v::is_not_word\", i))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif s.WTestRef == nil || len(s.WTestRef) == 0 {\n\t\terrs = append(errs, \"wtest_ref::is_required\")\n\t}\n\tfor i, v := range s.WTestRef {\n\t\tif v != nil {\n\t\t\tfor _, n := range *v {\n\t\t\t\tif !unicode.IsLetter(n) && !unicode.IsDigit(n) && !unicode.IsPunct(n) && !unicode.IsSpace(n) {\n\t\t\t\t\terrs = append(errs, fmt.Sprintf(\"wtest_ref_%v::is_not_word\", i))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif s.DTest == nil || len(s.DTest) == 0 {\n\t\terrs = append(errs, \"dtest::is_required\")\n\t}\n\tfor i, v := range s.DTest {\n\t\tfor _, n := range v {\n\t\t\tif !unicode.IsDigit(n) {\n\t\t\t\terrs = append(errs, fmt.Sprintf(\"dtest_%v::is_not_digit\", i))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif s.DTestRef == nil || len(s.DTestRef) == 0 {\n\t\terrs = append(errs, \"dtest_ref::is_required\")\n\t}\n\tfor i, v := range s.DTestRef {\n\t\tif v != nil {\n\t\t\tfor _, n := range *v {\n\t\t\t\tif !unicode.IsDigit(n) {\n\t\t\t\t\terrs = append(errs, fmt.Sprintf(\"dtest_ref_%v::is_not_digit\", i))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif s.SpacesMapString == nil || len(s.SpacesMapString) == 0 {\n\t\terrs = append(errs, \"spaces_map_string::is_required\")\n\t}\n\n\treturn errs\n}", "title": "" }, { "docid": "f5f9b52ea6d22dfeda7eb91eecfdea0d", "score": "0.5184149", "text": "func Valid(s string) bool {\n\tif len(s) != 36 {\n\t\treturn false\n\t}\n\tfor _, n := range [...]int{8, 4, 4, 4} {\n\t\tif !acceptRun(s[:n]) {\n\t\t\treturn false // ErrFormat\n\t\t}\n\t\tif s[n] != '-' {\n\t\t\treturn false // ErrFieldCount\n\t\t}\n\t\ts = s[n+1:]\n\t}\n\tif !acceptRun(s) {\n\t\treturn false // ErrFormat\n\t}\n\treturn true\n}", "title": "" }, { "docid": "e34048b16dd3f936bbbcc977eace696a", "score": "0.5177719", "text": "func (sm MessagingType) Validate() error {\n\tswitch sm {\n\tcase SidecarOffline:\n\tcase Heartbeat:\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown %d sidecar message type\", sm)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "74560cc23bdef6cc81c95e4f7ff22530", "score": "0.51713806", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Lsdb_LsaTypes_LsaType_Lsas) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Lsdb_LsaTypes_LsaType_Lsas\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "66675f5adc2b3b1c64b501354588e1ff", "score": "0.5165385", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dcf90d53031c9f94e3bc7fe6518e41de", "score": "0.51642054", "text": "func (m *NullableString) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "70ed7f12991294532be3c05a6c298919", "score": "0.51626325", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1eabdf98a179ee6b8ed67d46dda6f259", "score": "0.51520854", "text": "func (timeStr *TimeStr) validate() error {\n\tvar errs = new(ValidationError)\n\n\tif _, err := time.Parse(AtomTimeFormat, string(*timeStr)); err != nil {\n\t\terrs.AddErr(err)\n\t}\n\n\treturn errs.NilIfEmpty()\n}", "title": "" }, { "docid": "83c6c00309e2c250e7687d2350178a7b", "score": "0.5142017", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_RouterLsa_Links_TypesOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_RouterLsa_Links_TypesOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2af789d39aab8477a5413d5bb0c6592e", "score": "0.51377696", "text": "func (s TextBlockObject) validateType() MessageObjectType {\n\treturn MessageObjectType(s.Type)\n}", "title": "" }, { "docid": "42a5f725dba2de9c35a4044c4dee37dc", "score": "0.5136625", "text": "func validateTestStructure(test *Test) error {\n\t// Verify that at least one type is specified and that all types are supported\n\tif len(test.Types) < 1 {\n\t\treturn errors.New(\"The Types array must contain at least one supported type\")\n\t}\n\tfor _, typ := range test.Types {\n\t\tif typ != \"string\" && typ != \"int\" && typ != \"date\" && typ != \"timestamp\" {\n\t\t\treturn errors.New(\"The Types array contains an unsupported type\")\n\t\t}\n\t}\n\n\t// If Values are specified, the should be of the same length as the Types\n\tif len(test.Values) > 0 {\n\t\tif len(test.Values) != len(test.Types) {\n\t\t\treturn errors.New(\"The Types array and the Values array are not of the same length\")\n\t\t}\n\t}\n\n\t// If Values are specified, verify that they can convert to the right types\n\tif len(test.Values) > 0 {\n\t\tfor index, typ := range test.Types {\n\t\t\tswitch {\n\t\t\tcase typ == \"string\":\n\t\t\t\tif reflect.TypeOf(test.Values[index]) != reflect.TypeOf(\" \") {\n\t\t\t\t\treturn errors.New(\"Value of type string expected\")\n\t\t\t\t}\n\t\t\tcase typ == \"int\":\n\t\t\t\t_, err := strconv.Atoi(test.Values[index])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.New(\"Value of type int expected\")\n\t\t\t\t}\n\t\t\tcase typ == \"date\":\n\t\t\t\t_, err := time.Parse(\"2006-02-01\", test.Values[index])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn errors.New(\"Value of type date (YYYY-MM-DD) expected\")\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"Unsupported value type specified (%v)\", typ)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e5a692cdbd8a75608443c600d28fd0bb", "score": "0.513399", "text": "func (m TapiTopologyRuleType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateTapiTopologyRuleTypeEnum(\"\", \"body\", m); 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": "6904f66aad7d7c354b62c3eb51719449", "score": "0.5129808", "text": "func (v *StringIsInt) Validate(e *validator.Errors) {\n\t// null string is valid\n\tif isNullString(v.Field) {\n\t\treturn\n\t}\n\n\t// Int is valid\n\tif rxInteger.MatchString(v.Field) {\n\t\treturn\n\t}\n\n\te.Add(v.Name, StringIsIntError(v))\n}", "title": "" }, { "docid": "d302ac8ba20a57588ca3929ac0b46a27", "score": "0.51235116", "text": "func (m MfaType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateMfaTypeEnum(\"\", \"body\", m); 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": "ccad9c8b873f91286a94ca973b1e66de", "score": "0.51205105", "text": "func (s *WifiOffice_OfficeAp_Ssids) Validate() error {\n\tif err := ytypes.Validate(SchemaTree[\"WifiOffice_OfficeAp_Ssids\"], s); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "efd2f7ce9a5ce0e53a46ba55c72cbef8", "score": "0.51135933", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_NssaExternalLsa_TypesOfService_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_NssaExternalLsa_TypesOfService_TypeOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1771ebe7cf5b364c19b84bd9f981bc02", "score": "0.5112624", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Lsdb_LsaTypes) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Interface_Lsdb_LsaTypes\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3c7ed322adfecd17ddd0c11ddfa7d0dd", "score": "0.510876", "text": "func (m *RicStyleType) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "592d616720dedb16fd2ba315207f47e8", "score": "0.5099823", "text": "func (m *ValidationError) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateKind(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": "4e2779ced550dbbb3c48c0d9ca972907", "score": "0.5095021", "text": "func (e Element) Validate() error {\n\tif len(e) < 1 {\n\t\treturn ErrElementMissingType\n\t}\n\tidx := bytes.IndexByte(e[1:], 0x00)\n\tif idx == -1 {\n\t\treturn ErrElementMissingKey\n\t}\n\treturn Value{Type: bsontype.Type(e[0]), Data: e[idx+2:]}.Validate()\n}", "title": "" }, { "docid": "eb30d5501f8a674b04eca256e0d56bd7", "score": "0.5090036", "text": "func (t ethereumTypedDataTypes) validate() error {\n\tfor typeKey, typeArr := range t {\n\t\tif len(typeKey) == 0 {\n\t\t\treturn errors.Errorf(\"empty type key\")\n\t\t}\n\t\tfor i, typeObj := range typeArr {\n\t\t\tif len(typeObj.Type) == 0 {\n\t\t\t\treturn errors.Errorf(\"type %q:%d: empty Type\", typeKey, i)\n\t\t\t}\n\t\t\tif len(typeObj.Name) == 0 {\n\t\t\t\treturn errors.Errorf(\"type %q:%d: empty Name\", typeKey, i)\n\t\t\t}\n\t\t\tif typeKey == typeObj.Type {\n\t\t\t\treturn errors.Errorf(\"type %q cannot reference itself\", typeObj.Type)\n\t\t\t}\n\t\t\tif typeObj.isReferenceType() {\n\t\t\t\tif _, exist := t[typeObj.typeName()]; !exist {\n\t\t\t\t\treturn errors.Errorf(\"reference type %q is undefined\", typeObj.Type)\n\t\t\t\t}\n\t\t\t\tif !typedDataReferenceTypeRegexp.MatchString(typeObj.Type) {\n\t\t\t\t\treturn errors.Errorf(\"unknown reference type %q\", typeObj.Type)\n\t\t\t\t}\n\t\t\t} else if !isPrimitiveTypeValid(typeObj.Type) {\n\t\t\t\treturn errors.Errorf(\"unknown type %q\", typeObj.Type)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a021189291737061a8f0939d7a6417b6", "score": "0.50880337", "text": "func (c Custom) Validate() []string {\n\tvar errs []string\n\tif c.Structs == nil || len(c.Structs) == 0 {\n\t\terrs = append(errs, \"structs::is_required\")\n\t}\n\tif len(c.Structs) < 1 {\n\t\terrs = append(errs, \"structs::min_length_is::1\")\n\t}\n\tif len(c.Structs) > 100 {\n\t\terrs = append(errs, \"structs::max_length_is::100\")\n\t}\n\tfor _, v := range c.Structs {\n\t\tif e := v.Validate(); len(e) > 0 {\n\t\t\terrs = append(errs, e...)\n\t\t}\n\t}\n\tif c.Strings == nil || len(c.Strings) == 0 {\n\t\terrs = append(errs, \"strings::is_required\")\n\t}\n\tif len(c.Strings) < 1 {\n\t\terrs = append(errs, \"strings::min_length_is::1\")\n\t}\n\tif len(c.Strings) > 100 {\n\t\terrs = append(errs, \"strings::max_length_is::100\")\n\t}\n\tfor i, v := range c.Strings {\n\t\tif utf8.RuneCountInString(v) != 15 {\n\t\t\terrs = append(errs, fmt.Sprintf(\"strings_%v::length_is_not::15\", i))\n\t\t}\n\t}\n\tif c.Map == nil || len(c.Map) == 0 {\n\t\terrs = append(errs, \"map::is_required\")\n\t}\n\tif len(c.Map) < 1 {\n\t\terrs = append(errs, \"map::min_length_is::1\")\n\t}\n\tif len(c.Map) > 100 {\n\t\terrs = append(errs, \"map::max_length_is::100\")\n\t}\n\tfor i, v := range c.Map {\n\t\tif utf8.RuneCountInString(v) != 15 {\n\t\t\terrs = append(errs, fmt.Sprintf(\"map_%v::length_is_not::15\", i))\n\t\t}\n\t}\n\n\treturn errs\n}", "title": "" }, { "docid": "b3105264869411728e86a0d171205abd", "score": "0.50850356", "text": "func (ut *AssetType) Validate() (err error) {\n\tif ut.Name != nil {\n\t\tif utf8.RuneCountInString(*ut.Name) < 3 {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidLengthError(`type.name`, *ut.Name, utf8.RuneCountInString(*ut.Name), 3, true))\n\t\t}\n\t}\n\tif ut.Type != nil {\n\t\tif !(*ut.Type == \"car\") {\n\t\t\terr = goa.MergeErrors(err, goa.InvalidEnumValueError(`type.type`, *ut.Type, []interface{}{\"car\"}))\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "81e0b6ef301e28e62905cd25a8abc50f", "score": "0.508287", "text": "func (s *scrapExchange) validate(scrap *ScrapBody) error {\n\tif err := validateType(scrap.Type); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ab2a1c73c3125e1978f53eb646ae0aa0", "score": "0.507981", "text": "func Validate(value string) error {\n\t_, err := validate(value)\n\treturn err\n}", "title": "" }, { "docid": "733a1007d7f1185fc3ad9fbf7a84d52d", "score": "0.50742304", "text": "func (t *SrlNokiaInterfaces_Interface_Sflow) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaInterfaces_Interface_Sflow\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ddb635e2ec00a065dc4f24c73c295a2c", "score": "0.5073583", "text": "func Validate(schemaJSON string, subject string, data interface{}) error {\n\tschema, err := gojsonschema.NewSchema(gojsonschema.NewStringLoader(schemaJSON))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to compile schema: %v\", err)\n\t}\n\n\tloader := emptyObjectLoader\n\n\tswitch d := data.(type) {\n\tcase apiextv1.JSON:\n\t\tif len(d.Raw) > 0 {\n\t\t\tloader = gojsonschema.NewBytesLoader(d.Raw)\n\t\t}\n\tcase *apiextv1.JSON:\n\t\tif d != nil && len(d.Raw) > 0 {\n\t\t\tloader = gojsonschema.NewBytesLoader(d.Raw)\n\t\t}\n\tcase []byte:\n\t\tif len(d) > 0 {\n\t\t\tloader = gojsonschema.NewBytesLoader(d)\n\t\t}\n\tcase string:\n\t\tif len(d) > 0 {\n\t\t\tloader = gojsonschema.NewStringLoader(d)\n\t\t}\n\tdefault:\n\t\tif d != nil {\n\t\t\tloader = gojsonschema.NewGoLoader(d)\n\t\t}\n\t}\n\n\tres, err := schema.Validate(loader)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s has failed validation: %w\", subject, err)\n\t}\n\tif !res.Valid() {\n\t\tve := validation.NewError(\"%s has failed validation\", subject)\n\t\tfor _, err := range res.Errors() {\n\t\t\tswitch err.(type) {\n\t\t\tcase *gojsonschema.ConditionElseError, *gojsonschema.ConditionThenError:\n\t\t\t\t// Ignore these errors\n\t\t\tdefault:\n\t\t\t\tfield := err.Field()\n\t\t\t\t// in the case of required error type, get the field name from the message \"fieldName is required\"\n\t\t\t\t// use this for \"field\" instead of \"(root)\"\n\t\t\t\tif err.Type() == \"required\" && field == validation.FieldRoot {\n\t\t\t\t\tfield = strings.Fields(err.Description())[0]\n\t\t\t\t}\n\t\t\t\tve.AddFieldError(field, validation.ErrorCode(err.Type()), err.Description())\n\t\t\t}\n\t\t}\n\t\treturn ve\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0a8d84461d0cc5eedc43206552be265e", "score": "0.5071554", "text": "func TestSchemaValidation(t *testing.T) {\n\ttype T struct {\n\t\tA string `validate:\"len=12\"`\n\t\tB int `validate:\"min=5,max=100\"`\n\t\tC []bool `validate:\"len=50\"`\n\t\tD map[string]string `validate:\"eq=5\"`\n\t\tE string `validate:\"eq=15\"`\n\t\tF string `validate:\"lt=8\"`\n\t\tG string `validate:\"gt=6\"`\n\t\tH int `validate:\"len=foo\"` // ignored, cannot convert \"foo\" to integer\n\t\tI []string `validate:\"dive,len=6\"` // ignored, dive option present before tag\n\t\tJ map[string]string `validate:\"keys,max=6\"` // ignored, keys option present before tag\n\t}\n\tg := gen(t)\n\n\tsor := g.newSchemaFromType(rt(new(T)))\n\tassert.NotNil(t, sor)\n\tschema := g.resolveSchema(sor)\n\tassert.NotNil(t, schema)\n\n\tactual, err := json.Marshal(schema)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\t// see testdata/validation/len.json.\n\texpected, err := ioutil.ReadFile(\"../testdata/schemas/validation.json\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tm, err := diffJSON(actual, expected)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif !m {\n\t\tt.Error(\"expected json outputs to be equal\")\n\t}\n}", "title": "" }, { "docid": "cd01bc7f446fdf4ff950fde3358aa359", "score": "0.5069949", "text": "func (f *pyFunc) validateType(s *scope, i int, expr *Expression) pyObject {\n\tval := s.interpretExpression(expr)\n\tif i >= len(f.types) && (f.varargs || f.kwargs) {\n\t\treturn val // function is varargs so we have no type signature for this\n\t} else if f.types[i] == nil {\n\t\treturn val // not varargs but we just don't have a type signature, so take it as it is\n\t} else if val == None {\n\t\tif f.constants[i] == nil && (f.defaults == nil || f.defaults[i] == nil) {\n\t\t\treturn val\n\t\t}\n\t\treturn f.defaultArg(s, i, f.args[i])\n\t}\n\tactual := val.Type()\n\tfor _, t := range f.types[i] {\n\t\tif t == actual {\n\t\t\treturn val\n\t\t}\n\t}\n\t// Using integers in place of booleans seems common in Bazel BUILD files :(\n\tif s.state.Config.Bazel.Compatibility && f.types[i][0] == \"bool\" && actual == \"int\" {\n\t\treturn val\n\t}\n\tdefer func() {\n\t\tpanic(AddStackFrame(s.filename, expr.Pos, recover()))\n\t}()\n\treturn s.Error(\"Invalid type for argument %s to %s; expected %s, was %s\", f.args[i], f.name, strings.Join(f.types[i], \" or \"), actual)\n}", "title": "" }, { "docid": "b70de8096445c549beab749a2e36e187", "score": "0.50677055", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e07300b1c1e49b281b16e65d050e5c34", "score": "0.5065997", "text": "func (ut *MessagePayload) Validate() (err error) {\n\tif ut.Content == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`type`, \"content\"))\n\t}\n\tif ut.Auther == \"\" {\n\t\terr = goa.MergeErrors(err, goa.MissingAttributeError(`type`, \"auther\"))\n\t}\n\n\tif utf8.RuneCountInString(ut.Content) < 1 {\n\t\terr = goa.MergeErrors(err, goa.InvalidLengthError(`type.content`, ut.Content, utf8.RuneCountInString(ut.Content), 1, true))\n\t}\n\tif utf8.RuneCountInString(ut.Content) > 400 {\n\t\terr = goa.MergeErrors(err, goa.InvalidLengthError(`type.content`, ut.Content, utf8.RuneCountInString(ut.Content), 400, false))\n\t}\n\treturn\n}", "title": "" }, { "docid": "2b7f04763829d8f324570ae104e31234", "score": "0.506375", "text": "func ValidateStruct(s interface{}) error {\n\tv, trans := newValidator()\n\terr := v.Struct(s)\n\tif err != nil {\n\t\terrPtr := malformedRequestErr(err.(validator.ValidationErrors), trans)\n\t\treturn &errPtr\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e5a1d13ed1915d2c47d251b130d96814", "score": "0.50474924", "text": "func (m MessageY) Validate() error {\n\terr, _ := m.Value.(error)\n\treturn err\n}", "title": "" }, { "docid": "bfeff60e1e154aa36c52805c0d4e3459", "score": "0.5045987", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas_Lsa) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Lsdb_LsaTypes_LsaType_Lsas_Lsa\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8a31702191cb5fc53872b7c096e4741", "score": "0.5044578", "text": "func validateStringSlice(schema *yang.Entry, value interface{}) error {\n\t// Check that the schema itself is valid.\n\tif err := validateStringSchema(schema); err != nil {\n\t\treturn err\n\t}\n\n\t// Check that type of value is the type expected from the schema.\n\tslice, ok := value.([]string)\n\tif !ok {\n\t\treturn fmt.Errorf(\"non []string type %T with value %v for schema %s\", value, value, schema.Name)\n\t}\n\n\t// Each slice element must be valid and unique.\n\ttbl := make(map[string]bool, len(slice))\n\tfor i, val := range slice {\n\t\tif err := validateString(schema, val); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid element at index %d: %v for schema %s\", i, err, schema.Name)\n\t\t}\n\t\tif tbl[val] {\n\t\t\treturn fmt.Errorf(\"duplicate string: %q for schema %s\", val, schema.Name)\n\t\t}\n\t\ttbl[val] = true\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "03b3ff5b5ed08c7ae56f57017b64f272", "score": "0.50406766", "text": "func (m MessageL) Validate() error {\n\terr, _ := m.Value.(error)\n\treturn err\n}", "title": "" }, { "docid": "233352bdab8c881f7771160469e87fdc", "score": "0.50342965", "text": "func (c length) Validate(value interface{}) error {\n\tvar ok bool\n\tvar val string\n\tif val, ok = value.(string); ok != true {\n\t\treturn errors.New(CannotValidateNonStringMessage)\n\t}\n\tif c.min == c.max {\n\t\tif c.min != len(val) {\n\t\t\treturn fmt.Errorf(ExactLengthMessage, c.min)\n\t\t}\n\t} else {\n\t\tif !(c.min <= len(val)) {\n\t\t\treturn fmt.Errorf(MinMessage, c.min)\n\t\t}\n\t\tif !(len(val) <= c.max) {\n\t\t\treturn fmt.Errorf(MaxMessage, c.max)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "17412f38a5531305d9ad299aa4795520", "score": "0.50337267", "text": "func (m *SportsAreaTypes) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "8429c358aefb577db82626765864e188", "score": "0.5031643", "text": "func (sss *ServerlessServiceSpec) Validate(ctx context.Context) *apis.FieldError {\n\t// Spec must not be empty.\n\tif equality.Semantic.DeepEqual(sss, &ServerlessServiceSpec{}) {\n\t\treturn apis.ErrMissingField(apis.CurrentField)\n\t}\n\tvar all *apis.FieldError\n\t// Spec mode must be from the enum\n\tswitch sss.Mode {\n\tcase SKSOperationModeProxy, SKSOperationModeServe:\n\t\tbreak\n\tcase \"\":\n\t\tall = all.Also(apis.ErrMissingField(\"mode\"))\n\tdefault:\n\t\tall = all.Also(apis.ErrInvalidValue(sss.Mode, \"mode\"))\n\t}\n\n\tif sss.NumActivators < 0 {\n\t\tall = all.Also(apis.ErrInvalidValue(sss.NumActivators, \"numActivators\"))\n\t}\n\n\tall = all.Also(networking.ValidateNamespacedObjectReference(&sss.ObjectRef).ViaField(\"objectRef\"))\n\n\treturn all.Also(sss.ProtocolType.Validate(ctx).ViaField(\"protocolType\"))\n}", "title": "" }, { "docid": "5df8f4182d1c150f31aaf1399a30279e", "score": "0.50310963", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_SummaryLsa_TypesOfService_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_SummaryLsa_TypesOfService_TypeOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d910464488f323f5f6bc53f24527d571", "score": "0.5031053", "text": "func validType(tp string) bool {\n\tswitch tp {\n\tdefault:\n\t\treturn false\n\tcase \"text\": // string\n\tcase \"int\": // int64\n\tcase \"float\": // float64\n\tcase \"bool\": // bool\n\tcase \"decimal\": // *apd.Decimal\n\tcase \"bytes\": // []byte\n\tcase \"node\": // *Node\n\t}\n\treturn true\n}", "title": "" }, { "docid": "16f7b7332257f6a07137a47e5de26ce9", "score": "0.50227994", "text": "func (sc StringConverter) validate() error {\n\tif match := sc.validationRegExp.MatchString(sc.inputString); match {\n\t\treturn fmt.Errorf(\"invalid string\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a10e0ba57c0f369cb7da49e7843da938", "score": "0.5008709", "text": "func (s *Office) Validate() error {\n\tif err := ytypes.Validate(SchemaTree[\"Office\"], s); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "79c5a88bf15b17a5256c5adc39b507eb", "score": "0.49991223", "text": "func (pTypeDef *BigStruct) Validate() error {\n\tif pTypeDef.MyName == \"\" {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myName\")\n\t}\n\tif pTypeDef.MyUtfname == \"\" {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myUtfname\")\n\t}\n\tif pTypeDef.MyIntArray == nil {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myIntArray\")\n\t}\n\tif pTypeDef.MyStringArray == nil {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myStringArray\")\n\t}\n\tif pTypeDef.MyMap == nil {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myMap\")\n\t}\n\tif pTypeDef.MyUuid == nil {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myUuid\")\n\t}\n\tif pTypeDef.MyStringSubtype == \"\" {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myStringSubtype\")\n\t}\n\tif pTypeDef.MyTime.IsZero() {\n\t\treturn fmt.Errorf(\"BigStruct: Missing required field: myTime\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "30253a398b9a5ddfab6d9a8ee9bb05a7", "score": "0.4997073", "text": "func (e *Enum) Validate() error {\n\tif e.Package == \"\" {\n\t\treturn ErrPackageRequred\n\t}\n\n\tif e.Type == \"\" {\n\t\treturn ErrTypeRequired\n\t}\n\n\tif e.Description != \"\" && !strings.HasPrefix(e.Description, fmt.Sprintf(\"%s is\", e.Type)) {\n\t\treturn ErrDescriptionInvalid\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "abda0d1cb2393a7534b945dc02af192f", "score": "0.49859875", "text": "func (s *TableSchema) Validate() error {\n\tif s.Name == \"\" {\n\t\treturn fmt.Errorf(\"missing table name\")\n\t}\n\n\tif len(s.Indexes) == 0 {\n\t\treturn fmt.Errorf(\"missing table indexes for '%s'\", s.Name)\n\t}\n\n\tif _, ok := s.Indexes[id]; !ok {\n\t\treturn fmt.Errorf(\"must have id index\")\n\t}\n\n\tif _, ok := s.Indexes[id].Indexer.(index.SingleIndexer); !ok {\n\t\treturn fmt.Errorf(\"id index must be a SingleIndexer\")\n\t}\n\n\tfor name, index := range s.Indexes {\n\t\tif name != index.Name {\n\t\t\treturn fmt.Errorf(\"index name mis-match for '%s'\", name)\n\t\t}\n\n\t\tif err := index.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"index %q: %s\", name, err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b88a73f9805436adecb80af0f7a2b15e", "score": "0.49852547", "text": "func (c *Check) validateType() error {\n\tswitch c.Type {\n\tcase MySQLShow:\n\t\tfallthrough\n\tcase MySQLSelect:\n\t\tfallthrough\n\tcase PostgreSQLShow:\n\t\tfallthrough\n\tcase PostgreSQLSelect:\n\t\tfallthrough\n\tcase MongoDBGetParameter:\n\t\tfallthrough\n\tcase MongoDBBuildInfo:\n\t\tfallthrough\n\tcase MongoDBGetCmdLineOpts:\n\t\treturn nil\n\tcase \"\":\n\t\treturn errors.New(\"check type is empty\")\n\tdefault:\n\t\treturn errors.Errorf(\"unknown check type: %s\", c.Type)\n\t}\n}", "title": "" }, { "docid": "7c5d00b4a2297cf8fea262c31eea1e3a", "score": "0.49832585", "text": "func (m ErrorMess) Validate(formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "531db2c4b0a44c618c93a976e12a980f", "score": "0.49805185", "text": "func (sv *SysVar) Validate(vars *SessionVars, value string, scope ScopeFlag) (string, error) {\n\t// Check that the scope is correct first.\n\tif err := sv.validateScope(scope); err != nil {\n\t\treturn value, err\n\t}\n\t// Normalize the value and apply validation based on type.\n\t// i.e. TypeBool converts 1/on/ON to ON.\n\tnormalizedValue, err := sv.ValidateFromType(vars, value, scope)\n\tif err != nil {\n\t\treturn normalizedValue, err\n\t}\n\t// If type validation was successful, call the (optional) validation function\n\tif sv.Validation != nil {\n\t\treturn sv.Validation(vars, normalizedValue, value, scope)\n\t}\n\treturn normalizedValue, nil\n}", "title": "" }, { "docid": "6666aa75cd0f2970d85555b5fa08c1cf", "score": "0.497617", "text": "func (l ListType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics {\n\tvar diags diag.Diagnostics\n\n\tif in.Type() == nil {\n\t\treturn diags\n\t}\n\n\tif !in.Type().Is(tftypes.List{}) {\n\t\terr := fmt.Errorf(\"expected List value, received %T with value: %v\", in, in)\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"List Type Validation Error\",\n\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+err.Error(),\n\t\t)\n\t\treturn diags\n\t}\n\n\tif !in.IsKnown() || in.IsNull() {\n\t\treturn diags\n\t}\n\n\tvar elems []tftypes.Value\n\n\tif err := in.As(&elems); err != nil {\n\t\tdiags.AddAttributeError(\n\t\t\tpath,\n\t\t\t\"List Type Validation Error\",\n\t\t\t\"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\\n\\n\"+err.Error(),\n\t\t)\n\t\treturn diags\n\t}\n\n\tvalidatableType, isValidatable := l.ElemType.(xattr.TypeWithValidate)\n\tif !isValidatable {\n\t\treturn diags\n\t}\n\n\tfor index, elem := range elems {\n\t\tif !elem.IsFullyKnown() {\n\t\t\tcontinue\n\t\t}\n\t\tdiags = append(diags, validatableType.Validate(ctx, elem, path.AtListIndex(index))...)\n\t}\n\n\treturn diags\n}", "title": "" }, { "docid": "72c2c8dbf22efc7ad7450215422e987a", "score": "0.49710128", "text": "func ValidateStruct(s interface{}) error {\n\t// returns nil or ValidationErrors ( []FieldError )\n\terr := validate.Struct(s)\n\tif err != nil {\n\n\t\t// this check is only needed when your code could produce\n\t\t// an invalid value for validation such as interface with nil\n\t\t// value most including myself do not usually have code like this.\n\t\tif _, ok := err.(*validator.InvalidValidationError); ok {\n\t\t\tfmt.Println(err)\n\t\t\treturn errors.Wrap(err, errInvalidType)\n\t\t}\n\n\t\t// for _, err := range err.(validator.ValidationErrors) {\n\n\t\t// fmt.Println(err.Namespace())\n\t\t// fmt.Println(err.Field())\n\t\t// fmt.Println(err.StructNamespace()) // can differ when a custom TagNameFunc is registered or\n\t\t// fmt.Println(err.StructField()) // by passing alt name to ReportError like below\n\t\t// fmt.Println(err.Tag())\n\t\t// fmt.Println(err.ActualTag())\n\t\t// fmt.Println(err.Kind())\n\t\t// fmt.Println(err.Type())\n\t\t// fmt.Println(err.Value())\n\t\t// fmt.Println(err.Param())\n\n\t\t// return errors.New(\"Error in: \" + err.StructField())\n\t\t// }\n\n\t\t// from here you can create your own error messages in whatever language you wish\n\t\treturn errors.Wrap(err, errInvalidStructure)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e30ef2f8be4b2ebbf6ca0a1dc64de6f7", "score": "0.49646154", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_RouterLsa_Links_TypesOfService_TypeOfService) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa_RouterLsa_Links_TypesOfService_TypeOfService\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c06d5ef368cf6f8ba3e742c36355a65", "score": "0.4956657", "text": "func (m MessageZ) Validate() error {\n\terr, _ := m.Value.(error)\n\treturn err\n}", "title": "" }, { "docid": "89f903f516e282b4186d9572b0e579ff", "score": "0.4953607", "text": "func (t *SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa) Validate(opts ...ygot.ValidationOption) error {\n\tif err := ytypes.Validate(SchemaTree[\"SrlNokiaNetworkInstance_NetworkInstance_Protocols_Ospf_Instance_Area_Lsdb_LsaTypes_LsaType_Lsas_Lsa\"], t, opts...); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4dcf32cd49e13e790b5ed28e5d8eebd7", "score": "0.4952626", "text": "func Validate(s string, opts ...Option) bool {\n\tc := NewDefaultConfig(opts...)\n\treturn ValidateWithConfig(s, c)\n}", "title": "" }, { "docid": "887f546ea60676d78b72a1fd5724f6e0", "score": "0.49458018", "text": "func (m ModelStatusDatumType) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\t// value enum\n\tif err := m.validateModelStatusDatumTypeEnum(\"\", \"body\", m); 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": "" } ]
fff043e4cfead97ca535f965e62be95b
NewGroupRegistry returns an empty GroupRegistry.
[ { "docid": "2a5faa3620adf7374829e704c70859d1", "score": "0.69551295", "text": "func NewGroupRegistry(\n\trelayChain relaychain.GroupRegistrationInterface,\n\tpersistence persistence.Handle,\n) *Groups {\n\treturn &Groups{\n\t\tmyGroups: make(map[string][]*Membership),\n\t\trelayChain: relayChain,\n\t\tstorage: newStorage(persistence),\n\t\tmutex: sync.Mutex{},\n\t}\n}", "title": "" } ]
[ { "docid": "cbca46ece30501305f958e41d8f6932e", "score": "0.6786233", "text": "func newGroup() *Group {\n\tg := new(Group)\n\tg.handlers = make([]HandlerFunc, 0)\n\treturn g\n}", "title": "" }, { "docid": "5d5b1351edfe53335b930853d877e0fb", "score": "0.67860854", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\toutlets: make([]*Outlet, 0),\n\t\toutletMap: make(map[string]*Outlet),\n\t\tgroups: make([]*Group, 0),\n\t\tgroupMap: make(map[string]*Group),\n\t}\n}", "title": "" }, { "docid": "4a702b2fd42adbfc67b0e4225cc9fbc0", "score": "0.66301906", "text": "func NewGroup() *Group {\n\treturn &Group{}\n}", "title": "" }, { "docid": "4a702b2fd42adbfc67b0e4225cc9fbc0", "score": "0.66301906", "text": "func NewGroup() *Group {\n\treturn &Group{}\n}", "title": "" }, { "docid": "634e625b4bbcff604b6ae785da77af52", "score": "0.6528303", "text": "func NewGroup(system SystemUtils) *Group {\n\treturn &Group{\n\t\tsystem: system,\n\t}\n}", "title": "" }, { "docid": "8c9a133f83dd861d7802ad67b4f1d252", "score": "0.6516504", "text": "func NewRegistry() Registry {\n\treturn make(Registry)\n}", "title": "" }, { "docid": "65f5038e5178b3985573cbd6bad91420", "score": "0.65003693", "text": "func NewRegistry() *Registry {\n\tt := Registry{}\n\tt.Reset()\n\n\treturn &t\n}", "title": "" }, { "docid": "4bb92a3d04cc9962da6ef51b0bcebd74", "score": "0.64845705", "text": "func newGroup(groupId string, broadcastChannelCap int64) *group {\n\n\tg := &group{\n\t\tId: groupId,\n\t\tclients: make(map[string]*socketClient),\n\t\tbroadcastChannel: make(chan interface{}, broadcastChannelCap),\n\t\tshutdownChannel: make(chan interface{}),\n\t\tdownChannel: make(chan interface{}, broadcastChannelCap),\n\t}\n\n\tAppLogger.Infof(\"[newGroup] group: %s created\", groupId)\n\treturn g\n}", "title": "" }, { "docid": "c203bae7157e28d018e757b69b97a99f", "score": "0.6479231", "text": "func New(dir string) *Group {\n\tg := &Group{\n\t\tdir: dir,\n\t}\n\tg.Clear()\n\treturn g\n}", "title": "" }, { "docid": "d17ca5cd4e3c16d97ac761f28b52b431", "score": "0.64746785", "text": "func WindowGroupNew() (*WindowGroup, error) {\n\tc := C.gtk_window_group_new()\n\tif c == nil {\n\t\treturn nil, nilPtrErr\n\t}\n\treturn wrapWindowGroup(glib.Take(unsafe.Pointer(c))), nil\n}", "title": "" }, { "docid": "fa65d9e3deb434eeaed9dca6fef5318f", "score": "0.6465523", "text": "func New(gid string) *Group {\n return &Group{\n Client: client.New().Init(),\n GroupID: gid,\n }\n}", "title": "" }, { "docid": "804c7b8cbba86c2a5715df69d2aab104", "score": "0.63670254", "text": "func NewRegistry() *Registry {\n\treturn new(Registry)\n}", "title": "" }, { "docid": "042d2fb427d0de882144deb564c57955", "score": "0.63519007", "text": "func NewGroup(name string) Group {\n\treturn Group{\n\t\tname: name,\n\t\treadyCh: make(chan struct{}),\n\t}\n}", "title": "" }, { "docid": "d335ca33e652c142864f61a4e93d3d53", "score": "0.635036", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\tmodules: make([]bar.Module, 0),\n\t}\n}", "title": "" }, { "docid": "4ca6f7ca24702a2f1921d81691034a04", "score": "0.63204014", "text": "func NewRegistry(opts ...registry.Option) registry.Registry {\n\treturn mdns.NewRegistry(opts...)\n}", "title": "" }, { "docid": "fbd5fe12b3738c51b8d52e077754ee6a", "score": "0.6312836", "text": "func NewGroup(gvr client.GVR) ResourceViewer {\n\tg := Group{ResourceViewer: NewBrowser(gvr)}\n\tg.AddBindKeysFn(g.bindKeys)\n\tg.SetContextFn(g.subjectCtx)\n\n\treturn &g\n}", "title": "" }, { "docid": "14e3f0d1d26d5f29af543b9f054f9a80", "score": "0.62991357", "text": "func NewGroup() UserGroup {\n\tgroup := make(UserGroup, 0)\n\treturn group\n}", "title": "" }, { "docid": "b4f05a8d422510312ac096d569f88232", "score": "0.6259461", "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\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": "" }, { "docid": "fc3cc235ccb78e38cac4266ee592dfec", "score": "0.6257752", "text": "func NewRegistry() *bsoncodec.Registry {\n\treturn NewRegistryBuilder().Build()\n}", "title": "" }, { "docid": "f6ec3305853ed9cc89f87847ba07e6e0", "score": "0.6214605", "text": "func NewGroup(name string, members ...string) *Group {\n\treturn &Group{\n\t\tName: name,\n\t\tpassword: \"\",\n\t\tGID: -1,\n\t\tUserList: members,\n\t}\n}", "title": "" }, { "docid": "d68f43e40a9e5f89674a023532419873", "score": "0.62017196", "text": "func NewRegistry() *Registry {\n\tregistry := Registry{}\n\tregistry.lock = &sync.Mutex{}\n\treturn &registry\n}", "title": "" }, { "docid": "fad6a3a3c7e81ed99c3bf00bd3f73f08", "score": "0.6198656", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\tServicesMap: make(map[string]ServiceList),\n\t}\n}", "title": "" }, { "docid": "32c69ff44bd636e2afcaebbb84e42a62", "score": "0.61547244", "text": "func NewGroup()(*Group) {\n m := &Group{\n DirectoryObject: *NewDirectoryObject(),\n }\n odataTypeValue := \"#microsoft.graph.group\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "title": "" }, { "docid": "dc7fcc810b960ceac7a2889208053319", "score": "0.61349887", "text": "func NewRegistry(opts ...registry.Option) registry.Registry {\r\n\treturn registry.NewRegistry(opts...)\r\n}", "title": "" }, { "docid": "40fbd94ee142a16505d84bb68e0f3b7f", "score": "0.6120801", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\tall: make(map[string]*Job),\n\t}\n}", "title": "" }, { "docid": "c868d2518cf1ef3a6de07b7d17fce2b5", "score": "0.6102915", "text": "func NewRegistry(scheme *runtime.Scheme, codec serializer.CodecFactory, serializer *json.Serializer) *Registry {\n\tvar groupVersions []schema.GroupVersion\n\tfor k := range scheme.AllKnownTypes() {\n\t\tgroupVersions = append(groupVersions, k.GroupVersion())\n\t}\n\n\treturn &Registry{\n\t\tscheme: scheme,\n\t\tcodec: codec.CodecForVersions(serializer, serializer, schema.GroupVersions(groupVersions), schema.GroupVersions(groupVersions)),\n\t\tnameToObject: make(map[string]*object),\n\t}\n}", "title": "" }, { "docid": "78ab9431a8c12442903c2dbd8485ddc5", "score": "0.6064412", "text": "func NewGroup(name string, maxSize int) *Group {\n\treturn &Group{\n\t\tName: name,\n\t\tMembers: []Person{},\n\t\tMaxSize: maxSize,\n\t}\n}", "title": "" }, { "docid": "caf401e3934e16fea498aa9b698c7e8b", "score": "0.6038459", "text": "func New(client *marathon.Client) *Groups {\n\n\tif client != nil {\n\t\treturn &Groups{\n\t\t\tclient: client,\n\t\t\tgroup: &Group{},\n\t\t\tdeploy: &data.Response{},\n\t\t\tfail: &data.FailureMessage{},\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bc62db8c175ebe5e81b496b86bd37264", "score": "0.60233706", "text": "func NewGroup(ctx context.Context) *Group {\n\tctx, cancel := context.WithCancel(ctx)\n\n\tg := &Group{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tdone: make(chan struct{}),\n\t}\n\n\tgo g.wait()\n\n\treturn g\n}", "title": "" }, { "docid": "b4e39096592b46468ad6f85e0f051b95", "score": "0.60218304", "text": "func NewGroup(name string, cacheBytes int64, getter Getter) *Group {\n\tif getter == nil {\n\t\tpanic(\"Nil Getter\")\n\t}\n\n\tmu.Lock()\n\tdefer mu.Unlock()\n\n\tg := &Group{\n\t\tname: name,\n\t\tmainCache: &SafeCache{maxBytes: cacheBytes},\n\t\tgetter: getter,\n\t}\n\tgroups[name] = g\n\treturn g\n}", "title": "" }, { "docid": "500e346b44d8ace296aa929eed86aaab", "score": "0.6017399", "text": "func NewGroup(ctx context.Context, options ...GroupOption) *Group {\n\tctx, cancel := context.WithCancel(ctx)\n\tg := &Group{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tpool: dummyPool{},\n\t\trecover: false,\n\t}\n\tfor _, opt := range options {\n\t\topt(g)\n\t}\n\treturn g\n}", "title": "" }, { "docid": "75e699a4eda23981175508ca05de3080", "score": "0.601464", "text": "func NewCalendarGroup()(*CalendarGroup) {\n m := &CalendarGroup{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "1461065614b6245c843aadfd9616afb0", "score": "0.59898376", "text": "func NewRegistry(userNS *auth.UserNamespace) *Registry {\n\treturn &Registry{\n\t\treg: ipc.NewRegistry(userNS),\n\t}\n}", "title": "" }, { "docid": "f064ab0ff30c53a4428a91ef3aa61d0f", "score": "0.59824425", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\ttypes: make(map[string]reflect.Type),\n\t\tmu: sync.Mutex{},\n\t}\n}", "title": "" }, { "docid": "81b480b82b2db9b87e5f58730f82b0b5", "score": "0.59823334", "text": "func NewRegistry(\n\trepoRegistry domain.RepositoryRegistry,\n) domain.Registry {\n\n\tr := registry{\n\t\trepoRegistry: repoRegistry,\n\t\taccountService: NewAccountService(\n\t\t\trepoRegistry,\n\t\t\tvalidator.NewAccountCreation(),\n\t\t\tvalidator.NewAccountBalanceUpdate(),\n\t\t),\n\t\ttransferService: NewTransferService(\n\t\t\trepoRegistry,\n\t\t\tvalidator.NewTransferCreation(),\n\t\t),\n\t\taccessService: NewAccessService(\n\t\t\trepoRegistry,\n\t\t),\n\t}\n\tr.checkDependencies()\n\n\treturn &r\n}", "title": "" }, { "docid": "1e8a210adb4e66792b53bcfa6b88b703", "score": "0.597263", "text": "func New() *ClrInstGrp {\n\tvar m ClrInstGrp\n\treturn &m\n}", "title": "" }, { "docid": "eef69a7b4ff625679a5a1fb70e0b1c30", "score": "0.5966071", "text": "func New(directory string) (*Group, []error) {\n\tthis := new(Group)\n\n\tthis.t = template.New(\"\")\n\tthis.t.Parse(\"\")\n\n\terrs := this.loadFolder(directory)\n\n\treturn this, errs\n}", "title": "" }, { "docid": "282f9de1285dae216c60feff2a1c24a1", "score": "0.59560317", "text": "func NewGroupLookup() *GroupLookup {\n\treturn &GroupLookup{\n\t\tlastIndex: -1,\n\t\tnextID: 1,\n\t}\n}", "title": "" }, { "docid": "aeac6acd1e2ce9dc3e8e435d42051a23", "score": "0.59388137", "text": "func NewGroup(client *Client) *GroupService {\n\treturn &GroupService{\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "cdf3a166927924faf4e257eeefa3879f", "score": "0.59338284", "text": "func NewRegistry() ObjectRegistry {\n\timpl := &registry{actionChannel: make(actionChannel)}\n\tgo impl.run()\n\n\treturn impl\n}", "title": "" }, { "docid": "ed23b36576d372e63a4eca1760aff0c5", "score": "0.5930845", "text": "func NewRegistry() *Registry {\n\tr := &Registry{}\n\tr.functions = make(map[string]*function)\n\treturn r\n}", "title": "" }, { "docid": "71df8cb392c5f0b222d5fba67b6cb4b1", "score": "0.59229827", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\tplugins: make(map[string]interface{}),\n\t\tproviders: make(map[string]interface{}),\n\t}\n}", "title": "" }, { "docid": "b916d5a61a9b8a8498216c6d87859320", "score": "0.5921394", "text": "func New(app, account, region, stack, cluster string) InstanceGroup {\n\treturn group{\n\t\tapp: app,\n\t\taccount: account,\n\t\tregion: region,\n\t\tstack: stack,\n\t\tcluster: cluster,\n\t}\n}", "title": "" }, { "docid": "f9af066bb80780d3d3ec51f79f3ff315", "score": "0.58965904", "text": "func New(servers ...Server) *Group {\n\treturn &Group{servers: servers, shutdownTimeout: DefaultShutdownTimeout}\n}", "title": "" }, { "docid": "b5464cab4abc06a8adc71e07673078c3", "score": "0.58906114", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\trateLimiters: make(map[string]*rate.Limiter),\n\t}\n}", "title": "" }, { "docid": "35197b830d7a869cec8c51191d71d576", "score": "0.58877903", "text": "func NewResourceGroup(key string) ResourceGroup {\n\tscope := Scope{\n\t\tKey: key,\n\t\tScopeObjects: []ScopeObject{\n\t\t\t{\n\t\t\t\tKey: \"*\",\n\t\t\t},\n\t\t},\n\t}\n\tresourceGroup := ResourceGroup{\n\t\tID: \"\",\n\t\tName: key,\n\t\tMeta: map[string]string{\n\t\t\t\"editable\": \"false\",\n\t\t},\n\t\tScope: scope,\n\t}\n\treturn resourceGroup\n}", "title": "" }, { "docid": "2891c053d2c874d740265b6eca0e07cb", "score": "0.58825487", "text": "func newBucketGroup(mBuckets int64) bucketGroup {\n\treturn make(bucketGroup, mBuckets)\n}", "title": "" }, { "docid": "017bfcf26f3e2600284c04ec8933aa71", "score": "0.5864015", "text": "func NewRegistry(b biz.RegistryBiz) *RegistryHandler {\n\treturn &RegistryHandler{\n\t\tSearch: registrySearch(b),\n\t\tFind: registryFind(b),\n\t\tDelete: registryDelete(b),\n\t\tSave: registrySave(b),\n\t}\n}", "title": "" }, { "docid": "19af635023507f43a8c8508f762ede71", "score": "0.5861146", "text": "func NewGroup(m *algebra.Matrix) *Group {\n\tmat := m\n\tif m == nil || len(m.Get()) != 4 || len(m.Get()[0]) != 4 {\n\t\tmat = algebra.IdentityMatrix(4)\n\t}\n\temptyShapes := make([]Shape, 0, 0)\n\treturn &Group{transform: mat, parent: nil, shapes: emptyShapes, bounds: [2]*algebra.Vector{}}\n}", "title": "" }, { "docid": "751bcb71cc604d3a7300d5e16ccb49a7", "score": "0.58549386", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\tnodesView: make(map[identity.ID]*View),\n\t}\n}", "title": "" }, { "docid": "b33acbb6d8f3d2916bb94e5b11aed9a7", "score": "0.58431035", "text": "func newRegistry(logger logr.Logger, config globalregistry.RegistryConfig) (globalregistry.Registry, error) {\n\tvar err error\n\tc := &registry{\n\t\tlogger: logger,\n\t\tRegistryConfig: config,\n\t\tClient: http.DefaultClient,\n\t}\n\tc.projects, err = newProjectAPI(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.remoteRegistries = newRemoteRegistries(c)\n\tc.replications = newReplicationAPI(c)\n\tc.parsedUrl, err = url.Parse(config.GetAPIEndpoint())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tc.scanners = newScannerAPI(c)\n\treturn c, nil\n}", "title": "" }, { "docid": "ad81d4b1736a95f02a7ac65bd16e7d95", "score": "0.58377355", "text": "func NewGroup(field string) Group {\n\treturn Group{\n\t\tField: field,\n\t}\n}", "title": "" }, { "docid": "1051998f891b3c8d5fa3f4f38831f3e6", "score": "0.5827167", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\ttypeForTag: typeForTag{},\n\t\ttagForType: tagForType{},\n\t\tfactoryForType: factoryForType{},\n\t}\n}", "title": "" }, { "docid": "5a5ae6fdedb892b1a9d33e51f4ac43fa", "score": "0.58266556", "text": "func New(controllerManager *generic.ControllerManager, informers informers.Interface,\n\tclient clientset.Interface) Interface {\n\treturn &group{\n\t\tcontrollerManager: controllerManager,\n\t\tinformers: informers,\n\t\tclient: client,\n\t}\n}", "title": "" }, { "docid": "f6c7c328dfe535b2a6e47f1ab89140ce", "score": "0.58017087", "text": "func NewRegistry(settings ...Settings) *Registry {\n\treturn NewSwarmRegistry(nil, nil, settings...)\n}", "title": "" }, { "docid": "dc334efd03902e9be3382abd69fcf8dd", "score": "0.58016115", "text": "func NewGroup(name string, o Owner) *Group {\n\tng := new(Group)\n\tng.Own = o\n\tng.Name = name\n\n\tvar nid OwnerID\n\tnid.Type = 'g'\n\tnid.UserDefined = name2userdefined(name)\n\t// nid.Stamp = newstamp()\n\n\tng.ID = nid\n\n\treturn ng\n}", "title": "" }, { "docid": "abdf9b811732e2dd87a712e8758e8f12", "score": "0.5798559", "text": "func New(ctx context.Context) *Group {\n\t// Monitor goroutine context and cancelation.\n\tmctx, cancel := context.WithCancel(ctx)\n\n\tg := &Group{\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\n\t\taddC: make(chan struct{}),\n\t\tlenC: make(chan int),\n\t}\n\n\tg.wg.Add(1)\n\tgo func() {\n\t\tdefer g.wg.Done()\n\t\tg.monitor(mctx)\n\t}()\n\n\treturn g\n}", "title": "" }, { "docid": "b8a55084110083afca6b1bc7d4398bc0", "score": "0.57771194", "text": "func NewGroupStore() storage.Interface {\n\tindexers := cache.Indexers{\n\t\tcache.NamespaceIndex: func(obj interface{}) ([]string, error) {\n\t\t\tg, ok := obj.(*antreatypes.Group)\n\t\t\tif !ok {\n\t\t\t\treturn []string{}, nil\n\t\t\t}\n\t\t\treturn []string{g.Selector.Namespace}, nil\n\t\t},\n\t\tGroupMemberIndex: func(obj interface{}) ([]string, error) {\n\t\t\tg, ok := obj.(*antreatypes.Group)\n\t\t\tif !ok {\n\t\t\t\treturn []string{}, nil\n\t\t\t}\n\t\t\tvar members []string\n\t\t\tfor _, m := range g.GroupMembers {\n\t\t\t\tif m.Pod != nil {\n\t\t\t\t\tmembers = append(members, k8s.NamespacedName(m.Pod.Namespace, m.Pod.Name))\n\t\t\t\t} else if m.ExternalEntity != nil {\n\t\t\t\t\tmembers = append(members, k8s.NamespacedName(m.ExternalEntity.Namespace, m.ExternalEntity.Name))\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn members, nil\n\t\t},\n\t}\n\treturn ram.NewStore(GroupKeyFunc, indexers, genGroupEvent, keyAndSpanSelectFunc, func() runtime.Object { return new(controlplane.Group) })\n}", "title": "" }, { "docid": "9cd232bea2a62dd7bcf580efafa750d2", "score": "0.57694304", "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(\"aws-native:eventschemas:Registry\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "deb524039e7e8ff6554f806d57079eaa", "score": "0.57578087", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "deb524039e7e8ff6554f806d57079eaa", "score": "0.57578087", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv4_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "06f537df8204a1f1dbbc09bbb674d791", "score": "0.57555294", "text": "func New(reg *api.Registry, store ApiObjectProvider) *Registry {\n\treturn &Registry{\n\t\tapiProvider: store,\n\t\tapiRegistry: reg,\n\t}\n}", "title": "" }, { "docid": "450ea101a91dbaea30c3b8075a83298f", "score": "0.5754747", "text": "func New() *StorageGroup {\n\treturn NewFromV2(new(storagegroup.StorageGroup))\n}", "title": "" }, { "docid": "e1b0c9ab97ab80c36533bac2d6b0689a", "score": "0.5742423", "text": "func NewDefaultGroups(ctx *pulumi.Context,\n\tname string, args *DefaultGroupsArgs, opts ...pulumi.ResourceOption) (*DefaultGroups, error) {\n\tif args == nil || args.GroupIds == nil {\n\t\treturn nil, errors.New(\"missing required argument 'GroupIds'\")\n\t}\n\tif args == nil || args.RealmId == nil {\n\t\treturn nil, errors.New(\"missing required argument 'RealmId'\")\n\t}\n\tif args == nil {\n\t\targs = &DefaultGroupsArgs{}\n\t}\n\tvar resource DefaultGroups\n\terr := ctx.RegisterResource(\"keycloak:index/defaultGroups:DefaultGroups\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "07b02063ddf5b56a2fbe3d03a8b384cb", "score": "0.5739891", "text": "func newRouteGroup(prefix string, router *Router, handlers []Handler) *RouteGroup {\n\treturn &RouteGroup{\n\t\tprefix: prefix,\n\t\trouter: router,\n\t\thandlers: handlers,\n\t}\n}", "title": "" }, { "docid": "ba6adac3f485a2abdee53b3133621d97", "score": "0.5734644", "text": "func NewGroup(bootles []Bottle, water uint32) Group {\n\treturn Group{\n\t\tWater: water,\n\t\tBottles: bootles,\n\t}\n}", "title": "" }, { "docid": "85d83be47746ba0a0ed9a46c42068506", "score": "0.57323563", "text": "func (t *OpenconfigSystem_System_Aaa_ServerGroups) NewServerGroup(Name string) (*OpenconfigSystem_System_Aaa_ServerGroups_ServerGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.ServerGroup == nil {\n\t\tt.ServerGroup = make(map[string]*OpenconfigSystem_System_Aaa_ServerGroups_ServerGroup)\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.ServerGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list ServerGroup\", key)\n\t}\n\n\tt.ServerGroup[key] = &OpenconfigSystem_System_Aaa_ServerGroups_ServerGroup{\n\t\tName: &Name,\n\t}\n\n\treturn t.ServerGroup[key], nil\n}", "title": "" }, { "docid": "98e92139128726512068dcd99b225f3a", "score": "0.57249224", "text": "func (og *OrdererGroup) NewGroup(name string) (ValueProposer, error) {\n\treturn NewOrganizationGroup(name, og.mspConfig), nil\n}", "title": "" }, { "docid": "23bb3157d7445dcf5f7093490bece272", "score": "0.5724556", "text": "func (r *RouteGroup) NewGroup(path string) *RouteGroup {\n\treturn NewRouteGroup(r.r, r.subPath(path))\n}", "title": "" }, { "docid": "116d1141208d5098e29af31f79c87b2c", "score": "0.57243574", "text": "func NewGroups(filename string, bad BadLineHandler) (*HTGroup, error) {\n\thtGroup := HTGroup{\n\t\tfilePath: filename,\n\t}\n\treturn &htGroup, htGroup.ReloadGroups(bad)\n}", "title": "" }, { "docid": "e715df8429afe8cdb71f09cd13b0e01d", "score": "0.57120436", "text": "func (t *DeviceGroup_DeviceGroup) NewDeviceGroup(Id string) (*DeviceGroup_DeviceGroup_DeviceGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.DeviceGroup == nil {\n\t\tt.DeviceGroup = make(map[string]*DeviceGroup_DeviceGroup_DeviceGroup)\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.DeviceGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list DeviceGroup\", key)\n\t}\n\n\tt.DeviceGroup[key] = &DeviceGroup_DeviceGroup_DeviceGroup{\n\t\tId: &Id,\n\t}\n\n\treturn t.DeviceGroup[key], nil\n}", "title": "" }, { "docid": "837388a45029de3ff13e0fed309fd08a", "score": "0.5703689", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\ttypeEncoders: new(typeEncoderCache),\n\t\ttypeDecoders: new(typeDecoderCache),\n\t\tkindEncoders: new(kindEncoderCache),\n\t\tkindDecoders: new(kindDecoderCache),\n\t}\n}", "title": "" }, { "docid": "90a61ce94450dabbb510068125db5b91", "score": "0.57024646", "text": "func New() *FillsGrp {\n\tvar m FillsGrp\n\treturn &m\n}", "title": "" }, { "docid": "9f0a841b7dd7cca152be9669ba9ce231", "score": "0.5689163", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "9f0a841b7dd7cca152be9669ba9ce231", "score": "0.56872416", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Ipv6_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "577c4bcb258b42fbeca3a60768121fea", "score": "0.5687191", "text": "func NewRegistry() Registry {\n\tfr := make(Registry)\n\tfr.mustRegister(BuiltIns...)\n\treturn fr\n}", "title": "" }, { "docid": "bd3701b6d915718a081a914ff4509e97", "score": "0.56833166", "text": "func NewDefaultRegistry() framework.Registry {\n\treturn framework.Registry{\n\t\t// This is just a test plugin to showcase the setup, it should be deleted once\n\t\t// we have at least one legitimate plugin here.\n\t\tnoop.Name: noop.New,\n\t}\n}", "title": "" }, { "docid": "0470f1c650bbbfeace7d47bca18495f1", "score": "0.5669232", "text": "func NewRegistry() *Registry {\n\treturn &Registry{\n\t\tentries: make(map[datatransfer.TypeIdentifier]Processor),\n\t}\n}", "title": "" }, { "docid": "66111ba694a715446078065cd722ff6d", "score": "0.56609964", "text": "func NewRegistry(s Storage) Registry {\n\treturn &storage{s}\n}", "title": "" }, { "docid": "66111ba694a715446078065cd722ff6d", "score": "0.56609964", "text": "func NewRegistry(s Storage) Registry {\n\treturn &storage{s}\n}", "title": "" }, { "docid": "d7ca011f0e395ae58da7505ac35ebac9", "score": "0.5648778", "text": "func New(s []string) Group {\n\treturn Group{str: s}\n}", "title": "" }, { "docid": "3b1640d2a514db1cb83734359e596094", "score": "0.56468064", "text": "func New() *Registry {\n\tr := &Registry{\n\t\tstore: make(map[string]template.Template),\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "80e6431d5238dd33242ccd530daaa06e", "score": "0.5644105", "text": "func (t *OpenconfigOfficeAp_System_Aaa_ServerGroups) NewServerGroup(Name string) (*OpenconfigOfficeAp_System_Aaa_ServerGroups_ServerGroup, error) {\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.ServerGroup == nil {\n\t\tt.ServerGroup = make(map[string]*OpenconfigOfficeAp_System_Aaa_ServerGroups_ServerGroup)\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.ServerGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list ServerGroup\", key)\n\t}\n\n\tt.ServerGroup[key] = &OpenconfigOfficeAp_System_Aaa_ServerGroups_ServerGroup{\n\t\tName: &Name,\n\t}\n\n\treturn t.ServerGroup[key], nil\n}", "title": "" }, { "docid": "98c01080c2003da452381c27787f9d43", "score": "0.5641824", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "98c01080c2003da452381c27787f9d43", "score": "0.5641824", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv4_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "ef4df22b01eb15077f68ef509699818e", "score": "0.56341904", "text": "func NewGroup(client *gosip.SPClient, endpoint string, config *RequestConfig) *Group {\n\treturn &Group{\n\t\tclient: client,\n\t\tendpoint: endpoint,\n\t\tconfig: config,\n\t\tmodifiers: NewODataMods(),\n\t}\n}", "title": "" }, { "docid": "482d53791068d7065c75bc4dc54de6de", "score": "0.5625047", "text": "func NewGroup(owner, name string) Group {\n\tnow := time.Now()\n\treturn Group{\n\t\tOwner: owner,\n\t\tName: name,\n\t\tDescription: name,\n\t\tAccess: \"private\",\n\t\tBirthtime: now,\n\t\tMTime: now,\n\t}\n}", "title": "" }, { "docid": "f51a061d3ed0b2cb2e3c0de36b452854", "score": "0.5624819", "text": "func NewServerGroup(ctx *pulumi.Context,\n\tname string, args *ServerGroupArgs, opts ...pulumi.ResourceOption) (*ServerGroup, error) {\n\tif args == nil {\n\t\targs = &ServerGroupArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource ServerGroup\n\terr := ctx.RegisterResource(\"openstack:compute/serverGroup:ServerGroup\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "7f706943569ddafdc38f9793e836d066", "score": "0.5624308", "text": "func NewGroup(list []*Identity, threshold int, genesis int64, period, catchupPeriod time.Duration,\n\tsch *crypto.Scheme, beaconID string) *Group {\n\treturn &Group{\n\t\tNodes: copyAndSort(list),\n\t\tThreshold: threshold,\n\t\tGenesisTime: genesis,\n\t\tPeriod: period,\n\t\tCatchupPeriod: catchupPeriod,\n\t\tScheme: sch,\n\t\tID: beaconID,\n\t}\n}", "title": "" }, { "docid": "bc714c244b08a4b89bb9c294baee064b", "score": "0.56164503", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "bc714c244b08a4b89bb9c294baee064b", "score": "0.56164503", "text": "func (t *OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp) NewVrrpGroup(VirtualRouterId uint8) (*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp_VrrpGroup, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.VrrpGroup == nil {\n\t\tt.VrrpGroup = make(map[uint8]*OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp_VrrpGroup)\n\t}\n\n\tkey := VirtualRouterId\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.VrrpGroup[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list VrrpGroup\", key)\n\t}\n\n\tt.VrrpGroup[key] = &OpenconfigInterfaces_Interfaces_Interface_RoutedVlan_Ipv6_Addresses_Address_Vrrp_VrrpGroup{\n\t\tVirtualRouterId: &VirtualRouterId,\n\t}\n\n\treturn t.VrrpGroup[key], nil\n}", "title": "" }, { "docid": "88d759260954f295e67cdad8f792dbef", "score": "0.56103617", "text": "func NewRegistry(name string) (*Registry, error) {\n\tref := registry.Reference{\n\t\tRegistry: name,\n\t}\n\tif err := ref.ValidateRegistry(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Registry{\n\t\tRepositoryOptions: RepositoryOptions{\n\t\t\tReference: ref,\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "1161811fb1156eadbb7d8c05ce2138e4", "score": "0.56102306", "text": "func NewGroup(lv Level, w io.Writer) Group {\n\treturn NewGroupWithHandle(lv, w, nil, nil)\n}", "title": "" }, { "docid": "ac7681aec033771d99280aed1541672e", "score": "0.56082046", "text": "func (g *Group) NewSubgroup() *Group {\n\tid := g.db.nextGroupID()\n\tsub := &Group{ID: id, db: g.db}\n\tg.groups = append(g.groups, sub)\n\tg.db.groups[id] = sub\n\treturn sub\n}", "title": "" }, { "docid": "6146c627cede1fe507e66468170c7bb2", "score": "0.56045055", "text": "func newRunnerGroup(scope RunnerGroupScope, name string) RunnerGroup {\n\tif name == \"\" {\n\t\treturn RunnerGroup{\n\t\t\tScope: scope,\n\t\t\tKind: Default,\n\t\t\tName: \"\",\n\t\t}\n\t}\n\n\treturn RunnerGroup{\n\t\tScope: scope,\n\t\tKind: Custom,\n\t\tName: name,\n\t}\n}", "title": "" }, { "docid": "23dc05ee7f93cb15a78efbe06ed1438c", "score": "0.55873466", "text": "func New(opts ...Option) *Registry {\n\tregistry := &Registry{}\n\n\t// apply options\n\tfor _, opt := range opts {\n\t\topt(registry)\n\t}\n\n\treturn registry\n}", "title": "" }, { "docid": "2b8ce1405dbdf72d312203a8191f3b15", "score": "0.55615133", "text": "func NewRegistry(\n\tparams libfsm.ExecutorParams,\n\tclusterApp loc.Locator,\n\tclusterApps app.Applications,\n\tclusterPackages pack.PackageService,\n\tsilent localenv.Silent,\n\tlogger log.FieldLogger,\n) (libfsm.PhaseExecutor, error) {\n\tstateDir, err := state.GetStateDir()\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\n\timageService, err := docker.NewImageService(docker.RegistryConnectionRequest{\n\t\tRegistryAddress: defaults.LocalRegistryAddr,\n\t\tCertName: defaults.DockerRegistry,\n\t\tCACertPath: state.Secret(stateDir, defaults.RootCertFilename),\n\t\tClientCertPath: state.Secret(stateDir, \"kubelet.cert\"),\n\t\tClientKeyPath: state.Secret(stateDir, \"kubelet.key\"),\n\t})\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\tpruner, err := registry.New(registry.Config{\n\t\tApp: &clusterApp,\n\t\tApps: clusterApps,\n\t\tPackages: clusterPackages,\n\t\tImageService: imageService,\n\t\tConfig: prune.Config{\n\t\t\tSilent: silent,\n\t\t\tFieldLogger: logger,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t}\n\treturn &registryExecutor{\n\t\tFieldLogger: logger,\n\t\tPruner: pruner,\n\t\tsilent: silent,\n\t}, nil\n}", "title": "" }, { "docid": "bc761a410ba3e0f645e293561e58a190", "score": "0.5555023", "text": "func New() *Registry {\n\treturn &Registry{\n\t\tdb: make(map[string]*task.Task),\n\t}\n}", "title": "" }, { "docid": "08946d527248ccb52302463d723f5dd3", "score": "0.5554649", "text": "func DefaultRegistry() *Registry {\n\treturn &defaultRegistry\n}", "title": "" }, { "docid": "28ceb9323affdd1ec7d8a7d755c4b9bc", "score": "0.55546004", "text": "func NewRegistry(s Storage) WatchingRegistry {\n\treturn &storage{s}\n}", "title": "" } ]
fe01ada98a1170e1577f795b7f0485cd
GetCompanyName gets the companyName property value. The name of the contact's company.
[ { "docid": "c1a1890a95794248ff424a099eeba55a", "score": "0.827036", "text": "func (m *Contact) GetCompanyName()(*string) {\n return m.companyName\n}", "title": "" } ]
[ { "docid": "56d79f72e6ef287992f34601b4fb33ab", "score": "0.7949281", "text": "func (o *CreateCustomerFiscalEntitiesResponse) GetCompanyName() string {\n\tif o == nil || IsNil(o.CompanyName) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "c9a67741414e7f0a689ee8ec21c72f01", "score": "0.79225683", "text": "func (o *InlineResponse2007Comments) GetCompanyName() string {\n\tif o == nil || o.CompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "0d41e4f8a0497b0c0cfc6bf2286ba714", "score": "0.7834122", "text": "func (o *CompanyUpdateResponseCompany) GetContactName() string {\n\tif o == nil || o.ContactName.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn *o.ContactName.Get()\n}", "title": "" }, { "docid": "b0f1a62d91321b1361faa987eba94f23", "score": "0.7804069", "text": "func (c *Company) CompanyName() string {\n\treturn c.format(c.pick(companyPrefix+\"/name\"), companyPrefix)\n}", "title": "" }, { "docid": "31dd68a4da40ddd294fac6254f47a42a", "score": "0.7724629", "text": "func (o *InlineResponse20013People) GetCompanyName() string {\n\tif o == nil || o.CompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "40090b67a0b8c276675386963dd4b9d7", "score": "0.77208155", "text": "func (o *InlineResponse20022Invoices) GetCompanyName() string {\n\tif o == nil || o.CompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "9b2ea957c6058386efe4caa0c8deb815", "score": "0.76917803", "text": "func (o *InlineResponse200107TimeEntries) GetCompanyName() string {\n\tif o == nil || o.CompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "e32037f1968e97f229e65606af824ba6", "score": "0.75865245", "text": "func (o UserInfoPtrOutput) CompanyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *UserInfo) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.CompanyName\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "00f89a3c16ff71951221e66b5f4a0a91", "score": "0.75779045", "text": "func (o *InlineResponse200120Workload) GetCompanyName() string {\n\tif o == nil || o.CompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "1a12b22f3240ce284cf10bd98046b572", "score": "0.7562995", "text": "func (o UserInfoOutput) CompanyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserInfo) *string { return v.CompanyName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "5d598fd6a7fd671cca6f96690a77624f", "score": "0.75463164", "text": "func (o *QuotationCreateParams) GetCompanyName() string {\n\tif o == nil || o.CompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyName\n}", "title": "" }, { "docid": "304df9e61b113278f41973a3a96ce69b", "score": "0.75229037", "text": "func GetCompanyName(companyNumber string, req *http.Request) (string, error) {\n\n\tapi, err := manager.GetSDK(req)\n\tif err != nil {\n\t\tlog.ErrorR(req, err, log.Data{\"company_number\": companyNumber})\n\t\treturn \"\", err\n\t}\n\n\tcompanyProfile, err := api.Profile.Get(companyNumber).Do()\n\tif err != nil {\n\t\tlog.ErrorR(req, err, log.Data{\"company_number\": companyNumber})\n\t\treturn \"\", err\n\t}\n\n\treturn companyProfile.CompanyName, nil\n}", "title": "" }, { "docid": "afc536885a79f8bc6f85640607695ce0", "score": "0.75186926", "text": "func (o UserInfoResponseOutput) CompanyName() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v UserInfoResponse) *string { return v.CompanyName }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1094ea353469d6366125036fa2089ff7", "score": "0.7390391", "text": "func (o *CompanyUpdateResponseCompany) GetName() string {\n\tif o == nil || o.Name.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn *o.Name.Get()\n}", "title": "" }, { "docid": "6f5219b7581cad0ede02067c1d6b5eff", "score": "0.687019", "text": "func (m *Contact) GetYomiCompanyName()(*string) {\n return m.yomiCompanyName\n}", "title": "" }, { "docid": "bf998806ec9fe41cd0ddbf7263411662", "score": "0.68616205", "text": "func CompanyName() string {\n\tchoice := rand.Intn(3)\n\n\tswitch choice {\n\tcase 1:\n\t\treturn fmt.Sprintf(\"%s - %s\", faker.LastName(), faker.LastName())\n\tcase 2:\n\t\treturn fmt.Sprintf(\"%s, %s and %s\", faker.LastName(), faker.LastName(), faker.LastName())\n\tdefault:\n\t\tsuffix := auth.RandomStringChoice(companySuffixes[:])\n\t\treturn fmt.Sprintf(\"%s %s\", faker.LastName(), suffix)\n\t}\n}", "title": "" }, { "docid": "4c50726c727be174f575eb99dd2a5ebd", "score": "0.68212444", "text": "func (m *PrivilegeManagementElevation) GetCompanyName()(*string) {\n val, err := m.GetBackingStore().Get(\"companyName\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "119ca9bb7798b81572c0ec3c7b8e31df", "score": "0.6774086", "text": "func (o *InlineResponse2007Comments) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || o.CompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "cabe77330a9c95f92034d12e0ec15963", "score": "0.6753924", "text": "func (o *InlineResponse20013People) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || o.CompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "0b4bf9af85a4696cfc078e2a7c20429b", "score": "0.6721355", "text": "func (o *CreateCustomerFiscalEntitiesResponse) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || IsNil(o.CompanyName) {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "dbcb3026179a835b41c3f436b2a6c8be", "score": "0.6710143", "text": "func (m *Contact) SetCompanyName(value *string)() {\n m.companyName = value\n}", "title": "" }, { "docid": "c94b417b936b74cab5486a0905594170", "score": "0.6671951", "text": "func (o *InlineResponse200120Workload) GetUserCompanyName() string {\n\tif o == nil || o.UserCompanyName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.UserCompanyName\n}", "title": "" }, { "docid": "3e7554ae722d3e62885a60ae28acbed6", "score": "0.6663084", "text": "func (o *InlineResponse20022Invoices) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || o.CompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "cbe2c72c5d6cff839bcae6da46ff74dd", "score": "0.6615886", "text": "func Company() string {\n\treturn lookup(lang, \"companies\", true)\n}", "title": "" }, { "docid": "d737e3104a54233f4e6647453c36b7bb", "score": "0.6557859", "text": "func (o *InlineResponse200107TimeEntries) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || o.CompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "bcfa9407e3d40f9679705d3c0dd74374", "score": "0.65543926", "text": "func GetCompany(ctx *contx.Context) {\n\tid := ctx.Params(\":id\")\n\tcompany, err := repo.GetCompanyMongo(id)\n\tif err != nil {\n\t\tfmt.Printf(\"[user.GetCompanyMongo] Erro ao retornar o Company do MongoDB\")\n\t\treturn\n\t}\n\tfmt.Printf(\"%v\\n\\r\", company)\n\tctx.JSON(http.StatusAccepted, company)\n\treturn\n}", "title": "" }, { "docid": "edd8c8b049d25deb897e194e55c6dd38", "score": "0.6502039", "text": "func (s *hyCompanysrvc) GetCompany(ctx context.Context, p *hycompany.GetCompanyPayload) (res *hycompany.Company, view string, err error) {\n\tlog.Info().Msg(\"hyCompany.getCompany\")\n\n\tcompany, err := s.companyRepo.GetCompany(p.CompanyID)\n\tif err != nil {\n\t\t// Not Found\n\t\tif strings.Contains(err.Error(), \"no rows in result set\") {\n\t\t\treturn nil, \"\", hycompany.MakeNotFound(errors.New(\"company not found\"))\n\t\t}\n\t\treturn nil, \"\", errors.Wrapf(err, \"fail to call companyRepo.GetCompany(%d)\", p.CompanyID)\n\t}\n\tres = company\n\tview = \"default\"\n\n\treturn\n}", "title": "" }, { "docid": "dcfac0dabc7942933bc25c3dd7c3c455", "score": "0.64736897", "text": "func (o *InlineResponse2007Comments) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "ac2a6c26e22be4c7dccb8f21c8fe07a8", "score": "0.6451576", "text": "func (o *CompanyUpdateResponseCompany) GetDisplayName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.DisplayName\n}", "title": "" }, { "docid": "59d495a7204a2cfeb628ec111d5a8515", "score": "0.64503837", "text": "func (o *CompanyUpdateResponseCompany) GetContactNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.ContactName.Get(), o.ContactName.IsSet()\n}", "title": "" }, { "docid": "56a28ebcd097c3646537ef832b26c84b", "score": "0.64496857", "text": "func (o *InlineResponse20054Projects) GetCompany() InlineResponse20054Company {\n\tif o == nil || o.Company == nil {\n\t\tvar ret InlineResponse20054Company\n\t\treturn ret\n\t}\n\treturn *o.Company\n}", "title": "" }, { "docid": "3ba140605dc3f1ba4db76a7eebebce0d", "score": "0.64263", "text": "func (o *InlineResponse2007Comments) GetCompanyId() string {\n\tif o == nil || o.CompanyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyId\n}", "title": "" }, { "docid": "5ca861b39798025c3aed22b2d18c33c6", "score": "0.6421945", "text": "func (o *InlineResponse200120Workload) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "0550ea5987e097ee05ec0160879dfa3d", "score": "0.6421025", "text": "func (o *InlineResponse20013People) GetCompanyId() string {\n\tif o == nil || o.CompanyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyId\n}", "title": "" }, { "docid": "61ce3e2364828d7ae4f3e6866ea2b5c2", "score": "0.641951", "text": "func (o *InlineResponse200120Workload) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || o.CompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "f4d7cdc1e22b651b1a90be7fd89932d5", "score": "0.6397815", "text": "func (o *InlineResponse20078Projects) GetCompany() InlineResponse2002People12345Company {\n\tif o == nil || o.Company == nil {\n\t\tvar ret InlineResponse2002People12345Company\n\t\treturn ret\n\t}\n\treturn *o.Company\n}", "title": "" }, { "docid": "bc0508f6744d19a457067edcab7670cf", "score": "0.6381605", "text": "func (o *InlineResponse200107TimeEntries) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "3b574e220a3e2df5bf6f8802fb542f1e", "score": "0.6332512", "text": "func (o *ProjectsJsonProject) GetCompanyId() string {\n\tif o == nil || o.CompanyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyId\n}", "title": "" }, { "docid": "8c9c7417d7aa58cd47725e33d03f25be", "score": "0.63295305", "text": "func (o *QuotationCreateParams) GetCompanyNameOk() (*string, bool) {\n\tif o == nil || o.CompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.CompanyName, true\n}", "title": "" }, { "docid": "0600c300ad6ae999927caf42db867066", "score": "0.6314571", "text": "func (o *InlineResponse20013People) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "8ab26dd5f343f7cc9b506560640f5c76", "score": "0.6308491", "text": "func ProcessorCompanyName(cmap *ColumnMapper, input string) (string, error) {\n\treturn fake.Company(), nil\n}", "title": "" }, { "docid": "17064815ade09c43ba77143ca79dda19", "score": "0.63041854", "text": "func (o *InlineResponse20022Invoices) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "75b4f0ad403a14905d72a66f5db4fd48", "score": "0.6279715", "text": "func (o *QuotationCreateParams) GetCompanyContactInfo() string {\n\tif o == nil || o.CompanyContactInfo == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyContactInfo\n}", "title": "" }, { "docid": "8840643a35c0de19de4c504c98006a98", "score": "0.62662876", "text": "func (q *Quickbooks) GetCompanyInfo() (*Company, error) {\n\tendpoint := fmt.Sprintf(\"/company/%s/companyinfo/%s\", q.RealmID, q.RealmID)\n\n\tres, err := q.makeGetRequest(endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\n\tcompany := Company{}\n\terr = json.NewDecoder(res.Body).Decode(&company)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &company, nil\n}", "title": "" }, { "docid": "b84e4886461bc910dcfba71a89dc27a1", "score": "0.6251607", "text": "func (o *QuotationCreateParams) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "876a4d4566530d9498a65442f93a0cf4", "score": "0.6249993", "text": "func (c *Chance) Company() string {\n\trandomIndex := c.Rand.Intn(len(data.Companies))\n\treturn data.Companies[randomIndex]\n}", "title": "" }, { "docid": "2370ab3b6a869e11ab728476a8b816d1", "score": "0.61966026", "text": "func (o *InlineResponse20022Invoices) GetCompanyId() string {\n\tif o == nil || o.CompanyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyId\n}", "title": "" }, { "docid": "552d0b60d2402fbc70ab2aaf914a3fd9", "score": "0.61545134", "text": "func (m *CompanyInformation) GetDisplayName()(*string) {\n val, err := m.GetBackingStore().Get(\"displayName\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "cc9eb7c8434f197d1d98e9588a9363d6", "score": "0.6132431", "text": "func (o *Collaboration) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "title": "" }, { "docid": "62a1dbe4236d4d7254cff0217deba793", "score": "0.6119411", "text": "func (o *CreateCustomerFiscalEntitiesResponse) SetCompanyName(v string) {\n\to.CompanyName = &v\n}", "title": "" }, { "docid": "7fd5c65ca9544624503b5704eb7ab86c", "score": "0.60855144", "text": "func (o *InlineResponse200107TimeEntries) GetCompanyId() string {\n\tif o == nil || o.CompanyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyId\n}", "title": "" }, { "docid": "a6e882669bee4cea4998ebd058d85cb7", "score": "0.6085162", "text": "func (m *Contact) GetDisplayName()(*string) {\n return m.displayName\n}", "title": "" }, { "docid": "ced0da90494adfcdaf303b6b41b94c8e", "score": "0.60681754", "text": "func (a Review) GetCompanyID() string {\n\treturn a.CompanyID.Hex()\n}", "title": "" }, { "docid": "71a60c5367b2331a21d1aef33fc383e9", "score": "0.6042692", "text": "func (o *InlineResponse200120Workload) GetCompanyId() string {\n\tif o == nil || o.CompanyId == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanyId\n}", "title": "" }, { "docid": "af8045634e42857890a5cfa6708b3ff9", "score": "0.5971615", "text": "func (o *DeprecatedApprovalRequestResponseApprovalRequest) GetCompanyId() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.CompanyId\n}", "title": "" }, { "docid": "1815411e27cc92f7cc5c8f1d8878724b", "score": "0.59529275", "text": "func (o *DealCreateResponseDeal) GetCompanyId() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.CompanyId\n}", "title": "" }, { "docid": "07323c342facd693acbc9620be62d16d", "score": "0.59348255", "text": "func (o *InlineResponse20054Projects) GetCompanyOk() (*InlineResponse20054Company, bool) {\n\tif o == nil || o.Company == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Company, true\n}", "title": "" }, { "docid": "350662034f30bf83f7eeb92777eee3bb", "score": "0.58896947", "text": "func (o *QuotationCreateParams) GetCompanyId() int32 {\n\tif o == nil {\n\t\tvar ret int32\n\t\treturn ret\n\t}\n\n\treturn o.CompanyId\n}", "title": "" }, { "docid": "7cb470ec30edffc2f43f4047eda1faa5", "score": "0.5885172", "text": "func (o *InlineResponse20078Projects) GetCompanyOk() (*InlineResponse2002People12345Company, bool) {\n\tif o == nil || o.Company == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Company, true\n}", "title": "" }, { "docid": "42435eb42b855354e335f534c80d3656", "score": "0.58748114", "text": "func (o *InlineResponse200120Workload) GetUserCompanyNameOk() (*string, bool) {\n\tif o == nil || o.UserCompanyName == nil {\n\t\treturn nil, false\n\t}\n\treturn o.UserCompanyName, true\n}", "title": "" }, { "docid": "404d7afb2bbe944d3a91229b8d9b39ac", "score": "0.5865159", "text": "func (m *Contact) GetJobTitle()(*string) {\n return m.jobTitle\n}", "title": "" }, { "docid": "43312ddeb7afa9b2ff10af0f4a654ea0", "score": "0.58183044", "text": "func (o *JobDetailsOrganization) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "title": "" }, { "docid": "a01c576c3101453aacfca19acc0eb6c5", "score": "0.5784829", "text": "func (o *CompanyUpdateResponseCompany) GetNameOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Name.Get(), o.Name.IsSet()\n}", "title": "" }, { "docid": "72785d4bfc840d0aad6063f92c9ff76b", "score": "0.5779638", "text": "func getCompany(w http.ResponseWriter, r *http.Request) {\n\n\tcompanyKey := data.Company{\n\t\tName: TrimSpace(r.URL.Query().Get(\"name\")),\n\t\tZip: TrimSpace(r.URL.Query().Get(\"zip\")),\n\t}\n\n\tif companyKey.Name == \"\" || companyKey.Zip == \"\" {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t// TODO write StatusBadRequest message\n\t\treturn\n\t}\n\n\tcompany, err := data.FindCompany(companyKey)\n\n\tif err != nil {\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tPrintln(err)\n\t}\n\n\tif company == nil {\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\t// TODO write StatusNotFound message\n\t} else {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\terr := json.NewEncoder(w).Encode(company)\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tPrintln(err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8fb5e0c031524224b8e86237c3d96c05", "score": "0.5776341", "text": "func GetCompany(companyID string) (models.Company, error) {\n\t//s := fmt.Sprintf(\"dbname=%s user=%s password=%s port=5432\", \"priorincidents\", os.Getenv(\"DATABASE_USER\"), os.Getenv(\"DATABASE_PASSWORD\"))\n\tdb, err := gorm.Open(\"postgres\", os.Getenv(\"DATABASE_URL\"))\n\tvar company models.Company\n\tif err != nil {\n\t\treturn company, err\n\t}\n\tdefer db.Close()\n\tdb.Preload(\"Locations\").Where(\"id = ?\", companyID).Find(&company)\n\treturn company, nil\n}", "title": "" }, { "docid": "95a0fcd371024300a7238cfe069b6ebb", "score": "0.5758546", "text": "func (o *ETFProfileData) GetEtfCompany() string {\n\tif o == nil || o.EtfCompany == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.EtfCompany\n}", "title": "" }, { "docid": "35cf9cb4d90afc37e81410ae0d60a961", "score": "0.5743768", "text": "func (o GetAlertContactsContactOutput) AlertContactName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetAlertContactsContact) string { return v.AlertContactName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d4d3115547c0629d278cf9a1452bf7cb", "score": "0.572742", "text": "func (o *Counterparty) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "title": "" }, { "docid": "84300370fbe7f5dc32d627b28f9d2955", "score": "0.57264614", "text": "func (s *CompanyService) Company(companyID uuid.UUID) (allowance.Company, error) {\n\tvar company allowance.Company\n\terr := s.db.One(\"ID\", companyID, &company)\n\treturn company, err\n}", "title": "" }, { "docid": "200f689baa06e9b9cb644d531c21d429", "score": "0.5713117", "text": "func (o *InlineResponse2007Comments) HasCompanyName() bool {\n\tif o != nil && o.CompanyName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "cc6eb0e1d16db90ecdf1732963054c5e", "score": "0.56701756", "text": "func (c *Contact) GetFirstName() string {\n\treturn c.FirstName\n}", "title": "" }, { "docid": "06fbefadbbfd1016ca3ba218a2d50d0c", "score": "0.56555796", "text": "func (o *InlineResponse20013People) HasCompanyName() bool {\n\tif o != nil && o.CompanyName != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "281db6ef10cce8c8d34e012c811fe6d4", "score": "0.56501603", "text": "func (c *ConnectionOptionsEmail) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}", "title": "" }, { "docid": "c4f466c8da380a7a877e27b0eda23b0b", "score": "0.5649065", "text": "func (c *Client) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}", "title": "" }, { "docid": "4f864010a3ff5fc108e1610da62003cf", "score": "0.5641467", "text": "func (o *ProjectsJsonProject) GetNewCompany() string {\n\tif o == nil || o.NewCompany == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.NewCompany\n}", "title": "" }, { "docid": "98ff852f3cc40bf61fa7447d867b0ad1", "score": "0.5636268", "text": "func (o *MultipleCollaboratorsFieldField) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "title": "" }, { "docid": "a3ed63b3505a7f5ade370fcd293ba1ce", "score": "0.5636163", "text": "func (o *Organization) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "edda975e5d069f783bb99d6adf947263", "score": "0.5630052", "text": "func (c *Companies) Get(companyID string) (company *Company, err error) {\n\tc.mux.RLock()\n\tdefer c.mux.RUnlock()\n\n\tvar ok bool\n\tif company, ok = c.cm[companyID]; !ok {\n\t\terr = fmt.Errorf(errCannotFindCompanyFmt, companyID)\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "b146e4e98fecad1dc513872255daf649", "score": "0.55893093", "text": "func GetCompanyEndpoint(response http.ResponseWriter, request *http.Request) {\n\tresponse.Header().Set(\"content-type\", \"application/json\")\n\tparams := mux.Vars(request)\n\tname, _ := params[\"name\"]\n\tvar company Company\n\tcollection := client.Database(\"RESTful\").Collection(\"companies\")\n\tctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)\n\tdefer cancel()\n\terr := collection.FindOne(ctx, Company{Name: name}).Decode(&company)\n\tif err != nil {\n\t\tresponse.WriteHeader(http.StatusInternalServerError)\n\t\tresponse.Write([]byte(`{ \"message\": \"` + err.Error() + `\" }`))\n\t\treturn\n\t}\n\tjson.NewEncoder(response).Encode(company)\n}", "title": "" }, { "docid": "cb58bba48f1fea6ed4207ba31155b9e7", "score": "0.557596", "text": "func (m *Contact) GetGivenName()(*string) {\n return m.givenName\n}", "title": "" }, { "docid": "dc27a7c6cb9ae250e2c42da37fd78659", "score": "0.55576617", "text": "func (c *component) GetName() string {\n\treturn c.Call(\"getName\").String()\n}", "title": "" }, { "docid": "f995a14b676a1e4549c055d6a3b414dd", "score": "0.5555988", "text": "func (o *UserOnboardingSurvey) GetOrganizationName() string {\n\tif o == nil || o.OrganizationName == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.OrganizationName\n}", "title": "" }, { "docid": "02a7fafe3d9d6f67b3b6afb2a913393a", "score": "0.5552462", "text": "func (o *JobDetailsProject) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "title": "" }, { "docid": "6a1171dba2f8d8952a2ac795dff50c85", "score": "0.5548953", "text": "func (m Message) CashSettlAgentContactName() (*field.CashSettlAgentContactNameField, quickfix.MessageRejectError) {\n\tf := &field.CashSettlAgentContactNameField{}\n\terr := m.Body.Get(f)\n\treturn f, err\n}", "title": "" }, { "docid": "9593ef432c17e7219f191c6d33ac274e", "score": "0.5546158", "text": "func (o *CompanyUpdateResponseCompany) GetNameKana() string {\n\tif o == nil || o.NameKana.Get() == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn *o.NameKana.Get()\n}", "title": "" }, { "docid": "0499d708b6d31935e14417bcb04a98f5", "score": "0.55450344", "text": "func (o *OrganizationConnectionDetails) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "43ad4ba0cd3d4b16970a3989d04fe320", "score": "0.55322045", "text": "func (o *ApplianceAllOfConnectorAdvancedClients) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Name\n}", "title": "" }, { "docid": "d98fa3cd80ef6c5fcd3d37105cbdb9a5", "score": "0.5508604", "text": "func (o *CreateCustomerFiscalEntitiesResponse) HasCompanyName() bool {\n\tif o != nil && !IsNil(o.CompanyName) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ddb2dc7f0f3bae2727896e80bca15694", "score": "0.54989636", "text": "func (o *AccountReferenceAllOf) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "e9542fd514cee00c448df72fa916cb5e", "score": "0.54899305", "text": "func (m *Contact) GetTitle()(*string) {\n return m.title\n}", "title": "" }, { "docid": "da3e79fd3631106350a423e9dbf35607", "score": "0.54676896", "text": "func (o *UserOnboardingSurvey) GetCompanySize() string {\n\tif o == nil || o.CompanySize == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.CompanySize\n}", "title": "" }, { "docid": "a8123bed143713c0baf20bd7e830aaaa", "score": "0.54448915", "text": "func (c *Client) GetContactPropertyByName(propertyName string) (Response, error) {\n\tresponse, err := SendRequest(Request{\n\t\tURL:\t\t\tfmt.Sprintf(\"https://api.hubapi.com/properties/v1/contacts/properties/named/%s?hapikey=%s\", propertyName, c.apiKey),\n\t\tMethod:\t\t\t\"GET\",\n\t\tOkStatusCode: \t200,\n\t})\n\n\treturn response, err\n}", "title": "" }, { "docid": "280d088d578a1864d35b069de4f02390", "score": "0.5443051", "text": "func (o *CompanyUpdateResponseCompany) SetContactName(v string) {\n\to.ContactName.Set(&v)\n}", "title": "" }, { "docid": "71bf27470a7054272560c2b2f3cfa63f", "score": "0.5442621", "text": "func (o *Tenant) GetCompanyInfo() TenantCompanyInfo {\n\tif o == nil {\n\t\tvar ret TenantCompanyInfo\n\t\treturn ret\n\t}\n\n\treturn o.CompanyInfo\n}", "title": "" }, { "docid": "5b44f3a3db1d08af59f7034565517c83", "score": "0.54121196", "text": "func (o *CIAppPipelineEventJob) GetName() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn o.Name\n}", "title": "" }, { "docid": "9509925f2d9bd6591047d1a053294387", "score": "0.54100215", "text": "func GetContact(filter *model.Filter) (*model.Contact, error) {\n\tvar contact model.Contact\n\terr := database.Collection(\"contacts\").FindOne(context.Background(), filter).Decode(&contact)\n\tif err != nil {\n\t\tlog.Printf(\"GetContact failed: %v\\n\", err)\n\t\treturn nil, err\n\t}\n\n\treturn &contact, nil\n}", "title": "" }, { "docid": "3c25ff5477ca1b116e919e1e94b1ffea", "score": "0.540801", "text": "func (calendar *GoogleCalendar) GetName() string {\n\treturn calendar.Name\n}", "title": "" }, { "docid": "ab1397321022023ca2e1a66178eb4821", "score": "0.5402559", "text": "func GetUserNameByContactID(contactID int) (name string, err error) {\n\terr = nil\n\tdb, err := conf.GetDB()\n\tif err != nil {\n\t\tlog.Println(\"[GetUserNameByContactID] Error getting db connection: \" + err.Error())\n\t\treturn\n\t}\n\tsql := `select \n\t\t\t\tlogcli_clientname\n\t\t\tFROM \n\t\t\t\tlogcli_loginclient \n\t\t\twhere \n\t\t\t\tlogcli_id=?`\n\terr = db.Get(&name, sql, contactID)\n\tif err != nil {\n\t\tlog.Println(\"[GetUserNameByContactID] Error running query: \", sql, \" parameter: \", contactID, \" - Error: \", err.Error())\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "e534b7bcfcdd6391d2baaedff3b9a6a9", "score": "0.53971475", "text": "func (o *PostPagesPageIdComponentGroupsComponentGroup) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Name\n}", "title": "" }, { "docid": "42857faac65484f666b9460f5177d224", "score": "0.53885543", "text": "func (d *Database) GetByName(name string) (contact Contact, err error) {\n\tstmt, err := d.Prepare(sqlGetByContactName)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer stmt.Close()\n\n\trows, err := stmt.Query(name)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer rows.Close()\n\n\t// There should only be one record with this name, so assume no more than one row.\n\thasRow := rows.Next()\n\n\tif !hasRow {\n\t\terr = rows.Err()\n\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\treturn\n\t}\n\n\terr = rows.Scan(&contact.ID, &contact.Name, &contact.Month, &contact.Day, &contact.Year)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tcontact.isInitialized = true\n\n\treturn\n}", "title": "" } ]
4a998e667e32de1880c8e7463e8c5db1
GetHash returns a byte array to the hash of the data. alg indicates the hashing algorithm. Currently, the only supported hashing algorithms are SHA1, SHA256, SHA384 and SHA512
[ { "docid": "7290c6323800fc462876cbdbed4e34eb", "score": "0.6605673", "text": "func getHashData(data []byte, alg crypto.Hash) []byte {\n\n\tswitch alg {\n\tcase crypto.SHA1:\n\t\ts := sha1.Sum(data)\n\t\treturn s[:]\n\tcase crypto.SHA256:\n\t\ts := sha256.Sum256(data)\n\t\treturn s[:]\n\tcase crypto.SHA384:\n\t\t//SHA384 is implemented in the sha512 package\n\t\ts := sha512.Sum384(data)\n\t\treturn s[:]\n\tcase crypto.SHA512:\n\t\ts := sha512.Sum512(data)\n\t\treturn s[:]\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "ddbd514438e6096b01667243c91bbc35", "score": "0.614031", "text": "func GetHash(algorithm Algorithm, plaintext []byte) ([]byte, error) {\r\n\tvar hash hash.Hash\r\n\r\n\tswitch algorithm {\r\n\tcase RS256, PS256, ES256:\r\n\t\thash = sha256.New()\r\n\tcase RS384, PS384, ES384:\r\n\t\thash = sha512.New384()\r\n\tcase RS512, PS512, ES512, EdDSA:\r\n\t\thash = sha512.New()\r\n\t}\r\n\r\n\tif nil == hash {\r\n\t\treturn nil, fmt.Errorf(\"Cannot generate hash with the configured algorithm %s\", algorithm)\r\n\t}\r\n\r\n\thash.Write(plaintext)\r\n\treturn hash.Sum(nil), nil\r\n}", "title": "" }, { "docid": "1037c440ced64197bbe7dec7ae10286e", "score": "0.59134233", "text": "func GetHashAlgorithm() string {\n\treturn defaultHashAlgorithm\n}", "title": "" }, { "docid": "6cf091bb044a815e215f51cd7a84648c", "score": "0.5796316", "text": "func (hasher *sha256) HashAlgorithm() HashAlgorithm {\n\treturn Sha256\n}", "title": "" }, { "docid": "e34787f8154c7cea1fee8f604c4d712e", "score": "0.5749434", "text": "func hashing(hashAlgorithm string, buffer ...[]byte) (key []byte) {\n\thashMap := map[string]hash.Hash{\n\t\t\"md4\": md4.New(),\n\t\t\"md5\": md5.New(),\n\t\t\"ripemd-160\": ripemd160.New(),\n\t\t\"sha1\": sha1.New(),\n\t\t\"sha256\": sha256.New(),\n\t\t\"sha384\": sha512.New384(),\n\t\t\"sha512\": sha512.New(),\n\t}\n\thandler, ok := hashMap[strings.ToLower(hashAlgorithm)]\n\tif !ok {\n\t\treturn key\n\t}\n\tfor _, buf := range buffer {\n\t\t_, _ = handler.Write(buf)\n\t}\n\tkey = handler.Sum(nil)\n\treturn key\n}", "title": "" }, { "docid": "555d7724dbd7c57a6bc6f02969e5e88e", "score": "0.5684712", "text": "func hashFunc(val, alg string) string {\n\tvar h hash.Hash\n\tif alg == \"sha256\" {\n\t\th = sha256.New()\n\t} else if alg == \"sha512\" {\n\t\th = sha512.New()\n\t} else {\n\t\th = sha1.New()\n\t}\n\th.Write([]byte(val))\n\treturn hex.EncodeToString(h.Sum(nil))\n}", "title": "" }, { "docid": "7a3de37eea5aff01eee7307a5210566d", "score": "0.5440516", "text": "func (ss *SecurityScheme) Hash() [32]byte {\n\tvar f []string\n\tif !ss.Type.IsEmpty() {\n\t\tf = append(f, ss.Type.Value)\n\t}\n\tif !ss.Description.IsEmpty() {\n\t\tf = append(f, ss.Description.Value)\n\t}\n\tif !ss.Name.IsEmpty() {\n\t\tf = append(f, ss.Name.Value)\n\t}\n\tif !ss.In.IsEmpty() {\n\t\tf = append(f, ss.In.Value)\n\t}\n\tif !ss.Flow.IsEmpty() {\n\t\tf = append(f, ss.Flow.Value)\n\t}\n\tif !ss.AuthorizationUrl.IsEmpty() {\n\t\tf = append(f, ss.AuthorizationUrl.Value)\n\t}\n\tif !ss.TokenUrl.IsEmpty() {\n\t\tf = append(f, ss.TokenUrl.Value)\n\t}\n\tif !ss.Scopes.IsEmpty() {\n\t\tf = append(f, low.GenerateHashString(ss.Scopes.Value))\n\t}\n\tkeys := make([]string, len(ss.Extensions))\n\tz := 0\n\tfor k := range ss.Extensions {\n\t\tkeys[z] = fmt.Sprintf(\"%s-%x\", k.Value, sha256.Sum256([]byte(fmt.Sprint(ss.Extensions[k].Value))))\n\t\tz++\n\t}\n\tsort.Strings(keys)\n\tf = append(f, keys...)\n\treturn sha256.Sum256([]byte(strings.Join(f, \"|\")))\n}", "title": "" }, { "docid": "8b5d08de9e7c699320cc32934ab62574", "score": "0.5429795", "text": "func (a Algorithm) Hash() (hash.Hash, error) {\n\tfor _, info := range hashInfo {\n\t\tif info.alg == a {\n\t\t\tif info.hash == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"go hash algorithm #%snot available\", info.alg.String())\n\t\t\t}\n\t\t\treturn info.hash, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"hash algorithm not supported: %s\", a.String())\n}", "title": "" }, { "docid": "418b0b99051d1fa63b95c64c5d5c7156", "score": "0.5424295", "text": "func (self *Authorizer) CalculateDigest() ([]byte, error) {\n\n\t/* A1: secret XOR opad (k_opad) */\n\tvar A1 []byte\n\tfor i := 0; i < 64; i++ {\n\t\tA1 = append(A1, '\\x00')\n\t}\n\tfor idx, secretByte := range self.secret {\n\t\tA1[idx] = secretByte\n\t}\n\tfor i := 0; i < 64; i++ {\n\t\tA1[i] ^= '\\x5C';\n\t}\n\tlog.Printf(\"A1 = %x\", A1)\n\n\t/* A2: secret XOR ipad (k_ipad) */\n\tvar A2 []byte\n\tfor i := 0; i < 64; i++ {\n\t\tA2 = append(A2, '\\x00')\n\t}\n\tfor idx, secretByte := range self.secret {\n\t\tA2[idx] = secretByte\n\t}\n\tfor i := 0; i < 64; i++ {\n\t\tA2[i] ^= '\\x36';\n\t}\n\tlog.Printf(\"A2 = %x\", A2)\n\n\t/* A3: HASH(A2, challengedata) */\n\th3 := md5.New()\n\th3.Write(A2)\n\th3.Write(self.challengeData)\n\tA3 := h3.Sum(nil)\n\tlog.Printf(\"A3 = %x\", A3)\n\n\t/* A4: HASH(A1, A3) */\n\th4 := md5.New()\n\th4.Write(A1)\n\th4.Write(A3)\n\tA4 := h4.Sum(nil)\n\tlog.Printf(\"A4 = %x\", A4)\n\n\t/* Make string representation */\n\tout := make([]byte, hex.EncodedLen(len(A4)))\n\thex.Encode(out, A4)\n\n\treturn out, nil\n}", "title": "" }, { "docid": "e31ccc0410aab398fbea76b0db2abd78", "score": "0.5322818", "text": "func (h *HMAC) GetAlgorithmID() jwtee.Algorithm {\n\treturn h.alg\n}", "title": "" }, { "docid": "eccd1f48630382a2e513ccabf349656c", "score": "0.5321582", "text": "func getNewHashHash(AlgoType string) (hash.Hash, error) {\n\tswitch AlgoType {\n\tcase \"-sha256\":\n\t\treturn sha256.New(), nil\n\tcase \"-sha512\":\n\t\treturn sha512.New(), nil\n\tcase \"-md5\":\n\t\treturn md5.New(), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknow algo type %v\", AlgoType)\n\t}\n}", "title": "" }, { "docid": "7f844b6202c08e6a4787e94993c81ea8", "score": "0.532025", "text": "func getHash(val []byte) string {\n\thasher := sha1.New()\n\thasher.Write(val)\n\tsha := base64.URLEncoding.EncodeToString(hasher.Sum(nil))\n\treturn sha\n}", "title": "" }, { "docid": "36326f28a965d9a614d6243bc670510e", "score": "0.5313458", "text": "func (o Algorithm) Hash() (hashCreator func() hash.Hash, err error) {\n\tswitch o {\n\tcase AlgorithmSHA256:\n\t\thashCreator = sha256.New\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupported algorithm %s\", o)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "820bf52310d9c2a7c283023fd9070c69", "score": "0.53073084", "text": "func (opts *SHA256Opts) Algorithm() string {\r\n\treturn SHA256\r\n}", "title": "" }, { "docid": "d2b7880b77e9e3a61e1e1446e310cc10", "score": "0.5268615", "text": "func calcHash(buf []byte, hasher hash.Hash) []byte {\r\n\thasher.Write(buf)\r\n\treturn hasher.Sum(nil)\r\n}", "title": "" }, { "docid": "3797b8b931908b7b3e0b5c536f4360a0", "score": "0.52616566", "text": "func (opts *SHA256Opts) Algorithm() string {\n\treturn SHA256\n}", "title": "" }, { "docid": "e7871f0b4f3cf45f30d11765de52dabb", "score": "0.52536535", "text": "func (ba ByteArray) GetHash(autoFree bool) (res UInt256) {\n\ts := NewDataStreamFromByteArray(ba, false)\n\tres = s.GetHash(autoFree)\n\ts.Free()\n\treturn\n}", "title": "" }, { "docid": "8bb42e1426f3fbe4dfdcb9312924ae4b", "score": "0.52458966", "text": "func (r JsonRepresentation) Hash() ([]byte, error) {\n\n\tbuff := bytes.NewBuffer([]byte(r.Name))\n\n\tif _, err := buff.Write([]byte(r.Code)); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err := buff.Write(r.SignaturePublicKey); err != nil {\n\t\treturn nil, err\n\t}\n\n\tmultiHash, err := mh.Sum(buff.Bytes(), mh.SHA3_256, -1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn multiHash, nil\n\n}", "title": "" }, { "docid": "2b32276d07c0ec11d64936680bc3636a", "score": "0.5241087", "text": "func (sig *Signature) Hash(in []byte) (h, h64 []byte) {\n\tif sig.Alg == nil || *sig.Alg == SignAlgRS256 {\n\t\th256 := sha256.Sum256(in)\n\t\th = h256[:]\n\t} else {\n\t\th1 := sha1.Sum(in)\n\t\th = h1[:]\n\t}\n\n\th64 = make([]byte, base64.StdEncoding.EncodedLen(len(h)))\n\tbase64.StdEncoding.Encode(h64, h)\n\n\treturn\n}", "title": "" }, { "docid": "cad715662bf065d40e0fd4f4a1ea6ce0", "score": "0.5220079", "text": "func (s *HashStructure) HashAlgOffset() uint64 {\n\treturn 0\n}", "title": "" }, { "docid": "5888e7f22c62f05e432605ba08992329", "score": "0.5181339", "text": "func (g *HelpGetAppConfigRequest) GetHash() (value int) {\n\tif g == nil {\n\t\treturn\n\t}\n\treturn g.Hash\n}", "title": "" }, { "docid": "07b202ca369265315e694f1b65b933a5", "score": "0.5148651", "text": "func (hasher *sha224) HashAlgorithm() HashAlgorithm {\n\treturn Sha224\n}", "title": "" }, { "docid": "3c72d0009fb099a06c6f89fa4919c4fe", "score": "0.5141717", "text": "func GetHash(a string) (hash.Hash, error) {\n\tvar h hash.Hash\n\tswitch a {\n\tcase \"adler32\":\n\t\th = adler32.New()\n\tcase \"crc32\", \"crc32ieee\":\n\t\th = crc32.New(crc32.MakeTable(crc32.IEEE))\n\tcase \"crc32castagnoli\":\n\t\th = crc32.New(crc32.MakeTable(crc32.Castagnoli))\n\tcase \"crc32koopman\":\n\t\th = crc32.New(crc32.MakeTable(crc32.Koopman))\n\tcase \"crc64\", \"crc64iso\":\n\t\th = crc64.New(crc64.MakeTable(crc64.ISO))\n\tcase \"crc64ecma\":\n\t\th = crc64.New(crc64.MakeTable(crc64.ECMA))\n\tcase \"fnv\", \"fnv32\":\n\t\th = fnv.New32()\n\tcase \"fnv32a\":\n\t\th = fnv.New32a()\n\tcase \"fnv64\":\n\t\th = fnv.New64()\n\tcase \"fnv64a\":\n\t\th = fnv.New64a()\n\tcase \"hmac\", \"hmacsha256\":\n\t\tkey := \"SHA-256\"\n\t\th = hmac.New(sha256.New, []byte(key))\n\tcase \"hmacmd5\":\n\t\tkey := \"SHA-256\"\n\t\th = hmac.New(md5.New, []byte(key))\n\tcase \"hmacsha1\":\n\t\tkey := \"SHA-256\"\n\t\th = hmac.New(sha1.New, []byte(key))\n\tcase \"hmacsha512\":\n\t\tkey := \"SHA-256\"\n\t\th = hmac.New(sha512.New, []byte(key))\n\tcase \"md5\":\n\t\th = md5.New()\n\tcase \"sha1\":\n\t\th = sha1.New()\n\tcase \"sha224\":\n\t\th = sha256.New224()\n\tcase \"sha256\":\n\t\th = sha256.New()\n\tcase \"sha384\":\n\t\th = sha512.New384()\n\tcase \"sha512\":\n\t\th = sha512.New()\n\tdefault:\n\t\treturn nil, errors.New(\"Invalid algorithm\")\n\t}\n\treturn h, nil\n}", "title": "" }, { "docid": "440b499206f8a4a061485e8de2038448", "score": "0.5139919", "text": "func GetHash(namespace string) crypto.Hash {\n\tif strings.HasPrefix(namespace, \"sha256-\") {\n\t\treturn crypto.SHA256\n\t}\n\tif strings.HasPrefix(namespace, \"sha512-\") {\n\t\treturn crypto.SHA512\n\t}\n\treturn crypto.SHA1\n}", "title": "" }, { "docid": "ad42455155093a5123e3e646a2c03476", "score": "0.5137449", "text": "func (blk Block) CalcHash() []byte {\n\t// TODO\n}", "title": "" }, { "docid": "b40296d36c2cdc4f2379fc30b912a946", "score": "0.51303345", "text": "func Hash64(data []byte) uint64", "title": "" }, { "docid": "8bc2bec5a75b8d72dbf4d729831c636d", "score": "0.5122578", "text": "func (opts *SHA3_256Opts) Algorithm() string {\r\n\treturn SHA3_256\r\n}", "title": "" }, { "docid": "87adb3ca7b9562870a474e63941c6906", "score": "0.5117093", "text": "func (blk Block) CalcHash() []byte {\n\tpreviousHash := hex.EncodeToString(blk.PrevHash)\n\tmyGeneration := fmt.Sprintf(\"%v\",blk.Generation)\n\tmyDifficulty := fmt.Sprintf(\"%v\",blk.Difficulty)\n\tmyData := blk.Data\n\tmyProof := fmt.Sprintf(\"%v\",blk.Proof)\n\tmyStringHash := (previousHash+\":\"+myGeneration+\":\"+myDifficulty+\":\"+myData+\":\"+myProof)\n\n\tactualHash := sha256.Sum256([]byte(myStringHash[:]))\n\treturn (actualHash[:])\n}", "title": "" }, { "docid": "c56c10492040dc9e6fca912ee1969fe7", "score": "0.51164347", "text": "func (alg HashAlgorithm) ToHasher() hash.Hash {\n\tswitch alg {\n\tcase HashAlgCRC32:\n\t\treturn crc32.NewIEEE()\n\tcase HashAlgMD5:\n\t\treturn md5.New()\n\tcase HashAlgSHA1:\n\t\treturn sha1.New()\n\tcase HashAlgSHA256:\n\t\treturn sha256.New()\n\tdefault:\n\t\treturn dummyHash{}\n\t}\n}", "title": "" }, { "docid": "e613c662b227ead6659c65f21dd9aa97", "score": "0.5112528", "text": "func (e Aes256CtsHmacSha384192) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error) {\n\treturn common.GetHash(data, protocolKey, common.GetUsageKc(usage), e)\n}", "title": "" }, { "docid": "516a3dbcf57dd665bbdd7255d7b327bb", "score": "0.5106254", "text": "func (o *AssociationTransaction) ComputeHash() []byte {\n\tsha := sha3.NewKeccak256()\n\n\tsha.Write([]byte(o.Source))\n\tsha.Write([]byte(o.TransactionType))\n\tfor _, param := range o.Params {\n\t\tsha.Write([]byte(param))\n\t}\n\treturn sha.Sum(nil)\n}", "title": "" }, { "docid": "66206812fa25a441ff34df6af2861000", "score": "0.50906575", "text": "func (o *CreateJsonWebKeySet) GetAlg() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Alg\n}", "title": "" }, { "docid": "dad9fa50761b55d19c9784cba722a619", "score": "0.5083337", "text": "func (i *Info) Hash() [32]byte {\n\tvar f []string\n\n\tif !i.Title.IsEmpty() {\n\t\tf = append(f, i.Title.Value)\n\t}\n\tif !i.Summary.IsEmpty() {\n\t\tf = append(f, i.Summary.Value)\n\t}\n\tif !i.Description.IsEmpty() {\n\t\tf = append(f, i.Description.Value)\n\t}\n\tif !i.TermsOfService.IsEmpty() {\n\t\tf = append(f, i.TermsOfService.Value)\n\t}\n\tif !i.Contact.IsEmpty() {\n\t\tf = append(f, low.GenerateHashString(i.Contact.Value))\n\t}\n\tif !i.License.IsEmpty() {\n\t\tf = append(f, low.GenerateHashString(i.License.Value))\n\t}\n\tif !i.Version.IsEmpty() {\n\t\tf = append(f, i.Version.Value)\n\t}\n\tkeys := make([]string, len(i.Extensions))\n\tz := 0\n\tfor k := range i.Extensions {\n\t\tkeys[z] = fmt.Sprintf(\"%s-%x\", k.Value, sha256.Sum256([]byte(fmt.Sprint(i.Extensions[k].Value))))\n\t\tz++\n\t}\n\tsort.Strings(keys)\n\tf = append(f, keys...)\n\treturn sha256.Sum256([]byte(strings.Join(f, \"|\")))\n}", "title": "" }, { "docid": "53691e5422d72572fea4533fc9039122", "score": "0.5071259", "text": "func (H *HASH256) Hash() []byte { /* pad message and finish - supply digest */\n\tvar digest [32]byte\n\tlen0 := H.length[0]\n\tlen1 := H.length[1]\n\tH.Process(0x80)\n\tfor (H.length[0] % 512) != 448 {\n\t\tH.Process(0)\n\t}\n\tH.w[14] = len1\n\tH.w[15] = len0\n\tH.transform()\n\tfor i := 0; i < 32; i++ { /* convert to bytes */\n\t\tdigest[i] = byte((H.h[i/4] >> uint(8*(3-i%4))) & 0xff)\n\t}\n\tH.Init()\n\treturn digest[0:32]\n}", "title": "" }, { "docid": "9badc556e54249e085b8fed4f9b4dd9e", "score": "0.5060075", "text": "func (opts *SHA3_256Opts) Algorithm() string {\n\treturn SHA3_256\n}", "title": "" }, { "docid": "9cb8698bd1a25fe057a5394441b12996", "score": "0.50591415", "text": "func calcHash(\n\tbuf []byte, hasher hash.Hash) []byte {\n\n\thasher.Write(buf)\n\treturn hasher.Sum(nil)\n}", "title": "" }, { "docid": "af44d18338a819e666b19e31bc954c1e", "score": "0.5056697", "text": "func computeHash(h hash.Hash, eles ...gg.GroupElement) ([]byte, error) {\n\tserialized, err := getSerializedElements(eles...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\th.Reset()\n\tfor _, buf := range serialized {\n\t\t_, err = h.Write(buf)\n\t\tif err != nil {\n\t\t return nil, err\n\t\t}\n\t}\n\treturn h.Sum(nil), nil\n}", "title": "" }, { "docid": "e453f3d6bae6e173541c123ebb037171", "score": "0.5049081", "text": "func (b NativeSecurityDescriptorHashV3) Hash() []byte { return b[6:70] }", "title": "" }, { "docid": "158afbaf1ae28a30c7744715fb88b10d", "score": "0.5044563", "text": "func (sr *cryptoSerializer) hashDigest(b []byte) (s []byte, err error) {\n\tvar h = sr.hash.New()\n\tif _, err = h.Write(b); nil != err {\n\t\treturn\n\t}\n\n\treturn h.Sum(nil), nil\n}", "title": "" }, { "docid": "be3b8b51244d5f16173bc35d9e7fda3c", "score": "0.49963254", "text": "func (_INode *INodeCaller) ChallengeHash(opts *bind.CallOpts) ([32]byte, error) {\n\tvar out []interface{}\n\terr := _INode.contract.Call(opts, &out, \"challengeHash\")\n\n\tif err != nil {\n\t\treturn *new([32]byte), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "3fc36fc1ae4d0aed93f746eec59556c9", "score": "0.49841988", "text": "func (blk Block) CalcHash() []byte {\n\tstr := fmt.Sprintf(\"%x:%d:%d:%s:%d\", blk.PrevHash, blk.Generation, blk.Difficulty, blk.Data, blk.Proof)\n\thash := sha256.New()\n\thash.Write([]byte(str))\n\treturn hash.Sum(nil)\n}", "title": "" }, { "docid": "4b471962bc86066a133590940560a683", "score": "0.49720913", "text": "func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte {\n\treturn cc.hashingAlgorithm\n}", "title": "" }, { "docid": "9fa8fdf9d2f79a2e58a3af52811cd793", "score": "0.49698564", "text": "func computeHash(spec interface{}) string {\n\thasher := fnv.New32a()\n\tprinter := spew.ConfigState{\n\t\tIndent: \" \",\n\t\tSortKeys: true,\n\t\tDisableMethods: true,\n\t\tSpewKeys: true,\n\t}\n\tprinter.Fprintf(hasher, \"%#v\", spec)\n\n\treturn rand.SafeEncodeString(fmt.Sprint(hasher.Sum32()))\n}", "title": "" }, { "docid": "490599f055eff8eb5d4333746c5f4c57", "score": "0.49697572", "text": "func HashMe(in interface{}, hashType string) string {\n\n\tvar (\n\t\terr error\n\t\thasher hash.Hash\n\t\tfile *os.File\n\t)\n\t/*\n\t \"md2\", \"MD2 hash, 128-bit (MD2)\", md2.New\n\t \"md4\", \"MD4 hash, 128-bit (MD4)\", md4.New\n\t \"md5\", \"MD5 hash, 128-bit (MD5)\", md5.New\n\t \"sha1\", \"SHA-1 hash, 160-bit (SHA-1)\", sha1.New\n\t \"sha2-224\", \"SHA-2 hash, 224-bit (SHA-224)\", sha256.New224\n\t \"sha2-256\", \"SHA-2 hash, 256-bit (SHA-256)\", sha256.New\n\t \"sha2-384\", \"SHA-2 hash, 384-bit (SHA-384)\", sha512.New384\n\t \"sha2-512\", \"SHA-2 hash, 512-bit (SHA-512)\", sha512.New\n\t \"sha2-512/224\", \"SHA-2 hash, 224-bit (SHA-512/224)\", sha512.New512_224\n\t \"sha2-512/256\", \"SHA-2 hash, 256-bit (SHA-512/256)\", sha512.New512_256\n\t \"sha3-224\", \"SHA-3 hash, 224-bit (SHA3-224)\", sha3.New224\n\t \"sha3-256\", \"SHA-3 hash, 256-bit (SHA3-256)\", sha3.New256\n\t \"sha3-384\", \"SHA-3 hash, 384-bit (SHA3-384)\", sha3.New384\n\t \"sha3-512\", \"SHA-3 hash, 512-bit (SHA3-512)\", sha3.New512\n\t \"sha3-512\", \"SHA-3 hash, 512-bit (SHA3-512)\", sha3.New512\n\t \"shake-128\", \"SHA-3 hash, n-byte (SHAKE-128)\", sha3.ShakeSum128, 32\n\t \"shake-256\", \"SHA-3 hash, n-byte (SHAKE-256)\", sha3.ShakeSum256, 64\n\t \"ripemd-160\", \"RIPEMD hash, 160-bit (RIPEMD-160)\", ripemd160.New\n\t*/\n\tswitch hashType {\n\tcase \"md4\":\n\t\thasher = md4.New()\n\tcase \"md5\":\n\t\thasher = md5.New()\n\tcase \"sha1\":\n\t\thasher = sha1.New()\n\tcase \"sha256\":\n\t\thasher = sha256.New()\n\tcase \"sha384\":\n\t\thasher = sha512.New384()\n\tcase \"sha512\":\n\t\thasher = sha512.New()\n\tcase \"sha3-256\":\n\t\thasher = sha3.New256()\n\tcase \"sha3-384\":\n\t\thasher = sha3.New384()\n\tcase \"sha3-512\":\n\t\thasher = sha3.New512()\n\tcase \"blake2b256\":\n\t\thasher, _ = blake2b.New256(nil)\n\tcase \"blake2b384\":\n\t\thasher, _ = blake2b.New384(nil)\n\tcase \"blake2b512\":\n\t\thasher, _ = blake2b.New512(nil)\n\tdefault:\n\t\treturn fmt.Sprintf(\"HashMe: hash type '%s' is not handled\", hashType)\n\t}\n\n\tswitch data := in.(type) {\n\n\tcase string:\n\t\tif file, err = os.Open(data); err == nil {\n\t\t\tdefer file.Close()\n\n\t\t\tif _, err = io.Copy(hasher, file); err == nil {\n\t\t\t\treturn hex.EncodeToString(hasher.Sum(nil))\n\t\t\t}\n\t\t}\n\n\tcase []byte:\n\n\t\tif _, err = hasher.Write(in.([]byte)); err == nil {\n\t\t\treturn hex.EncodeToString(hasher.Sum(nil))\n\t\t}\n\n\tdefault:\n\t\terr = fmt.Errorf(\"argument is not []byte or string\")\n\n\t}\n\n\tlog.Printf(\"HashMe: '%s': %v\\n\", hashType, err)\n\n\treturn fmt.Sprintf(\"HashMe: '%s': %v\", hashType, err)\n}", "title": "" }, { "docid": "ad847fd70294151fedd8894e087a29af", "score": "0.4964927", "text": "func (b *Blake2bDigest) Hash(data []byte) [32]byte {\n\treturn blake2b.Sum256(data)\n}", "title": "" }, { "docid": "3e97df52faa6a3400b0d92020f5be06c", "score": "0.49406648", "text": "func (p *LogicalTableDual) HashCode() []byte {\n\t// PlanType + SelectOffset + RowCount\n\tresult := make([]byte, 0, 12)\n\tresult = encodeIntAsUint32(result, plancodec.TypeStringToPhysicalID(p.TP()))\n\tresult = encodeIntAsUint32(result, p.SelectBlockOffset())\n\tresult = encodeIntAsUint32(result, p.RowCount)\n\treturn result\n}", "title": "" }, { "docid": "bd8e44115b9d301d438c7a406c9253c5", "score": "0.4922644", "text": "func generateHash(data []byte) string {\n\tsha256 := sha256.Sum256(data)\n\tstrval := fmt.Sprintf(\"%x\", sha256)\n\treturn strval\n}", "title": "" }, { "docid": "a173e238cfc9058b349f53813bf137cc", "score": "0.49155423", "text": "func (sm *stringMethods) Hash() (uint32, error) {\n\treturn 0, fmt.Errorf(\"unhashable: %s\", sm.Type())\n}", "title": "" }, { "docid": "6409b06bc88acd66bb57e90d128076d8", "score": "0.4910375", "text": "func lenHashType(AlgoType string) int {\n\tswitch AlgoType {\n\tcase \"-sha256\":\n\t\treturn sha256.BlockSize\n\tcase \"-sha512\":\n\t\treturn sha512.BlockSize\n\tcase \"-md5\":\n\t\treturn md5.BlockSize\n\tdefault:\n\t\treturn -1\n\t}\n\n}", "title": "" }, { "docid": "ad96ac9a16a9f7de7aa53808c849fd90", "score": "0.49056196", "text": "func (i *Uint256) MarshalHash() (o []byte, err error) {\n\treturn i.Bytes(), nil\n}", "title": "" }, { "docid": "13f2aee4b451028e06ea77b384624925", "score": "0.48933133", "text": "func CalcAuthHash(secret, date, url string, body []byte) string {\n\thash := make([]byte, 136)\n\thashStr := secret + date + url + string(body)\n\tsha3.ShakeSum256(hash, []byte(hashStr))\n\treturn base64.StdEncoding.EncodeToString(hash)\n}", "title": "" }, { "docid": "a75992c70d0722c818a1d22fa507f48e", "score": "0.48902175", "text": "func (mdh *MD5Hasher) GetHash(key string) *big.Int {\n\th := md5.New()\n\th.Write([]byte(key))\n\thv := h.Sum(nil)\n\tval := big.NewInt(0)\n\tval = val.SetBytes(hv)\n\treturn val\n}", "title": "" }, { "docid": "b2aa874f5c749e02eddee8039194ed4f", "score": "0.48785785", "text": "func (o *ValidateRequest) Hash() string {\n\targs := make([]interface{}, 0)\n\targs = append(args, o.Config)\n\targs = append(args, o.CustomerID)\n\targs = append(args, o.EnrollmentID)\n\targs = append(args, o.ID)\n\targs = append(args, o.IntegrationInstanceID)\n\targs = append(args, o.RefID)\n\targs = append(args, o.RefType)\n\targs = append(args, o.SessionID)\n\to.Hashcode = hash.Values(args...)\n\treturn o.Hashcode\n}", "title": "" }, { "docid": "193b8ccc9f1d81fcce5cb5c092776f55", "score": "0.48777586", "text": "func (s *Signature) GetHash() []byte {\n\treturn s.hash\n}", "title": "" }, { "docid": "2c148085820251928a0b990d1692efe5", "score": "0.4869556", "text": "func (ds DataStream) GetHash(autoFree bool) (res UInt256) {\n\tres = UInt256FromC(C.datastream_get_hash(ds.inner))\n\tuint256SetFinalizer(res, autoFree)\n\truntime.KeepAlive(ds)\n\treturn\n}", "title": "" }, { "docid": "10287e8fde375f67ba94d3191dcfc02a", "score": "0.48651466", "text": "func getHashDigest(key string) []byte {\n\tm := md5.New()\n\tm.Write([]byte(key))\n\treturn m.Sum(nil)\n}", "title": "" }, { "docid": "b98da7204f0bfa6d7f27cea03b260502", "score": "0.4852537", "text": "func CompareHash(algo, comparison string, hash []byte) {\n\n\th := fmt.Sprintf(\"%x\", hash)\n\n\tif h == comparison {\n\t\tfmt.Printf(\"PASS: The %s checksum of input matches %s\\n\", algo, comparison)\n\t} else {\n\t\tfmt.Printf(\"FAIL: The %s checksum of %s is %x\\n\", algo, filename, hash)\n\t}\n}", "title": "" }, { "docid": "8a82c6da617c0b3596feee8024b2cb06", "score": "0.48491567", "text": "func (v *Value) GetHash(buf []byte) error {\n\t_, err := v.GetBytes(buf, 32)\n\treturn err\n}", "title": "" }, { "docid": "09dc4db698c0601c5ffef31929927be1", "score": "0.48489556", "text": "func (blk Block) CalcHash() []byte {\n\thash := hex.EncodeToString(blk.PrevHash)\n\thash += \":\" + strconv.FormatUint(blk.Generation, 10)\n\thash += \":\" + strconv.FormatUint(uint64(blk.Difficulty), 10)\n\thash += \":\" + blk.Data\n\thash += \":\" + strconv.FormatUint(blk.Proof, 10)\n\tsum := sha256.Sum256([]byte(hash))\n\treturn sum[:]\n}", "title": "" }, { "docid": "44468a9785b7e0c7535401c5ec9773f5", "score": "0.4848345", "text": "func computeHash(hashAlgorithms map[string]hash.Hash, hashSums map[string][]byte, reader io.ReadSeeker) (size int64, err error) {\n\thashWriter := ioutil.Discard\n\tfor _, v := range hashAlgorithms {\n\t\thashWriter = io.MultiWriter(hashWriter, v)\n\t}\n\n\t// If no buffer is provided, no need to allocate just use io.Copy.\n\tsize, err = io.Copy(hashWriter, reader)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\t// Seek back reader to the beginning location.\n\tif _, err := reader.Seek(0, 0); err != nil {\n\t\treturn 0, err\n\t}\n\n\tfor k, v := range hashAlgorithms {\n\t\thashSums[k] = v.Sum(nil)\n\t}\n\treturn size, nil\n}", "title": "" }, { "docid": "ad76fc91c3a2724b361e1e9ee1f36119", "score": "0.48433357", "text": "func (ds *MockDatasource) GetHash(log *logrus.Entry, admin bool, nodb bool) string {\n\tvar toHash string\n\n\tif ds.Type == datasource.File {\n\t\ttoHash = ds.FilePath\n\t} else {\n\t\tswitch {\n\t\tcase nodb:\n\t\t\ttoHash = ds.URLNoDb\n\t\tcase admin:\n\t\t\ttoHash = ds.URLAdmin\n\t\tdefault:\n\t\t\ttoHash = ds.URL\n\t\t}\n\t}\n\n\thashed := sha256.Sum256([]byte(toHash))\n\n\treturn fmt.Sprintf(\"%x\", hashed)\n}", "title": "" }, { "docid": "17376ad18034f3b5db1522dea5566132", "score": "0.48334378", "text": "func (this *Challenge) GetAlgorithm() string {\n\treturn this.authParams.GetValue(ParameterNames_ALGORITHM).(string)\n}", "title": "" }, { "docid": "7ab315723c168d383ef9efd40ce36d21", "score": "0.4821206", "text": "func HashedEncoding(val interface{}) ([32]byte, error) {\n\trval := reflect.ValueOf(val)\n\tencoding, err := getEncoding(rval)\n\tif err != nil {\n\t\treturn [32]byte{}, err\n\t}\n\treturn hash(encoding), nil\n}", "title": "" }, { "docid": "77ef95ebb7ef6ce4050bc5dbf332e41c", "score": "0.48203266", "text": "func (jSig *JwsSignature) GetAlg() (string, error) {\n\tvar algProt string\n\tvar algUnProt string\n\n\tif jSig.ProtectedHeader != nil {\n\t\talgProt = jSig.ProtectedHeader.Algorithm\n\t}\n\tif jSig.UnprotectedHeader != nil {\n\t\talgUnProt = jSig.UnprotectedHeader.Algorithm\n\t}\n\n\tif algProt == \"\" {\n\t\tif algUnProt == \"\" {\n\t\t\treturn \"\", errors.New(\"No algorithm (alg) found in protected or unprotected header\")\n\t\t} else if algProt != algUnProt {\n\t\t\treturn \"\", errors.New(\"Two non-matching algorithm (alg) parameters found in unprotected and protected header\")\n\t\t} else if !IsValidJwsAlg(algUnProt) {\n\t\t\treturn \"\", errors.New(\"Unprotected header algorithm (alg) is not valid\")\n\t\t}\n\t\treturn algUnProt, nil\n\t} else {\n\t\tif algUnProt != \"\" && algProt != algUnProt {\n\t\t\treturn \"\", errors.New(\"Two non-matching algorithm (alg) parameters found in unprotected and protected header\")\n\t\t} else if !IsValidJwsAlg(algProt) {\n\t\t\treturn \"\", errors.New(\"protected header algorithm (alg) is not valid\")\n\t\t}\n\t\treturn algProt, nil\n\t}\n}", "title": "" }, { "docid": "85e73b227fe4da33e1db549e44ceecc2", "score": "0.48189393", "text": "func (h *HttpInterfaceV4) Hash() string {\n\thash := md5.New()\n\tio.WriteString(hash, h.URL)\n\tio.WriteString(hash, h.Method)\n\tio.WriteString(hash, h.QueryString)\n\treturn fmt.Sprintf(\"%x\", hash.Sum(nil))\n}", "title": "" }, { "docid": "966eb919a6bf595dd8b14ce62c17f123", "score": "0.481766", "text": "func (h Hash) HashFunc() Hash", "title": "" }, { "docid": "a555cad16d3f7919c0d7bb3f6e792d6d", "score": "0.48155203", "text": "func (r *Remote) Hash(fpath string) ([]byte, error) {\n\to, err := r.Run(\"md5sum\", []string{fpath})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thashStr := strings.Trim(strings.Split(string(o), \" \")[0], \"\\n\\t \")\n\treturn hex.DecodeString(hashStr)\n}", "title": "" }, { "docid": "e7888b214a2f9ee9a0dc880fed1867b2", "score": "0.48139992", "text": "func CalculateHash(inputBlock *Block) string {\n\n\tvar temp string\n\tif (inputBlock.Course != Course{}) {\n\t\ttemp = inputBlock.Course.Code + inputBlock.Course.Name + inputBlock.Course.Grade\n\t}\n\tif (inputBlock.Project != Project{}) {\n\t\ttemp = inputBlock.Project.CourseName + inputBlock.Project.Name + inputBlock.Project.Details + inputBlock.Project.FileName\n\t}\n\th := sha256.New()\n\th.Write([]byte(temp))\n\tsum := hex.EncodeToString(h.Sum(nil))\n\n\t// sum := sha256.Sum256([]byte(temp))\n\n\treturn sum\n}", "title": "" }, { "docid": "37dbc39c4a6c55c24247b2384af002f5", "score": "0.48134643", "text": "func Hash(\n\tbytes []byte, name string, height int32) (out chainhash.Hash) {\n\tswitch name {\n\tcase \"blake2b\":\n\t\tb := Argon2i(Cryptonight7v2(Blake2b(bytes)))\n\t\t_ = out.SetBytes(rightShift(Blake2b(b)))\n\tcase \"blake14lr\":\n\t\tb := Argon2i(Cryptonight7v2(Blake14lr(bytes)))\n\t\t_ = out.SetBytes(rightShift(Blake14lr(b)))\n\tcase \"blake2s\":\n\t\tb := Argon2i(Cryptonight7v2(Blake2s(bytes)))\n\t\t_ = out.SetBytes(rightShift(Blake2s(b)))\n\tcase \"lyra2rev2\":\n\t\tb := Argon2i(Cryptonight7v2(Lyra2REv2(bytes)))\n\t\t_ = out.SetBytes(rightShift(Lyra2REv2(b)))\n\tcase \"scrypt\":\n\t\tif GetCurrent(height) > 0 {\n\t\t\tb := Argon2i(Cryptonight7v2(Scrypt(bytes)))\n\t\t\t_ = out.SetBytes(rightShift(Scrypt(b)))\n\t\t} else {\n\t\t\t_ = out.SetBytes(Scrypt(bytes))\n\t\t}\n\tcase \"sha256d\": // sha256d\n\t\tif GetCurrent(height) > 0 {\n\t\t\tb := Argon2i(Cryptonight7v2(chainhash.DoubleHashB(bytes)))\n\t\t\t_ = out.SetBytes(rightShift(chainhash.DoubleHashB(b)))\n\t\t} else {\n\t\t\t_ = out.SetBytes(chainhash.DoubleHashB(bytes))\n\t\t}\n\tcase \"stribog\":\n\t\tb := Argon2i(Cryptonight7v2(Stribog(bytes)))\n\t\t_ = out.SetBytes(rightShift(Stribog(b)))\n\tcase \"skein\":\n\t\tb := Argon2i(Cryptonight7v2(Skein(bytes)))\n\t\t_ = out.SetBytes(rightShift(Skein(b)))\n\tcase \"x11\":\n\t\tb := Argon2i(Cryptonight7v2(X11(bytes)))\n\t\t_ = out.SetBytes(rightShift(X11(b)))\n\tcase \"keccak\":\n\t\tb := Argon2i(Cryptonight7v2(Keccak(bytes)))\n\t\t_ = out.SetBytes(rightShift(Keccak(b)))\n\t}\n\treturn\n}", "title": "" }, { "docid": "ae107759e4c2e8197062914bee4673b3", "score": "0.48116073", "text": "func (req *RequestOnLedger) Hash() [32]byte {\n\treturn blake2b.Sum256(req.Bytes())\n}", "title": "" }, { "docid": "45bd855e6cf012a68be255b2a6e1a25a", "score": "0.48104793", "text": "func Hash(data []byte) [DigestSize]byte {\n\tdigest := sha512.Sum512_256(data)\n\treturn digest\n}", "title": "" }, { "docid": "8bb77ccfdd9f0062e3b0776b08fefda2", "score": "0.48104584", "text": "func (id *Public) hash() []byte {\n\treturn hash_helper(id.SigningKey.SerializeUncompressed(),\n\t\tid.EncryptionKey.SerializeUncompressed())\n}", "title": "" }, { "docid": "b59498aa66b8d1681926c0e4b65bf4f6", "score": "0.4807011", "text": "func (n node) hash() string {\n\tif n.isSentinel() {\n\t\treturn \"\"\n\t}\n\th := sha256.New()\n\th.Write([]byte(n.data))\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "ad076823e1e948e87faf53f8efb2d0ed", "score": "0.48041442", "text": "func (csp *impl) GetHash(opts bccsp.HashOpts) (h hash.Hash, err error) {\n\treturn csp.implcsp.GetHash(opts)\n}", "title": "" }, { "docid": "4881f0b5f52983cafe3439084218a0de", "score": "0.48027903", "text": "func HashByteArr(data []byte) (hashedData []byte) {\n\th := md5.New()\n\th.Write(data)\n\thashedData = h.Sum(nil)\n\treturn hashedData\n}", "title": "" }, { "docid": "7a42b8e7eb4c62481cdc6d40ba33f07e", "score": "0.47957796", "text": "func (d *Definition) SerializeHash() []byte {\n\thashes := make([]string, 0, len(d.Hashes))\n\tif val, ok := d.Hashes[\"sha256\"]; ok {\n\t\thashes = append(hashes, \"sha256:\"+fmt.Sprintf(\"%x\", val))\n\t}\n\tif val, ok := d.Hashes[\"sha512\"]; ok {\n\t\thashes = append(hashes, \"sha512:\"+fmt.Sprintf(\"%x\", val))\n\t}\n\treturn []byte(JoinRow(hashes))\n}", "title": "" }, { "docid": "d390f823c551befc7432c1ad3299fd23", "score": "0.47928783", "text": "func getMD5Hash(data []byte) string {\n\thash := md5.New()\n\thash.Write(data)\n\treturn hex.EncodeToString(hash.Sum(nil))\n}", "title": "" }, { "docid": "31642e12dd6e6e767b6f40e0901d7f9a", "score": "0.4782307", "text": "func Hcom(R *btcec.PublicKey) []byte {\n\ts := sha256.New()\n\ts.Write(R.SerializeCompressed())\n\thash := s.Sum(nil)\n\treturn hash\n}", "title": "" }, { "docid": "18ac515e6f38ae5c0193baaed2e96589", "score": "0.47744954", "text": "func hashAlgs(hash crypto.Hash, pubKey crypto.PublicKey, opts SignOptions) (string, string, error) {\n\thashName := hashNames[hash]\n\tif hashName == \"\" {\n\t\treturn \"\", \"\", errors.New(\"unsupported hash type\")\n\t}\n\tvar pubName string\n\tswitch pubKey.(type) {\n\tcase *rsa.PublicKey:\n\t\tpubName = \"rsa\"\n\tcase *ecdsa.PublicKey:\n\t\tpubName = \"ecdsa\"\n\tdefault:\n\t\treturn \"\", \"\", errors.New(\"unsupported key type\")\n\t}\n\tvar hashAlg, sigAlg string\n\tif opts.MsCompatHashNames {\n\t\thashAlg = NsXMLDsig + hashName\n\t} else {\n\t\thashAlg = HashUris[hash]\n\t}\n\tif pubName == \"rsa\" && (hashName == \"sha1\" || opts.MsCompatHashNames) {\n\t\tsigAlg = NsXMLDsig + pubName + \"-\" + hashName\n\t} else {\n\t\tsigAlg = NsXMLDsigMore + pubName + \"-\" + hashName\n\t}\n\treturn hashAlg, sigAlg, nil\n}", "title": "" }, { "docid": "9a57a117f676c5157c24ecd9d5fffe7f", "score": "0.47742674", "text": "func (ah *Average) computeHash(img *image.Gray, mean uint) hashtype.Binary {\n\tsize := ah.width * ah.height / 8\n\thash := make(hashtype.Binary, size)\n\tbnds := img.Bounds()\n\tvar c uint\n\tfor i := bnds.Min.Y; i < bnds.Max.Y; i++ {\n\t\tfor j := bnds.Min.X; j < bnds.Max.X; j++ {\n\t\t\tpix := img.GrayAt(j, i).Y\n\t\t\tif uint(pix) > mean {\n\t\t\t\thash.Set(c)\n\t\t\t}\n\t\t\tc++\n\t\t}\n\t}\n\treturn hash\n}", "title": "" }, { "docid": "2c8e325fcbce3dd3afda445adc2c7872", "score": "0.47709784", "text": "func (r *MetaRequest) GetHash() string {\n\tspew.Config.SortKeys = true\n\tspew.Config.SpewKeys = true\n\tspew.Config.DisablePointerAddresses = true\n\tspew.Config.DisableCapacities = true\n\tspew.Config.DisablePointerMethods = true\n\tspew.Config.DisableMethods = true\n\thash := fmt.Sprintf(\"%s:%s\", \"meta\", spew.Sdump(r))\n\treturn strings.Join(strings.Fields(hash), \":\")\n}", "title": "" }, { "docid": "b85d8d1b176efa59ae85ab079feddacb", "score": "0.4766044", "text": "func (s *SpinnakerConfig) GetHash() (string, error) {\n\tdata, err := json.Marshal(s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tm := md5.Sum(data)\n\treturn hex.EncodeToString(m[:]), nil\n}", "title": "" }, { "docid": "f9cc9d1bd40563cdb085547732080c12", "score": "0.47644874", "text": "func (o *CreateJsonWebKeySet) SetAlg(v string) {\n\to.Alg = v\n}", "title": "" }, { "docid": "aa9b931edcdeafde18125551212fef55", "score": "0.4761065", "text": "func (e Aes256CtsHmacSha384192) GetHashID() int32 {\n\treturn chksumtype.HMAC_SHA384_192_AES256\n}", "title": "" }, { "docid": "8a2cb3c5eff813c2bf1bbe61a394486e", "score": "0.47596866", "text": "func (p *Protocol) SignHash(name string, hash []byte, protocol ProtocolType) ([]byte, error) {\n\tconst expectedHashSize = 32\n\n\tid, err := p.Crypto.GetUUID(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif id == uuid.Nil { //catch error if there is an entry but the UUID is nil\n\t\treturn nil, fmt.Errorf(\"Entry for name found but UUID is nil\")\n\t}\n\n\tif len(hash) != expectedHashSize {\n\t\treturn nil, fmt.Errorf(\"Invalid hash size, expected %v, got %v bytes\", expectedHashSize, len(hash))\n\t}\n\n\tswitch protocol {\n\tcase Plain:\n\t\treturn nil, fmt.Errorf(\"Plain type packets are deprecated\") //p.Crypto.Sign(id, value)\n\tcase Signed:\n\t\treturn SignedUPP{protocol, id, 0x00, hash, nil}.sign(p)\n\tcase Chained:\n\t\tsignature, found := p.Signatures[id]\n\t\tif !found {\n\t\t\tsignature = make([]byte, 64)\n\t\t}\n\t\treturn ChainedUPP{protocol, id, signature, 0x00, hash, nil}.sign(p)\n\tdefault:\n\t\treturn nil, errors.New(fmt.Sprintf(\"unknown protocol type: 0x%02x\", protocol))\n\t}\n}", "title": "" }, { "docid": "417bc657c10eb1d48e1ba588b551a3e1", "score": "0.4752171", "text": "func (h Header) CalculateHash() (c.Hash, error) {\n\thash, err := blake2b.New256(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tserialized, err := h.SerializeForProof()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\thash.Write(serialized)\n\n\tmd := hash.Sum(nil)\n\treturn md, nil\n}", "title": "" }, { "docid": "19ce67615a59353ec68409f8a35dd1e7", "score": "0.4744587", "text": "func computeOrgHash(organizations []string) string {\n\tsort.Strings(organizations)\n\ts := strings.Join(organizations, \",\")\n\n\th := sha512.New()\n\t_, err := h.Write([]byte(s))\n\tif err != nil {\n\t\tpanic(microerror.JSON(err))\n\t}\n\tbs := h.Sum(nil)\n\n\treturn fmt.Sprintf(\"%x\", bs)\n}", "title": "" }, { "docid": "543332f812bdce5f298dcdd9f4eb5995", "score": "0.4741831", "text": "func (t textContent) CalcHash() ([]byte, error) {\r\n hashVal := sha256.New()\r\n if _, err := h.write([]byte(t.x)); err != nil {\r\n\t return nil, err\r\n }\r\n return hashVal.Sum(nil), nil\r\n}", "title": "" }, { "docid": "f97644419428472ff53e0f3022e423f8", "score": "0.4740425", "text": "func (j *JWT) Algorithm() string {\n\treturn j.header.Algorithm\n}", "title": "" }, { "docid": "40e41259ed0ac29eb2fe51e8c585c29e", "score": "0.47385332", "text": "func (body *Body) Hash() (h string) {\n\tb := body.Buffer()\n\t// empty buffs should return a empty string\n\tif b.Len() == 0 {\n\t\th = HashStr(\"\")\n\t}\n\th = HashStr(b.String())\n\treturn\n}", "title": "" }, { "docid": "da7be94fda5f2f2822abc53416237ff4", "score": "0.47374776", "text": "func getHash(c *Config) (string, error) {\n\tbytes, err := yaml.Marshal(c)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\thash := md5.Sum(bytes)\n\treturn hex.EncodeToString(hash[:]), nil\n}", "title": "" }, { "docid": "24338592d394f5649539c63bbf24a472", "score": "0.47321188", "text": "func (o *UpdateData) Hash() string {\n\targs := make([]interface{}, 0)\n\targs = append(args, o.CustomerID)\n\targs = append(args, o.ID)\n\targs = append(args, o.IntegrationInstanceID)\n\targs = append(args, o.Model)\n\targs = append(args, o.Pull)\n\targs = append(args, o.Push)\n\targs = append(args, o.RefID)\n\targs = append(args, o.RefType)\n\targs = append(args, o.Set)\n\targs = append(args, o.Unset)\n\targs = append(args, o.UpdatedAt)\n\to.Hashcode = hash.Values(args...)\n\treturn o.Hashcode\n}", "title": "" }, { "docid": "df11a30e96c5cd785211a39915c7830a", "score": "0.47318345", "text": "func NewHashAlgorithm(arg string) HashAlgorithm {\n\treturn HashAlgorithm(arg)\n}", "title": "" }, { "docid": "562cdd86e3d44a057dcd5ed5d0ac6ff6", "score": "0.472828", "text": "func (o RunBookPublishContentLinkHashOutput) Algorithm() pulumi.StringOutput {\n\treturn o.ApplyT(func(v RunBookPublishContentLinkHash) string { return v.Algorithm }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4a5d74a79289abdee43573cfb7889d73", "score": "0.47281852", "text": "func (s *Shape) Hash() index.Code {\n\tshape := s\n\tif shape == nil {\n\t\tshape = &Shape{}\n\t}\n\n\tclientData := shape.ClientData\n\tif clientData == nil {\n\t\tclientData = &ClientData{}\n\t}\n\n\treturn index.Hash(strings.Join([]string{\n\t\tshape.Type,\n\t\tstrconv.FormatInt(int64(shape.Spt), 10),\n\t\tstrconv.FormatInt(int64(clientData.Column), 10),\n\t\tstrconv.FormatInt(int64(clientData.Row), 10),\n\t}, \":\"))\n}", "title": "" }, { "docid": "065cd4faafbacb77cabf822f289313ca", "score": "0.47260892", "text": "func (r *Request) Hash() string {\n\th := sha256.New()\n\n\th.Write([]byte(r.Command))\n\th.Write([]byte(r.ModulePlatformID))\n\th.Write([]byte(r.Arch))\n\tfor _, repo := range r.Arguments.Repos {\n\t\th.Write([]byte(repo.Hash()))\n\t}\n\th.Write([]byte(fmt.Sprintf(\"%T\", r.Arguments.Search.Latest)))\n\th.Write([]byte(strings.Join(r.Arguments.Search.Packages, \"\")))\n\n\treturn fmt.Sprintf(\"%x\", h.Sum(nil))\n}", "title": "" }, { "docid": "0088b1a83de3547db3996a8610c86ab5", "score": "0.47199515", "text": "func (e Aes256CtsHmacSha384192) GetHashFunc() func() hash.Hash {\n\treturn sha512.New384\n}", "title": "" }, { "docid": "150726c87528c45efc67d49e448ef06a", "score": "0.47127143", "text": "func Hash(proof Proof, lastProof Proof) ProofHash {\n\tslice := sha256.Sum256(append([]byte(proof), ([]byte(lastProof))...))\n\treturn ProofHash(slice[:])\n}", "title": "" }, { "docid": "1917d8cc2204bd72f82bc97625012032", "score": "0.47125512", "text": "func HashIt(text string) string {\n\th := md5.New()\n\tsum := h.Sum([]byte(text))\n\tcryptoText := base64.URLEncoding.EncodeToString(sum)\n\treturn cryptoText\n}", "title": "" }, { "docid": "3e9c10f379076926930668e9a611f273", "score": "0.47061834", "text": "func (proposal *Proposal) Hash() ([]byte, error) {\n\treturn proposal.hash(proposal.bytes)\n}", "title": "" }, { "docid": "4d39787535c53803b43177e3fb020e41", "score": "0.47056487", "text": "func (p *AzureBlobPath) Hash(a hashing.HashAlgorithm) (*hashing.Hash, error) {\n\tif a != hashing.HashAlgorithmMD5 {\n\t\treturn nil, nil\n\t}\n\n\tif p.md5Hash == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tmd5Bytes, err := base64.StdEncoding.DecodeString(p.md5Hash)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"not valid MD5 sum: %q\", p.md5Hash)\n\t}\n\n\treturn &hashing.Hash{Algorithm: hashing.HashAlgorithmMD5, HashValue: md5Bytes}, nil\n}", "title": "" } ]
f28d89461cba62553f849097e4fa199c
SetAuthorizeInvocation configures Authorizer.Authorize to return the given results when called with the given parameters If no match is found for an invocation the result(s) of the fallback function are returned
[ { "docid": "932434e168f58f9a86b8f5d377f2e41a", "score": "0.8102992", "text": "func (_f3 *FakeAuthorizer) SetAuthorizeInvocation(calls_f4 []*AuthorizerAuthorizeInvocation, fallback_f5 func() (bool, merry.Error)) {\n\t_f3.AuthorizeHook = func(ident1 context.Context, ident2 *httpx.Request) (ident3 bool, ident4 merry.Error) {\n\t\tfor _, call := range calls_f4 {\n\t\t\tif reflect.DeepEqual(call.Parameters.Ident1, ident1) && reflect.DeepEqual(call.Parameters.Ident2, ident2) {\n\t\t\t\tident3 = call.Results.Ident3\n\t\t\t\tident4 = call.Results.Ident4\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_f5()\n\t}\n}", "title": "" } ]
[ { "docid": "f2069d0f965eca0ce77ae2ff35ff40a2", "score": "0.6151317", "text": "func NewAuthorizerAuthorizeInvocation(ident1 context.Context, ident2 *httpx.Request, ident3 bool, ident4 merry.Error) *AuthorizerAuthorizeInvocation {\n\tinvocation := new(AuthorizerAuthorizeInvocation)\n\n\tinvocation.Parameters.Ident1 = ident1\n\tinvocation.Parameters.Ident2 = ident2\n\n\tinvocation.Results.Ident3 = ident3\n\tinvocation.Results.Ident4 = ident4\n\n\treturn invocation\n}", "title": "" }, { "docid": "c7073705c5d9cdd78cb9adc35cd1c559", "score": "0.55809546", "text": "func (_f2 *FakeAuthorizer) SetAuthorizeStub(ident3 bool, ident4 merry.Error) {\n\t_f2.AuthorizeHook = func(context.Context, *httpx.Request) (bool, merry.Error) {\n\t\treturn ident3, ident4\n\t}\n}", "title": "" }, { "docid": "7698f5634cf8ec5678b9ceb8be6d6e87", "score": "0.55566615", "text": "func (_f3 *FakeRegistrar) SetRegisterInvocation(calls_f4 []*RegistrarRegisterInvocation, fallback_f5 func() merry.Error) {\n\t_f3.RegisterHook = func(serviceID string, url *url.URL) (ident1 merry.Error) {\n\t\tfor _, call := range calls_f4 {\n\t\t\tif reflect.DeepEqual(call.Parameters.ServiceID, serviceID) && reflect.DeepEqual(call.Parameters.Url, url) {\n\t\t\t\tident1 = call.Results.Ident1\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_f5()\n\t}\n}", "title": "" }, { "docid": "d1d391778ed39a97bd5eaa2608487eb7", "score": "0.55003065", "text": "func (_f10 *FakeAuthorizer) AuthorizeResultsForCall(ident1 context.Context, ident2 *httpx.Request) (ident3 bool, ident4 merry.Error, found bool) {\n\tfor _, call := range _f10.AuthorizeCalls {\n\t\tif reflect.DeepEqual(call.Parameters.Ident1, ident1) && reflect.DeepEqual(call.Parameters.Ident2, ident2) {\n\t\t\tident3 = call.Results.Ident3\n\t\t\tident4 = call.Results.Ident4\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "aeba324ffca64afc52db3b19e0b536cc", "score": "0.5455089", "text": "func (cc *Chaincode) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\tlog.Init(\"DEBUG\")\n\tfcn, params := stub.GetFunctionAndParameters()\n\tvar err error\n\tvar result string\n\tCHANNEL_ENV = stub.GetChannelID()\n\tif fcn == \"proxy\" {\n\t\tresult, err = cc.verifyArgs(stub, params)\n\t}\n\tif err != nil {\n\t\tlog.Errorf(\"[%s][%s][IdentityCC][Init] Error %v\",uuidgen(), CHANNEL_ENV, err)\n\t\treturn shim.Error(err.Error())\n\t}\n\treturn shim.Success([]byte(result))\n}", "title": "" }, { "docid": "4588ba1bf80e438829b5032dc0630f24", "score": "0.54372716", "text": "func (f_sym7 *FakeJWT) SetValidateInvocation(calls_sym7 []*JWTValidateInvocation, fallback_sym7 func() error) {\n\tf_sym7.ValidateHook = func(key interface{}, method crypto.SigningMethod, v ...*jwt.Validator) (ident1 error) {\n\t\tfor _, call_sym7 := range calls_sym7 {\n\t\t\tif reflect.DeepEqual(call_sym7.Parameters.Key, key) && reflect.DeepEqual(call_sym7.Parameters.Method, method) && reflect.DeepEqual(call_sym7.Parameters.V, v) {\n\t\t\t\tident1 = call_sym7.Results.Ident1\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym7()\n\t}\n}", "title": "" }, { "docid": "9960d2934889c0046308b4b17296cde2", "score": "0.54358417", "text": "func (_f6 *FakeAuthorizer) AuthorizeCalledWith(ident1 context.Context, ident2 *httpx.Request) (found bool) {\n\tfor _, call := range _f6.AuthorizeCalls {\n\t\tif reflect.DeepEqual(call.Parameters.Ident1, ident1) && reflect.DeepEqual(call.Parameters.Ident2, ident2) {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "6644dbd3ce8d055d6271d11c44fa4cd0", "score": "0.53293204", "text": "func (m *MockPermsStore) Authorize(v0 context.Context, v1 int64, v2 int64, v3 AccessMode, v4 AccessModeOptions) bool {\n\tr0 := m.AuthorizeFunc.nextHook()(v0, v1, v2, v3, v4)\n\tm.AuthorizeFunc.appendCall(PermsStoreAuthorizeFuncCall{v0, v1, v2, v3, v4, r0})\n\treturn r0\n}", "title": "" }, { "docid": "669b3463fea0abe6477d70b84545ca20", "score": "0.5322937", "text": "func (f_sym15 *FakeJWT) SetSerializeInvocation(calls_sym15 []*JWTSerializeInvocation, fallback_sym15 func() ([]byte, error)) {\n\tf_sym15.SerializeHook = func(key interface{}) (ident1 []byte, ident2 error) {\n\t\tfor _, call_sym15 := range calls_sym15 {\n\t\t\tif reflect.DeepEqual(call_sym15.Parameters.Key, key) {\n\t\t\t\tident1 = call_sym15.Results.Ident1\n\t\t\t\tident2 = call_sym15.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym15()\n\t}\n}", "title": "" }, { "docid": "0e3977320c3fb37362a7cb7eacfc8f52", "score": "0.528471", "text": "func (t *ArticlesPrivateChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tswitch function {\n\tcase \"initArticle\":\n\t\t//create a new article\n\t\treturn t.initArticle(stub, args)\n\tcase \"readArticle\":\n\t\t//read a article\n\t\treturn t.readArticle(stub, args)\n\tcase \"readArticlePrivateDetails\":\n\t\t//read a article private details\n\t\treturn t.readArticlePrivateDetails(stub, args)\n\tcase \"transferArticle\":\n\t\t//change owner of a specific article\n\t\treturn t.transferArticle(stub, args)\n\tcase \"delete\":\n\t\t//delete a article\n\t\treturn t.delete(stub, args)\n\tcase \"getArticlesByRange\":\n\t\t//get articles based on range query\n\t\treturn t.getArticlesByRange(stub, args)\n\tcase \"getArticleHash\":\n\t\t// get private data hash for collectionArticles\n\t\treturn t.getArticleHash(stub, args)\n\tcase \"getArticlePrivateDetailsHash\":\n\t\t// get private data hash for collectionArticlePrivateDetails\n\t\treturn t.getArticlePrivateDetailsHash(stub, args)\n\tdefault:\n\t\t//error\n\t\tfmt.Println(\"invoke did not find func: \" + function)\n\t\treturn shim.Error(\"Received unknown function invocation\")\n\t}\n}", "title": "" }, { "docid": "947fb5e594f7d6b5983fd12daab68866", "score": "0.5175618", "text": "func (t *TestChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfmt.Println(\"~~~~~~~~ ivoking chaincode ~~~~~~~~\")\n\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tif function == \"queryAccount\" {\n\t\treturn t.queryAccount(stub, args)\n\t} else if function == \"valueTransfer\" {\n\t\treturn t.valueTransfer(stub, args)\n\t} else if function == \"addAccount\" {\n\t\treturn t.addAccount(stub, args)\n\t}\n\n\treturn shim.Error(\"Unknown action, check the first argument\")\n}", "title": "" }, { "docid": "5ddb082165aab9292a0941993b4468d0", "score": "0.5141284", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tlogger.Info(\"########### certificates Invoke ###########\")\n\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\t// check if user is an university\n\terr := checkUserAttr(stub, \"role\", \"university\")\n\n\tif err != nil {\n\t\t// user doesn't have the expected role or attrs retrieval error\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// check if user has email\n\tval, attrErr := getUserAttr(stub, \"email\")\n\n\tif attrErr != nil {\n\t\t// error getting user's email\n\t\treturn shim.Error(attrErr.Error())\n\t}\n\n\tif function == \"initLedger\" {\n\t\t// init empty structures in ledger\n\t\treturn t.initLedger(stub)\n\t}\n\tif function == \"issueBadge\" {\n\t\t// Add email to arguments at 1st position\n\t\targuments := append([]string{val}, args...)\n\t\t// issue a Badge\n\t\treturn t.issueBadge(stub, arguments)\n\t}\n\tif function == \"issueCertificate\" {\n\t\t// Add email to arguments at 1st position\n\t\targuments := append([]string{val}, args...)\n\t\t// Issue a certificate\n\t\treturn t.issueCertificate(stub, arguments)\n\t}\n\tif function == \"getCertificate\" {\n\t\t// Add email to arguments at 1st position\n\t\t// arguments := []string{val}\n\n\t\t// get a certificate\n\t\treturn t.getCertificate(stub, args)\n\t}\n\n\terrorMsg := \"Unknown action, check the first argument, must be one of 'setCertificate' or 'getCertificate'. But got:\" + args[0]\n\tlogger.Errorf(errorMsg)\n\treturn shim.Error(errorMsg)\n}", "title": "" }, { "docid": "e1d1735902d6e6f07450adccb2c73187", "score": "0.5137044", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"initAav\" { //create a new aav\n\t\treturn t.initAav(stub, args)\n\t} else if function == \"verify\" { //start anonymous on chain verification\n\t\treturn t.verify(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "ae99beb4d5ff068ee2d92edf346e55dc", "score": "0.51348805", "text": "func (t *myChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tswitch function {\n\n\tcase \"addOrganization\":\n\t\treturn t.addOrganization(stub, args)\n\tcase \"queryByOrganunitCode\":\n\t\treturn t.queryByOrganunitCode(stub, args)\n\n\tdefault:\n\t\treturn shim.Error(\"Unsupported operation\")\n\t}\n}", "title": "" }, { "docid": "5800b37c4f14913f63c1efeee7cac68c", "score": "0.51324433", "text": "func (f_sym13 *FakeIdentifier) SetInvocationSetterInvocation(calls_sym13 []*IdentifierInvocationSetterInvocation, fallback_sym13 func() (string, string, string)) {\n\tf_sym13.InvocationSetterHook = func(val int64) (call string, calls string, fallback string) {\n\t\tfor _, call_sym13 := range calls_sym13 {\n\t\t\tif reflect.DeepEqual(call_sym13.Parameters.Val, val) {\n\t\t\t\tcall = call_sym13.Results.Call\n\t\t\t\tcalls = call_sym13.Results.Calls\n\t\t\t\tfallback = call_sym13.Results.Fallback\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym13()\n\t}\n}", "title": "" }, { "docid": "9d7f4b1471a44f2496d3c515278f5a80", "score": "0.5127508", "text": "func (f_sym7 *FakeEmbedder) SetEmbedInvocation(calls_sym7 []*EmbedderEmbedInvocation, fallback_sym7 func() string) {\n\tf_sym7.EmbedHook = func(ident1 string) (ident2 string) {\n\t\tfor _, call_sym7 := range calls_sym7 {\n\t\t\tif reflect.DeepEqual(call_sym7.Parameters.Ident1, ident1) {\n\t\t\t\tident2 = call_sym7.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym7()\n\t}\n}", "title": "" }, { "docid": "4a1871af083efaf86d43609e01c048e3", "score": "0.50881684", "text": "func (t *ServicesChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\n\tif len(pme.COMPARISON_ATTR) == 0{\n\t\terr := getConfiguration(stub);\n\t\tif err != nil{\n\t\t\treturn nil, fmt.Errorf(\"Failed retriving configurations [%s]\", err)\n\t\t}\n\t}\n\n\tif function == \"addCIAV\" {\n\t\t// add customer\n\t\treturn t.addCIAV(stub, args)\n\t} else {\n\t\t// update customer\n\t\treturn t.updateCIAV(stub, args)\n\t}\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "fe51c123162e7411f3bf1da284ba6441", "score": "0.50715894", "text": "func (cc *HealthcareChaincode) Invoke(stub shim.ChaincodeStubInterface) sc.Response {\n\tfun, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"Invoke is runing \" + fun)\n\n\tif fun == \"addAsset\" {\n\t\treturn cc.addAsset(stub, args)\n\t} else if fun == \"addAssetPriv\" {\n\t\treturn cc.addAssetPriv(stub, args)\n\t} else if fun == \"getAsset\" {\n\t\treturn cc.getAsset(stub, args)\n\t} else if fun == \"getAssetPriv\" {\n\t\treturn cc.getAssetPriv(stub, args)\n\t} else if fun == \"shareAssetWithDoctor\" {\n\t\treturn cc.shareAssetWithDoctor(stub, args)\n\t} else if fun == \"getSharedAssetWithDoctor\" {\n\t\treturn cc.getSharedAssetWithDoctor(stub, args)\n\t} else if fun == \"shareAssetForResearcher\" {\n\t\treturn cc.shareAssetForResearcher(stub, args)\n\t} else if fun == \"requestAssetForResearcher\" {\n\t\treturn cc.requestAssetForResearcher(stub, args)\n\t} else if fun == \"getSharedAssetForResearcher\" {\n\t\treturn cc.getSharedAssetForResearcher(stub, args)\n\t} else if fun == \"auditLogs\" {\n\t\treturn cc.auditLogs(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + fun) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "f8d4a9a3087c59bae4118e19e865d248", "score": "0.5049575", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tlogger.Info(\"########### example_cc0 Invoke ###########\")\n\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tif function == \"delete\" {\n\t\treturn t.delete(stub, args)\n\t}\n\tif function == \"query\" {\n\t\treturn t.query(stub, args)\n\t}\n\tif function == \"addUser\" {\n\t\treturn t.addUser(stub, args)\n\t}\n\tif function == \"getLoan\"{\n\t\treturn t.getLoan(stub, args)\n\t}\n\tif function == \"payLoan\" {\n\t\treturn t.payLoan(stub, args)\n\t}\n\n\tif function == \"addTransaction\" {\n\t\treturn t.addTransaction(stub, args)\n\t}\n\t// if function == \"addTutorial\" {\n\t// \treturn t.addTutorial(stub, args)\n\t// }\n\t// if function == \"addTutor\" {\n\t// \treturn t.addTutor(stub, args)\n\t// }\n\t// if function == \"addTutorToTutorial\" {\n\t// \treturn t.addTutorToTutorial(stub, args)\n\t// }\n\t// if function == \"removeTutorFromTutorial\" {\n\t// \treturn t.removeTutorFromTutorial(stub, args)\n\t// }\n\n\tlogger.Errorf(\"Unknown action, check the first argument, must be one of 'delete', 'query'. But got: %v\", args[0])\n\treturn shim.Error(fmt.Sprintf(\"Unknown action, check the first argument, must be one of 'delete', 'query', or 'move'. But got: %v\", args[0]))\n}", "title": "" }, { "docid": "550ef62bf7f96bb123f068e45bdfc2a2", "score": "0.5048571", "text": "func (t *Chaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\t_, args := stub.GetFunctionAndParameters()\n\n\tvar functionName = args[0]\n\targs = append(args[:0], args[1:]...)\n\n\tlogger.Infof(\"Invoke is running \" + functionName)\n\tfmt.Println(args)\n\n\tvar err error\n\tvar response []byte\n\n\tswitch functionName {\n\tcase \"register\":\n\t\terr = contracts.RegisterUser(stub, args)\n\tcase \"loginUser\":\n\t\tresponse, err = contracts.LoginUser(stub, args)\n\tcase \"getUser\":\n\t\tresponse, err = contracts.GetUser(stub, args)\n\tcase \"allUsers\":\n\t\tresponse, err = contracts.GetAllUsers(stub)\n\tcase \"createPoll\":\n\t\terr = contracts.CreatePoll(stub, args)\n\tcase \"allPolls\":\n\t\tresponse, err = contracts.GetAllPolls(stub)\n\tcase \"getPoll\":\n\t\tresponse, err = contracts.GetPoll(stub, args)\n\tcase \"vote\":\n\t\terr = contracts.Vote(stub, args)\n\tcase \"delegate\":\n\t\terr = contracts.Delegate(stub, args)\n\tcase \"allVotes\":\n\t\tresponse, err = contracts.RetrieveAllVotes(stub)\n\tdefault:\n\t\treturn shim.Error(fmt.Sprintf(\"Received unknown invoke function name: '%s'\", functionName))\n\t}\n\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(response)\n}", "title": "" }, { "docid": "cad3e6d97cfb0d98e88d594f84622ac5", "score": "0.5040728", "text": "func (cc *Re) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\t// Which function is been called?\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfunction = strings.ToLower(function)\n\t// Route call to the correct function\n\tswitch function {\n\tcase \"register\": return cc.register(stub, args)\n\tcase \"order\": return cc.order(stub, args);\n\tcase \"transfer\": return cc.transfer(stub, args);\n\tcase \"search\": return cc.search(stub, args);\n\tdefault: return shim.Error(\"Valid methods are 'register' or 'search'!\")\n\t}\n}", "title": "" }, { "docid": "3eeb7b57af66a81de38502246767ef20", "score": "0.5035299", "text": "func WrapAuthorize(hfn http.Handler, cfg config.Config, routeName string) http.HandlerFunc {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\tvar errs []ErrorResponse\n\n\t\t// log.Printf(\" >> Authorization takes place here...\")\n\t\tvar roles []string\n\n\t\troles = context.Get(r, \"roles\").([]string)\n\n\t\tif roles != nil {\n\t\t\tauthor := authorization.HasResourceRoles(cfg, routeName, roles)\n\t\t\tif author != false {\n\t\t\t\thfn.ServeHTTP(w, r)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tError(w, r, ErrAuthor, cfg, errs)\n\n\t})\n}", "title": "" }, { "docid": "5f3fdbc70078921142a46c6fd61d7c05", "score": "0.5032523", "text": "func (f_sym73 *FakeTransactionRepo) SetDeleteInvocation(calls_sym73 []*TransactionRepoDeleteInvocation, fallback_sym73 func() error) {\n\tf_sym73.DeleteHook = func(userID int, tranID int) (ident1 error) {\n\t\tfor _, call_sym73 := range calls_sym73 {\n\t\t\tif reflect.DeepEqual(call_sym73.Parameters.UserID, userID) && reflect.DeepEqual(call_sym73.Parameters.TranID, tranID) {\n\t\t\t\tident1 = call_sym73.Results.Ident1\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym73()\n\t}\n}", "title": "" }, { "docid": "a2537563a34cf1cde2d656a9fe14aaf6", "score": "0.5022975", "text": "func Authorize(obj string, act string, enforcer *casbin.Enforcer) gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\taccessDetails := c.MustGet(auth.ContextAccessDetailsKey).(*auth.AccessDetails)\n\t\t// casbin enforces policy\n\t\tok := enforcer.Enforce(accessDetails.Username, obj, act)\n\t\tif !ok {\n\t\t\tc.AbortWithStatusJSON(http.StatusForbidden, \"forbidden\")\n\t\t\treturn\n\t\t}\n\t\tc.Next()\n\t}\n}", "title": "" }, { "docid": "967d957fd582837455889718db0086be", "score": "0.5022071", "text": "func (t *SupplychainChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfmt.Println(\"invoke is running \")\n\n\tcallerDetails, err := GetCallerDetails(stub)\n\tif err != nil {\n\t\tfmt.Println(\"An error occured whilst obtaining the caller details: \" + callerDetails.Role)\n\t\treturn shim.Error(\"An error occured whilst obtaining the caller details\")\n\t}\n\tfmt.Println(\"User is \" + callerDetails.Username)\n\tfmt.Println(\"Role is \" + callerDetails.Role)\n\tfunction, args := stub.GetFunctionAndParameters()\n\t// Handle different functions\n\tif function == \"init\" {\n\t\tb := t.Init(stub)\n\t\treturn b\n\t} else if function == \"clearData\" {\n\t\tb, _ := t.processClearData(stub, callerDetails, args)\n\t\treturn b\n\t} else if function == \"addOrder\" {\n\t\t_, err := t.processAddPurchaseOrder(stub, callerDetails, args)\n\t\tif err != nil {\n\t\t\treturn shim.Error(\"Error Occured in processAddPurchaseOrder \")\n\t\t}\n\n\t} else if function == \"updatePurchaseOrderStatus\" {\n\t\t_, err := t.processUpdatePurchaseOrderStatus(stub, callerDetails, args)\n\t\tif err != nil {\n\t\t\treturn shim.Error(\"Error Occured in processUpdatePurchaseOrderStatus \")\n\t\t}\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn shim.Success(nil) /*, errors.New(\"Received unknown function invocation: \" + function)*/\n}", "title": "" }, { "docid": "cceb57ea974ddd57ad3948f3d39a0ea7", "score": "0.5018238", "text": "func (run *Run) AddInvocation(executionSuccessful bool) *Invocation {\n\ti := &Invocation{\n\t\tExecutionSuccessful: &executionSuccessful,\n\t}\n\trun.Invocations = append(run.Invocations, i)\n\treturn i\n}", "title": "" }, { "docid": "8d4fe051a108a6e9face0a5b3a38a796", "score": "0.5002691", "text": "func (f_sym57 *FakeTransactionRepo) SetCreateInvocation(calls_sym57 []*TransactionRepoCreateInvocation, fallback_sym57 func() error) {\n\tf_sym57.CreateHook = func(ident1 *model.Transaction) (ident2 error) {\n\t\tfor _, call_sym57 := range calls_sym57 {\n\t\t\tif reflect.DeepEqual(call_sym57.Parameters.Ident1, ident1) {\n\t\t\t\tident2 = call_sym57.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym57()\n\t}\n}", "title": "" }, { "docid": "857e86dfff9119a2247d890697fa27f4", "score": "0.4996519", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfmt.Println(\"TrustAS Invoke\")\n\tfunction, args := stub.GetFunctionAndParameters()\n\tif function == \"invoke\" {\n\t\t// Make payment of X units from A to B\n\t\treturn t.invoke(stub, args)\n\t} else if function == \"delete\" {\n\t\t// Deletes an entity from its state\n\t\treturn t.delete(stub, args)\n\t} else if function == \"query\" {\n\t\t// Queries chaincode\n\t\treturn t.query(stub, args)\n\t} else if function == \"createAgreement\" {\n\t\t// Create an agreement in the chaincode\n\t\treturn t.createAgreement(stub, args)\n\t} else if function == \"queryAgreement\" {\n\t\t// Create an agreement in the chaincode\n\t\treturn t.queryAgreement(stub, args)\n\t} else if function == \"publishMeasurement\" {\n\t\t// Publish an agreement measurement to the chaincode\n\t\treturn t.publishMeasurement(stub, args)\n\t}\n\n\treturn shim.Error(\"Invalid invoke function name. Expecting \\\"invoke\\\", \\\"delete\\\", \\\"query\\\", \\\"createAgreement\\\", or \\\"queryAgreement\\\"\")\n}", "title": "" }, { "docid": "b94794ef5c6b22fc7511f031b7148a56", "score": "0.49916157", "text": "func (authzHandler unionAuthzHandler) Authorize(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {\n\tvar (\n\t\terrlist []error\n\t\treasonlist []string\n\t)\n\n\tfor _, currAuthzHandler := range authzHandler {\n\t\tdecision, reason, err := currAuthzHandler.Authorize(ctx, a)\n\n\t\tif err != nil {\n\t\t\terrlist = append(errlist, err)\n\t\t}\n\t\tif len(reason) != 0 {\n\t\t\treasonlist = append(reasonlist, reason)\n\t\t}\n\t\tswitch decision {\n\t\tcase authorizer.DecisionAllow, authorizer.DecisionDeny:\n\t\t\treturn decision, reason, err\n\t\tcase authorizer.DecisionNoOpinion:\n\t\t\t// continue to the next authorizer\n\t\t}\n\t}\n\n\treturn authorizer.DecisionNoOpinion, strings.Join(reasonlist, \"\\n\"), utilerrors.NewAggregate(errlist)\n}", "title": "" }, { "docid": "bbaee019a848152b3af1eec4c9e857c6", "score": "0.4967164", "text": "func (t *CertificateChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t} else if function == \"init_cert\" {\t\t\t\t\t\t\t\t\t//create a new certificate\n\t\treturn t.init_cert(stub, args)\n\t} else if function == \"set_user\" {\t\t\t\t\t\t\t\t\t\t//change owner of a certificate\n\t\tres, err := t.set_user(stub, args)\n\t\treturn res, err\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function)\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "5c70814d7ee050920c11a10dd30397a3", "score": "0.49658266", "text": "func (b *BASE) Invoke(stub shim.ChaincodeStubInterface) (pbResponse pb.Response) {\r\n\r\n\tbaselogger.Debug(\"Enter Invoke\")\r\n\tfunction, args := stub.GetFunctionAndParameters()\r\n\tbaselogger.Debug(\"func =%s, args = %+v\", function, args)\r\n\r\n\tstateCache.create()\r\n\tdefer func() {\r\n\t\tstateCache.destroy()\r\n\t}()\r\n\r\n\tdefer func() {\r\n\t\tif excption := recover(); excption != nil {\r\n\t\t\tpbResponse = shim.Error(baselogger.SError(\"Invoke(%s) got an unexpect error:%s\", function, excption))\r\n\t\t\tbaselogger.Critical(\"Invoke got exception, stack:\\n%s\", string(debug.Stack()))\r\n\t\t}\r\n\t}()\r\n\r\n\tvar err error\r\n\r\n\tvar fixedArgCount = 2\r\n\t//最后一个参数为签名,所以参数必须大于fixedArgCount个\r\n\tif len(args) < fixedArgCount {\r\n\t\treturn shim.Error(baselogger.SError(\"Invoke miss arg, got %d, at least need %d(use, acc).\", len(args), fixedArgCount))\r\n\t}\r\n\r\n\tvar userName = args[0]\r\n\tvar accName = args[1]\r\n\ttimestamp, err := stub.GetTxTimestamp()\r\n\tif err != nil {\r\n\t\treturn shim.Error(fmt.Sprintf(\"Init: GetTxTimestamp failed, err=%s\", err))\r\n\t}\r\n\r\n\tvar invokeTime = timestamp.Seconds*1000 + int64(timestamp.Nanos/1000000) //精确到毫秒\r\n\r\n\tvar signBase64 = args[len(args)-1]\r\n\tvar sign []byte\r\n\tsign, err = base64.StdEncoding.DecodeString(signBase64)\r\n\tif err != nil {\r\n\t\treturn shim.Error(baselogger.SError(\"Invoke convert sign(%s) failed. err=%s\", signBase64, err))\r\n\t}\r\n\tif len(sign) == 0 {\r\n\t\treturn shim.Error(baselogger.SError(\"Invoke can not get signature.\"))\r\n\t}\r\n\r\n\tvar invokeFixArgs BaseInvokeArgs\r\n\tinvokeFixArgs.FixedArgCount = fixedArgCount\r\n\tinvokeFixArgs.UserName = userName\r\n\tinvokeFixArgs.AccountName = accName\r\n\tinvokeFixArgs.InvokeTime = invokeTime\r\n\r\n\t//客户端签名的生成: 把函数名和输入的参数用\",\"拼接为字符串,然后计算其Sha256作为msg,然后用私钥对msg做签名。所以这里用同样的方法生成msg\r\n\tvar allArgsString = function + \",\" + strings.Join(args[:len(args)-1], \",\") //不包括签名本身\r\n\tmsg, err := baseCrypto.Sha256([]byte(allArgsString))\r\n\tif err != nil {\r\n\t\treturn shim.Error(baselogger.SError(\"Invoke get sign-msg failed. err=%s\", err))\r\n\t}\r\n\tbaselogger.Debug(\"allArgsString =%s\", allArgsString)\r\n\tbaselogger.Debug(\"sign-msg =%v\", msg)\r\n\r\n\tvar accountEnt *AccountEntity = nil\r\n\r\n\t//开户时验证在客户函数中做\r\n\tif function != \"account\" && function != \"accountCB\" {\r\n\r\n\t\taccountEnt, err = b.getAccountEntity(stub, accName)\r\n\t\tif err != nil {\r\n\t\t\t//查询函数和invoke函数走的一个入口, 所以查询接口的几个特殊处理放在这里\r\n\t\t\tif err == ErrNilEntity {\r\n\t\t\t\tif function == \"isAccExists\" { //如果是查询账户是否存在,如果是空,返回不存在\r\n\t\t\t\t\treturn shim.Success([]byte(\"0\"))\r\n\t\t\t\t} else if function == \"getBalance\" { //如果是查询余额,如果账户不存,返回0\r\n\t\t\t\t\treturn shim.Success([]byte(\"0\"))\r\n\t\t\t\t} else if function == \"transPreCheck\" { //如果是转账预检查,返回付款账户不存在\r\n\t\t\t\t\treturn shim.Success([]byte(strconv.FormatInt(ERRCODE_TRANS_PAY_ACCOUNT_NOT_EXIST, 10)))\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke getAccountEntity failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\t//非account时签名为最后一个参数\r\n\t\tsign, msg, err := b.getSignAndMsg(stub, len(args)-1)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke: getSignAndMsg(%s) failed, err=%s.\", accName, err))\r\n\t\t}\r\n\r\n\t\t//校验修改Entity的用户身份,只有Entity的所有者才能修改自己的Entity\r\n\t\tif err = b.verifyIdentity(stub, userName, sign, msg, accountEnt.OwnerPubKeyHash, accountEnt.OwnerIdentityHash, accountEnt); err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke: verifyIdentity(%s) failed.\", accName))\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tinvokeFixArgs.AccountEnt = accountEnt\r\n\r\n\tif function == \"account\" {\r\n\t\tbaselogger.Debug(\"Enter account\")\r\n\t\tvar usrType int\r\n\r\n\t\t//args:[usrname, accname, pubkey, signature, userIdentity]\r\n\t\t//因为userIdentity是平台自动添加的,而签名是在客户端做的,所以把userIdentity放在最后\r\n\r\n\t\tvar argCount = fixedArgCount + 3\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(fmt.Sprintf(\"Invoke(account) miss arg, got %d, at least need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar userPubKeyHash = args[fixedArgCount] //base64\r\n\t\tvar userIdHash = args[len(args)-1] //base64\r\n\r\n\t\t//签名为倒数第二个参数\r\n\t\tsign, msg, err := b.getSignAndMsg(stub, len(args)-2)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(account): getSignAndMsg(%s) failed, err=%s.\", accName, err))\r\n\t\t}\r\n\t\t//校验修改Entity的用户身份,只有Entity的所有者才能修改自己的Entity\r\n\t\tif err = b.verifyIdentity(stub, userName, sign, msg, userPubKeyHash, userIdHash, nil); err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(account) verifyIdentity(%s) failed.\", accName))\r\n\t\t}\r\n\r\n\t\t_, err = b.newAccount(stub, accName, usrType, userName, userIdHash, userPubKeyHash, invokeTime, false)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(account) newAccount failed. err=%s\", err))\r\n\t\t}\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"accountCB\" {\r\n\t\tbaselogger.Debug(\"Enter accountCB\")\r\n\t\tvar usrType int = 0\r\n\r\n\t\t//args:[usrname, accname, pubkey, signature, userIdentity]\r\n\t\t//因为userIdentity是平台自动添加的,而签名是在客户端做的,所以把userIdentity放在最后\r\n\r\n\t\tvar argCount = fixedArgCount + 3\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(fmt.Sprintf(\"Invoke(account) miss arg, got %d, at least need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar userPubKeyHash = args[fixedArgCount] //base64\r\n\t\tvar userIdHash = args[len(args)-1] //base64\r\n\r\n\t\t//签名为倒数第二个参数\r\n\t\tsign, msg, err := b.getSignAndMsg(stub, len(args)-2)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(account): getSignAndMsg(%s) failed, err=%s.\", accName, err))\r\n\t\t}\r\n\r\n\t\t//校验修改Entity的用户身份,只有Entity的所有者才能修改自己的Entity\r\n\t\tif err = b.verifyIdentity(stub, userName, sign, msg, userPubKeyHash, userIdHash, nil); err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(accountCB) verifyIdentity(%s) failed.\", accName))\r\n\t\t}\r\n\r\n\t\ttmpByte, err := b.getCenterBankAcc(stub)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(accountCB) getCenterBankAcc failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\t//如果央行账户已存在,报错\r\n\t\tif tmpByte != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(accountCB) CBaccount(%s) exists.\", string(tmpByte)))\r\n\t\t}\r\n\r\n\t\t_, err = b.newAccount(stub, accName, usrType, userName, userIdHash, userPubKeyHash, invokeTime, true)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(accountCB) openAccount failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\terr = b.setCenterBankAcc(stub, accName)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(accountCB) setCenterBankAcc failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"issue\" {\r\n\t\tbaselogger.Debug(\"Enter issue\")\r\n\r\n\t\tvar argCount = fixedArgCount + 1\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(issue) miss arg, got %d, at least need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar issueAmount int64\r\n\t\tissueAmount, err = strconv.ParseInt(args[fixedArgCount], 0, 64)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(issue) convert issueAmount(%s) failed. err=%s\", args[fixedArgCount], err))\r\n\t\t}\r\n\t\tbaselogger.Debug(\"issueAmount= %+v\", issueAmount)\r\n\r\n\t\ttmpByte, err := b.getCenterBankAcc(stub)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(issue) getCenterBankAcc failed. err=%s\", err))\r\n\t\t}\r\n\t\t//如果没有央行账户,报错。否则校验账户是否一致。\r\n\t\tif tmpByte == nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(issue) getCenterBankAcc nil.\"))\r\n\t\t} else {\r\n\t\t\tif accName != string(tmpByte) {\r\n\t\t\t\treturn shim.Error(baselogger.SError(\"Invoke(issue) centerBank account is %s, can't issue to %s.\", string(tmpByte), accName))\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_, err = b.issueCoin(stub, accName, issueAmount, invokeTime)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(issue) issueCoin failed. err=%s\", err))\r\n\t\t}\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"transefer\" {\r\n\t\tvar argCount = fixedArgCount + 2\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transefer) miss arg, got %d, at least need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar toAcc = args[fixedArgCount]\r\n\r\n\t\tvar transAmount int64\r\n\t\ttransAmount, err = strconv.ParseInt(args[fixedArgCount+1], 0, 64)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transefer): convert issueAmount(%s) failed. err=%s\", args[fixedArgCount+1], err))\r\n\t\t}\r\n\t\tbaselogger.Debug(\"transAmount= %+v\", transAmount)\r\n\r\n\t\t//以下为可选参数\r\n\t\tvar description string\r\n\t\tvar transType string\r\n\t\tvar sameEntSaveTransFlag bool = false\r\n\r\n\t\tif len(args) > argCount {\r\n\t\t\tdescription = args[argCount]\r\n\t\t}\r\n\t\tif len(args) > argCount+1 {\r\n\t\t\ttransType = args[argCount+1]\r\n\t\t}\r\n\t\tif len(args) > argCount+2 {\r\n\t\t\tvar sameEntSaveTrans = args[argCount+2] //如果转出和转入账户相同,是否记录交易 0表示不记录 1表示记录\r\n\t\t\tif sameEntSaveTrans == \"1\" {\r\n\t\t\t\tsameEntSaveTransFlag = true\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_, err = b.transferCoin(stub, accName, toAcc, transType, description, transAmount, invokeTime, sameEntSaveTransFlag)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transefer) transferCoin failed. err=%s\", err))\r\n\t\t}\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"transefer3\" { //带锁定期功能\r\n\t\tvar argCount = fixedArgCount + 3\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transeferLockAmt) miss arg, got %d, at least need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar toAcc = args[fixedArgCount]\r\n\r\n\t\tvar transAmount int64\r\n\t\ttransAmount, err = strconv.ParseInt(args[fixedArgCount+1], 0, 64)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transeferLockAmt): convert issueAmount(%s) failed. err=%s\", args[fixedArgCount+1], err))\r\n\t\t}\r\n\r\n\t\tvar lockCfgs = args[fixedArgCount+2]\r\n\r\n\t\t//以下为可选参数\r\n\t\tvar description string\r\n\t\tvar transType string\r\n\t\tvar sameEntSaveTransFlag bool = false\r\n\r\n\t\tif len(args) > argCount {\r\n\t\t\tdescription = args[argCount]\r\n\t\t}\r\n\t\tif len(args) > argCount+1 {\r\n\t\t\ttransType = args[argCount+1]\r\n\t\t}\r\n\t\tif len(args) > argCount+2 {\r\n\t\t\tvar sameEntSaveTrans = args[argCount+2] //如果转出和转入账户相同,是否记录交易 0表示不记录 1表示记录\r\n\t\t\tif sameEntSaveTrans == \"1\" {\r\n\t\t\t\tsameEntSaveTransFlag = true\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar lockedThistime int64 = 0\r\n\t\tlockedThistime, _, err = b.setAccountLockAmountCfg(stub, toAcc, lockCfgs, false)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transeferLockAmt): setAccountLockAmountCfg failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\tif lockedThistime > transAmount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transeferLockAmt): lockAmt(%d) > transAmount(%d).\", lockedThistime, transAmount))\r\n\t\t}\r\n\r\n\t\t_, err = b.transferCoin(stub, accName, toAcc, transType, description, transAmount, invokeTime, sameEntSaveTransFlag)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(transeferLockAmt) transferCoin3 failed. err=%s\", err))\r\n\t\t}\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"updateEnv\" {\r\n\t\t//更新环境变量\r\n\t\tif !b.isAdmin(stub, accName) {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(updateEnv) can't exec updateEnv by %s.\", accName))\r\n\t\t}\r\n\r\n\t\tvar argCount = fixedArgCount + 2\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(updateEnv) miss arg, got %d, at least need %d.\", len(args), argCount))\r\n\t\t}\r\n\t\tkey := args[fixedArgCount]\r\n\t\tvalue := args[fixedArgCount+1]\r\n\r\n\t\tif key == \"logLevel\" {\r\n\t\t\tlvl, _ := strconv.Atoi(value)\r\n\t\t\t// debug=5, info=4, notice=3, warning=2, error=1, critical=0\r\n\t\t\tvar loggerSet = baselogger.GetLoggers()\r\n\t\t\tfor _, l := range loggerSet {\r\n\t\t\t\tl.SetDefaultLvl(shim.LoggingLevel(lvl))\r\n\t\t\t}\r\n\r\n\t\t\tbaselogger.Info(\"set logLevel to %d.\", lvl)\r\n\t\t}\r\n\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"updateState\" {\r\n\t\tif !b.isAdmin(stub, accName) {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(setWorldState) can't exec by %s.\", accName))\r\n\t\t}\r\n\r\n\t\tvar argCount = fixedArgCount + 4\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"setWorldState miss arg, got %d, need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar fileName = args[fixedArgCount]\r\n\t\tvar needHash = false\r\n\t\tif args[fixedArgCount+1] == \"1\" {\r\n\t\t\tneedHash = true\r\n\t\t}\r\n\t\tvar sameKeyOverwrite = false //相同的key是否覆盖\r\n\t\tif args[fixedArgCount+2] == \"1\" {\r\n\t\t\tsameKeyOverwrite = true\r\n\t\t}\r\n\r\n\t\tvar srcCcid = args[fixedArgCount+3]\r\n\r\n\t\t_, err = b.loadWorldState(stub, fileName, needHash, sameKeyOverwrite, srcCcid)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(setWorldState) setWorldState failed. err=%s\", err))\r\n\t\t}\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"lockAccAmt\" {\r\n\t\tif !b.isAdmin(stub, accName) {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(lockAccAmt) can't exec by %s.\", accName))\r\n\t\t}\r\n\r\n\t\tvar argCount = fixedArgCount + 4\r\n\t\tif len(args) < argCount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(lockAccAmt) miss arg, got %d, need %d.\", len(args), argCount))\r\n\t\t}\r\n\r\n\t\tvar lockedAccName = args[fixedArgCount]\r\n\t\tvar lockCfgs = args[fixedArgCount+1]\r\n\r\n\t\tvar overwriteOld = false //是否覆盖已有记录\r\n\t\tif args[fixedArgCount+2] == \"1\" {\r\n\t\t\toverwriteOld = true\r\n\t\t}\r\n\r\n\t\tvar canLockMoreThanRest = false //是否可以锁定比剩余额度多的额度\r\n\t\tif args[fixedArgCount+3] == \"1\" {\r\n\t\t\tcanLockMoreThanRest = true\r\n\t\t}\r\n\r\n\t\tlockEnt, err := b.getAccountEntity(stub, lockedAccName)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(lockAccAmt): getAccountEntity failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\t_, lockedTotal, err := b.setAccountLockAmountCfg(stub, lockedAccName, lockCfgs, overwriteOld)\r\n\t\tif err != nil {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(lockAccAmt): setAccountLockAmountCfg failed. err=%s\", err))\r\n\t\t}\r\n\r\n\t\tif !canLockMoreThanRest && lockedTotal > lockEnt.RestAmount {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(lockAccAmt): lock amount > account rest(%d,%d).\", lockedTotal, lockEnt.RestAmount))\r\n\t\t}\r\n\r\n\t\treturn shim.Success(nil)\r\n\r\n\t} else if function == \"recharge\" { //测试链才有\r\n\t\tif Ctrl_isTestChain {\r\n\t\t\tvar argCount = fixedArgCount + 1\r\n\t\t\tif len(args) < argCount {\r\n\t\t\t\treturn shim.Error(baselogger.SError(\"Invoke(lockAccAmt) miss arg, got %d, need %d.\", len(args), argCount))\r\n\t\t\t}\r\n\r\n\t\t\tvar rechargeAmount int64\r\n\t\t\trechargeAmount, err = strconv.ParseInt(args[fixedArgCount], 0, 64)\r\n\t\t\tif err != nil {\r\n\t\t\t\treturn shim.Error(baselogger.SError(\"Invoke(recharge): convert rechargeAmount(%s) failed. err=%s\", args[fixedArgCount], err))\r\n\t\t\t}\r\n\r\n\t\t\taccountEnt.TotalAmount = rechargeAmount\r\n\t\t\taccountEnt.RestAmount = rechargeAmount\r\n\r\n\t\t\terr = b.setAccountEntity(stub, accountEnt)\r\n\t\t\tif err != nil {\r\n\t\t\t\treturn shim.Error(baselogger.SError(\"Invoke(recharge): save account failed. err=%s\", err))\r\n\t\t\t}\r\n\r\n\t\t\treturn shim.Success(nil)\r\n\t\t} else {\r\n\t\t\treturn shim.Error(baselogger.SError(\"Invoke(recharge): can not run this function.\"))\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\tretValue, err := b.Query(stub, &invokeFixArgs)\r\n\r\n\t\tif err != nil {\r\n\t\t\t//如果是因为没找到处理函数,尝试在扩展模块中查找\r\n\t\t\tif err == ErrUnregistedFun {\r\n\t\t\t\t//如果没有扩展处理模块,直接返回错误\r\n\t\t\t\tif InvokeHook == nil {\r\n\t\t\t\t\treturn shim.Error(baselogger.SError(\"unknown function:%s.\", function))\r\n\t\t\t\t}\r\n\r\n\t\t\t\tretBytes, err := InvokeHook(stub, &invokeFixArgs)\r\n\t\t\t\tif err != nil {\r\n\t\t\t\t\treturn shim.Error(err.Error())\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn shim.Success(retBytes)\r\n\t\t\t}\r\n\r\n\t\t\treturn shim.Error(err.Error())\r\n\t\t}\r\n\r\n\t\treturn shim.Success(retValue)\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "b0dacce0ab35837bbf1aaea816043304", "score": "0.49513257", "text": "func (t *policyChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\n\t//get adminCert\n\tcallerCert := args[0]\n\tadminCertRaw, err := stub.GetState(\"admin\")\n\tif err != nil {\n\t\treturn nil, errors.New(\"GetState('admin') returned an error, Invoke call aborted.\")\n\t}\n\tadminCert := string(adminCertRaw)\n\tif callerCert != adminCert {\n\t\treturn nil, errors.New(\"Caller is not admin. Aborting invoke call.\")\n\t}\n\tif err != nil {\n\t\treturn nil, errors.New(\"Failed checking admin certificate.\")\n\t}\n\tswitch function {\n\t\t//This case is executed when the recieved function is removePolicy\n case \"removePolicy\":\n\t\t//The removePolicy function only takes one argument, certificate of the user as a string in arg[1].\n \tif len(args) != 2 {\n return nil, errors.New(\"Wrong number of arguments for function \" + function + \", expected 1 but recieved \" + string(len(args)) + \".\")\n }\n\t\tfmt.Println(\"Deleting policy for user: \" + args[1] + \".\")\n\t\t//Delete the policy for user in argument\n stub.PutState(args[2], nil)\n case \"addPolicy\":\n\t\tif len(args) != 3 {\n\t\t\treturn nil, errors.New(\"Wrong number of arguments for function \" + function + \", expected 1 but recieved \" + string(len(args)) + \".\")\n\t\t}\n\t\t//addPolicy takes the certificate of the user as a string in arg[1] and the policy as string encoded JSON in arg[2].\n\t\tfmt.Println(\"This is what arg[0] looks like: \" + args[1])\n\t\tfmt.Println(\"Inserting new policy\")\n err = stub.PutState(args[1], []byte(args[2]))\n if err != nil {\n return nil, errors.New(\"Error occurred when trying to PutState(\" + args[1] + \", \" + args[2] + \").\")\n }\n default:\n return nil, errors.New(\"Function: \" + function + \" was not found.\")\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "2467f28b08a6679574864a5ced949292", "score": "0.49439418", "text": "func (t *InsuranceChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\tcaller, caller_affiliation, _ := t.get_caller_data(stub)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"addPolicy\" {\n\t\treturn t.addPolicy(stub, caller, caller_affiliation, args)\n\t} else if function == \"createClaim\" {\n\t\treturn t.createClaim(stub, caller, caller_affiliation, args)\n\t} else if function == \"declareLiability\" {\n\t\treturn t.declareLiability(stub, caller, caller_affiliation, args)\n\t} else if function == \"addPoliceReport\" {\n\t\t//TODO\n\t} else if function == \"addGarageReport\" {\n\t\treturn t.addGarageReport(stub, caller, caller_affiliation, args)\n\t} else if function == \"confirmWork\" {\n\t\t//TODO\n\t} else if function == \"agreePayoutAmount\" {\n\t\treturn t.agreePayoutAmount(stub, caller, caller_affiliation, args)\n\t} else if function == \"vehicleValueOracleCallback\" {\n\t\tfmt.Printf(\"vehicleValueOracleCallback: ReqeustId / Value\" + args[0] + \" / \" + args[1]);\n\t\treturn t.vehicleValueOracleCallback(stub, caller, caller_affiliation, args)\n\t} else if function == \"confirmPaidOut\" {\n\t\treturn t.confirmPaidOut(stub, caller, caller_affiliation, args)\n\t} else if function == \"closeClaim\" {\n\t\treturn t.closeClaim(stub, caller, caller_affiliation, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "13bf4450e5dcfbd8ac7811c6a4bae83c", "score": "0.49409944", "text": "func VerifyInvocation(ctx context.Context, id invocations.ID, permissions ...realms.Permission) error {\n\treturn VerifyInvocations(ctx, invocations.NewIDSet(id), permissions...)\n}", "title": "" }, { "docid": "801339c056df0fe0d274eb3286c9949d", "score": "0.49192607", "text": "func (a DummyAuthorizator) Authorize(user, pass string) bool {\n\treturn true\n}", "title": "" }, { "docid": "bc390a065f83aa731971d90e15937741", "score": "0.4916904", "text": "func (t *CommonChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfn, params := stub.GetFunctionAndParameters()\n\t\n\tfmt.Println(\"Enter,\", \"fn\", fn, \"params\", params)\n\t\n\tswitch fn {\n\tcase \"rawInsert\":\n\t\treturn rawInsert(stub, params)\n\tcase \"rawListInsert\":\n\t\treturn rawListInsert(stub, params)\n\tcase \"rawUpdate\":\n\t\treturn rawUpdate(stub, params)\n\tcase \"rawDelete\":\n\t\treturn rawDelete(stub, params)\n\tcase \"rawSelect\":\n\t\treturn rawSelect(stub, params)\n\tcase \"rawListSelect\":\n\t\treturn rawListSelect(stub, params)\n\tcase \"rawHistory\":\n\t\treturn rawHistory(stub, params)\n\t}\n\t\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "9d101a96624db30b233704c216385f50", "score": "0.49157938", "text": "func (cmd PolicyAuthorize) Execute(t transport.TPM, s ...Session) (*PolicyAuthorizeResponse, error) {\n\tvar rsp PolicyAuthorizeResponse\n\terr := execute[PolicyAuthorizeResponse](t, cmd, &rsp, s...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &rsp, nil\n}", "title": "" }, { "docid": "10f59174a43c82472e1054744cd2febc", "score": "0.49121442", "text": "func (f *PermsStoreAuthorizeFunc) SetDefaultReturn(r0 bool) {\n\tf.SetDefaultHook(func(context.Context, int64, int64, AccessMode, AccessModeOptions) bool {\n\t\treturn r0\n\t})\n}", "title": "" }, { "docid": "f50e9c33c361a7b591e22b8422a583b5", "score": "0.48907375", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"registerUser\" { //create a new user\n\t\treturn t.registerUser(stub, args)\n\t} else if function == \"query\" {\n\t\treturn t.query(stub, args) // to get value for key\n\t} else {\n\t\tfmt.Println(\"invoke did not find func: \" + function) //error\n\t\treturn shim.Error(\"Received unknown function invocation\")\n\t}\n\n}", "title": "" }, { "docid": "5603163dca48c4e92e8782cb3b393bcb", "score": "0.48871452", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n fmt.Println(\"invoke is running \" + function)\n\n // Handle different functions\n if function == \"init\" {\n return t.Init(stub, \"init\", args)\n } else if function == \"upsertAppointment\" { \n return t.upsertAppointment(stub, args)\n }\n\n fmt.Println(\"invoke did not find func: \" + function)\n\n return nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "5bc181c2137a92728502945a919a9d29", "score": "0.48797423", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\taction := args[0]\n\tfmt.Println(\"invoke action \" + action)\n\tfmt.Println(args)\n\tif action == \"init\" { //initialize the chaincode state, used as reset\n\t\treturn t.Init(stub)\n\t} else if action == \"commit\" {\n\t\treturn t.EventHandler(stub, args)\n\t} else if action == \"commitPrivate\" {\n\t\treturn t.EventHandlerPrivate(stub, args)\n\t} else if action == \"readPrivate\" {\n\t\treturn t.readUserPrivateDetails(stub, args)\n\t} else if action == \"query\" {\n\t\treturn t.Query(stub, args)\n\t} else if action == \"queryPrivate\" {\n\t\treturn t.QueryPrivate(stub, args)\n\t} else if action == \"audit\" {\n\t\treturn t.AuditEventHandler(stub, args)\n\t} else if action == \"upload\" {\n\t\treturn t.UploadEventHandler(stub, args)\n\t} else if action == \"modify\" {\n\t\treturn t.ModifyEventHandler(stub, args)\n\t} else if action == \"claim\" {\n\t\treturn t.ClaimEventHandler(stub, args)\n\t} else if action == \"authenticate\" {\n\t\treturn t.AuthenticateEventHandler(stub, args)\n\t} else if action == \"delete\" {\n\t\treturn t.DeleteEventHandler(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + action) //error\n\n\treturn shim.Error(\"Received unknown function\")\n}", "title": "" }, { "docid": "406ef3c12165c63e17867b22ec575f44", "score": "0.48688155", "text": "func (t *GuavaChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" { //initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"create_account\" { //create a new account\n\n\t\treturn t.create_account(stub, args)\n\t} else if function == \"create_transfer\" { //create a new transfer\n\n\t\treturn t.create_transfer(stub, args)\n\t} else if function == \"increment_value\" { //increment balance for an account\n\n\t\treturn t.increment_value(stub, args)\n\t} else if function == \"decrement_value\" { //decrement balance for an account\n\n\t\treturn t.decrement_value(stub, args)\n\t} else if function == \"accept_transfer\" { //accept a pending open transfer\n\n\t\treturn t.accept_transfer(stub, args)\n\t} else if function == \"reject_transfer\" { //reject a pending open transfer\n\n\t\treturn t.reject_transfer(stub, args)\n\t} else if function == \"create_user\" {\n\n\t\treturn t.create_user(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error invoke function not found\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "adbb515c539a5724ee252dfc176e9b43", "score": "0.48671126", "text": "func (_f8 *FakeAuthorizer) AuthorizeCalledOnceWith(ident1 context.Context, ident2 *httpx.Request) bool {\n\tvar count int\n\tfor _, call := range _f8.AuthorizeCalls {\n\t\tif reflect.DeepEqual(call.Parameters.Ident1, ident1) && reflect.DeepEqual(call.Parameters.Ident2, ident2) {\n\t\t\tcount++\n\t\t}\n\t}\n\n\treturn count == 1\n}", "title": "" }, { "docid": "8f6322c3894adf800be66f1c76e7f26a", "score": "0.4865506", "text": "func (f *Filter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {\n\tcmdName := fmt.Sprintf(\"%s&method=%s\", invoker.GetURL().Key(), invocation.MethodName())\n\n\t// Do the configuration if the circuit breaker is created for the first time\n\tif _, load := f.ifNewMap.LoadOrStore(cmdName, true); !load {\n\t\tconfigLoadMutex.Lock()\n\t\tfilterConf := getConfig(invoker.GetURL().Service(), invocation.MethodName(), f.COrP)\n\t\tfor _, ptn := range filterConf.Error {\n\t\t\treg, err := regexp.Compile(ptn)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Warnf(\"[Hystrix Filter]Errors occurred parsing error omit regexp: %s, %v\", ptn, err)\n\t\t\t} else {\n\t\t\t\tif f.res == nil {\n\t\t\t\t\tf.res = make(map[string][]*regexp.Regexp)\n\t\t\t\t}\n\t\t\t\tf.res[invocation.MethodName()] = append(f.res[invocation.MethodName()], reg)\n\t\t\t}\n\t\t}\n\t\thystrix.ConfigureCommand(cmdName, hystrix.CommandConfig{\n\t\t\tTimeout: filterConf.Timeout,\n\t\t\tMaxConcurrentRequests: filterConf.MaxConcurrentRequests,\n\t\t\tSleepWindow: filterConf.SleepWindow,\n\t\t\tErrorPercentThreshold: filterConf.ErrorPercentThreshold,\n\t\t\tRequestVolumeThreshold: filterConf.RequestVolumeThreshold,\n\t\t})\n\t\tconfigLoadMutex.Unlock()\n\t}\n\tconfigLoadMutex.RLock()\n\t_, _, err := hystrix.GetCircuit(cmdName)\n\tconfigLoadMutex.RUnlock()\n\tif err != nil {\n\t\tlogger.Errorf(\"[Hystrix Filter]Errors occurred getting circuit for %s , will invoke without hystrix, error is: %+v\", cmdName, err)\n\t\treturn invoker.Invoke(ctx, invocation)\n\t}\n\tlogger.Infof(\"[Hystrix Filter]Using hystrix filter: %s\", cmdName)\n\tvar result protocol.Result\n\t_ = hystrix.Do(cmdName, func() error {\n\t\tresult = invoker.Invoke(ctx, invocation)\n\t\terr := result.Error()\n\t\tif err != nil {\n\t\t\tresult.SetError(NewHystrixFilterError(err, false))\n\t\t\tfor _, reg := range f.res[invocation.MethodName()] {\n\t\t\t\tif reg.MatchString(err.Error()) {\n\t\t\t\t\tlogger.Debugf(\"[Hystrix Filter]Error in invocation but omitted in circuit breaker: %v; %s\", err, cmdName)\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}, func(err error) error {\n\t\t// Return error and if it is caused by hystrix logic, so that it can be handled by previous filters.\n\t\t_, ok := err.(hystrix.CircuitError)\n\t\tlogger.Debugf(\"[Hystrix Filter]Hystrix health check counted, error is: %v, failed by hystrix: %v; %s\", err, ok, cmdName)\n\t\tresult = &protocol.RPCResult{}\n\t\tresult.SetResult(nil)\n\t\tresult.SetError(NewHystrixFilterError(err, ok))\n\t\treturn err\n\t})\n\treturn result\n}", "title": "" }, { "docid": "0a38c335ed5c68b2ad363223292a865f", "score": "0.48537457", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"enrollMilkFarm\" { // create a new Milk-Farm with initialisation\n\t\treturn t.enrollMilkFarm(stub, args)\n\t} else if function == \"readMilkFarm\" { // read Milk-Farm \n\t\treturn t.readMilkFarm(stub, args)\n\t} else if function == \"enrollChillingAndProccessingUnit\" { // read Milk-Farm \n\t\treturn t.enrollChillingAndProccessingUnit(stub, args)\n\t} else if function == \"readChillingAndProccessingUnit\" { // read Milk-Farm \n\t\treturn t.readChillingAndProccessingUnit(stub, args)\n\t} else if function == \"enrollPackagingUnit\" { // read Milk-Farm \n\t\treturn t.enrollPackagingUnit(stub, args)\n\t} else if function == \"readPackagingUnit\" { // read Milk-Farm \n\t\treturn t.readPackagingUnit(stub, args)\n\t} else if function == \"enrollFreight\" { // read Milk-Farm \n\t\treturn t.enrollFreight(stub, args)\n\t} else if function == \"readFreight\" { // read Milk-Farm \n\t\treturn t.readFreight(stub, args)\n\t} else if function == \"enrollMarket\" { // read Milk-Farm \n\t\treturn t.enrollMarket(stub, args)\n\t} else if function == \"readMarket\" { // read Milk-Farm \n\t\treturn t.readMarket(stub, args)\n\t} else if function == \"enrollConsumer\" { // read Milk-Farm \n\t\treturn t.enrollConsumer(stub, args)\n\t} else if function == \"readConsumer\" { // read Milk-Farm \n\t\treturn t.readConsumer(stub, args)\n\t} else if function == \"addBatch\" { // read Milk-Farm \n\t\treturn t.addBatch(stub, args)\n\t} else if function == \"readBatch\" { // read Milk-Farm \n\t\treturn t.readBatch(stub, args)\n\t} else if function == \"createProduct\" { // read Milk-Farm \n\t\treturn t.createProduct(stub, args)\n\t} else if function == \"readProduct\" { // read Milk-Farm \n\t\treturn t.readProduct(stub, args)\n\t} else if function == \"changeOwnershipProduct\" { // read Milk-Farm \n\t\treturn t.changeOwnershipProduct(stub, args)\n\t} else if function == \"changeOwnershipBatch\" { // read Milk-Farm \n\t\treturn t.changeOwnershipBatch(stub, args)\n\t} else if function == \"changeOwnershipBatch\" { // read Milk-Farm \n\t\treturn t.changeOwnershipBatch(stub, args)\n\t} else if function == \"getShipmentRecord\" { // read Milk-Farm \n\t\treturn t.getShipmentRecord(stub, args)\n\t} else if function == \"getHistoryForAsset\" { // read Milk-Farm \n\t\treturn t.getHistoryForAsset(stub, args)\n\t} else if function == \"readMilkFarmList\" { // read Milk-Farm \n\t\treturn t.readMilkFarmList(stub)\n\t} else if function == \"readConsumerList\" { // read Milk-Farm \n\t\treturn t.readConsumerList(stub, args)\n\t} \t\n\t\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "adf1fe56788a08aac85588b9a6205e94", "score": "0.48451906", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\r\n\tfunction, args := stub.GetFunctionAndParameters()\r\n\tfmt.Println(\"invoking all the methods for use \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"sendRenewal\" {\r\n\t\treturn t.sendRenewal(stub, args)\r\n\t} else if function == \"updateRenewal\" {\r\n\t\treturn t.updateRenewal(stub, args)\r\n\t} else if function == \"getAllRenewals\" {\r\n\t\treturn t.getAllRenewals(stub, args)\r\n\t} else if function == \"getAllRenewalsByState\" {\r\n\t\treturn t.getAllRenewalsByState(stub, args)\r\n\t} else if function == \"queryRenewal\" {\r\n\t\treturn t.queryRenewal(stub, args)\r\n\t} else if function == \"queryHistoryofRenewal\" {\r\n\t\treturn t.queryHistoryofRenewal(stub, args)\r\n\t} else if function == \"respondRenewal\" {\r\n\t\treturn t.respondRenewal(stub, args)\r\n\t}\r\n\r\n\tfmt.Println(\"invoke did not find func: \" + function) //error\r\n\treturn shim.Error(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "6fa3cd962617292ae61f281d27ab0051", "score": "0.48402148", "text": "func (f_sym65 *FakeTransactionRepo) SetUpdateInvocation(calls_sym65 []*TransactionRepoUpdateInvocation, fallback_sym65 func() error) {\n\tf_sym65.UpdateHook = func(ident1 *model.Transaction) (ident2 error) {\n\t\tfor _, call_sym65 := range calls_sym65 {\n\t\t\tif reflect.DeepEqual(call_sym65.Parameters.Ident1, ident1) {\n\t\t\t\tident2 = call_sym65.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym65()\n\t}\n}", "title": "" }, { "docid": "366925314e0e5e30da22cbab304e3a56", "score": "0.48349136", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\t//fmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"signup\" { //create a new User\n\t\treturn t.signup(stub, args)\n\t\t// } else if function == \"initUser\" { //read a User\n\t\t// \treturn t.siginitUsernup(stub, args)\n\t} else if function == \"readUser\" { //read a User\n\t\treturn t.readUser(stub, args)\n\t\t// } else if function == \"readallUsers\" { //read a User\n\t\t// \treturn t.readallUsers(stub)\n\t} else if function == \"deleteUser\" {\n\t\treturn t.deleteUser(stub, args)\n\t} else if function == \"getHistoryForUser\" {\n return t.getHistoryForUser(stub,args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "09e8c4a32a2737877e8b4fc6784a64a2", "score": "0.4829231", "text": "func (t *AutomoitiveChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tif function == \"registerProduct\" {\n\t\treturn t.registerProduct(stub, args)\n\t}\n\n\tif function == \"transferProduct\" {\n\t\treturn t.transferProduct(stub, args)\n\t}\n\n\tif function == \"searchProduct\" {\n\t\treturn t.searchProduct(stub, args)\n\t}\n\n\treturn shim.Error(\"Error invoking function\")\n}", "title": "" }, { "docid": "43ae9af91763b755f8899b7fc2683ba9", "score": "0.48282713", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfmt.Println(\"########### example_cc Invoke ###########\")\n\tfunction, args := stub.GetFunctionAndParameters()\n\n\tif function != \"invoke\" {\n\t\treturn shim.Error(\"Unknown function call\")\n\t}\n\n\tif len(args) < 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting at least 2\")\n\t}\n\n\tif args[0] == \"delete\" {\n\t\t// Deletes an entity from its state\n\t\treturn t.delete(stub, args)\n\t}\n\n\tif args[0] == \"query\" {\n\t\t// queries an entity state\n\t\treturn t.query(stub, args)\n\t}\n\tif args[0] == \"move\" {\n\t\t// Deletes an entity from its state\n\t\treturn t.move(stub, args)\n\t}\n\tif args[0] == \"addUser\" {\n\t\treturn t.addUser(stub, args)\n\t}\n\tif args[0] == \"newQuery\" {\n\t\treturn t.newQuery(stub, args)\n\t}\n\tif args[0] == \"addNewActivePollToUser\" {\n\t\treturn t.addNewActivePollToUser(stub, args)\n\t}\n\tif args[0] == \"activeToInactivePoll\" {\n\t\treturn t.activeToInactivePoll(stub, args)\n\t}\n\tif args[0] == \"addNewPoll\" {\n\t\treturn t.addNewPoll(stub, args)\n\t}\n\tif args[0] == \"vote\" {\n\t\treturn t.vote(stub, args)\n\t}\n\tif args[0] == \"changeStatusToZero\" {\n\t\treturn t.changeStatusToZero(stub, args)\n\t}\n\tif args[0] == \"addNewActivePollToManyUsers\"{\n return t.addNewActivePollToManyUsers(stub,args)\n }\n\treturn shim.Error(\"Unknown action, check the first argument, must be one of 'delete', 'query', or 'move'\")\n}", "title": "" }, { "docid": "64f34d446bfca7b399ae9edd4684a796", "score": "0.48221073", "text": "func (c *Charity) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\r\n\tfuncName, args := stub.GetFunctionAndParameters()\r\n\tswitch funcName {\r\n\tcase \"userRegister\":\r\n\t\treturn userRegister(stub, args)\r\n\tcase \"LogIn\":\r\n\t\treturn logIn(stub, args)\r\n\tcase \"applyforHelp\":\r\n\t\treturn applyforHelp(stub, args)\r\n\tcase \"queryUncheckedHelp\":\r\n\t\treturn queryUncheckedHelp(stub, args)\r\n\tcase \"checkHelp\":\r\n\t\treturn checkHelp(stub, args)\r\n\tcase \"queryAllMyHelp\":\r\n\t\treturn queryAllMyHelp(stub, args)\r\n\tcase \"queryAllHelp\":\r\n\t\treturn queryAllHelp(stub, args)\r\n\tcase \"queryAllMySupport\":\r\n\t\treturn queryAllMySupport(stub, args)\r\n\tcase \"supportTheHelp\":\r\n\t\treturn supportTheHelp(stub, args)\r\n\tcase \"addSupportLogi\":\r\n\t\treturn addSupportLogi(stub, args)\r\n\tcase \"addSupportPath\":\r\n\t\treturn addSupportPath(stub, args)\r\n\tcase \"queryAllSupportToTheHelp\":\r\n\t\treturn queryAllSupportToTheHelp(stub, args)\r\n\tcase \"adoptSupportToTheHelp\":\r\n\t\treturn adoptSupportToTheHelp(stub, args)\r\n\tdefault:\r\n\t\treturn shim.Error(fmt.Sprintf(\"unsupported function: %s\", funcName))\r\n\t}\r\n\treturn shim.Success(nil)\r\n}", "title": "" }, { "docid": "ec000e9007e5811823b6d8b2a7c27307", "score": "0.48193324", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\t// Handle different functions\n\tif function == \"addStudent\" { //add a Student\n\t\treturn t.addStudent(stub, args)\n\t} else if function == \"readStudent\" { //read a Student\n\t\treturn t.readStudent(stub, args)\n\t} else if function == \"addCert\" { //add a Certificate\n\t\treturn t.addCert(stub, args)\n\t} else if function == \"readCert\" { //read a Certificate\n\t\treturn t.readCert(stub, args)\n\t} else if function == \"transferCert\" { //transfer a Certificate\n\t\treturn t.transferCert(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "c977fe4390eaab22033900da5e56acc1", "score": "0.48154783", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tlogger.Info(\"########### example_cc0 Invoke ###########\")\n\n\tfunction, args := stub.GetFunctionAndParameters()\n\t\n\tif function == \"PayMoney\" {\n\t\treturn t.PayMoney(stub, args)\n\t}\n if function == \"Exchange\" {\n\t\treturn t.Exchange(stub, args)\n\t}\n\tif function == \"QueryTicket\" {\n\t\treturn t.QueryTicket(stub, args)\n\t}\n\tif function == \"CreateCustomerAccount\" {\n\t\treturn t.CreateCustomerAccount(stub, args)\n\t}\n\t\n\tlogger.Errorf(\"Unknown action, check the first argument, must be one of 'CreateCustomerAccount', 'PayMoney', 'Exchange', or 'QueryTicket'. But got: %v\", args[0])\n\treturn shim.Error(fmt.Sprintf(\"Unknown action, check the first argument, must be one of 'CreateCustomerAccount', 'PayMoney', 'Exchange', or 'QueryTicket'. But got: %v\", args[0]))\n}", "title": "" }, { "docid": "747914fba11a4a7a67351e07c7fbc334", "score": "0.48044834", "text": "func (stub *CustomMockStub) MockInvoke(uuid string, args [][]byte) pb.Response {\n\tstub.args = args\n\tstub.MockTransactionStart(uuid)\n\tres := stub.cc.Invoke(stub)\n\tstub.MockTransactionEnd(uuid)\n\treturn res\n}", "title": "" }, { "docid": "c37053ab1bb9b118c353f11b05b09d92", "score": "0.48039782", "text": "func (t *Sharing) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n function, args := stub.GetFunctionAndParameters()\n //fmt.Println(\"invoke is running \" + function)\n\n // Handle different functions\n if function == \"initSharing\" { //create a new data\n return t.initSharing(stub, args)\n } else if function == \"readSharing\" { //access a data\n return t.readSharing(stub, args)\n } else if function == \"updateSharing\" {\n return t.updateSharing(stub, args)\n } else if function == \"queryDataByOwner\" {\n return t.queryDataByOwner(stub, args)\n } else if function == \"delete\" { //delete a record\n return t.delete(stub, args)\n }\n\n fmt.Println(\"invoke did not find func: \" + function) //error\n return shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "1070e725e243afba7bea7bb651fd2afd", "score": "0.48031044", "text": "func (w *ServerInterfaceWrapper) Authorize(ctx echo.Context) error {\n\tvar err error\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.Authorize(ctx)\n\treturn err\n}", "title": "" }, { "docid": "cf53a5896ebeff8560459415c2c17efe", "score": "0.4797844", "text": "func (f_sym5 *Fakerepository) SetQueryInvocation(calls_sym5 []*repositoryQueryInvocation, fallback_sym5 func() ([]Record, error)) {\n\tf_sym5.QueryHook = func(name string, category string) (ident1 []Record, ident2 error) {\n\t\tfor _, call_sym5 := range calls_sym5 {\n\t\t\tif reflect.DeepEqual(call_sym5.Parameters.Name, name) && reflect.DeepEqual(call_sym5.Parameters.Category, category) {\n\t\t\t\tident1 = call_sym5.Results.Ident1\n\t\t\t\tident2 = call_sym5.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym5()\n\t}\n}", "title": "" }, { "docid": "fa78a68b4ebafc59e4e2a43cd4720a20", "score": "0.47967118", "text": "func (kyc *KYCChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n fmt.Println(\"invoke is running \" + function);\n\n if(function == \"updatePerson\"){\n return kyc.updatePerson(stub, args);\n } else if(function == \"createPerson\"){\n return kyc.createPerson(stub, args);\n }\n\n fmt.Println(\"invoke did not find func: \" + function);\n return nil, errors.New(\"Received unknown function invocation\");\n}", "title": "" }, { "docid": "5d83b41dd305382d1dafd2e136abe767", "score": "0.47938806", "text": "func (u *Usecase) Authorize(grantType string, authParam interface{}) error {\n\treturn nil\n}", "title": "" }, { "docid": "721539b670e6160250e1e4035041e2ee", "score": "0.47924653", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\" \")\n\tfmt.Println(\"starting invoke, for - \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" { //initialize the chaincode state, used as reset\n\t\treturn t.Init(stub)\n\t} else if function == \"read\" { //generic read ledger\n\t\treturn read(stub, args)\n\t} else if function == \"write\" { //generic writes to ledger\n\t\treturn write(stub, args)\n\t} else if function == \"delete_canine\" { //deletes a Canine from state\n\t\treturn delete_canine(stub, args)\n\t} else if function == \"init_canine\" { //create a new Canine\n\t\treturn init_canine(stub, args)\n\t} else if function == \"init_vet\" { //change owner of a Canine\n\t\treturn init_vet(stub, args)\n\t} else if function == \"set_owner\" { //change owner of a Canine\n\t\treturn set_owner(stub, args)\n\t} else if function == \"init_owner\"{ //create a new Canine owner\n\t\treturn init_owner(stub, args)\n\t} else if function == \"read_everything\"{ //read everything, (owners + Canines + companies)\n\t\treturn read_everything(stub)\n\t} else if function == \"getHistory\"{ //read history of a Canine (audit)\n\t\treturn getHistory(stub, args)\n\t} else if function == \"getCaninesByRange\"{ //read a bunch of Canines by start and stop id\n\t\treturn getCaninesByRange(stub, args)\n\t} else if function == \"disable_owner\"{ //disable a Canine owner from appearing on the UI\n\t\treturn disable_owner(stub, args)\n\t}\n\n\t// error out\n\tfmt.Println(\"Received unknown invoke function name - \" + function)\n\treturn shim.Error(\"Received unknown invoke function name - '\" + function + \"'\")\n}", "title": "" }, { "docid": "89736503209919513faf42f27d25ca89", "score": "0.47898", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\")\n\t} else if function == \"write\" {\n\t\treturn t.Write(stub, args)\n\t} else if function == \"deleteConsum\" {\n\t\treturn t.DeleteConsum(stub, args)\n\t} else if function == \"search\" {\n\t\treturn t.Search(stub, args)\n\t} else if function == \"Query\" { //read a variable\n\t\treturn t.Query(stub, args)\n\t} else if function == \"delecteConsumProd\" {\n\t\treturn t.DeleteConsProd(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "91e84b1de406d1b21fddd73f7b9ab99e", "score": "0.47871628", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\t//Extract function and args\n\tfn, args := stub.GetFunctionAndParameters()\n\n\tif fn == \"initOrganisations\" {\n\t\treturn t.initOrganisations(stub)\n\t} else if fn == \"initProducts\" {\n\t\treturn t.initProducts(stub)\n\t} else if fn == \"initStorageSpaces\" {\n\t\treturn t.initStorageSpaces(stub)\n\t} else if fn == \"queryByKey\" {\n\t\treturn t.queryByKey(stub, args)\n\t} else if fn == \"queryTestData\" {\n\t\treturn t.queryTestData(stub)\n\t} else if fn == \"createLot\" {\n\t\treturn t.createLot(stub, args)\n\t} else if fn == \"changeLot\" {\n\t\treturn t.changeLot(stub, args)\n\t} else if fn == \"aggregateLots\" {\n\t\treturn t.aggregateLots(stub, args)\n\t} else if fn == \"produceProduct\" {\n\t\treturn t.produceProduct(stub, args)\n\t} else if fn == \"removeQuantity\" {\n\t\treturn t.removeQuantity(stub, args)\n\t} else if fn == \"unloadLot\" {\n\t\treturn t.unloadLot(stub, args)\n\t} else if fn == \"changeStorageSpace\" {\n\t\treturn t.changeStorageSpace(stub, args)\n\t} else if fn == \"createProduct\" {\n\t\treturn t.createProduct(stub, args)\n\t} else if fn == \"createOrganisation\" {\n\t\treturn t.createOrganisation(stub, args)\n\t} else if fn == \"createStorageSpace\" {\n\t\treturn t.createStorageSpace(stub, args)\n\t}\n\n\treturn shim.Error(\"Invalid function name\")\n\n}", "title": "" }, { "docid": "98f930cee88f87715076c7ae9b45e440", "score": "0.4786648", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\r\n //authenticate the user\r\n //caller_ecert, caller_role, err := t.get_user_data(stub, args[0])\r\n //if checkErrors(err){return nil, err}\r\n\r\n // switch function {\r\n // case \"depositCash\":\r\n // return t.depositCash(stub, args)\r\n // case \"withdrawCash\":\r\n // return t.withdrawCash(stub, args)\r\n // case \"createTrade\":\r\n // return t.createTrade(stub, args)\r\n // case \"createAccount\":\r\n // return t.createAccount(stub, args)\r\n // case \"issueProperty\":\r\n // return t.issueProperty(stub, args)\r\n // case \"generateOffer\":\r\n // return t.generateOffer(stub, args)\r\n // case \"acceptOffer\":\r\n // return t.acceptOffer(stub, args)\r\n // default:\r\n // return nil, errors.New(\"Invalid function (\" + function + \") called\")\r\n // }\r\n if function == \"depositCash\" {\r\n return t.depositCash(stub, args) \r\n } else if function == \"withdrawCash\" {\r\n return t.withdrawCash(stub, args)\r\n } else if function == \"createTrade\" {\r\n return t.createTrade(stub, args) \r\n } else if function == \"createAccount\" {\r\n return t.createAccount(stub, args) \r\n } else if function == \"issueProperty\" {\r\n return t.issueProperty(stub, args)\r\n } else if function == \"generateOffer\" {\r\n return t.generateOffer(stub, args) \r\n } else if function == \"acceptOffer\" {\r\n return t.acceptOffer(stub, args)\r\n } else {\r\n return nil, errors.New(\"Invalid function (\" + function + \") called\") \r\n }\r\n\r\n}", "title": "" }, { "docid": "15dcfbe5b6cc9c9c2ec3a9f5ebf04bdd", "score": "0.47844672", "text": "func (f_sym5 *FakeImporter) SetScanInvocation(calls_sym5 []*ImporterScanInvocation, fallback_sym5 func() z.Reader) {\n\tf_sym5.ScanHook = func(ident1 *Scanner) (ident2 z.Reader) {\n\t\tfor _, call_sym5 := range calls_sym5 {\n\t\t\tif reflect.DeepEqual(call_sym5.Parameters.Ident1, ident1) {\n\t\t\t\tident2 = call_sym5.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym5()\n\t}\n}", "title": "" }, { "docid": "4099ff61ab914a2f03175bfab17538fa", "score": "0.47814095", "text": "func (p *AuthService) authorize(clientid string, username string, topic string, access int, opt *Options) error {\n\treturn nil\n}", "title": "" }, { "docid": "d2fd3bd818a6a5c720d291c8477f4f78", "score": "0.477675", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfmt.Println(\"########### example_cc Invoke ###########\")\n\targs := stub.GetStringArgs()\n\tif len(args) == 0 {\n\t\treturn shim.Error(\"Function not provided\")\n\t}\n\n\tfunction := args[0]\n\n\tif len(args) < 2 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting at least 2\")\n\t}\n\n\tif function == \"put\" {\n\t\treturn t.put(stub, args[1:])\n\t}\n\n\tif function == \"get\" {\n\t\treturn t.get(stub, args[1:])\n\t}\n\n\tif function == \"delete\" {\n\t\treturn t.delete(stub, args[1:])\n\t}\n\n\treturn shim.Error(fmt.Sprintf(\"Unknown function call: %s\", function))\n}", "title": "" }, { "docid": "e1b5a7b08165683c8e8d51287b024bec", "score": "0.47730166", "text": "func (i *Acct) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\n\treturn i.postacct(stub, args)\n\n}", "title": "" }, { "docid": "542463636c779d3ba8101c6e7f9ab70b", "score": "0.47679943", "text": "func (t *DNSChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"createAccount\" {\n\t\treturn t.createAccount(stub, args)\n\t}\n\n\tcheck, err := t.checkUserPrivKey(stub,args)\n\tif check == false || err != nil {\n\t\treturn nil, errors.New(\"Signed by wrong private key. I can smell something fishy, Error: \" + err.Error())\n\t}\n\n\t// Handle different functions\n\tif function == \"registerDomain\" {\n\t\treturn t.registerDomain(stub, args)\n\t} else if function == \"transferDomain\" {\n\t\treturn t.transferDomain(stub, args)\n\t} else if function == \"placeBid\" {\n\t\treturn t.placeBid(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find function: \" + function)\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "309fcf881c8413e88ec606cf22249ff5", "score": "0.47550285", "text": "func (t *CTS) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\r\n\r\n\tif function == \"registerAsset\" {\r\n\t\tt := CTS{}\r\n\t\treturn t.registerAsset(stub, args)\t\r\n\t} else if function == \"addDeleteMile\" { \r\n\t\tt := CTS{}\r\n\t\treturn t.addDeleteMile(stub, args)\r\n\t}\r\n\r\n\treturn nil, errors.New(\"Invalid invoke function name.\")\r\n\r\n}", "title": "" }, { "docid": "504d0bb4903b30c14bfab1ef8cb0a813", "score": "0.47513333", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n\tfmt.Printf(\"Invoke called, determining function\")\n\t\n\tt.bl.initObjects(stub) //for some reason the stub changes each call\n\t// Handle different functions\n\tif function == \"init\" {\n\t\tfmt.Printf(\"Function is init\")\n\t\treturn t.Init(stub, function, args)\n\t} else if function == \"ask\" || function == \"bid\" {\n\t\t// offers squares up for sale as initial public offering\n\t\tfmt.Printf(\"Function is trade\")\n\t\t\n\t\tif len(args) != 5 {\n\t\t\treturn nil, errors.New(\"Incorrect number of arguments. Expecting registerTrade(tradeType, userid, security, price, units, expiry)\")\n\t\t}\n\t\t\n\t\tprice, err := strconv.ParseFloat(args[2], 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t\n\t\tunits, err := strconv.Atoi(args[3])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t\n\t\treturn t.bl.registerTrade(function, args[0], args[1], price, units, args[4])\n\t} else if function == \"dividend\" {\n\t\t// enter an an character event happening in the show. pays out to users holding squares\n\t\tfmt.Printf(\"Function is ask\")\n\t\t\n\t\tamount, err := strconv.Atoi(args[1])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn t.bl.dividend(args[0], amount)\n\t} else if function == \"registeruser\" {\n\t\t// matches trades and excecutes any matches\n\t\tfmt.Printf(\"Function is registeruser\")\n\t\tuserID := args[0]\n\t\treturn t.bl.registerUser(userID)\n\t}\n\t\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "ffbae8c233d22cc2f5a22eb4ad2fd01c", "score": "0.47302288", "text": "func (t *IdentityData) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\r\n\tfunction, args := stub.GetFunctionAndParameters()\r\n\tfmt.Println(\"invoke is running \" + function)\r\n\r\n\t// Handle different functions\r\n\tif function == \"initIdentity\" { //初始化标识数据\r\n\t\treturn t.initIdentity(stub, args)\r\n\t} else if function == \"delete\" { //删除数据\r\n\t\treturn t.delete(stub, args)\r\n\t} else if function == \"quaryIdentityByName\" { //read a Identity\r\n\t\treturn t.quaryIdentityByName(stub, args)\r\n\t} else if function == \"queryIdentityByType\" { //find marbles for owner X using rich query\r\n\t\treturn t.queryIdentityByType(stub, args)\r\n\t} \r\n\r\n\tfmt.Println(\"invoke did not find func: \" + function) //error\r\n\treturn shim.Error(\"Received unknown function invocation\")\r\n}", "title": "" }, { "docid": "ac0ab7294b903903d20e3378af186d06", "score": "0.47214466", "text": "func (c *Client) Authorize(username, password, invitecode, payoutaddress string) error {\n\treq := AuthorizeRequest(username, password, invitecode, payoutaddress)\n\tc.Lock()\n\tc.requestsMade[req.ID] = func(resp Response) {\n\t\tvar result bool\n\t\tif err := resp.FitResult(&result); err == nil {\n\t\t\tif result == false {\n\t\t\t\tlog.Errorf(\"AuthorizeResponse is false. Rather than contributing uncredited mining, shutting down client.\")\n\t\t\t\tc.Close()\n\t\t\t} else {\n\t\t\t\tlog.Infof(\"AuthorizeResponse result: %t\\n\", result)\n\t\t\t}\n\t\t}\n\t}\n\tc.Unlock()\n\terr := c.Encode(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ed68b74a69379b8c46d4ec5a6dc17029", "score": "0.4720414", "text": "func (a *inProcessAuthorizer) Authorize(subject string, groups []string, permission rbac.Permission, resource, tenant string) bool {\n\tvar i interface{} = Input{\n\t\tGroups: groups,\n\t\tPermission: permission,\n\t\tResource: resource,\n\t\tSubject: subject,\n\t\tTenant: tenant,\n\t}\n\tres, err := a.query.Eval(context.Background(), rego.EvalInput(i))\n\tif err != nil {\n\t\tlevel.Error(a.logger).Log(\"msg\", \"failed to evaluate OPA query\", \"err\", err.Error())\n\t\treturn false\n\t}\n\n\tif len(res) == 0 || len(res[0].Expressions) == 0 || res[0].Expressions[0] == nil {\n\t\tlevel.Error(a.logger).Log(\"msg\", \"received a empty OPA response\")\n\t\treturn false\n\t}\n\n\tresult, ok := (res[0].Expressions[0].Value).(bool)\n\tif !ok {\n\t\tlevel.Error(a.logger).Log(\"msg\", \"received a malformed OPA response\")\n\t\treturn false\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "242eb99fa73420f82f6bf01646e768cd", "score": "0.47174865", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tif function == \"putTicket\" {\n\t\treturn putTicket(stub, args)\n\t}\n\n\treturn nil, errors.New(\"function not supported\")\n}", "title": "" }, { "docid": "6e2f17f7df72ba5a31ecc608f64104fa", "score": "0.4710163", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"run is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\t\t\t\t\t\t\t\t\t\t\t\t\t//initialize the chaincode state, used as reset\n\t\treturn t.Init(stub, function, args)\n\t} else if function == \"delete\" {\t\t\t\t\t\t\t\t\t\t//deletes an entity from its state\n\t\treturn t.Delete(stub, args)\n\t} else if function == \"write\" {\t\t\t\t\t\t\t\t\t\t\t//writes a value to the chaincode state\n\t\treturn t.Write(stub, args)\n\t} else if function == \"init_cpr\" {\t\t\t\t\t \t\t\t\t //create a new cpr\n\t\tfmt.Println(\"pre call cpr\");\n\t\treturn t.init_cpr(stub, args)\n\n\t} else if function == \"set_user\" {\t\t\t\t\t\t\t\t\t\t//change owner of a cpr\n\t\treturn t.set_user(stub, args)\n\t}\n\tfmt.Println(\"run did not find func: \" + function)\t\t\t\t\t\t//error\n\n\treturn nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "c33ee86f09327614ca6c2e285f10da67", "score": "0.47101358", "text": "func (a *Authz) Authorize(context.Context, *contract.AuthorizationRequest) (*contract.AuthorizationResponse, error) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "c2aa926d137e60abee94aa9af5743da2", "score": "0.47096905", "text": "func NewIdentifierInvocationSetterInvocation(val int64, call string, calls string, fallback string) *IdentifierInvocationSetterInvocation {\n\tinvocation := new(IdentifierInvocationSetterInvocation)\n\n\tinvocation.Parameters.Val = val\n\n\tinvocation.Results.Call = call\n\tinvocation.Results.Calls = calls\n\tinvocation.Results.Fallback = fallback\n\n\treturn invocation\n}", "title": "" }, { "docid": "278c8060312a9fb6c6d2937a002a0e20", "score": "0.47059754", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"initProperty\" {\n\t\treturn t.initProperty(stub, args)\n\t} else if function == \"initConditon\" {\n\t\treturn t.initConditon(stub, args)\n\t} else if function == \"CreateContract\" {\n\t\treturn t.CreateContract(stub, args)\n\t} else if function == \"transferProperty\" {\n\t\treturn t.transferProperty(stub, args)\n\t} else if function == \"readValue\" {\n\t\treturn t.readValue(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "6ba1444107b552e0c9c8eede81ade816", "score": "0.4705083", "text": "func (m *mLogicExecutorMockExecuteMethod) Set(f func(p context.Context, p1 *Transcript) (r artifacts.RequestResult, r1 error)) *LogicExecutorMock {\n\tm.mainExpectation = nil\n\tm.expectationSeries = nil\n\n\tm.mock.ExecuteMethodFunc = f\n\treturn m.mock\n}", "title": "" }, { "docid": "4c6381897d21da4f559aea79a6b41799", "score": "0.47049987", "text": "func (f_sym15 *FakeEmbedder) SetOtherInvocation(calls_sym15 []*EmbedderOtherInvocation, fallback_sym15 func() string) {\n\tf_sym15.OtherHook = func(ident1 string) (ident2 string) {\n\t\tfor _, call_sym15 := range calls_sym15 {\n\t\t\tif reflect.DeepEqual(call_sym15.Parameters.Ident1, ident1) {\n\t\t\t\tident2 = call_sym15.Results.Ident2\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_sym15()\n\t}\n}", "title": "" }, { "docid": "174af746ff65a08c20b3ced5979bcae8", "score": "0.46999192", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"createPersonHealth\" { //create a new personHealth\n\t\treturn t.createPersonHealth(stub, args)\n\t} else if function == \"updateRemediationIDPersonStatus\" { //change personStatus of a specific personHealth\n\t\treturn t.updateRemediationIDPersonStatus(stub, args)\n\t} else if function == \"readPersonHealth\" { //read a personHealth\n\t\treturn t.readPersonHealth(stub, args)\n\t} else if function == \"getHistoryForPersonHealth\" { //get history of values for a personHealth\n\t\treturn t.getHistoryForPersonHealth(stub, args)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\" + function)\n}", "title": "" }, { "docid": "da688521e7e088ff17da873ab0f91e23", "score": "0.46953475", "text": "func (_f23 *FakeRegistrar) SetAddCheckInvocation(calls_f24 []*RegistrarAddCheckInvocation, fallback_f25 func() merry.Error) {\n\t_f23.AddCheckHook = func(service string, url *url.URL) (ident1 merry.Error) {\n\t\tfor _, call := range calls_f24 {\n\t\t\tif reflect.DeepEqual(call.Parameters.Service, service) && reflect.DeepEqual(call.Parameters.Url, url) {\n\t\t\t\tident1 = call.Results.Ident1\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_f25()\n\t}\n}", "title": "" }, { "docid": "d5b7f363507e533f2a45310052c7b206", "score": "0.46886182", "text": "func (t *SimpleChaincode) Invoke(stub *shim.ChaincodeStub, function string, args []string) ([]byte, error) {\n fmt.Println(\"invoke is running \" + function)\n\n // Handle different functions\n if function == \"init\" {\n return t.Init(stub, \"init\", args)\n } else if function == \"write\" {\n return t.Write(stub, args)\n } else if function == \"init_journal\" { \n //create a new journal \n return t.Init_journal(stub, args)\n }\n \n fmt.Println(\"invoke did not find func: \" + function)\n\n return nil, errors.New(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "efc5f385be6fcad332d3bb591ebc8206", "score": "0.4688545", "text": "func (m *FakeMethod) HandleInvocation(ctx context.Context, i interface{}) (interface{}, error) {\n\tif m.HandleMethod != nil {\n\t\treturn m.HandleMethod(ctx, i)\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "515984085e9757733b9c7c2744255422", "score": "0.46865204", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"recordSalmon\" { //create a new marble\n\t\treturn t.recordSalmon(stub, args)\n\t} else if function == \"changeSalmonHolder\" { //change owner of a specific marble\n\t\treturn t.changeSalmonHolder(stub, args)\n\t} else if function == \"querySalmon\" { //change owner of a specific marble\n\t\treturn t.querySalmon(stub, args)\n\t} else if function == \"queryAllSalmon\" { //change owner of a specific marble\n\t\treturn t.queryAllSalmon(stub)\n\t} else if function == \"initLedger\" { //change owner of a specific marble\n\t\treturn t.initLedger(stub)\n\t}\n\n\tfmt.Println(\"invoke did not find func: \" + function) //error\n\treturn shim.Error(\"Received unknown function invocation\")\n}", "title": "" }, { "docid": "0e45ee49106ba81840295b3c7087cee8", "score": "0.468153", "text": "func (r *Requestor) Invoke(serviceName string, methodName string, arg1 interface{}, arg2 interface{}) network.Response {\n\n\targs := make([]interface{}, 2)\n\targs[0] = arg1\n\targs[1] = arg2\n\tserviceAddress := \"\"\n\tif namingProxyIsOn {\n\t\tserviceAddress = r.find(serviceName)\n\t}\n\tif serviceAddress == \"\" {\n\t\tserviceAddress = r.lookup(serviceName)\n\t\tr.putServiceInNamingProxy(serviceName, serviceAddress)\n\t}\n\tbytesRequestData := r.marshall(serviceName, methodName, args)\n\tserverResponse := r.send(serviceAddress, bytesRequestData)\n\treturn r.unmarshall(serverResponse)\n}", "title": "" }, { "docid": "637df2ebdcfc22d351b8fc25723ff57a", "score": "0.46782157", "text": "func (t *PRChainCode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\n\t//getting MSP\n\tcertOrgType, err := cid.GetMSPID(stub)\n\tif err != nil {\n\t\treturn shim.Error(\"Enrolment mspid Type invalid!!! \" + err.Error())\n\t}\n\tfmt.Println(\"MSP:\" + certOrgType)\n\n\torgType, err := getOrgTypeByMSP(stub, string(certOrgType))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\tfunction, args := stub.GetFunctionAndParameters()\n\tfmt.Println(\"Invoke is running for function: \" + function)\n\t//<<Function Validation Logic-Start>>\n\n\t// args, errTrans := getArguments(stub)\n\t// if errTrans != nil {\n\t// \treturn shim.Error(errTrans.Error())\n\t// }\n\tfmt.Println(\"Arguments Loaded Successfully!!\", args)\n\n\tconnection := hypConnect{}\n\tconnection.Connection = stub\n\tif orgType == \"Airline\" || orgType == \"Airport\" || orgType == \"Interliner\" {\n\n\t\tswitch functionName := function; functionName {\n\n\t\tcase \"RegisterAirports\":\n\t\t\treturn t.RegisterAirports(connection, args)\n\t\tcase \"RegisterAirlines\":\n\t\t\treturn t.RegisterAirlines(connection, args)\n\t\tcase \"CreateBaggage\":\n\t\t\treturn t.CreateBaggage(connection, args)\n\t\tcase \"ChangeBaggageStatusByAirlines\":\n\t\t\treturn t.ChangeBaggageStatusByAirlines(connection, args)\n\t\tcase \"ChangeBaggageStatusByAirport\":\n\t\t\treturn t.ChangeBaggageStatusByAirport(connection, args)\t\n\t\tcase \"GetBaggageDetails\":\n\t\t\treturn t.GetBaggageDetails(connection, args)\n\n\t\tdefault:\n\t\t\treturn defaultConditionInvoke(function)\n\t\t}\n\t} else {\n\t\treturn shim.Error(\"Invalid MSP: \" + orgType)\n\t}\n}", "title": "" }, { "docid": "96674b5791463893de3b6d592414daa2", "score": "0.4674383", "text": "func (_f13 *FakeRegistrar) SetDeregisterInvocation(calls_f14 []*RegistrarDeregisterInvocation, fallback_f15 func() merry.Error) {\n\t_f13.DeregisterHook = func(serviceID string) (ident1 merry.Error) {\n\t\tfor _, call := range calls_f14 {\n\t\t\tif reflect.DeepEqual(call.Parameters.ServiceID, serviceID) {\n\t\t\t\tident1 = call.Results.Ident1\n\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\treturn fallback_f15()\n\t}\n}", "title": "" }, { "docid": "26c156e9948f26bf738c7d012453d866", "score": "0.46680957", "text": "func TestAnyAuthorizerMultiple(t *testing.T) {\n\tctrl, ctx := gomock.WithContext(context.Background(), t)\n\n\tbaseAuthorizer1 := mock.NewMockAuthorizer(ctrl)\n\tbaseAuthorizer2 := mock.NewMockAuthorizer(ctrl)\n\tbaseAuthorizer3 := mock.NewMockAuthorizer(ctrl)\n\tauthorizer := auth.NewAnyAuthorizer([]auth.Authorizer{\n\t\tbaseAuthorizer1,\n\t\tbaseAuthorizer2,\n\t\tbaseAuthorizer3,\n\t})\n\n\tbaseAuthorizer1.EXPECT().Authorize(ctx, []digest.InstanceName{\n\t\tdigest.MustNewInstanceName(\"ok1\"),\n\t\tdigest.MustNewInstanceName(\"ok2\"),\n\t\tdigest.MustNewInstanceName(\"ok3\"),\n\t\tdigest.MustNewInstanceName(\"denied\"),\n\t\tdigest.MustNewInstanceName(\"unavailable1\"),\n\t\tdigest.MustNewInstanceName(\"unavailable2\"),\n\t\tdigest.MustNewInstanceName(\"unavailable3\"),\n\t}).Return([]error{\n\t\tnil,\n\t\tstatus.Error(codes.PermissionDenied, \"1: Permission denied for ok2\"),\n\t\tstatus.Error(codes.PermissionDenied, \"1: Permission denied for ok3\"),\n\t\tstatus.Error(codes.PermissionDenied, \"1: Permission denied for denied\"),\n\t\tstatus.Error(codes.Unavailable, \"1: Server offline for unavailable1\"),\n\t\tstatus.Error(codes.PermissionDenied, \"1: Permission denied for unavailable2\"),\n\t\tstatus.Error(codes.PermissionDenied, \"1: Permission denied for unavailable3\"),\n\t})\n\tbaseAuthorizer2.EXPECT().Authorize(ctx, []digest.InstanceName{\n\t\tdigest.MustNewInstanceName(\"ok2\"),\n\t\tdigest.MustNewInstanceName(\"ok3\"),\n\t\tdigest.MustNewInstanceName(\"denied\"),\n\t\tdigest.MustNewInstanceName(\"unavailable2\"),\n\t\tdigest.MustNewInstanceName(\"unavailable3\"),\n\t}).Return([]error{\n\t\tnil,\n\t\tstatus.Error(codes.PermissionDenied, \"2: Permission denied for ok3\"),\n\t\tstatus.Error(codes.PermissionDenied, \"2: Permission denied for denied\"),\n\t\tstatus.Error(codes.Unavailable, \"2: Server offline for unavailable2\"),\n\t\tstatus.Error(codes.PermissionDenied, \"2: Permission denied for unavailable3\"),\n\t})\n\tbaseAuthorizer3.EXPECT().Authorize(ctx, []digest.InstanceName{\n\t\tdigest.MustNewInstanceName(\"ok3\"),\n\t\tdigest.MustNewInstanceName(\"denied\"),\n\t\tdigest.MustNewInstanceName(\"unavailable3\"),\n\t}).Return([]error{\n\t\tnil,\n\t\tstatus.Error(codes.PermissionDenied, \"3: Permission denied for denied\"),\n\t\tstatus.Error(codes.Unavailable, \"3: Server offline for unavailable3\"),\n\t})\n\n\terrs := authorizer.Authorize(ctx, []digest.InstanceName{\n\t\tdigest.MustNewInstanceName(\"ok1\"),\n\t\tdigest.MustNewInstanceName(\"ok2\"),\n\t\tdigest.MustNewInstanceName(\"ok3\"),\n\t\tdigest.MustNewInstanceName(\"denied\"),\n\t\tdigest.MustNewInstanceName(\"unavailable1\"),\n\t\tdigest.MustNewInstanceName(\"unavailable2\"),\n\t\tdigest.MustNewInstanceName(\"unavailable3\"),\n\t})\n\trequire.Len(t, errs, 7)\n\trequire.NoError(t, errs[0])\n\trequire.NoError(t, errs[1])\n\trequire.NoError(t, errs[2])\n\ttestutil.RequireEqualStatus(t, status.Error(codes.PermissionDenied, \"1: Permission denied for denied\"), errs[3])\n\ttestutil.RequireEqualStatus(t, status.Error(codes.Unavailable, \"1: Server offline for unavailable1\"), errs[4])\n\ttestutil.RequireEqualStatus(t, status.Error(codes.Unavailable, \"2: Server offline for unavailable2\"), errs[5])\n\ttestutil.RequireEqualStatus(t, status.Error(codes.Unavailable, \"3: Server offline for unavailable3\"), errs[6])\n}", "title": "" }, { "docid": "147945575d6e60599322eea31ace3af0", "score": "0.46672758", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"***** Invoke ********* \"+ function )\n\tfor i:=0 ; i<=100 && locked== true; i++ {\n\t time.Sleep(time.Millisecond * 20 )\t\n\t}\n\tlocked=true\n\tfmt.Println(\"invoke is running \" + function)\n //xx = shared.Args{1, 2} \n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t}else if function == \"updateOds\" {\n\t\treturn t.update(stub, args)\n\t}else if function == \"Crtjournal\" {\n\t\treturn t.Crtjournal(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\tlocked=false\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "31d1c426cce536eaf2b54de5132dcf70", "score": "0.46633208", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"register\" {\n\t\treturn t.register(stub, args)\n\t} else if function == \"stand\" {\n\t\treturn t.stand(stub, args)\n\t} else if function == \"vote\" {\n\t\treturn t.vote(stub, args)\n\t} else if function == \"unregister\" {\n\t\treturn t.unregister(stub, args)\n\t} else if function == \"cancel\" {\n\t\treturn t.cancel(stub, args)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n}", "title": "" }, { "docid": "414bba8b987abf93c396605248ea81e9", "score": "0.4662202", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tswitch function {\n\tcase \"put\":\n\t\treturn t.put(stub, args)\n\tcase \"web\":\n\t\tweb, err := makeServiceCall()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\terr = stub.PutState(\"rest_result\", []byte(web))\n\t\treturn nil, err\n\tcase \"remove\":\n\t\treturn t.remove(stub, args)\n\tdefault:\n\t\treturn nil, errors.New(\"Unsupported operation\")\n\t}\n}", "title": "" }, { "docid": "cb4832ba73bd4469a828e917f9ed14af", "score": "0.46608165", "text": "func (o BotElicitationCodeHookInvocationSettingOutput) EnableCodeHookInvocation() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v BotElicitationCodeHookInvocationSetting) bool { return v.EnableCodeHookInvocation }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "66f9181bb027a6ac15521ee6e404a25e", "score": "0.46578276", "text": "func (t *EnclaveChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\tfunction, _ := stub.GetFunctionAndParameters()\n\tlogger.Debugf(\"Invoke is running [%s]\", function)\n\n\t// Look first if there are system functions (and handle them)\n\tif function == \"__setup\" { // create enclave and register at ercc\n\t\t// Note: above string is also used in ecc_valdation_logic.go,\n\t\t// so if you change here you also will have to change there ...\n\t\t// If/when we refactor we should define such stuff somewhere as constants..\n\t\treturn t.setup(stub)\n\t} else if function == \"__init\" { // pass CC init to chaincode\n\t\treturn t.init(stub)\n\t} else if function == \"__getEnclavePk\" { //get Enclave PK\n\t\treturn t.getEnclavePk(stub)\n\t}\n\n\t// Remaining functions are user functions, so pass them on the enclave and\n\treturn t.invoke(stub)\n}", "title": "" }, { "docid": "fb7b3339d3a7b7ec907baa2758ada879", "score": "0.4655466", "text": "func WrapAuthorize(hfn http.Handler, routeName string) http.HandlerFunc {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\n\t\trefStr := context.Get(r, \"str\").(stores.Store)\n\t\trefRoles := context.Get(r, \"auth_roles\").([]string)\n\n\t\tif auth.Authorize(routeName, refRoles, refStr) {\n\t\t\thfn.ServeHTTP(w, r)\n\t\t} else {\n\t\t\trespondErr(w, 403, \"Access to this resource is forbidden\")\n\t\t}\n\n\t})\n}", "title": "" }, { "docid": "2969e923ce9c3cb11747fa7d145be486", "score": "0.4653812", "text": "func (o *IscsiInitiatorSetDefaultAuthRequest) ExecuteUsing(zr *ZapiRunner) (*IscsiInitiatorSetDefaultAuthResponse, error) {\n\treturn o.executeWithoutIteration(zr)\n}", "title": "" }, { "docid": "e885f3d9cbbd9d99770da48f701afa47", "score": "0.46518013", "text": "func (self *stubHandler) Invoke(stub shim.ChaincodeStubInterface) pb.Response {\n\n\targs := stub.GetArgs()\n\n\tvar params []byte\n\n\tif len(args) > 1 {\n\t\tparams = args[1]\n\t}\n\n\tdispatcher, index, err := self.decodeFunction(string(args[0]))\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn dispatcher.Dispatch(stub, index, params)\n}", "title": "" }, { "docid": "f6fa132d801bca2de88880cecf82d131", "score": "0.46494845", "text": "func (auth Driver) Authorize(user gate.User, action, object string) (err error) {\n\treturn gate.Authorize(auth, user, action, object)\n}", "title": "" }, { "docid": "cb4e9ca8b30661cf5715cf0622ef4ce3", "score": "0.4646027", "text": "func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface, function string, args []string) ([]byte, error) {\n\tfmt.Println(\"invoke is running \" + function)\n\n\tvar a,b,c,d string\n\n\ta = args[0]\n\tb = args[1]\n\tc = args[2]\n\td = args[3]\n \n fmt.Println(\"invoke args \"+ a+\":\"+b+\":\"+c+\":\"+d)\n\n\te := removeCPFMask(args[0])\n\tkv := []string{e,b}\n\n\t// Handle different functions\n\tif function == \"init\" {\n\t\treturn t.Init(stub, \"init\", args)\n\t} else if function == \"write\" {\n\t\treturn t.write(stub, kv)\n\t}\n\tfmt.Println(\"invoke did not find func: \" + function)\n\n\treturn nil, errors.New(\"Received unknown function invocation: \" + function)\n\n}", "title": "" }, { "docid": "8d8419d60ecd88ff67a2720c10b325b0", "score": "0.46434054", "text": "func (t *SimpleAsset) Invoke(stub shim.ChaincodeStubInterface) peer.Response {\n\t// Extract the function and args from the transaction proposal\n\tfn, args := stub.GetFunctionAndParameters()\n\n\tvar result string\n\tvar err error\n\tif fn == \"createLoanRequest\" {\n\t\tresult, err = createLoanRequest(stub, args)\n\t} else if fn == \"getLoanOfUser\" { // assume 'get' even if fn is nil\n\t\tresult, err = getLoanOfUser(stub, args)\n\t} else if fn == \"queryLoanByBank\" {\n\t\treturn t.queryLoanByBank(stub, args)\n\t} else if fn == \"setCreditScoreState\" { // assume 'set' even if fn is nil\n\n\t\tresult, err = setCreditScoreState(stub, args)\n\t} else {\n\t\tresult, err = updateLoanStatus(stub, args)\n\t}\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// Return the result as success payload\n\treturn shim.Success([]byte(result))\n}", "title": "" } ]
d71ed991fff559e133d5f236c54c500a
Deprecated: Use Owner.ProtoReflect.Descriptor instead.
[ { "docid": "fb709e6c71ac398543ac12e354a63069", "score": "0.677745", "text": "func (*Owner) Descriptor() ([]byte, []int) {\n\treturn file_google_apps_drive_activity_v2_target_proto_rawDescGZIP(), []int{4}\n}", "title": "" } ]
[ { "docid": "c4a6f7f994efe02c30a02282e85f66db", "score": "0.7024905", "text": "func (x *fastReflection_Owner) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Owner\n}", "title": "" }, { "docid": "b22fde99b7bda8255dc654accf63dfaa", "score": "0.70171887", "text": "func (x *fastReflection_Foo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Foo\n}", "title": "" }, { "docid": "fe1df19f78aa42b465d168f8537e858a", "score": "0.68889797", "text": "func (*OwnerReference) Descriptor() ([]byte, []int) {\n\treturn file_k8s_io_apimachinery_pkg_apis_meta_v1_generated_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "c8ec2b6c6d85cbc0dd302a423756cf3d", "score": "0.68750954", "text": "func (*VisibilityUpdate) Descriptor() ([]byte, []int) {\n\treturn file_all_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "62249d82ec730c11b6c9814821aef776", "score": "0.6826005", "text": "func (*DMLink) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_luciexe_legacy_annotee_proto_annotations_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "f2451b5a59f05ba1c2a40890eb04cafa", "score": "0.68212813", "text": "func (*Listener_DeprecatedV1) Descriptor() ([]byte, []int) {\n\treturn file_xds_lds_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "63097f242660b5ece2889ef29c55baeb", "score": "0.67794377", "text": "func (*VoidProto) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_server_internal_gae_base_api_base_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "aeb75679c3d063ef083c1117e5af0894", "score": "0.6766035", "text": "func (*Peer) Descriptor() ([]byte, []int) {\n\treturn file_cerbos_audit_v1_audit_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "a27878d5f18d4ec1b09a069d7a02fa9a", "score": "0.67597187", "text": "func (*Peer) Descriptor() ([]byte, []int) {\n\treturn file_pkg_grpc_biz_biz_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "4a7027344b00eff0b194037b9a1e5796", "score": "0.6746641", "text": "func (x *fastReflection_Coin) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Coin\n}", "title": "" }, { "docid": "aea87af71e6faf031a6c51cb25b9aba5", "score": "0.67282474", "text": "func (x *fastReflection_DenomOwner) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_DenomOwner\n}", "title": "" }, { "docid": "fcf68c3dd627c0e0aa3ca9d5eadf1f5c", "score": "0.6724963", "text": "func (*Ref_Foo) Descriptor() ([]byte, []int) {\n\treturn file_constructsserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1}\n}", "title": "" }, { "docid": "7c284740112030260738d9d09b4b89fa", "score": "0.67085177", "text": "func (*VoidProto) Descriptor() ([]byte, []int) {\n\treturn file_api_base_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "6901e64f8744a5ad0b714ceca36e3930", "score": "0.67000604", "text": "func (*Owner) Descriptor() ([]byte, []int) {\n\treturn file_wgtwo_events_v0_events_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "15ec63d4a3d5002cbb87869eb7c90ad2", "score": "0.6698725", "text": "func (x *fastReflection_DecCoin) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_DecCoin\n}", "title": "" }, { "docid": "f033df91fb92d4eab7618babf08e6434", "score": "0.66799164", "text": "func (*Verified) Descriptor() ([]byte, []int) {\n\treturn file_proto_customers_events_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "4285dffea0c3f539c7af7a8df31170a4", "score": "0.6673069", "text": "func (*InstanceMessage) Descriptor() ([]byte, []int) {\n\treturn file_pkg_security_proto_api_api_proto_rawDescGZIP(), []int{41}\n}", "title": "" }, { "docid": "b1425b54d92e6f86cca18d9743679e4b", "score": "0.66676027", "text": "func (*Delegation) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "1165cb73a4db018f774f12a87d9ef71c", "score": "0.66674507", "text": "func (*MetadataMessage) Descriptor() ([]byte, []int) {\n\treturn file_pkg_security_proto_api_api_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "fe8a1a30af64aa19ba8a870903352497", "score": "0.6664585", "text": "func (*Contact) Descriptor() ([]byte, []int) {\n\treturn file_github_com_gunk_opt_openapiv2_all_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "0d005cc733fb09fd68ced85bc1b5306b", "score": "0.66594994", "text": "func (*DeltaDiscoveryRequest) Descriptor() ([]byte, []int) {\n\treturn file_envoy_api_v2_discovery_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d77082929001acbe7a37d97c7b2fd7c3", "score": "0.66572315", "text": "func (*VerifyRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha2_attestation_custom_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "484b79791d3459d42d1bf2d58c474297", "score": "0.66522515", "text": "func (*OwnerReference) Descriptor() ([]byte, []int) {\n\treturn edgelq_common_types_meta_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "70269ee0e24174e7c4c01cdb27ba8ab4", "score": "0.664942", "text": "func (x *fastReflection_MsgRevokeAllowance) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgRevokeAllowance\n}", "title": "" }, { "docid": "09338eb2d140abd5040afda57ea774b2", "score": "0.6644815", "text": "func (x *fastReflection_DVVTriplet) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_DVVTriplet\n}", "title": "" }, { "docid": "0583dc1ab6d80b20a681c777a7e367d2", "score": "0.66447836", "text": "func (*Name) Descriptor() ([]byte, []int) {\n\treturn file_contacts_contact_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "d109fd9980616cd469705bd2882c2344", "score": "0.66406983", "text": "func (*CustomExt) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_protowalk_fields_test_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f6900c956c61425bcda5026c18a3988d", "score": "0.6635274", "text": "func (*MetadataName) Descriptor() ([]byte, []int) {\n\treturn file_internal_pkg_protofiles_client_cp_metadata_messages_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "ef5c39c5f2984a8c4f081c58d6b60e17", "score": "0.6622675", "text": "func (*CallUpdateParticipantRemoved) Descriptor() ([]byte, []int) {\n\treturn file_client_call_proto_rawDescGZIP(), []int{39}\n}", "title": "" }, { "docid": "d36e76ccd823c4ed8cd7552072f36e11", "score": "0.6613451", "text": "func (*Unbanned) Descriptor() ([]byte, []int) {\n\treturn file_proto_customers_events_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "2b1d14eab70604ab73b54f6b2c016199", "score": "0.66094166", "text": "func (*BytesProto) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_server_internal_gae_base_api_base_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "ac3a8d1877a37e48cc6e5176fd468afb", "score": "0.660296", "text": "func (*Outer) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_protowalk_fields_test_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "c6afc980fed9dba03f0297f7ce9256d4", "score": "0.660158", "text": "func (*IsolateObject) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_luciexe_legacy_annotee_proto_annotations_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "01de35a00644b97528fa5a1d40822b18", "score": "0.6601571", "text": "func (*Inner) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_common_proto_protowalk_fields_test_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "d1334ebdff39cec507bf2746d0edfd03", "score": "0.6596207", "text": "func (*Ref_Foo_Bar) Descriptor() ([]byte, []int) {\n\treturn file_constructsserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1, 1}\n}", "title": "" }, { "docid": "d5f8af02a5a0d1dff9f62f149202aa57", "score": "0.65934026", "text": "func (*PlayerCommendationInfo) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "572aef7b25983bf1a67244428b544fb5", "score": "0.65874743", "text": "func (*BytesProto) Descriptor() ([]byte, []int) {\n\treturn file_api_base_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "8cb0f4d65190a8137181d64a3ac612c9", "score": "0.65797544", "text": "func (*UpdateWhitelistRequest) Descriptor() ([]byte, []int) {\n\treturn file_discord_mc_protobuf_proto_mc_management_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "55e48286e83b98f4d20597c786eac2b7", "score": "0.657859", "text": "func (*DoubleProto) Descriptor() ([]byte, []int) {\n\treturn file_api_base_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "f73c9c258f35c971ec966db3cf9590b7", "score": "0.65747464", "text": "func (x *fastReflection_HistoricalInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_HistoricalInfo\n}", "title": "" }, { "docid": "4bb3783c5fe9524ec8b34304bbe80db2", "score": "0.6571401", "text": "func (*ValidatorUpdate) Descriptor() ([]byte, []int) {\n\treturn file_core_abci_tendermint_abci_types_proto_rawDescGZIP(), []int{36}\n}", "title": "" }, { "docid": "fc3a8c293b006dc879294777c21c03c7", "score": "0.65707546", "text": "func (*PassThroughGrpc) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_extauth_v1_extauth_proto_rawDescGZIP(), []int{37}\n}", "title": "" }, { "docid": "43a01855dc1b693396c613b3192c9f74", "score": "0.6569004", "text": "func (*WebsocketProto) Descriptor() ([]byte, []int) {\n\treturn file_admin_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "254eca215d1b6dcd6658c88a687a8618", "score": "0.65664107", "text": "func (*Lifecycle) Descriptor() ([]byte, []int) {\n\treturn edgelq_common_types_meta_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "fe9532f8ed1225e3c082003baca33a8e", "score": "0.65661824", "text": "func (*Listener) Descriptor() ([]byte, []int) {\n\treturn file_github_com_solo_io_gloo_projects_gloo_api_v1_proxy_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "fc674798008e3c467a6d5a609c0eea84", "score": "0.65625626", "text": "func (*CoinWithDrawRevokeRep) Descriptor() ([]byte, []int) {\n\treturn file_proto_coin_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "622cb0e6a2b800507e78d926ea55fab5", "score": "0.6558354", "text": "func (*Constraint) Descriptor() ([]byte, []int) {\n\treturn file_tarianpb_types_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "042836310cd5785b1ebfc018828d0a7c", "score": "0.6554472", "text": "func (*CMsgDOTATransferTeamAdmin) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "309e699b0d218a31565e446efdc8b66d", "score": "0.65503365", "text": "func (x *fastReflection_Delegation) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Delegation\n}", "title": "" }, { "docid": "20364c8a4584ea7d43acc5dee0c0f3f5", "score": "0.65501165", "text": "func (*DoubleProto) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_server_internal_gae_base_api_base_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "5361981173de8db3b175c9f4ce42c40b", "score": "0.65489334", "text": "func (*OnExtAddrChangeEvent) Descriptor() ([]byte, []int) {\n\treturn file_visualize_grpc_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "9174d580ffa4a5c21cac5e9c699e63c3", "score": "0.6546295", "text": "func (x *fastReflection_ValidatorUpdates) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ValidatorUpdates\n}", "title": "" }, { "docid": "a4f2b78bd43cf908df098884f02bbe2e", "score": "0.6545712", "text": "func (*Name) Descriptor() ([]byte, []int) {\n\treturn file_add_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "0128b1f78a77e3000ffd0e049a17232a", "score": "0.65396154", "text": "func (*VersionedValue) Descriptor() ([]byte, []int) {\n\treturn file_pkg_shadow_shadowpb_shadow_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "a845688e5677a2945e4eca919d18591c", "score": "0.6538049", "text": "func (*UnbondingDelegation) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "f5dc2c276f98a547f953a78b7d70a6b7", "score": "0.65371245", "text": "func (*RpcOutpoint) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{106}\n}", "title": "" }, { "docid": "714a5a80344e92bf1277167382627d43", "score": "0.65358114", "text": "func (*Schema) Descriptor() ([]byte, []int) {\n\treturn file_github_com_gunk_opt_openapiv2_all_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "0f73baeacb24600289031416a94e7cfc", "score": "0.65326", "text": "func (*CMsgDOTAKickTeamMember) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "0f88ba55fa02dda4983c5c974fa243f3", "score": "0.6531643", "text": "func (x *fastReflection_Bar) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Bar\n}", "title": "" }, { "docid": "d0e13b8cee5f3016270571afad041c9d", "score": "0.6529174", "text": "func (*Person) Descriptor() ([]byte, []int) {\n\treturn file_demo_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "56e6b6ab05e8461aff9dde5b6735694d", "score": "0.6527535", "text": "func (*Visibility) Descriptor() ([]byte, []int) {\n\treturn file_google_api_visibility_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "42d32b7d8c5c66c5665d1d83b16b8b9a", "score": "0.6524739", "text": "func (*RemoteEditLogManifestProto) Descriptor() ([]byte, []int) {\n\treturn file_HdfsServer_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "d709a7a439012efe391f15815c9ae1be", "score": "0.65241146", "text": "func (*ExternalDocumentation) Descriptor() ([]byte, []int) {\n\treturn file_github_com_gunk_opt_openapiv2_all_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "7b3b9cc12b7e66c1aa02afa39cca2bd4", "score": "0.6523068", "text": "func (*Patch) Descriptor() ([]byte, []int) {\n\treturn file_k8s_io_apimachinery_pkg_apis_meta_v1_generated_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "65400d4d5fc8b134c22544422c8eff42", "score": "0.6520733", "text": "func (*FieldId) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_issuetracker_v1_issuetracker_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "645a97a5709be34ede4135cc945c6fec", "score": "0.6519478", "text": "func (*Permission) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha_permission_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "9897598fc6c4a733e11066b9e2d4dbc1", "score": "0.65190583", "text": "func (*Redelegation) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_staking_v1beta1_staking_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "973adc29c2e47a1899406c46ff4b6874", "score": "0.65177107", "text": "func (*CompanyProto) Descriptor() ([]byte, []int) {\n\treturn file_company_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "27378cf871657211a650915e35dad0b5", "score": "0.651728", "text": "func (*CMsgDOTALeaveTeam) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "01f03b5005252802218c7226fd5ce40e", "score": "0.65161884", "text": "func (*Name) Descriptor() ([]byte, []int) {\n\treturn file_proto_self_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "1a2f3679407ff7fe6264897ec6b8b395", "score": "0.6516115", "text": "func (*RemoveTeamMembersReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "8daecb7098ebd39ed9559cea6685dbb0", "score": "0.65112215", "text": "func (*Peer) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "359db5e61fef86327fda619daa72fca1", "score": "0.65084124", "text": "func (x *fastReflection_ListenCommitRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_ListenCommitRequest\n}", "title": "" }, { "docid": "ab49b2d3e9dbce2403ec08287adfc571", "score": "0.65067726", "text": "func (*BlacklistClientRequest) Descriptor() ([]byte, []int) {\n\treturn file_fleetspeak_src_server_proto_fleetspeak_server_admin_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "3b024425e5eec5930f509d91631f3a9e", "score": "0.65051514", "text": "func (x *fastReflection_DVVTriplets) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_DVVTriplets\n}", "title": "" }, { "docid": "13b6801652bb3b65ed2ac030eee9a780", "score": "0.6503466", "text": "func (*OwnerReference) Descriptor() ([]byte, []int) {\n\treturn file_api_gadgettracermanager_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "d9719013c3475a9d77d69aa18ba91322", "score": "0.65026593", "text": "func (*CallParticipants) Descriptor() ([]byte, []int) {\n\treturn file_client_call_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "99bacb60dab4931afe6df5907584ddf5", "score": "0.6502353", "text": "func (*MethodDescriptor) Descriptor() ([]byte, []int) {\n\treturn edgelq_audit_proto_v1alpha2_method_descriptor_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "158d5a8ed3830b4f5601a482445528d0", "score": "0.649739", "text": "func (*AddTeamMembersReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "c8fc71da033137a759af02c685b53517", "score": "0.6496417", "text": "func (*UpdateWhitelistResponse) Descriptor() ([]byte, []int) {\n\treturn file_discord_mc_protobuf_proto_mc_management_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "2ebee47d3eefcabfdc63db9fe6996c26", "score": "0.6495839", "text": "func (*ForeignMessage) Descriptor() ([]byte, []int) {\n\treturn file_google_protobuf_test_messages_proto3_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "5b380047ea26eb9fee98c4604a79b194", "score": "0.6495523", "text": "func (*Ref) Descriptor() ([]byte, []int) {\n\treturn file_constructsserver_pb_constructs_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "3fbb02cc608d3d98d51bb5aca2261aa0", "score": "0.6493549", "text": "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_contrib_envoy_extensions_filters_network_sip_proxy_tra_v3alpha_tra_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "97ce2f7ec81ea2a7b0b4f23f3dec7376", "score": "0.64934915", "text": "func (*Target) Descriptor() ([]byte, []int) {\n\treturn file_src_main_protobuf_analysis_v2_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "8c31a2c0662043ee63b85f4d8985989c", "score": "0.6492874", "text": "func (*Follow) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{142}\n}", "title": "" }, { "docid": "0150794e58cbb0d297c396ae06e8ef07", "score": "0.6491616", "text": "func (*Shadow) Descriptor() ([]byte, []int) {\n\treturn file_pkg_shadow_shadowpb_shadow_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "46b2a5c310e0676eed4517ae2c1d8efe", "score": "0.6490858", "text": "func (*Constraint) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_swarming_internal_remoteworkers_reservations_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "ec254538903b5117ac87f1bb59e779ab", "score": "0.6490146", "text": "func (*MuteTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_MuteTeam_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "193113099cf8eceb81a662c2f0fc3a87", "score": "0.6488774", "text": "func (x *fastReflection_MsgAddAllowedDenom) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgAddAllowedDenom\n}", "title": "" }, { "docid": "7dd068bc78c8a69b3a9c24c24bcd5a4c", "score": "0.6482881", "text": "func (*RuntimeInfo) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_dataproc_v1_shared_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "e77f2108c7b9eaee61a78c9c216937f6", "score": "0.6482091", "text": "func (*GetUDTypeInfoRequestPB) Descriptor() ([]byte, []int) {\n\treturn file_yb_master_master_proto_rawDescGZIP(), []int{161}\n}", "title": "" }, { "docid": "7023811676f6352f92871175e288fc7d", "score": "0.64786685", "text": "func (*VerifyResponse) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha2_attestation_custom_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "2628a8b3aa05fb04c0c3821213067de6", "score": "0.6471389", "text": "func (*RemovePeerCommand) Descriptor() ([]byte, []int) {\n\treturn file_internal_meta_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "5791dc03956865c8ada5a75cf39159ba", "score": "0.64677733", "text": "func (*TrustedDataMessage) Descriptor() ([]byte, []int) {\n\treturn file_p2p_proto_rawDescGZIP(), []int{59}\n}", "title": "" }, { "docid": "4a66cca4a1490a80eb70d6f49ae1ba23", "score": "0.6466266", "text": "func (*FieldUpdate) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_issuetracker_v1_issuetracker_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "eaa346fdbe36bf3624370ee0570146df", "score": "0.6465386", "text": "func WrapDescriptor(descriptor DescriptorProto) *Descriptor {\n\tdesc := &Descriptor{}\n\tswitch t := descriptor.(type) {\n\tcase *TableDescriptor:\n\t\tdesc.Union = &Descriptor_Table{Table: t}\n\tcase *DatabaseDescriptor:\n\t\tdesc.Union = &Descriptor_Database{Database: t}\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"unknown descriptor type: %s\", descriptor.TypeName()))\n\t}\n\treturn desc\n}", "title": "" }, { "docid": "ba8defa7b19e315df28ff8ad945914e4", "score": "0.64613044", "text": "func (*Void) Descriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_grpc_discovery_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "2881b199a468d7578af23902e7bfc862", "score": "0.64587957", "text": "func (*UpdateTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "515a0d40febdcac14a507e6d3be1c576", "score": "0.6458517", "text": "func (*Info) Descriptor() ([]byte, []int) {\n\treturn file_github_com_gunk_opt_openapiv2_all_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "4a9b320a1775a29faf9f23204845d6dd", "score": "0.64578635", "text": "func (*CMsgDOTATeam) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{3}\n}", "title": "" } ]
d9bc6e831d465f10fd3beb915bbd0018
GetInChan returns the inChan of the program. Really meant for unit testing.
[ { "docid": "9681a59221d753caff77262d72cc8e8c", "score": "0.7811407", "text": "func (p *DNSFilterProgram) GetInChan() chan programapi.MatraEvent {\n\treturn p.State.inChan\n}", "title": "" } ]
[ { "docid": "1f47dadb327e665e65b1370f49a8605f", "score": "0.66796714", "text": "func (iw *Worker) In() chan interface{} {\n\treturn iw.inChan\n}", "title": "" }, { "docid": "89a49688f88f762b99efb6adc8597614", "score": "0.6660683", "text": "func (f *filterParam) GetInCh() <-chan int {\n\treturn f.InCh\n}", "title": "" }, { "docid": "4fb921f051642c05047c86acd482a5f7", "score": "0.64047045", "text": "func (m *MenderAuthManager) GetInMessageChan() chan<- AuthManagerRequest {\n\t// Auto-start the service if it hasn't been started already.\n\tm.Start()\n\treturn m.inChan\n}", "title": "" }, { "docid": "6311a470d4b8a26102029b219c2ea54c", "score": "0.60903525", "text": "func (p *DNSFilterProgram) GetOutChan() chan programapi.MatraEvent {\n\treturn p.State.outChan\n}", "title": "" }, { "docid": "284527513e66895396c6a24a72f44490", "score": "0.5903773", "text": "func (fs *fsnoti) GetEventChan() chan types.Event {\n\treturn fs.eventChannel\n}", "title": "" }, { "docid": "aae4e556f3ee0b9a0cfb2d779137d888", "score": "0.5857003", "text": "func (d *Dispatcher) In() chan<- []byte {\n\treturn d.broadcast\n}", "title": "" }, { "docid": "64f8d054422c8e462e08e70dc61fc846", "score": "0.58413494", "text": "func (fm *Frame) InputChan() chan any {\n\treturn fm.ports[0].Chan\n}", "title": "" }, { "docid": "28fce7d8dcf7561b249024894110395c", "score": "0.5836531", "text": "func (o *OrderedPool) GetInputCh() chan<- interface{} {\n\treturn o.inChan\n}", "title": "" }, { "docid": "e02ddf6bcece01de7fa2d2e60d284161", "score": "0.5820533", "text": "func (fm *Frame) InputChan() chan interface{} {\n\treturn fm.ports[0].Chan\n}", "title": "" }, { "docid": "8e3e2d291d70cdc579104aabf0f088dd", "score": "0.5772463", "text": "func GetMixPanelChan() chan *[]byte {\n\treturn mixPanelChanel\n}", "title": "" }, { "docid": "9bc52a23f87acb86a539ccf9bfd4c29f", "score": "0.57607174", "text": "func (r *Runner) GetChan() chan<- check.Check {\n\treturn r.pending\n}", "title": "" }, { "docid": "ee0f38c0d01effe3b6f4f74f5f4eefc9", "score": "0.5749082", "text": "func (c *Channels) InChannel(sessionID string, channelID string) bool {\n\tkey := getSessionChannelsKey(sessionID)\n\tcmd := c.cli.SIsMember(key, channelID)\n\treturn cmd.Val()\n}", "title": "" }, { "docid": "92c9702d5c856971946ad3a7c1885b1f", "score": "0.5710135", "text": "func (j *JumpAI) GetChannel(c chan string) {\n\tj.l.Lock()\n\tdefer j.l.Unlock()\n\n\tj.i = c\n}", "title": "" }, { "docid": "071735f9a9c9fc41916c3cb9184ac3df", "score": "0.5669559", "text": "func (p *Port) GetIncomingChannel(edge int) (error, chan interface{}) {\n\tif len(p.Incoming) > edge {\n\t\treturn nil, p.Incoming[edge].Channel\n\t} else {\n\t\treturn errors.New(\"Out of bounds\"), nil\n\t}\n}", "title": "" }, { "docid": "6dba3dd187df6e0f0744b14e0f5df382", "score": "0.56591356", "text": "func (wsock *WebSocketSink) In() chan<- interface{} {\n\treturn wsock.in\n}", "title": "" }, { "docid": "a3b9c0a3f94c8f76cc286e38e768b621", "score": "0.5621817", "text": "func (c *UpdateKubernetesCluster) GetChan() chan v1.Message {\n\treturn c.result\n}", "title": "" }, { "docid": "5e5a28a901f3e366bc959685c5e48a11", "score": "0.56212187", "text": "func (s *Syslog) GetOutputChan() chan events.LookatchEvent {\n\treturn s.OutputChannel\n}", "title": "" }, { "docid": "cfe7fc2ed973a5f47e8158d1747f73e3", "score": "0.5578628", "text": "func (this *NetServer) GetMsgChan(isConsensus bool) chan *types.MsgPayload {\n\tif isConsensus {\n\t\treturn this.ConsChan\n\t} else {\n\t\treturn this.SyncChan\n\t}\n}", "title": "" }, { "docid": "0db8df3ba8372c9f1540a4a25ee9e605", "score": "0.5483426", "text": "func (f *BasicFetcher) InputChannel() chan string {\n\treturn f.inputChannel\n}", "title": "" }, { "docid": "5b79b908f4355e74b0d7e50f832c471f", "score": "0.54588616", "text": "func (f *filterParam) GetOutCh() chan<- int {\n\treturn f.OutCh\n}", "title": "" }, { "docid": "114dcda4f299a396772526204ad07ce4", "score": "0.5439859", "text": "func (c *Cache) In() chan *points.Points {\n\tif c.inputChan == nil {\n\t\tc.inputChan = make(chan *points.Points, c.inputCapacity)\n\t}\n\treturn c.inputChan\n}", "title": "" }, { "docid": "420a6b74c4d594c64fdd297133db9185", "score": "0.5438941", "text": "func (gc *gossipChannel) IsMemberInChan(member discovery.NetworkMember) bool {\n\torg := gc.GetOrgOfPeer(member.PKIid)\n\tif org == nil {\n\t\treturn false\n\t}\n\n\treturn gc.IsOrgInChannel(org)\n}", "title": "" }, { "docid": "9fec4e849bacb7feab35bfe9b70ab151", "score": "0.5432419", "text": "func (p *Pipe) In() chan<- interface{} {\n\treturn p.in\n}", "title": "" }, { "docid": "a34357f7d25a5ecb55cd01ddd1620ff8", "score": "0.5427163", "text": "func (as *AerospikeSink) In() chan<- interface{} {\n\treturn as.in\n}", "title": "" }, { "docid": "a34357f7d25a5ecb55cd01ddd1620ff8", "score": "0.5427163", "text": "func (as *AerospikeSink) In() chan<- interface{} {\n\treturn as.in\n}", "title": "" }, { "docid": "653bd6bb17b470c8fdac79a900326bc6", "score": "0.54151464", "text": "func (m *EventsServer) InputChannel() chan *protos.Events {\n\treturn m.inCh\n}", "title": "" }, { "docid": "8d382753c34874f4f8efedaae2c80f30", "score": "0.5346665", "text": "func (c *Coordinator) GetRequestChannel() <-chan *protocol.RequestHandle {\n\treturn (<-chan *protocol.RequestHandle)(c.state.incomings)\n}", "title": "" }, { "docid": "4c6d750fb228c302aa406af3d607d30e", "score": "0.53371686", "text": "func (wc *workCluster) PopChan() chan interface{} {\n\treturn wc.outputChan\n}", "title": "" }, { "docid": "77f81989244146688c31244b796af292", "score": "0.5304192", "text": "func (h *MaxHub) ChanRecvFromOuter() chan interface{} {\n\treturn h.chanRecvFromOuter\n}", "title": "" }, { "docid": "0c79e3a8148226492458f1e14b48c8e2", "score": "0.52822465", "text": "func (m EP) Inbox() <-chan interface{} { return m.InQ }", "title": "" }, { "docid": "389ef41c3df4ed6e984ad7d7fd35948b", "score": "0.528188", "text": "func (srv *Server) IndChan() chan<- *MsgDiagMsgIndDst {\n\treturn srv.router.ch\n}", "title": "" }, { "docid": "7276d928e72f7b4694a6b49aba9583c8", "score": "0.5280152", "text": "func GetChannel(size int) <-chan broker.Job {\n\treturn b.getChannel(size)\n}", "title": "" }, { "docid": "71c3284a94624420dc0ddf2db398cdd8", "score": "0.5235576", "text": "func (t *SSHTransport) InChannel() {\n\t// Ensure we have a working channel\n\tt.in = make(chan SSHReply)\n\n\t// setup a buffered string channel\n\tgo func() {\n\t\tbuf := make([]byte, 1024)\n\t\ttmpS := \"\"\n\t\tn, err := t.ses.In.Read(buf) // this reads the ssh terminal\n\t\tif err == nil {\n\t\t\ttmpS = string(buf[:n])\n\t\t}\n\t\tfor err == nil {\n\n\t\t\tif strings.Contains(tmpS, \"#\") {\n\t\t\t\tparts := strings.Split(tmpS, \"#\")\n\t\t\t\tli := len(parts) - 1\n\t\t\t\tfor i := 0; i < li; i++ {\n\t\t\t\t\tr := t.K.PromptParse(t, &parts[i])\n\t\t\t\t\tif r == nil {\n\t\t\t\t\t\tr = &SSHReply{\n\t\t\t\t\t\t\tresult: parts[i],\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tt.in <- *r\n\t\t\t\t}\n\t\t\t\ttmpS = parts[li]\n\t\t\t}\n\t\t\tn, err = t.ses.In.Read(buf)\n\t\t\ttmpS += string(buf[:n])\n\t\t}\n\t\tlog.Debugf(\"In Channel closing: %v\", err)\n\t\tt.in <- SSHReply{\n\t\t\tresult: tmpS,\n\t\t\tprompt: \"\",\n\t\t}\n\t}()\n\n\t// Save first prompt\n\tt.LoginMessage = t.Run(\"\", 15)\n\tif DebugCount > 1 {\n\t\tt.LoginMessage.Info(t.Target)\n\t}\n}", "title": "" }, { "docid": "0cba0926bc2928d81670bef74ae972c3", "score": "0.52187425", "text": "func (client *SYRHandler) GetChanTerm() chan string {\n\treturn client.chanterm\n}", "title": "" }, { "docid": "aae0aea47868633f7c7c783d1e655972", "score": "0.5187647", "text": "func (m *Metrics) In() chan<- interface{} {\n\treturn m.in\n}", "title": "" }, { "docid": "6c275792c6968c485b9d6457b25ab950", "score": "0.51729363", "text": "func (r *BadRandomAI) GetChannel(c chan string) {\n\tr.l.Lock()\n\tdefer r.l.Unlock()\n\tr.i = c\n}", "title": "" }, { "docid": "67f17c3fac38ff28dfe7a4855b35b361", "score": "0.517004", "text": "func (cm *ChannelManager) GetChannel(f *font.Font, freq intrange.Range,\n\tfileNames ...string) (chan ChannelSignal, error) {\n\n\treturn getChannel(f, freq, cm.quitCh, fileNames...)\n}", "title": "" }, { "docid": "7a1f85c66554cf80d5502a5ef358bda5", "score": "0.5165528", "text": "func fanIn() {\n\teven := make(chan int)\n\todd := make(chan int)\n\tfanin := make(chan int)\n\n\tgo sendFanIn(even, odd)\n\n\tgo receiveFanIn(even, odd, fanin)\n\n\tfor v := range fanin {\n\t\tfmt.Println(v)\n\t}\n}", "title": "" }, { "docid": "ca45cd2a3b0a4c2bdf63de56c6835c7e", "score": "0.5155703", "text": "func (c *Computer) GetOutput() chan int {\n\treturn c.output\n}", "title": "" }, { "docid": "61ee560d97c9605443d3ab2f0e853f81", "score": "0.51512134", "text": "func (c *Channel) GetChannel() *Channel { return c }", "title": "" }, { "docid": "7203619ed14597d584536f31db85a53e", "score": "0.51368195", "text": "func GetSignalChannel() chan os.Signal {\n\treturn sigch\n}", "title": "" }, { "docid": "fba0dd73b2f13daea22e45e00e694830", "score": "0.51360977", "text": "func (o *OutChanInt) Chan() <-chan int {\n\treturn o.ch\n}", "title": "" }, { "docid": "4a81ff50b403b33c7981a0a7c8639f44", "score": "0.51184297", "text": "func (a *AsyncNetCounter) GetResultChan() <-chan URIInfo {\n\treturn a.outInfo\n}", "title": "" }, { "docid": "852976c233b1f3f21da1b6fbe935afc2", "score": "0.51126593", "text": "func (p *Provisioner) getMessageChan(id string) chan *updateMessage {\n\tp.id2chanLock.Lock()\n\tdefer p.id2chanLock.Unlock()\n\n\treturn p.id2chan[id]\n}", "title": "" }, { "docid": "2da1f03ef47f5f840ea02bf2fabbfde8", "score": "0.50843096", "text": "func getSetupChannel() chan string {\n\treturn gStatus\n}", "title": "" }, { "docid": "ccca92b7ab002b7fe3e83333060212a7", "score": "0.5071145", "text": "func (b *BaseStage) GetInputCh() *chan Mediator {\n\treturn b.InputCh\n}", "title": "" }, { "docid": "b0f72bc63119cd94cadc608e04fe51d8", "score": "0.5049916", "text": "func fanIn(c1, c2 <-chan string) <-chan string {\n\tc := make(chan string)\n\tgo func() {\n\t\tfor {\n\t\t\tc <- <-c1\n\t\t}\n\t}()\n\tgo func() {\n\t\tfor {\n\t\t\tc <- <-c2\n\t\t}\n\t}()\n\treturn c\n}", "title": "" }, { "docid": "26ee8811aaef061c3dbf0e580d2f46f8", "score": "0.5049635", "text": "func (o *OutChanInt32) Chan() <-chan int32 {\n\treturn o.ch\n}", "title": "" }, { "docid": "7a923ea631a6d475c080533bb7b83e72", "score": "0.5040681", "text": "func (c *IrcClient) ReadChannel() <-chan []byte {\n\treturn c.siphonchan\n}", "title": "" }, { "docid": "6b0fdeca3ea8b70a4ef6ac6cc43a82ed", "score": "0.50397563", "text": "func getPing(msg <-chan string) string {\n result := <-msg\n\n return result\n}", "title": "" }, { "docid": "9694ccc5e9c90d9ffc14509275c56858", "score": "0.5037872", "text": "func NewChan() chan InputEvent {\n\treturn make(chan InputEvent)\n}", "title": "" }, { "docid": "6c9070341cab48fd0f432351829457c7", "score": "0.50209916", "text": "func (um *UserManager) In(nick string) []string {\n\n\tvar res []string\n\n\tfor name, ch := range um.channels {\n\n\t\t_, ok := ch.users[nick]\n\t\tif ok {\n\t\t\tres = append(res, name)\n\t\t}\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "49dbefcb46d3c599e588fcde85c58e76", "score": "0.50200385", "text": "func GetOSSigChannel() chan os.Signal {\n\tc := make(chan os.Signal, 1)\n\n\tsignal.Notify(c,\n\t\tsyscall.SIGKILL,\n\t\tsyscall.SIGHUP,\n\t\tsyscall.SIGINT,\n\t\tsyscall.SIGTERM,\n\t\tsyscall.SIGQUIT,\n\t\tos.Interrupt)\n\n\treturn c\n}", "title": "" }, { "docid": "9e67160ec112f49b2ceaf49b8915e9d7", "score": "0.5020034", "text": "func (m *ChatMessage) GetChannelIdentity()(ChannelIdentityable) {\n val, err := m.GetBackingStore().Get(\"channelIdentity\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(ChannelIdentityable)\n }\n return nil\n}", "title": "" }, { "docid": "f606a6bb87c9a986190fa8bd035fa818", "score": "0.50174916", "text": "func (p *chnBroker) getChannel(size int) <-chan broker.Job {\n\tp.lock.Lock()\n\tdefer p.lock.Unlock()\n\n\tc := make(chan broker.Job, size)\n\tp.out = append(p.out, c)\n\treturn c\n}", "title": "" }, { "docid": "67c5241130c72bf089c9167e0452001e", "score": "0.5005728", "text": "func fanIn(input1, input2 <-chan string) <-chan string { // HL\n\tc := make(chan string)\n\tgo func() { // HL\n\t\tfor {\n\t\t\tselect { // HL\n\t\t\tcase s := <-input1:\n\t\t\t\tc <- s // HL\n\t\t\tcase s := <-input2:\n\t\t\t\tc <- s // HL\n\t\t\t} // HL\n\t\t}\n\t}()\n\treturn c\n}", "title": "" }, { "docid": "e902d9220dd8b4f5b7824aa5f8a36072", "score": "0.5001685", "text": "func (p *ChatPool) GetUnregisterChann() chan IClient {\n\treturn p.Unregister\n}", "title": "" }, { "docid": "b3145b74eddd87740a639fe3e434f9e1", "score": "0.5000122", "text": "func (self *JobPubSub) getSubChan(id string) chan interface{} {\n\tself.lock.Lock()\n\tdefer self.lock.Unlock()\n\n\tvar c chan interface{}\n\tif self.pubSubMap[id] != nil {\n\t\tc = self.pubSubMap[id].Sub(\"result\")\n\t\t//fmt.Printf(\"Subscribing to existing computing for %s \\n\", id)\n\t} else {\n\t\t//fmt.Printf(\"Creating new pubsub for %s \\n\", id)\n\t\tps := pubsub.New(1)\n\t\tself.pubSubMap[id] = ps\n\t}\n\treturn c\n}", "title": "" }, { "docid": "1e9367b5ef2f6ae40a0cbed2f3ada766", "score": "0.4989495", "text": "func (c *Client) GetChannelsIn() ([]models.Channel, error) {\n\trawResponse, err := c.ddp.Call(\"rooms/get\", map[string]int{\n\t\t\"$date\": 0,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdocument, _ := gabs.Consume(rawResponse.(map[string]interface{})[\"update\"])\n\n\tchans, err := document.Children()\n\n\tvar channels []models.Channel\n\n\tfor _, i := range chans {\n\t\tchannels = append(channels, models.Channel{\n\t\t\tID: stringOrZero(i.Path(\"_id\").Data()),\n\t\t\t//Default: stringOrZero(i.Path(\"default\").Data()),\n\t\t\tName: stringOrZero(i.Path(\"name\").Data()),\n\t\t\tType: stringOrZero(i.Path(\"t\").Data()),\n\t\t})\n\t}\n\n\treturn channels, nil\n}", "title": "" }, { "docid": "4e4891edf5bb11b8f1a11652b2d77ccf", "score": "0.49846026", "text": "func (o *OrderedPool) GetOutputCh() <-chan interface{} {\n\treturn o.outChan\n}", "title": "" }, { "docid": "609ee4ce41e41b93963cfc66a2ab23d1", "score": "0.49805123", "text": "func (client *Client) Incoming() MessageChan {\n\treturn client.requests\n}", "title": "" }, { "docid": "bd1a572c1e2b0c540a7c4693f1420b8c", "score": "0.49763173", "text": "func (this DelayChan) Get() (rv interface{}, ok bool) {\n\trv, ok = <-this.OutC\n\treturn\n}", "title": "" }, { "docid": "95458ced482ebc0e918aaa9194b8506f", "score": "0.4975012", "text": "func (s *Spock) GetChannel(name string) (Channel, bool) {\n\ts.Locks[\"Channels\"].Lock()\n\tchannel, exists := s.Channels[name]\n\ts.Locks[\"Channels\"].Unlock()\n\treturn channel, exists\n}", "title": "" }, { "docid": "651233459b29152883f63df2e84ad5d3", "score": "0.49695793", "text": "func (r *RunConfigController) ConfigChan() <-chan RunConfig {\n\treturn r.out\n}", "title": "" }, { "docid": "481cdd126d6318cdd790c4765430b728", "score": "0.4965264", "text": "func fanIn(input1, input2 <-chan string) <-chan string {\n\tc := make(chan string)\n\tgo func() {\n\t\tfor {\n\t\t\tc <- <-input1\n\t\t}\n\t}()\n\tgo func() {\n\t\tfor {\n\t\t\tc <- <-input2\n\t\t}\n\t}()\n\treturn c\n}", "title": "" }, { "docid": "4092b9398a6ea816c6976d87147607f2", "score": "0.49551603", "text": "func (p *Concatenator) In() *scipipe.InPort { return p.InPort(\"in\") }", "title": "" }, { "docid": "e06adbf9bdf6e654c10e1ef2828fbcf7", "score": "0.49507633", "text": "func fanIn(input1, input2 <-chan string) <-chan string {\n\tout := make(chan string)\n\tgo func() {\n\t\tfor {\n\t\t\tout <- <-input1 // take value off from input1 and onto channel out\n\t\t}\n\t}()\n\tgo func() {\n\t\tfor {\n\t\t\tout <- <-input2\n\t\t}\n\t}()\n\treturn out\n}", "title": "" }, { "docid": "c943e43941574f75386e20b4c555004a", "score": "0.49472207", "text": "func (gas *GasStation) GetEnterChannel() chan<- *Car {\n\treturn gas.enterChannel\n}", "title": "" }, { "docid": "373c49179c9c3b9698ec660b7d914b1f", "score": "0.49399415", "text": "func (pt *InPort) Recv() *FileIP {\n\treturn <-pt.Chan\n}", "title": "" }, { "docid": "b72919d7bdf28afc08333ab041d2eaba", "score": "0.49370864", "text": "func (a *Analyzer) InputChannel() chan []Frame {\n\treturn a.frameStream\n}", "title": "" }, { "docid": "a7f0d95720a9a641afa843dd39c91f13", "score": "0.49233463", "text": "func (p *ChatPool) GetRegisterChann() chan IClient {\n\treturn p.Register\n}", "title": "" }, { "docid": "22776bf7bed1dda0c332b35a6293edb6", "score": "0.4920717", "text": "func (s *Server) Inbox() <-chan *Envelope {\n\treturn s.inbox\n}", "title": "" }, { "docid": "0bb1617dcd5317785d91030219f5c65b", "score": "0.48986608", "text": "func (fm *Frame) OutputChan() chan<- interface{} {\n\treturn fm.ports[1].Chan\n}", "title": "" }, { "docid": "468a4c6a786ee73221f84f216f721a85", "score": "0.48979005", "text": "func (i *FanIn) MessageChan() <-chan types.Message {\n\treturn i.messageChan\n}", "title": "" }, { "docid": "01e6ba016e9801195c0246df11f0bffa", "score": "0.48916063", "text": "func (cm *ChannelManager) GetActiveChannel(f *font.Font, freq intrange.Range,\n\tfileNames ...string) (chan ChannelSignal, error) {\n\n\treturn getActiveChannel(f, freq, cm.quitCh, fileNames...)\n}", "title": "" }, { "docid": "c476fcd518e96b6f6d9e0050859f7a23", "score": "0.4884732", "text": "func (s *Syslog) GetCommitChan() chan interface{} {\n\treturn s.CommitChannel\n}", "title": "" }, { "docid": "545b85231e24977b3706564f33d49189", "score": "0.48697972", "text": "func (o *OutChanInterface) Chan() <-chan interface{} {\n\treturn o.ch\n}", "title": "" }, { "docid": "bb2d45c67b1ec3b51c11c069cde23a95", "score": "0.48641878", "text": "func (c *Human) Incoming() chan []byte {\n\tmutex.Lock()\n\tdefer mutex.Unlock()\n\treturn c.incoming\n}", "title": "" }, { "docid": "2c12459a92e10e49155ff8658643bdbb", "score": "0.48564684", "text": "func (t *packageType) getChanToWait() chan bool {\n\tt.rw.Lock()\n\tdefer t.rw.Unlock()\n\tdone := make(chan bool)\n\tt.chans = append(t.chans, done)\n\treturn done\n}", "title": "" }, { "docid": "0111a8bfe8d491f65bb357cb67521d66", "score": "0.48328805", "text": "func (p *Pipeline) Input() chan interface{} {\n\tif p.input == nil {\n\t\tp.input = p.NewChannel()\n\t}\n\n\treturn p.input\n}", "title": "" }, { "docid": "d278b9b0c384ec594947a2e1ac63df5e", "score": "0.48265648", "text": "func (r *Router) GetBottleChan() (chan *rhynock.Bottle) {\n\treturn r.bottle\n}", "title": "" }, { "docid": "4beb7f5db4778875a14c13cc98cb0b7a", "score": "0.48206222", "text": "func (p *ChatPool) GetBroadcastChann() chan Message {\n\treturn p.Broadcast\n}", "title": "" }, { "docid": "c4f52879347a6e680343d9bfad40ca10", "score": "0.4818231", "text": "func (w *watcher) ConfigChan() <-chan resmgrConfig {\n\treturn w.configChan\n}", "title": "" }, { "docid": "77e0d4df805f2bd89529f46a404bafea", "score": "0.48125398", "text": "func (rserver *rServer) Inbox() <-chan *LogEntry {\n\treturn rserver.Inner\n}", "title": "" }, { "docid": "ce8500fb3610bf2905335e64c8a207c3", "score": "0.4804283", "text": "func (s *Drain) GetOutput() <-chan interface{} {\n\treturn s.output\n}", "title": "" }, { "docid": "8f4e28d2f5c2ad48975f2f15367fca4d", "score": "0.4798152", "text": "func fanIn(input1, input2 <-chan string) <-chan string{\n\tc := make(chan string)\n\tgo func(){for {c<- <-input1}}()\n\tgo func(){for {c<- <-input2}}()\n\treturn c\n}", "title": "" }, { "docid": "9ad6867f22aefd6b1801d43848adb93d", "score": "0.47906372", "text": "func (fm *FlatMap) In() chan<- interface{} {\n\treturn fm.in\n}", "title": "" }, { "docid": "a7143a2db671237679ccc5eba3a779d1", "score": "0.47880045", "text": "func ChannelIn(vs ...string) predicate.Event {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Event(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldChannel), v...))\n\t})\n}", "title": "" }, { "docid": "f25a95ee264ac8065987c0b1380decf1", "score": "0.47771603", "text": "func (a *ParallelAnalyzer) GetProgressChan() chan CurrentProgress {\n\treturn a.progressOutChan\n}", "title": "" }, { "docid": "74248efa6ceb22ac840487b8318b9679", "score": "0.4775169", "text": "func (c Config) GetChannel(inherited ...string) string {\n\treturn configutil.CoalesceString(c.Channel, \"\", inherited...)\n}", "title": "" }, { "docid": "6ac1654aa71d4f50eb0d052e470e65bb", "score": "0.4762069", "text": "func (m *ConnectPinRequest) GetChannel() (x string) {\n\tif m == nil {\n\t\treturn x\n\t}\n\treturn m.Channel\n}", "title": "" }, { "docid": "08a5670be101b659a044c4c922042f92", "score": "0.4745661", "text": "func (o *OutChanInt64) Chan() <-chan int64 {\n\treturn o.ch\n}", "title": "" }, { "docid": "0c5059e3eb407d5575415a2fdecc415c", "score": "0.47437483", "text": "func (o *OutChanUint32) Chan() <-chan uint32 {\n\treturn o.ch\n}", "title": "" }, { "docid": "6de1544e1fa5f2c984b1eda4c3668f58", "score": "0.4725906", "text": "func (w *watchV2) GetChannel() *ChannelVersion {\n\treturn &ChannelVersion{V2: w.out}\n}", "title": "" }, { "docid": "6de1544e1fa5f2c984b1eda4c3668f58", "score": "0.4725906", "text": "func (w *watchV2) GetChannel() *ChannelVersion {\n\treturn &ChannelVersion{V2: w.out}\n}", "title": "" }, { "docid": "51acef1e0ca2b469d514f49ccdbb3d77", "score": "0.47212473", "text": "func (cm *FakeConsumer) Channel() string {\n\treturn cm.config.Channel\n}", "title": "" }, { "docid": "942d27cc88ab20814b5733c52f2c99f3", "score": "0.47178563", "text": "func (t *Tracker) GetChannel(name string) *ChannelState {\n\tt.RLock()\n\tdefer t.RUnlock()\n\n\treturn t.channels[name]\n}", "title": "" }, { "docid": "f492f902836a4428922ae8368ff10c55", "score": "0.4702753", "text": "func (inmsg *IncomingMessage) Channel() string {\n\treturn inmsg.sb.channels[inmsg.channel].Name\n}", "title": "" }, { "docid": "a3e85af511061f04a507258f9d2d7ddb", "score": "0.46988058", "text": "func GetChannel(f *font.Font, freq intrange.Range, fileNames ...string) (chan ChannelSignal, error) {\n\treturn getChannel(f, freq, timing.ClearDelayCh, fileNames...)\n}", "title": "" }, { "docid": "4e85464b6399f0e9c36f1eebb0d7175e", "score": "0.4692468", "text": "func GetChannel(guild *dstate.GuildState, channel int64) int64 {\n\tc := guild.Channel(true, channel)\n\tif c == nil {\n\t\treturn 0\n\t}\n\n\treturn c.ID\n}", "title": "" } ]
45207ac9d37b0dcea2a72895e83ebe66
Len returns the number of entries in this FST instance.
[ { "docid": "38c0a7352d2ee768a7e4eb29e942071a", "score": "0.79668295", "text": "func (f *FST) Len() int {\n\treturn f.len\n}", "title": "" } ]
[ { "docid": "6ecd191f2e5b523d10fc3e0c19ce2362", "score": "0.8214504", "text": "func (t *Tree) Len() int64 { return t.count }", "title": "" }, { "docid": "40ba4bdd887401a3200e8090760d146c", "score": "0.81776804", "text": "func (t *Tree) Len() int {\n return t.count\n}", "title": "" }, { "docid": "095e9dfc13d1835d3b49955a16f78713", "score": "0.80955225", "text": "func (t *Tree) Len() int {\n\treturn t.Count\n}", "title": "" }, { "docid": "3c34c00ab72d293946d225c96183435f", "score": "0.80277205", "text": "func (t *Tree) Len() int {\n\treturn t.size\n}", "title": "" }, { "docid": "90e207b4a5f32c524a36e7e75d25dc75", "score": "0.79270554", "text": "func (t *Tree[VT]) Len() int {\n\treturn t.size\n}", "title": "" }, { "docid": "c544906657ba9739a29559e80bfd1cdc", "score": "0.79035735", "text": "func (t *Tree) Len() int {\n\tif t.root != nil {\n\t\treturn t.root.size\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "0d1e295153b9e9a70cc4720f0e5dc5a5", "score": "0.78382695", "text": "func (this *TernarySearchTree) Len() int {\n\treturn this.length\n}", "title": "" }, { "docid": "fb508b59ab807705338e8ff23007d275", "score": "0.7824882", "text": "func (tree *Paths) Len() int {\n\treturn tree.size\n}", "title": "" }, { "docid": "66e6cf717d285db4a5afc857bc5aec95", "score": "0.7671551", "text": "func (tr *bTree) Len() int {\n\treturn tr.count\n}", "title": "" }, { "docid": "c4f415082d9c34d7a2af4e6f8ad7b1ce", "score": "0.7622616", "text": "func (rbt *RedBlackTree) Len() int {\n\trbt.rlock()\n\tdefer rbt.runlock()\n\n\treturn rbt.len()\n}", "title": "" }, { "docid": "12472476b236ad24cb196b5f61138e76", "score": "0.75862294", "text": "func (tr *Tree) Len() int {\n\tif tr.safe {\n\t\tdefer tr.mu.RUnlock()\n\t\ttr.mu.RLock()\n\t}\n\treturn tr.length\n}", "title": "" }, { "docid": "d70b32d1c388b71728e8013a69178a4e", "score": "0.7549797", "text": "func (s *Sparse) Len() int {\n\tif s.root == nil {\n\t\treturn 0\n\t}\n\treturn s.root.len()\n}", "title": "" }, { "docid": "6e69bceb560e7a019eb69afe1f13a9dd", "score": "0.7524409", "text": "func (t *Tree) Length() int {\n\treturn t.length\n}", "title": "" }, { "docid": "4febfcd07fff7deb777133692d653913", "score": "0.7499722", "text": "func (tree *btree) Len() uint64 {\n\treturn tree.number\n}", "title": "" }, { "docid": "0dab99d26f12097dd3e773836512fa66", "score": "0.7489816", "text": "func (r *Root) Len() int {\n\tvar l int\n\tfor _, t := range r.Subtree.Nodes {\n\t\tl += t.Len()\n\t}\n\n\treturn l\n}", "title": "" }, { "docid": "e00db91d67bbc451c5051236c457f411", "score": "0.7474464", "text": "func (th treeHeap) Len() int { return len(th) }", "title": "" }, { "docid": "81ac4620f0c8b1ec751c1c7cec6c1e22", "score": "0.7466863", "text": "func (n *nodes) Len() int { return len(*n) }", "title": "" }, { "docid": "dfe82bff48705cf2f26fcc531dfbbbce", "score": "0.745144", "text": "func (bt *BTree) Len() int {\n\tbt.rlock()\n\tdefer bt.runlock()\n\n\treturn bt.len()\n}", "title": "" }, { "docid": "7047d18a4241b1aab79e85019630ed5b", "score": "0.7442063", "text": "func (s *MapStore) Len() int {\n\treturn len(s.entries)\n}", "title": "" }, { "docid": "22b10be49537052c7ebd797123ad77f9", "score": "0.74406445", "text": "func (t *File) Len() uint64 {\n\tvar descend func(t *File) uint64\n\n\tdescend = func(t *File) uint64 {\n\t\tsize := uint64(1)\n\n\t\tfor _, child := range t.Children {\n\t\t\tsize += descend(child)\n\t\t}\n\n\t\treturn size\n\t}\n\n\treturn descend(t)\n}", "title": "" }, { "docid": "3075d3ac24c8f3f2f8e3d871bdd0917f", "score": "0.73663193", "text": "func (d *distanceHeap) Len() int { return len(d.nodes) }", "title": "" }, { "docid": "8607ee9a6882001e478f8c0746ff53ab", "score": "0.7365866", "text": "func (b *BTree) Len() int {\n\treturn b.length\n}", "title": "" }, { "docid": "15f935d862c6be5820305f2afc6e484f", "score": "0.7315493", "text": "func (s *Float64Map) Len() int {\n\treturn int(atomic.LoadInt64(&s.length))\n}", "title": "" }, { "docid": "16149a2ce61e927e9c34e35f7ff9e4f3", "score": "0.72989213", "text": "func (hns huffmanNodes) Len() int {\n\treturn len(hns)\n}", "title": "" }, { "docid": "613a6ff75a4904f8b8bf9da0f404be8b", "score": "0.72715974", "text": "func (n *Node) Len() int {\n\tn.m.RLock()\n\tl := len(n.childIndexMap)\n\tn.m.RUnlock()\n\treturn l\n}", "title": "" }, { "docid": "565f63452c4ed9e73ffc620d3c7009de", "score": "0.725157", "text": "func (t *Tree) Length() uint64 {\n\tt.mtx.RLock()\n\tr := t.length\n\tt.mtx.RUnlock()\n\treturn r\n}", "title": "" }, { "docid": "53bfa3a54338ab77f0ef694c79ffb45d", "score": "0.72473305", "text": "func (r *Registry) Len() uint64 {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\treturn uint64(len(r.entries))\n}", "title": "" }, { "docid": "0e8b56796172d008a7bfbae5a55d8269", "score": "0.7211816", "text": "func (n *Node) Len() int {\n\treturn n.node.Len()\n}", "title": "" }, { "docid": "e5b5c7179257bea4a1971d29985e7794", "score": "0.7210829", "text": "func (s *Float32Map) Len() int {\n\treturn int(atomic.LoadInt64(&s.length))\n}", "title": "" }, { "docid": "1ffad764d6d84778f3669f9d58c5237d", "score": "0.7206743", "text": "func (hp *nodeHeap) Len() int { return len(hp.Nodes) }", "title": "" }, { "docid": "d9fcd351330f0f09bae0ab8d8e80e4d4", "score": "0.71793103", "text": "func (mr *merkleRoots) len() int {\n\treturn mr.numMerkleRoots\n}", "title": "" }, { "docid": "6775646d3851b193d8ee997b37b400c9", "score": "0.7166331", "text": "func (lru *LRU) Len() int {\n\treturn len(lru.entries)\n}", "title": "" }, { "docid": "eb1dfb15e47ad95e9d68babc7fb5db95", "score": "0.71439654", "text": "func (t Traces) Len() int { return len(t) }", "title": "" }, { "docid": "097815ad4d33aa0f395153efe0bc3361", "score": "0.7127288", "text": "func (p *pathHeap) Len() int { return len(p.paths) }", "title": "" }, { "docid": "09e809fb91cbd039b52d33642b0ebf3c", "score": "0.71199614", "text": "func (p nameLeafDataList) Len() int {\n\treturn len(p)\n}", "title": "" }, { "docid": "11f5999fef06124b9242ba78c766814b", "score": "0.7113114", "text": "func (s *Set) Length() int {\n\treturn s.root.Length()\n}", "title": "" }, { "docid": "bbb1c0b904b09b26847791836565ee58", "score": "0.71004754", "text": "func (m *Map) Len() int {\n\treturn m.n\n}", "title": "" }, { "docid": "898897a5f22808d2c427c57f29410056", "score": "0.7089474", "text": "func (r *Ring) Len() int {\n\treturn len(r.vnodes)\n}", "title": "" }, { "docid": "53c29a247dedf9fed38606af0d8ad4b2", "score": "0.7089084", "text": "func (s *Stack) Len() int {\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\treturn len(s.nodes)\n}", "title": "" }, { "docid": "5f5249aea9111853f196f6ff63660677", "score": "0.707925", "text": "func (s lruEntries) Len() int { return len(s) }", "title": "" }, { "docid": "eaac53bb6270f8df2ab5a88060ed06f4", "score": "0.70754015", "text": "func (e LogEntries) Len() int {\n\treturn len(e.Entries)\n}", "title": "" }, { "docid": "70e2a7dabc381821345908ca8b923e98", "score": "0.7064932", "text": "func (f FloatHeap) Len() int {\n\treturn len(f)\n}", "title": "" }, { "docid": "183a7cd05076c1996237956687e21189", "score": "0.7059284", "text": "func (s S) Len() int {\n\treturn len(s.t)\n}", "title": "" }, { "docid": "3d40b2b95921bb03aefc3d0661a41286", "score": "0.7054448", "text": "func (h *HashMap) Len() int {\n\treturn h.count\n}", "title": "" }, { "docid": "a3fb6eeae0c6d13df8cdc5bdae7e33e4", "score": "0.7044584", "text": "func (s *Base) Len() int {\n\treturn MetaLen + s.NumINF*path.InfoLen + s.NumHops*path.HopLen\n}", "title": "" }, { "docid": "e8fa825bcbe35dc01981dbb5b0a58173", "score": "0.70251", "text": "func (h NodeHeap) Len() int { return len(h) }", "title": "" }, { "docid": "a7d744c002d18794bfd4abdce41eb451", "score": "0.70142", "text": "func (h *topNHeap) Len() int {\n\treturn h.size\n}", "title": "" }, { "docid": "9ebd4e5d931c411c8c2d8ad9d6085642", "score": "0.70005155", "text": "func (s *NodeStack) Len() int { return len(*s) }", "title": "" }, { "docid": "dfd7f2ea604b8f911922413dd8a93186", "score": "0.6994131", "text": "func (s SortableEntries) Len() int {\n\treturn len(s)\n}", "title": "" }, { "docid": "8da757bfb84494fa99ace73d152309eb", "score": "0.69721645", "text": "func (d *Stack) Len() int {\n\t// Use atomic so that getting Len() is independent from our internal Mutex.\n\treturn int(atomic.LoadInt64(&d.length))\n}", "title": "" }, { "docid": "69e95ea8052b577b818b126c7ef6c005", "score": "0.69585973", "text": "func (l *LinkedList[TElem]) Len() int { return l.len }", "title": "" }, { "docid": "418ba4e62c6562eb6f2f2d1949f443eb", "score": "0.695617", "text": "func (hm *HashMap) Len() int {\n\treturn len(hm.content)\n}", "title": "" }, { "docid": "df3f437409f6187df6527d31b0a82c18", "score": "0.69462913", "text": "func (p List) Len() int {\n\tif p.seg == nil {\n\t\treturn 0\n\t}\n\treturn int(p.length)\n}", "title": "" }, { "docid": "3ce1b889924c3ba306d0598339c82aee", "score": "0.6942275", "text": "func (g *GoldenTrace) Len() int {\n\treturn len(g.Digests)\n}", "title": "" }, { "docid": "3ce1b889924c3ba306d0598339c82aee", "score": "0.6942275", "text": "func (g *GoldenTrace) Len() int {\n\treturn len(g.Digests)\n}", "title": "" }, { "docid": "2e26db48a1baa0765b66d95978d289dc", "score": "0.69418997", "text": "func (pit *Pit) Len() int {\n\treturn int(pit.nEntries)\n}", "title": "" }, { "docid": "392ec8937191c5a72476fe555366d8f5", "score": "0.6941829", "text": "func (h distHeap) Len() int {return len(h)}", "title": "" }, { "docid": "dea2c26298747b6db752a94483575593", "score": "0.69316643", "text": "func (f *forthstack) Length() int {\n\treturn len(f.stack)\n}", "title": "" }, { "docid": "d2e82337a3f1e97912860a59ddb781f1", "score": "0.6930262", "text": "func (s *orderedTaxonomySorter) Len() int {\n\treturn len(s.taxonomy)\n}", "title": "" }, { "docid": "c0d8fe01b0ccdbb0307dac09700466cd", "score": "0.6927335", "text": "func (t *FHQTreap) Size() int {\r\n\treturn t.nodes[t.root].size\r\n}", "title": "" }, { "docid": "c4e392888ece0493548231758e871109", "score": "0.6921952", "text": "func (t *Immutable) Len() int {\n\treturn t.count\n}", "title": "" }, { "docid": "f10076de34fbfbbd6e0d3b88e8415d7a", "score": "0.692058", "text": "func (s *stack) Len() int {\n\treturn s.size\n}", "title": "" }, { "docid": "a2de54d6f8aeb4c14a2dfaa9b19e08f4", "score": "0.69200784", "text": "func (sfs *RegistryStorageFiles) Len() int {\n\tif sfs == nil {\n\t\treturn 0\n\t}\n\tcount := len(sfs.Blobs) + len(sfs.Repos)\n\tfor _, links := range sfs.ManifestLinks {\n\t\tcount += len(links)\n\t}\n\tfor _, links := range sfs.LayerLinks {\n\t\tcount += len(links)\n\t}\n\treturn count\n}", "title": "" }, { "docid": "0918367f7e16eef791a2869f9f7cb42a", "score": "0.69151455", "text": "func (s *Stack) Len() int {\n\ts.mtx.Lock()\n\tdefer s.mtx.Unlock()\n\n\treturn s.size\n}", "title": "" }, { "docid": "e168184968554c5e091c0d8aa6df2f54", "score": "0.6903673", "text": "func (s *Store) Len(ctx context.Context) (int64, error) {\n\ts.μ.Lock()\n\tdefer s.μ.Unlock()\n\tif err := s.initKeyMap(ctx); err != nil {\n\t\treturn 0, err\n\t}\n\tvar n int64\n\ts.keymap.Inorder(func(key string) bool {\n\t\tn++\n\t\treturn true\n\t})\n\treturn n, nil\n}", "title": "" }, { "docid": "016f9879437527c73498303001c36d01", "score": "0.6898793", "text": "func (e *Feature) Len() int { return e.End() - e.Start() }", "title": "" }, { "docid": "016f9879437527c73498303001c36d01", "score": "0.6898793", "text": "func (e *Feature) Len() int { return e.End() - e.Start() }", "title": "" }, { "docid": "be467d5e43cc0770a9d7296dd3910db0", "score": "0.6889945", "text": "func (s *stack) Len() int {\n\treturn len(s.data)\n}", "title": "" }, { "docid": "59d459a4a13084690ca155ac735037fa", "score": "0.6877039", "text": "func (s *StackInf) Len() int {\n\treturn (s.top + 1)\n}", "title": "" }, { "docid": "4abf1d2c476223bf7c3455e45df2b1b8", "score": "0.687429", "text": "func (s *Stack) Len() int {\n\ts.m.Lock()\n\tdefer s.m.Unlock()\n\treturn s.size\n}", "title": "" }, { "docid": "6416638f36a048af95ee2cd885177ab7", "score": "0.6871601", "text": "func (a Diary) Len() int { return len(a) }", "title": "" }, { "docid": "3610b1e7480de347f6c2d0c493f622ff", "score": "0.6867311", "text": "func (stack *Stack) Len() int {\n\treturn stack.List.Len()\n}", "title": "" }, { "docid": "cccb4c943f10f002b18f362deaffdbda", "score": "0.6865774", "text": "func (pit *Pit) Len() int {\n\treturn int(C.Pit_CountEntries(pit.getPtr()))\n}", "title": "" }, { "docid": "83273761714e36d55bfd4704f6678434", "score": "0.68583566", "text": "func (ms *MultiSorter) Len() int {\n\treturn len(ms.nodes)\n}", "title": "" }, { "docid": "83273761714e36d55bfd4704f6678434", "score": "0.68583566", "text": "func (ms *MultiSorter) Len() int {\n\treturn len(ms.nodes)\n}", "title": "" }, { "docid": "eee2fa36a16cca26ffc43b72373acbc8", "score": "0.6851725", "text": "func (s *Stack) Len() int {\n\treturn s.size\n}", "title": "" }, { "docid": "eee2fa36a16cca26ffc43b72373acbc8", "score": "0.6851725", "text": "func (s *Stack) Len() int {\n\treturn s.size\n}", "title": "" }, { "docid": "eee2fa36a16cca26ffc43b72373acbc8", "score": "0.6851725", "text": "func (s *Stack) Len() int {\n\treturn s.size\n}", "title": "" }, { "docid": "758a25c6d9967c6699af31f43903bccd", "score": "0.68507326", "text": "func (g graph) Len() int {\n\treturn len(g)\n}", "title": "" }, { "docid": "d271241e8f47111ee676910e7d43df5e", "score": "0.68480474", "text": "func (stack Stack) Len() int {\n\treturn len(stack)\n}", "title": "" }, { "docid": "d271241e8f47111ee676910e7d43df5e", "score": "0.68480474", "text": "func (stack Stack) Len() int {\n\treturn len(stack)\n}", "title": "" }, { "docid": "d271241e8f47111ee676910e7d43df5e", "score": "0.68480474", "text": "func (stack Stack) Len() int {\n\treturn len(stack)\n}", "title": "" }, { "docid": "4b9295dfc6f40a90dc6529a9f3cf1d52", "score": "0.68445915", "text": "func (mh minHeap) Len() int {\n\treturn len(mh)\n}", "title": "" }, { "docid": "c5c1c4f6549f5aafe716af607410703a", "score": "0.6841376", "text": "func (es *Stack) Len() int {\n\treturn es.size\n}", "title": "" }, { "docid": "7f6bd1a82d145d6dfed61b4e61b640d8", "score": "0.6839325", "text": "func (s *Uint64Map) Len() int {\n\treturn int(atomic.LoadInt64(&s.length))\n}", "title": "" }, { "docid": "fe5acf38bd3e60f80c893d86583fe0e1", "score": "0.68382853", "text": "func (l *List) Len() int {\r\n\treturn l.N\r\n}", "title": "" }, { "docid": "822b15fd3a26bf7e02fe08bf3ea7b5c2", "score": "0.68364096", "text": "func (b *Bucket) Len() int {\n\tb.mutex.RLock()\n\tdefer b.mutex.RUnlock()\n\n\tvar total int\n\tfor i := k - 1; i >= 0; i-- {\n\t\tif b.nodes[i] == nil {\n\t\t\tbreak\n\t\t}\n\t\ttotal++\n\t}\n\treturn total\n}", "title": "" }, { "docid": "826f583d17cc7e7e2c2da6293a90a094", "score": "0.68360484", "text": "func (m *Map) Len() int {\n\tif m != nil {\n\t\treturn m.length\n\t}\n\treturn 0\n}", "title": "" }, { "docid": "58e5cae302deb7b856842eed78bd9f16", "score": "0.68295145", "text": "func (e *queueEntry) Length() int64 {\n\treturn int64(len(e.view))\n}", "title": "" }, { "docid": "2bca8edb885d7c5a1936c776858c9849", "score": "0.6827982", "text": "func (e EdgeList) Len() int {\n\treturn len(e)\n}", "title": "" }, { "docid": "57c1453fae037789f50ad07c0b5ee980", "score": "0.6826762", "text": "func (l *Lru) Len() int {\n\treturn len(l.kvMap)\n}", "title": "" }, { "docid": "d0b2f9fc4cd0aea42e5efa2bad494c13", "score": "0.6823178", "text": "func (this *Stack) Len() int {\n\treturn this.length\n}", "title": "" }, { "docid": "d0b2f9fc4cd0aea42e5efa2bad494c13", "score": "0.6823178", "text": "func (this *Stack) Len() int {\n\treturn this.length\n}", "title": "" }, { "docid": "d0b2f9fc4cd0aea42e5efa2bad494c13", "score": "0.6823178", "text": "func (this *Stack) Len() int {\n\treturn this.length\n}", "title": "" }, { "docid": "d0b2f9fc4cd0aea42e5efa2bad494c13", "score": "0.6823178", "text": "func (this *Stack) Len() int {\n\treturn this.length\n}", "title": "" }, { "docid": "d0b2f9fc4cd0aea42e5efa2bad494c13", "score": "0.6823178", "text": "func (this *Stack) Len() int {\n\treturn this.length\n}", "title": "" }, { "docid": "302e245873f955d724ffd42f563bd7b0", "score": "0.6822948", "text": "func (s *Stack) Len() int {\n\ts.mu.RLock()\n\tdefer s.mu.RUnlock()\n\n\treturn s.length\n}", "title": "" }, { "docid": "1d31853640e9e26f7d6377a70d653096", "score": "0.681264", "text": "func (rb *RedBlackBST) size() int { \n\treturn rb.N\n}", "title": "" }, { "docid": "73cc85f8fe7a129042049d22a8d3bc56", "score": "0.68095756", "text": "func (f *list) Len() int {\n\treturn len(f.val)\n}", "title": "" }, { "docid": "181efd34efcfaf450028f6cbec7c86db", "score": "0.68060803", "text": "func (s *Stack) Len() int {\r\n\treturn len(s.a)\r\n}", "title": "" } ]
c05c6a66f8ba1227a35fc8505499a735
readConnectionConfigFile read connection config file
[ { "docid": "fb4b5600f5e1b702e5e6ad35838d307b", "score": "0.847561", "text": "func readConnectionConfigFile() error {\n\n\tconfigPath := getPath()\n\tfileContent, err := ioutil.ReadFile(configPath + \"/\" + connectionConfigFile)\n\tif err != nil {\n\t\tfmt.Println(\"Error read config file:\", err)\n\t\treturn err\n\t}\n\n\t// expand environment variables\n\tfileContent = []byte(os.ExpandEnv(string(fileContent)))\n\tif err := yaml.Unmarshal(fileContent, &connectionConfig); err != nil {\n\t\tfmt.Println(\"Error Unmarshal:\", err)\n\t\treturn err\n\t}\n\n\t// fmt.Println(\"Load connection config:\", connectionConfig)\n\treturn nil\n}", "title": "" } ]
[ { "docid": "1530033589cb48a0ff773d7bd977496b", "score": "0.70411134", "text": "func GetConnectionString(configFilePath string) string {\n\tfile, err := os.Open(configFilePath)\n\tif err != nil {\n\t\tlog.Fatal().Err(err).Msg(\"error loading configuration file\")\n\t\tpanic(err)\n\t}\n\tdefer file.Close()\n\n\tdataSource := &dataSource{}\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tif equal := strings.Index(line, \"=\"); equal >= 0 {\n\t\t\tvalue := \"\"\n\t\t\tif len(line) > equal {\n\t\t\t\tvalue = strings.TrimSpace(line[equal+1:])\n\t\t\t}\n\t\t\tif key := strings.TrimSpace(line[:equal]); len(key) > 0 {\n\t\t\t\tswitch key {\n\t\t\t\tcase \"db_host\":\n\t\t\t\t\tdataSource.host = value\n\t\t\t\tcase \"db_port\":\n\t\t\t\t\tdataSource.port = value\n\t\t\t\tcase \"db_name\":\n\t\t\t\t\tdataSource.dbname = value\n\t\t\t\tcase \"db_user\":\n\t\t\t\t\tdataSource.user = value\n\t\t\t\tcase \"db_password\":\n\t\t\t\t\tdataSource.password = value\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Sprintf(\"user='%s' password='%s' dbname='%s' host='%s' port='%s' sslmode=disable\", dataSource.user, dataSource.password, dataSource.dbname, dataSource.host, dataSource.port)\n}", "title": "" }, { "docid": "55cb5bae423c46209397029695b46880", "score": "0.6989995", "text": "func ReadConfig(path string) ([]ConnectionInfo, map[Protocol]ConnectionInfo) {\n var config struct {\n Frontends []ConnectionInfo\n Backends map[Protocol]ConnectionInfo\n }\n\n configFile, err := os.Open(path)\n if err != nil {\n fmt.Println(\"Could not open config file: \", err.Error())\n }\n\n jsonParser := json.NewDecoder(configFile)\n if err = jsonParser.Decode(&config); err != nil {\n fmt.Println(\"Could not parse config file: \", err.Error())\n }\n\n return config.Frontends, config.Backends\n}", "title": "" }, { "docid": "0c433ff53df11266384a97d6c06aeb02", "score": "0.67563146", "text": "func LoadConfigFile() {\n\tif err := readConnectionConfigFile(); err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "d889cbab8e3d258fa3736289afdf8565", "score": "0.6750366", "text": "func (conf *Configuration) readConfig() (err error) {\n\n\ttracelog.Started(\"Configuration\", \"readConfig\")\n\ttracelog.Info(\"Configuration\", \"readConfig\", \"Reading Config file\")\n\tvar file *os.File\n\tfile, err = os.Open(\"./config.json\")\n\tif err != nil {\n\t\ttracelog.Info(\"Configuraton\", \"readConfig\", \"Couldn't open the file\")\n\t\ttracelog.CompletedError(err, \"Configuration\", \"readConfig\")\n\t\treturn\n\t}\n\tdefer file.Close()\n\tdecoder := json.NewDecoder(file)\n\n\tdecodeResult := decoder.Decode(conf)\n\tif decodeResult != nil {\n\t\ttracelog.Info(\"Configuration\", \"readConfig\", \"File content decoding failed\")\n\t}\n\n\ttracelog.Info(\"Configuration\", \"readConfig\", \"ServerIp: %s \", conf.ServerIP)\n\ttracelog.Info(\"Configuration\", \"readConfig\", \"ServerPort: %s\", conf.ServerPort)\n\ttracelog.Info(\"Configuration\", \"readConfig\", \"ServerPort: %s\", conf.FilePath)\n\n\ttracelog.Completed(\"Configuration\", \"readConfig\")\n\treturn\n\n}", "title": "" }, { "docid": "db6ec45d0a2db23de0d015f0ecf2e8cf", "score": "0.6602144", "text": "func ReadConfigFile(filename string) (Config, error) {\n\tvar config Config\n\n\t_, err := toml.DecodeFile(filename, &config)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\n\tif config.Server.Address == \"\" {\n\t\treturn config, fmt.Errorf(\"missing server address\")\n\t}\n\n\tif config.NumWorkers < 1 {\n\t\treturn config, fmt.Errorf(\"NumWorkers must be greater than 0\")\n\t}\n\n\tif config.Server.GRPCTimeout < 1 {\n\t\t// If timeout not specified, set to default\n\t\tconfig.Server.GRPCTimeout = 2\n\t}\n\treturn config, nil\n}", "title": "" }, { "docid": "4d71ff548814552bd3a161e073e54efe", "score": "0.65932274", "text": "func readConfig(filePath string) error {\n\tif err := gcfg.ReadFileInto(&ConfigData, filePath); err != nil {\n\t\treturn err\n\t}\n\n\treturn ConfigData.validate()\n}", "title": "" }, { "docid": "9fe01b2cc21aac3e694d2ca5901f006e", "score": "0.6553194", "text": "func readConfig(confFilePath string) (configFile, error) {\n\tvar config configFile\n\n\tconfFile, err := ioutil.ReadFile(confFilePath)\n\tif err != nil {\n\t\treturn config, err\n\n\t}\n\n\tjson.Unmarshal(confFile, &config)\n\treturn config, nil\n}", "title": "" }, { "docid": "153d2094aa677ff629bb50d01ba64a1b", "score": "0.64989406", "text": "func readConfig() {\n\tvar configfile = \"res/config.toml\"\n\t_, err := os.Stat(configfile)\n\tif err != nil {\n\t\tlog.Fatal(\"Config file is missing: \", configfile, err)\n\t}\n\n\tconfig_data, err := toml.LoadFile(configfile)\n\t\n\tif err != nil {\n \tlog.Fatal(\"Error \", err.Error())\n\t} else {\n\t\tinitialized = 1\n\t\tConfiguration.Username = config_data.Get(\"sql-database.username\").(string)\n \tConfiguration.Password = config_data.Get(\"sql-database.password\").(string)\n\t}\n}", "title": "" }, { "docid": "4bb66beec383067820819b274954f35d", "score": "0.6455748", "text": "func (n *DcrdTestServer) RPCConnectionConfig() rpcclient.ConnConfig {\n\tfile := n.CertFile()\n\tfmt.Println(\"reading: \" + file)\n\tcert, err := ioutil.ReadFile(file)\n\tCheckTestSetupMalfunction(err)\n\n\treturn rpcclient.ConnConfig{\n\t\tHost: n.rpcListen,\n\t\tEndpoint: n.endpoint,\n\t\tUser: n.rpcUser,\n\t\tPass: n.rpcPass,\n\t\tCertificates: cert,\n\t\tDisableAutoReconnect: true,\n\t\tHTTPPostMode: false,\n\t}\n}", "title": "" }, { "docid": "8d4f5eb791105d4f5c7cfa658d98bc4d", "score": "0.6441635", "text": "func ReadConfig() (CNSConfig, error) {\n\tvar cnsConfig CNSConfig\n\n\t// Check if env set for config path otherwise use default path\n\tconfigpath, found := os.LookupEnv(\"CNS_CONFIGURATION_PATH\")\n\tif !found {\n\t\tdir, err := common.GetExecutableDirectory()\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"[Configuration] Failed to find exe dir:%v\", err)\n\t\t\treturn cnsConfig, err\n\t\t}\n\n\t\tconfigpath = filepath.Join(dir, defaultConfigName)\n\t}\n\n\tlogger.Printf(\"[Configuration] Config path:%s\", configpath)\n\n\tcontent, err := ioutil.ReadFile(configpath)\n\tif err != nil {\n\t\tlogger.Errorf(\"[Configuration] Failed to read config file :%v\", err)\n\t\treturn cnsConfig, err\n\t}\n\n\terr = json.Unmarshal(content, &cnsConfig)\n\treturn cnsConfig, err\n}", "title": "" }, { "docid": "1d27c18d13bc35cb3acf46c943b8dd1e", "score": "0.6436121", "text": "func (node *DefaultTestNode) RPCConnectionConfig() *rpcclient.ConnConfig {\n\tfile := node.CertFile()\n\tfmt.Println(\"reading: \" + file)\n\tcert, err := ioutil.ReadFile(file)\n\tintegration.CheckTestSetupMalfunction(err)\n\n\treturn &rpcclient.ConnConfig{\n\t\tHost: node.rpcListen,\n\t\tEndpoint: node.endpoint,\n\t\tUser: node.rpcUser,\n\t\tPass: node.rpcPass,\n\t\tCertificates: cert,\n\t\tDisableAutoReconnect: true,\n\t\tHTTPPostMode: false,\n\t}\n}", "title": "" }, { "docid": "05a4a482e64999c2bd5909323ac07d3a", "score": "0.6434176", "text": "func ReadConf() (mongo.Conn, error) {\n\tconn := mongo.Conn{}\n\n\tuserHome, err := user.Current()\n\tif err != nil {\n\t\treturn conn, err\n\t}\n\tconfFile := userHome.HomeDir + \"/.aityconf\"\n\n\t// Decode the string representation to a conn struct\n\t_, err = toml.DecodeFile(confFile, &conn)\n\treturn conn, err\n}", "title": "" }, { "docid": "db48cefe1b0bd5cdbfa47d14cbd1ed6d", "score": "0.63907176", "text": "func readConfigFile(filename string) (*configBody, error) {\n\tcfg := &configBody{}\n\n\t// Can ignore gosec G304 because the file path is forced within config subfolder\n\t//nolint:gosec\n\tyamlFile, err := os.ReadFile(filename)\n\tif err != nil {\n\t\treturn cfg, err\n\t}\n\n\terr = yaml.Unmarshal(yamlFile, cfg)\n\tcfg.filename = filename\n\treturn cfg, err\n}", "title": "" }, { "docid": "c99d38a1734963dbfc8a8621300f5f16", "score": "0.63445073", "text": "func readConfig(fileContent []byte) (Config, error) {\n\tconfig := Config{}\n\terr := json.Unmarshal(fileContent, &config)\n\treturn config, err\n}", "title": "" }, { "docid": "f38e992ee65e53ee9a10fb51f901cfa2", "score": "0.6342183", "text": "func ReadConfigFile(filename string, cfg interface{}) error {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tif err := json.NewDecoder(f).Decode(cfg); err != nil {\n\t\treturn fmt.Errorf(\"Failure to decode config: %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9fd45feb53cbffb319bfda69c41244f2", "score": "0.6339954", "text": "func (n *WalletTestServer) RPCConnectionConfig() rpcclient.ConnConfig {\n\tfile := n.CertFile()\n\tfmt.Println(\"reading: \" + file)\n\tcert, err := ioutil.ReadFile(file)\n\tCheckTestSetupMalfunction(err)\n\n\treturn rpcclient.ConnConfig{\n\t\tHost: n.rpcListen,\n\t\tEndpoint: n.endpoint,\n\t\tUser: n.rpcUser,\n\t\tPass: n.rpcPass,\n\t\tCertificates: cert,\n\t\tDisableAutoReconnect: true,\n\t}\n}", "title": "" }, { "docid": "8635caeb41d7bdc00bfcb4aa7a480437", "score": "0.63344234", "text": "func readConfigFile(filename string) (*Config, error) {\n\tconf := &Config{}\n\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\tif err := yaml.NewDecoder(f).Decode(conf); err != nil {\n\t\treturn nil, fmt.Errorf(\"failure to decode config: %s\", err)\n\t}\n\treturn conf, nil\n}", "title": "" }, { "docid": "a6eb3622a0b758c5d63415bf6cca7e98", "score": "0.6316768", "text": "func readConfig(fileContent []byte) (Config, error) {\n\tconfig := Config{}\n\terr := json.Unmarshal(fileContent, &config)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "75ec572f9c7da1dcc959236f0ef173a5", "score": "0.62992316", "text": "func GetConfFile(filepath string) []byte {\n conf, err := ioutil.ReadFile(filepath)\n if err != nil {\n log.Fatal(err)\n }\n return conf\n}", "title": "" }, { "docid": "013bded89fd580549eb048a19c93eb82", "score": "0.62519705", "text": "func readConfig(configPath string) (cfg *ini.File, err error) {\n\tconfigPath, err = filepath.Abs(configPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"configuration file not found at %s\", configPath)\n\t}\n\n\tif _, err2 := os.Stat(configPath); err2 != nil {\n\t\treturn nil, fmt.Errorf(\"configuration file not found or not readable at %s\", configPath)\n\t}\n\n\tcfg, err = ini.Load(configPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"configuration file cannot be parsed at %s\", configPath)\n\t}\n\n\treturn cfg, nil\n}", "title": "" }, { "docid": "bc1decbc38a75fa97a28b16b5d74ce91", "score": "0.62431496", "text": "func (client CloudConfigClient) GetConfigFile(file, app, label string, profile ...string) ([]byte, error) {\n\turl := client.url + app + \"/\" + strings.Join(profile, \",\") + \"/\" + label + \"/\" + file\n\treturn client.execute(http.MethodGet, url)\n}", "title": "" }, { "docid": "e2aaaad8241f32a1016a47f01ba022ca", "score": "0.6234993", "text": "func ReadConfigFile(fs afero.Fs, filename string, cfg interface{}) error {\n\tf, err := fs.Open(filename)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = serialize.ErrNotInitialized\n\t\t}\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tif err := json.NewDecoder(f).Decode(cfg); err != nil {\n\t\treturn fmt.Errorf(\"failure to decode config: %s\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0e7a4b864f667d88404f166ea3efdbe5", "score": "0.62301606", "text": "func (b *backend) pathConnectionRead(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {\n\tentry, err := req.Storage.Get(ctx, \"config/connection\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read connection configuration\")\n\t}\n\tif entry == nil {\n\t\treturn nil, nil\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "653c9ea2a03e8719ca6e5f055c4455db", "score": "0.62149733", "text": "func readConfig() Config {\n\t// Defining output variable\n\tvar config Config\n\t// Load the file\n\turl := \"/static/conf.yml\"\n\tyamlFile, err := ioutil.ReadFile(url)\n\tif err != nil {\n\t\tBail(err)\n\t}\n\t// parse yaml file\n\terr = yaml.Unmarshal(yamlFile, &config)\n\tif err != nil {\n\t\tBail(err)\n\t}\n\treturn config\n}", "title": "" }, { "docid": "b9528eff5dc6a23ff7eccc624b968921", "score": "0.61913514", "text": "func (c *AuthCnfg) ReadConfig(privateFile string) error {\n\tf, err := os.Open(privateFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { _ = f.Close() }()\n\tbyteValue, _ := io.ReadAll(f)\n\treturn c.ParseConfig(byteValue)\n}", "title": "" }, { "docid": "84658033c6854d41aeca53ac155bbd46", "score": "0.61878014", "text": "func (a *App) GetConfigFile(name string) ([]byte, error) {\n\tdata, err := a.Srv().platform.GetConfigFile(name)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to get config file %s\", name)\n\t}\n\n\treturn data, nil\n}", "title": "" }, { "docid": "457c0602ca87989cf54c410c0acfb6c7", "score": "0.61730814", "text": "func readConfig(filename string) (Config, error) {\r\n\tvar config Config\r\n\tdata, err := ioutil.ReadFile(filename)\r\n\tif err != nil {\r\n\t\treturn config, err\r\n\t}\r\n\r\n\tjson.Unmarshal(data, &config)\r\n\treturn config, nil\r\n}", "title": "" }, { "docid": "b375eff2ae66a1e18ea4840729a6f861", "score": "0.61563534", "text": "func (c *ManageClient) GetConfigFile(ctx context.Context, r *manage.GetConfigFileRequest) (*common.ConfigFile, error) {\n\tb, err := json.Marshal(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\turlStr := c.serverURL + manage.GetConfigFileOp\n\treq, err := http.NewRequest(http.MethodGet, urlStr, bytes.NewReader(b))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := c.cli.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, manage.ConvertHTTPError(resp)\n\t}\n\n\tdefer c.closeRespBody(resp)\n\n\tres := &manage.GetConfigFileResponse{}\n\terr = json.NewDecoder(resp.Body).Decode(&res)\n\treturn res.ConfigFile, err\n}", "title": "" }, { "docid": "f9cd22d9dd7e46076aec7fdc94717b3c", "score": "0.6146727", "text": "func readConfig(cfg *Config) error {\n\tfs := flag.NewFlagSet(\"socks5proxy\", flag.ContinueOnError)\n\n\t_ = fs.String(\"config\", \"config/config.json\", \"load config file from `path` (optional)\")\n\n\tfs.StringVar(&cfg.ProxyUser, \"proxy_user\", \"\", \"Socks5 proxy username\")\n\tfs.StringVar(&cfg.ProxyPassword, \"proxy_password\", \"\", \"Socks5 proxy password\")\n\tfs.IntVar(&cfg.ProxyPort, \"proxy_port\", 1080, \"Socks5 proxy port\")\n\tfs.BoolVar(&cfg.HideSystrayIcon, \"hide_systray_icon\", false, \"show or hide systray icon\")\n\n\terr := ff.Parse(fs, os.Args[1:],\n\t\tff.WithConfigFileFlag(\"config\"),\n\t\tff.WithConfigFileParser(ff.JSONParser),\n\t\tff.WithEnvVarPrefix(\"SOCKS5PROXY\"),\n\t)\n\n\treturn err\n}", "title": "" }, { "docid": "db14b99b24385e63510fd57adc7cca07", "score": "0.61000687", "text": "func (rpc *ParticlRpc) ReadConfig(filename string) error {\n\tvar cfg struct {\n\t\tDataDir string `json:\"data_dir\"`\n\t\tRpcHost string `json:\"rpc_host\"`\n\t\tRpcPort int `json:\"rpc_port\"`\n\t}\n\n\tdata, err := ioutil.ReadFile(filename)\n\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"Failed to read ParticlRpc config file\")\n\t}\n\n\terr = json.Unmarshal(data, &cfg)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"Syntax error in ParticlRpc config file %s\", filename)\n\t}\n\n\tif cfg.DataDir != \"\" {\n\t\trpc.dataDir = cfg.DataDir\n\t}\n\n\tif cfg.RpcHost != \"\" {\n\t\trpc.rpcHost = cfg.RpcHost\n\t}\n\n\tif cfg.RpcPort > 0 {\n\t\trpc.rpcPort = cfg.RpcPort\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "59860bf9325cc23489f62ce26a930045", "score": "0.608351", "text": "func ReadConfig(relativeConfigFilePath string) Configuration {\n\tusr, err := user.Current()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tconfigFileName := usr.HomeDir + relativeConfigFilePath\n\traw, err := ioutil.ReadFile(configFileName) // nolint: gosec\n\tif err != nil {\n\t\tlog.Fatalf(\"error %q happened reading config file %v. raw: %v\", err, configFileName, raw)\n\t}\n\n\tconfig := Configuration{}\n\terr = json.Unmarshal(raw, &config)\n\tif err != nil {\n\t\tlog.Fatalf(\"something happened during unmarshall config: %q. engineers: %v\", err, config)\n\t}\n\n\treturn config\n\n}", "title": "" }, { "docid": "a610fffe762ab9ef9e45de2887474e4e", "score": "0.60807073", "text": "func readConfiguration(config_file string) map[string]interface{} {\n\tconfig.AddDriver(json.Driver)\n\n\tif err := config.LoadFiles(config_file); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn config.Data()\n}", "title": "" }, { "docid": "b65229d248987b6f30a5a41afd71a2cb", "score": "0.60805124", "text": "func getConnectionConfig() connectionConfig {\n\thost, exist := os.LookupEnv(\"APP_MONGO_HOST\")\n\tif !exist {\n\t\tlog.Fatal(\"Undefined env: APP_MONGO_HOST\")\n\t}\n\n\tport, exist := os.LookupEnv(\"APP_MONGO_PORT\")\n\tif !exist {\n\t\tlog.Fatal(\"Undefined env: APP_MONGO_PORT\")\n\t}\n\n\tdbName, exist := os.LookupEnv(\"APP_MONGO_DB_NAME\")\n\tif !exist {\n\t\tlog.Fatal(\"Undefined env: APP_MONGO_DB_NAME\")\n\t}\n\n\tc := connectionConfig{\n\t\thost: fmt.Sprintf(\"%s:%s\", host, port),\n\t\tdbName: dbName,\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "fcd89307f115f4705d2fe812681241e1", "score": "0.60705376", "text": "func ReadConfig(cfgFile string) Configuration {\n\tc, err := readConfig(cfgFile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn c\n}", "title": "" }, { "docid": "c645c5beca520728d38c1036f776917b", "score": "0.60660255", "text": "func (c *AuthCnfg) ReadConfig(privateFile string) error {\n\tjsonFile, err := os.Open(privateFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { _ = jsonFile.Close() }()\n\n\tbyteValue, _ := io.ReadAll(jsonFile)\n\treturn c.ParseConfig(byteValue)\n}", "title": "" }, { "docid": "187eeb7dfe3ef94de3ad734a3cae4f23", "score": "0.6063949", "text": "func ReadConfigFile(file string) (c *Config, err error) {\n\tc = new(Config)\n\tc.v = make(map[string]parameter)\n\tl := 0\n\n\tvar f *os.File\n\tif f, err = os.Open(file); err == nil {\n\t\tdefer f.Close()\n\n\t\tscanner := bufio.NewScanner(f)\n\n\t\tfor scanner.Scan() {\n\t\t\tline := strings.TrimSpace(scanner.Text())\n\t\t\tl++\n\n\t\t\tif len(line) > 0 && line[0] != '#' {\n\t\t\t\tparts := strings.SplitN(line, \"=\", 2)\n\n\t\t\t\tif len(parts) != 2 {\n\t\t\t\t\terr = fmt.Errorf(\"Config line %d invalid: %s (missing =)\", l,\n\t\t\t\t\t\tline)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tk := strings.TrimSpace(parts[0])\n\t\t\t\tv := strings.TrimSpace(parts[1])\n\n\t\t\t\tif k == \"\" {\n\t\t\t\t\terr = fmt.Errorf(\"Config line %d invalid: %s (missing key)\", l,\n\t\t\t\t\t\tline)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif _, found := c.v[k]; !found {\n\t\t\t\t\tc.v[k] = parameter{v, false, l}\n\t\t\t\t} else {\n\t\t\t\t\terr = fmt.Errorf(\"Config line %d invalid: %s (repeated parameter)\", l,\n\t\t\t\t\t\tline)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\terr = scanner.Err()\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "5f881803f050783e0dc76ed462446918", "score": "0.60506296", "text": "func ReadConfig(v *viper.Viper) (interface{}, bool) {\n\t// 设置读取的配置文件\n\tv.SetConfigName(\"config\")\n\t// 添加读取的配置文件路径\n\t_, filename, _, _ := runtime.Caller(0)\n\tfmt.Println(\"filename:\", filename)\n\tfmt.Println(path.Dir(filename))\n\t// 如果不设置AddConfigPath去指定路径, 它会在程序执行的目录去寻找config.yaml\n\tv.AddConfigPath(path.Dir(filename))\n\t// 设置配置文件类型\n\tv.SetConfigType(\"yaml\")\n\tif err := v.ReadInConfig(); err != nil {\n\t\tfmt.Print(\"Read config file failed, err is :\", err.Error())\n\t\treturn nil, false\n\t}\n\n\tconfigPaths := v.Get(\"configpath\")\n\tif configPaths == nil {\n\t\treturn nil, false\n\t}\n\treturn configPaths, true\n}", "title": "" }, { "docid": "896666dba40c65ffda5ce2f9d2b089d2", "score": "0.60467386", "text": "func ReadConfigFile(path string, allowEnvironmentOverrides bool) (*model.Config, error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\treturn ReadConfig(f, allowEnvironmentOverrides)\n}", "title": "" }, { "docid": "412f0fb93d6316be90ec21a3b0f4c88a", "score": "0.6036006", "text": "func ReadConfigFile(configPath string, config *global.ConfigStruct) (ok bool) {\n\t// Open the Config File\n\tconfigFile, err := os.Open(configPath)\n\tif err != nil {\n\t\tlog.Header(\"Whilst trying to open \"+configPath+\" this Error occurred:\\n\"+err.Error(), log.Fatal)\n\t\treturn false\n\t} else {\n\t\tdefer func(configFile *os.File) {\n\t\t\terrClose := configFile.Close()\n\t\t\tif errClose != nil {\n\t\t\t\tlog.Header(\"Whilst trying to close \"+configPath+\" this Error occurred:\\n\"+errClose.Error(), log.Error)\n\t\t\t}\n\t\t}(configFile)\n\t}\n\n\t// Read the opened jsonFile as a byte array\n\tbyteConfigFile, errRead := ioutil.ReadAll(configFile)\n\tif errRead != nil {\n\t\tlog.Header(\"Whilst trying to read \"+configPath+\" this Error occurred:\\n\"+errRead.Error(), log.Fatal)\n\t\treturn false\n\t}\n\n\t// Parse the opened jsonFile to the internal global.ConfigStruct\n\terrJson := json.Unmarshal(byteConfigFile, config)\n\tif errJson != nil {\n\t\tlog.Header(\"Whilst parsing \"+configPath+\" this Error occurred:\\n\"+errJson.Error(), log.Fatal)\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "bae2413a7e7b98fb4753d03d7a661eaa", "score": "0.6021832", "text": "func ReadConfigFile() (err error) {\n\tif cfgFile != constant.EmptyString && cfgFile != constant.DefaultRandomString {\n\t\tviper.SetConfigFile(cfgFile)\n\t\tviper.SetConfigType(\"yaml\")\n\t\terr = viper.ReadInConfig()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\terr = config.ValidateConfig()\n\t\tif err != nil {\n\t\t\treturn multierror.Append(message.NewMessage(message.ErrValidateConfig), err)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e35e382e06d888577eac8066b86e9452", "score": "0.6019183", "text": "func ReadConfig(configFilePtr *string) (X509Config, error) {\n\n\tvar jsonX509Config X509Config\n\n\t// Open JSON config file\n\tjsonFile, err := os.Open(*configFilePtr)\n\tif err != nil {\n\t\treturn jsonX509Config, err\n\t}\n\n\t// Read JSON config file into byteArray\n\tbyteValue, err := ioutil.ReadAll(jsonFile)\n\tif err != nil {\n\t\treturn jsonX509Config, err\n\t}\n\n\t// Initialize the final X509 Configuration array\n\t// Unmarshal byteArray with the jsonFile's content into jsonX509Config\n\tjson.Unmarshal(byteValue, &jsonX509Config)\n\tif err != nil {\n\t\treturn jsonX509Config, err\n\t}\n\n\t// Close JSON config file\n\tif err = jsonFile.Close(); err != nil {\n\t\treturn jsonX509Config, err\n\t}\n\n\treturn jsonX509Config, nil\n}", "title": "" }, { "docid": "98311270ef9cd3c0a8bd7597b244c7b7", "score": "0.6018805", "text": "func readConfig(fs afero.Fs, configFile string) (*Config, error) {\n\tconf, err := fs.Open(configFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to open SELinux config: %w\", err)\n\t}\n\n\tvar c Config\n\n\ts := bufio.NewScanner(conf)\n\tfor s.Scan() {\n\t\tline := s.Text()\n\t\tif strings.HasPrefix(line, \"#\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tconfiguration := strings.SplitN(line, \"=\", 2)\n\t\tif len(configuration) < 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid entry, should be key=value. Got: %s\", line)\n\t\t}\n\n\t\tswitch configuration[0] {\n\t\tcase \"SELINUX\":\n\t\t\tc.Mode = configuration[1]\n\t\tcase \"SELINUXTYPE\":\n\t\t\tc.LoadedPolicyName = configuration[1]\n\t\t}\n\t}\n\n\treturn &c, nil\n}", "title": "" }, { "docid": "75b12cf0f5f31b52cb1eadf7d6f40583", "score": "0.601325", "text": "func (c *MongoConfig) Read() {\n\n\t// Load database connection\n\tif _, err := toml.DecodeFile(\"config.toml\", &c); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "7ea1b8b3d423fcd73d82b51d9082dff0", "score": "0.6007124", "text": "func ReadConfigFile(filename string, locations []string) ([]byte, string) {\n\tfor _, dir := range locations {\n\t\tif strings.HasPrefix(dir, \"~\") {\n\t\t\thomeDir := os.Getenv(\"HOME\")\n\t\t\tdir = filepath.Join(homeDir, dir[1:])\n\t\t}\n\t\tfilep := filepath.Join(dir, filename)\n\t\tlog.WithField(\"filepath\", filep).Debug(\"Looking for config file\")\n\t\tif FileExists(filep) {\n\t\t\treturn MustReadFile(filep), dir\n\t\t}\n\t}\n\terrMsg := \"Could not find config file\"\n\tif len(locations) > 1 {\n\t\terrMsg += \" in any of the possible directories\"\n\t}\n\tlog.WithField(\"filepath\", filename).Fatal(errMsg)\n\treturn nil, \"\"\n}", "title": "" }, { "docid": "25a18b2f6c4aa66d00fcecc4ff7da1b8", "score": "0.6003433", "text": "func ReadConfig() map[string]string {\n\t// Open config file\n\tfile, err := os.Open(configFile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Defer file closure so it runs after the return\n\tdefer func() {\n\t\terr = file.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}()\n\n\t// Decode config file from json\n\terr = json.NewDecoder(file).Decode(&cfg)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn cfg\n}", "title": "" }, { "docid": "d593213b76902ea8e177971f51c89fe0", "score": "0.60002595", "text": "func readConfig(path string, pidFile string) error {\n\n\tif _, err := d.LoadConfig(path); err != nil {\n\t\treturn err\n\t}\n\n\t// override config pidFile with with flag from the command line\n\tif len(pidFile) > 0 {\n\t\td.Config.PidFile = pidFile\n\t} else if len(d.Config.PidFile) == 0 {\n\t\td.Config.PidFile = defaultPidFile\n\t}\n\n\tif len(d.Config.AllowedHosts) == 0 {\n\t\treturn errors.New(\"Empty `allowed_hosts` is not allowed\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "795a844bdb599d20005b7e1433623d73", "score": "0.5999758", "text": "func getConfigFile() []byte {\n\tfilename, err := filepath.Abs(\"./config.yml\")\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tyamlFile, err := ioutil.ReadFile(filename)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn yamlFile\n}", "title": "" }, { "docid": "980b0e060ceda796ab444a09e1579a38", "score": "0.59992474", "text": "func readConfig(filename string) Config {\n\n\tconfig := Config{\n\t\tMailServer: \"smpt.smals.be\",\n\t\tWorkerNumber: 2,\n\t\tMailServerPort: 25,\n\t\tSender: \"pingos@smals.be\",\n\t\tMails: []string{\"xavier.zebier@smals.be\", \"patrick.alin@smals.be\"},\n\t\tTargets: []Target{{Name: \"Local HTTP Server\", Addr: \"localhost:80\"}},\n\t}\n\n\tfile, err := os.Open(filename)\n\tdefer file.Close()\n\tif err != nil {\n\t\t// unaccessible or not existing file -> creatoin\n\t\tfile, err = os.Create(filename)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t// config file just created\n\t\terr := json.NewEncoder(file).Encode(config)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t} else {\n\n\t\terr = json.NewDecoder(file).Decode(&config)\n\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\treturn config\n}", "title": "" }, { "docid": "e6b2b8729a1a1ca21253f7830b2bcccf", "score": "0.59956187", "text": "func getInfoFromConfigFile() (string, []string, error) {\n\t// Read the project configuration file\n\tprojectConfig, err := internalconfig.Read()\n\tswitch {\n\tcase err == nil:\n\tcase os.IsNotExist(err):\n\t\treturn \"\", nil, nil\n\tdefault:\n\t\treturn \"\", nil, err\n\t}\n\n\treturn getInfoFromConfig(projectConfig)\n}", "title": "" }, { "docid": "9b40f62ab566d624a96556249ad88eb9", "score": "0.596793", "text": "func readConfig() {\n\t// return already parsed config if it's present\n\tif Conf != (Config{}) {\n\t\treturn\n\t}\n\n\t_, err := toml.DecodeFile(\"config.toml\", &Conf)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "3677a291d4f497800a87a666b690d157", "score": "0.5965594", "text": "func ReadConfig(path string) (*Config, error) {\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar conf Config\n\terr = json.Unmarshal(data, &conf)\n\tif err != nil {\n\t\tfmt.Println(\"Error\", err.Error())\n\t\treturn nil, errors.New(\"Incorrect format in config file.\\n\" + err.Error())\n\t}\n\tfmt.Println(\"Config is \", conf)\n\treturn &conf, err\n}", "title": "" }, { "docid": "c55421e2d761e3a876a4887ceee29ced", "score": "0.5961341", "text": "func (g *CommandGetter) readConfiguration() error {\n\tvar err error\n\tg.rawConfiguration, err = readConfiguration(g.filename)\n\treturn err\n}", "title": "" }, { "docid": "0430c913b7edced700c923973847ce94", "score": "0.5957526", "text": "func readConfig(path string) ([]string, error) {\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tvar lines []string\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tlines = append(lines, scanner.Text())\n\t}\n\treturn lines, scanner.Err()\n}", "title": "" }, { "docid": "d76f6c26c1bb4b3908f8fdc91b4c168a", "score": "0.5957283", "text": "func GetConnConfig(ConnConfigName string) (ConnConfig, error) {\n\n\turl := SpiderRestUrl + \"/connectionconfig/\" + ConnConfigName\n\n\tclient := resty.New().SetCloseConnection(true)\n\n\tresp, err := client.R().\n\t\tSetResult(&ConnConfig{}).\n\t\t//SetError(&SimpleMsg{}).\n\t\tGet(url)\n\n\tif err != nil {\n\t\tCBLog.Error(err)\n\t\tcontent := ConnConfig{}\n\t\terr := fmt.Errorf(\"an error occurred while requesting to CB-Spider\")\n\t\treturn content, err\n\t}\n\n\tswitch {\n\tcase resp.StatusCode() >= 400 || resp.StatusCode() < 200:\n\t\tfmt.Println(\" - HTTP Status: \" + strconv.Itoa(resp.StatusCode()) + \" in \" + GetFuncName())\n\t\terr := fmt.Errorf(string(resp.Body()))\n\t\tCBLog.Error(err)\n\t\tcontent := ConnConfig{}\n\t\treturn content, err\n\t}\n\n\ttemp, _ := resp.Result().(*ConnConfig)\n\n\t// Get geolocation\n\tnativeRegion, err := GetNativeRegion(temp.ConfigName)\n\tif err != nil {\n\t\tCBLog.Error(err)\n\t\tcontent := ConnConfig{}\n\t\treturn content, err\n\t}\n\n\tlocation := GetCloudLocation(strings.ToLower(temp.ProviderName), strings.ToLower(nativeRegion))\n\ttemp.Location = location\n\n\treturn *temp, nil\n\n}", "title": "" }, { "docid": "6b42dd7925c95db4d585051f4f972280", "score": "0.5952622", "text": "func ReadConfig() error {\n\tviper.SetDefault(\"http-addr\", \":8081\") //HTTP listen addres\n\tviper.SetDefault(\"debug-addr\", \":8080\") //Debug and metrics listen address\n\tviper.SetDefault(\"mysql\", \"\") //MySQL connection string\n\tviper.SetDefault(\"folder\", \"\") //MySQL exchange folder\n\tviper.SetDefault(\"log\", \"\") //Log folder\n\tviper.SetDefault(\"id\", \"\") //Instanse ID\n\tviper.SetDefault(\"master-url\", \"\") //master server url (need only for slave server)\n\tviper.SetDefault(\"sync-interval\", \"10\") //sinc interval (minutes)\n\tviper.SetDefault(\"balance-hour\", \"2\") //hour of daily balance recalculation\n\tviper.SetDefault(\"level-days\", \"1,2\") //days of monthly level recalculation (comma sepparated)\n\tviper.SetDefault(\"level-hour\", \"2\") //hour of monthly level recalculation\n\n\tpath, err := osext.ExecutableFolder()\n\tif err != nil {\n\t\tpath = \".\"\n\t}\n\t//fmt.Println(\"Path \", path)\n\tviper.AddConfigPath(path)\n\tviper.SetConfigName(\"config\")\n\treturn viper.ReadInConfig()\n\t/*\n\t\tif err != nil {\n\t\t\tlogger.Info(err)\n\t\t\tlogger.Info(\"Start using default setings\")\n\t\t}\n\t*/\n}", "title": "" }, { "docid": "4ed9e46bdcd62ed2bc9fdad816a83ecf", "score": "0.59509045", "text": "func ReadConfigFile(path string) error {\n\treturn vi.ReadConfigFile(path)\n}", "title": "" }, { "docid": "b537f82277b162102a5371b896301157", "score": "0.5950051", "text": "func ReadZKConfigFile() ([]byte, error) {\n\tuser, err := user.Current()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, fmt.Sprintf(\"no user found\"))\n\t}\n\tconfigPathUser := filepath.Join(user.HomeDir, configPathUserDir, configName)\n\tconfigPathSystem := filepath.Join(configPathSystemDir, configName)\n\tconfigPaths := [2]string{configPathUser, configPathSystem}\n\t// Check clusters.json in ~/.peloton/, if not exist, check /etc/pelton\n\tfor _, path := range configPaths {\n\t\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\t\tcontinue\n\t\t}\n\t\tfile, err := ioutil.ReadFile(path)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, fmt.Sprintf(\"unable to \"+\n\t\t\t\t\"open file %s\", path))\n\t\t}\n\t\treturn file, nil\n\t}\n\treturn nil, fmt.Errorf(\"unable to \"+\n\t\t\"find file %s or %s, \"+\n\t\t\"please create this file or clone it from a cluster config\"+\n\t\t\" repo\",\n\t\tconfigPathUser, configPathSystem)\n}", "title": "" }, { "docid": "3598776876608dea85fc1365b3beb777", "score": "0.5948959", "text": "func readConfig(path string) *Configuration {\n\tconfigFile, err := os.Open(path)\n\tif os.IsNotExist(err) {\n\t\tlog.Println(\"error opening configuration file:\", err)\n\t\treturn nil\n\t}\n\t// Read JSON data from file\n\tdecoder := json.NewDecoder(configFile)\n\tconfiguration := Configuration{}\n\terr = decoder.Decode(&configuration)\n\tif err != nil {\n\t\tlog.Println(\"error:\", err)\n\t}\n\t// Print out contents the configuration struct\n\t//fmt.Printf(\"Configuration: %v\\n\", configuration)\n\treturn &configuration\n}", "title": "" }, { "docid": "b2b204a3fde622b202ba4f241c6ed4f5", "score": "0.5947613", "text": "func read(cfgPath string) (*Config, error) {\n\tfile, err := os.Open(cfgPath)\n\n\tfbytes, err := ioutil.ReadAll(file)\n\tif err != nil {\n\t\tlog.Println(\"Cant start server without initial file\\n\"+\n\t\t\t\"Please creaate init file and put it to \"+cfgPath, err)\n\t\treturn nil, err\n\t}\n\n\tfileData := string(fbytes)\n\tconfigs := strings.Split(fileData, \"\\n\")\n\n\tcountFields := reflect.ValueOf(Config{}).NumField()\n\tif len(configs) < countFields {\n\t\tlog.Println(\"Not enough fields\")\n\t\treturn nil, errors.New(\"Not Enough fields for config\")\n\t}\n\n\tlogLevel, err := strconv.Atoi(configs[13])\n\tif err != nil {\n\t\tlog.Print(\"Error logLevel, must be integer\")\n\t\treturn nil, err\n\t}\n\n\treturn &Config{\n\t\tconfigs[0],\n\t\tconfigs[1],\n\t\tconfigs[2],\n\t\tconfigs[3],\n\t\tconfigs[4],\n\t\tconfigs[5],\n\t\tconfigs[6],\n\t\tconfigs[7],\n\t\tconfigs[8],\n\t\tconfigs[9],\n\t\tconfigs[10],\n\t\tconfigs[11],\n\t\tconfigs[12],\n\t\tlogLevel,\n\t\tconfigs[14],\n\t}, nil\n}", "title": "" }, { "docid": "b75ed3b6c22274c56950a1055922afe5", "score": "0.5944569", "text": "func ReadConfigFile(path string) (file []byte, err error) {\n\tfilelocation, err := filepath.Glob(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(filelocation) == 0 {\n\t\treturn nil, errors.New(\"Could not find \" + path)\n\t}\n\tfilename, err := filepath.Abs(filelocation[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tyamlFile, err := os.ReadFile(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar jsonFile []byte\n\tjsonFile, err = yaml.YAMLToJSON(yamlFile)\n\treturn jsonFile, err\n}", "title": "" }, { "docid": "803a3bacef91221c6d0fb82c0597a7d8", "score": "0.59307295", "text": "func ReadConfigFile(fileName string) error {\n\t// Read the whole file\n\tbytes, err := ioutil.ReadFile(fileName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tidFound := false\n\tpKeysFound := false\n\tsKeysFound := false\n\tbKeysFound := false\n\tbAddrFound := false\n\n\tchain = make(map[string][]string)\n\trChain = make(map[string][]string)\n\n\t// Break the file up into lines\n\tlines := strings.Split(string(bytes), \"\\n\")\n\n\tfor i := range lines {\n\t\t// Break each line into a key and value\n\t\tlineContents := strings.Split(lines[i], \"=\")\n\n\t\t// Get the values for each key\n\t\tswitch {\n\t\tcase lineContents[0] == tagID:\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\tlocalID, err = strconv.ParseUint(lineContents[1], 10, 64)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tidFound = true\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tcase lineContents[0] == tagPublisherKeys:\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\tpublisherKeys = strings.Split(lineContents[1], \",\")\n\t\t\t\tpKeysFound = true\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tcase lineContents[0] == tagSubscriberKeys:\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\tsubscriberKeys = strings.Split(lineContents[1], \",\")\n\t\t\t\tsKeysFound = true\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tcase lineContents[0] == tagBrokerKeys:\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\tbrokerKeys = strings.Split(lineContents[1], \",\")\n\t\t\t\tbKeysFound = true\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tcase lineContents[0] == tagBrokerAddrs:\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\tbrokerAddresses = strings.Split(lineContents[1], \",\")\n\t\t\t\tbAddrFound = true\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tcase lineContents[0] == tagChain:\n\t\t\t// If there is a value to the tag\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\ttemp := strings.Split(lineContents[1], \":\")\n\t\t\t\tnode := temp[0]\n\n\t\t\t\t// If there are children to the node\n\t\t\t\tif len(temp) == 2 {\n\t\t\t\t\tchildren := strings.Split(temp[1], \",\")\n\t\t\t\t\tif len(children) != 0 && children[0] != \"\" {\n\t\t\t\t\t\tchain[node] = children\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchain[node] = nil\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tchain[node] = nil\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tcase lineContents[0] == tagRChain:\n\t\t\t// If there is a value to the tag\n\t\t\tif len(lineContents) == 2 {\n\t\t\t\ttemp := strings.Split(lineContents[1], \":\")\n\t\t\t\tnode := temp[0]\n\n\t\t\t\t// If there are parents to the node\n\t\t\t\tif len(temp) == 2 {\n\t\t\t\t\tparents := strings.Split(temp[1], \",\")\n\t\t\t\t\tif len(parents) != 0 && parents[0] != \"\" {\n\t\t\t\t\t\trChain[node] = parents\n\t\t\t\t\t} else {\n\t\t\t\t\t\trChain[node] = nil\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\trChain[node] = nil\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error parsing the config file entry for %s.\\n\", lineContents[0])\n\t\t\t}\n\t\tdefault:\n\t\t}\n\t}\n\n\t// Check that the required fields are found.\n\tif idFound == false {\n\t\treturn fmt.Errorf(\"Please add %v=<id> to the config file.\", tagID)\n\t}\n\tif pKeysFound == false {\n\t\treturn fmt.Errorf(\"Please add %v=<key1>,<key2>,... to the config file.\", tagPublisherKeys)\n\t}\n\tif sKeysFound == false {\n\t\treturn fmt.Errorf(\"Please add %v=<key1>,<key2>,... to the config file.\", tagSubscriberKeys)\n\t}\n\tif bKeysFound == false {\n\t\treturn fmt.Errorf(\"Please add %v=<key1>,<key2>,... to the config file.\", tagBrokerKeys)\n\t}\n\tif bAddrFound == false {\n\t\treturn fmt.Errorf(\"Please add %v=<addr1>,<addr2>,... to the config file.\", tagBrokerAddrs)\n\t}\n\n\tif len(brokerAddresses) != len(brokerKeys) {\n\t\treturn fmt.Errorf(\"The number of broker addresses is not the same as the number of broker keys.\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4afb375385b11ef7e85868768b6ce793", "score": "0.5927474", "text": "func read(file_name string) (*Configuration, error) {\n\tfile, err := os.Open(file_name)\n\tif err == nil {\n\t\tdecoder := json.NewDecoder(file)\n\t\terr := decoder.Decode(Config)\n\t\tif err == nil {\n\t\t\tlog.Infof(\"Read config: %s\", file_name)\n\t\t} else {\n\t \t\tlog.Fatal(\"Cannot read config file:\", file_name, err)\n\t\t}\n\t}\n\treturn Config, err\n}", "title": "" }, { "docid": "be94c85f41e9763602561c21f19e5520", "score": "0.5924828", "text": "func (vc *viperConfigurator) readConfigFile() error {\n\tvc.viper.AddConfigPath(vc.projectDir)\n\tvc.viper.SetConfigName(vc.flags.configFile)\n\terr := vc.viper.ReadInConfig()\n\t// if there is no config - it is not an error, we allow it\n\tif _, ok := err.(viper.ConfigFileNotFoundError); !ok {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa0b4e1f9f8f33be9441adef20f064b5", "score": "0.59234333", "text": "func ReadDatasetConfig(ds interface{}, fcfg string) (e error) {\n\tcfg, e := os.ReadFile(fcfg)\n\n\tif nil != e {\n\t\treturn e\n\t}\n\n\treturn json.Unmarshal(cfg, ds)\n}", "title": "" }, { "docid": "b71b73d0cd22a1327c7eea52721c316b", "score": "0.5906307", "text": "func readConfigFile(fileName string, result interface{}) {\n\n\tconfigFile, err := os.Open(fileName + \".json\")\n\tif err != nil {\n\t\tfmt.Println(\"opening config file\", err.Error())\n\t}\n\n\tjsonParser := json.NewDecoder(configFile)\n\tif err = jsonParser.Decode(result); err != nil {\n\t\tfmt.Println(\"parsing config file\", err.Error())\n\t}\n\n}", "title": "" }, { "docid": "7f0e63e2add78c7fb1598ccdad8b25de", "score": "0.59046465", "text": "func readConfigObject(path string) (*netv1.NetworkConfig, error) {\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"Failed to open NetworkConfig file %s\", path)\n\t}\n\n\tdecoder := k8syaml.NewYAMLOrJSONDecoder(f, 4096)\n\tconf := netv1.NetworkConfig{}\n\tif err := decoder.Decode(&conf); err != nil {\n\t\treturn nil, errors.Wrapf(err, \"failed to unmarshal NetworkConfig\")\n\t}\n\n\treturn &conf, nil\n}", "title": "" }, { "docid": "a86198c898f92401f062ab99b5f7c697", "score": "0.58841497", "text": "func ParseConfigFile(filename string) {\n\n\ttype PathDescriptionJson struct {\n\t\tFsPath string `json:\"fsPath\"`\n\t\tWebPath string `json:\"webPath\"`\n\t\tDescription string `json:\"description\"`\n\t\tSecurity int `json:\"security\"`\n\t}\n\n\ttype ConfigJson struct {\n\t\tRouting []PathDescriptionJson `json:\"routing\"`\n\t\tPort int `json:\"port\"`\n\t\tKeepAliveSeconds int64 `json:\"keepAliveSeconds\"`\n\t\tSecretKey string `json:\"secretKey\"`\n\t\tSecretKeyInPath bool `json:\"secretKeyInPath\"`\n\t}\n\n\tif filename == \"\" {\n\t\tfilename = \"./config.json\"\n\t}\n\n\tcontent, err := ioutil.ReadFile(filename)\n\tif err == nil {\n\t\tvar tmpConfig ConfigJson\n\t\terr := json.Unmarshal(content, &tmpConfig)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\tsettings.Port = tmpConfig.Port\n\t\tsettings.KeepAliveSeconds = tmpConfig.KeepAliveSeconds\n\t\tsettings.SecretKey = tmpConfig.SecretKey\n\t\tsettings.SecretKeyInPath = tmpConfig.SecretKeyInPath\n\n\t\twebRoutes = make([]PathDescription, len(tmpConfig.Routing))\n\n\t\tfor i := 0; i < len(tmpConfig.Routing); i++ {\n\t\t\titem := tmpConfig.Routing[i]\n\t\t\twebRoutes[i].FsPath, webRoutes[i].IsRelative = ssutil.PathStringToArray(item.FsPath)\n\t\t\twebRoutes[i].WebPath, _ = ssutil.PathStringToArray(item.WebPath)\n\t\t\twebRoutes[i].Description = item.Description\n\t\t}\n\t\t// fmt.Printf(\"webRoutes: %+v\\n\\n\", webRoutes)\n\t\t// fmt.Printf(\"settings: %+v\\n\\n\", settings)\n\t}\n}", "title": "" }, { "docid": "67b12511180b834d56beb9afaa1be2c3", "score": "0.58702284", "text": "func ReadConfig() *Config {\n\tvar (\n\t\tcfg Config\n\t\terr error\n\t\tenviron string\n\t)\n\n\tpath := FilePathList()\n\n\tfor _, val := range path {\n\t\tfile := fmt.Sprintf(\"%sconfig.ini\", val)\n\t\tlog.Printf(\"%s\\n\", file)\n\t\terr := gcfg.ReadFileInto(&cfg, file)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif err != nil {\n\t\tlog.Fatalf(\"[testingwebapp] Cannot load config env:%s :%+v\\n \", environ, err)\n\t}\n\n\tlog.Printf(\"[testingwebapp] Config load success, using \\\"%s\\\".\\n\", environ)\n\n\treturn &cfg\n}", "title": "" }, { "docid": "8582c9331b7f3d415a785130d0ae1b75", "score": "0.5860419", "text": "func parseConfigFile(cFile []byte) ([]streamArgs, error) {\n\tresp := []streamArgs{}\n\n\tif len(cFile) == 0 {\n\t\treturn resp, errors.New(errConfig)\n\t}\n\n\ttype cfgArgs struct {\n\t\tFilepath string `json:\"filepath\"`\n\t\tDelimiter string `json:\"delimiter\"`\n\t\tRegexp string `json:\"regexp\"`\n\t\tCommand string `json:\"command\"`\n\t\tArgs string `json:\"args\"`\n\t}\n\tallConf := make([]cfgArgs, 0)\n\n\tif err := json.Unmarshal(cFile, &allConf); err != nil {\n\t\treturn resp, errors.New(errConfig)\n\t}\n\n\tfor _, c := range allConf {\n\t\targ, err := constructArgs(\n\t\t\tc.Filepath,\n\t\t\tc.Delimiter,\n\t\t\tc.Regexp,\n\t\t\tc.Command,\n\t\t\tc.Args)\n\t\tif err != nil {\n\t\t\treturn resp, errors.New(errConfigInvalid)\n\t\t}\n\n\t\tresp = append(resp, arg)\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "485a1595e5ee1d3f5052c0c5a11f4c3c", "score": "0.5848324", "text": "func readConfig(path string, out io.Writer) error {\n\trawCfgMu.RLock()\n\tdefer rawCfgMu.RUnlock()\n\treturn unsyncedConfigAccess(http.MethodGet, path, nil, out)\n}", "title": "" }, { "docid": "853b20852c9560f9a6fe954d0a972f54", "score": "0.5846041", "text": "func (c *conf) getConf(filename *string) *conf {\n\n yamlFile, err := ioutil.ReadFile(*filename)\n if err != nil {\n log.Printf(\"yamlFile.Get err \", err)\n }\n err = yaml.Unmarshal(yamlFile, c)\n if err != nil {\n log.Fatalf(\"Unmarshal: \", err)\n }\n return c\n}", "title": "" }, { "docid": "da330e6f19eacabc3fd2ec55c2528648", "score": "0.5841885", "text": "func ReadConfig(configfile string) structs.Config {\n\tvar cfg structs.Config\n\n\t_, err := os.Stat(configfile)\n\tif err != nil {\n\t\tlog.Fatal(\"Config file is missing: \", configfile)\n\t}\n\n\tif _, err := toml.DecodeFile(configfile, &cfg); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn cfg\n}", "title": "" }, { "docid": "63f1755b1db77dab4227b12bc039a421", "score": "0.582736", "text": "func readConfig() Config {\n\tjsonData, err := ioutil.ReadFile(\"appsettings.json\")\n\tif err != nil {\n\t\tfmt.Print(err)\n\t}\n\n\tvar data Config\n\n\terr = json.Unmarshal(jsonData, &data)\n\tif err != nil {\n\t\tfmt.Println(\"error:\", err)\n\t}\n\n\treturn data\n}", "title": "" }, { "docid": "c3646975c58a95b3a82e9bcba1c5a4bf", "score": "0.58235234", "text": "func ReadConfig() error {\n\tif skipReadConfig {\n\t\treturn nil\n\t}\n\tskipReadConfig = true\n\n\tviper.SetConfigFile(CDSConfigFile)\n\terrReadConfigFile := viper.ReadInConfig()\n\tif errReadConfigFile == nil {\n\t\tif viper.GetString(\"host\") != \"\" {\n\t\t\tHost = viper.GetString(\"host\")\n\t\t}\n\t\tif viper.GetString(\"user\") != \"\" {\n\t\t\tuser = viper.GetString(\"user\")\n\t\t}\n\t\tif viper.GetString(\"token\") != \"\" {\n\t\t\ttoken = viper.GetString(\"token\")\n\t\t}\n\t}\n\n\tif val := os.Getenv(\"CDS_VERBOSE\"); val == \"true\" {\n\t\tverbose = true\n\t}\n\n\tif val := os.Getenv(\"CDS_USER\"); val != \"\" {\n\t\tuser = val\n\t}\n\tif val := os.Getenv(\"CDS_TOKEN\"); val != \"\" {\n\t\ttoken = val\n\t}\n\n\tif user != \"\" && token != \"\" {\n\t\treturn nil\n\t}\n\n\tif hash != \"\" {\n\t\treturn nil\n\t}\n\n\tif errReadConfigFile != nil {\n\t\tfmt.Printf(\"Warning: Invalid configuration file (%s)\\n\", errReadConfigFile)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "16fe824f9b6404935e3305f49ab56d11", "score": "0.58189195", "text": "func readConfig() (*Config, error) {\n\tappConfigPath := getAppConfigPath()\n\tconfigFilePath := appConfigPath + \"/config.json\"\n\n\tconfigFileData, err := ioutil.ReadFile(configFilePath)\n\tif err != nil {\n\t\tos.MkdirAll(appConfigPath, os.ModePerm)\n\t\terr := ioutil.WriteFile(configFilePath, []byte(\"{}\"), 0644)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error creating config file at path: %s\", configFilePath)\n\t\t}\n\n\t\tconfigFileData, err = ioutil.ReadFile(configFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Error creating empty config file\")\n\t\t}\n\t}\n\n\tvar config Config\n\terr = json.Unmarshal(configFileData, &config)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Error parsing json file\")\n\t}\n\n\treturn &config, nil\n}", "title": "" }, { "docid": "72e09fa98fa3868eafcf82edf7abed6c", "score": "0.5818204", "text": "func ReadConfig(filename string) Configuration {\n\tfile, err := ioutil.ReadFile(filename)\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't open config file: %s\", err.Error())\n\t}\n\n\tvar jsonConfig Configuration\n\tif err := json.Unmarshal(file, &jsonConfig); err != nil {\n\t\tlog.Fatalf(\"Cannot parse the configuration: %s\", err)\n\t}\n\n\t// Safety checks\n\tif len(jsonConfig.Filters) == 0 {\n\t\tlog.Fatal(\"Configuration contains no 'filters' section\")\n\t}\n\n\tfor _, filter := range jsonConfig.Filters {\n\t\tif filter.Pattern == \"\" || len(filter.Addresses) == 0 {\n\t\t\tlog.Fatal(\"Filter error: missing pattern or empty server list\")\n\t\t}\n\n\t\tfor i, address := range filter.Addresses {\n\t\t\tif !strings.Contains(address, \":\") {\n\t\t\t\tfilter.Addresses[i] = strings.Join([]string{address, \"53\"}, \":\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn jsonConfig\n}", "title": "" }, { "docid": "6b8002a56b76c823c7a1dfdf615a4a87", "score": "0.5815909", "text": "func ReadConfig(confName string) ([]byte, error) {\n\tbuf, err := ReadConfigWithEnv(confName, GetConfEnv())\n\tif err == nil || os.IsNotExist(err) == false {\n\t\treturn buf, err\n\t}\n\n\tfilePath := path.Join(ConfigDir, confName)\n\tlogs.Warnf(\"use %v as default config\", filePath)\n\treturn ioutil.ReadFile(filePath)\n}", "title": "" }, { "docid": "e249426d2f2847af7f0e933b59aff480", "score": "0.5815629", "text": "func readFile(cfgFile string) ([]byte, error) {\n\tsource, err := ioutil.ReadFile(cfgFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn source, nil\n}", "title": "" }, { "docid": "e249426d2f2847af7f0e933b59aff480", "score": "0.5815629", "text": "func readFile(cfgFile string) ([]byte, error) {\n\tsource, err := ioutil.ReadFile(cfgFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn source, nil\n}", "title": "" }, { "docid": "896400293b7e6bcac12ed89c37f1f895", "score": "0.5813111", "text": "func ReadConfig() {\n\tfile, err := os.Open(\"config\")\n\tif err != nil {\n\t\tlog.Printf(\"Не удалось найти конфигурационный файл (%s)\", err)\n\t\treturn\n\t}\n\tdefer file.Close()\n\n\tvar line []string\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tline = strings.Split(scanner.Text(), \"=\")\n\t\tif len(line) == 2 {\n\t\t\tkey := line[0]\n\t\t\tvalue := line[1]\n\t\t\tConfig[key] = value\n\t\t}\n\t}\n\n\terr = scanner.Err()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n}", "title": "" }, { "docid": "ea8a60efd4a4427ff2b5ef7420e0ed78", "score": "0.5812603", "text": "func ReadConfig(filename string) (datastruct []ConfigLine, err error) {\r\n\r\n\tf, err := os.Open(filename)\r\n\tif err != nil {\r\n\r\n\t\treturn\r\n\t}\r\n\tb, err := ioutil.ReadAll(f)\r\n\tif err != nil {\r\n\r\n\t\treturn\r\n\t}\r\n\tif b[0] == 0xEF || b[0] == 0xBB || b[1] == 0xBB {\r\n\t\tb = b[3:] //skip BOM\r\n\t}\r\n\r\n\terr = json.Unmarshal(b, &datastruct)\r\n\tif err != nil {\r\n\t\terr = fmt.Errorf(\"config has bad json structure: %w\", err)\r\n\t\treturn datastruct, err\r\n\t}\r\n\treturn datastruct, nil\r\n}", "title": "" }, { "docid": "c63e17a58e7d8ab89a1f534dd2a943b1", "score": "0.5809482", "text": "func ReadConfig() Configuration {\n\tfile, _ := os.Open(configFile)\n\tdefer file.Close()\n\tdecoder := json.NewDecoder(file)\n\tconf := Configuration{}\n\terr := decoder.Decode(&conf)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn conf\n}", "title": "" }, { "docid": "e0811793017dad0752d80ae3ba199f13", "score": "0.57979786", "text": "func readConfig(configFile string, defaultUsername string, defaultPort uint) ([]Server, error) {\n\tfileData, err := ioutil.ReadFile(configFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar servers []Server\n\tif err = yaml.Unmarshal(fileData, &servers); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor i := 0; i < len(servers); i++ {\n\t\tservers[i].normalize(defaultUsername, defaultPort)\n\n\t\tif err = servers[i].validate(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn servers, nil\n}", "title": "" }, { "docid": "04140d8e6bc78c561d6590201e9c1444", "score": "0.5790141", "text": "func readConfig(filename string) (Config, error) {\n\tvar ret Config\n\tret.devices = make(map[string]Device)\n\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\tb := bufio.NewScanner(f)\n\tfor b.Scan() {\n\t\tline := b.Text()\n\t\tfields := strings.Fields(line)\n\t\tif len(fields) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tswitch fields[0] {\n\t\tcase \"prefix\":\n\t\t\tif len(fields) != 2 {\n\t\t\t\treturn ret, errors.New(\"must specify a prefix\")\n\t\t\t}\n\t\t\tret.prefix = fields[1]\n\t\tcase \"device\":\n\t\t\tif len(fields) != 7 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar d Device\n\t\t\td.name = fields[1]\n\t\t\td.pdutype = fields[2]\n\t\t\td.host = fields[3]\n\t\t\td.port = fields[4]\n\t\t\td.username = fields[5]\n\t\t\td.password = fields[6]\n\t\t\td.outlets = make(map[string]string)\n\t\t\tfor _, v := range ret.devices {\n\t\t\t\tif v.name == d.name {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tret.devices[d.name] = d\n\t\tcase \"node\":\n\t\t\tif len(fields) != 4 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnodename := fields[1]\n\t\t\tdev := fields[2]\n\t\t\toutlet := fields[3]\n\t\t\tif _, ok := ret.devices[dev]; ok {\n\t\t\t\tret.devices[dev].outlets[nodename] = outlet\n\t\t\t}\n\t\t}\n\t}\n\treturn ret, nil\n}", "title": "" }, { "docid": "f3bfe0948c515f9ee1a3f29629cf71bf", "score": "0.57857245", "text": "func ReadConfLogFile()(rsp map[string]string){\n\tconfMap := make(map[string]string,0)\n\tfin, err := os.OpenFile(confFile,os.O_RDONLY|os.O_CREATE,0644);if (err != nil){\n\t\tlogs.Error(\"Failed ReadConfLogFile,ERROR=\",err)\n\t\treturn\n\t}\n\tdefer fin.Close()\n\tscanner := bufio.NewScanner(fin)\n\tscanner.Split(bufio.ScanLines)\n\tfor scanner.Scan() {\n\t\tline := strings.TrimSuffix(scanner.Text(), \"\\n\")\n\t\tlineSplit := strings.Split(line,\"\\t\")\n\t\tconfMap[lineSplit[0]] = lineSplit[1]\n\t}\n\treturn confMap\n}", "title": "" }, { "docid": "806c3e201d69522d13d7d8097bfa0113", "score": "0.5781512", "text": "func dockerCredsFromConfigFile(configFilePath string) (*docker.AuthConfigurations, error) {\n\n\tf, err := os.Open(configFilePath)\n\tif f != nil {\n\t\tdefer cutil.CloseFileLogError(f)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tauths, err := docker.NewAuthConfigurations(f)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn auths, nil\n}", "title": "" }, { "docid": "0102e1bb5a9dedd710418acb19705c48", "score": "0.5780664", "text": "func loadConfigFile(path string) (*configfile.ConfigFile, error) {\n\tcfg := configfile.New(path)\n\tif _, err := os.Stat(path); err == nil {\n\t\tfile, err := os.Open(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer file.Close()\n\t\tif err := cfg.LoadFromReader(file); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if !os.IsNotExist(err) {\n\t\treturn nil, err\n\t}\n\tif !cfg.ContainsAuth() {\n\t\tcfg.CredentialsStore = credentials.DetectDefaultStore(cfg.CredentialsStore)\n\t}\n\treturn cfg, nil\n}", "title": "" }, { "docid": "4f0e980777ebd733f15ab4cbabc0fab2", "score": "0.57789564", "text": "func ReadConfig(filename string) (Configuration, error) {\n\tfile, _ := os.Open(filename)\n\tdecoder := json.NewDecoder(file)\n\tconfig := Configuration{}\n\terr := decoder.Decode(&config)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\n\terr = validateConfig(config)\n\tif err != nil {\n\t\treturn config, err\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "f6c08fa48fc3c1867af834e60e98debd", "score": "0.57740456", "text": "func load_config(filepath string) {\n\tfile, _ := ini.LoadFile(filepath)\n\tdb_user, _ := file.Get(\"bugspad\", \"user\")\n\tdb_pass, _ := file.Get(\"bugspad\", \"password\")\n\tdb_host, _ := file.Get(\"bugspad\", \"host\")\n\tdb_name, _ := file.Get(\"bugspad\", \"database\")\n\tconn_str = fmt.Sprintf(\"%s:%s@tcp(%s:3306)/%s?parseTime=true\", db_user, db_pass, db_host, db_name)\n\n}", "title": "" }, { "docid": "0b0fd38d5156551442783f235d05a9b7", "score": "0.5749367", "text": "func (websockService *WebSocketService) loadConfigFile(fileName string) (err error) {\n\tdata, err := utils.ReadFileAll(fileName)\n\tif err != nil {\n\t\treturn\n\t}\n\terr = json.Unmarshal(data, &serviceConfig)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "931a8d4e013f47e9899b3251bbb6dfa3", "score": "0.5748388", "text": "func loadConfigFile() {\n\tf, err := os.Open(confPath)\n\tif err != nil {\n\t\tnotify(\"Error: failed to load configuration file (./config.json). \"+err.Error(), config.Devtopic, config.Devtopicregion)\n\t\tlog.Fatal(errors.New(\"Error: failed to load configuration file (./config.json). \" + err.Error()))\n\t}\n\td := json.NewDecoder(f)\n\terr = d.Decode(&config)\n\tif err != nil {\n\t\tnotify(\"Error: failed to configure server. \"+err.Error(), config.Devtopic, config.Devtopicregion)\n\t\tlog.Fatal(errors.New(\"Error: failed to configure server. \" + err.Error()))\n\t}\n\tif config.Forecastdays > 7 {\n\t\tnotify(\"Error: Forecastdays cannot exceed 7 days, setting to 7\", config.Devtopic, config.Devtopicregion)\n\t\tlog.Println(\"Forecastdays cannot exceed 7 days, setting to 7\")\n\t\tconfig.Forecastdays = 7\n\t}\n}", "title": "" }, { "docid": "11f2cda52020db7c89b9b65b93ffbf19", "score": "0.57447094", "text": "func (gen *generator) readGapicConfigFile(gapicFname string) error {\n\t// ignore gapicFname if unspecified\n\tif gapicFname == \"\" {\n\t\treturn nil\n\t}\n\tf, err := os.Open(gapicFname)\n\tif err != nil {\n\t\treturn errors.E(err, \"cannot read GAPIC config file: %q\", gapicFname)\n\t}\n\tdefer f.Close()\n\n\tif err := yaml.NewDecoder(f).Decode(&gen.gapic); err != nil {\n\t\treturn errors.E(err, \"error reading GAPIC config file: %q\", gapicFname)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0dbea47890b30552b01a0d8c5681a26f", "score": "0.57331675", "text": "func ReadConfigutionFromFile(path string) *Configuration {\n\tvar config Configuration\n\tif _, err := os.Stat(path); os.IsNotExist(err) {\n\t\tpanic(\"can not find configuration file\")\n\t}\n\tif bytes, err := ioutil.ReadFile(path); err != nil {\n\t\tpanic(err)\n\t} else {\n\t\tif jsnError := json.Unmarshal(bytes, &config); jsnError != nil {\n\t\t\tpanic(jsnError)\n\t\t}\n\t}\n\treturn &config\n}", "title": "" }, { "docid": "9583431e7e86cdc2c0929a112e5b255e", "score": "0.57286495", "text": "func ReadConfig(tomlConfigFile string, config interface{}, panicOnFail ...bool) error {\n\n\tshouldPanicOnFail := len(panicOnFail) == 1 && panicOnFail[0] == true\n\n\t_, err := os.Stat(tomlConfigFile)\n\tif err != nil {\n\t\texpectedConfigPath := tomlConfigFile\n\t\tif !path.IsAbs(expectedConfigPath) {\n\t\t\tif cwd, err := os.Getwd(); err == nil {\n\t\t\t\texpectedConfigPath = path.Join(cwd, tomlConfigFile)\n\t\t\t}\n\t\t}\n\t\terr = errors.New(fmt.Sprintf(\"Error when poking config file %s: %v\", expectedConfigPath, err))\n\t\tif shouldPanicOnFail {\n\t\t\tlogrus.WithError(err).Panic(\"ReadConfig failed\")\n\t\t}\n\t\treturn err\n\t}\n\n\tif _, err := toml.DecodeFile(tomlConfigFile, config); err != nil {\n\t\terr = errors.New(fmt.Sprintf(\"Error when decoding config file: %v\", err))\n\t\tif shouldPanicOnFail {\n\t\t\tlogrus.WithError(err).Panic(\"ReadConfig failed\")\n\t\t}\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6fadba1baec0561d48044f0eb4e1b701", "score": "0.57241625", "text": "func readConfig(path string) LoginConfigs {\n\tvar loginConfigs LoginConfigs\n\tyamlFile, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\tlogger.WithFields(\n\t\t\tlog.Fields{\n\t\t\t\t\"subsystem\": \"config_loader\",\n\t\t\t\t\"part\": \"read_file\",\n\t\t\t}).Panicln(err.Error())\n\t}\n\terr = yaml.Unmarshal(yamlFile, &loginConfigs)\n\tif err != nil {\n\t\tlogger.WithFields(\n\t\t\tlog.Fields{\n\t\t\t\t\"subsystem\": \"config_loader\",\n\t\t\t\t\"part\": \"parse_file\",\n\t\t\t}).Panicln(err.Error())\n\t}\n\treturn loginConfigs\n}", "title": "" }, { "docid": "fecdda4a168a33ce602c52515ff6752d", "score": "0.5718888", "text": "func readConfig() {\n\n\t//read the config file\n\tcontent, err := ioutil.ReadFile(\"config.json\")\n\tif err != nil {\n\t\tfmt.Println(\"Can't found 'config.json' using default parameters\")\n\t\tconfig = make(map[string]interface{})\n\t\tconfig[\"token\"] = \"adminToken\"\n\t\tvar maxMemdefault json.Number = json.Number(\"10485760\")\n\t\tconfig[\"memory\"] = maxMemdefault\n\t\tconfig[\"data_dir\"] = \"data\"\n\t} else {\n\t\tconfig, err = convertJsonToMap(string(content))\n\t}\n\n\tfmt.Println(\"Using Config:\", config)\n\n}", "title": "" }, { "docid": "caaca83d786402d17110c2e6afdda253", "score": "0.57143825", "text": "func ParseConfigFile(path string) (*structs.Config, error) {\n\tpath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer f.Close()\n\n\tconfig, err := ParseConfig(f)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "e7a5315559ff67d0c9cfae9f0ec03f50", "score": "0.57054824", "text": "func ReadUserConfig(file string) {\n\tUserCfg = ReadConfig(file)\n\tUserCfgFile = file\n}", "title": "" }, { "docid": "5e4bb7d5f279de00ab0d4d2af10564e2", "score": "0.5700728", "text": "func ReadConfig(configFile string) {\n\tif _, err := toml.DecodeFile(configFile, &Conf); err != nil {\n\t\tlogger.Fatal(\"[config] failed to read config:\", configFile, err)\n\t}\n\n\tif Conf.Log.Level != 0 {\n\t\tlogger.SetLevel(Conf.Log.Level)\n\t}\n\tif Conf.Log.File != \"\" {\n\t\tlogger.SetOutput(Conf.Log.File)\n\t}\n\tlogger.Debug(\"[config] read config successfully:\", Conf)\n}", "title": "" }, { "docid": "722a24a57510d61fcd6357d071bb52c6", "score": "0.56976455", "text": "func parseConfig() error {\n\tpaths := [...]string{\n\t\tpath.Join(os.ExpandEnv(\"${XDG_CONFIG_HOME}\"), configFilename),\n\t\tpath.Join(os.ExpandEnv(\"${HOME}\"), \".config\", configFilename),\n\t\tpath.Join(\"/etc\", configFilename),\n\t}\n\tvar configFile io.ReadCloser\n\tvar err error\n\tfor i, path := range paths {\n\t\tconfigFile, err = os.Open(path)\n\t\tif err != nil {\n\t\t\tif i == len(paths) {\n\t\t\t\t// exhausted all options\n\t\t\t\treturn errors.New(\"config file not found\")\n\t\t\t}\n\t\t} else {\n\t\t\t// opened file successfully\n\t\t\tbreak\n\t\t}\n\t}\n\tdefer configFile.Close()\n\treturn json.NewDecoder(configFile).Decode(&cfg)\n}", "title": "" } ]
99b721cafc69decc2197e8969c463d33
SetBounds sets the node bounding box for the given child index.
[ { "docid": "f639cf0fd75f703c51fee50576f47a38", "score": "0.77717537", "text": "func (n *Node) SetBounds(idx int, bounds m.BoundingBox) {\n\t//log.Printf(\"SetBounds %v %v\", idx, bounds)\n\tfor i := 0; i < 2; i++ {\n\t\tfor k := 0; k < 3; k++ {\n\t\t\tn.Boxes[idx+(i*12)+(k*4)] = bounds.Bounds[i][k]\n\t\t}\n\t}\n\t//log.Printf(\"SetBounds %v %v\", idx, n.boxes)\n}", "title": "" } ]
[ { "docid": "43d25716ec56768412b9a9d9162289fd", "score": "0.66580296", "text": "func (bb *BBox) SetBounds(min, max mat32.Vec3) {\n\tbb.BBox.Set(&min, &max)\n\tbb.UpdateFmBBox()\n}", "title": "" }, { "docid": "a61d2780a8275c9a7292155ee2f7cb97", "score": "0.6077097", "text": "func (self *TilemapLayer) SetChildIndex(child *DisplayObject, index int) {\n self.Object.Call(\"setChildIndex\", child, index)\n}", "title": "" }, { "docid": "ca29d9eda4110b72d86e4f8a695f25a2", "score": "0.5953701", "text": "func (n *Node) SetChild(idx int, ch int32) {\n\tn.Children[idx] = ch\n}", "title": "" }, { "docid": "807bccf2c71002cf4cfd313d159ae04c", "score": "0.58204377", "text": "func (n *Node) Bounds(idx int) (bounds m.BoundingBox) {\n\tfor i := 0; i < 2; i++ {\n\t\tfor k := 0; k < 3; k++ {\n\t\t\tbounds.Bounds[i][k] = n.Boxes[idx+(i*12)+(k*4)]\n\t\t}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "d6a777bff08738b399cb629eb40fd1b2", "score": "0.5812779", "text": "func (e *Explosions) SetBound(width, height float64) {\r\n\te.width = width\r\n\te.height = height\r\n}", "title": "" }, { "docid": "7f88004783de56a2e63541e48a1eaaef", "score": "0.56126165", "text": "func (n *Node) SetChild(kid Ki, idx int, name string) error {\n\tif err := n.Kids.IsValidIndex(idx); err != nil {\n\t\treturn err\n\t}\n\tif name != \"\" {\n\t\tkid.InitName(kid, name)\n\t} else {\n\t\tkid.Init(kid)\n\t}\n\tn.Kids[idx] = kid\n\tkid.SetParent(n.This())\n\treturn nil\n}", "title": "" }, { "docid": "9c20bb9b1401f3a5f806afaac239953a", "score": "0.559039", "text": "func (n *Node) SetChild(kid Ki, idx int, name string) error {\n\tif err := n.Kids.IsValidIndex(idx); err != nil {\n\t\treturn err\n\t}\n\tif name != \"\" {\n\t\tkid.InitName(kid, name)\n\t} else {\n\t\tInitNode(kid)\n\t}\n\tn.Kids[idx] = kid\n\tSetParent(kid, n.This())\n\treturn nil\n}", "title": "" }, { "docid": "a1a8f76dc589016bb834b9b2a07a62cf", "score": "0.5571284", "text": "func (c *Canvas) SetBounds(bounds pixel.Rect) {\n\tc.gf.SetBounds(bounds)\n\tif c.sprite == nil {\n\t\tc.sprite = pixel.NewSprite(nil, pixel.Rect{})\n\t}\n\tc.sprite.Set(c, c.Bounds())\n\t// c.sprite.SetMatrix(pixel.IM.Moved(c.Bounds().Center()))\n}", "title": "" }, { "docid": "75a1a128dc42ad79beeb979d5a516b08", "score": "0.5559087", "text": "func (self *ParticlesArcadeEmitter) SetChildIndex(child *DisplayObject, index int) {\n self.Object.Call(\"setChildIndex\", child, index)\n}", "title": "" }, { "docid": "9ad5714c020b44dc2fa1cc2eacffb2fc", "score": "0.54751503", "text": "func (it *Iterator) SetBounds(lower, upper []byte) {\n\tit.lower = lower\n\tit.upper = upper\n}", "title": "" }, { "docid": "74424cd6cc81b992b4d488afa44594a4", "score": "0.52145034", "text": "func (r *Rectangle) SetChildren(children ...*Rectangle) {\n\tlastRow := 0\n\tlastColumn := 0\n\tfor _, child := range children {\n\t\tif r.HasRows() {\n\t\t\t// variable sized rectangle (both width and height)\n\t\t\tif child.width != nil && child.height != nil {\n\t\t\t\t// with percent of the width and height\n\t\t\t\tchild.topCorner.Row = lastRow\n\t\t\t\tchild.topCorner.Column = lastColumn\n\t\t\t\tchild.bottomCorner.Row = child.calculatedHeight(r.bottomCorner.Row)\n\t\t\t\tchild.bottomCorner.Column = child.calculatedWidth(r.bottomCorner.Column)\n\t\t\t\tlastColumn = child.bottomCorner.Column\n\t\t\t\tlastRow = child.bottomCorner.Row\n\t\t\t\tlog.Printf(\"parent at %04d,%04d\", lastColumn, lastRow)\n\t\t\t\tlog.Printf(\"child [%04d,%04d->%04d,%04d]\", child.topCorner.Column, child.topCorner.Row, child.bottomCorner.Column, child.bottomCorner.Row)\n\t\t\t\tchild.invalidateSize()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// fixed size rectangle\n\t\t\tif child.width == nil && child.height == nil {\n\t\t\t\tchild.topCorner.Row = lastRow\n\t\t\t\tchild.topCorner.Column = lastColumn\n\t\t\t\tchild.bottomCorner.Row = r.bottomCorner.Row\n\t\t\t\tchild.bottomCorner.Column = r.bottomCorner.Column\n\t\t\t\tchild.invalidateSize()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// variable width rectangle\n\t\t\tif child.width != nil {\n\t\t\t\tchild.bottomCorner.Column = child.calculatedWidth(r.bottomCorner.Column)\n\t\t\t\tlastColumn = child.bottomCorner.Column\n\t\t\t} else {\n\t\t\t\t// with 100% width\n\t\t\t\tchild.bottomCorner.Column = r.bottomCorner.Column\n\t\t\t\tlastColumn = child.bottomCorner.Column\n\t\t\t}\n\n\t\t\t// variable height rectangle\n\t\t\tif child.height != nil {\n\t\t\t\t// with percent of the height\n\t\t\t\tchild.bottomCorner.Row = child.calculatedHeight(r.bottomCorner.Row)\n\t\t\t\tlastRow = child.bottomCorner.Row\n\t\t\t} else {\n\t\t\t\t// with 100% height\n\t\t\t\tchild.bottomCorner.Row = r.bottomCorner.Row\n\t\t\t\tlastRow = child.bottomCorner.Row\n\t\t\t}\n\n\t\t} else if r.HasColumns() {\n\t\t\t// columns orientation\n\t\t\tif child.width == nil && child.height == nil {\n\t\t\t\t// fixed size rectangle\n\t\t\t} else {\n\t\t\t\t// variable sized rectangle\n\t\t\t\tif child.width != nil {\n\t\t\t\t\t// with percent of the width\n\t\t\t\t} else {\n\t\t\t\t\t// with 100% width\n\t\t\t\t}\n\t\t\t\tif child.height != nil {\n\t\t\t\t\t// with percent of the height\n\t\t\t\t} else {\n\t\t\t\t\t// with 100% height\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Println(\"bad call to Rectangle.SetChildren : orientation is not set (should never happen)\")\n\t\t}\n\t\tr.children = append(r.children, child) // TODO : mount death listener and remove child when shutdown\n\t\tchild.invalidateSize()\n\t}\n}", "title": "" }, { "docid": "2d81e18f1cd0a3f9a8610904ce75339f", "score": "0.5114901", "text": "func (w *Window) SetBounds(bounds pixel.Rect) {\n\tw.bounds = bounds\n\tmainthread.Call(func() {\n\t\t_, _, width, height := intBounds(bounds)\n\t\tw.window.SetSize(width, height)\n\t})\n}", "title": "" }, { "docid": "9cafcdf49f1712408e238d75bee7fcca", "score": "0.5106047", "text": "func (bs *RectBounds) Set(top, right, bottom, left float32) {\n\n\tif top >= 0 {\n\t\tbs.Top = top\n\t}\n\tif right >= 0 {\n\t\tbs.Right = right\n\t}\n\tif bottom >= 0 {\n\t\tbs.Bottom = bottom\n\t}\n\tif left >= 0 {\n\t\tbs.Left = left\n\t}\n}", "title": "" }, { "docid": "b4f2d7eacbe62f9f9956d91ebfcae48b", "score": "0.50655323", "text": "func (self *TilemapLayer) SetChildIndexI(args ...interface{}) {\n self.Object.Call(\"setChildIndex\", args)\n}", "title": "" }, { "docid": "22cc6acd93058f8c4457550cc8b4ce5c", "score": "0.49873587", "text": "func (n *Node) SetNChildren(trgn int, typ reflect.Type, nameStub string) (mods, updt bool) {\n\tmods, updt = false, false\n\tsz := len(n.Kids)\n\tif trgn == sz {\n\t\treturn\n\t}\n\tfor sz > trgn {\n\t\tif !mods {\n\t\t\tmods = true\n\t\t\tupdt = n.UpdateStart()\n\t\t}\n\t\tsz--\n\t\tn.DeleteChildAtIndex(sz, true)\n\t}\n\tfor sz < trgn {\n\t\tif !mods {\n\t\t\tmods = true\n\t\t\tupdt = n.UpdateStart()\n\t\t}\n\t\tnm := fmt.Sprintf(\"%v%v\", nameStub, sz)\n\t\tn.InsertNewChildFast(typ, sz, nm)\n\t\tsz++\n\t}\n\treturn\n}", "title": "" }, { "docid": "a652bb35518b4e4b3d3c3b49ef589533", "score": "0.4949254", "text": "func (n *Node) SetNChildren(trgn int, typ reflect.Type, nameStub string) (mods, updt bool) {\n\tmods, updt = false, false\n\tsz := len(n.Kids)\n\tif trgn == sz {\n\t\treturn\n\t}\n\tfor sz > trgn {\n\t\tif !mods {\n\t\t\tmods = true\n\t\t\tupdt = n.UpdateStart()\n\t\t}\n\t\tsz--\n\t\tn.DeleteChildAtIndex(sz, true)\n\t}\n\tfor sz < trgn {\n\t\tif !mods {\n\t\t\tmods = true\n\t\t\tupdt = n.UpdateStart()\n\t\t}\n\t\tnm := fmt.Sprintf(\"%s%d\", nameStub, sz)\n\t\tn.InsertNewChild(typ, sz, nm)\n\t\tsz++\n\t}\n\treturn\n}", "title": "" }, { "docid": "305ff4bd3116dd0662a68bc3547e8218", "score": "0.49469006", "text": "func SetPumBounds(width, height, row, col float64) {\n\tname(nvim_ui_pum_set_bounds)\n}", "title": "" }, { "docid": "8d6ba21d6fcd329965644fd33fd11fea", "score": "0.49211988", "text": "func (n *Node) SetEmptyLeaf(idx int) {\n\tn.Children[idx] = -1\n\tb := m.InfBox\n\t//b := m.BoundingBox{}\n\t//b.Reset() // setting it like this will not stop rays hitting!\n\t/*\tb.Bounds[0][0] = m.Inf(1)\n\t\tb.Bounds[0][1] = 50000\n\t\tb.Bounds[0][1] = 50000\n\t\tb.Bounds[1][0] = 50000\n\t\tb.Bounds[1][1] = 50000\n\t\tb.Bounds[1][1] = 50000*/\n\tn.SetBounds(idx, b)\n}", "title": "" }, { "docid": "647621341b9e94092fb8c04165876ee2", "score": "0.47747624", "text": "func (v *Stack) SetVisibleChild(child IWidget) {\n\tC.gtk_stack_set_visible_child(v.native(), child.toWidget())\n}", "title": "" }, { "docid": "303311347d8e47fd314b04814c971ea3", "score": "0.472968", "text": "func (c *CloudMemorystoreInstance) SetBound(state bool) {\n\tif state {\n\t\tc.Status.Phase = corev1alpha1.BindingStateBound\n\t} else {\n\t\tc.Status.Phase = corev1alpha1.BindingStateUnbound\n\t}\n}", "title": "" }, { "docid": "17e15a9d1bb5b10dc9a5b33444de2e14", "score": "0.46330935", "text": "func (self *ParticlesArcadeEmitter) SetChildIndexI(args ...interface{}) {\n self.Object.Call(\"setChildIndex\", args)\n}", "title": "" }, { "docid": "d3e7321009b8c60deaa4ab41778612b9", "score": "0.4582624", "text": "func (this *quadTreeNode) setRect(rect *Rect) {\n\tthis.rect = *rect\n}", "title": "" }, { "docid": "e79861ab876a236606d6ac2cc0ec904f", "score": "0.45758954", "text": "func (a *ArraySpan) resizeChildren(i int) {\n\tif cap(a.Children) >= i {\n\t\ta.Children = a.Children[:i]\n\t} else {\n\t\ta.Children = make([]ArraySpan, i)\n\t}\n}", "title": "" }, { "docid": "34fdd56f1577437d1d28fb45570ce3c0", "score": "0.45361897", "text": "func (be *BitExtractor) SetBounds(start, len int) {\n\tif start < 0 || len < 1 {\n\t\tpanic(fmt.Sprintf(\"illegal start (%d) or length (%d)\", start, len))\n\t}\n\tif start+len < 0 {\n\t\t// check for overflow\n\t\tpanic(fmt.Sprintf(\"cannot handle such a large start (%d) and length (%d)\",\n\t\t\tstart, len))\n\t}\n\n\tbe.bitStart = start\n\tbe.byteStart = start / ByteSize\n\tbe.dstLen = len/ByteSize + ifAligned(len, 0, 1)\n\tsrcEndByte := ((start + len) / ByteSize) - ifAligned(start+len, 1, 0)\n\tbe.srcLen = srcEndByte - be.byteStart + 1\n\tsrcEndOffset := (start + len - 1) % ByteSize\n\tbe.rshift = uint8(ByteSize - srcEndOffset - 1)\n\tbe.lshift = uint8(srcEndOffset + 1)\n\tbe.mask = byte(ifAligned(len, ByteMask, (1<<uint(len%ByteSize))-1))\n\n\tswitch {\n\tcase be.rshift == 0:\n\t\tbe.bias = srcAligned\n\tcase be.srcLen == be.dstLen:\n\t\tbe.bias = srcBiasPrev\n\tdefault:\n\t\tbe.bias = srcBiasNext\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "220951c2cb6b7144748459fa262f7a25", "score": "0.44916505", "text": "func WithBounds(up, lo uint64) IndexOption {\n\treturn func(idx *Index) {\n\t\t// Should crash execution rather than running the index with sneaky bugs\n\t\tif up < lo {\n\t\t\tpanic(\"upper bound cannot be lower than lower bound\")\n\t\t}\n\t\tidx.ub = up\n\t\tidx.lb = lo\n\t}\n}", "title": "" }, { "docid": "948bc5f592783669d16dde901cc05ad1", "score": "0.44377354", "text": "func (inst *Instance) AddChildAt(index int, child *Instance) error {\n\tif err := assertLoop(child, inst); err != nil {\n\t\treturn err\n\t}\n\tif index < 0 {\n\t\tindex = 0\n\t} else if index >= len(inst.children) {\n\t\tinst.addChild(child)\n\t\treturn nil\n\t}\n\tif child.parent != nil {\n\t\tchild.parent.RemoveChild(child)\n\t}\n\tinst.children = append(inst.children, nil)\n\tcopy(inst.children[index+1:], inst.children[index:])\n\tinst.children[index] = child\n\tchild.parent = inst\n\treturn nil\n}", "title": "" }, { "docid": "7c7679344c6d87928a50e9304fab69bd", "score": "0.44161096", "text": "func (f *Faster) SetLimit(newLimit int) {\n\tf.tree.Limit = newLimit\n}", "title": "" }, { "docid": "c688905df0480fe461144a1dcbdc3b5b", "score": "0.441414", "text": "func (n *Node) SetChildType(t reflect.Type) error {\n\tif !reflect.PtrTo(t).Implements(reflect.TypeOf((*Ki)(nil)).Elem()) {\n\t\terr := fmt.Errorf(\"Ki Node %v SetChildType: type does not implement the Ki interface -- must -- type passed is: %v\", n.PathUnique(), t.Name())\n\t\tlog.Print(err)\n\t\treturn err\n\t}\n\tn.SetProp(\"ChildType\", t)\n\treturn nil\n}", "title": "" }, { "docid": "3679fb40ee1e60c220a9390150f3d348", "score": "0.43966234", "text": "func (n *Node) ChildAt(idx int) INode {\r\n\r\n\tif idx < 0 || idx >= len(n.children) {\r\n\t\treturn nil\r\n\t}\r\n\treturn n.children[idx]\r\n}", "title": "" }, { "docid": "549bbdd537ca682b9d4b03be813ad13f", "score": "0.4369212", "text": "func (self *TilemapLayer) SetChildrenA(member []DisplayObject) {\n self.Object.Set(\"children\", member)\n}", "title": "" }, { "docid": "c78f4874d758576f9e63c4aaf765c214", "score": "0.43576488", "text": "func (n *Node) SetLeaf(idx int, first, count uint32) {\n\tif count == 0 {\n\t\tn.SetEmptyLeaf(idx)\n\t\treturn\n\t}\n\n\tv := (1 << 31) | ((first << 4) & 0xfffffff0) | ((count - 1) & 0xf)\n\tn.Children[idx] = int32(v)\n\t//log.Printf(\"%v %v\", n.children[idx], v)\n\t//log.Printf(\"%v %v\", (n.children[idx]&(0x7fffffff))>>4, (v&0x7fffffff)>>4)\n\t//log.Printf(\"%v %v\", n.children[idx]&0xf, v&0xf)\n}", "title": "" }, { "docid": "964ccb40adbe28b1f71d271a28b3f349", "score": "0.43554324", "text": "func (cv Canvas) SetBoundaries(x int, y int, w int, h int) error {\n\tret, err := C.caca_set_canvas_boundaries(cv.Cv, C.int(x), C.int(y), C.int(w), C.int(h))\n\n\tif int(ret) == -1 {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7255df8d64a4808d0bef3856efc16daf", "score": "0.43546772", "text": "func (t *SegmentTree) Set(idx, val int) bool {\n\tif idx < 0 || idx >= t.size || len(t.tree) == 0 {\n\t\treturn false // wrong index\n\t}\n\n\tcur := t.levels[len(t.levels)-1].begin + idx\n\tif t.tree[cur] == val {\n\t\treturn true // the same value, nothing to do\n\t}\n\n\tt.tree[cur] = val\n\tfor l := len(t.levels) - 2; l >= 0; l-- {\n\t\tcur = (cur - 1) / 2\n\t\tleft := 2*cur + 1\n\t\tright := 2*cur + 2\n\n\t\tif right > t.levels[l+1].end {\n\t\t\tt.tree[cur] = t.tree[left]\n\t\t} else {\n\t\t\tt.tree[cur] = t.fn(t.tree[left], t.tree[right])\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "77df0fc29c3216268f46bafdcc57f5b8", "score": "0.43137646", "text": "func TestSetHamtChild(t *testing.T) {\n\tctx := context.Background()\n\n\tds := mdtest.Mock()\n\ts, _ := NewShard(ds, 256)\n\n\te := ft.EmptyDirNode()\n\tds.Add(ctx, e)\n\n\terr := s.Set(ctx, \"bar\", e)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsnd, err := s.Node()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, ns, err := makeDir(ds, 50)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = ns.Set(ctx, \"foo\", snd)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tnsnd, err := ns.Node()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ths, err := NewHamtFromDag(ds, nsnd)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = assertLink(hs, \"bar\", false)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = assertLink(hs, \"foo\", true)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "f0904c31716415da3991d514679a7c08", "score": "0.42976758", "text": "func (self *StellarTransactionConstructor) SetTimeBound(lowerbound, upperbound int64) error {\n\ttimeBounds := xdr.TimeBounds{}\n\ttimeBounds.MinTime = xdr.TimePoint(lowerbound)\n\ttimeBounds.MaxTime = xdr.TimePoint(upperbound)\n\tself.mutex.Lock()\n\tdefer self.mutex.Unlock()\n\tself.txeB.E.Tx.TimeBounds = &timeBounds\n\treturn nil\n}", "title": "" }, { "docid": "e815992fd36ac584097a6451c849fe80", "score": "0.42800885", "text": "func (x ArrayType) Set(i int, child Ast) {\n\texpr := ToExpr(child)\n\tif i == 0 {\n\t\tx.X.Len = expr\n\t} else if i == 1 {\n\t\tx.X.Elt = expr\n\t} else {\n\t\tbadIndex(i, 2)\n\t}\n}", "title": "" }, { "docid": "a1b0ee78fe1506be8a9f32cf20c55b4a", "score": "0.42450345", "text": "func (_m *MockEParameter) SetUpperBound(_a0 int) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "23628bf4a544d5f3c580c0775d5e3ff6", "score": "0.42369866", "text": "func (recv *Window) SetChildShapes() {\n\tC.gdk_window_set_child_shapes((*C.GdkWindow)(recv.native))\n\n\treturn\n}", "title": "" }, { "docid": "b26d0fb4a86a8b8c064353b1e4be75d3", "score": "0.4217451", "text": "func (t *TNode) SetRChild(n *TNode) {\n\tt.rchild = n\n}", "title": "" }, { "docid": "237f9114d5e9baecaa42ec2e9203107c", "score": "0.42170408", "text": "func (m *Term) SetChildren(value []Termable)() {\n err := m.GetBackingStore().Set(\"children\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "1b2de8164d3b7c78764223f2981750a2", "score": "0.42143178", "text": "func (bi *Amounts) Set(index int, bigint *Amount) error {\n\tif index < 0 || index >= len(bi.bigints) {\n\t\treturn errors.New(\"index out of bounds\")\n\t}\n\tbi.bigints[index] = bigint.bigint\n\treturn nil\n}", "title": "" }, { "docid": "bf16ea6f2a68894837e64965f338e1d6", "score": "0.42028058", "text": "func (self *PhysicsArcadeBody) SetOnWorldBoundsA(member *Signal) {\n self.Object.Set(\"onWorldBounds\", member)\n}", "title": "" }, { "docid": "ce19571ebeab8ec4d2ee565be110bab2", "score": "0.41812855", "text": "func (n *Node) SetPosition(pos image.Point) {\n\tshift := pos.Sub(n.Position())\n\tn.positioner.SetPosition(pos)\n\tn.BBoxDefaultSetPosition(pos)\n\tfor _, p := range n.ports {\n\t\tp.SetPosition(p.Position().Add(shift))\n\t}\n}", "title": "" }, { "docid": "bfc457c19d6ff243dc68f2b6830a2638", "score": "0.41686237", "text": "func (p *Prospector) SetRect(x1, y1, x2, y2 int) {\n\tp.view.SetRect(x1, y1, x2, y2)\n\n\t// 4*3+2 for dividers and padding\n\t// 10 for orphaned\n\t// 10 for status\n\t// 20 for lines\n\t// divide amongst remaining 2 columns\n\tcalculatedWidth := int((p.Inner.Dx() - 14 - 10 - 10 - 20) / 2)\n\tcolumnWidths := []int{calculatedWidth, 10, 10, 20, calculatedWidth}\n\n\tp.table.ColumnWidths = columnWidths\n\tp.table.SetRect(p.Min.X, p.Min.Y, p.Max.X, p.Max.Y)\n}", "title": "" }, { "docid": "93cd2b02fea410a8f26d2b198b94861b", "score": "0.41640455", "text": "func (n *Node) AddAt(idx int, ichild INode) *Node {\r\n\r\n\t// Validate position\r\n\tif idx < 0 || idx > len(n.children) {\r\n\t\tpanic(\"Node.AddAt: invalid position\")\r\n\t}\r\n\r\n\tsetParent(n.GetINode(), ichild)\r\n\r\n\t// Insert child in the specified position\r\n\tn.children = append(n.children, nil)\r\n\tcopy(n.children[idx+1:], n.children[idx:])\r\n\tn.children[idx] = ichild\r\n\r\n\tn.Dispatch(OnDescendant, nil)\r\n\r\n\treturn n\r\n}", "title": "" }, { "docid": "8dfff8d74d23ae74058a117846820a47", "score": "0.41449642", "text": "func (self *TilemapLayer) AddChildAt(child *DisplayObject, index int) *DisplayObject{\n return &DisplayObject{self.Object.Call(\"addChildAt\", child, index)}\n}", "title": "" }, { "docid": "02573dad49c9aaddfb50cce527e37b5e", "score": "0.41402233", "text": "func (r *BasicRectangleNode) SetBoundsUsingComps(minx, miny, maxx, maxy float64) {\n\tr.min.SetByComp(minx, miny)\n\tr.max.SetByComp(maxx, maxy)\n\tr.SetDirty(true)\n}", "title": "" }, { "docid": "940ac4115bf3e58e2d125e75541436fa", "score": "0.41359338", "text": "func (mt *MachineTarget) SetLimits(min, max int) {\n\tannotations := mt.GetAnnotations()\n\n\tif annotations == nil {\n\t\tannotations = make(map[string]string)\n\t}\n\n\tannotations[minSizeAnnotation] = strconv.Itoa(min)\n\tannotations[maxSizeAnnotation] = strconv.Itoa(max)\n\n\tmt.SetAnnotations(annotations)\n}", "title": "" }, { "docid": "cdb496a6238e6ed09bb24ead8d9c8d48", "score": "0.41333798", "text": "func (self *TilemapLayer) SetScaleMinMax(minX interface{}, minY interface{}, maxX interface{}, maxY interface{}) {\n self.Object.Call(\"setScaleMinMax\", minX, minY, maxX, maxY)\n}", "title": "" }, { "docid": "3ccfa17419704fc7b226ee6719ea5e93", "score": "0.41190085", "text": "func (obj *Scale) SetValuePos(pos PositionType) {\n\tobj.Candy().Guify(\"gtk_scale_set_value_pos\", obj, pos)\n}", "title": "" }, { "docid": "88f0e9cfedf9beb3a6ace9376539afe9", "score": "0.4118553", "text": "func (c Conversations) SetRect(x, y, width, height int) {\n\tc.flex.SetRect(x, y, width, height)\n}", "title": "" }, { "docid": "4ab5ea4f544e626ba170cc9d8adfc6ba", "score": "0.4113785", "text": "func (a *Area) SetRect(r image.Rectangle) {\n\tatr := r.Min.Sub(a.bounds.Min) // translation to display coordinates\n\ta.bounds.Max = a.bounds.Min.Add(r.Size())\n\tfor ad := &a.ad; ad != nil; ad = ad.link {\n\t\tad.disp.mt.Lock()\n\t\tdtr := ad.disp.tr\n\t\tdrvBounds := ad.disp.drvBounds\n\t\tad.disp.mt.Unlock()\n\t\tad.tr = dtr.Add(atr)\n\t\tad.visible = r.Add(dtr).Intersect(drvBounds)\n\t}\n}", "title": "" }, { "docid": "e7515fe7bd52bb432bf22ca56ff6a40d", "score": "0.40577802", "text": "func (inst *Instance) RemoveChildAt(index int) *Instance {\n\tif index < 0 || index >= len(inst.children) {\n\t\treturn nil\n\t}\n\treturn inst.removeChildAt(index)\n}", "title": "" }, { "docid": "2c550d24befcb8014242f35e3ca1a604", "score": "0.40575606", "text": "func (n *Node) DeleteChildAtIndex(idx int, destroy bool) error {\n\tchild, err := n.ChildTry(idx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tupdt := n.UpdateStart()\n\tn.SetFlag(int(ChildDeleted))\n\tif child.Parent() == n.This() {\n\t\t// only deleting if we are still parent -- change parent first to\n\t\t// signal move delete is always sent live to affected node without\n\t\t// update blocking note: children of child etc will not send a signal\n\t\t// at this point -- only later at destroy -- up to this parent to\n\t\t// manage all that\n\t\tchild.SetFlag(int(NodeDeleted))\n\t\tchild.NodeSignal().Emit(child, int64(NodeSignalDeleting), nil)\n\t\tchild.SetParent(nil)\n\t}\n\tn.Kids.DeleteAtIndex(idx)\n\tif destroy {\n\t\tDelMgr.Add(child)\n\t}\n\tchild.UpdateReset() // it won't get the UpdateEnd from us anymore -- init fresh in any case\n\tn.UpdateEnd(updt)\n\treturn nil\n}", "title": "" }, { "docid": "fbed90a02e7ed63ca2130a153a7a88c4", "score": "0.404017", "text": "func (n *Node) DeleteChildAtIndex(idx int, destroy bool) error {\n\tchild, err := n.ChildTry(idx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tupdt := n.UpdateStart()\n\tn.SetFlag(int(ChildDeleted))\n\tif child.Parent() == n.This() {\n\t\t// only deleting if we are still parent -- change parent first to\n\t\t// signal move delete is always sent live to affected node without\n\t\t// update blocking note: children of child etc will not send a signal\n\t\t// at this point -- only later at destroy -- up to this parent to\n\t\t// manage all that\n\t\tchild.SetFlag(int(NodeDeleted))\n\t\tchild.NodeSignal().Emit(child, int64(NodeSignalDeleting), nil)\n\t\tSetParent(child, nil)\n\t}\n\tn.Kids.DeleteAtIndex(idx)\n\tif destroy {\n\t\tDelMgr.Add(child)\n\t}\n\tUpdateReset(child) // it won't get the UpdateEnd from us anymore -- init fresh in any case\n\tn.UpdateEnd(updt)\n\treturn nil\n}", "title": "" }, { "docid": "97083721c8f46b4f85a21b1863ec908e", "score": "0.40384418", "text": "func (v *ButtonBox) SetChildSecondary(child IWidget, isSecondary bool) {\n\tC.gtk_button_box_set_child_secondary(v.native(), child.toWidget(), gbool(isSecondary))\n}", "title": "" }, { "docid": "ec80d1422386c8a728b2c32fd08dadb5", "score": "0.40356633", "text": "func (_NodeIngress *NodeIngressTransactor) SetContractAddress(opts *bind.TransactOpts, name [32]byte, addr common.Address) (*types.Transaction, error) {\n\treturn _NodeIngress.contract.Transact(opts, \"setContractAddress\", name, addr)\n}", "title": "" }, { "docid": "3aa66c68554b13d4242a0935deaf6b08", "score": "0.4026004", "text": "func (_m *MockEGenericType) SetEUpperBound(_a0 EGenericType) {\n\t_m.Called(_a0)\n}", "title": "" }, { "docid": "04004d4bec54c2c8d9ccc88569f2ad61", "score": "0.40214288", "text": "func (v *Stack) SetVisibleChildName(name string) {\n\tcstr := C.CString(name)\n\tdefer C.free(unsafe.Pointer(cstr))\n\tC.gtk_stack_set_visible_child_name(v.native(), (*C.gchar)(cstr))\n}", "title": "" }, { "docid": "8cf47b4c63fb4ce08985938db26f2ed5", "score": "0.40185052", "text": "func (e *FixedRatio) Init(window *pixelgl.Window, bounds *pixel.Rect) (err error) {\n\t// Initialise the element part of the fixed ratio\n\terr = e.Impl.Init(window, bounds)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If the bounds are known\n\tif bounds != nil {\n\t\t// Calculate the correct dimensions of the child\n\t\tdimensions := e.Ratio.RestrictDimensions(bounds.Size())\n\n\t\t// If the bounds are integers\n\t\tboundsSize := bounds.Size()\n\t\tif boundsSize == boundsSize.Floor() {\n\t\t\t// While the dimensions aren't integers\n\t\t\tfor dimensions.Floor() != dimensions {\n\t\t\t\tif dimensions.X == bounds.Size().X {\n\t\t\t\t\tboundsSize.X -= 1\n\t\t\t\t\tdimensions = e.Ratio.RestrictDimensions(boundsSize)\n\t\t\t\t} else {\n\t\t\t\t\tboundsSize.Y -= 1\n\t\t\t\t\tdimensions = e.Ratio.RestrictDimensions(boundsSize)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Calculate the minimum point for the child (based on gravity)\n\t\tmin := element.CalculateMin(e, bounds, dimensions)\n\n\t\t// If the minimum point was calculated (it should've been)\n\t\tif min != nil {\n\t\t\t// Create the bounds of the child\n\t\t\tchildBounds := pixel.Rect{\n\t\t\t\tMin: *min,\n\t\t\t\tMax: min.Add(dimensions),\n\t\t\t}\n\n\t\t\t// Initialise the child with the bounds\n\t\t\terr = e.GetChild(0).Init(window, &childBounds)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\t// Initialise the child with the bounds\n\t\t\terr = e.GetChild(0).Init(window, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise\n\t} else {\n\t\t// Initialise the child with no bounds\n\t\terr = e.GetChild(0).Init(window, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// If the width is meant to match the content size\n\tif e.GetRelWidth().MatchContent {\n\t\t// Set the width as the child's\n\t\te.SetActualWidth(e.GetChild(0).GetActualWidth())\n\t}\n\n\t// If the height is meant to match the content size\n\tif e.GetRelHeight().MatchContent {\n\t\t// Set the height as the child's\n\t\te.SetActualHeight(e.GetChild(0).GetActualHeight())\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d954be4a39ea32152aaef89dc027f9ec", "score": "0.39607853", "text": "func (r *ratchetingValueValidator) SubIndexValidator(index int, schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry, options ...validate.Option) validate.ValueValidator {\n\toldValueForIndex := r.correlateOldValueForChildAtNewIndex(index)\n\tif oldValueForIndex == nil {\n\t\t// If correlation fails, default to non-ratcheting logic\n\t\treturn validate.NewSchemaValidator(schema, rootSchema, root, formats, options...)\n\t}\n\n\treturn inlineValidator(func(new interface{}) *validate.Result {\n\t\tchildNode := newRatchetingValueValidator(new, oldValueForIndex, schemaArgs{\n\t\t\tschema: schema,\n\t\t\troot: rootSchema,\n\t\t\tpath: root,\n\t\t\tknownFormats: formats,\n\t\t\toptions: options,\n\t\t})\n\n\t\tr.children[index] = childNode\n\t\treturn childNode.Validate()\n\t})\n}", "title": "" }, { "docid": "569fb6b0956517a5e5617f70ca2b2564", "score": "0.3953321", "text": "func (p *cinderPlugin) SetQuota(project core.KeystoneProject, quotas map[string]uint64) error {\n\tvar requestData struct {\n\t\tQuotaSet map[string]uint64 `json:\"quota_set\"`\n\t}\n\trequestData.QuotaSet = make(map[string]uint64)\n\n\tfor _, volumeType := range p.VolumeTypes {\n\t\tquotaCapacity := quotas[p.makeResourceName(\"capacity\", volumeType)]\n\t\trequestData.QuotaSet[\"gigabytes_\"+volumeType] = quotaCapacity\n\t\trequestData.QuotaSet[\"gigabytes\"] += quotaCapacity\n\n\t\tquotaSnapshots := quotas[p.makeResourceName(\"snapshots\", volumeType)]\n\t\trequestData.QuotaSet[\"snapshots_\"+volumeType] = quotaSnapshots\n\t\trequestData.QuotaSet[\"snapshots\"] += quotaSnapshots\n\n\t\tquotaVolumes := quotas[p.makeResourceName(\"volumes\", volumeType)]\n\t\trequestData.QuotaSet[\"volumes_\"+volumeType] = quotaVolumes\n\t\trequestData.QuotaSet[\"volumes\"] += quotaVolumes\n\t}\n\n\turl := p.CinderV3.ServiceURL(\"os-quota-sets\", project.UUID)\n\t_, err := p.CinderV3.Put(url, requestData, nil, &gophercloud.RequestOpts{OkCodes: []int{200}}) //nolint:bodyclose // already closed by gophercloud\n\treturn err\n}", "title": "" }, { "docid": "51dfd3700dc5ce5a9a02f744963c042f", "score": "0.39529538", "text": "func (list *List) Set(index int, data interface{}) *List {\n\n\tif list.checkIndex(index) {\n\t\treturn list\n\t}\n\n\ttoSet := list.getNode(index)\n\ttoSet.data = data\n\n\treturn list\n}", "title": "" }, { "docid": "c33f95c714dbcfef0083d3bbf6599096", "score": "0.3950763", "text": "func (t *bptree) UpdateRange(minKey, maxKey int, f func([]byte) []byte) {\n\tt.root.updateRange(minKey, maxKey, f)\n}", "title": "" }, { "docid": "e958bac64d2b4c5a728495a204fdea3c", "score": "0.3945783", "text": "func (s *split) SetRenderRect(fullscreen bool, x, y, w, h int) {\n\ts.renderRect = Rect{x, y, w, h}\n\n\t// NOTE: should we clear the screen?\n\n\ts.refreshRenderRect(fullscreen)\n}", "title": "" }, { "docid": "c7cc99c907a12d35014da12f6c29dd90", "score": "0.39390203", "text": "func (self *RangeSearchAdvanced) setXTreeHeight() {\n\tarrayLength := len(self.xTree)\n\theight := uint(1)\n\tfor 1<<height < arrayLength {\n\t\theight++\n\t}\n\tself.xTreeHeight = int(height)\n}", "title": "" }, { "docid": "209fd279b41905a8ff2622e21c931c3e", "score": "0.3935639", "text": "func (z *ZoomNode) SetPosition(x, y float64) {\n\tz.zoom.SetPosition(x, y)\n\tz.RippleDirty(true)\n}", "title": "" }, { "docid": "c6819af7c29fd750dec8ce8a00f3fdcc", "score": "0.39317867", "text": "func (s *Scrollbar) SetSize(v wm.Size) { s.onSetSize.Handle(s.w, &s.size, v) }", "title": "" }, { "docid": "b31f89d43ebc1dba4acdedb361fa7eac", "score": "0.39316466", "text": "func (n *Node) SetScale(x, y, z float32) {\r\n\r\n\tn.scale.Set(x, y, z)\r\n\tn.matNeedsUpdate = true\r\n}", "title": "" }, { "docid": "9b6c5026d2b78d45cad712ac3a9d210a", "score": "0.3911903", "text": "func (v *ButtonBox) SetChildNonHomogeneous(child IWidget, nonHomogeneous bool) {\n\tC.gtk_button_box_set_child_non_homogeneous(v.native(), child.toWidget(), gbool(nonHomogeneous))\n}", "title": "" }, { "docid": "d577ed611231b0b17a7bee70aad7201d", "score": "0.3910996", "text": "func (n *Node) ChildIndex(ichild INode) int {\r\n\r\n\tfor idx := 0; idx < len(n.children); idx++ {\r\n\t\tif n.children[idx] == ichild {\r\n\t\t\treturn idx\r\n\t\t}\r\n\t}\r\n\treturn -1\r\n}", "title": "" }, { "docid": "a8f79dbba30c793caa667d5ecce35db8", "score": "0.3906188", "text": "func (_NodeIngress *NodeIngressSession) SetContractAddress(name [32]byte, addr common.Address) (*types.Transaction, error) {\n\treturn _NodeIngress.Contract.SetContractAddress(&_NodeIngress.TransactOpts, name, addr)\n}", "title": "" }, { "docid": "62641b4e82c4f30bbc02c1cc7557d27e", "score": "0.39029282", "text": "func (m *EdiscoveryReviewTag) SetChildSelectability(value *ChildSelectability)() {\n m.childSelectability = value\n}", "title": "" }, { "docid": "c161de5f6b1d75017af6a1e675c490f3", "score": "0.3902294", "text": "func (s *Scrollbar) SetHandlePosition(v int) { s.onSetHandlePos.Handle(s.w, &s.handlePos, v) }", "title": "" }, { "docid": "8e097b3eb0a014f9038065ff274b3ed9", "score": "0.38991314", "text": "func (inst *Instance) removeChildAt(i int) (child *Instance) {\n\tchild = inst.children[i]\n\tchild.parent = nil\n\tcopy(inst.children[i:], inst.children[i+1:])\n\tinst.children[len(inst.children)-1] = nil\n\tinst.children = inst.children[:len(inst.children)-1]\n\treturn child\n}", "title": "" }, { "docid": "baefae7d64eb61f4a2e86e71a72f6535", "score": "0.3895588", "text": "func SetRandomNumberBoundaries(start, end int) error {\n\tif start > end {\n\t\treturn errors.New(ErrStartValueBiggerThanEnd)\n\t}\n\tnBoundary = numberBoundary{start: start, end: end}\n\treturn nil\n}", "title": "" }, { "docid": "4defe00c3fe6f07a22ad6ac1b518b77f", "score": "0.38955075", "text": "func (this *ZxdgToplevelV6) SetMaxSize(width int32, height int32) error {\n\tif this == nil {\n\t\treturn errors.New(\"object is nil\")\n\t}\n\tif this.c.Err != nil {\n\t\treturn errors.Wrap(this.c.Err, \"global wayland error\")\n\t}\n\tthis.c.mu.Lock()\n\tdefer this.c.mu.Unlock()\n\t_, exists := this.c.obj[this.i]\n\tif !exists {\n\t\treturn errors.New(\"object has been deleted\")\n\t}\n\tthis.c.buf.Reset()\n\tvar tmp int32\n\t_ = tmp\n\tvar oob []byte\n\tbinary.Write(this.c.buf, hostByteOrder, this.i)\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(0))\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(width))\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(height))\n\thostByteOrder.PutUint32(this.c.buf.Bytes()[4:8], uint32(this.c.buf.Len())<<16|opCodeZxdgToplevelV6SetMaxSize)\n\n\tfmt.Println(\"Sending ZxdgToplevelV6 -> SetMaxSize\")\n\tfmt.Println(hex.Dump(this.c.buf.Bytes()))\n\tthis.c.c.WriteMsgUnix(this.c.buf.Bytes(), oob, nil)\n\treturn nil\n}", "title": "" }, { "docid": "16033311042144ceeddd8f09d7878fb4", "score": "0.38936022", "text": "func (intSlice IntSlice) SetValue(i int, value interface{}) {\n\tintSlice.IntSlice[i] = value.(int)\n}", "title": "" }, { "docid": "8d83aa062ed3bf5f5006a46319dcf212", "score": "0.3884651", "text": "func updateBounds(p *path, x, y, z float64) {\n\tp.minXYZ.X, p.maxXYZ.X = math.Min(p.minXYZ.X, x), math.Max(p.maxXYZ.X, x)\n\tp.minXYZ.Y, p.maxXYZ.Y = math.Min(p.minXYZ.Y, y), math.Max(p.maxXYZ.Y, y)\n\tp.minXYZ.Z, p.maxXYZ.Z = math.Min(p.minXYZ.Z, z), math.Max(p.maxXYZ.Z, z)\n}", "title": "" }, { "docid": "78777bace5769f4ae2ea9b9d3ed5488d", "score": "0.38829997", "text": "func (t *Dense) SetMaskAtIndex(v bool, i int) error {\n\tif !t.IsMasked() {\n\t\treturn nil\n\t}\n\tt.mask[i] = v\n\treturn nil\n}", "title": "" }, { "docid": "1b14bde241e26ed3cb06ebb2eb52c46d", "score": "0.3881235", "text": "func (s *children) insertAt(index int, n *node) {\n\tcn := childrenNode{\n\t\tchildNode: n,\n\t\tchildNodeId: n.nodeId,\n\t}\n\t*s = append(*s, nil)\n\tif index < len(*s) {\n\t\tcopy((*s)[index+1:], (*s)[index:])\n\t}\n\t(*s)[index] = &cn\n}", "title": "" }, { "docid": "197bfa8bef99e54dc60441df8f7b108e", "score": "0.3880881", "text": "func (b *FakeBucket) SetVbmap(kvaddr string, vbnos []uint16) {\n\tb.vbmap[kvaddr] = vbnos\n}", "title": "" }, { "docid": "238f28931b51c87214a617cc3af58c27", "score": "0.38790983", "text": "func (c *LitRpcClient) SetContractDivision(contractIndex uint64, valueFullyOurs, valueFullyTheirs int64) error {\n\targs := new(litrpc.SetContractDivisionArgs)\n\targs.CIdx = contractIndex\n\targs.ValueFullyOurs = valueFullyOurs\n\targs.ValueFullyTheirs = valueFullyTheirs\n\treply := new(litrpc.SetContractDivisionReply)\n\terr := c.rpcConn.Call(\"LitRPC.SetContractDivision\", args, reply)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !reply.Success {\n\t\treturn fmt.Errorf(\"Server returned success = false\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "53b0276e244719d439930dbeac982d05", "score": "0.38700876", "text": "func (n *Node) RemoveAt(idx int) INode {\r\n\r\n\t// Validate position\r\n\tif idx < 0 || idx >= len(n.children) {\r\n\t\tpanic(\"Node.RemoveAt: invalid position\")\r\n\t}\r\n\r\n\tchild := n.children[idx]\r\n\r\n\t// Remove child from children list\r\n\tcopy(n.children[idx:], n.children[idx+1:])\r\n\tn.children[len(n.children)-1] = nil\r\n\tn.children = n.children[:len(n.children)-1]\r\n\r\n\tn.Dispatch(OnDescendant, nil)\r\n\r\n\treturn child\r\n}", "title": "" }, { "docid": "3f44df41f123c6073388fe42c5f37cb1", "score": "0.38681746", "text": "func (n *ttreeNode) addChild(idx byte) *ttreeNode {\n\tif nil == n.nodes {\n\t\tn.nodes = make([]*ttreeNode, TTreeNodeMax)\n\t}\n\tnode := n.nodes[idx]\n\tif nil == node {\n\t\tnode = newTTreeNode()\n\t\tn.nodes[idx] = node\n\t\t// If allocate new, update child cnt\n\t\tn.childCnt++\n\t\tnode.parent = n\n\t\tnode.level = n.level + 1\n\t\tnode.value = idx\n\t}\n\n\treturn node\n}", "title": "" }, { "docid": "1b127d53144ed74a49f4b5f86e819948", "score": "0.38667068", "text": "func (f *Frame) SetRects(r image.Rectangle, b *draw.Image) {\n\theight := f.Font.DefaultHeight()\n\tf.Background = b\n\tf.Entire = r\n\tf.Rect = r\n\tf.Rect.Max.Y -= (r.Max.Y - r.Min.Y) % height\n\tf.maxlines = (r.Max.Y - r.Min.Y) / height\n}", "title": "" }, { "docid": "1a43197dd9b1db46dd0cb12a7cc8b46b", "score": "0.38665184", "text": "func (as *nodeSet) setMaxSize(maxSize int) {\n\tif as.maxSize != maxSize {\n\t\tas.maxSize = maxSize\n\t}\n}", "title": "" }, { "docid": "e4fed19aad8b887904cca2ba77cf447e", "score": "0.3858892", "text": "func (_NodeIngress *NodeIngressTransactorSession) SetContractAddress(name [32]byte, addr common.Address) (*types.Transaction, error) {\n\treturn _NodeIngress.Contract.SetContractAddress(&_NodeIngress.TransactOpts, name, addr)\n}", "title": "" }, { "docid": "6cb9dc2d148a9d401946417566f58a11", "score": "0.38524193", "text": "func (s *Scrollbar) SetPosition(v wm.Position) { s.onSetPosition.Handle(s.w, &s.position, v) }", "title": "" }, { "docid": "89d52906e3736ee59914d9e95a0ca56c", "score": "0.3851378", "text": "func (_m *Fpdf) SetPageBox(t string, x float64, y float64, wd float64, ht float64) {\n\t_m.Called(t, x, y, wd, ht)\n}", "title": "" }, { "docid": "d74ad139efca05b820f1c333ebfc61e3", "score": "0.38478905", "text": "func (gc *GroupCreate) SetRange(i int) *GroupCreate {\n\tgc.mutation.SetRange(i)\n\treturn gc\n}", "title": "" }, { "docid": "9bf598a1458cbabb4519fb55ab63e7d2", "score": "0.3843818", "text": "func (e *Editor) SetPosition(x, y int) {\n\te.box.SetPosition(x, y)\n}", "title": "" }, { "docid": "a307af327e604cce05def80cc315ee3d", "score": "0.38429195", "text": "func (self *ParticlesArcadeEmitter) SetChildrenA(member []DisplayObject) {\n self.Object.Set(\"children\", member)\n}", "title": "" }, { "docid": "35904185051ef1bcb48861f60faff26d", "score": "0.3841317", "text": "func (this *ZxdgPositionerV6) SetAnchorRect(x int32, y int32, width int32, height int32) error {\n\tif this == nil {\n\t\treturn errors.New(\"object is nil\")\n\t}\n\tif this.c.Err != nil {\n\t\treturn errors.Wrap(this.c.Err, \"global wayland error\")\n\t}\n\tthis.c.mu.Lock()\n\tdefer this.c.mu.Unlock()\n\t_, exists := this.c.obj[this.i]\n\tif !exists {\n\t\treturn errors.New(\"object has been deleted\")\n\t}\n\tthis.c.buf.Reset()\n\tvar tmp int32\n\t_ = tmp\n\tvar oob []byte\n\tbinary.Write(this.c.buf, hostByteOrder, this.i)\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(0))\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(x))\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(y))\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(width))\n\tbinary.Write(this.c.buf, hostByteOrder, uint32(height))\n\thostByteOrder.PutUint32(this.c.buf.Bytes()[4:8], uint32(this.c.buf.Len())<<16|opCodeZxdgPositionerV6SetAnchorRect)\n\n\tfmt.Println(\"Sending ZxdgPositionerV6 -> SetAnchorRect\")\n\tfmt.Println(hex.Dump(this.c.buf.Bytes()))\n\tthis.c.c.WriteMsgUnix(this.c.buf.Bytes(), oob, nil)\n\treturn nil\n}", "title": "" }, { "docid": "6a0f82471a2715b413e114d83d241807", "score": "0.383196", "text": "func MakeSet(v interface{}) *Node {\n\tx := &Node{Val: v}\n\tx.Parent = x\n\n\treturn x\n}", "title": "" }, { "docid": "0b8c0421ae76018ac4962b8e84df8f21", "score": "0.38310307", "text": "func (ref *StructNode) SetPosition(x, y float64) {\n\tref.posX = x\n\tref.posY = y\n}", "title": "" }, { "docid": "4ba530c42a95b80e54fa80afa91b6010", "score": "0.38305902", "text": "func (f *Font) Bounds(scale fixed.Int26_6) fixed.Rectangle26_6 {\n\tb := f.bounds\n\tb.Min.X = f.scale(scale * b.Min.X)\n\tb.Min.Y = f.scale(scale * b.Min.Y)\n\tb.Max.X = f.scale(scale * b.Max.X)\n\tb.Max.Y = f.scale(scale * b.Max.Y)\n\treturn b\n}", "title": "" }, { "docid": "4b598cb2e7222666a171d53d639e76fd", "score": "0.38280636", "text": "func (seg SubSegment) Set(pos uint, colour framebuffer.Rgb) {\n\n\t// Is position out of range?\n\tif pos >= seg.len {\n\t\tlog.Panic(\"position out of range\")\n\t}\n\t// Set at position within segment\n\tseg.baseSeg.Set(seg.start+pos, colour)\n}", "title": "" }, { "docid": "628826f74e348e8c4be4bab626d32c16", "score": "0.3818955", "text": "func (pq *IndexFibonacciMinPQ) cut(i int) {\n\tx := pq.nodes[i]\n\tparent := x.parent\n\tparent.child = pq.cutNode(x, parent.child)\n\tx.parent = nil\n\tparent.order--\n\tpq.head = pq.insertNode(x, pq.head)\n\tparent.mark = !parent.mark\n\tif !parent.mark && parent.parent != nil {\n\t\tpq.cut(parent.index)\n\t}\n}", "title": "" }, { "docid": "e830da24bd8673d8f504aeebf5542b63", "score": "0.38183394", "text": "func (gdt *Rect2) SetSize(size Vector2) {\n\targ0 := gdt.getBase()\n\targ1 := size.getBase()\n\n\tC.go_godot_rect2_set_size(GDNative.api, arg0, arg1)\n}", "title": "" } ]
ee1d0a6b9604924b73bfa424f4eebec0
collect all the routes from the etcd nodes
[ { "docid": "2b015052b1eeffdccd7c1d5d55c9bf64", "score": "0.6301559", "text": "func (c *client) iterateRoutes(n *etcd.Node, data *[]string, highestIndex *uint64) {\n\tif n.ModifiedIndex > *highestIndex {\n\t\t*highestIndex = n.ModifiedIndex\n\t}\n\n\tif n.Key == c.routesRoot {\n\t\tfor _, ni := range n.Nodes {\n\t\t\tc.iterateRoutes(ni, data, highestIndex)\n\t\t}\n\t}\n\n\tif path.Dir(n.Key) != c.routesRoot {\n\t\treturn\n\t}\n\n\trid := path.Base(n.Key)\n\tr := rid + \":\" + n.Value\n\n\texisting := -1\n\tfor i, ri := range *data {\n\t\tif getRouteId(ri) == rid {\n\t\t\texisting = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif existing < 0 {\n\t\t*data = append(*data, r)\n\t} else {\n\t\t(*data)[existing] = r\n\t}\n}", "title": "" } ]
[ { "docid": "d3b888a75a1dda53700458f9d01d40a3", "score": "0.6322059", "text": "func (sc *ServiceConfig) getRoutes() []rest.Route {\n\n\tgz := gzipHandler\n\n\troutes := []rest.Route{\n\t\trest.Route{\"GET\", \"/\", gz(mainPage)},\n\n\t\t// Backups\n\t\trest.Route{\"GET\", \"/backup/check\", gz(sc.authorizedClient(RestBackupCheck))},\n\t\trest.Route{\"GET\", \"/backup/create\", gz(sc.authorizedClient(RestBackupCreate))},\n\t\trest.Route{\"GET\", \"/backup/restore\", gz(sc.authorizedClient(RestBackupRestore))},\n\t\trest.Route{\"GET\", \"/backup/list\", gz(sc.authorizedClient(RestBackupFileList))},\n\t\trest.Route{\"GET\", \"/backup/status\", gz(sc.authorizedClient(RestBackupStatus))},\n\t\trest.Route{\"GET\", \"/backup/restore/status\", gz(sc.authorizedClient(RestRestoreStatus))},\n\n\t\t// Hosts\n\t\trest.Route{\"GET\", \"/hosts\", gz(sc.checkAuth(restGetHosts))},\n\t\trest.Route{\"GET\", \"/hosts/running\", gz(sc.checkAuth(restGetActiveHostIDs))},\n\t\trest.Route{\"GET\", \"/hosts/defaultHostAlias\", gz(sc.checkAuth(restGetDefaultHostAlias))},\n\t\trest.Route{\"GET\", \"/hosts/:hostId\", gz(sc.checkAuth(restGetHost))},\n\t\trest.Route{\"POST\", \"/hosts/add\", gz(sc.checkAuth(restAddHost))},\n\t\trest.Route{\"DELETE\", \"/hosts/:hostId\", gz(sc.checkAuth(restRemoveHost))},\n\t\trest.Route{\"PUT\", \"/hosts/:hostId\", gz(sc.checkAuth(restUpdateHost))},\n\t\trest.Route{\"GET\", \"/hosts/:hostId/running\", gz(sc.authorizedClient(restGetRunningForHost))},\n\t\trest.Route{\"DELETE\", \"/hosts/:hostId/:serviceStateId\", gz(sc.authorizedClient(restKillRunning))},\n\t\trest.Route{\"POST\", \"/hosts/:hostId/key\", gz(sc.checkAuth(restResetHostKey))},\n\n\t\t// Pools\n\t\trest.Route{\"GET\", \"/pools/:poolId\", gz(sc.checkAuth(restGetPool))},\n\t\trest.Route{\"DELETE\", \"/pools/:poolId\", gz(sc.checkAuth(restRemovePool))},\n\t\trest.Route{\"PUT\", \"/pools/:poolId\", gz(sc.checkAuth(restUpdatePool))},\n\t\trest.Route{\"POST\", \"/pools/add\", gz(sc.checkAuth(restAddPool))},\n\t\trest.Route{\"GET\", \"/pools\", gz(sc.checkAuth(restGetPools))},\n\t\trest.Route{\"GET\", \"/pools/:poolId/hosts\", gz(sc.checkAuth(restGetHostsForResourcePool))},\n\n\t\t// Pools (VirtualIP)\n\t\trest.Route{\"PUT\", \"/pools/:poolId/virtualip\", gz(sc.checkAuth(restAddPoolVirtualIP))},\n\t\trest.Route{\"DELETE\", \"/pools/:poolId/virtualip/*ip\", gz(sc.checkAuth(restRemovePoolVirtualIP))},\n\n\t\t// Pools (IPs)\n\t\trest.Route{\"GET\", \"/pools/:poolId/ips\", gz(sc.checkAuth(restGetPoolIps))},\n\n\t\t// Services (Apps)\n\t\trest.Route{\"GET\", \"/services\", gz(sc.checkAuth(restGetAllServices))},\n\t\trest.Route{\"GET\", \"/servicehealth\", gz(sc.checkAuth(restGetServicesHealth))},\n\t\trest.Route{\"GET\", \"/services/:serviceId\", gz(sc.authorizedClient(restGetService))},\n\t\trest.Route{\"GET\", \"/services/:serviceId/running\", gz(sc.authorizedClient(restGetRunningForService))},\n\t\trest.Route{\"GET\", \"/services/:serviceId/:serviceStateId/logs\", gz(sc.authorizedClient(restGetServiceStateLogs))},\n\t\trest.Route{\"GET\", \"/services/:serviceId/:serviceStateId/logs/download\", gz(sc.authorizedClient(downloadServiceStateLogs))},\n\t\trest.Route{\"POST\", \"/services/add\", gz(sc.authorizedClient(restAddService))},\n\t\trest.Route{\"POST\", \"/services/deploy\", gz(sc.authorizedClient(restDeployService))},\n\t\trest.Route{\"PUT\", \"/services/restartServices\", gz(sc.checkAuth(restRestartServices))},\n\t\trest.Route{\"PUT\", \"/services/startServices\", gz(sc.checkAuth(restStartServices))},\n\t\trest.Route{\"PUT\", \"/services/stopServices\", gz(sc.checkAuth(restStopServices))},\n\t\trest.Route{\"DELETE\", \"/services/:serviceId\", gz(sc.checkAuth(restRemoveService))},\n\t\trest.Route{\"GET\", \"/services/:serviceId/logs\", gz(sc.authorizedClient(restGetServiceLogs))},\n\t\trest.Route{\"PUT\", \"/services/:serviceId\", gz(sc.authorizedClient(restUpdateService))},\n\t\trest.Route{\"GET\", \"/services/:serviceId/snapshot\", gz(sc.authorizedClient(restSnapshotService))},\n\t\trest.Route{\"PUT\", \"/services/:serviceId/restartService\", gz(sc.checkAuth(restRestartService))},\n\t\trest.Route{\"PUT\", \"/services/:serviceId/startService\", gz(sc.checkAuth(restStartService))},\n\t\trest.Route{\"PUT\", \"/services/:serviceId/stopService\", gz(sc.checkAuth(restStopService))},\n\t\trest.Route{\"POST\", \"/services/:serviceId/migrate\", sc.authorizedClient(restPostServicesForMigration)},\n\n\t\t// Services (Virtual Host)\n\t\trest.Route{\"PUT\", \"/services/:serviceId/endpoint/:application/vhosts/*name\", gz(sc.checkAuth(restAddVirtualHost))},\n\t\trest.Route{\"DELETE\", \"/services/:serviceId/endpoint/:application/vhosts/*name\", gz(sc.checkAuth(restRemoveVirtualHost))},\n\t\trest.Route{\"POST\", \"/services/:serviceId/endpoint/:application/vhosts/*name\", gz(sc.checkAuth(restVirtualHostEnable))},\n\t\t// Services (Endpoint Ports)\n\t\trest.Route{\"PUT\", \"/services/:serviceId/endpoint/:application/ports/*portname\", gz(sc.checkAuth(restAddPort))},\n\t\trest.Route{\"DELETE\", \"/services/:serviceId/endpoint/:application/ports/*portname\", gz(sc.checkAuth(restRemovePort))},\n\t\trest.Route{\"POST\", \"/services/:serviceId/endpoint/:application/ports/*portname\", gz(sc.checkAuth(restPortEnable))},\n\n\t\t// Services (IP)\n\t\trest.Route{\"PUT\", \"/services/:serviceId/ip\", gz(sc.checkAuth(restServiceAutomaticAssignIP))},\n\t\trest.Route{\"PUT\", \"/services/:serviceId/ip/*ip\", gz(sc.checkAuth(restServiceManualAssignIP))},\n\n\t\t// Service templates (App templates)\n\t\trest.Route{\"GET\", \"/templates\", gz(sc.checkAuth(restGetAppTemplates))},\n\t\trest.Route{\"POST\", \"/templates/add\", gz(sc.checkAuth(restAddAppTemplate))},\n\t\trest.Route{\"DELETE\", \"/templates/:templateId\", gz(sc.checkAuth(restRemoveAppTemplate))},\n\t\trest.Route{\"POST\", \"/templates/deploy\", gz(sc.checkAuth(restDeployAppTemplate))},\n\t\trest.Route{\"POST\", \"/templates/deploy/status\", gz(sc.checkAuth(restDeployAppTemplateStatus))},\n\t\trest.Route{\"GET\", \"/templates/deploy/active\", gz(sc.checkAuth(restDeployAppTemplateActive))},\n\n\t\t// Login\n\t\trest.Route{\"POST\", \"/login\", gz(sc.noAuth(restLogin))},\n\t\trest.Route{\"DELETE\", \"/login\", gz(restLogout)},\n\n\t\t// \"Misc\" stuff\n\t\trest.Route{\"GET\", \"/top/services\", gz(sc.checkAuth(restGetTopServices))},\n\t\trest.Route{\"GET\", \"/config\", gz(sc.authorizedClient(restGetUIConfig))},\n\t\trest.Route{\"GET\", \"/servicestatus\", gz(sc.checkAuth(restGetConciseServiceStatus))},\n\n\t\t// Generic static data\n\t\trest.Route{\"GET\", \"/favicon.ico\", gz(favIcon)},\n\t\trest.Route{\"GET\", \"/static/globals.js\", sc.noAuth(restGetAuth0Config)},\n\t\trest.Route{\"GET\", \"/static/*resource\", gz(staticData)},\n\t\trest.Route{\"GET\", \"/licenses.html\", gz(licenses)},\n\n\t\t// Info about serviced itself\n\t\trest.Route{\"GET\", \"/dockerIsLoggedIn\", gz(sc.authorizedClient(restDockerIsLoggedIn))},\n\t\trest.Route{\"GET\", \"/stats\", gz(sc.isCollectingStats())},\n\t\trest.Route{\"GET\", \"/version\", gz(restGetServicedVersion)},\n\t\trest.Route{\"GET\", \"/storage\", gz(sc.authorizedClient(restGetStorage))},\n\n\t\t// V2 API\n\t\trest.Route{\"GET\", \"/api/v2/pools\", gz(sc.checkAuth(getPools))},\n\t\trest.Route{\"GET\", \"/api/v2/pools/:poolId/hosts\", gz(sc.checkAuth(getHostsForPool))},\n\t\trest.Route{\"GET\", \"/api/v2/hosts\", gz(sc.checkAuth(getHosts))},\n\t\trest.Route{\"GET\", \"/api/v2/hosts/:hostId/instances\", gz(sc.checkAuth(restGetHostInstances))},\n\t\trest.Route{\"GET\", \"/api/v2/internalservices\", gz(sc.checkAuth(getAllInternalServices))},\n\t\trest.Route{\"GET\", \"/api/v2/internalservices/:id\", gz(sc.checkAuth(getInternalService))},\n\t\trest.Route{\"GET\", \"/api/v2/internalservices/:id/instances\", gz(sc.checkAuth(getInternalServiceInstances))},\n\t\trest.Route{\"GET\", \"/api/v2/internalservicestatuses\", gz(sc.checkAuth(getInternalServiceStatuses))},\n\t\trest.Route{\"GET\", \"/api/v2/services\", gz(sc.checkAuth(getAllServiceDetails))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId\", gz(sc.checkAuth(getServiceDetails))},\n\t\trest.Route{\"PUT\", \"/api/v2/services/:serviceId\", gz(sc.checkAuth(putServiceDetails))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/services\", gz(sc.checkAuth(getChildServiceDetails))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/instances\", gz(sc.checkAuth(restGetServiceInstances))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/monitoringprofile\", gz(sc.checkAuth(restGetServiceMonitoringProfile))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/publicendpoints\", gz(sc.checkAuth(restGetServicePublicEndpoints))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/ipassignments\", gz(sc.checkAuth(restGetServiceIPAssignments))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/exportendpoints\", gz(sc.checkAuth(restGetServiceExportedEndpoints))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/descendantstates\", gz(sc.checkAuth(restCountDescendantStates))},\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/context\", gz(sc.checkAuth(getServiceContext))},\n\t\trest.Route{\"PUT\", \"/api/v2/services/:serviceId/context\", gz(sc.checkAuth(putServiceContext))},\n\t\trest.Route{\"GET\", \"/api/v2/statuses\", gz(sc.checkAuth(restGetAggregateServices))},\n\t\trest.Route{\"GET\", \"/api/v2/hoststatuses\", gz(sc.checkAuth(getHostStatuses))},\n\n\t\trest.Route{\"GET\", \"/api/v2/services/:serviceId/serviceconfigs\", gz(sc.checkAuth(restGetServiceConfigFiles))},\n\t\trest.Route{\"POST\", \"/api/v2/services/:serviceId/serviceconfigs\", gz(sc.checkAuth(restAddServiceConfigFile))},\n\t\trest.Route{\"GET\", \"/api/v2/serviceconfigs/:fileId\", gz(sc.checkAuth(restGetServiceConfigFile))},\n\t\trest.Route{\"PUT\", \"/api/v2/serviceconfigs/:fileId\", gz(sc.checkAuth(restUpdateServiceConfigFile))},\n\t\trest.Route{\"DELETE\", \"/api/v2/serviceconfigs/:fileId\", gz(sc.checkAuth(restDeleteServiceConfigFile))},\n\t}\n\n\t// Hardcoding these target URLs for now.\n\t// TODO: When internal services are allowed to run on other hosts, look that up.\n\t// All API calls require authentication\n\troutes = routeToInternalServiceProxy(\"/api/controlplane/elastic\", \"http://127.0.0.1:9100/\", true, routes)\n\troutes = routeToInternalServiceProxy(\"/metrics/api\", \"http://127.0.0.1:8888/api\", true, routes)\n\troutes = routeToInternalServiceProxy(\"/api/controlplane/kibana\", \"http://127.0.0.1:5601\", true, routes)\n\n\t// Allow static assets for metrics data to be loaded without authentication since they are\n\t// included in index.html by default.\n\troutes = routeToInternalServiceProxy(\"/metrics/static\", \"http://127.0.0.1:8888/static\", false, routes)\n\n\treturn routes\n}", "title": "" }, { "docid": "6ae8020932c1b4cc4dabf4daf6ee0041", "score": "0.6133842", "text": "func getRoutes(prefix string, node *treePathNode) []string {\n\tvar listOfRoutes []string\n\n\t// path variable nodes are identified by the flag and returned with curly brackets to make them identifiable\n\t// the node value is added to the prefix being the full path to reach the current node, and the prefix for all\n\t// child node paths\n\tif node.pathVariable {\n\t\tprefix = prefix + \"/{\" + node.value + \"}\"\n\t} else {\n\t\tprefix = prefix + \"/\" + node.value\n\t}\n\n\t// If the current node has a handler then it matches an endpoint. We add it to the list of all sub-path endpoints\n\t// starting at the current node\n\tif node.handler != nil {\n\t\tlistOfRoutes = []string{prefix}\n\t}\n\n\t// All the children nodes of the current node will be drilled down to find their matching sub-paths\n\tfor _, child := range node.children {\n\t\tlistOfRoutes = append(listOfRoutes, getRoutes(prefix, child)...)\n\t}\n\tfor _, variable := range node.variables {\n\t\tlistOfRoutes = append(listOfRoutes, getRoutes(prefix, variable)...)\n\t}\n\tif node.wildCard != nil {\n\t\tlistOfRoutes = append(listOfRoutes, getRoutes(prefix, node.wildCard)...)\n\t}\n\tif node.doubleWildcard != nil {\n\t\tlistOfRoutes = append(listOfRoutes, getRoutes(prefix, node.doubleWildcard)...)\n\t}\n\n\t// Returns all the paths found down this node.\n\treturn listOfRoutes\n}", "title": "" }, { "docid": "edc0b4ebf0f6398dbce2caa9ca4a0881", "score": "0.59331244", "text": "func getRoutes(c *cli.Context) error {\n\tctx, cannel := context.WithTimeout(context.Background(), 30*time.Second)\n\tdefer cannel()\n\n\tserverResponse, err := client.GatewayClient.Get(ctx, ROUTE_RESOURCE_OBJECT, nil, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbody, err := ioutil.ReadAll(serverResponse.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttools.IndentFromBody(body)\n\n\treturn nil\n}", "title": "" }, { "docid": "e96b6f00faeddff59e17824ef8d27092", "score": "0.5887125", "text": "func (c *Client) LoadAll() ([]*eskip.Route, error) {\n\tif c.failNext > 0 {\n\t\tc.upsert, c.deletedIDs = nil, nil\n\t\tc.failNext--\n\t\treturn nil, errors.New(\"failed to get routes\")\n\t}\n\n\tvar routes []*eskip.Route\n\tfor _, r := range c.routes {\n\t\troutes = append(routes, r)\n\t}\n\n\treturn routes, nil\n}", "title": "" }, { "docid": "ba41641ccf45df7122d9ce470c4b7e21", "score": "0.58379537", "text": "func listRoutes(e *echo.Echo) {\n\tlog.Debug(\"%0120v\", \"\")\n\tlog.Debug(\"%-10s | %-50s | %-54s\", \"METHOD\", \"URL PATH\", \"REQ. HANDLER\")\n\tlog.Debug(\"%0120v\", \"\")\n\n\troutes := e.Routes()\n\tsort.Sort(sortByPath(routes))\n\tfor _, v := range routes {\n\t\tif v.Path[len(v.Path)-1:] != \"*\" {\n\t\t\tlog.Debug(\"%-10s | %-50s | %-54s\", v.Method, v.Path, filepath.Base(v.Name))\n\t\t}\n\t}\n\tlog.Debug(\"%0120v\", \"\")\n}", "title": "" }, { "docid": "a419c8a0f23e5e54c2a8de86c5a14934", "score": "0.58267367", "text": "func (r *Router) GetAll(name string) []*Route {\n var list []*Route\n search := func(haystack []*Route) []*Route {\n var list []*Route\n for _, route := range haystack {\n if (route.ServiceMethod == name) {\n list = append(list, route)\n }\n }\n return list\n }\n get := search(r.get)\n list = append(list, get...)\n put := search(r.put)\n list = append(list, put...)\n post := search(r.post)\n list = append(list, post...)\n del := search(r.del)\n list = append(list, del...)\n return list\n}", "title": "" }, { "docid": "78c00c4f4250a164f7ac0ea2510e7d3c", "score": "0.5819529", "text": "func (t *RestRoute) GetAll(w http.ResponseWriter, r *http.Request) {\n\tt.Log.Handle(w, r, nil, \"begin\", \"RestRoute\", \"GetAll\")\n\n\txxRouteVars := mux.Vars(r)\n\trouteValues := xxRouteVars\n\n\tt.embed.GetAll(routeValues)\n\n\tw.WriteHeader(200)\n\n\tt.Log.Handle(w, r, nil, \"end\", \"RestRoute\", \"GetAll\")\n\n}", "title": "" }, { "docid": "89cbf0f2ba513d5b1e5092bc730f45a2", "score": "0.57594806", "text": "func Routes(exec executor.Executor) (map[string]Route, map[string]Route, error) {\n\tres, err := exec.Exec(\"vtysh\", \"-c\", \"show bgp ipv4 json\")\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"Failed to query routes\")\n\t}\n\tv4Routes, err := parseRoutes(res)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"Failed to parse routes %s\", res)\n\t}\n\tres, err = exec.Exec(\"vtysh\", \"-c\", \"show bgp ipv6 json\")\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"Failed to query routes\")\n\t}\n\tv6Routes, err := parseRoutes(res)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"Failed to parse routes %s\", res)\n\t}\n\treturn v4Routes, v6Routes, nil\n}", "title": "" }, { "docid": "5c9ac9aead321a86d086ed893665ec78", "score": "0.57518345", "text": "func (app *App) assembleRouters() map[string] *denco.Router {\n var volume int = 0 // how many records?\n routers := make(map[string] *denco.Router)\n records := make(map[string] []denco.Record)\n const mloaded = \"registered %v URL patterns\"\n app.Journal.Info(\"assembling request routers\")\n app.collectRecords(records) // build records\n for method, vector := range records { // walk\n routers[method] = denco.New() // allocating\n err := routers[method].Build(vector) // build\n if sz := len(vector); sz > volume { volume = sz }\n if err != nil { // check if built was successful\n app.Journal.Fatal(\"failed to build router\")\n panic(err) // inability to build is fatal\n } // if built successfully, move to the next\n } // done with building routers per HTTP method\n app.Journal.Infof(mloaded, volume) // verbose\n return routers // routers are ready for use\n}", "title": "" }, { "docid": "1aa2137a45b9771c2b228d529cf3e610", "score": "0.57159334", "text": "func (l *kubeListener) Routes() common.Routes {\n\troutes := common.Routes{}\n\treturn routes\n}", "title": "" }, { "docid": "55bd550c334a940314d916a32641d82a", "score": "0.57096213", "text": "func (l *KubeListener) Routes() common.Routes {\n\troutes := common.Routes{}\n\treturn routes\n}", "title": "" }, { "docid": "ef9aac71d61e4d23bc8a39002bf93728", "score": "0.57032514", "text": "func (s *FrontendShard) getRouteResources() []cache.Resource {\n\t// At the moment this uses clusterheader to decide and has no\n\t// business logic. The listener should have a filter configured\n\t// to decide the correct shard and then route based on that.\n\tconfig := &api.RouteConfiguration{\n\t\tName: \"local_route\",\n\t\tVirtualHosts: []*route.VirtualHost{\n\t\t\t&route.VirtualHost{\n\t\t\t\tName: \"front\",\n\t\t\t\tDomains: []string{\"*\"},\n\t\t\t\tRoutes: []*route.Route{\n\t\t\t\t\t&route.Route{\n\t\t\t\t\t\tName: \"front\",\n\t\t\t\t\t\tMatch: &route.RouteMatch{\n\t\t\t\t\t\t\tPathSpecifier: &route.RouteMatch_Prefix{\n\t\t\t\t\t\t\t\tPrefix: \"/\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAction: &route.Route_Route{\n\t\t\t\t\t\t\tRoute: &route.RouteAction{\n\t\t\t\t\t\t\t\tClusterSpecifier: &route.RouteAction_Cluster{\n\t\t\t\t\t\t\t\t\tCluster: \"back\",\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\tresources := []cache.Resource{config}\n\treturn resources\n}", "title": "" }, { "docid": "3fac8d82e8d9e79b4bf8be07c0decc00", "score": "0.5695606", "text": "func (k *KubeInfo) GetRoutes(app string) (routes string, err error) {\n\troutesURL := \"http://localhost:15000/config_dump\"\n\tfor cluster := range k.Clusters {\n\t\tappPods := k.GetAppPods(cluster)\n\t\tif len(appPods[app]) == 0 {\n\t\t\treturn \"\", errors.Errorf(\"missing pod names for app %q\", app)\n\t\t}\n\n\t\tpod := appPods[app][0]\n\n\t\tr, e := util.PodExec(k.Namespace, pod, \"app\", fmt.Sprintf(\"client -url %s\", routesURL), true, k.Clusters[cluster])\n\t\tif e != nil {\n\t\t\treturn \"\", errors.WithMessage(err, \"failed to get routes\")\n\t\t}\n\t\troutes += fmt.Sprintf(\"Routes From %s Cluster: \\n\", cluster)\n\t\troutes += r\n\t}\n\n\treturn routes, nil\n}", "title": "" }, { "docid": "70e1d57fa602a576e84866e1f75fbb32", "score": "0.5695291", "text": "func (ing *ingress) convert(state *clusterState, df defaultFilters) ([]*eskip.Route, error) {\n\tvar ewIngInfo map[string][]string // r.Id -> {namespace, name}\n\tif ing.kubernetesEnableEastWest {\n\t\tewIngInfo = make(map[string][]string)\n\t}\n\troutes := make([]*eskip.Route, 0, len(state.ingresses))\n\thostRoutes := make(map[string][]*eskip.Route)\n\tredirect := createRedirectInfo(ing.provideHTTPSRedirect, ing.httpsRedirectCode)\n\tfor _, i := range state.ingresses {\n\t\tr, err := ing.ingressRoute(i, redirect, state, hostRoutes, df)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif r != nil {\n\t\t\troutes = append(routes, r)\n\t\t\tif ing.kubernetesEnableEastWest {\n\t\t\t\tewIngInfo[r.Id] = []string{i.Metadata.Namespace, i.Metadata.Name}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor host, rs := range hostRoutes {\n\t\tif len(rs) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tapplyEastWestRange(ing.eastWestRangeDomains, ing.eastWestRangePredicates, host, rs)\n\t\troutes = append(routes, rs...)\n\n\t\t// if routes were configured, but there is no catchall route\n\t\t// defined for the host name, create a route which returns 404\n\t\tif !hasCatchAllRoutes(rs) {\n\t\t\troutes = append(routes, ing.addCatchAllRoutes(host, rs[0], redirect)...)\n\t\t}\n\t}\n\n\tif ing.kubernetesEnableEastWest && len(routes) > 0 && len(ewIngInfo) > 0 {\n\t\tewroutes := make([]*eskip.Route, 0, len(routes))\n\t\tfor _, r := range routes {\n\t\t\tif v, ok := ewIngInfo[r.Id]; ok {\n\t\t\t\tewroutes = append(ewroutes, createEastWestRouteIng(ing.kubernetesEastWestDomain, v[0], v[1], r))\n\t\t\t}\n\t\t}\n\t\tl := len(routes)\n\t\troutes = append(routes, ewroutes...)\n\t\tlog.Infof(\"enabled east west routes: %d %d %d %d\", l, len(routes), len(ewroutes), len(hostRoutes))\n\t}\n\n\treturn routes, nil\n}", "title": "" }, { "docid": "59983044247d76d41df3b58c9f2143fc", "score": "0.56859165", "text": "func (router *Router) Route() {\n\tfor uri := range Instance.Tree {\n\t\thttp.Handle(uri, router)\n\t\tlog.Println(\"handled: \" + uri)\n\t}\n}", "title": "" }, { "docid": "0ff7324022ab2560fd9992907a255fac", "score": "0.5657181", "text": "func (src *SingleTableBirdwatcher) AllRoutes(\n\tctx context.Context,\n) (*api.RoutesResponse, error) {\n\t// First fetch all routes from the master table\n\tmainTable := src.GenericBirdwatcher.config.MainTable\n\tbirdImported, err := src.client.GetJSON(ctx, \"/routes/table/\"+mainTable)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Then fetch all filtered routes from the master table\n\tbirdFiltered, err := src.client.GetJSON(ctx, \"/routes/table/\"+mainTable+\"/filtered\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Use api status from second request\n\tapiStatus, err := parseAPIStatus(birdFiltered, src.config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse := &api.RoutesResponse{\n\t\tResponse: api.Response{\n\t\t\tMeta: apiStatus,\n\t\t},\n\t}\n\n\t// Parse the routes\n\timported := parseRoutesData(birdImported[\"routes\"].([]interface{}), src.config, false)\n\t// Sort routes for deterministic ordering\n\t// sort.Sort(imported)\n\tresponse.Imported = imported\n\n\t// Parse the routes\n\tfiltered := parseRoutesData(birdFiltered[\"routes\"].([]interface{}), src.config, false)\n\t// Sort routes for deterministic ordering\n\t// sort.Sort(filtered)\n\tresponse.Filtered = filtered\n\n\treturn response, nil\n}", "title": "" }, { "docid": "50ccda847b0a3986424563d0f3efcd8b", "score": "0.5655177", "text": "func (r *Redis) GetRoutes() ([]core.Route, error) {\n\tif database.CentralStore {\n\t\treturn database.GetRoutes()\n\t}\n\n\tconn := pool.Get()\n\tdefer conn.Close()\n\n\t// get known members(other than me) to 'poll' for routes\n\tmembers, _ := redis.Strings(conn.Do(\"SMEMBERS\", \"members\"))\n\tif len(members) == 0 {\n\t\t// should only happen on new cluster\n\t\t// assume i'm ok to be primary so don't reset imported routes\n\t\tconfig.Log.Trace(\"[cluster] - Assuming OK to be primary, using routes from my database...\")\n\t\treturn common.GetRoutes()\n\t}\n\tfor i := range members {\n\t\tif members[i] == self {\n\t\t\t// if i'm in the list of members, new requests should have failed while `waitForMembers`ing\n\t\t\tconfig.Log.Trace(\"[cluster] - Assuming I was in sync, using routes from my database...\")\n\t\t\treturn common.GetRoutes()\n\t\t}\n\t}\n\n\tc, err := redis.DialURL(config.ClusterConnection, redis.DialConnectTimeout(15*time.Second), redis.DialPassword(config.ClusterToken))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to reach redis for routes subscriber - %s\", err)\n\t}\n\tdefer c.Close()\n\n\tmessage := make(chan interface{})\n\tsubconn := redis.PubSubConn{c}\n\n\t// subscribe to channel that routes will be published on\n\tif err := subconn.Subscribe(\"routes\"); err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to reach redis for routes subscriber - %s\", err)\n\t}\n\tdefer subconn.Close()\n\n\t// listen always\n\tgo func() {\n\t\tfor {\n\t\t\tmessage <- subconn.Receive()\n\t\t}\n\t}()\n\n\t// todo: maybe use ttl?\n\t// timeout is how long to wait for the listed members to come back online\n\ttimeout := time.After(time.Duration(20) * time.Second)\n\n\t// loop attempts for timeout, allows last dead members to start back up\n\tfor {\n\t\tselect {\n\t\tcase <-timeout:\n\t\t\treturn nil, fmt.Errorf(\"Timed out waiting for routes from %s\", strings.Join(members, \", \"))\n\t\tdefault:\n\t\t\t// request routes from each member until successful\n\t\t\tfor _, member := range members {\n\t\t\t\t// memberTimeout is how long to wait for a member to respond with list of routes\n\t\t\t\tmemberTimeout := time.After(3 * time.Second)\n\n\t\t\t\t// ask a member for its routes\n\t\t\t\tconfig.Log.Trace(\"[cluster] - Attempting to request routes from %s...\", member)\n\t\t\t\t_, err := conn.Do(\"PUBLISH\", \"portal\", fmt.Sprintf(\"get-routes %s\", member))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\t// wait for member to respond\n\t\t\t\tfor {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-memberTimeout:\n\t\t\t\t\t\tconfig.Log.Debug(\"[cluster] - Timed out waiting for routes from %s\", member)\n\t\t\t\t\t\tgoto nextRouteMember\n\t\t\t\t\tcase msg := <-message:\n\t\t\t\t\t\tswitch v := msg.(type) {\n\t\t\t\t\t\tcase redis.Message:\n\t\t\t\t\t\t\tconfig.Log.Trace(\"[cluster] - Received message on 'routes' channel\")\n\t\t\t\t\t\t\tvar routes []core.Route\n\t\t\t\t\t\t\terr = parseBody(v.Data, &routes)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn nil, fmt.Errorf(\"Failed to marshal routes - %s\", err)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconfig.Log.Trace(\"[cluster] - Routes from cluster: %#v\\n\", routes)\n\t\t\t\t\t\t\treturn routes, nil\n\t\t\t\t\t\tcase error:\n\t\t\t\t\t\t\treturn nil, fmt.Errorf(\"Subscriber failed to receive routes - %s\", v.Error())\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tnextRouteMember:\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "85e2040288517ea34162227fb9484965", "score": "0.5597147", "text": "func Nodes() string { return \"/nodes\" }", "title": "" }, { "docid": "b8052ad6f565c7359e3b33a75fa9ef57", "score": "0.55505615", "text": "func (e *Endpoints) Routes() []httpserver.Endpoint {\n\treturn []httpserver.Endpoint{\n\t\t{Path: \"/healthz\", Method: http.MethodGet, Handler: e.Info},\n\n\t\t{Path: \"/api/runner/tasks\", Method: http.MethodPost, Handler: e.CreateRunnerTask},\n\t\t{Path: \"/api/runner/tasks/{id}\", Method: http.MethodPut, Handler: e.UpdateRunnerTask},\n\t\t{Path: \"/api/runner/tasks/{id}\", Method: http.MethodGet, Handler: e.GetRunnerTask},\n\t\t{Path: \"/api/runner/fetch-task\", Method: http.MethodGet, Handler: e.FetchRunnerTask},\n\t\t{Path: \"/api/runner/collect/logs/{source}\", Method: http.MethodPost, Handler: e.CollectLogs},\n\t}\n}", "title": "" }, { "docid": "97207ced2cb8bcfddcf9f82f615883c4", "score": "0.55436957", "text": "func ListRoutesRoot(routes map[string][]string) http.Handler {\n return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n asJSONResponse(w, routes, http.StatusOK)\n })\n}", "title": "" }, { "docid": "48e677d0f2a4b4c836e36642a33b2c45", "score": "0.5532653", "text": "func (self WebService) Routes() []Route {\n\treturn self.routes\n}", "title": "" }, { "docid": "1658a69bd39bdc88fcbe471a7a54af1d", "score": "0.55141824", "text": "func (p *server_pool) connect_all(directory string) {\n\tkAPI := etcdclient.NewKeysAPI(p.client)\n\t//get the keys under directory\n\tlog.Println(\"connecting servers under:\", directory)\n\tresp, err := kAPI.Get(context.Background(), directory, nil)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\t//validation check\n\tif !resp.Node.Dir {\n\t\tlog.Println(\"no a directory\")\n\t\treturn\n\t}\n\n\tfor _, node := range resp.Node.Nodes {\n\t\tif node.Dir {\n\t\t\tfor _, server := range node.Nodes {\n\t\t\t\tp.add_server(server.Key, server.Value)\n\t\t\t}\n\t\t}\n\n\t}\n\tlog.Println(\"servers add complete\")\n\tgo p.watcher()\n\n}", "title": "" }, { "docid": "faa214025ea02933d50b7b4942f66152", "score": "0.55064267", "text": "func initRoutes(logFilePath string, tr chat.Tracker) []route {\n\treturn []route{\n\t\t{\n\t\t\tpath: \"/user/{userName}/message/\",\n\t\t\thandler: transport.GetMessagesOfUser(log.FetchMessagesOfSender(logFilePath)),\n\t\t\tmethod: http.MethodGet,\n\t\t},\n\t\t{\n\t\t\tpath: \"/user/{userName}\",\n\t\t\thandler: transport.GetUser(log.FetchUser(logFilePath, tracker.IsUserOnline(tr))),\n\t\t\tmethod: http.MethodGet,\n\t\t},\n\t\t{\n\t\t\tpath: \"/user/{userName}\",\n\t\t\thandler: transport.DeleteUser(tracker.KickUser(tr)),\n\t\t\tmethod: http.MethodDelete,\n\t\t},\n\t\t{\n\t\t\tpath: \"/user/\",\n\t\t\thandler: transport.GetAllUsers(log.FetchAllUsers(logFilePath)),\n\t\t\tmethod: http.MethodGet,\n\t\t},\n\t\t{\n\t\t\tpath: \"/message/{messageID}\",\n\t\t\thandler: transport.GetMessage(log.FetchMessage(logFilePath)),\n\t\t\tmethod: http.MethodGet,\n\t\t},\n\t\t{\n\t\t\tpath: \"/message/\",\n\t\t\thandler: transport.GetNMessages(log.FetchNMessages(logFilePath)),\n\t\t\tmethod: http.MethodGet,\n\t\t},\n\t\t{\n\t\t\tpath: \"/message/\",\n\t\t\thandler: transport.PostMessage(tracker.PostMessage(tr)),\n\t\t\tmethod: http.MethodPost,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "6176db5ac4097f95bc11368c7f0d7b71", "score": "0.54010916", "text": "func (r *TravelsRoute) getRoutes() RouteStructs {\n\treturn RouteStructs{\n\t\tRouteStruct{\n\t\t\t\"travelsIndex\",\n\t\t\t\"GET\",\n\t\t\t\"/travels\",\n\t\t\tr.index,\n\t\t},\n\t\tRouteStruct{\n\t\t\t\"travelsByKey\",\n\t\t\t\"GET\",\n\t\t\t\"/travels/{key}\",\n\t\t\tr.byKey,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "5d7c44660416215ac3fdc6f8b55138d2", "score": "0.5395661", "text": "func (registry *Etcd) ListRoutes(selector labels.Selector) (*api.RouteList, error) {\n\tallRoutes := api.RouteList{}\n\terr := registry.ExtractList(\"/routes\", &allRoutes.Items, &allRoutes.ResourceVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfiltered := []api.Route{}\n\tfor _, route := range allRoutes.Items {\n\t\tif selector.Matches(labels.Set(route.Labels)) {\n\t\t\tfiltered = append(filtered, route)\n\t\t}\n\t}\n\tallRoutes.Items = filtered\n\treturn &allRoutes, nil\n\n}", "title": "" }, { "docid": "f85776f0647727c655603d2aa0cf0c3a", "score": "0.5393218", "text": "func initializeRoutes(graph *GraphManager, office *Office) error {\n\tfor _, r := range office.Routes {\n\t\tfmt.Println(\"init route\", r.RouteNbr)\n\t\troute, err := createRoute(graph, r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// create departs for today\n\t\tfrom := officeNodes[office.Carrier+\":\"+r.From.Iata]\n\t\tif _, err := createEdgeDeparts(graph, route, from, time.Time{}); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// create arrival for today\n\t\tto := officeNodes[office.Carrier+\":\"+r.To.Iata]\n\t\tif _, err := createEdgeArrives(graph, route, to, time.Time{}); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// create shedules rel from carrier to route\n\t\tcarrier := carrierNodes[office.Carrier]\n\t\tif err := createEdgeSchedules(graph, carrier, route); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// cache route node for further processing\n\t\trouteNodes[office.Carrier+\":\"+r.From.Iata+\":\"+r.To.Iata] = route\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7bb4509a2078db7ca99ce363efe264a6", "score": "0.53903306", "text": "func (s *Server) routes() {\n\ts.Get(\"/health\", app.HealthCheck())\n}", "title": "" }, { "docid": "29a733fa2ac786359674a0ad6b6bd6a5", "score": "0.5377206", "text": "func getRouters(instances []*IndexInst) (map[uint64]c.Router, error) {\n\tentities := make(map[uint64]c.Router, 0)\n\tfor _, instance := range instances {\n\t\tdefn := instance.GetDefinition()\n\t\tentities[defn.GetDefnID()] = instance\n\t}\n\treturn entities, nil\n}", "title": "" }, { "docid": "ffe2a4eff2bd591c3afb830745d7d8c0", "score": "0.5358121", "text": "func (app *App) collectRecords(records map[string] []denco.Record) {\n for _, srv := range app.Services {\n for _, ep := range srv.Endpoints {\n epp := strings.TrimPrefix(ep.Pattern, \"/\")\n mask := fmt.Sprintf(\"%v/%v\", srv.Prefix, epp)\n pipe := &Pipeline {Operation: ep, Service: srv}\n pipe.Compile(app) // seal up pipeline instance\n log := app.Journal.WithField(\"url\", mask)\n log = log.WithField(\"service\", srv)\n log.Debug(\"mounting endpoint into router\")\n record := denco.NewRecord(mask, pipe)\n for m, _ := range ep.Methods { // HTTP verbs\n records[m] = append(records[m], record)\n } // vector of records per each method\n } // inner loop actually builds records\n } // finish up with collecting the records\n}", "title": "" }, { "docid": "d8d617813b50154bd28afa2985c9fa36", "score": "0.535151", "text": "func RoutesFromHost(host string) (map[string]Route, error) {\n\tdocker, err := newDockerClient(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontainers, err := docker.ListContainers(false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\troutes := make(map[string]Route)\n\tfor _, c := range containers {\n\t\tci, err := docker.InspectContainer(c.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tpath, pathOk := envVariable(\"ENDPOINT\", ci.Config.Env)\n\t\thost, hostOk := envVariable(\"HOST\", ci.Config.Env)\n\t\tif pathOk == hostOk { // Hackety XOR.\n\t\t\tcontinue\n\t\t}\n\n\t\tp, ok := envVariable(\"TCP_PORT\", ci.Config.Env)\n\t\tif !ok {\n\t\t\tp = \"8080\"\n\t\t}\n\t\tport, err := strconv.Atoi(p)\n\t\tif err != nil {\n\t\t\tport = 8080\n\t\t}\n\n\t\tn := ci.NetworkSettings\n\t\tkey := fmt.Sprintf(\"%s:%s\", host, path)\n\t\tif r, ok := routes[key]; ok {\n\t\t\tif r.created > c.Created {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\troutes[key] = Route{host, path, n.IpAddress, port, c.Created}\n\t}\n\treturn routes, err\n}", "title": "" }, { "docid": "bd15505d4003335f485cf24cb9d58764", "score": "0.53477234", "text": "func (c *Conn) RouteGetAll(dst net.IP) (ret []*Route, err error) {\n\taf, err := addrFamily(dst)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tattr := rtnetlink.RouteAttributes{\n\t\tDst: dst,\n\t}\n\n\ttx := &rtnetlink.RouteMessage{\n\t\tFamily: uint8(af),\n\t\tTable: unix.RT_TABLE_MAIN,\n\t\tAttributes: attr,\n\t}\n\n\trx, err := c.Conn.Route.Get(tx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, rt := range rx {\n\t\tifindex := int(rt.Attributes.OutIface)\n\n\t\tiface, err := c.LinkByIndex(ifindex)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get link by interface index: %w\", err)\n\t\t}\n\n\t\t_, dstNet, err := net.ParseCIDR(fmt.Sprintf(\"%s/%d\", rt.Attributes.Dst.String(), rt.DstLength))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to construct CIDR from route destination address and length: %w\", err)\n\t\t}\n\n\t\tret = append(ret, &Route{\n\t\t\tDestination: dstNet,\n\t\t\tGateway: rt.Attributes.Gateway,\n\t\t\tInterface: iface,\n\t\t\tMetric: rt.Attributes.Priority,\n\t\t})\n\t}\n\n\treturn ret, nil\n}", "title": "" }, { "docid": "efeb7932cebba63f80058b2357679eb7", "score": "0.5346608", "text": "func (h handler) routes(router *http.ServeMux) error {\n\tallmark, err := h.allMark()\n\tif err != nil {\n\t\treturn err\n\t}\n\trouter.Handle(\"/wh/mutating/allmark\", allmark)\n\n\tingressVal, err := h.ingressValidation()\n\tif err != nil {\n\t\treturn err\n\t}\n\trouter.Handle(\"/wh/validating/ingress\", ingressVal)\n\n\tsafeServiceMonitor, err := h.safeServiceMonitor()\n\tif err != nil {\n\t\treturn err\n\t}\n\trouter.Handle(\"/wh/mutating/safeservicemonitor\", safeServiceMonitor)\n\n\treturn nil\n}", "title": "" }, { "docid": "ddce175c2317f94337e0a31593f0b805", "score": "0.53320116", "text": "func getHandler(w http.ResponseWriter, r *http.Request, endpoint string) {\n\n\tvar allrespData []Kv\n\n\tfor _, ip := range hash2ip {\n\t\tjsonData := []byte(\"\") //empty json\n\t\tresp_content := sendRequest(ip, jsonData, \"GET\", endpoint)\n\n\t\tif server_data_cnt[ip] == 0 { //dont't fetch from empty node, it will return empty\n\t\t\tcontinue\n\t\t}\n\t\tvar resp_data KvArray\n\t\terr := json.Unmarshal([]byte(resp_content), &resp_data)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tallrespData = append(allrespData, resp_data.KvPair...)\n\t}\n\tfmt.Fprint(w, string(tojson(allrespData)))\n}", "title": "" }, { "docid": "7640cd4474a8a649dcb68a8a1a49591a", "score": "0.5330193", "text": "func routeScrapeData(resp http.ResponseWriter, req *http.Request) {\n\tparams := mux.Vars(req)\n\tnamespace := params[\"ns\"]\n\n\tctx := context.Background()\n\n\tpods, err := clientset.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tservices, err := clientset.CoreV1().Services(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tendpoints, err := clientset.CoreV1().Endpoints(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tpvs, err := clientset.CoreV1().PersistentVolumes().List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tpvcs, err := clientset.CoreV1().PersistentVolumeClaims(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tconfigmaps, err := clientset.CoreV1().ConfigMaps(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tsecrets, err := clientset.CoreV1().Secrets(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tdeployments, err := clientset.AppsV1().Deployments(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tdaemonsets, err := clientset.AppsV1().DaemonSets(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\treplicasets, err := clientset.AppsV1().ReplicaSets(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tstatefulsets, err := clientset.AppsV1().StatefulSets(namespace).List(ctx, metav1.ListOptions{})\n\t//t := statefulsets.Items\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tingresses, err := clientset.NetworkingV1().Ingresses(namespace).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.Println(\"### Kubernetes API error\", err.Error())\n\t\thttp.Error(resp, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Remove and hide Helm v3 release secrets, we're never going to show them\n\tsecrets.Items = filterSecrets(secrets.Items, func(v apiv1.Secret) bool {\n\t\treturn !strings.HasPrefix(v.ObjectMeta.Name, \"sh.helm.release\")\n\t})\n\n\t// Obfuscate & remove secret values\n\tfor _, secret := range secrets.Items {\n\t\t// Inside 'last-applied-configuration'\n\t\tif secret.ObjectMeta.Annotations[\"kubectl.kubernetes.io/last-applied-configuration\"] != \"\" {\n\t\t\tsecret.ObjectMeta.Annotations[\"kubectl.kubernetes.io/last-applied-configuration\"] = \"__VALUE REDACTED__\"\n\t\t}\n\n\t\t// And the data values of course\n\t\tfor key := range secret.Data {\n\t\t\tsecret.Data[key] = []byte(\"__VALUE REDACTED__\")\n\t\t}\n\t}\n\n\t// Dump of results\n\tscrapeResult := scrapeData{\n\t\tPods: pods.Items,\n\t\tServices: services.Items,\n\t\tEndpoints: endpoints.Items,\n\t\tPersistentVolumes: pvs.Items,\n\t\tPersistentVolumeClaims: pvcs.Items,\n\t\tDeployments: deployments.Items,\n\t\tDaemonSets: daemonsets.Items,\n\t\tReplicaSets: replicasets.Items,\n\t\tStatefulSets: statefulsets.Items,\n\t\tIngresses: ingresses.Items,\n\t\tConfigMaps: configmaps.Items,\n\t\tSecrets: secrets.Items,\n\t}\n\n\tscrapeResultJSON, _ := json.Marshal(scrapeResult)\n\tresp.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\tresp.Header().Add(\"Content-Type\", \"application/json\")\n\t_, err = resp.Write([]byte(scrapeResultJSON))\n\tif err != nil {\n\t\tlog.Println(\"Unable to write\")\n\t}\n}", "title": "" }, { "docid": "85b167e2ba404a2af13b7b98f112b86b", "score": "0.53285724", "text": "func (r *EducationsRoute) getRoutes() RouteStructs {\n\treturn RouteStructs{\n\t\tRouteStruct{\n\t\t\t\"educationsIndex\",\n\t\t\t\"GET\",\n\t\t\t\"/educations\",\n\t\t\tr.index,\n\t\t},\n\t\tRouteStruct{\n\t\t\t\"educationsByKey\",\n\t\t\t\"GET\",\n\t\t\t\"/educations/{key}\",\n\t\t\tr.byKey,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "542feef023873a01d89d820ec2192b80", "score": "0.53247374", "text": "func (c *Client) LoadAll() (err error) {\n\tvar resp *etcd.Response\n\n\tif resp, err = c.c.Get(c.rootNode(), true, true); err != nil {\n\t\treturn\n\t}\n\n\terr = c.parseNodes(resp.Node.Nodes)\n\n\treturn\n}", "title": "" }, { "docid": "e4e573ef33fd8ffc9598855f77336c47", "score": "0.5315347", "text": "func GetRoutes() (routes Routes) {\n\troutes = Routes{\n\t\t// vSummary UI routes\n\t\tRoute{\n\t\t\t\"UiIndex\",\n\t\t\t\"GET\",\n\t\t\t\"/\",\n\t\t\thandlerUiIndex,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiVirtualmachines\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/virtualmachines\",\n\t\t\thandlerUiVirtualmachines,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiESXi\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/esxi\",\n\t\t\thandlerUiEsxi,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiPortgroups\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/portgroups\",\n\t\t\thandlerUiPortgroup,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiDatastores\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/datastores\",\n\t\t\thandlerUiDatastore,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiVNics\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/vnics\",\n\t\t\thandlerUiVNic,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiVDisks\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/vdisks\",\n\t\t\thandlerUiVDisk,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiClusters\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/clusters\",\n\t\t\thandlerUiCluster,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiVCenters\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/vcenters\",\n\t\t\thandlerUiVCenters,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiPoller\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/pollers\",\n\t\t\thandlerUiPoller,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiFormAddPoller\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/form/poller\",\n\t\t\thandlerUiFormPoller,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiFormEditPoller\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/form/editpoller/{id}\",\n\t\t\thandlerUiFormEditPoller,\n\t\t},\n\t\tRoute{\n\t\t\t\"UiFormRemovePoller\",\n\t\t\t\"GET\",\n\t\t\t\"/ui/form/removepoller/{id}\",\n\t\t\thandlerUiFormRemovePoller,\n\t\t},\n\n\t\t// Datatables API routes\n\t\tRoute{\n\t\t\t\"DtVirtualMachines\",\n\t\t\t\"POST\",\n\t\t\t\"/api/dt/virtualmachines\",\n\t\t\thandlerDtVirtualMachine,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtESXi\",\n\t\t\t\"POST\",\n\t\t\t\"/api/dt/esxi\",\n\t\t\thandlerDtEsxi,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtPortgroups\",\n\t\t\t\"POST\",\n\t\t\t\"/api/dt/portgroups\",\n\t\t\thandlerDtPortgroup,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtDatastores\",\n\t\t\t\"POST\",\n\t\t\t\"/api/dt/datastores\",\n\t\t\thandlerDtDatastore,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtVNics\",\n\t\t\t\"POST\",\n\t\t\t\"/api/dt/vnics\",\n\t\t\thandlerDtVNic,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtVDisks\",\n\t\t\t\"POST\",\n\t\t\t\"/api/dt/vdisks\",\n\t\t\thandlerDtVDisk,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtClusters\",\n\t\t\t\"POST\",\n\t\t\tclusterView.AjaxEndpoint,\n\t\t\thandlerDtCluster,\n\t\t},\n\t\tRoute{\n\t\t\t\"DtVCenters\",\n\t\t\t\"POST\",\n\t\t\tvcenterView.AjaxEndpoint,\n\t\t\thandlerDtVCenter,\n\t\t},\n\t}\n\n\tif !viper.GetBool(\"demo_enabled\") {\n\t\t// vSummary API endpoints\n\t\troutes = append(routes, Routes{\n\t\t\tRoute{\n\t\t\t\t\"VirtualMachine\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointVirtualMachine,\n\t\t\t\thandlerVirtualmachine,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Datacenter\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointDatacenter,\n\t\t\t\thandlerDatacenter,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Cluster\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointCluster,\n\t\t\t\thandlerCluster,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Esxi\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointESXi,\n\t\t\t\thandlerEsxi,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"ResourcePool\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointResourcepool,\n\t\t\t\thandlerResourcepool,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Datastore\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointDatastore,\n\t\t\t\thandlerDatastore,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"VDisks\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointVDisk,\n\t\t\t\thandlerVDisks,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"VNics\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointVNIC,\n\t\t\t\thandlerVNics,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Portgroups\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointPortGroup,\n\t\t\t\thandlerPortgroups,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Folders\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointFolder,\n\t\t\t\thandlerFolders,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"VSwitch\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointVSwitch,\n\t\t\t\thandlerVswitch,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"vCenter\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointVCenter,\n\t\t\t\thandlerVcenter,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"Poller\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointPoller,\n\t\t\t\thandlerPoller,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"DeletePoller\",\n\t\t\t\t\"DELETE\",\n\t\t\t\tcommon.EndpointPoller + \"/{id}\",\n\t\t\t\thandlerDeletePoller,\n\t\t\t},\n\t\t\tRoute{\n\t\t\t\t\"PollNow\",\n\t\t\t\t\"POST\",\n\t\t\t\tcommon.EndpointPoller + \"/{id}/pollnow\",\n\t\t\t\thandlerPollNow,\n\t\t\t},\n\t\t}...)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "99b369e03810c294751b41c4b514da42", "score": "0.5305447", "text": "func (e *Echo) Routes() []Route {\n\treturn e.router.routes\n}", "title": "" }, { "docid": "cd013be3b8f1951ea0040a9e96536e48", "score": "0.5295288", "text": "func (e *Echo) Routes() []*Route {\n\treturn e.router.routes\n}", "title": "" }, { "docid": "69d8b0ecdbf2e227328e836470f32632", "score": "0.5281503", "text": "func (api *API) loadRoutes() {\n\tcrawlersRouter := crawlers.New()\n\tapi.Mount(\"/crawlers\", crawlersRouter)\n\n\tjobsRouter := jobs.New()\n\tapi.Mount(\"/jobs\", jobsRouter)\n\n\tprojectsRouter := projects.New()\n\tapi.Mount(\"/projects\", projectsRouter)\n\n\tusersRouter := users.New()\n\tapi.Mount(\"/users\", usersRouter)\n\n\tworkersRouter := workers.New()\n\tapi.Mount(\"/workers\", workersRouter)\n\n\tdsRouter := datastore.New()\n\tapi.Mount(\"/datastore\", dsRouter)\n\n\tapi.Get(\"/ping\", api.ping)\n}", "title": "" }, { "docid": "8df5b2f1c166a65cb748152ad6e00bef", "score": "0.5271807", "text": "func Routes() *web.Route {\n\tr := web.NewRoute()\n\tr.Use(context.PrivateContexter())\n\tr.Use(CheckInternalToken)\n\t// Log the real ip address of the request from SSH is really helpful for diagnosing sometimes.\n\t// Since internal API will be sent only from Gitea sub commands and it's under control (checked by InternalToken), we can trust the headers.\n\tr.Use(chi_middleware.RealIP)\n\n\tr.Post(\"/ssh/authorized_keys\", AuthorizedPublicKeyByContent)\n\tr.Post(\"/ssh/{id}/update/{repoid}\", UpdatePublicKeyInRepo)\n\tr.Post(\"/ssh/log\", bind(private.SSHLogOption{}), SSHLog)\n\tr.Post(\"/hook/pre-receive/{owner}/{repo}\", RepoAssignment, bind(private.HookOptions{}), HookPreReceive)\n\tr.Post(\"/hook/post-receive/{owner}/{repo}\", context.OverrideContext, bind(private.HookOptions{}), HookPostReceive)\n\tr.Post(\"/hook/proc-receive/{owner}/{repo}\", context.OverrideContext, RepoAssignment, bind(private.HookOptions{}), HookProcReceive)\n\tr.Post(\"/hook/set-default-branch/{owner}/{repo}/{branch}\", RepoAssignment, SetDefaultBranch)\n\tr.Get(\"/serv/none/{keyid}\", ServNoCommand)\n\tr.Get(\"/serv/command/{keyid}/{owner}/{repo}\", ServCommand)\n\tr.Post(\"/manager/shutdown\", Shutdown)\n\tr.Post(\"/manager/restart\", Restart)\n\tr.Post(\"/manager/reload-templates\", ReloadTemplates)\n\tr.Post(\"/manager/flush-queues\", bind(private.FlushOptions{}), FlushQueues)\n\tr.Post(\"/manager/pause-logging\", PauseLogging)\n\tr.Post(\"/manager/resume-logging\", ResumeLogging)\n\tr.Post(\"/manager/release-and-reopen-logging\", ReleaseReopenLogging)\n\tr.Post(\"/manager/set-log-sql\", SetLogSQL)\n\tr.Post(\"/manager/add-logger\", bind(private.LoggerOptions{}), AddLogger)\n\tr.Post(\"/manager/remove-logger/{logger}/{writer}\", RemoveLogger)\n\tr.Get(\"/manager/processes\", Processes)\n\tr.Post(\"/mail/send\", SendEmail)\n\tr.Post(\"/restore_repo\", RestoreRepo)\n\tr.Post(\"/actions/generate_actions_runner_token\", GenerateActionsRunnerToken)\n\n\treturn r\n}", "title": "" }, { "docid": "dbaf5558ba5e66be1cdb3598d22ca44b", "score": "0.52708286", "text": "func LoadRoutes() {\n InitRouter()\n AddRoutes()\n for _, route := range routes {\n fmt.Printf(\"route_name: %s --> route_pattern: %s\\n\", route.Name, route.Path)\n Router.HandleFunc(route.Path, route.Handler).Methods(route.Methods)\n }\n}", "title": "" }, { "docid": "ba2472de44e1ec841cd169dd1eb8e7af", "score": "0.5268655", "text": "func (s *lxcfsRouter) Routes() []router.Route {\r\n\treturn s.routes\r\n}", "title": "" }, { "docid": "e0d2478beb8a84cd5be52f65ba4bf078", "score": "0.5267242", "text": "func routes() *pat.Router {\n\tlumber.Debug(\"Registering routes...\\n\")\n\n\t// create new router\n\trouter := pat.New()\n\n\t// define ping\n\trouter.Get(\"/ping\", func(rw http.ResponseWriter, req *http.Request) {\n\t\trw.Write([]byte(\"pong\\n\"))\n\t})\n\n\t// blobs\n\trouter.Add(\"HEAD\", \"/blobs/{blob}\", handleRequest(getHead))\n\trouter.Get(\"/blobs/{blob}\", handleRequest(get))\n\trouter.Post(\"/blobs/{blob}\", handleRequest(create))\n\trouter.Put(\"/blobs/{blob}\", handleRequest(update))\n\trouter.Delete(\"/blobs/{blob}\", handleRequest(delete))\n\trouter.Add(\"HEAD\", \"/blobs\", handleRequest(list))\n\trouter.Get(\"/blobs\", handleRequest(list))\n\n\t//\n\treturn router\n}", "title": "" }, { "docid": "dd09e0a85c8d85957df76d2cee80bcec", "score": "0.5264398", "text": "func computeRoute(ispn *ispnv1.Infinispan) *routev1.Route {\n\troute := &routev1.Route{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: \"v1\",\n\t\t\tKind: \"Route\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: ispn.GetServiceExternalName(),\n\t\t\tNamespace: ispn.Namespace,\n\t\t\tLabels: ExternalServiceLabels(ispn.Name),\n\t\t},\n\t\tSpec: routev1.RouteSpec{\n\t\t\tHost: ispn.Spec.Expose.Host,\n\t\t\tTo: routev1.RouteTargetReference{\n\t\t\t\tKind: \"Service\",\n\t\t\t\tName: ispn.Name},\n\t\t},\n\t}\n\tif ispn.GetEncryptionSecretName() != \"\" && !ispn.IsEncryptionDisabled() {\n\t\troute.Spec.TLS = &routev1.TLSConfig{Termination: routev1.TLSTerminationPassthrough}\n\t}\n\treturn route\n}", "title": "" }, { "docid": "a0d07b1c9276843c5a9d2a9b583ed473", "score": "0.5253768", "text": "func (r *raftRouter) initRoutes() {\n\tr.routes = []router.Route{\n\t\trouter.NewPostRoute(\"/cluster/join\", r.joinHandler),\n\t\trouter.NewGetRoute(\"/cluster/status\", r.statusHandler),\n\t}\n}", "title": "" }, { "docid": "a855ed7ee799e87af4560590ee2caf6a", "score": "0.52351713", "text": "func prepareRoutes(\n\ttoRules []ToRouteRule,\n\tserviceName string,\n\tprotocol core_mesh.Protocol,\n) []Route {\n\tvar rules []api.Rule\n\n\tfor _, toRule := range toRules {\n\t\tif toRule.Subset.IsSubset(core_rules.MeshService(serviceName)) {\n\t\t\trules = toRule.Rules\n\t\t}\n\t}\n\n\tif len(rules) == 0 {\n\t\tswitch protocol {\n\t\tcase core_mesh.ProtocolHTTP, core_mesh.ProtocolHTTP2, core_mesh.ProtocolGRPC:\n\t\tdefault:\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tcatchAllPathMatch := api.PathMatch{Value: \"/\", Type: api.PathPrefix}\n\tcatchAllMatch := []api.Match{{Path: pointer.To(catchAllPathMatch)}}\n\n\tnoCatchAll := slices.IndexFunc(rules, func(rule api.Rule) bool {\n\t\treturn reflect.DeepEqual(rule.Matches, catchAllMatch)\n\t}) == -1\n\n\tif noCatchAll {\n\t\trules = append(rules, api.Rule{\n\t\t\tMatches: catchAllMatch,\n\t\t})\n\t}\n\n\tvar routes []Route\n\tfor _, rule := range rules {\n\t\tvar matches []api.Match\n\n\t\tfor _, match := range rule.Matches {\n\t\t\tif match.Path == nil {\n\t\t\t\t// According to Envoy docs, match must have precisely one of\n\t\t\t\t// prefix, path, safe_regex, connect_matcher,\n\t\t\t\t// path_separated_prefix, path_match_policy set, so when policy\n\t\t\t\t// doesn't specify explicit type of matching, we are assuming\n\t\t\t\t// \"catch all\" path (any path starting with \"/\").\n\t\t\t\tmatch.Path = pointer.To(catchAllPathMatch)\n\t\t\t}\n\n\t\t\tmatches = append(matches, match)\n\t\t}\n\n\t\troute := Route{\n\t\t\tMatches: matches,\n\t\t}\n\n\t\tif rule.Default.BackendRefs != nil {\n\t\t\troute.BackendRefs = *rule.Default.BackendRefs\n\t\t} else {\n\t\t\troute.BackendRefs = []common_api.BackendRef{{\n\t\t\t\tTargetRef: common_api.TargetRef{\n\t\t\t\t\tKind: common_api.MeshService,\n\t\t\t\t\tName: serviceName,\n\t\t\t\t},\n\t\t\t\tWeight: pointer.To(uint(100)),\n\t\t\t}}\n\t\t}\n\t\tif rule.Default.Filters != nil {\n\t\t\troute.Filters = *rule.Default.Filters\n\t\t}\n\t\troutes = append(routes, route)\n\t}\n\n\treturn routes\n}", "title": "" }, { "docid": "0bfb81a609cbedeeb35c7e9b3cc8eb65", "score": "0.5217845", "text": "func printAvailableRoutes(router *mux.Router, logger log.Logger, msg string) http.Handler {\n\tfn := func(w http.ResponseWriter, req *http.Request) {\n\t\tvar routes []string\n\t\terr := router.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {\n\t\t\tpath, err := route.GetPathTemplate()\n\t\t\tif err != nil {\n\t\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\t\tlogger.Log(\"msg\", \"walkFunc failed\", err, err.Error())\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\troutes = append(routes, path)\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\t\tlogger.Log(\"msg\", \"walkFunc failed\", err, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tfmt.Fprintln(w, msg)\n\t\tfmt.Fprintln(w, \"Available routes:\")\n\t\tfor _, path := range routes {\n\t\t\tfmt.Fprintln(w, path)\n\t\t}\n\t}\n\n\treturn http.HandlerFunc(fn)\n}", "title": "" }, { "docid": "aa0cd733f586ef2bcfaccfabe19b91e5", "score": "0.5214386", "text": "func registerRoutes(rs *server.RestServer) {\n\tregisterSwaggerUI(rs)\n\trpc.RegisterRoutes(rs.CliCtx, rs.Mux)\n\ttx.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)\n\tauth.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, at.StoreKey)\n\tbank.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)\n\tdist.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, distcmd.StoreKey)\n\tstaking.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)\n\tslashing.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc, rs.KeyBase)\n\tgov.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)\n\tmintrest.RegisterRoutes(rs.CliCtx, rs.Mux, rs.Cdc)\n}", "title": "" }, { "docid": "366eae969b849d65c7d1f3c7e17d5d2b", "score": "0.52122283", "text": "func (tree *pathTree) ListRoutes() []string {\n\t// let's build the list of registered endpoints from the root\n\treturn getRoutes(\"\", tree.root)\n}", "title": "" }, { "docid": "9432a175877f09c90a8cb0ca33b2fa88", "score": "0.5204054", "text": "func RegisterAllRoutes(router *mux.Router) {\n\tlivroRouter := router.PathPrefix(path).Subrouter()\n\troutes(livroRouter)\n}", "title": "" }, { "docid": "bfaf759dc4ee31e0eef8320ca69f39f7", "score": "0.51985204", "text": "func parseRoutes(root string) []Route {\n\tvar routes []Route\n\n\tfilepath.Walk(root, func(p string, i os.FileInfo, err error) error {\n\t\tif err == nil && !i.IsDir() {\n\t\t\t// get file extension and check whether\n\t\t\t// route file is supported\n\t\t\tlog.Println(\"found:\", filepath.Base(p))\n\t\t\treader := GetReader(strings.TrimLeft(filepath.Ext(p), \".\"))\n\t\t\tif reader != nil {\n\t\t\t\troute, err := parseRouteFile(p, reader)\n\t\t\t\tif err == nil {\n\t\t\t\t\troutes = append(routes, route)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\n\treturn routes\n}", "title": "" }, { "docid": "18bfe1772acc704e3fa59bfbfff03ae0", "score": "0.5197624", "text": "func (c *Cloud) Routes() (cloudprovider.Routes, bool) { return nil, false }", "title": "" }, { "docid": "abf55e9873227f6e0d6a1e7bcfb615d6", "score": "0.51599395", "text": "func (g *Backend) loopNodes(ns []*etcd.Node, nameParts []string, star bool, bx map[bareService]bool) (sx []msg.Service, err error) {\n\tif bx == nil {\n\t\tbx = make(map[bareService]bool)\n\t}\nNodes:\n\tfor _, n := range ns {\n\t\tif n.Dir {\n\t\t\tnodes, err := g.loopNodes(n.Nodes, nameParts, star, bx)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tsx = append(sx, nodes...)\n\t\t\tcontinue\n\t\t}\n\t\tif star {\n\t\t\tkeyParts := strings.Split(n.Key, \"/\")\n\t\t\tfor i, n := range nameParts {\n\t\t\t\tif i > len(keyParts)-1 {\n\t\t\t\t\t// name is longer than key\n\t\t\t\t\tcontinue Nodes\n\t\t\t\t}\n\t\t\t\tif n == \"*\" || n == \"any\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif keyParts[i] != n {\n\t\t\t\t\tcontinue Nodes\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tserv := new(msg.Service)\n\t\tif err := json.Unmarshal([]byte(n.Value), serv); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tb := bareService{serv.Host, serv.Port, serv.Priority, serv.Weight, serv.Text}\n\t\tif _, ok := bx[b]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tbx[b] = true\n\n\t\tserv.Key = n.Key\n\t\tserv.Ttl = g.calculateTtl(n, serv)\n\t\tif serv.Priority == 0 {\n\t\t\tserv.Priority = int(g.config.Priority)\n\t\t}\n\t\tsx = append(sx, *serv)\n\t}\n\treturn sx, nil\n}", "title": "" }, { "docid": "f61efc9931806fe7e47a9ff33b2ec05d", "score": "0.5156778", "text": "func Routes() []*Route {\n\treturn routes\n}", "title": "" }, { "docid": "4a0fba82ec06ea55c56f5c6cc14adb11", "score": "0.5154958", "text": "func init() {\n//\tvar _r = net.GetRouter()\n//\tvar r = _r.PathPrefix(\"/v1\").Subrouter()\n\n var r = net.GetRouter()\n\t//route for test\n\t log.Print(\"cz youtochi init net_v1\")\n\n\tr.Handle(\"/v1/testdbcharly\", netHandle(handleTestV1, nil)).Methods(\"GET\") //logicbusiness.go\n\n\n/////////start Para Dashboard\n\n\n r.Handle(\"/v1/getdash01grafica01\", netHandle(v1handleGETDash01Grafica01, nil)).Methods(\"GET\") //logicbusiness.go\n r.Handle(\"/v1/getdash01grafica02\", netHandle(v1handleGETDash01Grafica02, nil)).Methods(\"GET\") //logicbusiness.go\n\n r.Handle(\"/v1/getdash02grafica01\", netHandle(v1handleGETDash02Grafica01, nil)).Methods(\"GET\") //logicbusiness.go\n r.Handle(\"/v1/getdash02grafica02\", netHandle(v1handleGETDash02Grafica02, nil)).Methods(\"GET\") //logicbusiness.go\n r.Handle(\"/v1/getdash02grafica03\", netHandle(v1handleGETDash02Grafica03, nil)).Methods(\"GET\") //logicbusiness.go\n\n r.Handle(\"/v1/getdash03grafica01\", netHandle(v1handleGETDash03Grafica01, nil)).Methods(\"GET\") //logicbusiness.go\n r.Handle(\"/v1/getdash03grafica02\", netHandle(v1handleGETDash03Grafica02, nil)).Methods(\"GET\") //logicbusiness.go\n r.Handle(\"/v1/getdash03grafica03\", netHandle(v1handleGETDash03Grafica03, nil)).Methods(\"GET\") //logicbusiness.go\n\n\n// r.Handle(\"/v1/getjsondatabanwire\", netHandle(getJsonDataBanwire, nil)).Methods(\"GET\") //logicbusiness.go\n r.Handle(\"/v1/getDash02Grafica01\", netHandle(v1handleGETDash02Grafica01, nil)).Methods(\"GET\") //logicbusiness.go\n\n r.Handle(\"/v1/getDash02Grafica02\", netHandle(v1handleGETDash02Grafica02, nil)).Methods(\"GET\") //logicbusiness.go \n\n\n r.Handle(\"/v1/dash01\", netHandle(dash01Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/dash02\", netHandle(dash02Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/dash03\", netHandle(dash03Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/dash04\", netHandle(dash04Handler, nil)).Methods(\"GET\")\n r.Handle(\"/v1/dash05\", netHandle(dash05Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/dash06\", netHandle(dash06Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/dash07\", netHandle(dash07Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/dash08\", netHandle(dash08Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v1/ejemplo\", netHandle(ejemploHandler, nil)).Methods(\"GET\") \n\t\n\t//tochi - New phase v2\n\t\n\tr.Handle(\"/v2/dash01\", netHandle(dash21Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v2/dash02\", netHandle(dash22Handler, nil)).Methods(\"GET\") \n r.Handle(\"/v2/dash03\", netHandle(dash23Handler, nil)).Methods(\"GET\") \n\tr.Handle(\"/v2/dash04\", netHandle(dash24Handler, nil)).Methods(\"GET\") \n\tr.Handle(\"/v2/dash05\", netHandle(dash25Handler, nil)).Methods(\"GET\") \n\tr.Handle(\"/v2/dash06\", netHandle(dash26Handler, nil)).Methods(\"GET\") \n\tr.Handle(\"/v2/dash07\", netHandle(dash27Handler, nil)).Methods(\"GET\") \n\tr.Handle(\"/v2/dash08\", netHandle(dash28Handler, nil)).Methods(\"GET\") \n\n\n r.Handle(\"/font-roboto.css\", netHandle(serveCss01, nil)).Methods(\"GET\") \n r.Handle(\"/bootstrap4-alpha3.min.css\", netHandle(serveCss02, nil)).Methods(\"GET\") \n r.Handle(\"/font-awesome.min.css\", netHandle(serveCss03, nil)).Methods(\"GET\") \n r.Handle(\"/style.css\", netHandle(serveCss04, nil)).Methods(\"GET\") \n r.Handle(\"/jquery-3.1.0.min.js\", netHandle(serveJs01, nil)).Methods(\"GET\") \n r.Handle(\"/tether.min.js\", netHandle(serveJs02, nil)).Methods(\"GET\") \n r.Handle(\"/bootstrap4-alpha3.min.js\", netHandle(serveJs03, nil)).Methods(\"GET\") \n r.Handle(\"/canvasjs.min.js\", netHandle(serveJs04, nil)).Methods(\"GET\") \n r.Handle(\"/real-time.js\", netHandle(serveJs05, nil)).Methods(\"GET\") \n r.Handle(\"/real-time_dash01.js\", netHandle(serveJs05dash01, nil)).Methods(\"GET\") \n r.Handle(\"/real-time_dash02.js\", netHandle(serveJs05dash02, nil)).Methods(\"GET\") \n r.Handle(\"/real-time_dash03.js\", netHandle(serveJs05dash03, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash04.js\", netHandle(serveJs05dash04, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash05.js\", netHandle(serveJs05dash05, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash06.js\", netHandle(serveJs05dash06, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash07.js\", netHandle(serveJs05dash07, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash08.js\", netHandle(serveJs05dash08, nil)).Methods(\"GET\") \n\n r.Handle(\"/real-time_dash21.js\", netHandle(serveJs05dash21, nil)).Methods(\"GET\") \n r.Handle(\"/real-time_dash22.js\", netHandle(serveJs05dash22, nil)).Methods(\"GET\") \n r.Handle(\"/real-time_dash23.js\", netHandle(serveJs05dash23, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash24.js\", netHandle(serveJs05dash24, nil)).Methods(\"GET\")\t\n r.Handle(\"/real-time_dash25.js\", netHandle(serveJs05dash25, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash26.js\", netHandle(serveJs05dash26, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash27.js\", netHandle(serveJs05dash27, nil)).Methods(\"GET\")\n r.Handle(\"/real-time_dash28.js\", netHandle(serveJs05dash28, nil)).Methods(\"GET\")\t\n\n\n\n/////////end Para Dashboard\n\n}", "title": "" }, { "docid": "c182ff006691ff41e60437a460180bf4", "score": "0.514401", "text": "func initRoutes(e *gin.Engine, status *model.ServiceStatus, enableCORS bool) {\n\tif enableCORS {\n\t\tcfg := cors.DefaultConfig()\n\t\tcfg.AllowAllOrigins = true\n\t\tcfg.AddAllowMethods(http.MethodDelete)\n\t\tcfg.AddAllowHeaders(httputil.UserRoleXHeader)\n\t\te.Use(cors.New(cfg))\n\t}\n\te.Group(\"/static\").\n\t\tStaticFS(\"/\", static.HTTP)\n\n\te.GET(\"/status\", httputil.ServiceStatus(status))\n\n\te.POST(\"/send\", m.CheckActive(), h.SimpleSendHandler)\n\n\tmessages := e.Group(\"/messages\")\n\t{\n\t\tmessages.GET(\"/:message_id\", m.RequireAdminRole, h.MessageGetHandler)\n\t\tmessages.GET(\"\", m.RequireAdminRole, h.MessageListGetHandler)\n\t}\n\n\ttemplates := e.Group(\"/templates\")\n\t{\n\t\ttemplates.GET(\"\", m.RequireAdminRole, h.TemplateListGetHandler)\n\t\ttemplates.POST(\"\", m.RequireAdminRole, h.TemplateCreateHandler)\n\t\ttemplates.GET(\"/:name\", m.RequireAdminRole, h.TemplateGetHandler)\n\t\ttemplates.PUT(\"/:name\", m.RequireAdminRole, h.TemplateUpdateHandler)\n\t\ttemplates.DELETE(\"/:name\", m.RequireAdminRole, h.TemplateDeleteHandler)\n\t\ttemplates.POST(\"/:name\", h.SendHandler)\n\t}\n}", "title": "" }, { "docid": "0ef210b16840f2a27e2b3acab6b18688", "score": "0.5142112", "text": "func (self *SRouteTable) fetchRoutesForPeer() error {\n\tretPeer, err := self.region.ecsClient.VpcRoutes.List(map[string]string{\"vpc_id\": self.GetVpcId()})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get peer route error\")\n\t}\n\troutesPeer := make([]cloudprovider.ICloudRoute, 0, retPeer.Total)\n\tfor i := range retPeer.Data {\n\t\troute := retPeer.Data[i]\n\t\tid, err := route.GetString(\"id\")\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"get id of peer route error\")\n\t\t}\n\t\tdestination, err := route.GetString(\"destination\")\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"get destination of peer route error\")\n\t\t}\n\t\tnextHop, err := route.GetString(\"nexthop\")\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"get nexthop of peer route error\")\n\t\t}\n\t\troutesPeer = append(routesPeer, &SRouteEntry{\n\t\t\trouteTable: self,\n\t\t\tID: id,\n\t\t\tType: ROUTE_TYPE_PEER,\n\t\t\tDestination: destination,\n\t\t\tNextHop: nextHop,\n\t\t})\n\t}\n\tself.Routes = routesPeer\n\treturn nil\n}", "title": "" }, { "docid": "b84810e13504ba64cb4464a8f29a672c", "score": "0.5136661", "text": "func getNodeNames(resp *etcd.Response) ([]string, error) {\n\tif resp.Node == nil {\n\t\treturn nil, ErrBadResponse\n\t}\n\n\tnames := make([]string, 0, len(resp.Node.Nodes))\n\tfor _, n := range resp.Node.Nodes {\n\t\tnames = append(names, path.Base(n.Key))\n\t}\n\treturn names, nil\n}", "title": "" }, { "docid": "057f26e41ec7988182ac8ae583d58a96", "score": "0.5131873", "text": "func (i *SharedIngressTranslator) getRouteConfiguration(m *model.Model) []ciliumv2.XDSResource {\n\tportHostNameRouteMap := map[string]map[string][]model.HTTPRoute{}\n\tfor _, l := range m.HTTP {\n\t\tfor _, r := range l.Routes {\n\t\t\tport := \"insecure\"\n\t\t\tif l.TLS != nil {\n\t\t\t\tport = \"secure\"\n\t\t\t}\n\t\t\tif _, ok := portHostNameRouteMap[port]; !ok {\n\t\t\t\tportHostNameRouteMap[port] = map[string][]model.HTTPRoute{}\n\t\t\t}\n\t\t\tportHostNameRouteMap[port][l.Hostname] = append(portHostNameRouteMap[port][l.Hostname], r)\n\t\t}\n\t}\n\n\tvar res []ciliumv2.XDSResource\n\tfor port, hostNameRouteMap := range portHostNameRouteMap {\n\t\tvar virtualhosts []*envoy_config_route_v3.VirtualHost\n\n\t\t// Add HTTPs redirect virtual host for secure host\n\t\tif port == insecureHost && i.enforceHTTPs {\n\t\t\tfor h, r := range portHostNameRouteMap[secureHost] {\n\t\t\t\tvhs, _ := translation.NewVirtualHostWithDefaults(h, true, r)\n\t\t\t\tvirtualhosts = append(virtualhosts, vhs)\n\t\t\t}\n\t\t}\n\n\t\tfor h, r := range hostNameRouteMap {\n\t\t\tvhs, _ := translation.NewVirtualHostWithDefaults(h, false, r)\n\t\t\tvirtualhosts = append(virtualhosts, vhs)\n\t\t}\n\n\t\t// the route name should match the value in http connection manager\n\t\t// otherwise the request will be dropped by envoy\n\t\trouteName := fmt.Sprintf(\"listener-%s\", port)\n\t\trc, _ := translation.NewRouteConfiguration(routeName, virtualhosts)\n\t\tres = append(res, rc)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "75a294e6a0f1aa30a6c4e66b27e8855d", "score": "0.51278234", "text": "func makeRafts() ([]RaftNode){\n\tvar r []RaftNode\n\tr = make([]RaftNode, len(configs.Peers))\n\tfor i:=0; i<len(configs.Peers); i++ {\n\t\tconfig := NodeConfig{configs, i, \"Logs/\", 500}\n\t\tr[i] = New(config)\n\t\tr[i].server, _ = cluster.New(i, configs)\n\t}\n\treturn r\n}", "title": "" }, { "docid": "eed13a1f15a37a69881f942562317903", "score": "0.5125503", "text": "func (s *Service) LoadEndpoints() error {\n var es []models.ServiceEndpoint\n\n db := store.GetDB()\n\n s.eLock.Lock()\n defer s.eLock.Unlock()\n\n if err := db.Where(\"service_id = ?\", s.ID).Preload(\"Permissions\").Find(&es).Error; err != nil {\n return err\n }\n\n for i := range es {\n AddToRoute(s, &es[i])\n s.Endpoints = append(s.Endpoints, es[i])\n }\n\n return nil\n}", "title": "" }, { "docid": "15d549be156797ceb2c0b12f3ad32edf", "score": "0.5124521", "text": "func Routes(r fiber.Router, config *viper.Viper) {\n\tr.Get(\"/healthz\", HandlerFunc(config))\n}", "title": "" }, { "docid": "ae42f73055d43335e035b3cbf5ebd159", "score": "0.5117379", "text": "func AllRouting(ch rest.UserHandler, oh rest.OrderHandler, ph rest.ProductHandler, r rest.RoleHandler, stoh rest.StockHandler, suph rest.SupplierHandler) []routers.Router {\n\treturn []routers.Router{\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/users\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ch.UsersHandler,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/login\",\n\t\t\tAuthenticated: nil,\n\t\t\tAuthorized: nil,\n\t\t\tHandler: ch.LoginUserHandler,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/users/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ch.GetUserByIDHandler,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/users\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ch.CreateUserHandler,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPut,\n\t\t\tPath: \"/users/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ch.UpdateUserHandler,\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodDelete,\n\t\t\tPath: \"/users/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ch.DeleteUserHandler,\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/orders\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: oh.Orders,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/orders/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: oh.OrderById,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/orders\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: oh.CreateOrder,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPut,\n\t\t\tPath: \"/orders/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: oh.UpdateOrder,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodDelete,\n\t\t\tPath: \"/orders/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: oh.DeleteOrder,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/products\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ph.Products,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/products/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ph.ProductById,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/products\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ph.CreateProduct,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPut,\n\t\t\tPath: \"/products/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ph.UpdateProduct,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodDelete,\n\t\t\tPath: \"/products/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: ph.DeleteProduct,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/role\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: r.Roles,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/role/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: r.RoleById,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/role\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: r.CreateRole,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPut,\n\t\t\tPath: \"/role/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: r.UpdateRole,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodDelete,\n\t\t\tPath: \"/role/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: r.DeleteRole,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/stocks\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: stoh.Stocks,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/stocks/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: stoh.StockById,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/stocks\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: stoh.CreateStock,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPut,\n\t\t\tPath: \"/stocks/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: stoh.UpdateStock,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodDelete,\n\t\t\tPath: \"/stocks/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: stoh.DeleteStock,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/supplier\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: suph.Suppliers,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodGet,\n\t\t\tPath: \"/supplier/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: suph.SupplierById,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodPost,\n\t\t\tPath: \"/supplier\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: suph.CreateSupplier,\n\n\t\t},\n\t\t{\n\t\t\tMethod: http.MethodPut,\n\t\t\tPath: \"/supplier/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: suph.UpdateSupplier,\n\n\t\t},\n\n\t\t{\n\t\t\tMethod: http.MethodDelete,\n\t\t\tPath: \"/supplier/:id\",\n\t\t\tAuthenticated: ch.Authenticated,\n\t\t\tAuthorized: ch.Authorized,\n\t\t\tHandler: suph.DeleteSupplier,\n\n\t\t},\n\t}\n}", "title": "" }, { "docid": "8719940b1971a671b2bf7bc0cae5c1d0", "score": "0.51085544", "text": "func visitETCD(path string, fn reap) {\n\tlog.WithFields(log.Fields{\"func\": \"visitETCD\"}).Debug(fmt.Sprintf(\"On node %s\", path))\n\tcopts := etcd.GetOptions{\n\t\tRecursive: true,\n\t\tSort: false,\n\t\tQuorum: true,\n\t}\n\tif resp, err := kapi.Get(context.Background(), path, &copts); err != nil {\n\t\tlog.WithFields(log.Fields{\"func\": \"visitETCD\"}).Error(fmt.Sprintf(\"%s\", err))\n\t} else {\n\t\tif resp.Node.Dir { // there are children\n\t\t\tlog.WithFields(log.Fields{\"func\": \"visitETCD\"}).Debug(fmt.Sprintf(\"%s has %d children\", path, len(resp.Node.Nodes)))\n\t\t\tfor _, node := range resp.Node.Nodes {\n\t\t\t\tlog.WithFields(log.Fields{\"func\": \"visitETCD\"}).Debug(fmt.Sprintf(\"Next visiting child %s\", node.Key))\n\t\t\t\tvisitETCD(node.Key, fn)\n\t\t\t}\n\t\t} else { // we're on a leaf node\n\t\t\tfn(resp.Node.Key, string(resp.Node.Value))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2f2550df73121235d3480f7f0bb2e6fc", "score": "0.5107047", "text": "func (s *Server) rootHandler(w http.ResponseWriter, r *http.Request) {\n\tbw := bufio.NewWriter(w)\n\tbw.WriteString(\"\\n\\nAvailable Service Endpoints\\n===========================\\n\\n\")\n\tfor _, ep := range s.httpEndpoints {\n\t\tfmt.Fprintf(bw, \"curl -X %s localhost:%d%s\\n\", ep.Method, s.port, ep.Path)\n\t}\n\tbw.Flush()\n}", "title": "" }, { "docid": "2d5db90662479bb368640301b35bebce", "score": "0.51069796", "text": "func (c *UnifiedResourceCache) getNodes(ctx context.Context) ([]types.Server, error) {\n\tnewNodes, err := c.ResourceGetter.GetNodes(ctx, apidefaults.Namespace)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err, \"getting nodes for unified resource watcher\")\n\t}\n\n\treturn newNodes, err\n}", "title": "" }, { "docid": "ad8d3dc645944bf778a3f988a81f1f35", "score": "0.51056004", "text": "func (t *RestRouteDescriptor) GetAll() *ggt.MethodDescriptor { return t.methodGetAll }", "title": "" }, { "docid": "bd0807937ec9bb664a144b608eb342f8", "score": "0.510036", "text": "func (p *Probe) onRouteChanged(vrfId int) {\n\tvrf := p.getOrCreateRoutingTable(vrfId)\n\n\tp.Ctx.Graph.Lock()\n\tdefer p.Ctx.Graph.Unlock()\n\n\tfilter := graph.NewElementFilter(filters.NewTermInt64Filter(\"Contrail.VRFID\", int64(vrfId)))\n\tintfs := p.Ctx.Graph.GetNodes(filter)\n\n\tif len(intfs) == 0 {\n\t\tp.Ctx.Logger.Debugf(\"No interface with VRF index %d was found (on route add)\", vrfId)\n\t\treturn\n\t}\n\n\tfor _, n := range intfs {\n\t\tcontrailField, err := n.GetField(\"Contrail\")\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif metadata, ok := contrailField.(*Metadata); ok {\n\t\t\tmetadata.RoutingTable = vrf.Routes\n\t\t\tp.Ctx.Graph.AddMetadata(n, \"Contrail\", metadata)\n\t\t\tp.Ctx.Logger.Debugf(\"Update routes on node %s\", n.ID)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e98483d7a7adfda5176149c384e46738", "score": "0.50912315", "text": "func (g *gcp) cleanUnusedRoutes(cluster *kubermaticv1.Cluster) error {\n\tserviceAccount, err := GetCredentialsForCluster(cluster.Spec.Cloud, g.secretKeySelector)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get GCP service account: %v\", err)\n\t}\n\tsvc, projectID, err := ConnectToComputeService(serviceAccount)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to GCP comput service: %v\", err)\n\t}\n\t// filter routes on:\n\t// - name prefix for routes created by gcp cloud provider\n\t// - default tag for routes created by gcp cloud provider\n\t// - GCP network\n\tfilterStr := fmt.Sprintf(\"(name eq \\\"%s\\\")(description eq \\\"%s\\\")(network eq \\\".*%s.*\\\")\",\n\t\tk8sNodeRoutePrefixRegexp,\n\t\tk8sNodeRouteTag,\n\t\tg.networkURL(projectID, cluster.Spec.Cloud.GCP.Network))\n\n\troutesList, err := svc.Routes.List(projectID).Filter(filterStr).Do()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list GCP routes: %v\", err)\n\t}\n\tlogger := g.log.With(\"cluster\", cluster.Name)\n\tfor _, route := range routesList.Items {\n\t\tif isMyRoute, err := isClusterRoute(cluster, route); err != nil || !isMyRoute {\n\t\t\tif err != nil {\n\t\t\t\tlogger.Warnf(\"failed to determine route [%s] CIDR\", route.Name)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif isNextHopNotFound(route) {\n\t\t\tlogger.Infof(\"deleting unused GCP route [%s]\", route.Name)\n\t\t\tif _, err := svc.Routes.Delete(projectID, route.Name).Do(); err != nil && !isHTTPError(err, http.StatusNotFound) {\n\t\t\t\treturn fmt.Errorf(\"failed to delete GCP route %s: %v\", route.Name, err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6b551f643998a8d414f986ed25513aa1", "score": "0.5063104", "text": "func (r *Route) BuildRouteInfo() {\n\tfor _, value := range r.RouterMappingInfo {\n\t\touterPath := fmt.Sprintf(\"/%s/%s\", r.srvBelong.ServiceName, value.OuterPath)\n\t\tswitch value.InnerMethod {\n\t\tcase \"GET\", \"get\":\n\t\t\tswitch value.OuterMethod {\n\t\t\tcase \"GET\", \"get\":\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\tcase \"POST\", \"post\":\n\t\t\t\tr.router.POST(outerPath, r.srvBelong.HandleWrapPostMethod(value.InnerPath))\n\t\t\tcase \"PUT\", \"put\":\n\t\t\t\tr.router.PUT(outerPath, r.srvBelong.HandleWrapPutMethod(value.InnerPath))\n\t\t\tcase \"DELETE\", \"delete\":\n\t\t\t\tr.router.DELETE(outerPath, r.srvBelong.HandleWrapDeleteMethod(value.InnerPath))\n\t\t\tdefault:\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\t}\n\t\tcase \"POST\", \"post\":\n\t\t\tswitch value.OuterMethod {\n\t\t\tcase \"GET\", \"get\":\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\tcase \"POST\", \"post\":\n\t\t\t\tr.router.POST(outerPath, r.srvBelong.HandleWrapPostMethod(value.InnerPath))\n\t\t\tcase \"PUT\", \"put\":\n\t\t\t\tr.router.PUT(outerPath, r.srvBelong.HandleWrapPutMethod(value.InnerPath))\n\t\t\tcase \"DELETE\", \"delete\":\n\t\t\t\tr.router.DELETE(outerPath, r.srvBelong.HandleWrapDeleteMethod(value.InnerPath))\n\t\t\tdefault:\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\t}\n\t\tcase \"PUT\", \"put\":\n\t\t\tswitch value.OuterMethod {\n\t\t\tcase \"GET\", \"get\":\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\tcase \"POST\", \"post\":\n\t\t\t\tr.router.POST(outerPath, r.srvBelong.HandleWrapPostMethod(value.InnerPath))\n\t\t\tcase \"PUT\", \"put\":\n\t\t\t\tr.router.PUT(outerPath, r.srvBelong.HandleWrapPutMethod(value.InnerPath))\n\t\t\tcase \"DELETE\", \"delete\":\n\t\t\t\tr.router.DELETE(outerPath, r.srvBelong.HandleWrapDeleteMethod(value.InnerPath))\n\t\t\tdefault:\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\t}\n\t\tcase \"DELETE\", \"delete\":\n\t\t\tswitch value.OuterMethod {\n\t\t\tcase \"GET\", \"get\":\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\tcase \"POST\", \"post\":\n\t\t\t\tr.router.POST(outerPath, r.srvBelong.HandleWrapPostMethod(value.InnerPath))\n\t\t\tcase \"PUT\", \"put\":\n\t\t\t\tr.router.PUT(outerPath, r.srvBelong.HandleWrapPutMethod(value.InnerPath))\n\t\t\tcase \"DELETE\", \"delete\":\n\t\t\t\tr.router.DELETE(outerPath, r.srvBelong.HandleWrapDeleteMethod(value.InnerPath))\n\t\t\tdefault:\n\t\t\t\tr.router.GET(outerPath, r.srvBelong.HandleWrapGetMethod(value.InnerPath))\n\t\t\t}\n\t\tdefault:\n\t\t\tlog.Printf(\"path method [%s]is not support \\n\", value.OuterMethod)\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "d0157567438b3c0cce0c0b7eb3e4ee11", "score": "0.5062576", "text": "func (r *route) allDistances() []int {\n\troutes := []int{0}\n\tcurMax := 0\n\tfor blockIndex := 0; blockIndex < len(r.directionBlocks); blockIndex++ {\n\t\tblock := r.directionBlocks[blockIndex]\n\t\tfor i := 1; i <= len(block); i++ {\n\t\t\troutes = append(routes, i+curMax)\n\t\t}\n\t\tcurMax += len(block)\n\t\tfor _, branch := range r.branchBlocks[blockIndex] {\n\t\t\tif branch.skippable {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, br := range branch.allDistances() {\n\t\t\t\tif br == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\troutes = append(routes, br+curMax)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn routes\n}", "title": "" }, { "docid": "b8f9cc25f29b50d9f9ea3d5837ce5091", "score": "0.5059696", "text": "func extractAddrs(s *etcd.Response) (addrs, empty []string) {\r\n\taddrs, empty = []string{}, []string{}\r\n\r\n\t// check the response\r\n\tif s == nil || s.Node == nil || s.Node.Nodes == nil || len(s.Node.Nodes) == 0 {\r\n\t\treturn addrs, empty\r\n\t}\r\n\r\n\tfor _, node := range s.Node.Nodes {\r\n\t\t// node should contain host & port\r\n\t\thost, port := \"\", \"\"\r\n\t\tfor _, v := range node.Nodes {\r\n\t\t\t// get the last 4 characters\r\n\t\t\twhat := v.Key[len(v.Key)-4 : len(v.Key)]\r\n\t\t\tif what == \"host\" {\r\n\t\t\t\thost = v.Value\r\n\t\t\t}\r\n\t\t\tif what == \"port\" {\r\n\t\t\t\tport = v.Value\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// if one of host&port has no value, the addr is set partly, should not return\r\n\t\tif host != \"\" && port != \"\" {\r\n\t\t\taddrs = append(addrs, fmt.Sprintf(\"%s:%s\", host, port))\r\n\t\t}\r\n\t\tif host == \"\" && port == \"\" {\r\n\t\t\tempty = append(empty, node.Key)\r\n\t\t}\r\n\t}\r\n\r\n\treturn addrs, empty\r\n}", "title": "" }, { "docid": "48959cc1dbad41c296acc2d02d4c16e0", "score": "0.50562245", "text": "func (feed *Feed) startEndpoints(\n\topaque uint16, routers map[uint64]c.Router) (err error) {\n\n\tprefix := feed.logPrefix\n\tfor _, router := range routers {\n\t\tfor _, raddr := range router.Endpoints() {\n\t\t\traddr1, endpoint, e := feed.getEndpoint(raddr, opaque)\n\t\t\tif e != nil {\n\t\t\t\terr = e\n\t\t\t\tcontinue\n\n\t\t\t} else if endpoint == nil || !endpoint.Ping() {\n\t\t\t\ttopic, typ := feed.topic, feed.endpointType\n\t\t\t\tconfig := feed.config.SectionConfig(\"dataport.\", true /*trim*/)\n\t\t\t\tendpoint, e = feed.epFactory(topic, typ, raddr, config)\n\t\t\t\tif e != nil {\n\t\t\t\t\tfmsg := \"%v ##%x endpoint-factory %q: %v\\n\"\n\t\t\t\t\tlogging.Errorf(fmsg, prefix, opaque, raddr1, e)\n\t\t\t\t\terr = e\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tgo feed.watchEndpoint(raddr, endpoint)\n\t\t\t\tfmsg := \"%v ##%x endpoint %q started\\n\"\n\t\t\t\tlogging.Infof(fmsg, prefix, opaque, raddr)\n\n\t\t\t} else {\n\t\t\t\tfmsg := \"%v ##%x endpoint %q active ...\\n\"\n\t\t\t\tlogging.Infof(fmsg, prefix, opaque, raddr)\n\t\t\t}\n\t\t\t// FIXME: hack to make both node-name available from\n\t\t\t// endpoints table.\n\t\t\tfeed.endpoints[raddr] = endpoint // :SideEffect:\n\t\t\tfeed.endpoints[raddr1] = endpoint // :SideEffect:\n\t\t}\n\t}\n\t//return nil\n\treturn err\n}", "title": "" }, { "docid": "12994e1ec2a4f672d1899f6dc4cce641", "score": "0.5051191", "text": "func routerInit(sop core.StoreOperation, cop core.ClusterOperation) map[string]func(w http.ResponseWriter, r *http.Request) {\n\top := &RestOp{\n\t\tsop: sop,\n\t\tcop: cop,\n\t}\n\n\topMap := make(map[string]func(w http.ResponseWriter, r *http.Request))\n\topMap[\"/set\"] = op.Set\n\topMap[\"/get\"] = op.Get\n\topMap[\"/exist\"] = op.Exist\n\topMap[\"/remove\"] = op.Remove\n\topMap[\"/join\"] = op.Join\n\n\treturn opMap\n}", "title": "" }, { "docid": "99dea1d17efc4bccd85cb8f53079c638", "score": "0.5035442", "text": "func (self *Server) Route() {\n\tfor {\n\t\tselect {\n\n\t\t// Add new a client\n\t\tcase c := <-self.addClient:\n\t\t\tlog.Println(\"Added new client\")\n\t\t self.clients[c] = true\n\t\t\tfor _, msg := range self.messages {\n\t\t\t\tc.Write() <- msg\n\t\t\t}\n\t\t\tlog.Println(\"Now\", len(self.clients), \"clients connected.\")\n\n\t\t// remove a client\n\t\tcase c := <-self.removeClient:\n\t\t\tlog.Println(\"Remove client\")\n \t\t\tdelete(self.clients, c)\n\n\t\t// broadcast message for all clients\n\t\tcase msg := <-self.sendAll:\n\t\t\tlog.Println(\"Send all:\", msg)\n\t\t\tself.messages = append(self.messages, msg)\n\t\t\tfor c := range self.clients {\n\t\t\t\tc.Write() <- msg\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "082d6b430cb8aa5079cb46fdc55c2b50", "score": "0.5034101", "text": "func (ds *DiscoveryService) ListAllEndpoints(_ *restful.Request, response *restful.Response) {\n\tmethodName := \"ListAllEndpoints\"\n\tincCalls(methodName)\n\n\tservices := make([]*keyAndService, 0)\n\n\tsvcs, err := ds.Services()\n\tif err != nil {\n\t\t// If client experiences an error, 503 error will tell envoy to keep its current\n\t\t// cache and try again later\n\t\terrorResponse(methodName, response, http.StatusServiceUnavailable, \"EDS \"+err.Error())\n\t\treturn\n\t}\n\n\tfor _, service := range svcs {\n\t\tif !service.External() {\n\t\t\tfor _, port := range service.Ports {\n\t\t\t\thosts := make([]*host, 0)\n\t\t\t\tinstances, err := ds.InstancesByPort(service.Hostname, port.Port, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\t// If client experiences an error, 503 error will tell envoy to keep its current\n\t\t\t\t\t// cache and try again later\n\t\t\t\t\terrorResponse(methodName, response, http.StatusInternalServerError, \"EDS \"+err.Error())\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfor _, instance := range instances {\n\t\t\t\t\thosts = append(hosts, &host{\n\t\t\t\t\t\tAddress: instance.Endpoint.Address,\n\t\t\t\t\t\tPort: instance.Endpoint.Port,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tservices = append(services, &keyAndService{\n\t\t\t\t\tKey: service.Key(port, nil),\n\t\t\t\t\tHosts: hosts,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sort servicesArray. This is not strictly necessary, but discovery_test.go will\n\t// be comparing against a golden example using test/util/diff.go which does a textual comparison\n\tsort.Slice(services, func(i, j int) bool { return services[i].Key < services[j].Key })\n\n\tif err := response.WriteEntity(services); err != nil {\n\t\tincErrors(methodName)\n\t\tlog.Warna(err)\n\t} else {\n\t\tobserveResources(methodName, uint32(len(services)))\n\t}\n}", "title": "" }, { "docid": "a6ca50ae1aa73049eaab52f6c6245928", "score": "0.5028912", "text": "func (e *env) routes() {\n\te.router = func(ctx *fasthttp.RequestCtx) {\n\t\tswitch string(ctx.Path()) {\n\t\tcase \"/\":\n\t\t\te.handleRoot(ctx)\n\t\tdefault:\n\t\t\tctx.Error(\"not found\", fasthttp.StatusNotFound)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "285acccf86977e2ed37fa4b76006cb93", "score": "0.5028477", "text": "func serve(s *KVStore, r *rand.Rand, peers *arrayPeers, id string, port int, totNumNodes int) {\n\traft := Raft{AppendChan: make(chan AppendEntriesInput), VoteChan: make(chan VoteInput)}\n\t// Start in a Go routine so it doesn't affect us.\n\tgo RunRaftServer(&raft, port)\n\n\tpeerClients := make(map[string]pb.RaftClient)\n\n\tfor _, peer := range *peers {\n\t\tclient, err := connectToPeer(peer)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to connect to GRPC server %v\", err)\n\t\t}\n\n\t\tpeerClients[peer] = client\n\t\tlog.Printf(\"Connected to %v\", peer)\n\t}\n\n\ttype AppendResponse struct {\n\t\tret *pb.AppendEntriesRet\n\t\terr error\n\t\tpeer string\n\t\tisHeartBeat bool\n\t\treplicatedLogHighestIndex int64\n\t}\n\n\ttype VoteResponse struct {\n\t\tret *pb.RequestVoteRet\n\t\terr error\n\t\tpeer string\n\t}\n\tappendResponseChan := make(chan AppendResponse)\n\tvoteResponseChan := make(chan VoteResponse)\n\n\t// Create a timer and start running it\n\ttimer := time.NewTimer(randomDuration(r))\n\t// Creating heartbeatTimer - This ensures it's not called before the first election timeout\n\theartbeatTimer := time.NewTimer(100000 * time.Millisecond)\n\n\t// State -- To add more terms\n\tvar currentTerm int64\n\tvar votedFor string\n\tvar votes int\n\tvar currentLeader string\n\n\tvar logs []*pb.Entry\n\tvar lastLogIndex int64\n\tvar commitIndex int64\n\tvar lastApplied int64\n\n\tnextIndex := make(map[string]int64)\n\tmatchIndex := make(map[string]int64)\n\tfor _, peer := range *peers { //Initializing nextIndex and matchIndex Map values to 0\n\t\tnextIndex[peer] = 1\n\t\tmatchIndex[peer] = 0\n\t}\n\n\tindexToOp := make(map[int64]InputChannelType)\n\n\t// Run forever handling inputs from various channels\n\tfor {\n\t\tselect {\n\t\tcase <-timer.C:\n\t\t\t// The Election timer went off - Convert to candidate\n\t\t\tlog.Printf(\"Election Timeout!! - Convert to Candidate\")\n\t\t\tvotes = 0 //Resets vote count\n\n\t\t\t//Election\n\t\t\tcurrentTerm++\n\t\t\tlog.Printf(\"Current term increased to %v due to election timeout\", currentTerm)\n\t\t\tvotes++ //Votes for itself\n\t\t\tvotedFor = id //Since new term has started and it has voted for itself\n\n\t\t\tif lastLogIndex == 0 { //Case when no log has been added till now\n\t\t\t\tfor p, c := range peerClients {\n\t\t\t\t\t// Send in parallel so we don't wait for each client.\n\t\t\t\t\tgo func(c pb.RaftClient, p string) {\n\t\t\t\t\t\tret, err := c.RequestVote(context.Background(), &pb.RequestVoteArgs{Term: currentTerm, CandidateID: id, LastLogIndex: lastLogIndex})\n\t\t\t\t\t\tvoteResponseChan <- VoteResponse{ret: ret, err: err, peer: p}\n\t\t\t\t\t}(c, p)\n\t\t\t\t}\n\t\t\t} else { //All other cases\n\t\t\t\tfor p, c := range peerClients {\n\t\t\t\t\t// Send in parallel so we don't wait for each client.\n\t\t\t\t\tgo func(c pb.RaftClient, p string) {\n\t\t\t\t\t\tret, err := c.RequestVote(context.Background(), &pb.RequestVoteArgs{Term: currentTerm, CandidateID: id, LastLogIndex: lastLogIndex, LasLogTerm: logs[lastLogIndex-1].Term})\n\t\t\t\t\t\tvoteResponseChan <- VoteResponse{ret: ret, err: err, peer: p}\n\t\t\t\t\t}(c, p)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// This will also take care of any pesky timeouts that happened while processing the operation.\n\t\t\trestartTimer(timer, r)\n\t\tcase <-heartbeatTimer.C:\n\t\t\tif id == currentLeader { //Only run this if it is current leader\n\t\t\t\t//Heartbeats\n\t\t\t\tlog.Printf(\"Sending heartbeats from leader:%v,%v in term:%v\", id, currentLeader, currentTerm)\n\n\t\t\t\tfor p, c := range peerClients {\n\t\t\t\t\tif lastLogIndex >= nextIndex[p] { //Sending append entries\n\n\t\t\t\t\t\tif nextIndex[p] == 1 { //When the leaders logs are being sent for the very first time to peer\n\t\t\t\t\t\t\t// Send in parallel so we don't wait for each client.\n\t\t\t\t\t\t\tgo func(c pb.RaftClient, p string) {\n\t\t\t\t\t\t\t\t//Not sending PrevLogTerm since it will otherwise result in IndexOutOfBoundsError\n\t\t\t\t\t\t\t\tret, err := c.AppendEntries(context.Background(), &pb.AppendEntriesArgs{Term: currentTerm, LeaderID: id, PrevLogIndex: nextIndex[p] - 1, LeaderCommit: commitIndex, Entries: logs[nextIndex[p]-1:]})\n\t\t\t\t\t\t\t\tappendResponseChan <- AppendResponse{ret: ret, err: err, peer: p, isHeartBeat: false, replicatedLogHighestIndex: lastLogIndex}\n\t\t\t\t\t\t\t}(c, p)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Send in parallel so we don't wait for each client.\n\t\t\t\t\t\t\tgo func(c pb.RaftClient, p string) {\n\t\t\t\t\t\t\t\t//Hopefully the diff of logs is right\n\t\t\t\t\t\t\t\tret, err := c.AppendEntries(context.Background(), &pb.AppendEntriesArgs{Term: currentTerm, LeaderID: id, PrevLogIndex: nextIndex[p] - 1, PrevLogTerm: logs[nextIndex[p]-2].Term, LeaderCommit: commitIndex, Entries: logs[nextIndex[p]-1:]})\n\t\t\t\t\t\t\t\tappendResponseChan <- AppendResponse{ret: ret, err: err, peer: p, isHeartBeat: false, replicatedLogHighestIndex: lastLogIndex}\n\t\t\t\t\t\t\t}(c, p)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else { //Sending heartbeats - This includes the case for no log at the very beginning\n\t\t\t\t\t\t// Send in parallel so we don't wait for each client.\n\t\t\t\t\t\tgo func(c pb.RaftClient, p string) {\n\t\t\t\t\t\t\t//Sending empty logs\n\t\t\t\t\t\t\tret, err := c.AppendEntries(context.Background(), &pb.AppendEntriesArgs{Term: currentTerm, LeaderID: id, LeaderCommit: commitIndex, Entries: logs[len(logs):]})\n\t\t\t\t\t\t\tappendResponseChan <- AppendResponse{ret: ret, err: err, peer: p, isHeartBeat: true}\n\t\t\t\t\t\t}(c, p)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// This will also take care of any pesky timeouts that happened while processing the operation.\n\t\t\t\trestartHBTimer(heartbeatTimer)\n\t\t\t}\n\t\tcase op := <-s.C:\n\t\t\t// We received an operation from a client\n\t\t\tlog.Printf(\"Received Client operation\")\n\n\t\t\tif id == currentLeader {\n\t\t\t\tlastLogIndex++ //Incrementing latest log index to be applied at\n\n\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\tprintLogs(logs)\n\t\t\t\tlog.Printf(\"Adding new entry to leader log\") //commandName(&op.command)\n\t\t\t\tlogs = append(logs, &pb.Entry{Term: currentTerm, Index: lastLogIndex, Cmd: &op.command}) //Appending client command to log\n\t\t\t\tprintLogs(logs)\n\n\t\t\t\t//Adding the op to map -- Might need to check against log to see if it's safe to execute\n\t\t\t\tindexToOp[lastLogIndex] = op\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Please redirect client request to %v\", currentLeader)\n\t\t\t\top.response <- pb.Result{\n\t\t\t\t\tResult: &pb.Result_Redirect{\n\t\t\t\t\t\t&pb.Redirect{Server: currentLeader}}}\n\t\t\t}\n\n\t\tcase ae := <-raft.AppendChan:\n\t\t\t// We received an AppendEntries request from a Raft peer\n\t\t\tlog.Printf(\"Received append entry from %v\", ae.arg.LeaderID)\n\n\t\t\t//Might need to fix this logic later\n\t\t\tif currentTerm < ae.arg.Term {\n\t\t\t\tlog.Printf(\"Term incremented. My term: %v. Appender term: %v\", currentTerm, ae.arg.Term)\n\t\t\t\tcurrentTerm = ae.arg.Term\n\t\t\t\tvotedFor = \"\" //Resetting votedFor as I've not yet voted for anyone in this updated term\n\t\t\t\tvotes = 0 //Resetting my vote count\n\t\t\t\tif currentLeader == id { //If I am the leader\n\t\t\t\t\tlog.Printf(\"Stepping down as leader. New leader is %v\", ae.arg.LeaderID)\n\t\t\t\t\tstopHBTimer(heartbeatTimer) //Since Leader stepping down to follower\n\t\t\t\t}\n\t\t\t\tcurrentLeader = ae.arg.LeaderID // Assigning new leader with the higher term\n\n\t\t\t\tif len(ae.arg.Entries) > 0 { //These are not heartbeats, i.e, they are actual Append Entries.\n\t\t\t\t\t//Log Replication stuff for follower\n\t\t\t\t\tif lastLogIndex < ae.arg.PrevLogIndex { //Follower log length is less than leader log length\n\t\t\t\t\t\tlog.Printf(\"Follower log length is less than leader log length. Return false to leader\")\n\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t\t} else if lastLogIndex == ae.arg.PrevLogIndex { //Found an index that matches with leader\n\t\t\t\t\t\tlog.Printf(\"lastLogIndex index of follower matches with leader\")\n\n\t\t\t\t\t\tif ae.arg.PrevLogIndex == 0 { //Case of when first log is added\n\t\t\t\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\t\t\t\tprintLogs(logs)\n\t\t\t\t\t\t\tlog.Printf(\"Appending first entry/entries from leader. Return true to leader\")\n\t\t\t\t\t\t\t//Appending first entry\n\t\t\t\t\t\t\tfor _, logEntry := range ae.arg.Entries {\n\t\t\t\t\t\t\t\tlogs = append(logs, logEntry)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\tlastLogIndex = int64(len(logs)) //Updating lastLogIndex for follower\n\n\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: true}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif logs[lastLogIndex-1].Term == ae.arg.PrevLogTerm { //Append logs from leader\n\t\t\t\t\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\t\t\t\t\tprintLogs(logs)\n\t\t\t\t\t\t\t\tlog.Printf(\"Appending logs from leader. Return true to leader\")\n\t\t\t\t\t\t\t\t//Appending logs one by one\n\t\t\t\t\t\t\t\tfor _, logEntry := range ae.arg.Entries {\n\t\t\t\t\t\t\t\t\tlogs = append(logs, logEntry)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\t\tlastLogIndex = int64(len(logs)) //Updating lastLogIndex for follower\n\n\t\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: true}\n\t\t\t\t\t\t\t} else { // Terms don't match - Return false to leader\n\t\t\t\t\t\t\t\tlog.Printf(\"Term of lastLogIndex index of follower doesn't match with respective index term of leader . Return false to leader\")\n\t\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else { //Follower log length is greater than leader log length - need to delete some entries of followers\n\t\t\t\t\t\tif logs[ae.arg.PrevLogIndex-1].Term == ae.arg.PrevLogTerm { //Delete all entries after this for follower and append leader entries\n\t\t\t\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\tlog.Printf(\"Deleting extra logs of follower\")\n\t\t\t\t\t\t\tlogs = logs[:ae.arg.PrevLogIndex]\n\n\t\t\t\t\t\t\tlog.Printf(\"Appending logs from leader. Return true to leader\")\n\t\t\t\t\t\t\t//Appending logs one by one\n\t\t\t\t\t\t\tfor _, logEntry := range ae.arg.Entries {\n\t\t\t\t\t\t\t\tlogs = append(logs, logEntry)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\tlastLogIndex = int64(len(logs)) //Updating lastLogIndex for follower\n\n\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: true}\n\t\t\t\t\t\t} else { // Terms don't match - Return false to leader\n\t\t\t\t\t\t\tlog.Printf(\"Term of prevLogIndex of follower doesn't match with respective index term of leader . Return false to leader\")\n\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else { //Heartbeats\n\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t}\n\n\t\t\t\trestartTimer(timer, r)\n\t\t\t} else if currentTerm == ae.arg.Term {\n\t\t\t\tlog.Printf(\"Leader is %v for term %v\", ae.arg.LeaderID, currentTerm)\n\t\t\t\tcurrentLeader = ae.arg.LeaderID //Assigning leader for whom we voted earlier\n\n\t\t\t\tif len(ae.arg.Entries) > 0 { //These are not heartbeats, i.e, they are actual Append Entries.\n\t\t\t\t\t//Log Replication stuff for follower\n\t\t\t\t\tif lastLogIndex < ae.arg.PrevLogIndex { //Follower log length is less than leader log length\n\t\t\t\t\t\tlog.Printf(\"Follower log length is less than leader log length. Return false to leader\")\n\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t\t} else if lastLogIndex == ae.arg.PrevLogIndex { //Found an index that matches with leader\n\t\t\t\t\t\tlog.Printf(\"lastLogIndex index of follower matches with leader\")\n\n\t\t\t\t\t\tif ae.arg.PrevLogIndex == 0 { //Case of when first log is added\n\t\t\t\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\t\t\t\tprintLogs(logs)\n\t\t\t\t\t\t\tlog.Printf(\"Appending first entry/entries from leader. Return true to leader\")\n\t\t\t\t\t\t\t//Appending first entry\n\t\t\t\t\t\t\tfor _, logEntry := range ae.arg.Entries {\n\t\t\t\t\t\t\t\tlogs = append(logs, logEntry)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\tlastLogIndex = int64(len(logs)) //Updating lastLogIndex for follower\n\n\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: true}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif logs[lastLogIndex-1].Term == ae.arg.PrevLogTerm { //Append logs from leader\n\t\t\t\t\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\t\t\t\t\tprintLogs(logs)\n\t\t\t\t\t\t\t\tlog.Printf(\"Appending logs from leader. Return true to leader\")\n\t\t\t\t\t\t\t\t//Appending logs one by one\n\t\t\t\t\t\t\t\tfor _, logEntry := range ae.arg.Entries {\n\t\t\t\t\t\t\t\t\tlogs = append(logs, logEntry)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\t\tlastLogIndex = int64(len(logs)) //Updating lastLogIndex for follower\n\n\t\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: true}\n\t\t\t\t\t\t\t} else { // Terms don't match - Return false to leader\n\t\t\t\t\t\t\t\tlog.Printf(\"Term of lastLogIndex index of follower doesn't match with respective index term of leader . Return false to leader\")\n\t\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else { //Follower log length is greater than leader log length - need to delete some entries of followers\n\t\t\t\t\t\tif logs[ae.arg.PrevLogIndex-1].Term == ae.arg.PrevLogTerm { //Delete all entries after this for follower and append leader entries\n\t\t\t\t\t\t\tlog.Printf(\"Log before entry\")\n\t\t\t\t\t\t\tprintLogs(logs)\n\t\t\t\t\t\t\tlog.Printf(\"Deleting extra logs of follower\")\n\t\t\t\t\t\t\tlogs = logs[:ae.arg.PrevLogIndex]\n\n\t\t\t\t\t\t\tlog.Printf(\"Appending logs from leader. Return true to leader\")\n\t\t\t\t\t\t\t//Appending logs one by one\n\t\t\t\t\t\t\tfor _, logEntry := range ae.arg.Entries {\n\t\t\t\t\t\t\t\tlogs = append(logs, logEntry)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprintLogs(logs)\n\n\t\t\t\t\t\t\tlastLogIndex = int64(len(logs)) //Updating lastLogIndex for follower\n\n\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: true}\n\t\t\t\t\t\t} else { // Terms don't match - Return false to leader\n\t\t\t\t\t\t\tlog.Printf(\"Term of prevLogIndex of follower doesn't match with respective index term of leader . Return false to leader\")\n\t\t\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else { //Heartbeats\n\t\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t\t}\n\n\t\t\t\trestartTimer(timer, r)\n\t\t\t} else { //Receiving Stale Term\n\t\t\t\tlog.Printf(\"Append request from %v rejected as appender term < my term. My term: %v. Appender term: %v\", ae.arg.LeaderID, currentTerm, ae.arg.Term)\n\t\t\t\tae.response <- pb.AppendEntriesRet{Term: currentTerm, Success: false}\n\t\t\t}\n\n\t\t\t//Updating Commit Index\n\t\t\tif ae.arg.LeaderCommit > commitIndex {\n\t\t\t\tif ae.arg.LeaderCommit < lastLogIndex {\n\t\t\t\t\tlog.Printf(\"Setting my CommitIndex to Leader CommitIndex\")\n\t\t\t\t\tcommitIndex = ae.arg.LeaderCommit\n\t\t\t\t} else {\n\t\t\t\t\tlog.Printf(\"Setting my CommitIndex to my LastLogIndex\")\n\t\t\t\t\tcommitIndex = lastLogIndex\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Applying commands to State Machine\n\t\t\tif commitIndex > lastApplied {\n\t\t\t\tlog.Printf(\"Applying the following commands to State Machine\")\n\t\t\t\tprintLogs(logs[lastApplied:commitIndex])\n\n\t\t\t\tfor _, logEntry := range logs[lastApplied:commitIndex] {\n\t\t\t\t\ts.HandleCommandFollower(logEntry.Cmd)\n\t\t\t\t}\n\n\t\t\t\tlog.Printf(\"Updating LastApplied %v to CommitIndex %v\", lastApplied, commitIndex)\n\t\t\t\tlastApplied = commitIndex\n\t\t\t}\n\n\t\tcase vr := <-raft.VoteChan:\n\t\t\t// We received a RequestVote RPC from a raft peer\n\t\t\tlog.Printf(\"Received vote request from %v\", vr.arg.CandidateID)\n\n\t\t\tif currentTerm < vr.arg.Term { //Current term is less than Requester term\n\t\t\t\tlog.Printf(\"My term: %v is less than candidate term: %v\", currentTerm, vr.arg.Term)\n\n\t\t\t\tcurrentTerm = vr.arg.Term\n\t\t\t\tvotes = 0 //Reset my own votes incase I was a candidate\n\t\t\t\tif currentLeader == id { //If I am the leader\n\t\t\t\t\tlog.Printf(\"Stepping down as leader\")\n\t\t\t\t\tstopHBTimer(heartbeatTimer) //Since Leader stepping down to follower\n\t\t\t\t}\n\n\t\t\t\tisCandidateLogUpToDate := false\n\t\t\t\t//TODO: Candidate Upto Date Logic for Election Restriction\n\t\t\t\tif lastLogIndex > 0 {\n\t\t\t\t\tif vr.arg.LastLogIndex == 0 { //The case where leader log is empty\n\t\t\t\t\t\tisCandidateLogUpToDate = false\n\t\t\t\t\t} else if logs[lastLogIndex-1].Term != vr.arg.LasLogTerm { //Logs with last entries have different terms\n\t\t\t\t\t\tif vr.arg.LasLogTerm >= logs[lastLogIndex-1].Term {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = false\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { //Logs with last entries have same terms\n\t\t\t\t\t\tif vr.arg.LastLogIndex >= lastLogIndex {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif isCandidateLogUpToDate || lastLogIndex == 0 { //Candidate log is upto date or it's at the very beginning when my log is empty\n\t\t\t\t\tif lastLogIndex == 0 {\n\t\t\t\t\t\tlog.Printf(\"I have no logs yet\")\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf(\"Candidate log is up-to-date\")\n\t\t\t\t\tvotedFor = vr.arg.CandidateID\n\t\t\t\t\tlog.Printf(\"Voted for %v due to term increase and candidate log being upto date\", vr.arg.CandidateID)\n\t\t\t\t\tvr.response <- pb.RequestVoteRet{Term: currentTerm, VoteGranted: true} //Voted for Requester\n\t\t\t\t} else { //Candidate log is not upto date\n\t\t\t\t\tlog.Printf(\"Candidate log is not up-to-date\")\n\t\t\t\t\tlog.Printf(\"Vote request from %v rejected as candidate log is not upto date\", vr.arg.CandidateID)\n\t\t\t\t\tvr.response <- pb.RequestVoteRet{Term: currentTerm, VoteGranted: false}\n\t\t\t\t}\n\n\t\t\t\trestartTimer(timer, r)\n\n\t\t\t} else if currentTerm == vr.arg.Term { //Current term is equal to Requester term\n\t\t\t\tlog.Printf(\"My term: %v is equal to candidate term: %v\", currentTerm, vr.arg.Term)\n\n\t\t\t\tisCandidateLogUpToDate := false\n\t\t\t\t//TODO: Candidate Upto Date Logic for Election Restriction\n\t\t\t\tif lastLogIndex > 0 {\n\t\t\t\t\tif vr.arg.LastLogIndex == 0 { //The case where leader log is empty\n\t\t\t\t\t\tisCandidateLogUpToDate = false\n\t\t\t\t\t} else if logs[lastLogIndex-1].Term != vr.arg.LasLogTerm { //Logs with last entries have different terms\n\t\t\t\t\t\tif vr.arg.LasLogTerm >= logs[lastLogIndex-1].Term {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = false\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { //Logs with last entries have same terms\n\t\t\t\t\t\tif vr.arg.LastLogIndex >= lastLogIndex {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisCandidateLogUpToDate = false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif isCandidateLogUpToDate || lastLogIndex == 0 { //Candidate log is upto date or it's at the very beginning when my log is empty\n\t\t\t\t\tif lastLogIndex == 0 {\n\t\t\t\t\t\tlog.Printf(\"I have no logs yet\")\n\t\t\t\t\t}\n\n\t\t\t\t\tlog.Printf(\"Candidate log is up-to-date\")\n\t\t\t\t\tif votedFor == \"\" { //Then you can vote as you've not voted yet\n\t\t\t\t\t\tvotedFor = vr.arg.CandidateID\n\t\t\t\t\t\tlog.Printf(\"Voted for %v as I've not yet voted this term\", vr.arg.CandidateID)\n\t\t\t\t\t\tvr.response <- pb.RequestVoteRet{Term: currentTerm, VoteGranted: true} //Voted for Requester\n\t\t\t\t\t\trestartTimer(timer, r)\n\t\t\t\t\t} else { //Reject vote as you've already voted this term\n\t\t\t\t\t\tlog.Printf(\"Vote request from %v rejected as I've already voted in this term: %v for %v\", vr.arg.CandidateID, currentTerm, votedFor)\n\t\t\t\t\t\tvr.response <- pb.RequestVoteRet{Term: currentTerm, VoteGranted: false}\n\t\t\t\t\t}\n\t\t\t\t} else { //Candidate log is not upto date\n\t\t\t\t\tlog.Printf(\"Candidate log is not up-to-date\")\n\t\t\t\t\tlog.Printf(\"Vote request from %v rejected as candidate log is not upto date\", vr.arg.CandidateID)\n\t\t\t\t\tvr.response <- pb.RequestVoteRet{Term: currentTerm, VoteGranted: false}\n\t\t\t\t}\n\n\t\t\t} else { //Reject vote request\n\t\t\t\tlog.Printf(\"Vote request from %v rejected as requester term < my term. My term: %v. Requester term: %v\", vr.arg.CandidateID, currentTerm, vr.arg.Term)\n\t\t\t\tvr.response <- pb.RequestVoteRet{Term: currentTerm, VoteGranted: false}\n\t\t\t}\n\n\t\tcase vr := <-voteResponseChan:\n\t\t\t// We received a response to a previous vote request.\n\t\t\tif vr.err != nil {\n\t\t\t\t// Do not do Fatalf here since the peer might be gone but we should survive.\n\t\t\t\tlog.Printf(\"Error calling RPC %v\", vr.err)\n\t\t\t} else {\n\t\t\t\t//To check Term of response received\n\n\t\t\t\tlog.Printf(\"Got response to vote request from %v\", vr.peer)\n\t\t\t\tlog.Printf(\"Peer %s granted %v term %v\", vr.peer, vr.ret.VoteGranted, vr.ret.Term)\n\n\t\t\t\tif currentTerm < vr.ret.Term { //Some other node is at a higher term - Candidate changes to Follower\n\t\t\t\t\tlog.Printf(\"Term incremented. My term: %v. Voter term: %v\", currentTerm, vr.ret.Term)\n\t\t\t\t\tlog.Printf(\"Stepping down to Follower\")\n\t\t\t\t\tcurrentTerm = vr.ret.Term\n\t\t\t\t\tvotedFor = \"\" //Resetting votedFor as I've not yet voted for anyone in this updated term\n\t\t\t\t\tvotes = 0 //Resetting my vote count\n\t\t\t\t\trestartTimer(timer, r)\n\t\t\t\t} else if currentTerm == vr.ret.Term {\n\t\t\t\t\t//Vote Granted by peer\n\t\t\t\t\tif vr.ret.VoteGranted {\n\t\t\t\t\t\tvotes++\n\t\t\t\t\t\tlog.Printf(\"Peer %v voted %v in term %v. Vote Count: %v \", vr.peer, vr.ret.VoteGranted, currentTerm, votes)\n\t\t\t\t\t}\n\n\t\t\t\t\tif votes > (totNumNodes/2) && currentLeader != id { //Majority vote achieved - Candidate changes to Leader\n\t\t\t\t\t\tlog.Printf(\"Got Majority vote count of %v among %v nodes\", votes, totNumNodes)\n\t\t\t\t\t\tlog.Printf(\"Converting to Leader from Candidate\")\n\t\t\t\t\t\tcurrentLeader = id //Assigning self as Leader\n\n\t\t\t\t\t\tfor _, peer := range *peers { //Reinitializing nextIndex and matchIndex Map values after election\n\t\t\t\t\t\t\tnextIndex[peer] = lastLogIndex + 1 //Since initialized to leader last log index + 1\n\t\t\t\t\t\t\tmatchIndex[peer] = 0\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Clearing out earlier client requests\n\t\t\t\t\t\tfor k := range indexToOp {\n\t\t\t\t\t\t\tdelete(indexToOp, k)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstopTimer(timer) //Stopping Election timer since it has become leader\n\t\t\t\t\t\theartbeatTimer = time.NewTimer(1000 * time.Millisecond) //Starting heartbeatTimer\n\t\t\t\t\t}\n\t\t\t\t} else { //Receiving Vote response for Stale Term\n\t\t\t\t\tlog.Printf(\"Do Nothing. Received vote response for stale term. My term: %v. Voter term: %v\", currentTerm, vr.ret.Term)\n\t\t\t\t}\n\n\t\t\t}\n\t\tcase ar := <-appendResponseChan:\n\t\t\t// We received a response to a previous AppendEntries RPC call\n\t\t\tif ar.err != nil {\n\t\t\t\t// Do not do Fatalf here since the peer might be gone but we should survive.\n\t\t\t\tlog.Printf(\"Error calling RPC %v\", ar.err)\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Got append entries response from %v\", ar.peer)\n\t\t\t\tlog.Printf(\"Peer %s granted Success: %v in term %v\", ar.peer, ar.ret.Success, ar.ret.Term)\n\n\t\t\t\tif currentTerm < ar.ret.Term { //Some other node is at a higher term - Leader changes to Follower\n\t\t\t\t\tlog.Printf(\"Term incremented. My term: %v. Appender term: %v\", currentTerm, ar.ret.Term)\n\t\t\t\t\tlog.Printf(\"Stepping down to Follower\")\n\t\t\t\t\tcurrentTerm = ar.ret.Term\n\t\t\t\t\tvotedFor = \"\" //Resetting votedFor as I've not yet voted for anyone in this updated term\n\t\t\t\t\tvotes = 0 //Resetting my vote count\n\t\t\t\t\trestartTimer(timer, r)\n\t\t\t\t\tstopHBTimer(heartbeatTimer) //Since Leader stepping down to follower\n\t\t\t\t} else if currentTerm == ar.ret.Term {\n\n\t\t\t\t\tif ar.isHeartBeat { //Heartbeat\n\t\t\t\t\t\tlog.Printf(\"Got response to Heartbeat\")\n\t\t\t\t\t} else { //AppendEntries Response\n\t\t\t\t\t\t//Log Replication procedures happen here\n\t\t\t\t\t\tif ar.ret.Success {\n\t\t\t\t\t\t\t//Do some majority vote for replication and committing\n\t\t\t\t\t\t\tlog.Printf(\"Doing some vote count for log replication\")\n\t\t\t\t\t\t\tnextIndex[ar.peer] = lastLogIndex + 1 //Updating nextIndex for the peer that responded with True\n\t\t\t\t\t\t\tmatchIndex[ar.peer] = ar.replicatedLogHighestIndex //Highest log index know to be replicated on follower\n\n\t\t\t\t\t\t\tfor k, v := range matchIndex {\n\t\t\t\t\t\t\t\tlog.Printf(\"MatchIndex : %v for Peer %v\", v, k)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//Logic for setting commitIndex on Leader side\n\t\t\t\t\t\t\tfor n := lastLogIndex; n > 0; n-- {\n\t\t\t\t\t\t\t\treplicationVotes := 1\n\t\t\t\t\t\t\t\tfor _, v := range matchIndex {\n\t\t\t\t\t\t\t\t\tif v >= n {\n\t\t\t\t\t\t\t\t\t\treplicationVotes++\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlog.Printf(\"Replication votes %v for n: %v\", replicationVotes, n)\n\n\t\t\t\t\t\t\t\tlog.Printf(\"Term %v for n %v\", logs[n-1].Term, n)\n\n\t\t\t\t\t\t\t\tif n > commitIndex && replicationVotes > (totNumNodes/2) && logs[n-1].Term == currentTerm {\n\t\t\t\t\t\t\t\t\tcommitIndex = n\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\tlog.Printf(\"Leader Commit Index: %v\", commitIndex)\n\n\t\t\t\t\t\t\t//Applying commands to State Machine for Leader\n\t\t\t\t\t\t\tif commitIndex > lastApplied {\n\t\t\t\t\t\t\t\tlog.Printf(\"Applying the following commands to State Machine for Leader\")\n\t\t\t\t\t\t\t\tprintLogs(logs[lastApplied:commitIndex])\n\n\t\t\t\t\t\t\t\tfor _, logEntry := range logs[lastApplied:commitIndex] {\n\t\t\t\t\t\t\t\t\top, ok := indexToOp[logEntry.Index]\n\n\t\t\t\t\t\t\t\t\tif !ok { //Command had come from other earlier leader and not client\n\t\t\t\t\t\t\t\t\t\ts.HandleCommandFollower(logEntry.Cmd)\n\t\t\t\t\t\t\t\t\t} else { //Command is from client\n\t\t\t\t\t\t\t\t\t\ts.HandleCommand(op)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlog.Printf(\"Updating LastApplied %v to CommitIndex %v\", lastApplied, commitIndex)\n\t\t\t\t\t\t\t\tlastApplied = commitIndex\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else { //Need to decrement nextIndex since\n\t\t\t\t\t\t\tlog.Printf(\"Decrementing nextIndex for Leader\")\n\t\t\t\t\t\t\tnextIndex[ar.peer] = nextIndex[ar.peer] - 1\n\n\t\t\t\t\t\t\tif nextIndex[ar.peer] < 1 {\n\t\t\t\t\t\t\t\tlog.Printf(\"nextIndex less than 1. Shouldn't have happened. Resetting to 1\")\n\t\t\t\t\t\t\t\tnextIndex[ar.peer] = 1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else { //Receiving Append response for Stale Term\n\t\t\t\t\tlog.Printf(\"Do Nothing. Received append response for stale term. My term: %v. Appender term: %v\", currentTerm, ar.ret.Term)\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n\tlog.Printf(\"Strange to arrive here\")\n}", "title": "" }, { "docid": "b14714690c90f713ab03176b67d63582", "score": "0.50180364", "text": "func (a *AdsServer) FetchRoutes(context.Context, *xdsapi.DiscoveryRequest) (*xdsapi.DiscoveryResponse, error) {\n\treturn &xdsapi.DiscoveryResponse{}, fmt.Errorf(\"Unimplemented\")\n}", "title": "" }, { "docid": "6355d1b9d74e6cc04c5cf8553c514bdc", "score": "0.50120723", "text": "func tbnRedirectToEnvoyRoutes(domain tbnapi.Domain) []*envoyroute.Route {\n\troutes := []*envoyroute.Route{}\n\tfor _, redirect := range domain.Redirects {\n\t\turl, err := url.Parse(redirect.To)\n\t\tif err != nil {\n\t\t\tconsole.Error().Printf(\n\t\t\t\t\"Invalid Redirect destination for Domain[%s:%d], Redirect[%s]\",\n\t\t\t\tdomain.Name,\n\t\t\t\tdomain.Port,\n\t\t\t\tredirect.Name,\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar responseCode envoyroute.RedirectAction_RedirectResponseCode\n\t\tswitch redirect.RedirectType {\n\t\tcase tbnapi.TemporaryRedirect:\n\t\t\tresponseCode = envoyroute.RedirectAction_TEMPORARY_REDIRECT\n\t\tcase tbnapi.PermanentRedirect:\n\t\t\tresponseCode = envoyroute.RedirectAction_MOVED_PERMANENTLY\n\t\t}\n\n\t\tredirectHost := url.Hostname()\n\t\tif redirectHost == \"$host\" {\n\t\t\tredirectHost = domain.Name\n\t\t}\n\n\t\tpath := url.EscapedPath()\n\t\tif url.Fragment != \"\" {\n\t\t\tpath += \"#\" + url.Fragment\n\t\t}\n\n\t\tredirectAction := &envoyroute.RedirectAction{\n\t\t\tHostRedirect: scrubCaptureGroups(redirectHost),\n\t\t\tResponseCode: responseCode,\n\t\t}\n\t\tif url.Scheme == \"https\" {\n\t\t\tredirectAction.SchemeRewriteSpecifier = &envoyroute.RedirectAction_HttpsRedirect{\n HttpsRedirect: true,\n }\n\t\t}\n\n\t\tpathRewrite := scrubCaptureGroups(path)\n\t\tif pathRewrite != \"\" {\n\t\t\tredirectAction.PathRewriteSpecifier = &envoyroute.RedirectAction_PathRedirect{\n\t\t\t\tPathRedirect: pathRewrite,\n\t\t\t}\n\t\t}\n\n\t\troute := envoyroute.Route{\n\t\t\tMatch: &envoyroute.RouteMatch{\n\t\t\t\tPathSpecifier: &envoyroute.RouteMatch_Regex{Regex: redirect.From},\n\t\t\t\tCaseSensitive: boolValue(false),\n\t\t\t\tHeaders: toEnvoyHeaderMatcher(domain, redirect),\n\t\t\t},\n\t\t\tAction: &envoyroute.Route_Redirect{\n\t\t\t\tRedirect: redirectAction,\n\t\t\t},\n\t\t}\n\n\t\troutes = append(routes, &route)\n\t}\n\n\treturn routes\n}", "title": "" }, { "docid": "eaa0433541fa18f4960a6b588f85a00f", "score": "0.5010619", "text": "func (g *Gonf) endpointRoutes(w rest.ResponseWriter, _ *rest.Request) {\n\tw.WriteJson(g.Routes())\n}", "title": "" }, { "docid": "33596ee4b22006cf5587763c8fe87882", "score": "0.5008476", "text": "func getRoutes(cidrs []string) ([]string, error) {\n\tvar (\n\t\troutes []string\n\t\thasV4, hasV6 bool\n\t)\n\tfor _, c := range cidrs {\n\t\t_, cidr, err := net.ParseCIDR(c)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif cidr.IP.To4() != nil {\n\t\t\thasV4 = true\n\t\t} else {\n\t\t\thasV6 = true\n\t\t}\n\t}\n\tif hasV4 {\n\t\troutes = append(routes, zeroCIDRv4)\n\t}\n\tif hasV6 {\n\t\troutes = append(routes, zeroCIDRv6)\n\t}\n\treturn routes, nil\n}", "title": "" }, { "docid": "5d82fc5e84fc9576b54424ad071633c0", "score": "0.50050354", "text": "func (e *Engine) PrintRawAllRoutes() {\n\tif len(e.routeStore.routeSlice) == 0 {\n\t\tfmt.Printf(\"%s\\n\", \"no route\")\n\t\treturn\n\t}\n\n\tfor _, v := range e.routeStore.routeSlice {\n\t\t// count(router.handlers) + uri\n\t\tfmt.Printf(\"[%-7s : %d] %s\\n\", v.method, len(v.handlers), v.uri)\n\t}\n}", "title": "" }, { "docid": "19009239adc6c567e28fcadd1e46715f", "score": "0.50049704", "text": "func (r route) asIds() []nodeID {\n\tnodeCount := len(r.Nodes)\n\tlist := make([]nodeID, nodeCount)\n\n\tfor i := 0; i < nodeCount; i++ {\n\t\tlist[i] = r.Nodes[nodeCount-1-i].ID\n\t}\n\n\t// fmt.Printf(\"Route: %v\\n,Nodecount: %d\\nList: %v\\n\", r, nodeCount, list)\n\treturn list\n}", "title": "" }, { "docid": "b29f03d2c46c5dbab17025d2b8dab52d", "score": "0.49947298", "text": "func (fh *FileHandle) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {\n\n\trn := fh.RemoteNode\n\n\tzap.L().Debug(\"ReadDir FS Request\",\n\t\tzap.String(\"op\", \"readdir\"),\n\t\tzap.String(\"address\", rn.RemotePath.Address()),\n\t\tzap.String(\"path\", rn.RemotePath.Path),\n\t)\n\n\t// Get Files from Remote Directory\n\t// Populate Directory Accordingly\n\n\treq := &ReadDirInfo{\n\t\tPath: rn.RemotePath.Path,\n\t\tFileDescriptor: fh.FileDescriptor,\n\t}\n\n\tresp := Talker().sendRequest(ReadDirRequest, rn.RemotePath.Hostname, req)\n\n\tvar children []fuse.Dirent\n\t//rn.RemoteNodes = make(map[string] *RemoteNode)\n\n\tvar err error\n\tif respError, ok := resp.Data.(Error); !ok {\n\n\t\tfiles := resp.Data.(*DirInfo).Stats\n\n\t\tzap.L().Debug(\"ReadDir Response From Agent\",\n\t\t\tzap.String(\"op\", \"readdir\"),\n\t\t\tzap.String(\"address\", rn.RemotePath.Address()),\n\t\t\tzap.String(\"path\", rn.RemotePath.Path),\n\t\t\tzap.Int(\"size\", len(files)),\n\t\t)\n\n\t\tnewRns := cmap.New()\n\n\t\tfor _, file := range files {\n\n\t\t\ts := file\n\n\t\t\tzap.L().Debug(\"ReadDir File Response\",\n\t\t\t\tzap.String(\"op\", \"readdir\"),\n\t\t\t\tzap.String(\"address\", rn.RemotePath.Address()),\n\t\t\t\tzap.String(\"path\", path.Join(rn.RemotePath.Path, s.Name)),\n\t\t\t\tzap.Int64(\"size\", s.Size),\n\t\t\t\tzap.String(\"mode\", s.Mode.String()),\n\t\t\t\tzap.Time(\"mtime\", time.Unix(0, s.ModTime)),\n\t\t\t)\n\n\t\t\tvar child fuse.Dirent\n\t\t\tif s.IsDir {\n\t\t\t\tchild = fuse.Dirent{Type: fuse.DT_Dir, Name: s.Name}\n\t\t\t} else {\n\t\t\t\tchild = fuse.Dirent{Type: fuse.DT_File, Name: s.Name}\n\t\t\t}\n\t\t\tchildren = append(children, child)\n\n\t\t\tval, ok := rn.RemoteNodes.Get(s.Name)\n\n\t\t\tvar newRn *RemoteNode\n\n\t\t\tif !ok {\n\t\t\t\tnewRn = rn.generateChildRemoteNode(s.Name, s.IsDir)\n\t\t\t} else {\n\t\t\t\tnewRn = val.(*RemoteNode)\n\t\t\t\tFuseServer().InvalidateNodeData(newRn)\n\t\t\t}\n\n\t\t\tmtime := time.Unix(0, s.ModTime)\n\n\t\t\tif ok && mtime != newRn.Mtime {\n\t\t\t\tHoarder().CacheFetch(rn.RemotePath)\n\t\t\t}\n\n\t\t\tnewRn.Size = uint64(s.Size)\n\t\t\tnewRn.Mode = s.Mode\n\t\t\tnewRn.Mtime = mtime\n\t\t\tnewRn.IsCached = true\n\n\t\t\tnewRns.Set(s.Name, newRn)\n\t\t\t//rn.RemoteNodes[s.Name] = newRn\n\n\t\t}\n\n\t\t//TODO Might be fishy (Atomic?)\n\t\trn.RemoteNodes = &newRns\n\n\t\treturn children, nil\n\n\t} else {\n\t\terr = respError.Err\n\n\t\tzap.L().Warn(\"ReadDir Error Response\",\n\t\t\tzap.String(\"op\", \"readdir\"),\n\t\t\tzap.String(\"address\", rn.RemotePath.Address()),\n\t\t\tzap.String(\"path\", rn.RemotePath.Path),\n\t\t\tzap.Error(err),\n\t\t)\n\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "0b28413076fbd8933432ab0a30d40ee7", "score": "0.49940562", "text": "func routes(w *web.Web) {\n\tw.Handle(\"GET\", \"/v1/version\", handlers.Version.List)\n\n\tw.Handle(\"GET\", \"/v1/script\", handlers.Script.List)\n\tw.Handle(\"PUT\", \"/v1/script\", handlers.Script.Upsert)\n\tw.Handle(\"GET\", \"/v1/script/:name\", handlers.Script.Retrieve)\n\tw.Handle(\"DELETE\", \"/v1/script/:name\", handlers.Script.Delete)\n\n\tw.Handle(\"GET\", \"/v1/query\", handlers.Query.List)\n\tw.Handle(\"PUT\", \"/v1/query\", handlers.Query.Upsert)\n\tw.Handle(\"GET\", \"/v1/query/:name\", handlers.Query.Retrieve)\n\tw.Handle(\"DELETE\", \"/v1/query/:name\", handlers.Query.Delete)\n\n\tw.Handle(\"PUT\", \"/v1/index/:name\", handlers.Query.EnsureIndexes)\n\n\tw.Handle(\"GET\", \"/v1/regex\", handlers.Regex.List)\n\tw.Handle(\"PUT\", \"/v1/regex\", handlers.Regex.Upsert)\n\tw.Handle(\"GET\", \"/v1/regex/:name\", handlers.Regex.Retrieve)\n\tw.Handle(\"DELETE\", \"/v1/regex/:name\", handlers.Regex.Delete)\n\n\tw.Handle(\"GET\", \"/v1/mask\", handlers.Mask.List)\n\tw.Handle(\"PUT\", \"/v1/mask\", handlers.Mask.Upsert)\n\tw.Handle(\"GET\", \"/v1/mask/:collection/:field\", handlers.Mask.Retrieve)\n\tw.Handle(\"GET\", \"/v1/mask/:collection\", handlers.Mask.Retrieve)\n\tw.Handle(\"DELETE\", \"/v1/mask/:collection/:field\", handlers.Mask.Delete)\n\n\tw.Handle(\"POST\", \"/v1/exec\", handlers.Exec.Custom)\n\tw.Handle(\"GET\", \"/v1/exec/:name\", handlers.Exec.Name)\n\n\t// Create the Cayley middleware which will only be binded to specific\n\t// endpoints.\n\tcayleym := cayley.Midware(cfg.MustURL(cfgMongoURI))\n\n\t// These endpoints require Cayley, we will add the middleware onto the routes.\n\tw.Handle(\"GET\", \"/v1/exec/:name/view/:view/:item\", handlers.Exec.NameOnView, cayleym)\n\tw.Handle(\"POST\", \"/v1/exec/view/:view/:item\", handlers.Exec.CustomOnView, cayleym)\n\n\tw.Handle(\"GET\", \"/v1/relationship\", handlers.Relationship.List)\n\tw.Handle(\"PUT\", \"/v1/relationship\", handlers.Relationship.Upsert)\n\tw.Handle(\"GET\", \"/v1/relationship/:predicate\", handlers.Relationship.Retrieve)\n\tw.Handle(\"DELETE\", \"/v1/relationship/:predicate\", handlers.Relationship.Delete)\n\n\tw.Handle(\"GET\", \"/v1/view\", handlers.View.List)\n\tw.Handle(\"PUT\", \"/v1/view\", handlers.View.Upsert)\n\tw.Handle(\"GET\", \"/v1/view/:name\", handlers.View.Retrieve)\n\tw.Handle(\"DELETE\", \"/v1/view/:name\", handlers.View.Delete)\n}", "title": "" }, { "docid": "449de9eb4f35bec007b39ceafcfab0a2", "score": "0.49934208", "text": "func generateRoutes(paths []string) []*Route {\n\tdefs := make([]*eskip.Route, len(paths))\n\tfor i, p := range paths {\n\n\t\t// the path for the backend is fine here,\n\t\t// because it is only used for checking the\n\t\t// found routes\n\t\tdefs[i] = &eskip.Route{Id: fmt.Sprintf(\"route%d\", i), Path: p, Backend: p}\n\t}\n\n\troutes, _ := processRouteDefs(Options{}, nil, defs)\n\treturn routes\n}", "title": "" }, { "docid": "26c1a8c200060851ce0c9059f89e4284", "score": "0.49863893", "text": "func (c Client) RetrieveRoutes() []Route {\n\tfmt.Println(\"Retrieving stops\")\n\n\treq, _ := http.NewRequest(\"GET\", baseURL+\"/getroutes\", nil)\n\n\tq := req.URL.Query()\n\tq.Add(\"key\", c.APIKey)\n\tq.Add(\"format\", \"json\")\n\treq.URL.RawQuery = q.Encode()\n\n\tresp, httpDoErr := c.httpclient.Do(req)\n\tif httpDoErr != nil {\n\t\tfmt.Println(httpDoErr)\n\t\treturn []Route{}\n\t}\n\tdefer resp.Body.Close()\n\n\tparsed := busTimeRoutesResponse{}\n\terr := json.NewDecoder(resp.Body).Decode(&parsed)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn parsed.RoutesList.Routes\n}", "title": "" }, { "docid": "5ab16cb22499a6b3634054764c555d4d", "score": "0.49851313", "text": "func regisiterRoutes(app iris.Party, route Route) {\n\tif route.Method == \"Party\" {\n\t\t// judge exiest middleware,protecet from err\n\t\tappParty := *new(iris.Party)\n\t\tif route.HandlerFunc == nil {\n\t\t\tappParty = app.Party(route.Pattern)\n\t\t} else {\n\t\t\tappParty = app.Party(route.Pattern, route.HandlerFunc)\n\t\t}\n\t\tfor _, routeItem := range route.Routes {\n\t\t\tregisiterRoutes(appParty, routeItem)\n\t\t}\n\t} else {\n\t\tapp.Handle(route.Method, route.Pattern, route.HandlerFunc)\n\t}\n}", "title": "" }, { "docid": "490916741e5bea704fdbf4851e0fe728", "score": "0.49849012", "text": "func (r *raftRouter) Routes() []router.Route {\n\treturn r.routes\n}", "title": "" }, { "docid": "769d641af743aedf88738932b3e0eff0", "score": "0.4972472", "text": "func (r *checkpointRouter) Routes() []router.Route {\n\treturn r.routes\n}", "title": "" }, { "docid": "d3f47cf7d75039fecf39e9417fc7261e", "score": "0.49681595", "text": "func GetAllEndpoints() map[string] HandlerFunc {\r\n\treturn endpoints\r\n}", "title": "" }, { "docid": "24e1bddd0055c321196a724066211f9a", "score": "0.49595338", "text": "func retrieveRouterData(ch chan map[string]string, client *routeros.Client) {\n\tlog.Info(\"Retrieving router's static DNS entries.\")\n\targs := []routeros.Pair{*routeros.NewPair(\"comment\", \"adishe\")}\n\tparams := []string{\".id\", \"name\"}\n\tres, err := client.Query(\"/ip/dns/static/print\", routeros.Query{Op: \"=\", Pairs: args, Proplist: params})\n\tif err != nil {\n\t\tlog.Critical(err)\n\t\tpanic(err)\n\t}\n\n\trouterMap := make(map[string]string)\n\tfor _, val := range res.SubPairs {\n\t\trouterMap[val[\"name\"]] = val[\".id\"]\n\t}\n\n\tch <- routerMap\n\tlog.Info(\"Router's static DNS entries has been retrieved.\")\n}", "title": "" }, { "docid": "5845f901a61ec77b2d8a2e057c104fec", "score": "0.49568763", "text": "func (hn *httpPatternTrieNode) traverse(result *MethodSlice) {\n\tappendMethodOnCurrentNode := func() {\n\n\t\t// Sort the method in alphabet order to generate deterministic sequence for better unit testing.\n\t\tvar sortedKeys []string\n\t\t// Put the wildcard method in the end.\n\t\tvar wildMethodResult *lookupResult\n\t\tfor key, val := range hn.ResultMap {\n\t\t\tif key == HttpMethodWildCard {\n\t\t\t\twildMethodResult = val\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsortedKeys = append(sortedKeys, key)\n\t\t}\n\t\tsort.Strings(sortedKeys)\n\n\t\tfor _, key := range sortedKeys {\n\t\t\tif val, ok := hn.ResultMap[key]; ok {\n\t\t\t\tresult.AppendMethod(val.data.Method)\n\t\t\t}\n\t\t}\n\n\t\t// Put the wildcard method in the end.\n\t\tif wildMethodResult != nil {\n\t\t\tresult.AppendMethod(wildMethodResult.data.Method)\n\t\t}\n\n\t}\n\n\ttraverseChildren := func() {\n\t\tvar singleParameterChild *httpPatternTrieNode\n\t\tvar singleWildCardChild *httpPatternTrieNode\n\t\tvar doubleWildCardChild *httpPatternTrieNode\n\t\tvar exactMatchChildKeys []string\n\t\tfor key, child := range hn.Children {\n\t\t\tswitch key {\n\t\t\tcase SingleParameterKey:\n\t\t\t\tsingleParameterChild = child\n\t\t\tcase SingleWildCardKey:\n\t\t\t\tsingleWildCardChild = child\n\t\t\tcase DoubleWildCardKey:\n\t\t\t\tdoubleWildCardChild = child\n\t\t\tdefault:\n\t\t\t\texactMatchChildKeys = append(exactMatchChildKeys, key)\n\t\t\t}\n\t\t}\n\n\t\t// Visit exact match children first.\n\t\t// Sort the child keys to generate deterministic sequence for better unit testing.\n\t\tsort.Strings(exactMatchChildKeys)\n\t\tfor _, key := range exactMatchChildKeys {\n\t\t\tif child, ok := hn.Children[key]; ok {\n\t\t\t\tchild.traverse(result)\n\t\t\t}\n\t\t}\n\n\t\t// Visit vague match children after.\n\t\tfor _, child := range []*httpPatternTrieNode{singleParameterChild, singleWildCardChild, doubleWildCardChild} {\n\t\t\tif child != nil {\n\t\t\t\tchild.traverse(result)\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the current node is wildcard(**), its children has higher priority.\n\t// For the wildcard case, it is necessary to traverse children then collect\n\t// the current node.\n\t// ex. /**/a\n\t// /**\n\t//\n\t// For the non-wildcard, it is necessary to collect the current node then\n\t// traver children.\n\t// ex. /a\n\t// /a/b\n\tif hn.WildCard {\n\t\t// Pre-order traverse.\n\t\ttraverseChildren()\n\t\t// Post-order traverse.\n\t\tappendMethodOnCurrentNode()\n\t} else {\n\t\tappendMethodOnCurrentNode()\n\t\ttraverseChildren()\n\t}\n}", "title": "" }, { "docid": "67607461c56f988a054786f7cb59dd8e", "score": "0.4952641", "text": "func (a* ApiEngine) GenerateAPIRoutesForCluster() {\n\tenv.Output.WriteChDebug(\"(ApiEngine::GenerateAPIRoutesForCluster)\")\n\ta.AddRoute(ui.GenerateRoute(\"allchecks\",\"GET\",\"/api/cluster\",apiWriter(GetCluster)))\n\ta.AddRoute(ui.GenerateRoute(\"allchecks\",\"PUT\",\"/api/cluster\",PutCluster))\n\ta.AddRoute(ui.GenerateRoute(\"allchecks\",\"GET\",\"/api/cluster/nodes\",apiWriter(GetClusterNodes)))\n\ta.AddRoute(ui.GenerateRoute(\"allchecks\",\"GET\",\"/api/cluster/services\",apiWriter(GetClusterServices)))\n}", "title": "" }, { "docid": "0eb5239fa8823c4489ded1abf5078110", "score": "0.49525782", "text": "func InitAllRoutes(router *gin.Engine) {\n\t// Initialises /v1 routes\n\troutesV1.InitV1Routes(router)\n}", "title": "" }, { "docid": "f46d9b4ff1dd5ecd42ee764f5fe68e7a", "score": "0.49523976", "text": "func (s *Server) SetupRoutes() {\n\n}", "title": "" }, { "docid": "6ee8d452497b977c1b03ca9d47dd5731", "score": "0.49481046", "text": "func (registry *Etcd) WatchRoutes(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {\n\tif !label.Empty() {\n\t\treturn nil, fmt.Errorf(\"label selectors are not supported on routes yet\")\n\t}\n\tif value, found := field.RequiresExactMatch(\"ID\"); found {\n\t\treturn registry.Watch(makeRouteKey(value), resourceVersion), nil\n\t}\n\tif field.Empty() {\n\t\treturn registry.WatchList(\"/routes\", resourceVersion, tools.Everything)\n\t}\n\treturn nil, fmt.Errorf(\"only the 'ID' and default (everything) field selectors are supported\")\n}", "title": "" }, { "docid": "aea3344f763b8caf9966a00e12565ae9", "score": "0.4946586", "text": "func (self *SVpc) getRouteTables() ([]SRouteTable, error) {\n\t// every Vpc has two route table in Huawei Cloud\n\trouteTableIp := NewSRouteTable(self, ROUTE_TYPR_IP)\n\trouteTablePeer := NewSRouteTable(self, ROUTE_TYPE_PEER)\n\tif err := routeTableIp.fetchRoutesForIP(); err != nil {\n\t\treturn nil, errors.Wrap(err, `get route table whilc type is \"ip\" error`)\n\t}\n\tif err := routeTablePeer.fetchRoutesForPeer(); err != nil {\n\t\treturn nil, errors.Wrap(err, `get route table whilc type is \"peering\" error`)\n\t}\n\tret := make([]SRouteTable, 0, 2)\n\tif len(routeTableIp.Routes) != 0 {\n\t\tret = append(ret, routeTableIp)\n\t}\n\tif len(routeTablePeer.Routes) != 0 {\n\t\tret = append(ret, routeTablePeer)\n\t}\n\treturn ret, nil\n}", "title": "" } ]
83f92099abf41a4fa575ef84835bd525
A list of associated security group IDS.
[ { "docid": "3526d109884799eb1489d70032b969ad", "score": "0.5377573", "text": "func (o LaunchConfigurationOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *LaunchConfiguration) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "title": "" } ]
[ { "docid": "f5ce78f2f8a81e7453807c9e7c344651", "score": "0.6817801", "text": "func (o ApplicationNetworkConfigurationOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v ApplicationNetworkConfiguration) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "8b446ccaf4097180f6df792256a1fe27", "score": "0.678904", "text": "func (o EndpointOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Endpoint) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "f6476921e37363ea106791da39b48cc4", "score": "0.6782932", "text": "func (o EnvironmentNetworkConfigurationOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v EnvironmentNetworkConfiguration) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "894d0e12b28357ca3cdb0db60374f556", "score": "0.6669402", "text": "func (m *MCIRApi) ListSecurityGroupId(doc string) (string, error) {\n\tif m.requestMCIR == nil {\n\t\treturn \"\", errors.New(\"The Open() function must be called\")\n\t}\n\n\tm.requestMCIR.InData = doc\n\treturn m.requestMCIR.ListSecurityGroupId()\n}", "title": "" }, { "docid": "6ef5c4401ab51f83236854f87c099330", "score": "0.6618478", "text": "func (o FileCacheOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *FileCache) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "4651251e5dc0c6dac19929287d4cd549", "score": "0.6590852", "text": "func (o ApplicationNetworkConfigurationPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *ApplicationNetworkConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "5ff979710e3268b1b4a71cefa4e0cd47", "score": "0.65597284", "text": "func (o CanaryVpcConfigOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v CanaryVpcConfig) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "7ff69636a1ad13176dca0ca5a5833826", "score": "0.6544131", "text": "func (o EnvironmentNetworkConfigurationPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *EnvironmentNetworkConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "eac5aa5faa5d0bdd9207fef68c22c0cf", "score": "0.6490278", "text": "func (o WorkspaceVpcConfigurationOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v WorkspaceVpcConfiguration) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "807b5addc192141fe953154d4ad60d06", "score": "0.6461844", "text": "func (o InputVpcOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v InputVpc) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "b64031a00ba9333db940f509f8688923", "score": "0.64277864", "text": "func (o VpcEndpointOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *VpcEndpoint) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "62f7d2e1d97f959bdd6bfe2bbfa5b704", "score": "0.6417485", "text": "func (o HostVpcConfigurationOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v HostVpcConfiguration) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "680e79124fe6feea35fe43871b575d41", "score": "0.6335206", "text": "func (o CanaryVpcConfigPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *CanaryVpcConfig) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "79624474a6ee2e5e468b8d1d79cc0e16", "score": "0.6318309", "text": "func (o InputVpcPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *InputVpc) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "92788d2c76ce5420fa421cabd074db97", "score": "0.6292238", "text": "func (o PipelineVpcOptionsOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v PipelineVpcOptions) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "4146be5ab8b4dc0469bb81edae164cc4", "score": "0.62911326", "text": "func (o PipelineVpcOptionsPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *PipelineVpcOptions) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "c5d8699d776d3de667e5dc0bcf92674e", "score": "0.62805295", "text": "func wrappedGroupIds(osUser *user.User) ([]string, error) {\n return osUser.GroupIds()\n}", "title": "" }, { "docid": "7cf0237353d39749c67bcf6a5729f8ef", "score": "0.6276334", "text": "func (o WorkspaceVpcConfigurationPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *WorkspaceVpcConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "905d67d033ef0a94b8520fb167b2264c", "score": "0.6208777", "text": "func (o LookupVpcEndpointResultOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v LookupVpcEndpointResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "b9211f518f9b6f51a1fa38d88f4b6c3d", "score": "0.6198979", "text": "func findSecurityGroups(ctx context.Context, rdsCli *rds.RDS, instanceID string) ([]string, error) {\n\tdesc, err := rdsCli.DescribeDBInstances(ctx, instanceID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar sgIDs []string\n\tfor _, vpc := range desc.DBInstances[0].VpcSecurityGroups {\n\t\tsgIDs = append(sgIDs, *vpc.VpcSecurityGroupId)\n\t}\n\treturn sgIDs, err\n}", "title": "" }, { "docid": "de0f7e5882d3d0dbdd840b6a5438b87c", "score": "0.61670524", "text": "func (o HostVpcConfigurationPtrOutput) SecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *HostVpcConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroupIds\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "6fd573476070537f02367bc7d49b755f", "score": "0.61180454", "text": "func (opts *InstanceOptions) DetermineSecurityGroupIDs() ([]*string, error) {\n\tvar securityGroupIds []*string\n\n\t// if we already have an IDs, their pointer\n\tfor _, id := range opts.SecurityGroupIDs {\n\t\tsecurityGroupIds = append(securityGroupIds, &id)\n\t}\n\n\tif len(opts.SecurityGroupFilters) < 1 && len(opts.SecurityGroups) < 1 {\n\t\treturn securityGroupIds, nil\n\t}\n\n\tvar filters []*ec2.Filter\n\n\t// if filters are set, find and return AMI by filters\n\tfor _, filter := range opts.SecurityGroupFilters {\n\t\ts := strings.SplitN(filter, \"=\", 2)\n\t\tif len(s) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"unable to derive filter from: %s\", filter)\n\t\t}\n\n\t\tfilters = append(filters, &ec2.Filter{\n\t\t\tName: aws.String(s[0]),\n\t\t\tValues: aws.StringSlice(strings.Split(s[1], \",\")),\n\t\t})\n\t}\n\n\tif len(opts.SecurityGroups) > 0 {\n\t\tfilters = append(filters, &ec2.Filter{\n\t\t\tName: aws.String(\"group-name\"),\n\t\t\tValues: aws.StringSlice(opts.SecurityGroups),\n\t\t})\n\t}\n\n\tresult, err := ec2Svc.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{\n\t\tFilters: filters,\n\t})\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unable to find AMI: %s\", err)\n\t}\n\n\tif len(result.SecurityGroups) < 1 {\n\t\treturn nil, errors.New(\"no security groups found matching your filters\")\n\t}\n\n\tfor _, id := range result.SecurityGroups {\n\t\tsecurityGroupIds = append(securityGroupIds, id.GroupId)\n\t}\n\n\treturn securityGroupIds, nil\n}", "title": "" }, { "docid": "7c94c26a6d828a39f5c268b419ff4a52", "score": "0.6111194", "text": "func UserGroupIds(u *user.User,) ([]string, error)", "title": "" }, { "docid": "245bfca1daf5d4270bd4fcad93fad3c0", "score": "0.59226084", "text": "func (m *MCIRApi) ListSecurityGroupIdByParam(nameSpaceID string) (string, error) {\n\tif m.requestMCIR == nil {\n\t\treturn \"\", errors.New(\"The Open() function must be called\")\n\t}\n\n\tholdType, _ := m.GetInType()\n\tm.SetInType(\"json\")\n\tm.requestMCIR.InData = `{\"nsId\":\"` + nameSpaceID + `\", \"resourceType\":\"securityGroup\"}`\n\tresult, err := m.requestMCIR.ListSecurityGroupId()\n\tm.SetInType(holdType)\n\n\treturn result, err\n}", "title": "" }, { "docid": "829618bfec6f2c95298f151d5589ab73", "score": "0.58651024", "text": "func (o *CreateVmGroupRequest) GetSecurityGroupIds() []string {\n\tif o == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\n\treturn o.SecurityGroupIds\n}", "title": "" }, { "docid": "d37fc69a132a509bb936eed4e3e68422", "score": "0.5814034", "text": "func (o *InlineObject24) GetGroupIds() []string {\n\tif o == nil || o.GroupIds == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn *o.GroupIds\n}", "title": "" }, { "docid": "6fbd8a58e27b0fbbfc51e94fe70773c9", "score": "0.57514334", "text": "func FlattenSecurityGroups(list []*ec2.UserIdGroupPair, ownerId *string) []*GroupIdentifier {\n\tresult := make([]*GroupIdentifier, 0, len(list))\n\tfor _, g := range list {\n\t\tvar userId *string\n\t\tif aws.StringValue(g.UserId) != \"\" && (ownerId == nil || aws.StringValue(ownerId) != aws.StringValue(g.UserId)) {\n\t\t\tuserId = g.UserId\n\t\t}\n\t\t// userid nil here for same vpc groups\n\n\t\tvpc := aws.StringValue(g.GroupName) == \"\"\n\t\tvar id *string\n\t\tif vpc {\n\t\t\tid = g.GroupId\n\t\t} else {\n\t\t\tid = g.GroupName\n\t\t}\n\n\t\t// id is groupid for vpcs\n\t\t// id is groupname for non vpc (classic)\n\n\t\tif userId != nil {\n\t\t\tid = aws.String(*userId + \"/\" + *id)\n\t\t}\n\n\t\tif vpc {\n\t\t\tresult = append(result, &GroupIdentifier{\n\t\t\t\tGroupId: id,\n\t\t\t\tDescription: g.Description,\n\t\t\t})\n\t\t} else {\n\t\t\tresult = append(result, &GroupIdentifier{\n\t\t\t\tGroupId: g.GroupId,\n\t\t\t\tGroupName: id,\n\t\t\t\tDescription: g.Description,\n\t\t\t})\n\t\t}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "048e489f9715ee947b695f88b4e3b039", "score": "0.5728367", "text": "func (g *groups) List() ([]string, error) {\n\tres, err := g.c.baseRequest(http.MethodGet, routes.groups, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar r groupListResponse\n\tres.JSON(&r)\n\treturn r.Ocs.Data.Groups, nil\n}", "title": "" }, { "docid": "086c715c630a9d81952c5de439eb1cb9", "score": "0.56402105", "text": "func GetAPIGroupList(c *gin.Context) {\n\tg := app.Gin{C: c}\n\n\t// instancing dynamic client\n\tcontext := lang.NVL(g.C.Param(\"CLUSTER\"), config.Value.CurrentContext)\n\tdiscoveryClient, err := discovery.NewDiscoveryClientForConfig(config.Value.KubeConfigs[context])\n\tif err != nil {\n\t\tg.SendMessage(http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\tgroups, err := discoveryClient.ServerGroups()\n\tif err != nil {\n\t\tg.SendMessage(http.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\tg.Send(http.StatusOK, groups)\n\n}", "title": "" }, { "docid": "d5dacf19a299f93d36fa01c74fff0f21", "score": "0.56212634", "text": "func (m *SecurityGroupEvidence) GetSecurityGroupId()(*string) {\n val, err := m.GetBackingStore().Get(\"securityGroupId\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "a423789c311efc1b525bef0db33da686", "score": "0.5607389", "text": "func (o DbProxyOutput) VpcSecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *DbProxy) pulumi.StringArrayOutput { return v.VpcSecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "be66e6590d8253274b5b07a2fb60426e", "score": "0.5606636", "text": "func (o GetSlsGroupsGroupOutput) Id() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetSlsGroupsGroup) string { return v.Id }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "73cf2f19fd13764f09a173d8800e7eaa", "score": "0.5597845", "text": "func (e *GroupService) List() (grouplist map[string]string, err error) {\n\terr = e.client.magicRequestDecoder(\"GET\", \"groups\", nil, &grouplist)\n\treturn\n}", "title": "" }, { "docid": "9d9d03e71d612d9e9b758b63b3efe0f7", "score": "0.55973196", "text": "func getProjectSFIDList(groups []*v1ProjectsCLAGroups.ProjectClaGroup) []string {\n\tvar response []string\n\tfor _, projectCLAGroup := range groups {\n\t\tresponse = append(response, projectCLAGroup.ProjectSFID)\n\t}\n\treturn response\n}", "title": "" }, { "docid": "0122741285909a8810646f5e24b4f435", "score": "0.5573993", "text": "func (client IdentityClient) ListGroups(ctx context.Context, request ListGroupsRequest) (response ListGroupsResponse, err error) {\n\thttpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, \"/groups/\", request)\n\tif err != nil {\n\t\treturn\n\t}\n\n\thttpResponse, err := client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn\n}", "title": "" }, { "docid": "759a8f83d1cc5578fa122de6e50ff273", "score": "0.5559081", "text": "func (o SecGroupRuleOutput) SecurityGroupId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *SecGroupRule) pulumi.StringOutput { return v.SecurityGroupId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "a993aebc08a090ac0b7166af4ef2fb90", "score": "0.5553713", "text": "func (o ContainerGroupOutput) SecurityGroupId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *ContainerGroup) pulumi.StringOutput { return v.SecurityGroupId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "179e5d846aab3108bb40dd54e7b63d53", "score": "0.55397785", "text": "func (o FunctionOutput) ReplacementSecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Function) pulumi.StringArrayOutput { return v.ReplacementSecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "25a7d408ecfa53d3110c5289115e966f", "score": "0.5529973", "text": "func getSecurityGroupWithInstanceIdUrl(instanceId string) string {\n\treturn URI_PREFIX + REQUEST_DDC_SECURITYGROUP_URL + \"/\" + instanceId + \"/list\"\n}", "title": "" }, { "docid": "d3606b80a05839a9f7054f4da496539d", "score": "0.5518511", "text": "func (s *SecurityService) ListGroups(ctx context.Context) (*[]GroupDetails, *http.Response, error) {\n\tpath := \"/api/security/groups\"\n\treq, err := s.client.NewRequest(\"GET\", path, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeGroups)\n\n\tgroups := new([]GroupDetails)\n\tresp, err := s.client.Do(ctx, req, groups)\n\treturn groups, resp, err\n}", "title": "" }, { "docid": "c7117b7d21fa2934a16c45b665f9035c", "score": "0.5509308", "text": "func (m *Device) GetAlternativeSecurityIds()([]AlternativeSecurityIdable) {\n return m.alternativeSecurityIds\n}", "title": "" }, { "docid": "5b96b4546b010545d23a5d3f289df1f8", "score": "0.5490827", "text": "func groupIDs(u *user.User) ([]string, error) {\n\tlogrus.Infof(\"Performing slow lookup of group ids for %s\", u.Username)\n\n\t// user can have no gid if it's a non existing user\n\tif u.Gid == \"\" {\n\t\treturn []string{}, nil\n\t}\n\n\tf, err := os.Open(groupFile)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"open\")\n\t}\n\tdefer f.Close()\n\n\tgids := []string{u.Gid}\n\n\tfor _, g := range localGroups(f) {\n\t\tfor _, m := range g.members {\n\t\t\tif m == u.Username {\n\t\t\t\tgids = append(gids, g.id)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn gids, nil\n}", "title": "" }, { "docid": "fd589683e18d91b8666e70509e825f96", "score": "0.5489491", "text": "func Getgroups() (gids []int, err error) {\n\tn, err := getgroups(0, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif n == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Sanity check group count. Max is 16 on BSD.\n\tif n < 0 || n > 1000 {\n\t\treturn nil, EINVAL\n\t}\n\n\ta := make([]_Gid_t, n)\n\tn, err = getgroups(n, &a[0])\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgids = make([]int, n)\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn\n}", "title": "" }, { "docid": "6f964695d091dc71456ee70d833ac198", "score": "0.54712945", "text": "func (s *HostListener) ListSecurityGroups(inctx context.Context, in *protocol.SecurityGroupHostBindRequest) (_ *protocol.SecurityGroupBondsResponse, err error) {\n\tdefer fail.OnExitConvertToGRPCStatus(inctx, &err)\n\tdefer fail.OnExitWrapError(inctx, &err, \"cannot list security group on host\")\n\tdefer fail.OnPanic(&err)\n\n\tif s == nil {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\tif in == nil {\n\t\treturn nil, fail.InvalidParameterError(\"in\", \"cannot be nil\")\n\t}\n\tif inctx == nil {\n\t\treturn nil, fail.InvalidParameterError(\"inctx\", \"cannot be nil\")\n\t}\n\n\thostRef, _ := srvutils.GetReference(in.GetHost())\n\tif hostRef == \"\" {\n\t\treturn nil, fail.InvalidRequestError(\"neither name nor id given as reference of Host\")\n\t}\n\n\tjob, xerr := PrepareJob(inctx, in.GetHost().GetTenantId(), fmt.Sprintf(\"/host/%s/securitygroups/list\", hostRef))\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\tdefer job.Close()\n\n\thandler := handlers.NewHostHandler(job)\n\tbonds, xerr := handler.ListSecurityGroups(hostRef)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tresp := converters.SecurityGroupBondsFromPropertyToProtocol(bonds, \"hosts\")\n\treturn resp, nil\n}", "title": "" }, { "docid": "4ddbdf5bfa4a6758b9e96f5b6773d208", "score": "0.5462395", "text": "func (i *Identity) GroupListById(ctx context.Context, options ...RequestOption) (*Response[map[string]interface{}], error) {\n\trequestModifiers, err := requestOptionsToRequestModifiers(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trequestPath := \"/v1/identity/group/id\"\n\n\trequestQueryParameters := requestModifiers.customQueryParametersOrDefault()\n\trequestQueryParameters.Add(\"list\", \"true\")\n\n\treturn sendRequestParseResponse[map[string]interface{}](\n\t\tctx,\n\t\ti.client,\n\t\thttp.MethodGet,\n\t\trequestPath,\n\t\tnil, // request body\n\t\trequestQueryParameters,\n\t\trequestModifiers,\n\t)\n}", "title": "" }, { "docid": "7009ecb0eb5355feb8a7af7f019dcd6d", "score": "0.5462269", "text": "func Getgroups() (gids []int, errno int) {\n\tn, err := getgroups(0, nil);\n\tif err != 0 {\n\t\treturn nil, errno\n\t}\n\tif n == 0 {\n\t\treturn nil, 0\n\t}\n\n\t// Sanity check group count. Max is 16 on BSD.\n\tif n < 0 || n > 1000 {\n\t\treturn nil, EINVAL\n\t}\n\n\ta := make([]_Gid_t, n);\n\tn, err = getgroups(n, &a[0]);\n\tif err != 0 {\n\t\treturn nil, errno\n\t}\n\tgids = make([]int, n);\n\tfor i, v := range a[0:n] {\n\t\tgids[i] = int(v)\n\t}\n\treturn;\n}", "title": "" }, { "docid": "3ee8e42720b999ff4465137b3b0ecbe4", "score": "0.54572225", "text": "func GetInstanceIdsViaASG() map[string][]string {\n\t// Autoscaling group to instance ids mapping\n\tinsts := make(map[string][]string)\n\n\tfor {\n\t\tasIn := &autoscaling.DescribeAutoScalingInstancesInput{}\n\t\tasOut, err := svcAsg.DescribeAutoScalingInstances(asIn)\n\n\t\tif err != nil {\n\t\t\tutils.ExitWithError(err)\n\t\t}\n\n\t\tfor _, d := range asOut.AutoScalingInstances {\n\t\t\t// If set search context\n\t\t\tif OpsGetInventory.FilterBy == FlagValueFilterByAsgName &&\n\t\t\t\t!strings.Contains(*d.AutoScalingGroupName, OpsGetInventory.FilterValue) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tinsts[*d.AutoScalingGroupName] = append(insts[*d.AutoScalingGroupName], *d.InstanceId)\n\t\t}\n\n\t\tif asOut.NextToken == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn insts\n}", "title": "" }, { "docid": "09878a475a0c3fedc54406d1141f3b2a", "score": "0.5447753", "text": "func List(ctx context.Context, svc iaas.Service, all bool) ([]*abstract.SecurityGroup, fail.Error) {\n\tif ctx == nil {\n\t\treturn nil, fail.InvalidParameterCannotBeNilError(\"ctx\")\n\t}\n\tif svc == nil {\n\t\treturn nil, fail.InvalidParameterCannotBeNilError(\"svc\")\n\t}\n\n\tif all {\n\t\treturn svc.ListSecurityGroups(ctx, \"\")\n\t}\n\n\tisTerraform := false\n\tpn, xerr := svc.GetType()\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\tisTerraform = pn == \"terraform\"\n\n\tsgInstance, xerr := New(svc, isTerraform)\n\tif xerr != nil {\n\t\treturn nil, xerr\n\t}\n\n\tif !isTerraform {\n\t\tvar list []*abstract.SecurityGroup\n\t\txerr = sgInstance.Browse(ctx, func(asg *abstract.SecurityGroup) fail.Error {\n\t\t\tlist = append(list, asg)\n\t\t\treturn nil\n\t\t})\n\t\treturn list, xerr\n\t} else {\n\t\taho, xerr := operations.ListTerraformSGs(ctx, svc)\n\t\tif xerr != nil {\n\t\t\treturn nil, xerr\n\t\t}\n\n\t\tvar stage []*abstract.SecurityGroup\n\n\t\tfor _, v := range aho {\n\t\t\tahf := abstract.NewSecurityGroup()\n\t\t\tahf.Name = v.GetName()\n\t\t\tahf.ID, _ = v.GetID()\n\n\t\t\tstage = append(stage, ahf)\n\t\t}\n\n\t\treturn stage, nil\n\t}\n}", "title": "" }, { "docid": "d4aea516464e2655f7aae4747a76ff2b", "score": "0.5444778", "text": "func (c SecurityGroup) GetId() string {\n\treturn fmt.Sprintf(\"aws_security_group.%s.id\", c.Name)\n}", "title": "" }, { "docid": "d6de857bda736916f1c7ecfef034fae7", "score": "0.5439353", "text": "func (o ReplicationInstanceOutput) VpcSecurityGroupIds() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *ReplicationInstance) pulumi.StringArrayOutput { return v.VpcSecurityGroupIds }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "b06b0ac7d552be97e399756d2982a6e1", "score": "0.54358673", "text": "func (api *API) ListGroupsWithId() ([]byte, error) {\n\tq := `select groupID, userID, firstName, lastName from UserGroup inner join User using (userID) order by groupID asc;`\n\trows := api.executeQuery(q)\n\n\tgroups := make(map[int64]*UserGroupListing)\n\tfor rows.Next() {\n\t\tvar groupID int64\n\t\tvar userID, firstName, lastName string\n\n\t\tif err := rows.Scan(&groupID, &userID, &firstName, &lastName); err == nil {\n\t\t\tif groupListing, ok := groups[groupID]; !ok {\n\t\t\t\tgroup := &UserGroupListing{GroupID: groupID, Users: make([]User, 0)}\n\t\t\t\tgroup.Users = append(group.Users, User{UserID: userID, FullName: fmt.Sprintf(\"%s %s\", firstName, lastName)})\n\t\t\t\tgroups[groupID] = group\n\t\t\t} else {\n\t\t\t\tgroupListing.Users = append(groupListing.Users, User{UserID: userID, FullName: fmt.Sprintf(\"%s %s\", firstName, lastName)})\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Println(err.Error())\n\t\t}\n\t}\n\tdefer rows.Close()\n\treturn json.Marshal(groups)\n}", "title": "" }, { "docid": "f4566ec57e6e0dd4bc848308757508de", "score": "0.54090446", "text": "func (esi Client) GetMarketGroupIds() ([]uint32, error) {\n\tbody, error := esi.get(\"/latest/markets/groups/?datasource=tranquility\")\n\tif error != nil {\n\t\treturn nil, error\n\t}\n\n\tvar groupIds []uint32\n\tif err := json.Unmarshal(body, &groupIds); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groupIds, nil\n}", "title": "" }, { "docid": "3a46adba1f606e935187ebbbd1fd7522", "score": "0.5407238", "text": "func (db *Mongo) getIdentities(session *pbsessions.Session) (identities []string) {\n\n\tidentities = append(identities, session.GetUserId())\n\tfor _, identity := range session.GetGroups() {\n\t\tidentities = append(identities, identity)\n\t}\n\treturn\n\n}", "title": "" }, { "docid": "68c9bb3530c6b9d0ed8d710f2a599ea3", "score": "0.5396625", "text": "func (m *MCIRApi) ListSecurityGroup(doc string) (string, error) {\n\tif m.requestMCIR == nil {\n\t\treturn \"\", errors.New(\"The Open() function must be called\")\n\t}\n\n\tm.requestMCIR.InData = doc\n\treturn m.requestMCIR.ListSecurityGroup()\n}", "title": "" }, { "docid": "78c4058280626dbd2b8c6a741af15e83", "score": "0.5390572", "text": "func FlattenGroupIdentifiers(dtos []*ec2.GroupIdentifier) []string {\n\tids := make([]string, 0, len(dtos))\n\tfor _, v := range dtos {\n\t\tgroup_id := aws.StringValue(v.GroupId)\n\t\tids = append(ids, group_id)\n\t}\n\treturn ids\n}", "title": "" }, { "docid": "a3961ad082e17d4c61aadd30e2a4c84f", "score": "0.53889114", "text": "func (s stack) ListSecurityGroups(ctx context.Context, networkRef string) ([]*abstract.SecurityGroup, fail.Error) {\n\tif valid.IsNil(s) {\n\t\treturn nil, fail.InvalidInstanceError()\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "29a0b898ee11fd36ce988fc31258f4d5", "score": "0.53867126", "text": "func (this *OAuth2Access) Ids() []interface{} {\n\tids := make([]interface{}, 0)\n\tids = append(ids, this.M_id)\n\treturn ids\n}", "title": "" }, { "docid": "7144d0cfdc2a0f6bb2d576d0462bf9a3", "score": "0.5381298", "text": "func (o OceanOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *Ocean) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "85d33d913d60c00b514a63b809e27d90", "score": "0.5375073", "text": "func (c ComputeInstanceV2) Groups() []string {\n\tgroups := c.Primary.Attributes[\"metadata.groups\"]\n\treturn strings.Split(groups, \",\")\n}", "title": "" }, { "docid": "fca77e9c3001da82bee918a10011c030", "score": "0.53583723", "text": "func (r *NetworkInterface) SecurityGroups() pulumi.ArrayOutput {\n\treturn (pulumi.ArrayOutput)(r.s.State[\"securityGroups\"])\n}", "title": "" }, { "docid": "f1f7bc0cbb6befa4e4a39f0f632a91bc", "score": "0.5328758", "text": "func (o NetworkInterfaceOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *NetworkInterface) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "e5968d6df826235fd582b79493325f00", "score": "0.5286262", "text": "func (k KubernetesIdentity) Groups() []string {\n\treturn k.KubernetesGroups\n}", "title": "" }, { "docid": "9f46741d356c97008853a2dd0cf3c890", "score": "0.5275225", "text": "func (gq *GroupQuery) IDs(ctx context.Context) ([]string, error) {\n\tvar ids []string\n\tctx = setContextOp(ctx, gq.ctx, \"IDs\")\n\tif err := gq.Select(group.FieldID).Scan(ctx, &ids); err != nil {\n\t\treturn nil, err\n\t}\n\treturn ids, nil\n}", "title": "" }, { "docid": "c9f89ae08a92461766c0eb99a317eed8", "score": "0.5259684", "text": "func (o LaunchTemplateOutput) SecurityGroupId() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *LaunchTemplate) pulumi.StringPtrOutput { return v.SecurityGroupId }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "0e09eff9d96a1c567e9cd81681e40e0c", "score": "0.5246487", "text": "func (o EventTargetEcsTargetNetworkConfigurationPtrOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v *EventTargetEcsTargetNetworkConfiguration) []string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.SecurityGroups\n\t}).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "15c0bc19f4a80777f695ec7594c53577", "score": "0.5241221", "text": "func (o EventTargetEcsTargetNetworkConfigurationOutput) SecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v EventTargetEcsTargetNetworkConfiguration) []string { return v.SecurityGroups }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "122e1297cbb9c9505c5d98b024f28058", "score": "0.52285486", "text": "func (provider *IdentityProvider) List() ([]idam.Identity, error) {\n\tprovider.lock.RLock()\n\tdefer provider.lock.RUnlock()\n\n\tvar copy []idam.Identity\n\n\tfor _, i := range provider.identities {\n\t\tc, err := copyIdentiy(i)\n\t\tif err == nil {\n\t\t\tcopy = append(copy, c)\n\t\t}\n\t}\n\n\treturn copy, nil\n}", "title": "" }, { "docid": "7310af3f0ab91aae10e145c4ff0faf1a", "score": "0.52231145", "text": "func (id SqlVirtualMachineGroupId) Segments() []resourceids.Segment {\n\treturn []resourceids.Segment{\n\t\tresourceids.StaticSegment(\"staticSubscriptions\", \"subscriptions\", \"subscriptions\"),\n\t\tresourceids.SubscriptionIdSegment(\"subscriptionId\", \"12345678-1234-9876-4563-123456789012\"),\n\t\tresourceids.StaticSegment(\"staticResourceGroups\", \"resourceGroups\", \"resourceGroups\"),\n\t\tresourceids.ResourceGroupSegment(\"resourceGroupName\", \"example-resource-group\"),\n\t\tresourceids.StaticSegment(\"staticProviders\", \"providers\", \"providers\"),\n\t\tresourceids.ResourceProviderSegment(\"staticMicrosoftSqlVirtualMachine\", \"Microsoft.SqlVirtualMachine\", \"Microsoft.SqlVirtualMachine\"),\n\t\tresourceids.StaticSegment(\"staticSqlVirtualMachineGroups\", \"sqlVirtualMachineGroups\", \"sqlVirtualMachineGroups\"),\n\t\tresourceids.UserSpecifiedSegment(\"sqlVirtualMachineGroupName\", \"sqlVirtualMachineGroupValue\"),\n\t}\n}", "title": "" }, { "docid": "f11ca0959d94966c0aa9fee729df734a", "score": "0.51865584", "text": "func (m *MCIRApi) ListSecurityGroupByParam(nameSpaceID string) (string, error) {\n\tif m.requestMCIR == nil {\n\t\treturn \"\", errors.New(\"The Open() function must be called\")\n\t}\n\n\tholdType, _ := m.GetInType()\n\tm.SetInType(\"json\")\n\tm.requestMCIR.InData = `{\"nsId\":\"` + nameSpaceID + `\", \"resourceType\":\"securityGroup\"}`\n\tresult, err := m.requestMCIR.ListSecurityGroup()\n\tm.SetInType(holdType)\n\n\treturn result, err\n}", "title": "" }, { "docid": "ebaf1976b861f3de1a103fe6673d8ac9", "score": "0.5186305", "text": "func (this *Configurations) Ids() []interface{} {\n\tids := make([]interface{}, 0)\n\tids = append(ids, this.M_id)\n\treturn ids\n}", "title": "" }, { "docid": "574e5ed5c9d354bba8d377744774eefc", "score": "0.5185898", "text": "func GetSecurityGroups(ccAPI cCApi) (interface{}, error) {\n\tccResources := CreateSecurityGroupsCCResources(ccAPI)\n\n\tresources := ccResources.GetResources(securityGroupsURL, 2)\n\n\treturn resources, nil\n}", "title": "" }, { "docid": "66ab1fd8750216084e3bd91b8c4e2bd8", "score": "0.5179894", "text": "func (o *VirtualizationCloudVmConfigurationAllOf) GetSecurityGroups() []string {\n\tif o == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn o.SecurityGroups\n}", "title": "" }, { "docid": "9773694bb05983f9b120c6aee336b946", "score": "0.51768667", "text": "func (c *NetworkingClient) ListSecurityGroup(listOpts groups.ListOpts) ([]groups.SecGroup, error) {\n\tallPages, err := groups.List(c.client, listOpts).AllPages()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn groups.ExtractGroups(allPages)\n}", "title": "" }, { "docid": "2ef7b4e7af9ef9a1d3cb2c90d97998b9", "score": "0.516574", "text": "func (o NetworkInterfaceSecurityGroupAssociationOutput) NetworkSecurityGroupId() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *NetworkInterfaceSecurityGroupAssociation) pulumi.StringOutput { return v.NetworkSecurityGroupId }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "b8f8dd5a8caf6cde80da9f40a6fbd01a", "score": "0.51519847", "text": "func (id CapacityReservationGroupId) Segments() []resourceids.Segment {\n\treturn []resourceids.Segment{\n\t\tresourceids.StaticSegment(\"staticSubscriptions\", \"subscriptions\", \"subscriptions\"),\n\t\tresourceids.SubscriptionIdSegment(\"subscriptionId\", \"12345678-1234-9876-4563-123456789012\"),\n\t\tresourceids.StaticSegment(\"staticResourceGroups\", \"resourceGroups\", \"resourceGroups\"),\n\t\tresourceids.ResourceGroupSegment(\"resourceGroupName\", \"example-resource-group\"),\n\t\tresourceids.StaticSegment(\"staticProviders\", \"providers\", \"providers\"),\n\t\tresourceids.ResourceProviderSegment(\"staticMicrosoftCompute\", \"Microsoft.Compute\", \"Microsoft.Compute\"),\n\t\tresourceids.StaticSegment(\"staticCapacityReservationGroups\", \"capacityReservationGroups\", \"capacityReservationGroups\"),\n\t\tresourceids.UserSpecifiedSegment(\"capacityReservationGroupName\", \"capacityReservationGroupValue\"),\n\t}\n}", "title": "" }, { "docid": "440ee7c24f560a6896a3872a383aec71", "score": "0.5139793", "text": "func (s *VpcConfiguration) SetSecurityGroupIdList(v []*string) *VpcConfiguration {\n\ts.SecurityGroupIdList = v\n\treturn s\n}", "title": "" }, { "docid": "b6cacd465a10e9640f03c7a60bedf899", "score": "0.51391804", "text": "func (o *CreateVmGroupRequest) GetSecurityGroupIdsOk() (*[]string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn &o.SecurityGroupIds, true\n}", "title": "" }, { "docid": "0eaaba5df6823a790d586c3d7df88275", "score": "0.5139085", "text": "func (s *GroupService) List(ctx context.Context) ([]GroupRepresentation, error) {\n\n\tpath := \"/realms/{realm}/groups\"\n\tvar groups []GroupRepresentation\n\n\t_, err := s.client.newRequest(ctx).\n\t\tSetPathParams(map[string]string{\n\t\t\t\"realm\": s.client.Realm,\n\t\t}).\n\t\tSetResult(&groups).\n\t\tGet(path)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn groups, nil\n}", "title": "" }, { "docid": "266d7979c8930812fd4c27768a627bc4", "score": "0.5138578", "text": "func (s *OriginGroupsService) List(ctx context.Context) ([]*OriginGroup, *http.Response, error) {\n\treq, err := s.client.NewRequest(ctx, http.MethodGet, originGroupsURL, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\toriginGroups := make([]*OriginGroup, 0)\n\n\tresp, err := s.client.Do(req, &originGroups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn originGroups, resp, nil\n}", "title": "" }, { "docid": "35cad8cdc5d98f9e68632bdd784c93bf", "score": "0.5136749", "text": "func (ps *PulseGroupService) List(ids []int, opts ...Option) ([]*PulseGroup, error) {\n\tfor len(ids) < 1 {\n\t\treturn nil, ErrEmptyIDs\n\t}\n\n\tfor _, id := range ids {\n\t\tif id < 0 {\n\t\t\treturn nil, ErrNegativeID\n\t\t}\n\t}\n\n\tvar pg []*PulseGroup\n\n\topts = append(opts, SetFilter(\"id\", OpContainsAtLeast, sliceconv.Itoa(ids)...))\n\terr := ps.client.get(ps.end, &pg, opts...)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"cannot get PulseGroups with IDs %v\", ids)\n\t}\n\n\treturn pg, nil\n}", "title": "" }, { "docid": "1f5d80012694c6785defe486b90b7cce", "score": "0.51351255", "text": "func (m *PrinterShare) GetAllowedGroups()([]Groupable) {\n val, err := m.GetBackingStore().Get(\"allowedGroups\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]Groupable)\n }\n return nil\n}", "title": "" }, { "docid": "732fc551576a9b0c201ab2aad6485cbe", "score": "0.51345307", "text": "func (this *ServerConfiguration) Ids() []interface{} {\n\tids := make([]interface{}, 0)\n\tids = append(ids, this.M_id)\n\treturn ids\n}", "title": "" }, { "docid": "2c6987e04fb786242a8b9800555986bb", "score": "0.51324993", "text": "func getSGIPs(sgID string, ec2Svc *ec2.EC2) (map[string]string, error) {\n\tsgIPs := make(map[string]string)\n\tsgResp, err := ec2Svc.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{\n\t\tGroupIds: []*string{\n\t\t\taws.String(sgID),\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn sgIPs, err\n\t}\n\n\tif len(sgResp.SecurityGroups[0].IpPermissions) != 0 {\n\t\tfor _, ipRange := range sgResp.SecurityGroups[0].IpPermissions[0].IpRanges {\n\t\t\tsgIPs[aws.StringValue(ipRange.CidrIp)] = aws.StringValue(ipRange.CidrIp)\n\t\t}\n\t}\n\treturn sgIPs, err\n}", "title": "" }, { "docid": "d0776f4e39918cea44ae4cef373d8ea1", "score": "0.5131929", "text": "func (m GitlabQuerier) Groups() []string {\n\treturn util.ToStringSlice(m.groups)\n}", "title": "" }, { "docid": "dfcc1e65faf7ba0cbfa812da0283723a", "score": "0.5131518", "text": "func (*ListGroupsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_iam_proto_v1alpha2_group_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "1528e0d5bda018f370633bb3357e85cc", "score": "0.5125116", "text": "func (m *SecurityGroupEvidence) SetSecurityGroupId(value *string)() {\n err := m.GetBackingStore().Set(\"securityGroupId\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "5cfe45f7ed7d3f65e85bdb4ee6b7d5a3", "score": "0.5097967", "text": "func (col *ConsumerGroupsCommandClient) Groups(_ context.Context) ([]string, error) {\n\tcol.GroupInvocations++\n\treturn col.GroupsFn()\n}", "title": "" }, { "docid": "d31c597f547d3297ec6ac0d97bb4d6a6", "score": "0.50922036", "text": "func (m *UserMutation) GroupsIDs() (ids []int) {\n\tfor id := range m.groups {\n\t\tids = append(ids, id)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f1d8b2d4655cac3d7c459d774f305f65", "score": "0.5086354", "text": "func (m *Manager) Group(id string) []*Entity {\n\tg := make([]*Entity, 0, 10)\n\tgroup := m.groups[id]\n\tfor e := range group {\n\t\tg = append(g, e)\n\t}\n\treturn g\n}", "title": "" }, { "docid": "e0ee48550ffbfd61dcd3fbefc981a953", "score": "0.5083319", "text": "func (client IdentityClient) ListIdpGroupMappings(ctx context.Context, request ListIdpGroupMappingsRequest) (response ListIdpGroupMappingsResponse, err error) {\n\thttpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodGet, \"/identityProviders/{identityProviderId}/groupMappings/\", request)\n\tif err != nil {\n\t\treturn\n\t}\n\n\thttpResponse, err := client.Call(ctx, &httpRequest)\n\tdefer common.CloseBodyIfValid(httpResponse)\n\tresponse.RawResponse = httpResponse\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = common.UnmarshalResponse(httpResponse, &response)\n\treturn\n}", "title": "" }, { "docid": "9f7e691ebd5ab74d5f1e9bbfd6c20fd8", "score": "0.5081118", "text": "func (s *sqlimpl) ListPolicyGroups(ctx context.Context) (groups []*idm.PolicyGroup, e error) {\n\n\tstmt := s.GetStmt(\"listJoined\")\n\tif stmt == nil {\n\t\treturn nil, fmt.Errorf(\"Unknown statement\")\n\t}\n\tdefer stmt.Close()\n\n\tres, err := stmt.Query()\n\tif err != nil {\n\t\treturn groups, err\n\t}\n\tresult := make(map[string]*idm.PolicyGroup)\n\tdefer res.Close()\n\tfor res.Next() {\n\t\tpolicyGroup := new(idm.PolicyGroup)\n\t\tvar resourceGroup int32\n\t\tvar policyId string\n\t\tres.Scan(\n\t\t\t&policyGroup.Uuid,\n\t\t\t&policyGroup.Name,\n\t\t\t&policyGroup.Description,\n\t\t\t&policyGroup.OwnerUuid,\n\t\t\t&resourceGroup,\n\t\t\t&policyGroup.LastUpdated,\n\t\t\t&policyId,\n\t\t)\n\t\tif alreadyScanned, ok := result[policyGroup.Uuid]; ok {\n\t\t\tpolicyGroup = alreadyScanned\n\t\t}\n\t\tif policy, e := s.Get(policyId); e == nil {\n\t\t\tpolicyGroup.Policies = append(policyGroup.Policies, LadonToProtoPolicy(policy))\n\t\t}\n\t\tpolicyGroup.ResourceGroup = idm.PolicyResourceGroup(resourceGroup)\n\t\tresult[policyGroup.Uuid] = policyGroup\n\t}\n\tfor _, group := range result {\n\t\tgroups = append(groups, group)\n\t}\n\treturn\n}", "title": "" }, { "docid": "4a9eca9122021d4005d4c79157a11b98", "score": "0.50799114", "text": "func (g *GroupedSeries) ListGroups() []string {\n\treturn g.orderedKeys\n}", "title": "" }, { "docid": "92d447e6f1358585258239efac2b9df3", "score": "0.5073999", "text": "func (m *MySQL) ListGroups() ([]*model.Group, error) {\n\tgroups := []*model.Group{}\n\terr := m.conn.Select(&groups, \"SELECT * FROM `groups`\")\n\treturn groups, err\n}", "title": "" }, { "docid": "92d447e6f1358585258239efac2b9df3", "score": "0.5073999", "text": "func (m *MySQL) ListGroups() ([]*model.Group, error) {\n\tgroups := []*model.Group{}\n\terr := m.conn.Select(&groups, \"SELECT * FROM `groups`\")\n\treturn groups, err\n}", "title": "" }, { "docid": "eb1da41e27454fd4344bafa283ce1d60", "score": "0.50655013", "text": "func (s *securityGroupSynthesizer) findSDKSecurityGroups(ctx context.Context) ([]networking.SecurityGroupInfo, error) {\n\tstackTags := s.trackingProvider.StackTags(s.stack)\n\tstackTagsLegacy := s.trackingProvider.StackTagsLegacy(s.stack)\n\treturn s.taggingManager.ListSecurityGroups(ctx,\n\t\ttracking.TagsAsTagFilter(stackTags),\n\t\ttracking.TagsAsTagFilter(stackTagsLegacy))\n}", "title": "" }, { "docid": "125bbc6c316e67499d0d66b16ac79c07", "score": "0.5063687", "text": "func (this *Project) Ids() []interface{} {\n\tids := make([]interface{}, 0)\n\tids = append(ids, this.M_id)\n\treturn ids\n}", "title": "" }, { "docid": "93f42444bb5ebddc06e34d7409a61edb", "score": "0.50612426", "text": "func AWSRDSSecurityGroupID() string {\n\treturn MustGet(\"AWS_RDS_SECURITY_GROUP_ID\")\n}", "title": "" }, { "docid": "6cff20e492404a199b2cdcecd9262b2e", "score": "0.50568724", "text": "func (o LookupDbInstanceResultOutput) DbSecurityGroups() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v LookupDbInstanceResult) []string { return v.DbSecurityGroups }).(pulumi.StringArrayOutput)\n}", "title": "" }, { "docid": "e569a0415eb380640c3180952a6cd080", "score": "0.5046748", "text": "func GetAuthorizedGroupsForOktaID(oktaID string) ([]string, error) {\n\tdb := GetGORMDbConnection()\n\tdefer Close(db)\n\n\tvar (\n\t\tresult []string\n\t)\n\n\tgroups := []Group{}\n\terr := db.Select(\"*\").Find(&groups).Error\n\tif err != nil {\n\t\treturn result, err\n\t}\n\n\tfor _, group := range groups {\n\t\tfor _, user := range group.Data.Users {\n\t\t\tif user == oktaID {\n\t\t\t\tresult = append(result, group.GroupID)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result, nil\n}", "title": "" }, { "docid": "5d1e469e3fd2e453601b9522572adf54", "score": "0.504603", "text": "func (ds datastore) GetGroupNames() []string {\n\treturn ds.groups\n}", "title": "" } ]
8a50b9cb511c8298c44d2f3a3e1b8ddb
CheckMessage for check request message
[ { "docid": "b8fd10ee984ba87ed18f6e27d6dde428", "score": "0.6573451", "text": "func CheckMessage(req PushNotification) error {\n\tvar msg string\n\n\tif len(req.Tokens) == 0 {\n\t\tmsg = \"the message must specify at least one registration ID\"\n\t\tLogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\tif len(req.Tokens) == PlatFormIos && len(req.Tokens[0]) == 0 {\n\t\tmsg = \"the token must not be empty\"\n\t\tLogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\tif req.Platform == PlatFormAndroid && len(req.Tokens) > 1000 {\n\t\tmsg = \"the message may specify at most 1000 registration IDs\"\n\t\tLogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\t// ref: https://developers.google.com/cloud-messaging/http-server-ref\n\tif req.Platform == PlatFormAndroid && req.TimeToLive != nil && (*req.TimeToLive < uint(0) || uint(2419200) < *req.TimeToLive) {\n\t\tmsg = \"the message's TimeToLive field must be an integer \" +\n\t\t\t\"between 0 and 2419200 (4 weeks)\"\n\t\tLogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\treturn nil\n}", "title": "" } ]
[ { "docid": "edeb1673622710a78803889f07701bbd", "score": "0.6584211", "text": "func CheckMessage(req *PushNotification) error {\n\tvar msg string\n\n\t// ignore send topic mesaage from FCM\n\tif !req.IsTopic() && len(req.Tokens) == 0 && req.To == \"\" {\n\t\tmsg = \"the message must specify at least one registration ID\"\n\t\tlogx.LogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\tif len(req.Tokens) == core.PlatFormIos && req.Tokens[0] == \"\" {\n\t\tmsg = \"the token must not be empty\"\n\t\tlogx.LogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\tif req.Platform == core.PlatFormAndroid && len(req.Tokens) > 1000 {\n\t\tmsg = \"the message may specify at most 1000 registration IDs\"\n\t\tlogx.LogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\tif req.Platform == core.PlatFormHuawei && len(req.Tokens) > 500 {\n\t\tmsg = \"the message may specify at most 500 registration IDs for Huawei\"\n\t\tlogx.LogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\t// ref: https://firebase.google.com/docs/cloud-messaging/http-server-ref\n\tif req.Platform == core.PlatFormAndroid && req.TimeToLive != nil && *req.TimeToLive > uint(2419200) {\n\t\tmsg = \"the message's TimeToLive field must be an integer \" +\n\t\t\t\"between 0 and 2419200 (4 weeks)\"\n\t\tlogx.LogAccess.Debug(msg)\n\t\treturn errors.New(msg)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7388b99619ddcaef3e8e2f469b92eac3", "score": "0.63264924", "text": "func validateRequest(message Message) error {\n\tif !message.Tag.isRequest() {\n\t\treturn fmt.Errorf(\"%s: %w\", message.Tag, ErrNotARequestTag)\n\t}\n\treturn message.validate()\n}", "title": "" }, { "docid": "1e6fc94ebd28c08034cd89574948d6c5", "score": "0.63075256", "text": "func checkGetRequestMessageName() lint.Rule {\n\treturn &descriptor.CallbackRule{\n\t\tRuleInfo: lint.RuleInfo{\n\t\t\tName: lint.NewRuleName(\"core\", \"0131\", \"request_message\", \"name\"),\n\t\t\tDescription: \"check that Get RPCs have appropriate request messages\",\n\t\t\tRequestTypes: []lint.RequestType{lint.ProtoRequest},\n\t\t\tURI: \"https://aip.dev/131#guidance\",\n\t\t},\n\t\tCallback: descriptor.Callbacks{\n\t\t\tMethodCallback: func(m p.MethodDescriptor, s lint.DescriptorSource) (problems []lint.Problem, err error) {\n\t\t\t\t// We only care about Get methods for the purpose of this rule;\n\t\t\t\t// ignore everything else.\n\t\t\t\tif !isGetMethod(m) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Rule check: Establish that for methods such as `GetFoo`, the request\n\t\t\t\t// message is named `GetFooRequest`.\n\t\t\t\tmethodName := string(m.Name())\n\t\t\t\trequestMessageName := string(m.Input().Name())\n\t\t\t\tcorrectRequestMessageName := methodName + \"Request\"\n\t\t\t\tif requestMessageName != correctRequestMessageName {\n\t\t\t\t\tproblems = append(problems, lint.Problem{\n\t\t\t\t\t\tMessage: fmt.Sprintf(\n\t\t\t\t\t\t\t\"Get RPCs should have a request message named after the RPC, such as %q.\",\n\t\t\t\t\t\t\tcorrectRequestMessageName,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tSuggestion: correctRequestMessageName,\n\t\t\t\t\t\tDescriptor: m,\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\treturn problems, nil\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "153665b7c4dd63fe2564c9f84ae52259", "score": "0.62771326", "text": "func checkGetRequestMessageNameField() lint.Rule {\n\treturn &descriptor.CallbackRule{\n\t\tRuleInfo: lint.RuleInfo{\n\t\t\tName: lint.NewRuleName(\"core\", \"0131\", \"request_message\", \"name_field\"),\n\t\t\tDescription: \"check that a name field is present\",\n\t\t\tRequestTypes: []lint.RequestType{lint.ProtoRequest},\n\t\t\tURI: \"https://aip.dev/131#request-message\",\n\t\t},\n\t\tCallback: descriptor.Callbacks{\n\t\t\tMethodCallback: func(m p.MethodDescriptor, s lint.DescriptorSource) (problems []lint.Problem, err error) {\n\t\t\t\t// We only care about Get methods for the purpose of this rule;\n\t\t\t\t// ignore everything else.\n\t\t\t\tif !isGetMethod(m) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Rule check: Establish that a name field is present.\n\t\t\t\tnameField := m.Input().Fields().ByName(\"name\")\n\t\t\t\tif nameField == nil {\n\t\t\t\t\tproblems = append(problems, lint.Problem{\n\t\t\t\t\t\tMessage: fmt.Sprintf(\"method %q has no `name` field\", m.Name()),\n\t\t\t\t\t\tDescriptor: m.Input(),\n\t\t\t\t\t})\n\t\t\t\t\treturn problems, nil\n\t\t\t\t}\n\n\t\t\t\t// Rule check: Establish that the name field is a string.\n\t\t\t\tif nameField.Kind() != p.StringKind {\n\t\t\t\t\tproblems = append(problems, lint.Problem{\n\t\t\t\t\t\tMessage: \"`name` field on Get RPCs should be a string\",\n\t\t\t\t\t\tDescriptor: nameField,\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\treturn problems, nil\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "a7e89cd0f62165c8e89eeccd1ca9ac82", "score": "0.5789017", "text": "func checkGetRequestMessageUnknownFields() lint.Rule {\n\treturn &descriptor.CallbackRule{\n\t\tRuleInfo: lint.RuleInfo{\n\t\t\tName: lint.NewRuleName(\"core\", \"0131\", \"request_message\", \"unknown_fields\"),\n\t\t\tDescription: \"check that there are no unknown fields\",\n\t\t\tRequestTypes: []lint.RequestType{lint.ProtoRequest},\n\t\t\tURI: \"https://aip.dev/131#request-message\",\n\t\t},\n\t\tCallback: descriptor.Callbacks{\n\t\t\tMethodCallback: func(m p.MethodDescriptor, s lint.DescriptorSource) (problems []lint.Problem, err error) {\n\t\t\t\t// We only care about Get methods for the purpose of this rule;\n\t\t\t\t// ignore everything else.\n\t\t\t\tif !isGetMethod(m) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Rule check: Establish that there are no unexpected fields.\n\t\t\t\tallowedFields := map[string]struct{}{\n\t\t\t\t\t\"name\": {}, // AIP-131\n\t\t\t\t\t\"read_mask\": {}, // AIP-157\n\t\t\t\t\t\"view\": {}, // AIP-157\n\t\t\t\t}\n\t\t\t\tfields := m.Input().Fields()\n\t\t\t\tfor i := 0; i < fields.Len(); i++ {\n\t\t\t\t\tfield := fields.Get(i)\n\t\t\t\t\tif _, ok := allowedFields[string(field.Name())]; !ok {\n\t\t\t\t\t\tproblems = append(problems, lint.Problem{\n\t\t\t\t\t\t\tMessage: fmt.Sprintf(\n\t\t\t\t\t\t\t\t\"Get RPCs should only only contain fields explicitly described in AIPs, not %q.\",\n\t\t\t\t\t\t\t\tstring(field.Name()),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tDescriptor: field,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn problems, nil\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "dec1f5006d27168bbd23f051d6de4aab", "score": "0.5707622", "text": "func (s *Static) Check(msg types.Message) bool {\n\ts.mCount.Incr(1)\n\tif s.value {\n\t\ts.mTrue.Incr(1)\n\t} else {\n\t\ts.mFalse.Incr(1)\n\t}\n\treturn s.value\n}", "title": "" }, { "docid": "4313a20d110d9e1d1d3266f37ac4f0c0", "score": "0.5675868", "text": "func ValidateMessage(msg Msg) error {\n\tswitch msg.Cmd {\n\tcase \"GET\", \"DEL\":\n\t\tif err := checkField(\"key\", msg.Key); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"SET\":\n\t\tif err := checkField(\"key\", msg.Key); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := checkField(\"value\", msg.Val); err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"command '%s' is not supported\", msg.Cmd)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cf3057758703006fec242a50a991b439", "score": "0.56471246", "text": "func checkRequest(r *http.Request) bool {\n\treturn r.Header.Get(\"Accept\") == \"text/event-stream\"\n}", "title": "" }, { "docid": "1bc4243d6c53976d7c2ccc166e6680ce", "score": "0.56366664", "text": "func ValidateMessage(t *testing.T, m proto.Message) {\n\t// TODO: add some validation\n}", "title": "" }, { "docid": "79238f437d45f809048e01a4447047fa", "score": "0.56259835", "text": "func CheckIdentityMessage(identityMessage IdentityMessage, message Message) (bool, string, PkPreamble, string) {\n\n\tvar descriptionError string = \"\"\n\tvar pk PkPreamble = PkPreamble{}\n\tvar nm string = \"\"\n\n\tpk.Domain, descriptionError = CheckIdentityValueMessageValue(identityMessage.Domains, message.PkPreamble.Domain)\n\tif descriptionError != \"\" {\n\t\tdescriptionError = descriptionError + \" -> Domain\"\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode CheckIdentityValueMessageValue Domain error: \", descriptionError)\n\t\tLogMessage(ERROR, \"Domains register for this identity: \", strings.Join(identityMessage.Domains, \",\"))\n\t\tLogMessage(ERROR, \"Domain in INPUT parameters : \", message.PkPreamble.Domain)\n\t\treturn false, descriptionError, pk, nm\n\t}\n\n\tpk.Environment, descriptionError = CheckIdentityValueMessageValue(identityMessage.Environments, message.PkPreamble.Environment)\n\tif descriptionError != \"\" {\n\t\tdescriptionError = descriptionError + \" -> Environment\"\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode CheckIdentityValueMessageValue Environment error: \", descriptionError)\n\t\tLogMessage(ERROR, \"Environments register for this identity: \", strings.Join(identityMessage.Environments, \",\"))\n\t\tLogMessage(ERROR, \"Environment in INPUT parameters : \", message.PkPreamble.Environment)\n\t\treturn false, descriptionError, pk, nm\n\t}\n\n\tpk.Process, descriptionError = CheckIdentityValueMessageValue(identityMessage.Processes, message.PkPreamble.Process)\n\tif descriptionError != \"\" {\n\t\tdescriptionError = descriptionError + \" -> Process\"\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode CheckIdentityValueMessageValue Process error: \", descriptionError)\n\t\tLogMessage(ERROR, \"Processes register for this identity: \", strings.Join(identityMessage.Processes, \",\"))\n\t\tLogMessage(ERROR, \"Process in INPUT parameters : \", message.PkPreamble.Process)\n\t\treturn false, descriptionError, pk, nm\n\t}\n\n\tnm, descriptionError = CheckIdentityValueMessageValue(identityMessage.Names, message.Name)\n\tif descriptionError != \"\" {\n\t\tdescriptionError = descriptionError + \" -> Name\"\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode CheckIdentityValueMessageValue Name error: \", descriptionError)\n\t\tLogMessage(ERROR, \"Names register for this identity: \", strings.Join(identityMessage.Names, \",\"))\n\t\tLogMessage(ERROR, \"Name in INPUT parameters : \", message.Name)\n\t\treturn false, descriptionError, pk, nm\n\t}\n\treturn true, descriptionError, pk, nm\n}", "title": "" }, { "docid": "658777a076f0b1218272da1a54440129", "score": "0.56239885", "text": "func (i *instrumentation) CountRequestMsg() {\n\ti.countMessage(metrics.MessageTypeRequestWorkflowExecutionUpdateCounter.GetMetricName())\n}", "title": "" }, { "docid": "311ebbbba64459a32444d2ce9e3a81cb", "score": "0.56104255", "text": "func compareRequestMessages (m *RequestMessage, m2 *RequestMessage) (bool, string){\n\tif m.Type != m2.Type {\n\t\treturn false, \"Message Types don't match\"\n\t}\n\tif m.SequenceNumber != m2.SequenceNumber {\n\t\treturn false, \"message sequence numbers don't match\"\n\t}\n\tif m.AckNumber != m2.AckNumber {\n\t\treturn false, \"message ack numbers don't match\"\n\t}\n\tif m.Nonce != m2.Nonce {\n\t\treturn false, \"nonces don't match\"\n\t}\n\tb1, err1 := m.Body.Marshall()\n\tb2, err2 := m2.Body.Marshall()\n\tif err1 != nil || err2 != nil {\n\t\treturn false, fmt.Sprintf(\"Error: %v, %v\", err1, err2)\n\t}\n\tif bytes.Compare(b1, b2) != 0 {\n\t\treturn false, \"bodies don't match\"\n\t}\n\n\treturn true, \"\"\n}", "title": "" }, { "docid": "def27be5144f25fa5b23bdeb8e9b009a", "score": "0.560264", "text": "func messageValidator(message *clientSendMessage) bool {\n\n\tif message.TimeStamp.String() == \"\" || message.To == nil {\n\t\treturn false\n\t}\n\n\tfor _, user := range message.To {\n\t\tif user == \"\" {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tmessage.Text = strings.TrimSpace(message.Text)\n\tif message.Text == \"\" {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "7abbe107ac76377799519a233ad670e0", "score": "0.5577901", "text": "func (m *Message) IsValid() (valid bool) {\n\tswitch m.Type {\n\tcase TypePing:\n\t\tvalid = true\n\tcase TypeFindNode:\n\t\t_, valid = m.Data.(*RequestDataFindNode)\n\tcase TypeFindValue:\n\t\t_, valid = m.Data.(*RequestDataFindValue)\n\tcase TypeStore:\n\t\t_, valid = m.Data.(*RequestDataStore)\n\tcase TypeRPC:\n\t\t_, valid = m.Data.(*RequestDataRPC)\n\tcase TypeRelay:\n\t\t_, valid = m.Data.(*RequestRelay)\n\tdefault:\n\t\tvalid = false\n\t}\n\n\treturn valid\n}", "title": "" }, { "docid": "e7656b8825e9de56bb17babf3946e9e2", "score": "0.5569476", "text": "func (reqctx *requestContext) checkReasonRequestProcessed() error {\n\treqid := reqctx.req.ID()\n\tvar isProcessed bool\n\twithContractState(reqctx.uncommittedState, blocklog.Contract, func(s kv.KVStore) {\n\t\tisProcessed = blocklog.MustIsRequestProcessed(s, reqid)\n\t})\n\tif isProcessed {\n\t\treturn errors.New(\"already processed\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "788c3d1306b20031f5ccde65d05fc8ee", "score": "0.55576414", "text": "func CheckRequest(auth gosip.AuthCnfg, cnfgPath string) error {\n\terr := auth.ReadConfig(u.ResolveCnfgPath(cnfgPath))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient := &gosip.SPClient{\n\t\tAuthCnfg: auth,\n\t}\n\n\tendpoint := auth.GetSiteURL() + \"/_api/web?$select=Title\"\n\treq, err := http.NewRequest(\"GET\", endpoint, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create a request: %w\", err)\n\t}\n\n\treq.Header.Set(\"Accept\", \"application/json;odata=verbose\")\n\n\tresp, err := client.Execute(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to request api: %w\", err)\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\n\tdata, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to read a response: %w\", err)\n\t}\n\n\ttype apiResponse struct {\n\t\tD struct {\n\t\t\tTitle string `json:\"Title\"`\n\t\t} `json:\"d\"`\n\t\tError struct {\n\t\t\tMessage struct {\n\t\t\t\tValue string `json:\"value\"`\n\t\t\t} `json:\"message\"`\n\t\t} `json:\"error\"`\n\t}\n\tresults := &apiResponse{}\n\n\terr = json.Unmarshal(data, &results)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse a response: %w\", err)\n\t}\n\n\tif results.Error.Message.Value != \"\" {\n\t\treturn fmt.Errorf(results.Error.Message.Value)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1ce190b5d36e725707ce328bcbcfd46c", "score": "0.5547619", "text": "func (_m *mockIsServerReflectionRequest_MessageRequest) isServerReflectionRequest_MessageRequest() {\n\t_m.Called()\n}", "title": "" }, { "docid": "52384fbb94c203e25d6ffb211543e83b", "score": "0.5522849", "text": "func checkTaskRequest(req *api.TaskRequest) error {\n\tif req == nil {\n\t\treturn fmt.Errorf(\"TaskRequest missing\")\n\t}\n\n\tif req.Command == \"\" {\n\t\treturn fmt.Errorf(\"TaskRequest missing required field command\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6cd6127a8e6bcd53ccf1b77b3fa82bb5", "score": "0.55175257", "text": "func Check(message *discordgo.MessageCreate, session *discordgo.Session) {\n\tvar violations []string\n\tfor _, filter := range Filters {\n\t\tif strings.Contains(message.Content, filter.Text) && !message.Author.Bot {\n\t\t\tviolations = append(violations, filter.Text)\n\t\t}\n\t}\n\n\tif len(violations) > 0 {\n\t\t// Delete the member's message if a filter is violated\n\t\tsession.ChannelMessageDelete(message.ChannelID, message.ID)\n\n\t\toffenderChannel, _ := session.UserChannelCreate(message.Author.ID)\n\t\tguild, _ := session.Guild(message.GuildID)\n\t\tauthor := message.Author.ID\n\n\t\tif !strings.HasPrefix(message.Content, config.CommandPrefix) {\n\t\t\toutput := \"<@\" + author + \">, I detected you said a bad thing and I removed it.\\n\"\n\t\t\toutput += \">>> \"\n\t\t\toutput += \"You said ***\" + message.Content + \"***\\n\"\n\n\t\t\tif violations[0] != message.Content {\n\t\t\t\toutput += \"I detected \"\n\t\t\t\tfor i := 0; i < len(violations); i++ {\n\t\t\t\t\toutput += \"***\" + violations[i] + \"***\"\n\t\t\t\t\tif len(violations) > 1 {\n\t\t\t\t\t\tif i == len(violations)-2 {\n\t\t\t\t\t\t\toutput += \" and \"\n\t\t\t\t\t\t} else if i < len(violations)-1 {\n\t\t\t\t\t\t\toutput += \", \"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toutput += \" in that.\\n\"\n\t\t\t}\n\t\t\toutput += \"Detected in ***\" + guild.Name + \"*** in the channel <#\" + message.ChannelID + \">\\n\"\n\n\t\t\tif len(Alerts) > 0 {\n\t\t\t\tfor _, alert := range Alerts {\n\t\t\t\t\talertUser, _ := session.User(alert.ID)\n\t\t\t\t\tif !alertUser.Bot {\n\t\t\t\t\t\talertChannel, _ := session.UserChannelCreate(alert.ID)\n\n\t\t\t\t\t\talertText := \"<@\" + alert.ID + \">, member <@\" + author + \"> violated a filter.\\n\"\n\t\t\t\t\t\talertText += \">>> \"\n\t\t\t\t\t\talertText += \"They said ***\" + message.Content + \"***\\n\"\n\n\t\t\t\t\t\tif violations[0] != message.Content {\n\t\t\t\t\t\t\talertText += \"I detected \"\n\t\t\t\t\t\t\tfor i := 0; i < len(violations); i++ {\n\t\t\t\t\t\t\t\talertText += \"***\" + violations[i] + \"***\"\n\t\t\t\t\t\t\t\tif len(violations) > 1 {\n\t\t\t\t\t\t\t\t\tif i == len(violations)-2 {\n\t\t\t\t\t\t\t\t\t\talertText += \" and \"\n\t\t\t\t\t\t\t\t\t} else if i < len(violations)-1 {\n\t\t\t\t\t\t\t\t\t\talertText += \", \"\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\talertText += \" in that.\\n\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\talertText += \"Detected in ***\" + guild.Name + \"*** in the channel <#\" + message.ChannelID + \">\\n\"\n\t\t\t\t\t\tsession.ChannelMessageSend(alertChannel.ID, alertText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toutput += \"I alerted the appropriate members so they can review this.\\n\"\n\t\t\t}\n\n\t\t\tif config.MuteRole != \"\" {\n\t\t\t\t// Give the member the mute role if a filter is violated\n\t\t\t\tsession.GuildMemberRoleAdd(message.GuildID, message.Author.ID, config.MuteRole)\n\t\t\t\toutput += \"***YOU HAVE BEEN MUTED BECAUSE OF THIS!***\\n\"\n\t\t\t}\n\t\t\tsession.ChannelMessageSend(offenderChannel.ID, output)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "99321f4cbfdbabd0f893ca393aedcb20", "score": "0.55093735", "text": "func (m *Message) CheckMessageValidate() bool {\n\treturn true\n}", "title": "" }, { "docid": "3d1b6d2420639e11ab16eccef832b0f9", "score": "0.54800326", "text": "func checkRequest(r *http.Request) error {\n\t// TODO: maybe should also cover content-length = -1\n\tif r.ContentLength > maxHTTPBody {\n\t\treturn errutil.WithErrorReason(errBodyTooLarge, status.Error(codes.FailedPrecondition, \"body too large\"))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f34a03f49937bdbf48c39ca092b65b26", "score": "0.5478529", "text": "func checkClientRequest(req []byte) bool {\n\t// bits 0,1\n\tvar leapIndicator = req[0] >> 6 & bitMask2\n\t// bits 2,3,4\n\tvar versionNumber = req[0] >> 3 & bitMask3\n\t// bits 5,6,7\n\tvar mode = req[0] & bitMask3\n\n\tif leapIndicator != LiNoWarning && leapIndicator != LiAlarmCondition {\n\t\treturn false\n\t}\n\tif versionNumber < VnFirst || versionNumber > VnLast {\n\t\treturn false\n\t}\n\tif mode != ModeClient {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "c2a38e222d3c046a647149454b2e737a", "score": "0.5462952", "text": "func (x *fastReflection_MsgRequest) IsValid() bool {\n\treturn x != nil\n}", "title": "" }, { "docid": "0a6e7f32f40172be242fbab66ee759e2", "score": "0.5452289", "text": "func (k *slackProvider) Check(_ context.Context, req *pulumirpc.CheckRequest) (*pulumirpc.CheckResponse, error) {\n\trn := getResourceNameFromRequest(req)\n\tres := getSlackResource(rn)\n\treturn res.Check(req)\n}", "title": "" }, { "docid": "5b44a32e102cf8b067ecc4aaafd92730", "score": "0.5429592", "text": "func CheckReqId(c *gin.Context) {\n\tif requestid := c.Query(REQUEST_ID_REQ); requestid == \"\" {\n\t\tc.AbortWithStatusJSON(http.StatusBadRequest,\n\t\t\tgin.H{\"message\": fmt.Sprintf(\"%s is required\", REQUEST_ID_REQ)})\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "b7d22e193bd5a60bd0986b40a9189a8d", "score": "0.54254293", "text": "func checkGetResponseMessageName() lint.Rule {\n\treturn &descriptor.CallbackRule{\n\t\tRuleInfo: lint.RuleInfo{\n\t\t\tName: lint.NewRuleName(\"core\", \"0131\", \"response_message\", \"name\"),\n\t\t\tDescription: \"check that Get RPCs have appropriate response messages\",\n\t\t\tRequestTypes: []lint.RequestType{lint.ProtoRequest},\n\t\t\tURI: \"https://aip.dev/131#guidance\",\n\t\t},\n\t\tCallback: descriptor.Callbacks{\n\t\t\tMethodCallback: func(m p.MethodDescriptor, s lint.DescriptorSource) (problems []lint.Problem, err error) {\n\t\t\t\t// We only care about Get methods for the purpose of this rule;\n\t\t\t\t// ignore everything else.\n\t\t\t\tif !isGetMethod(m) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Rule check: Establish that for methods such as `GetFoo`, the response\n\t\t\t\t// message is named `Foo`.\n\t\t\t\tresponseMessageName := string(m.Output().Name())\n\t\t\t\tmethodName := string(m.Name())\n\t\t\t\tif correctResponseMessageName := methodName[3:]; correctResponseMessageName != responseMessageName {\n\t\t\t\t\tproblems = append(problems, lint.Problem{\n\t\t\t\t\t\tMessage: fmt.Sprintf(\n\t\t\t\t\t\t\t\"Get RPCs should have the corresponding resource as the response message, such as %q.\",\n\t\t\t\t\t\t\tcorrectResponseMessageName,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tSuggestion: correctResponseMessageName,\n\t\t\t\t\t\tDescriptor: m,\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\treturn problems, nil\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "3595c55bc62c4d7d2dc0a3b522c9971c", "score": "0.5420309", "text": "func (v *Validator) Check(ok bool, key, message string) {\n if !ok {\n v.AddError(key, message)\n }\n}", "title": "" }, { "docid": "0770e9a4702fea9ae086eb620b0be7d3", "score": "0.54055965", "text": "func (m *SetStatusMessageRequest) Validate() error {\n\treturn m.validate(false)\n}", "title": "" }, { "docid": "22c8e959bfad44846c052fc09a79781a", "score": "0.5391674", "text": "func (c *Update) IsMessage() bool {\n\treturn c.Method == MessageRequest\n}", "title": "" }, { "docid": "5219207872e898562c7a835bfce6f8fc", "score": "0.53913724", "text": "func (rhs *requestHandlerState) setRequestMessage(format string, args ...interface{}) string {\n\tmsg := rhs._setRequestMessage(format, args...)\n\trhs.c.Log.Infof(\"StorageRequest %s: %s\", rhs.Request.Meta.ID, msg)\n\treturn msg\n}", "title": "" }, { "docid": "8205662ad8aabcbba48b8cd3a68d4c44", "score": "0.5379633", "text": "func (h *handlerState) Check(ctx context.Context, requestBag *attribute.MutableBag, responseBag *attribute.MutableBag,\n\trequest *mixerpb.CheckRequest, response *mixerpb.CheckResponse) {\n\tif glog.V(2) {\n\t\tglog.Infof(\"Check [%x]\", request.RequestIndex)\n\t}\n\n\to := h.execute(ctx, requestBag, responseBag, aspect.CheckMethod, &aspect.CheckMethodArgs{})\n\tresponse.RequestIndex = request.RequestIndex\n\tresponse.Result = o.Status\n\n\t// TODO: this value needs to initially come from config, and be modulated by the kind of attribute\n\t// that was used in the check and the in-used aspects (for example, maybe an auth check has a\n\t// 30s TTL but a whitelist check has got a 120s TTL)\n\tresponse.Expiration = time.Duration(5) * time.Second\n\n\tif glog.V(2) {\n\t\tglog.Infof(\"Check [%x] <-- %s\", request.RequestIndex, response)\n\t}\n}", "title": "" }, { "docid": "a527a2d98478e008f90d5c3f612cfc2d", "score": "0.5340205", "text": "func (t *Client) Check(ctx context.Context, name string, key string) (bool, error) {\n\tcmd := t.buildCommand(_CHECK, name, key)\n\tresp, err := t.sendCommand(ctx, cmd)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn parseBool(resp)\n}", "title": "" }, { "docid": "ac19cb3ca13a61a611faaf17b4e96b85", "score": "0.53394735", "text": "func CheckInput(sc *ServerConfig) {\n\tfor {\n\t\tenvelope, ok := <-sc.Input\n\t\tif !ok {\n\t\t\tpanic(\"channels closed..\")\n\t\t}\n\t\tdbg.Println(\"Received msg from %d to %d\", envelope.SendBy, envelope.SendTo)\n\t}\n}", "title": "" }, { "docid": "ac19cb3ca13a61a611faaf17b4e96b85", "score": "0.53394735", "text": "func CheckInput(sc *ServerConfig) {\n\tfor {\n\t\tenvelope, ok := <-sc.Input\n\t\tif !ok {\n\t\t\tpanic(\"channels closed..\")\n\t\t}\n\t\tdbg.Println(\"Received msg from %d to %d\", envelope.SendBy, envelope.SendTo)\n\t}\n}", "title": "" }, { "docid": "d95dca43bee8598a3ec2bbc2039b3a91", "score": "0.5322426", "text": "func checks(req *pb.Command) error {\n\tif req.Name != \"DUMPLOG\" && req.Name != \"DISPLAY_SUMMARY\" {\n\t\tif req.UserId == \"\" {\n\t\t\treturn errors.New(\"No user Id specified\")\n\t\t}\n\t}\n\tif req.Amount < 0 {\n\t\treturn errors.New(\"Amount must be greater than 0\")\n\t}\n\tif len(req.Symbol) > 3 {\n\t\treturn errors.New(\"Symbol must be 3 characters or less\")\n\t}\n\tif !isLetter(req.Symbol) {\n\t\treturn errors.New(\"Symbol must consist of only letters\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fd1f247ef067a1c2f5e067058c5e7454", "score": "0.53180367", "text": "func (pm ProtoMessage) RequestMessageName() ExtString {\n\treturn pm.MethodName() + \"Request\"\n}", "title": "" }, { "docid": "fdbf7aae60cc0c00fe286ca22eb718d2", "score": "0.52983785", "text": "func (s *serverV2) Check(\n\tctx context.Context,\n\treq *envoy_service_auth_v2.CheckRequest) (*envoy_service_auth_v2.CheckResponse, error) {\n\thttp := req.Attributes.Request.Http\n\tctx, span := startSpan(ctx, s.tracer, req.Attributes.Request.Time, http.Method)\n\tsetSourcePeerV2(span, req.Attributes.Source)\n\tsetSpanAttributesV2(span, http)\n\tdefer span.End()\n\treturn &envoy_service_auth_v2.CheckResponse{\n\t\tStatus: &status.Status{\n\t\t\tCode: int32(code.Code_OK),\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "685889a3e9097cc2b70d901518d8743d", "score": "0.5283083", "text": "func (m *PactMessageRequest) Validate() error {\n\tm.Args = []string{}\n\n\tbody, err := json.Marshal(m.Message)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tm.Args = append(m.Args, []string{\n\t\tm.PactFileWriteMode,\n\t\tstring(body),\n\t\t\"--consumer\",\n\t\tm.Consumer,\n\t\t\"--provider\",\n\t\tm.Provider,\n\t\t\"--pact-dir\",\n\t\tm.PactDir,\n\t\t\"--pact-specification-version\",\n\t\t\"3\",\n\t}...)\n\n\treturn nil\n}", "title": "" }, { "docid": "5d19456408a917eceae00a16e4cc2e87", "score": "0.5282017", "text": "func (s Server) readMessage(m *tb.Message) {}", "title": "" }, { "docid": "10ccd5a56dbf150de519a55a9dcdc766", "score": "0.52807873", "text": "func (r PingPongRequest) Check() error {\n\tif !utils.StringInSlice([]string{ModePingPong, ModeBandwidth}, r.Mode) {\n\t\treturn trace.BadParameter(\"unsupported mode %q\", r.Mode)\n\t}\n\tif len(r.Listen) < 1 {\n\t\treturn trace.BadParameter(\"at least one listen address should be provided: %v\", r)\n\t}\n\tif len(r.Ping) < 1 {\n\t\treturn trace.BadParameter(\"at least one ping address should be provided: %v\", r)\n\t}\n\tif r.Mode == ModePingPong {\n\t\tfor _, server := range append(r.Listen, r.Ping...) {\n\t\t\tif !utils.StringInSlice([]string{\"tcp\", \"udp\"}, server.Network) {\n\t\t\t\treturn trace.BadParameter(\"unsupported protocol %v, supported are: tcp, udp\",\n\t\t\t\t\tserver)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "503bdbb20aab5f469c5a1d8750f800c5", "score": "0.52788424", "text": "func isPositiveRequest(request string) (bool, error) {\n\tswitch request {\n\tcase \"ON\", \"UP\", \"LOCK\", \"OPEN\", \"TOGGLE\", \"PUSH\":\n\t\treturn true, nil\n\tcase \"OFF\", \"DOWN\", \"UNLOCK\", \"CLOSE\":\n\t\treturn false, nil\n\t}\n\n\t// Command didn't match any of the above, get out of here\n\treturn false, fmt.Errorf(\"Error: %s is an invalid command\", request)\n}", "title": "" }, { "docid": "5f58f66e981ac54a6207f030a6d87297", "score": "0.52771014", "text": "func (rhs *requestHandlerState) _setRequestMessage(format string, args ...interface{}) string {\n\tmsg := fmt.Sprintf(format, args...)\n\tts := &models.TimestampedString{\n\t\tMessage: msg,\n\t\tTime: strfmt.DateTime(time.Now()),\n\t}\n\trhs.Request.RequestMessages = append(rhs.Request.RequestMessages, ts)\n\treturn msg\n}", "title": "" }, { "docid": "272eb677162332c2686bc416698c33ad", "score": "0.5274496", "text": "func check(c *gin.Context) {\n\tc.JSON(200, gin.H{\n\t\t\"message\": \"test successful\",\n\t})\n}", "title": "" }, { "docid": "f30373410ab3438714f29b2b6ba2bee8", "score": "0.52701956", "text": "func (me XLinkActuateType) IsOnRequest() bool { return me.String() == \"onRequest\" }", "title": "" }, { "docid": "b44e64abe6fbf820f6ab9a5f4a85bc8d", "score": "0.52537924", "text": "func (o *DowntimeUpdateRequestAttributes) HasMessage() bool {\n\treturn o != nil && o.Message.IsSet()\n}", "title": "" }, { "docid": "e8f4634f7ce6c47168bc0197c22bb028", "score": "0.5249881", "text": "func (WlShellSurfacePongRequest) MessageName() string { return \"pong\" }", "title": "" }, { "docid": "5cb719d252fb8df9e016a6401fd12143", "score": "0.52494353", "text": "func (XdgWmBasePongRequest) MessageName() string { return \"pong\" }", "title": "" }, { "docid": "5e6d25eb7f051b9d71121b014cddce28", "score": "0.52401286", "text": "func (s *SimpleRESTAgent) Msg() string { return s.msg }", "title": "" }, { "docid": "2ad4d241310facc084d5c6ce35cb4097", "score": "0.5234155", "text": "func (i *ISteamWebUserPresenceOAuth) Message() (*geyser.Request, error) {\n\tsm, err := i.Interface.Methods.Get(schema.MethodKey{\n\t\tName: \"Message\",\n\t\tVersion: 1,\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq := geyser.NewRequest(i.Interface, sm)\n\n\treturn req, nil\n}", "title": "" }, { "docid": "269c3731ca77751958c883e14c59991c", "score": "0.52180576", "text": "func (x *fastReflection_MsgRequest) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"testpb.MsgRequest.u32\":\n\t\treturn x.U32 != uint32(0)\n\tcase \"testpb.MsgRequest.u64\":\n\t\treturn x.U64 != uint64(0)\n\tcase \"testpb.MsgRequest.str\":\n\t\treturn x.Str != \"\"\n\tcase \"testpb.MsgRequest.bz\":\n\t\treturn len(x.Bz) != 0\n\tcase \"testpb.MsgRequest.timestamp\":\n\t\treturn x.Timestamp != nil\n\tcase \"testpb.MsgRequest.duration\":\n\t\treturn x.Duration != nil\n\tcase \"testpb.MsgRequest.i32\":\n\t\treturn x.I32 != int32(0)\n\tcase \"testpb.MsgRequest.i64\":\n\t\treturn x.I64 != int64(0)\n\tcase \"testpb.MsgRequest.a_bool\":\n\t\treturn x.ABool != false\n\tcase \"testpb.MsgRequest.an_enum\":\n\t\treturn x.AnEnum != 0\n\tcase \"testpb.MsgRequest.a_message\":\n\t\treturn x.AMessage != nil\n\tcase \"testpb.MsgRequest.a_coin\":\n\t\treturn x.ACoin != nil\n\tcase \"testpb.MsgRequest.an_address\":\n\t\treturn x.AnAddress != \"\"\n\tcase \"testpb.MsgRequest.page\":\n\t\treturn x.Page != nil\n\tcase \"testpb.MsgRequest.bools\":\n\t\treturn len(x.Bools) != 0\n\tcase \"testpb.MsgRequest.uints\":\n\t\treturn len(x.Uints) != 0\n\tcase \"testpb.MsgRequest.strings\":\n\t\treturn len(x.Strings) != 0\n\tcase \"testpb.MsgRequest.enums\":\n\t\treturn len(x.Enums) != 0\n\tcase \"testpb.MsgRequest.durations\":\n\t\treturn len(x.Durations) != 0\n\tcase \"testpb.MsgRequest.some_messages\":\n\t\treturn len(x.SomeMessages) != 0\n\tcase \"testpb.MsgRequest.positional1\":\n\t\treturn x.Positional1 != int32(0)\n\tcase \"testpb.MsgRequest.positional2\":\n\t\treturn x.Positional2 != \"\"\n\tcase \"testpb.MsgRequest.positional3_varargs\":\n\t\treturn len(x.Positional3Varargs) != 0\n\tcase \"testpb.MsgRequest.deprecated_field\":\n\t\treturn x.DeprecatedField != \"\"\n\tcase \"testpb.MsgRequest.shorthand_deprecated_field\":\n\t\treturn x.ShorthandDeprecatedField != \"\"\n\tcase \"testpb.MsgRequest.hidden_bool\":\n\t\treturn x.HiddenBool != false\n\tcase \"testpb.MsgRequest.a_validator_address\":\n\t\treturn x.AValidatorAddress != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: testpb.MsgRequest\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message testpb.MsgRequest does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "4c8c429116d3d030eb350243fa9c1f5a", "score": "0.5210523", "text": "func getRequestMessage(messageID string, payload []byte) []byte {\n\n\treqMessageIDBytes, err := hex.DecodeString(messageID)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\trequest := protobuf.Msg{\n\t\tMessageID: reqMessageIDBytes,\n\t\tPayload: payload,\n\t\tCheckSum: checksum(reqMessageIDBytes, payload),\n\t}\n\trequestBytes, err := proto.Marshal(&request)\n\tif err != nil {\n\t\tlog.Fatal(\"Marshaling error: \", err)\n\t}\n\n\treturn requestBytes\n}", "title": "" }, { "docid": "8ac740a3c4f542186e27cf5add8d9896", "score": "0.52063936", "text": "func (v Bool) isMessage() bool{\n\treturn true\n}", "title": "" }, { "docid": "ffa9128ab675bbae7af485919ebd02ca", "score": "0.51976657", "text": "func (WlDataOfferReceiveRequest) MessageName() string { return \"receive\" }", "title": "" }, { "docid": "9a6994adae1402f62a443dd8187be410", "score": "0.51910436", "text": "func (client APIManagementServicesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client, req)\n}", "title": "" }, { "docid": "50adaaa8cad9b53902f3b7a507d83f0e", "score": "0.5178951", "text": "func (m Msg) Ok() bool {\n\tif len(m) < 2 {\n\t\treturn false\n\t}\n\tswitch m.Cmd() {\n\tcase invite:\n\t\treturn len(m.Body()) == inviteLen\n\tcase rsvp:\n\t\treturn len(m.Body()) >= rsvpLen\n\tcase nominate:\n\t\treturn len(m.Body()) >= nominateLen\n\tcase vote:\n\t\treturn len(m.Body()) >= voteLen\n\t}\n\treturn false\n}", "title": "" }, { "docid": "4369ca93dbbd39ded5025045cfc7e979", "score": "0.51776963", "text": "func (v *Validator) Check(ok bool, key, message string) {\n\tif !ok {\n\t\tv.AddError(key, message)\n\t}\n}", "title": "" }, { "docid": "9ede819ee01223c26bd621f309eb9e8e", "score": "0.51754755", "text": "func validRequest(req *dns.Msg) (ok bool) {\n\t// 1. a client or server receives a message with a non-zero Message ID.\n\tif req.Id != 0 {\n\t\treturn false\n\t}\n\n\t// 2. an implementation receives a message containing the edns-tcp-keepalive\n\t// EDNS(0) Option [RFC7828].\n\tif opt := req.IsEdns0(); opt != nil {\n\t\tfor _, option := range opt.Option {\n\t\t\tif option.Option() == dns.EDNS0TCPKEEPALIVE {\n\t\t\t\tclog.Debug(\"client sent EDNS0 TCP keepalive option\")\n\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. the client or server does not indicate the expected STREAM FIN after\n\t// sending requests or responses.\n\t//\n\t// This is quite problematic to validate this case since this would imply\n\t// we have to wait until STREAM FIN is arrived before we start processing\n\t// the message. So we're consciously ignoring this case in this\n\t// implementation.\n\n\t// 4. a server receives a \"replayable\" transaction in 0-RTT data\n\t//\n\t// The information necessary to validate this is not exposed by quic-go.\n\n\treturn true\n}", "title": "" }, { "docid": "92b47dbc1319380bc76ca8ab11059041", "score": "0.51672655", "text": "func processMsg(w http.ResponseWriter, r *http.Request) *apiResponse {\n\n\t//\n\t// Get the message from the request\n\tmsg := r.FormValue(\"message\")\n\tif len(msg) == 0 {\n\t\tresp := apiResponse{StatusCode: http.StatusBadRequest, Message: \"Empty Body in the Request\", Data: nil}\n\t\treturn &resp\n\t\t//http.Error(w, \"Failed to read the body of the request\", http.StatusBadRequest)\n\t}\n\n\t//\n\t// Build the response struct\n\trespData, err := processMsgHelper(&msg)\n\tif err != nil {\n\t\tresp := apiResponse{StatusCode: http.StatusInternalServerError, Message: \"Server Error\", Data: nil}\n\t\treturn &resp\n\t}\n\n\tresp := apiResponse{StatusCode: http.StatusOK, Message: \"\", Data: respData}\n\treturn &resp\n}", "title": "" }, { "docid": "c89d2a8e45e9e4d23bab0f511964a385", "score": "0.51500565", "text": "func (ZwpTextInputV3EnableRequest) MessageName() string { return \"enable\" }", "title": "" }, { "docid": "4db7bcce3e205dfd0d885e113a78a31a", "score": "0.51496714", "text": "func CheckReq(req string, exp string, t *testing.T) {\n\tresp := DoReq(req, t)\n\tif resp != exp {\n\t\tt.Fatalf(\"Unexpected response string '%s', expected '%s'\", resp, exp)\n\t}\n}", "title": "" }, { "docid": "00dcfdafaa361aff954c18dc1d49e2be", "score": "0.5136003", "text": "func BadRequestMessage(c *fiber.Ctx, message string) {\n\tsetStatus(c, fiber.StatusBadRequest, newErrorResult(message))\n}", "title": "" }, { "docid": "e0ddd1393cdf0268cefc69bae8ad54c2", "score": "0.51256907", "text": "func readRequest(r *http.Request) string {\n\terr := r.ParseForm()\n\t// TODO: Change HTTP status code\n\tif err != nil {\n\t\treturn string(err.Error())\n\t}\n\t// Check incoming token against config\n\tif len(r.Form[\"token\"]) == 0 || r.Form[\"token\"][0] != os.Getenv(\"SLACK_TOKEN\") {\n\t\treturn \"Incoming token does not match configured SLACK_TOKEN\"\n\t}\n\tif len(r.Form[\"text\"]) == 0 {\n\t\treturn \"Empty Text\"\n\t}\n\ttext := strings.TrimSpace(r.Form[\"text\"][0])\n\tif text == \"list\" {\n\t\treturn \"https://api.imgflip.com/popular_meme_ids\"\n\t}\n\tparsedText := regEx.FindStringSubmatch(text)\n\n\tif parsedText == nil {\n\t\treturn \"Try again: /meme 61579 top: ONE DOES NOT SIMPLY bottom: CREATE A MEME\"\n\t}\n\ttemplateId := parsedText[0]\n\ttopText := parsedText[3]\n\tbottomText := parsedText[5]\n\n\tchannel := r.Form[\"channel_id\"][0]\n\tmemeUrl, err := createMeme(templateId, topText, bottomText)\n\tif err != nil {\n\t\treturn \"Failed to create meme\"\n\t}\n\terr = sendMeme(channel, memeUrl)\n\tif err != nil {\n\t\treturn \"Failed to send message.\"\n\t}\n\treturn fmt.Sprintf(\"Meme created : [%s]\", memeUrl)\n}", "title": "" }, { "docid": "4cca622f29fc60bb921d77556d42df8f", "score": "0.51220423", "text": "func CheckMessages(messageService MessageService,\n\tuserTo string) ([]Message, error) {\n\tlog.Printf(\"CheckMessages, Message: %s\\n\", userTo)\n\treturn messageService.GetMessages(userTo)\n}", "title": "" }, { "docid": "e6de5c70579a773d1c136f5bdecdcf69", "score": "0.5120482", "text": "func parseMessage(r *http.Request) (*message, error) {\n\tdecoder := json.NewDecoder(r.Body)\n\n\tvar msg message\n\terr := decoder.Decode(&msg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &msg, err\n}", "title": "" }, { "docid": "d9d1c180fa3a158c7f094473933323e5", "score": "0.51030976", "text": "func (t *MessagingBoardChaincode) getMessage(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tvar message Message = Message{}\n\tvar byteMessage []byte\n\tvar messages []Message\n\tvar err error\n\tvar IDKey string\n\tvar identityMessage IdentityMessage\n\tvar found bool\n\tvar descriptionError string = \"\"\n\n\tLogMessage(INFO, \"getMessage()\", time.Now().Format(time.RFC3339))\n\n\t// Control Parameter\n\tif len(args) != 4 && len(args) != 5 {\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage numbers of Args not correctly!: \", strconv.Itoa(len(args)))\n\t\treturn shim.Error(\"MessagingBoardChaincode getMessage ERROR: numbers of Args not correctly!:\\n\")\n\t}\n\n\tmessage.PkPreamble.Domain = strings.TrimSpace(args[0])\n\tmessage.PkPreamble.Environment = strings.TrimSpace(args[1])\n\tmessage.PkPreamble.Process = strings.TrimSpace(args[2])\n\tmessage.Name = strings.TrimSpace(args[3])\n\tLogMessage(DEBUG, \"getMessage() with Domain : \", message.PkPreamble.Domain)\n\tLogMessage(DEBUG, \"getMessage() with Environment: \", message.PkPreamble.Environment)\n\tLogMessage(DEBUG, \"getMessage() with Process : \", message.PkPreamble.Process)\n\tLogMessage(DEBUG, \"getMessage() with Name : \", message.Name)\n\n\t// Control IdentityMessage into CA and check the authorization to GetMessage\n\tidentityMessage, found, err = GetIdentityMessage(stub)\n\tif err != nil {\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage GetIdentityMessage err not nil\", err.Error())\n\t\treturn shim.Error(err.Error())\n\t}\n\tif !found {\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage GetIdentityMessage err nil but something mandatory notfound\", \"\")\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode fileds mandatory are ROLE: \", identityMessage.Role)\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode fileds mandatory are UUID: \", identityMessage.Client)\n\t\treturn shim.Error(\"MessagingBoardChaincode getMessage GetIdentityMessage err nil but something notfound\")\n\t}\n\tif identityMessage.Role != \"\" && identityMessage.Role != WRITER && identityMessage.Role != READER {\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage ERROR: role found but is not creator and not user!!!\", identityMessage.Role)\n\t\treturn shim.Error(\"MessagingBoardChaincode getMessage ERROR: role is not authorized to get a Message!!!\")\n\t}\n\tfound, descriptionError, message.PkPreamble, message.Name = CheckIdentityMessage(identityMessage, message)\n\tif descriptionError != \"\" || !found {\n\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage CheckIdentityMessage err not nil\", descriptionError)\n\t\treturn shim.Error(descriptionError)\n\t}\n\n\tif len(args) == 5 {\n\t\t// Key complete with 5 parameters - Simple GetState\n\t\tmessage.Version, err = strconv.Atoi(args[4])\n\t\tif err != nil {\n\t\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage strconv.Atoi err not nil\", err.Error())\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t\t// Create the KEY\n\t\tIDKey, err = stub.CreateCompositeKey(MESSAGE, []string{message.PkPreamble.Domain, message.PkPreamble.Environment, message.PkPreamble.Process, message.Name, strconv.Itoa(message.Version)})\n\t\t// IDKey, err = getKey(stub, MESSAGE, message.PkPreamble.Domain+message.PkPreamble.Environment+message.PkPreamble.Process+message.Name+versionString)\n\t\tif err != nil {\n\t\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage getKey err not nil\", err.Error())\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t\tbyteMessage, err = stub.GetState(IDKey)\n\t\tLogMessage(INFO, \"MessagingBoardChaincode getMessage Message version found is OK\", string(byteMessage))\n\t\tif err != nil {\n\t\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage GetState err not nil\", err.Error())\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t} else {\n\t\t// Partial Key number of parameters: 4\n\t\t// GetState for partial key -> list of message\n\n\t\t// Create the KEY\n\t\tIDKey, err = stub.CreateCompositeKey(MESSAGE, []string{message.PkPreamble.Domain, message.PkPreamble.Environment, message.PkPreamble.Process, message.Name})\n\t\t// IDKey, err = getKey(stub, MESSAGE, message.PkPreamble.Domain+message.PkPreamble.Environment+message.PkPreamble.Process+message.Name)\n\t\tif err != nil {\n\t\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage getKey partial err not nil\", err.Error())\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\t\tvar arrayKey = []string{message.PkPreamble.Domain, message.PkPreamble.Environment, message.PkPreamble.Process, message.Name}\n\t\tmessages, err = GetStateByPartialCompositeKeyMessage(stub, arrayKey)\n\t\tif err != nil {\n\t\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage GetStateByPartialCompositeKeyObject err not nil\", err.Error())\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t\tif len(messages) == 0 {\n\t\t\tbyteMessage = nil\n\t\t\tLogMessage(WARNING, \"MessagingBoardChaincode getMessage Message not found -return nil\", IDKey)\n\t\t} else {\n\t\t\tbyteMessage, err = json.Marshal(messages[len(messages)-1])\n\t\t\tLogMessage(INFO, \"MessagingBoardChaincode getMessage Message latest found is OK\", string(byteMessage))\n\t\t\tif err != nil {\n\t\t\t\tLogMessage(ERROR, \"MessagingBoardChaincode getMessage Marshal err not nil\", err.Error())\n\t\t\t\treturn shim.Error(err.Error())\n\t\t\t}\n\t\t}\n\t}\n\tif byteMessage == nil {\n\t\treturn shim.Success(nil)\n\t}\n\treturn shim.Success(byteMessage)\n}", "title": "" }, { "docid": "e661914cdefce1db41b593482236f541", "score": "0.50921357", "text": "func checkIncomingMsg(incomingMsg chan<- global.Message) {\n\tfor {\n\t\tudpMessage := <-udpReceive\n\t\tvar message global.Message\n\n\t\tif err := json.Unmarshal(udpMessage.data[:udpMessage.length], &message); err != nil {\n\t\t\tlog.Printf(\"%sjson.Unmarshal error: %v\\n%s\", global.ColorR, err, global.ColorN)\n\t\t}\n\t\tmessage.Addr = udpMessage.raddr\n\t\tincomingMsg <- message\n\t}\n}", "title": "" }, { "docid": "278881d2682d1da2ff79b5a6ccd4bbca", "score": "0.508728", "text": "func (m *Message) Validate() error {\n\tif m == nil {\n\t\treturn errors.New(\"message cannot be nil\")\n\t}\n\n\tswitch msg := m.Sum.(type) {\n\tcase *Message_ChunkRequest:\n\t\tif m.GetChunkRequest().Height == 0 {\n\t\t\treturn errors.New(\"height cannot be 0\")\n\t\t}\n\n\tcase *Message_ChunkResponse:\n\t\tif m.GetChunkResponse().Height == 0 {\n\t\t\treturn errors.New(\"height cannot be 0\")\n\t\t}\n\t\tif m.GetChunkResponse().Missing && len(m.GetChunkResponse().Chunk) > 0 {\n\t\t\treturn errors.New(\"missing chunk cannot have contents\")\n\t\t}\n\t\tif !m.GetChunkResponse().Missing && m.GetChunkResponse().Chunk == nil {\n\t\t\treturn errors.New(\"chunk cannot be nil\")\n\t\t}\n\n\tcase *Message_SnapshotsRequest:\n\n\tcase *Message_SnapshotsResponse:\n\t\tif m.GetSnapshotsResponse().Height == 0 {\n\t\t\treturn errors.New(\"height cannot be 0\")\n\t\t}\n\t\tif len(m.GetSnapshotsResponse().Hash) == 0 {\n\t\t\treturn errors.New(\"snapshot has no hash\")\n\t\t}\n\t\tif m.GetSnapshotsResponse().Chunks == 0 {\n\t\t\treturn errors.New(\"snapshot has no chunks\")\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown message type: %T\", msg)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5a0729b39a6b1f24ea8bb5fd90a754be", "score": "0.50868595", "text": "func Test_IncomingRequest_Check(t *testing.T) {\n\tt.Parallel()\n\n\tctx := inslogger.TestContext(t)\n\tcfg := DefaultLightConfig()\n\ts, err := NewServer(ctx, cfg, nil)\n\trequire.NoError(t, err)\n\tdefer s.Stop()\n\n\t// First pulse goes in storage then interrupts.\n\ts.SetPulse(ctx)\n\n\tt.Run(\"registered is older than reason returns error\", func(t *testing.T) {\n\t\tmsg, _ := MakeSetIncomingRequest(gen.ID(), gen.IDWithPulse(s.Pulse()+1), insolar.ID{}, true, true)\n\t\trep := SendMessage(ctx, s, &msg)\n\t\tRequireErrorCode(rep, payload.CodeInvalidRequest)\n\t})\n\n\tt.Run(\"detached returns error\", func(t *testing.T) {\n\t\tmsg, _ := MakeSetIncomingRequest(gen.ID(), gen.IDWithPulse(s.Pulse()), insolar.ID{}, true, true)\n\t\t// Faking detached request.\n\t\trecord.Unwrap(&msg.Request).(*record.IncomingRequest).ReturnMode = record.ReturnSaga\n\t\trep := SendMessage(ctx, s, &msg)\n\t\tRequireErrorCode(rep, payload.CodeInvalidRequest)\n\t})\n\n\tt.Run(\"registered API request appears in pendings\", func(t *testing.T) {\n\t\tmsg, _ := MakeSetIncomingRequest(gen.ID(), gen.IDWithPulse(s.Pulse()), insolar.ID{}, true, true)\n\t\trep := SendMessage(ctx, s, &msg)\n\t\tRequireNotError(rep)\n\t\treqInfo := rep.(*payload.RequestInfo)\n\n\t\ts.SetPulse(ctx)\n\n\t\trep = CallGetPendings(ctx, s, reqInfo.RequestID)\n\t\tRequireNotError(rep)\n\n\t\tids := rep.(*payload.IDs)\n\t\trequire.Equal(t, 1, len(ids.IDs))\n\t\trequire.Equal(t, reqInfo.RequestID, ids.IDs[0])\n\t})\n\n\tt.Run(\"registered request appears in pendings\", func(t *testing.T) {\n\t\tmsg, _ := MakeSetIncomingRequest(gen.ID(), gen.IDWithPulse(s.Pulse()), insolar.ID{}, true, true)\n\t\tfirstObjP := SendMessage(ctx, s, &msg)\n\t\tRequireNotError(firstObjP)\n\t\treqInfo := firstObjP.(*payload.RequestInfo)\n\n\t\ts.SetPulse(ctx)\n\n\t\tmsg, _ = MakeSetIncomingRequest(gen.ID(), reqInfo.RequestID, reqInfo.RequestID, true, false)\n\t\tsecondObjP := SendMessage(ctx, s, &msg)\n\t\tRequireNotError(secondObjP)\n\t\tsecondReqInfo := secondObjP.(*payload.RequestInfo)\n\n\t\ts.SetPulse(ctx)\n\n\t\tsecondPendings := CallGetPendings(ctx, s, secondReqInfo.RequestID)\n\t\tRequireNotError(secondPendings)\n\n\t\tids := secondPendings.(*payload.IDs)\n\t\trequire.Equal(t, 1, len(ids.IDs))\n\t\trequire.Equal(t, secondReqInfo.RequestID, ids.IDs[0])\n\t})\n\n\tt.Run(\"closed request does not appear in pendings\", func(t *testing.T) {\n\t\tmsg, _ := MakeSetIncomingRequest(gen.ID(), gen.IDWithPulse(s.Pulse()), insolar.ID{}, true, true)\n\t\trep := SendMessage(ctx, s, &msg)\n\t\tRequireNotError(rep)\n\t\treqInfo := rep.(*payload.RequestInfo)\n\n\t\ts.SetPulse(ctx)\n\n\t\tp, _ := CallActivateObject(ctx, s, reqInfo.RequestID)\n\t\tRequireNotError(p)\n\n\t\ts.SetPulse(ctx)\n\n\t\tp = CallGetPendings(ctx, s, reqInfo.RequestID)\n\n\t\terr := p.(*payload.Error)\n\t\trequire.Equal(t, insolar.ErrNoPendingRequest.Error(), err.Text)\n\t})\n}", "title": "" }, { "docid": "a0701c2c961442eccc3f9946ca2abb1b", "score": "0.507892", "text": "func (rtu *RequestTargetUpdate) check() error {\n\tif _, ok := rtu.mutation.RequestID(); rtu.mutation.RequestCleared() && !ok {\n\t\treturn errors.New(`ent: clearing a required unique edge \"RequestTarget.request\"`)\n\t}\n\tif _, ok := rtu.mutation.UserID(); rtu.mutation.UserCleared() && !ok {\n\t\treturn errors.New(`ent: clearing a required unique edge \"RequestTarget.user\"`)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "83b1270d54bd814e34485fd605020af4", "score": "0.5074781", "text": "func Validate(msg *ssmmds.Message) error {\n\tif msg == nil {\n\t\treturn errors.New(\"Message is nil\")\n\t}\n\tif empty(msg.Topic) {\n\t\treturn errors.New(\"Topic is missing\")\n\t}\n\tif empty(msg.Destination) {\n\t\treturn errors.New(\"Destination is missing\")\n\t}\n\tif empty(msg.MessageId) {\n\t\treturn errors.New(\"MessageId is missing\")\n\t}\n\tif empty(msg.CreatedDate) {\n\t\treturn errors.New(\"CreatedDate is missing\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "34b45bcbad332be35c0ae3ad9a6b50c7", "score": "0.50646025", "text": "func (ctx *HandlerContext) IsRequest() bool {\n\treturn ctx.msg.nonce > 0\n}", "title": "" }, { "docid": "7674f492b238f61ddd155eee5b6948b1", "score": "0.5061681", "text": "func CheckIn(w http.ResponseWriter, r *http.Request) {\n\n}", "title": "" }, { "docid": "174ae1de3955cf3e40c9e3ea8d8b1129", "score": "0.5060816", "text": "func (WlDataOfferAcceptRequest) MessageName() string { return \"accept\" }", "title": "" }, { "docid": "2f4e6d8b1c7e7539d722495c8beecb31", "score": "0.50607884", "text": "func (req *SMSMultiSendV1Request) Verify() error {\n\tif len(req.Mobile) == 0 {\n\t\treturn errors.New(\"Miss param: mobile\")\n\t}\n\tif len(req.Text) == 0 {\n\t\treturn errors.New(\"Miss param: text\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "377984f567af1cd3d1dd3084329cbabc", "score": "0.5057354", "text": "func TestMsgParseRequestUtf8(t *testing.T) {\n\tencoded, id, name, payload := rndRequestMsg(\n\t\tMsgRequestUtf8,\n\t\t2, 255,\n\t\t16, 16,\n\t)\n\n\t// Initialize expected message\n\texpected := Message{\n\t\tType: MsgRequestUtf8,\n\t\tIdentifier: id,\n\t\tName: string(name),\n\t\tPayload: payload,\n\t}\n\n\t// Parse\n\tactual := tryParseNoErr(t, encoded)\n\n\t// Compare\n\tcompareMessages(t, expected, actual)\n}", "title": "" }, { "docid": "08894bf5a45b7a0fc019b8d6cf7b5d0a", "score": "0.5051281", "text": "func (client GlobalClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {\n\treturn autorest.SendWithSender(client,\n\t\treq,\n\t\tazure.DoRetryWithRegistration(client.Client))\n}", "title": "" }, { "docid": "0888d0522057e9835fd1806e240cb039", "score": "0.5049814", "text": "func (m *validatorResponse) Message() ValidationMessage {\n\treturn m.messageField\n}", "title": "" }, { "docid": "f71d39f0a2dcb340a66db75efc2667d0", "score": "0.5049439", "text": "func (plugin StatusPlugin) Message() string {\n\treturn plugin.request.Text\n}", "title": "" }, { "docid": "ef41c282d7d6441db6a7b7e569e801bb", "score": "0.50468075", "text": "func (msg ServiceMsg) ValidateBasic() error {\n\treturn msg.Request.ValidateBasic()\n}", "title": "" }, { "docid": "2d5fc39872c0547e7b00bbc4d71eceee", "score": "0.5046489", "text": "func check(err error, errResp *scheme.Error) error {\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"fail to make a request to Veryfi\")\n\t}\n\n\t// Parse down to a more meaningful error.\n\tif *errResp != (scheme.Error{}) {\n\t\tctx := \"\"\n\t\tif len(errResp.Error) > 0 {\n\t\t\tctx = errResp.Error\n\t\t}\n\t\tif len(errResp.Message) > 0 {\n\t\t\tctx = errResp.Message\n\t\t}\n\n\t\treturn errors.Errorf(\n\t\t\t\"get a response from Veryfi with status=%s and context=%s\",\n\t\t\terrResp.Status, ctx,\n\t\t)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f25e44bfaecb50bcda1b89d054996a0e", "score": "0.5042314", "text": "func checkIfEventSatisfiesRequest(request *Request, event *info.Event) bool {\n\tstartTime := request.StartTime\n\tendTime := request.EndTime\n\teventTime := event.Timestamp\n\tif !startTime.IsZero() {\n\t\tif startTime.After(eventTime) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif !endTime.IsZero() {\n\t\tif endTime.Before(eventTime) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif request.EventType[event.EventType] != true {\n\t\treturn false\n\t}\n\tif request.ContainerName != \"\" {\n\t\treturn checkIfIsSubcontainer(request, event)\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9f18e4eff4b1bbf4b52a730a7ad4dd46", "score": "0.5040303", "text": "func (h *DontSendHandler) Check(dataSize uint64) error {\n\tif dataSize > h.limit {\n\t\tlog.Warn(\"Blockchain size exceeds limit\", \"limit\", h.limit, \"actual\", dataSize)\n\t\tlog.Debug(\"Selected strategy for exceeded limit is \\\"don't send\\\".\")\n\t\treturn errors.New(\"Blockchain size exceeds limit and should not be sent\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5fd34aa92388181ae899c080902540a7", "score": "0.50392056", "text": "func ParseAndValidateGetMessageRequest(r *http.Request) (req GetMessagesRequest, err error) {\n\tparams := r.URL.Query()\n\t// parse recipient, required\n\tif val, parseErr := parsePositiveInt(params.Get(\"recipient\")); parseErr == nil {\n\t\treq.RecipientID = val\n\t} else {\n\t\terr = parseErr\n\t\treturn\n\t}\n\t// parse start, required\n\tif val, parseErr := parsePositiveInt(params.Get(\"start\")); parseErr == nil {\n\t\treq.StartMsgID = val\n\t} else {\n\t\terr = parseErr\n\t\treturn\n\t}\n\t// parse limit, optional\n\tif val, parseErr := parsePositiveInt(params.Get(\"limit\")); parseErr == nil {\n\t\treq.Limit = val\n\t} else {\n\t\treq.Limit = 100\n\t}\n\treturn\n}", "title": "" }, { "docid": "02817cec71d28d04a393751b19d784e9", "score": "0.5038076", "text": "func getAndValidateRequest(ctx context.Context, params map[string]string) (type_util.ConsumerRequest, error) {\n\tnodeID := string(params[\"nodeid\"])\n\trequestID := string(params[\"requestid\"])\n\n\tcRequest, err := db_util.GetPendingConsumerRequestByRequestID(ctx, requestID)\n\tif err != nil || (type_util.ConsumerRequest{}) == cRequest {\n\t\terr = errors.New(\"Error getting the consumer request\")\n\t\tgoto End\n\t}\n\n\tif cRequest.NodeID != nodeID {\n\t\terr = errors.New(\"Node id does not match\")\n\t\tgoto End\n\t}\nEnd:\n\treturn cRequest, err\n}", "title": "" }, { "docid": "2e611f61e7303840648be048757383ce", "score": "0.50344074", "text": "func (s *AcquireSemaphoreRequest) Check() error {\n\tif s.SemaphoreKind == \"\" {\n\t\treturn trace.BadParameter(\"missing parameter SemaphoreKind\")\n\t}\n\tif s.SemaphoreName == \"\" {\n\t\treturn trace.BadParameter(\"missing parameter SemaphoreName\")\n\t}\n\tif s.MaxLeases == 0 {\n\t\treturn trace.BadParameter(\"missing parameter MaxLeases\")\n\t}\n\tif s.Expires.IsZero() {\n\t\treturn trace.BadParameter(\"missing parameter Expires\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2486be8dc16f1ed4effb556a350d92fa", "score": "0.5027233", "text": "func (req *SMSGetReplyV1Request) Verify() error {\n\tif len(req.StartTime) == 0 {\n\t\treturn errors.New(\"Miss param: start_time\")\n\t}\n\tif len(req.EndTime) == 0 {\n\t\treturn errors.New(\"Miss param: end_time\")\n\t}\n\tif req.PageNum == 0 {\n\t\treturn errors.New(\"Miss param: page_num\")\n\t}\n\tif req.PageSize == 0 {\n\t\treturn errors.New(\"Miss param: page_size\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b5224928b55ecdf60704ecf66f2035be", "score": "0.50164986", "text": "func (e GatewayKasResponse_MessageValidationError) Key() bool { return e.key }", "title": "" }, { "docid": "28a609151178e1e24841230bbfa19fb0", "score": "0.5013819", "text": "func validateMsgMetadata(obj *MsgGenData) bool {\n return !(obj.Exports == nil || len(obj.Exports) < 1 || \n obj.NetMsg == \"\" || obj.MsgSig == \"\" || \n obj.Package == \"\")\n}", "title": "" }, { "docid": "c87312cea09daaccbcf91a7a8bef73e2", "score": "0.5010727", "text": "func (p *Handler) Check(w http.ResponseWriter, req *http.Request) {\n\tlog.L().Info(\"receive Check request\")\n\n\tdb, addr, err := getDBConnFunc(req, p.timeout)\n\tif err != nil {\n\t\tlog.L().Error(\"connect to database failed\", zap.Error(err))\n\t\tp.genJSONResp(w, http.StatusBadRequest, CheckResult{\n\t\t\tCommonResult: CommonResult{\n\t\t\t\tResult: failed,\n\t\t\t\tError: err.Error(),\n\t\t\t},\n\t\t})\n\t\treturn\n\t}\n\tdefer db.Close()\n\tlog.L().Info(\"check success\", zap.String(\"address\", addr))\n\n\tp.genJSONResp(w, http.StatusOK, CheckResult{\n\t\tCommonResult: CommonResult{\n\t\t\tResult: success,\n\t\t\tError: \"\",\n\t\t},\n\t})\n}", "title": "" }, { "docid": "561aaf5bae9222b6323ca05f8661c61f", "score": "0.5006771", "text": "func (f *FakeHandler) ValidateRequest(t TestInterface, expectedPath, expectedMethod string, body *string) {\n\tf.lock.Lock()\n\tdefer f.lock.Unlock()\n\tif f.requestCount != 1 {\n\t\tt.Logf(\"Expected 1 call, but got %v. Only the last call is recorded and checked.\", f.requestCount)\n\t}\n\tf.hasBeenChecked = true\n\n\texpectURL, err := url.Parse(expectedPath)\n\tif err != nil {\n\t\tt.Errorf(\"Couldn't parse %v as a URL.\", expectedPath)\n\t}\n\tif f.RequestReceived == nil {\n\t\tt.Errorf(\"Unexpected nil request received for %s\", expectedPath)\n\t\treturn\n\t}\n\tif f.RequestReceived.URL.Path != expectURL.Path {\n\t\tt.Errorf(\"Unexpected request path for request %#v, received: %q, expected: %q\", f.RequestReceived, f.RequestReceived.URL.Path, expectURL.Path)\n\t}\n\tif e, a := expectURL.Query(), f.RequestReceived.URL.Query(); !reflect.DeepEqual(e, a) {\n\t\tt.Errorf(\"Unexpected query for request %#v, received: %q, expected: %q\", f.RequestReceived, a, e)\n\t}\n\tif f.RequestReceived.Method != expectedMethod {\n\t\tt.Errorf(\"Unexpected method: %q, expected: %q\", f.RequestReceived.Method, expectedMethod)\n\t}\n\tif body != nil {\n\t\tif *body != f.RequestBody {\n\t\t\tt.Errorf(\"Received body:\\n%s\\n Doesn't match expected body:\\n%s\", f.RequestBody, *body)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "79eae955dd994574e04962a206a7f5c9", "score": "0.5000585", "text": "func validateRequests(messages []Message) error {\n\tfor i, m := range messages {\n\t\tif err := validateRequest(m); err != nil {\n\t\t\treturn fmt.Errorf(\"message at index %d: %w\", i, err)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ae73fcbd4cc54dd280cb852c9d8b7b88", "score": "0.49975958", "text": "func decodeMessage(req *http.Request) (*extension.Request, error) {\n\text := &extension.Request{}\n\terr := ext.Decode(req.Body)\n\treturn ext, err\n}", "title": "" }, { "docid": "7cdd762eb60f84383d6b243931d4169f", "score": "0.4994389", "text": "func (m *RequestMock) MinimockIsCreationRequestInspect() {\n\tfor _, e := range m.IsCreationRequestMock.expectations {\n\t\tif mm_atomic.LoadUint64(&e.Counter) < 1 {\n\t\t\tm.t.Error(\"Expected call to RequestMock.IsCreationRequest\")\n\t\t}\n\t}\n\n\t// if default expectation was set then invocations count should be greater than zero\n\tif m.IsCreationRequestMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterIsCreationRequestCounter) < 1 {\n\t\tm.t.Error(\"Expected call to RequestMock.IsCreationRequest\")\n\t}\n\t// if func was set then invocations count should be greater than zero\n\tif m.funcIsCreationRequest != nil && mm_atomic.LoadUint64(&m.afterIsCreationRequestCounter) < 1 {\n\t\tm.t.Error(\"Expected call to RequestMock.IsCreationRequest\")\n\t}\n}", "title": "" }, { "docid": "dfac6e26622348e7f223ed43a774c59f", "score": "0.49940076", "text": "func TestValidateRefreshMessageWithNilMessage(t *testing.T) {\n\terr := validateIAMRoleCredentialsMessage(nil)\n\tif err == nil {\n\t\tt.Error(\"Expected validation error validating an empty message\")\n\t}\n}", "title": "" }, { "docid": "dfe0395cb546256ac92b73a7cfa4bd19", "score": "0.49898028", "text": "func (i *Influx) CheckSetup(ctx context.Context) (msg bool, err error) {\n\t// Form request strinsg\n\tres, err := i.HTTPInstance.Get(ctx, i.HTTPClient, i.GetBasicURL()+\"/setup\", nil, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar resBody map[string]interface{}\n\tjson.Unmarshal(res, &resBody)\n\n\tif resBody[\"allowed\"] == true {\n\t\tlogrus.Info(\"Influx has NOT been setup\")\n\t\tmsg = true\n\t\treturn\n\t}\n\n\tmsg = false\n\tlogrus.Info(\"Influx has ALREADY been setup\")\n\treturn\n}", "title": "" }, { "docid": "d45e1579245a8f958eaae01587571650", "score": "0.49857277", "text": "func (o *DowntimeUpdateRequestAttributes) GetMessageOk() (*string, bool) {\n\tif o == nil {\n\t\treturn nil, false\n\t}\n\treturn o.Message.Get(), o.Message.IsSet()\n}", "title": "" }, { "docid": "3d275224cc2b342c73f0b0fcf12b86c0", "score": "0.498365", "text": "func (s *App) checkSignature(r *http.Request, body []byte) error {\n\n\ttimestamp := r.Header.Get(\"X-Slack-Request-Timestamp\")\n\ttime := time.Now().Unix()\n\tstamp, err := strconv.ParseInt(timestamp, 10, 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Check if request is over 5 minutes old and reject if it is. Prevents replay attack\n\tif time-stamp > 300 {\n\t\treturn errors.New(\"invalid timestamp in request header\")\n\t}\n\n\tbase := \"v0:\" + timestamp + \":\" + string(body)\n\tsign := r.Header.Get(\"X-Slack-Signature\")\n\tkey := []byte(s.SigningSecret)\n\n\th := hmac.New(sha256.New, key)\n\th.Write([]byte(base))\n\tresult := \"v0=\" + hex.EncodeToString(h.Sum(nil))\n\n\tif sign == result {\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"invalid request signature\")\n}", "title": "" }, { "docid": "a0ca2cd5e583b3e3440f080c48572e8b", "score": "0.49626556", "text": "func (c *Client) Check() (PingResponse, error) {\n\n\tpath := apiprefix + \"/check\"\n\n\tvar js PingResponse\n\terr := c.sendRequest(\"GET\", path, nil, &js)\n\treturn js, err\n\n}", "title": "" }, { "docid": "131b53b365168cb1d96efb6db7a6c532", "score": "0.49589467", "text": "func TestCheckRequest(t testing.T, source, dest string) *envoyauth.CheckRequest {\n\treturn &envoyauth.CheckRequest{\n\t\tAttributes: &envoyauth.AttributeContext{\n\t\t\tSource: makeAttributeContextPeer(t, source),\n\t\t\tDestination: makeAttributeContextPeer(t, dest),\n\t\t},\n\t}\n}", "title": "" }, { "docid": "854c9a4b626767bbcdcf2b66bb1ba3c5", "score": "0.49562204", "text": "func identifyIgnoreMessage(msg *protocol.RtmpMessage, logger core.Logger) bool {\r\n h := &msg.Header\r\n\r\n if h.IsAckledgement() || h.IsSetChunkSize() || h.IsWindowAckledgementSize() || h.IsUserControlMessage() {\r\n logger.Info(\"ignore the ack/setChunkSize/windowAck/userControl msg\")\r\n return true\r\n }\r\n\r\n if !h.IsAmf0Command() && !h.IsAmf3Command() {\r\n logger.Trace(\"identify ignore messages except AMF0/AMF3 command message, type=%d\", h.MessageType)\r\n return true\r\n }\r\n\r\n return false\r\n}", "title": "" } ]
cd81843da82ca306c4ff462aebc02c8f
Create persists a new Queue into the db
[ { "docid": "717a9b84c414fedb86411f3e443760a4", "score": "0.75053084", "text": "func (r *QueueRepo) Create(q *Queue) (*Queue, error) {\n\tq.ID = bson.NewObjectId()\n\tq.Title = strings.ToUpper(strings.Replace(q.Name, \" \", \"\", -1))\n\tq.IsActive = true\n\tq.CreatedAt = time.Now()\n\n\terr := r.session.DB(r.database).C(r.collection).Insert(q)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn q, nil\n}", "title": "" } ]
[ { "docid": "c3378499defab85b83f00b5e7ace8062", "score": "0.79165655", "text": "func (repo *QueuesRepo) Create(q *Queue) (*Queue, error) {\n\tquery := \"INSERT INTO queues (name, description) VALUES (?, ?)\"\n\tres, err := repo.db.Exec(query, q.Name, q.Description)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tid, err := res.LastInsertId()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tq.ID = id\n\treturn q, nil\n}", "title": "" }, { "docid": "4ea52358cc37e45e50a1928d03ea55d7", "score": "0.6881736", "text": "func (q Queue) CreateQueue() (Queue, error) {\n\tif q.Name == \"\" {\n\t\terr := errors.New(\"Name must be specified\")\n\t\treturn Queue{}, err\n\t}\n\tconnString := fmt.Sprintf(\n\t\t\"%s:%s@/%s?charset=utf8&parseTime=True&loc=Local\",\n\t\tos.Getenv(\"DB_USER\"),\n\t\tos.Getenv(\"DB_PASSWORD\"),\n\t\tos.Getenv(\"DB_NAME\"),\n\t)\n\tdb, err := gorm.Open(os.Getenv(\"DIALECT\"), connString)\n\tdefer db.Close()\n\tif err != nil {\n\t\treturn Queue{}, err\n\t}\n\t// check if queue already exist\n\texists := Queue{}\n\terr = db.Where(\"name = ?\", q.Name).First(&exists).Error\n\tif err != nil {\n\t\treturn Queue{}, err\n\t}\n\tif (Queue{}) != exists {\n\t\treturn Queue{}, errors.New(\"Queue already exist\")\n\t}\n\tif err := db.Create(&q).Error; err != nil {\n\t\treturn Queue{}, err\n\t}\n\treturn q, nil\n}", "title": "" }, { "docid": "c136b33873c994951c6630f12a68d792", "score": "0.6870863", "text": "func (db *Database) CreateQueue(queueName string) error {\n\tqueueFileName := path.Join(db.dataFolder, queueName+logSuffix)\n\tloadedQueue, err := rawlog.Open(queueFileName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdb.queues[queueName] = loadedQueue\n\treturn nil\n}", "title": "" }, { "docid": "c226b37fbcf01a6dc36ba2b9bf273199", "score": "0.6511756", "text": "func (s *ServiceBusCli) CreateQueue(queue QueueEntity) error {\n\tvar commonError error\n\topts := make([]servicebus.QueueManagementOption, 0)\n\n\tctx, cancel := context.WithTimeout(context.Background(), 40*time.Second)\n\tdefer cancel()\n\tif queue.Name == \"\" {\n\t\tcommonError = errors.New(\"Queue name cannot be null\")\n\t\tlogger.Error(commonError.Error())\n\t\treturn commonError\n\t}\n\tlogger.LogHighlight(\"Creating queue %v in service bus %v\", log.Info, queue.Name, s.Namespace.Name)\n\n\tqm := s.GetQueueManager()\n\n\t// Checking if the queue already exists in the namespace\n\texistingSubscription, err := qm.Get(ctx, queue.Name)\n\tif existingSubscription != nil {\n\t\tcommonError = errors.New(\"Subscription \" + queue.Name + \" already exists in service bus\" + s.Namespace.Name)\n\t\tlogger.LogHighlight(\"Subscription %v already exists in service bus %v\", log.Error, queue.Name, s.Namespace.Name)\n\t\treturn commonError\n\t}\n\n\t// Generating subscription options\n\tif queue.LockDuration.Milliseconds() > 0 {\n\t\topts = append(opts, servicebus.QueueEntityWithLockDuration(&queue.LockDuration))\n\t}\n\tif queue.DefaultMessageTimeToLive.Microseconds() > 0 {\n\t\topts = append(opts, servicebus.QueueEntityWithMessageTimeToLive(&queue.DefaultMessageTimeToLive))\n\t}\n\tif queue.AutoDeleteOnIdle.Microseconds() > 0 {\n\t\topts = append(opts, servicebus.QueueEntityWithAutoDeleteOnIdle(&queue.AutoDeleteOnIdle))\n\t}\n\tif queue.MaxDeliveryCount > 0 && queue.MaxDeliveryCount != 10 {\n\t\topts = append(opts, servicebus.QueueEntityWithMaxDeliveryCount(int32(queue.MaxDeliveryCount)))\n\t}\n\n\t// Generating the forward rule, checking if the target exists or not\n\tif queue.Forward.To != \"\" {\n\t\tswitch queue.Forward.In {\n\t\tcase ForwardToTopic:\n\t\t\ttm := s.GetTopicManager()\n\t\t\ttarget, err := tm.Get(ctx, queue.Forward.To)\n\t\t\tif err != nil || target == nil {\n\t\t\t\tlogger.LogHighlight(\"Could not find forwarding topic %v in service bus %v\", log.Error, queue.Forward.To, s.Namespace.Name)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts = append(opts, servicebus.QueueEntityWithAutoForward(target))\n\t\tcase ForwardToQueue:\n\t\t\tqm := s.GetQueueManager()\n\t\t\ttarget, err := qm.Get(ctx, queue.Forward.To)\n\t\t\tif err != nil || target == nil {\n\t\t\t\tlogger.LogHighlight(\"Could not find forwarding queue %v in service bus %v\", log.Error, queue.Forward.To, s.Namespace.Name)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts = append(opts, servicebus.QueueEntityWithForwardDeadLetteredMessagesTo(target))\n\t\t}\n\t}\n\n\t// Generating the Dead Letter forwarding rule, checking if the target exist or not\n\tif queue.ForwardDeadLetter.To != \"\" {\n\t\tswitch queue.ForwardDeadLetter.In {\n\t\tcase ForwardToTopic:\n\t\t\ttm := s.GetTopicManager()\n\t\t\ttarget, err := tm.Get(ctx, queue.ForwardDeadLetter.To)\n\t\t\tif err != nil || target == nil {\n\t\t\t\tlogger.LogHighlight(\"Could not find forwarding topic %v in service bus %v\", log.Error, queue.Forward.To, s.Namespace.Name)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts = append(opts, servicebus.QueueEntityWithAutoForward(target))\n\t\tcase ForwardToQueue:\n\t\t\tqm := s.GetQueueManager()\n\t\t\ttarget, err := qm.Get(ctx, queue.ForwardDeadLetter.To)\n\t\t\tif err != nil || target == nil {\n\t\t\t\tlogger.LogHighlight(\"Could not find forwarding queue %v in service bus %v\", log.Error, queue.Forward.To, s.Namespace.Name)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts = append(opts, servicebus.QueueEntityWithAutoForward(target))\n\t\t}\n\t}\n\n\t_, err = qm.Put(ctx, queue.Name, opts...)\n\tif err != nil {\n\t\tlogger.Error(err.Error())\n\t\treturn err\n\t}\n\n\tlogger.LogHighlight(\"Queue %v was created successfully in service bus %v\", log.Info, queue.Name, s.Namespace.Name)\n\treturn nil\n}", "title": "" }, { "docid": "a4e73e859c8e888e239e86de960a95df", "score": "0.64377284", "text": "func (q *Queue) Create() {\n\tq.used <- <-q.pending\n}", "title": "" }, { "docid": "82eb2d31cda50c6bbe6a7d92196f715f", "score": "0.640009", "text": "func (s *Server) CreateQueue(ctx context.Context, in *tasks.CreateQueueRequest) (*tasks.Queue, error) {\n\tqueueState := in.GetQueue()\n\n\tname := queueState.GetName()\n\tnameMatched, _ := regexp.MatchString(\"projects/[A-Za-z0-9-]+/locations/[A-Za-z0-9-]+/queues/[A-Za-z0-9-]+\", name)\n\tif !nameMatched {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"Queue name must be formatted: \\\"projects/<PROJECT_ID>/locations/<LOCATION_ID>/queues/<QUEUE_ID>\\\"\")\n\t}\n\tparent := in.GetParent()\n\tparentMatched, _ := regexp.MatchString(\"projects/[A-Za-z0-9-]+/locations/[A-Za-z0-9-]+\", parent)\n\tif !parentMatched {\n\t\treturn nil, status.Errorf(codes.InvalidArgument, \"Invalid resource field value in the request.\")\n\t}\n\tqueue, ok := s.fetchQueue(name)\n\tif ok {\n\t\tif queue != nil {\n\t\t\treturn nil, status.Errorf(codes.AlreadyExists, \"Queue already exists\")\n\t\t}\n\n\t\treturn nil, status.Errorf(codes.FailedPrecondition, \"The queue cannot be created because a queue with this name existed too recently.\")\n\t}\n\n\t// Make a deep copy so that the original is frozen for the http response\n\tqueue, queueState = NewQueue(\n\t\tname,\n\t\tproto.Clone(queueState).(*tasks.Queue),\n\t\tfunc(task *Task) {\n\t\t\ts.removeTask(task.state.GetName())\n\t\t},\n\t)\n\ts.setQueue(name, queue)\n\tqueue.Run()\n\n\treturn queueState, nil\n}", "title": "" }, { "docid": "b1d5099b9b70123e26bc6520c4a3b42b", "score": "0.6306198", "text": "func (sqs *SQS) CreateQueue(name string, opt *CreateQueueOpt) (*Queue, error) {\n\tparams := url.Values{\n\t\t\"QueueName\": []string{name},\n\t}\n\tif opt != nil {\n\t\tdvt := strconv.Itoa(opt.DefaultVisibilityTimeout)\n\t\tparams[\"DefaultVisibilityTimeout\"] = []string{dvt}\n\t}\n\tvar resp createQueuesResponse\n\tif err := sqs.get(\"CreateQueue\", \"/\", params, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\tu, err := url.Parse(resp.QueueUrl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Queue{sqs, u.Path}, nil\n}", "title": "" }, { "docid": "10a77077b3ea436ccd9a17b2502eddc7", "score": "0.62246823", "text": "func createInitialQueue(emulatorServer *Server, name string) {\n\tprint(fmt.Sprintf(\"Creating initial queue %s\\n\", name))\n\n\tr := regexp.MustCompile(\"/queues/[A-Za-z0-9-]+$\")\n\tparentName := r.ReplaceAllString(name, \"\")\n\n\tqueue := &tasks.Queue{Name: name}\n\treq := &tasks.CreateQueueRequest{\n\t\tParent: parentName,\n\t\tQueue: queue,\n\t}\n\n\t_, err := emulatorServer.CreateQueue(context.TODO(), req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "5a0e1d641185740c5a463b565341839d", "score": "0.6206805", "text": "func (_e *Client_Expecter) CreateQueue(ctx interface{}, params interface{}, optFns ...interface{}) *Client_CreateQueue_Call {\n\treturn &Client_CreateQueue_Call{Call: _e.mock.On(\"CreateQueue\",\n\t\tappend([]interface{}{ctx, params}, optFns...)...)}\n}", "title": "" }, { "docid": "40fce827608d4f26739c457663a44c9f", "score": "0.6168605", "text": "func Create(client *gophercloud.ServiceClient, queueName string, opts CreateOptsBuilder) (r CreateResult) {\n\tb, q, err := opts.ToClaimCreateRequest()\n\tif err != nil {\n\t\tr.Err = err\n\t\treturn\n\t}\n\n\turl := createURL(client, queueName)\n\tif q != \"\" {\n\t\turl += q\n\t}\n\n\tresp, err := client.Post(url, b, &r.Body, &gophercloud.RequestOpts{\n\t\tOkCodes: []int{201, 204},\n\t})\n\t_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)\n\treturn\n}", "title": "" }, { "docid": "8f039f234ea7e76d28c67c9807e56a65", "score": "0.61578816", "text": "func NewQueue(pool *redis.Pool, name string) (bool, error) {\n\t// Create and close connection when finished\n\tc := pool.Get()\n\tdefer c.Close()\n\n\tnewQ := Queue{Name: name, Offset: 0, Jobs: make([][]byte, 0)}\n\t// newQ.jobs = make([][]byte, 100)\n\tqBytes, _ := json.Marshal(newQ)\n\tn1, err := c.Do(\"SET\", name, qBytes)\n\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tlog.Infof(\"Queue created with result: %v\", n1)\n\treturn true, nil\n\n}", "title": "" }, { "docid": "a85ceee198398eee4fa7e1d22d0b012a", "score": "0.60753965", "text": "func Create(domain ...string) error {\n\tfor _, v := range domain {\n\t\tif _, ok := queues[v]; ok {\n\t\t\treturn fmt.Errorf(\"queue with name '%s' already exists\", v)\n\t\t}\n\t\tqueues[v] = list.New()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0672154e6b498447992c359baddaf230", "score": "0.5949032", "text": "func NewQueue(name string) QueueEntity {\n\tresult := QueueEntity{\n\t\tMaxDeliveryCount: 10,\n\t}\n\n\tresult.Name = name\n\tresult.Forward.In = ForwardToQueue\n\n\treturn result\n}", "title": "" }, { "docid": "28a36594fe0e0d7c500d194dfb18359e", "score": "0.5905794", "text": "func (c *Client) CreateQueue(name, exchange, key string, durable, autoDelete bool) (*amqp.Channel, error) {\n\tchannel, err := c.connection.Channel()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err = channel.QueueDeclare(\n\t\tname,\n\t\tdurable,\n\t\tautoDelete,\n\t\tfalse, //internal\n\t\tfalse, //no wait\n\t\tnil, //args\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = channel.QueueBind(\n\t\tname,\n\t\tkey,\n\t\texchange,\n\t\tfalse, //no wait\n\t\tnil, //args\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn channel, nil\n}", "title": "" }, { "docid": "2d0aa4dc606321322190169de16a70f1", "score": "0.58445644", "text": "func (m *MemoryTopicDAO) Create(name string) error {\n\tm.set.Add(name)\n\treturn nil\n}", "title": "" }, { "docid": "23d78417e27509ea72405e20f6eb4336", "score": "0.58129406", "text": "func (client *SQS) CreateQueue(*sqs.CreateQueueInput) (*sqs.CreateQueueOutput, error) {\n\tpanic(\"CreateQueue is not implemented\")\n}", "title": "" }, { "docid": "1bac040e11df9a8f0f7a6a66a860c9ae", "score": "0.58020645", "text": "func CreateQueue(req server.Request, resp server.Response, Queues *sync.Map) (string, int) {\n\tvar QueueName = req.Params.Get(\"QueueName\")\n\t// TODO: Move validation to a separate validator\n\tif QueueName == \"\" {\n\t\treturn resp.Error(\"MissingParameter\", \"A required parameter QueueName is not supplied.\")\n\t}\n\n\tvar IsValidQueueName, err = regexp.MatchString(\"^[a-zA-Z0-9_\\\\-]{1,80}$\", QueueName)\n\tif !IsValidQueueName || err != nil {\n\t\treturn resp.Error(\"InvalidParameterValue\", \"The specified queue name is not valid.\")\n\t}\n\n\tvar _, QueueURL = util.CreateQueue(Queues, QueueName)\n\tvar CreateQueueResult = fmt.Sprintf(\"<QueueUrl>%s</QueueUrl>\", QueueURL)\n\treturn resp.Success(\"CreateQueue\", CreateQueueResult)\n}", "title": "" }, { "docid": "13e6dd7c8c483c2aa59e8549294a38dd", "score": "0.5785504", "text": "func NewQ(name string, cfg Config) (*rtQ, error) {\n\tdb, err := bolt.Open(name+\".db\", 0600, &bolt.Options{Timeout: 1 * time.Second})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// make our message queue bucket\n\terr = db.Update(func(tx *bolt.Tx) error {\n\t\t_, err := tx.CreateBucketIfNotExists([]byte(\"mq\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create bucket: %s\", err)\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmq := make(chan Message, 0)\n\n\tgo func() {\n\t\t// begin kv writer\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase msg := <-mq:\n\t\t\t\tdb.Update(func(tx *bolt.Tx) error {\n\t\t\t\t\tmsg.Time = time.Now()\n\t\t\t\t\tmsg.Uuid = uuid.NewV4().String()\n\n\t\t\t\t\tb := tx.Bucket([]byte(\"mq\"))\n\t\t\t\t\tid, _ := b.NextSequence()\n\n\t\t\t\t\tmsg.Seq = fmt.Sprintf(\"%d%d%d%012d\", msg.Time.Year(), msg.Time.Month(), msg.Time.Day(), id)\n\n\t\t\t\t\tbuf, err := json.Marshal(msg)\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\tb.Put([]byte(msg.Seq), buf)\n\n\t\t\t\t\treturn nil\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}()\n\n\trtq := &rtQ{\n\t\tdb: db, // database\n\t\tcfg: cfg, // Config\n\t\tmq: mq, // Message channel\n\t\tstatus: cfg.Logger.Info,\n\t\tstatusError: cfg.Logger.Error,\n\t}\n\n\tgo rtq.tx() // start transmitting\n\n\treturn rtq, nil\n}", "title": "" }, { "docid": "33877ea6b522e9e2f04c5feb351bb936", "score": "0.5779761", "text": "func (d *DB) Create(q *Quote) error {\n\terr := d.db.Update(func(tx *bolt.Tx) error {\n\n\t\t// TODO: Create a bucket if it does not exist already.\n\t\t// Use the constant quoteBucket as the bucket name.\n\t\t//\n\t\t// Remember to use []byte(...) to convert a string into a byte\n\t\t// slice if required.\n\n\n\t\tbucket, err := tx.CreateBucketIfNotExists([]byte(bucketName))\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to create bolt bucket\")\n\t\t}\n\n\t\t// Ensure that the quote we want to save does not already exist.\n\t\t// Hint: Call bucket.Get and verify if the result has zero length.\n\n\t\tif value := bucket.Get([]byte(q.Author)); value != nil {\n\t\t\treturn fmt.Errorf(\"giving up creating quote for author '%s' as already exists\", q.Author)\n\t\t}\n\n\t\t// Serialize the quote, using the Serialize method from quote.go.\n\t\tqbits, err := q.Serialize()\n\n\t\t// Put the serialized quote into the bucket.\n\t\terr = bucket.Put([]byte(q.Author), qbits)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed writing quote to bolt\")\n\t\t}\n\n\t\treturn nil\n\t})\n\n\t// TODO: Check the error returned by d.db.Update. Return an error or nil.\n\treturn err\n}", "title": "" }, { "docid": "41c79daa0499a2e59c13273844bfe572", "score": "0.57593715", "text": "func (s *Store) Create(ctx context.Context, job *jobpool.Job) error {\n\ts.stmtOnce.Do(s.initStmt)\n\n\tj, err := newJob(job)\n\tif err != nil {\n\t\treturn err\n\t}\n\tj.LastMod = j.Created\n\n\terr = RunInTxWithRetry(ctx, s.db, func(ctx context.Context, tx *sql.Tx) error {\n\t\tres, err := tx.Stmt(s.createStmt).ExecContext(\n\t\t\tctx,\n\t\t\tj.ID,\n\t\t\tj.Topic,\n\t\t\tj.State,\n\t\t\tj.Args,\n\t\t\tj.Rank,\n\t\t\tj.Priority,\n\t\t\tj.Retry,\n\t\t\tj.RetryWait,\n\t\t\tj.RetryBackoff,\n\t\t\tj.MaxRetry,\n\t\t\tj.CorrelationGroup,\n\t\t\tj.CorrelationID,\n\t\t\tj.After,\n\t\t\tj.Created,\n\t\t\tj.Started,\n\t\t\tj.Completed,\n\t\t\tj.LastMod,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trowsAffected, err := res.RowsAffected()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif rowsAffected != 1 {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}, func(err error) bool {\n\t\treturn IsDeadlock(err)\n\t})\n\treturn s.wrapError(err)\n}", "title": "" }, { "docid": "bae39f0e7ab429b468e09fcb2937bc43", "score": "0.5749096", "text": "func (d *Driver) CreateCommandQueue(c *Context) *CommandQueue {\n\tq := new(CommandQueue)\n\tq.GPUID = c.currentGPUID\n\tq.Context = c\n\n\tc.queueMutex.Lock()\n\tc.queues = append(c.queues, q)\n\tc.queueMutex.Unlock()\n\n\treturn q\n}", "title": "" }, { "docid": "9c494b93521bcfe1123dc714b3e999a1", "score": "0.5743662", "text": "func CreateWorkflow(w http.ResponseWriter, r *http.Request) {\n\t// set the header to content type x-www-form-urlencoded\n\t// Allow all origin to handle cors issue\n\tw.Header().Set(\"Context-Type\", \"application/x-www-form-urlencoded\")\n\tw.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\tw.Header().Set(\"Access-Control-Allow-Methods\", \"POST\")\n\tw.Header().Set(\"Access-Control-Allow-Headers\", \"Content-Type\")\n\n\t// create an empty workflow of type models.Workflow\n\tvar ds models.DataStatus\n\n\t// decode the json request to workflow\n\terr := json.NewDecoder(r.Body).Decode(&ds)\n\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to decode the request body. %v\\n\", err)\n\t}\n\n\tfmt.Printf(\"Queue size: %v\\n\", fila.Size())\n\n\t// call insert workflow function and pass the workflow\n\tworkflow := insertWorkflow(ds)\n\n\t// put UUID of the workflow in the end of the queue\n\tfila.Enqueue(workflow.UUID)\n\n\tfmt.Printf(\"Queue size: %v\\n\", fila.Size())\n\n\t// format a response object\n\tres := models.Workflow{\n\t\tUUID: workflow.UUID,\n\t\tStatus: workflow.Status,\n\t\tData: workflow.Data,\n\t\tSteps: workflow.Steps,\n\t}\n\n\t// send the response\n\tjson.NewEncoder(w).Encode(res)\n}", "title": "" }, { "docid": "4166ab3cded1ff9d21bbf4b4d06b8e4d", "score": "0.57336307", "text": "func Create(title, body string) (*Task, error) {\n\ttask := Task{\n\t\tTitle: title,\n\t\tBody: body,\n\t}\n\turl := BASE + ENDPOINT\n\tdb, err := gorm.Open(\"mysql\", url)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tdefer db.Close()\n\n\tdb.LogMode(true)\n\tif err := db.Create(&task).Error; err != nil {\n\t\treturn nil, err\n\t}\n\treturn &task, nil\n}", "title": "" }, { "docid": "3f5b8a5648c5263ff791ae053318e956", "score": "0.5711045", "text": "func QueueCreateSerial() *Queue {\n\treturn QueueCreate(1)\n}", "title": "" }, { "docid": "4fe9f41f6a312856ef865456ce184bc7", "score": "0.5707838", "text": "func (c *client) AddToQueue(ctx context.Context, uri string) error {\n\tres, err := c.apiRequest(ctx, http.MethodPost, \"/v1/me/player/queue?uri=\"+uri, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"apiRequest: %s\", err)\n\t}\n\tdefer func() {\n\t\t_ = res.Body.Close()\n\t}()\n\n\tif res.StatusCode != http.StatusNoContent {\n\t\trs, _ := ioutil.ReadAll(res.Body)\n\t\treturn fmt.Errorf(\"unexpected response status %d with body %s\", res.StatusCode, rs)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4631bb1fbf8b0bdc7ae1340cb1ac1c27", "score": "0.569929", "text": "func (q *QueueService) Push(jobType string, job Job) error {\n\tentry := models.QueueEntry{\n\t\tType: jobType,\n\t\tTypeID: job.ID,\n\t\tUser: job.User,\n\t\tUserID: job.User.ID,\n\t\tWeight: job.Weight,\n\t\tStatus: models.StatusQueued,\n\t\tCreatedAt: time.Now(),\n\t}\n\treturn q.db.Create(&entry).Error\n}", "title": "" }, { "docid": "b15c3a143132b692249704f0d28e7c01", "score": "0.56457543", "text": "func (c *MqttMessageQueueFactory) CreateQueue(name string) cqueues.IMessageQueue {\n\tqueue := queues.NewMqttMessageQueue(name)\n\n\tif c.Config != nil {\n\t\tqueue.Configure(c.Config)\n\t}\n\tif c.References != nil {\n\t\tqueue.SetReferences(c.References)\n\t}\n\n\treturn queue\n}", "title": "" }, { "docid": "deb007352d144503dd2ba1d8169ee485", "score": "0.5634971", "text": "func createManagedQueue(parentQI *SchedulingQueue, name string, parent bool, maxRes map[string]string) (*SchedulingQueue, error) {\n\tchildConf := configs.QueueConfig{\n\t\tName: name,\n\t\tParent: parent,\n\t\tQueues: nil,\n\t\tProperties: make(map[string]string),\n\t}\n\tif maxRes != nil {\n\t\tchildConf.Resources = configs.Resources{\n\t\t\tMax: maxRes,\n\t\t}\n\t}\n\tchild, err := cache.NewManagedQueue(childConf, parentQI.QueueInfo)\n\t// something failed in the cache return early\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newSchedulingQueueInfo(child, parentQI), err\n}", "title": "" }, { "docid": "8854ff72b9caf44f0606213166f4c280", "score": "0.5630824", "text": "func (q *Queue) CreateCommand() *exec.Cmd {\n\tvar args []string\n\n\tif q.Vhost != nil {\n\t\targs = append(\n\t\t\targs,\n\t\t\t\"--vhost\",\n\t\t\tq.Vhost.Name,\n\t\t)\n\t}\n\n\targs = append(\n\t\targs,\n\t\t[]string{\n\t\t\t\"declare\",\n\t\t\t\"queue\",\n\t\t\tfmt.Sprintf(\"name=%s\", q.Name),\n\t\t\tfmt.Sprintf(\"durable=%t\", q.Durable),\n\t\t}...,\n\t)\n\n\treturn exec.Command(\n\t\trabbitmqadmin,\n\t\targs...,\n\t)\n}", "title": "" }, { "docid": "84f676261c2c077b7e38bb1891a6e038", "score": "0.56186396", "text": "func CreateQueue(path string) (*Queue, error) {\n\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\terr = os.MkdirAll(path, 0755)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t_, err = os.Stat(path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\tif !fi.IsDir() {\n\t\treturn nil, fmt.Errorf(\"%s already exists and is not a directory\", path)\n\t}\n\tcurDir := filepath.Join(path, \"msg\")\n\tif err := os.MkdirAll(curDir, 0755); err != nil {\n\t\treturn nil, err\n\t}\n\ttmpDir := filepath.Join(path, \"tmp\")\n\tif err := os.MkdirAll(tmpDir, 0755); err != nil {\n\t\treturn nil, err\n\t}\n\tnewDir := filepath.Join(path, \"env\")\n\tif err := os.MkdirAll(newDir, 0755); err != nil {\n\t\treturn nil, err\n\t}\n\treturn GetQueue(path)\n}", "title": "" }, { "docid": "bcf4aa8804977a7d738f41ec8839b9df", "score": "0.55845165", "text": "func (c *Context) CreateCommandQueue(d *Device, cqp CommandQueueProperties) (*CommandQueue, error) {\n\n\tcommandQueue, err := clw.CreateCommandQueue(c.id, d.id, clw.CommandQueueProperties(cqp))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &CommandQueue{\n\t\tid: commandQueue,\n\t\tContext: c,\n\t\tDevice: d,\n\t\tProperties: cqp,\n\t\teventPool: sync.Pool{New: func() interface{} { return make([]clw.Event, eventPoolThreshold) }},\n\t}, nil\n}", "title": "" }, { "docid": "6ea2b96e12cd6e8d14a3cd4671637a46", "score": "0.556306", "text": "func (e *podEnqueue) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface) {\n\tpod, ok := evt.Object.(*corev1.Pod)\n\tif !ok {\n\t\treturn\n\t}\n\tif !e.canAddToQueue(pod) {\n\t\treturn\n\t}\n\tq.Add(reconcile.Request{NamespacedName: types.NamespacedName{\n\t\tName: pod.Spec.NodeName,\n\t}})\n\n}", "title": "" }, { "docid": "19ea67af48316a194b7865c5f9e89bb3", "score": "0.5545659", "text": "func newQueue(dir string, maxSize int64) (*queue, error) {\n\tq := &queue{\n\t\tdir: dir,\n\t\tmaxSegmentSize: defaultSegmentSize,\n\t\tmaxSize: maxSize,\n\t\tsegments: segments{},\n\t\tLogger: zap.New(zap.NullEncoder()),\n\t}\n\treturn q, nil\n}", "title": "" }, { "docid": "ab93e9f9d41705084be3f4a6daada5b5", "score": "0.55421066", "text": "func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientCreateOptions) (*policy.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}\"\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 accountName == \"\" {\n\t\treturn nil, errors.New(\"parameter accountName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{accountName}\", url.PathEscape(accountName))\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 queueName == \"\" {\n\t\treturn nil, errors.New(\"parameter queueName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{queueName}\", url.PathEscape(queueName))\n\treq, err := runtime.NewRequest(ctx, http.MethodPut, 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\", \"2022-09-01\")\n\treq.Raw().URL.RawQuery = reqQP.Encode()\n\treq.Raw().Header[\"Accept\"] = []string{\"application/json\"}\n\treturn req, runtime.MarshalAsJSON(req, queue)\n}", "title": "" }, { "docid": "775fde70d0ed6e1e6979791c26cec1b7", "score": "0.55224514", "text": "func newQueue() *Queue {\n\treturn &Queue{}\n}", "title": "" }, { "docid": "1e29422c8287c028e0e4bd4d0e1a0929", "score": "0.55174917", "text": "func TestCreateQueue(t *testing.T) {\n\tcapacity := 5\n\tq := CreateQueue(capacity)\n\tif q.Size() != 0 {\n\t\tt.Errorf(\"Queue must have size of zero when initialized. But found %v\", q.Size())\n\t}\n\tif q.Capacity() != capacity {\n\t\tt.Errorf(\"Queue must have capacity of %v but found %v\", capacity, q.Capacity())\n\t}\n}", "title": "" }, { "docid": "f9e8abd74ce92ef972aaf35295add619", "score": "0.55074996", "text": "func NewQueue(ctx *pulumi.Context,\n\tname string, args *QueueArgs, opts ...pulumi.ResourceOption) (*Queue, error) {\n\tif args == nil {\n\t\targs = &QueueArgs{}\n\t}\n\n\tvar resource Queue\n\terr := ctx.RegisterResource(\"aws:sqs/queue:Queue\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "ade5fc1ffc99a33fea061f25c1757a56", "score": "0.5494267", "text": "func (b *Base) PushToQueue(workItem *registry.WorkItem, nsqTopic string) {\n\terr := b.Context.NSQClient.Enqueue(\n\t\tnsqTopic,\n\t\tworkItem.ID)\n\tif err != nil {\n\t\tmsg := fmt.Sprintf(\"Error adding WorkItem %d (%s/%s) to NSQ topic %s: %v\",\n\t\t\tworkItem.ID, workItem.Bucket, workItem.Name, nsqTopic, err)\n\t\tb.Context.Logger.Errorf(msg)\n\t\tworkItem.Note = msg\n\t\tb.SaveWorkItem(workItem)\n\t} else {\n\t\tb.Context.Logger.Infof(\"Pushed WorkItem %d (%s/%s) to NSQ topic %s\",\n\t\t\tworkItem.ID, workItem.Bucket, workItem.Name, nsqTopic)\n\t}\n}", "title": "" }, { "docid": "52ae095478f62d57d8a6177d82a9f49a", "score": "0.5476985", "text": "func CreateRecord(task string) error {\n\terr := db.Update(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(\"tasks\"))\n\t\tid, seqErr := b.NextSequence()\n\t\tif seqErr != nil {\n\t\t\treturn seqErr\n\t\t}\n\t\ttaskJSON := \"{\\\"task\\\": \" + \"\\\"\" + task + \"\\\"\" + \",\\\"done\\\": 0}\"\n\t\tputErr := b.Put(itob(int(id)), []byte(taskJSON))\n\t\treturn putErr\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b565f111f5ad4bc21b2a4bef41c98b09", "score": "0.54758227", "text": "func (psc *partitionSchedulingContext) createSchedulingQueue(name string, user security.UserGroup) {\n\t// find the scheduling furthest down the hierarchy that exists\n\tschedQueue := name // the scheduling queue that exists\n\tcacheQueue := \"\" // the cache queue that needs to be created (with children)\n\tparent := psc.getQueue(schedQueue)\n\tfor parent == nil {\n\t\tcacheQueue = schedQueue\n\t\tschedQueue = name[0:strings.LastIndex(name, cache.DOT)]\n\t\tparent = psc.getQueue(schedQueue)\n\t}\n\t// found the last known scheduling queue,\n\t// create the corresponding scheduler queue based on the already created cache queue\n\tqueue := psc.partition.GetQueue(cacheQueue)\n\t// if the cache queue does not exist we should fail this create\n\tif queue == nil {\n\t\treturn\n\t}\n\t// Check the ACL before we really create\n\t// The existing parent scheduling queue is the lowest we need to look at\n\tif !parent.checkSubmitAccess(user) {\n\t\tlog.Logger().Info(\"Submit access denied by scheduler on queue\",\n\t\t\tzap.String(\"deniedQueueName\", schedQueue),\n\t\t\tzap.String(\"requestedQueue\", name))\n\t\treturn\n\t}\n\tlog.Logger().Info(\"Creating scheduling queue(s)\",\n\t\tzap.String(\"parent\", schedQueue),\n\t\tzap.String(\"child\", cacheQueue),\n\t\tzap.String(\"fullPath\", name))\n\tnewSchedulingQueueInfo(queue, parent)\n}", "title": "" }, { "docid": "6b7297f4ee505758ecaaa4f822c8bede", "score": "0.5472866", "text": "func NewQueue(db *leveldb.DB, prefix []byte, closeUnderlyingDB bool) (*Queue, error) {\n\tvar err error\n\n\tvar queue = &Queue{\n\t\tdb: db,\n\t\tcloseUnderlyingDB: closeUnderlyingDB,\n\t}\n\n\tqueue.prefix = make([]byte, len(prefix))\n\tcopy(queue.prefix, prefix)\n\tqueue.lowKey = withPrefix(prefix, []byte(lowKeyStr))\n\tqueue.highKey = withPrefix(prefix, []byte(highKeyStr))\n\n\tqueue.low, err = queue.readID(queue.lowKey)\n\tif err == leveldb.ErrNotFound {\n\t\tqueue.low = 1\n\t\terr = db.Put(queue.lowKey, id2bytes(1), nil)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tqueue.high, err = queue.readID(queue.highKey)\n\tif err == leveldb.ErrNotFound {\n\t\terr = db.Put(queue.highKey, id2bytes(0), nil)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn queue, nil\n}", "title": "" }, { "docid": "bfbe45e1596d834dcc4865a3185cb43d", "score": "0.5470876", "text": "func (instance *coordinator) NewQueue(queueName string, log *logger.LocLoggingEntry) *queueHandler {\n\tlog.Infof(\"Creating new message queue '%s'\", queueName)\n\tqueue := &queueHandler{\n\t\tqueueName: queueName,\n\t\tqueue: etcdRecipes.NewQueue(instance.cli, queueName),\n\t}\n\treturn queue\n}", "title": "" }, { "docid": "2037da62478ed5fb365fab3132b9174c", "score": "0.5469762", "text": "func (s service) Create(ctx context.Context, po documents.Model) (documents.Model, transactions.TxID, chan bool, error) {\n\tselfDID, err := contextutil.AccountDID(ctx)\n\tif err != nil {\n\t\treturn nil, transactions.NilTxID(), nil, errors.NewTypedError(documents.ErrDocumentConfigAccountID, err)\n\t}\n\n\tpo, err = s.validateAndPersist(ctx, nil, po, CreateValidator())\n\tif err != nil {\n\t\treturn nil, transactions.NilTxID(), nil, err\n\t}\n\n\ttxID := contextutil.TX(ctx)\n\ttxID, done, err := documents.CreateAnchorTransaction(s.txManager, s.queueSrv, selfDID, txID, po.CurrentVersion())\n\tif err != nil {\n\t\treturn nil, transactions.NilTxID(), nil, nil\n\t}\n\treturn po, txID, done, nil\n}", "title": "" }, { "docid": "6ac94edf20678f4b3c793b4ddb415d84", "score": "0.54684794", "text": "func (c *RabbitMQMessageQueueFactory) CreateQueue(name string) cqueues.IMessageQueue {\n\tqueue := queues.NewEmptyRabbitMQMessageQueue(name)\n\n\tif c.config != nil {\n\t\tqueue.Configure(c.config)\n\t}\n\tif c.references != nil {\n\t\tqueue.SetReferences(c.references)\n\t}\n\n\treturn queue\n}", "title": "" }, { "docid": "44431cc868d7daafcdf2ed56323dca93", "score": "0.5458639", "text": "func newQueue(opts queueOpts) *queue {\n\tq := &queue{opts: opts}\n\treturn q\n}", "title": "" }, { "docid": "701aa9ef5bad0d7bffc7cd4bb1dfa86a", "score": "0.5458019", "text": "func CreateQueue(queueName string) error {\n\terr := getPublishChannel()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = publishChannel.QueueDeclare(queueName, true, false, false, false, nil)\n\n\treturn err\n}", "title": "" }, { "docid": "75bf9609f98d920ca4ea9c66680a1849", "score": "0.5454291", "text": "func NewQueue(name string, rdb RedisClient) *Queue {\n\treturn &Queue{\n\t\tname: name,\n\t\trdb: rdb,\n\t\tlog: defaultLogger{},\n\t}\n}", "title": "" }, { "docid": "d723d0e4082ea899c2abbbca7c273002", "score": "0.54275495", "text": "func CreateQA(qa QA) (QA, error) {\n QuestionId += 1\n qa.Id = strconv.Itoa(QuestionId)\n _, err := collection.InsertOne(ctx, qa)\n return qa, err\n}", "title": "" }, { "docid": "84626916383954552ee1cdc01be1e09e", "score": "0.54043883", "text": "func QueueCreate(limit int) *Queue {\n\tq := &Queue{\n\t\tblocks: make(chan *Block, 100),\n\t\tchanLock: &sync.RWMutex{},\n\t\tkvMap: &sync.Map{},\n\t\tconcurrencyLimit: int64(limit),\n\t\tbarrierPending: make(chan struct{}, 1),\n\t\tbarrierDone: make(chan struct{}, 1),\n\t\tpendingBarrier: make(chan *Block, 1),\n\t\treachedConcurrencyLimit: make(chan struct{}, 1),\n\t\tunderConcurrencyLimit: make(chan struct{}, 1),\n\t\tsuspended: make(chan struct{}, 1),\n\t\tresumed: make(chan struct{}, 1),\n\t}\n\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-q.suspended:\n\t\t\t\t<-q.resumed\n\t\t\tcase <-q.barrierPending:\n\t\t\t\t<-q.barrierDone\n\t\t\tcase <-q.reachedConcurrencyLimit:\n\t\t\t\t<-q.underConcurrencyLimit\n\t\t\tdefault:\n\t\t\t\tr := atomic.LoadInt64(&q.runningCount)\n\t\t\t\tif r == q.concurrencyLimit && q.concurrencyLimit > 0 {\n\t\t\t\t\tq.reachedConcurrencyLimit <- struct{}{}\n\t\t\t\t} else {\n\t\t\t\t\tq.chanLock.RLock()\n\t\t\t\t\tb := <-q.blocks\n\t\t\t\t\tq.chanLock.RUnlock()\n\n\t\t\t\t\tif Barrier == b.blockType {\n\t\t\t\t\t\tq.setPendingBarrier(b)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tq.executeBlock(b)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn q\n}", "title": "" }, { "docid": "cb60e9a5399a7e0846ad0cfb1d9782df", "score": "0.54038256", "text": "func CreateJob(pool *redis.Pool, name string, job []byte) (bool, error) {\n\t// Create and close connection when finished\n\tc := pool.Get()\n\tdefer c.Close()\n\n\t// Get queue and append new job\n\tq, err := GetQueue(pool, name)\n\tif err != nil {\n\t\tlog.Warnf(\"Could not retrieve queue: %v \\n\", name)\n\t\treturn false, err\n\t}\n\tq.Jobs = append(q.Jobs, job)\n\n\t// Marshal updated queue and store it\n\tqBytes, _ := json.Marshal(q)\n\tn1, err := c.Do(\"SET\", name, qBytes)\n\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfmt.Println(\"Queue updated with result: \", n1)\n\treturn true, nil\n}", "title": "" }, { "docid": "cfe6eb067c0ac5058991db4b4052566c", "score": "0.53850985", "text": "func (r *RabbitConnection) setQueue(name string) error {\n\tvar err error\n\tr.queue, err = r.channel.QueueDeclarePassive(\n\t\tname, // name\n\t\ttrue, // durable\n\t\tfalse, // delete when unused\n\t\tfalse, // exclusive\n\t\tfalse, // no-wait\n\t\tnil, // arguments\n\t)\n\treturn err\n}", "title": "" }, { "docid": "fa9dd8cc60b8a57aa3e1d31e21ac427c", "score": "0.53832716", "text": "func (c *FakeQueueUnits) Create(ctx context.Context, queueUnit *v1alpha1.QueueUnit, opts v1.CreateOptions) (result *v1alpha1.QueueUnit, err error) {\n\tobj, err := c.Fake.\n\t\tInvokes(testing.NewCreateAction(queueunitsResource, c.ns, queueUnit), &v1alpha1.QueueUnit{})\n\n\tif obj == nil {\n\t\treturn nil, err\n\t}\n\treturn obj.(*v1alpha1.QueueUnit), err\n}", "title": "" }, { "docid": "f51a9b8725d4740f34a8390a8aaf2941", "score": "0.5381372", "text": "func (s *Server) Queue(ctx *fasthttp.RequestCtx) {\n\tqueueName := string(ctx.QueryArgs().Peek(\"name\"))\n\n\tif queueName == \"\" {\n\t\ts.badRequest(ctx, \"\\\"name\\\" parameter required.\")\n\t\treturn\n\t}\n\n\tbody := ctx.PostBody()\n\tif body == nil || len(body) == 0 {\n\t\ts.badRequest(ctx, \"The request body required.\")\n\t\treturn\n\t}\n\n\tvar mainAPI string\n\tif s.mainAPI != \"\" {\n\t\tmainAPI = s.mainAPI\n\t} else {\n\t\t// We can get the main api name from header if the x-service-name header provided.\n\t\tmainAPI = string(ctx.Request.Header.Peek(\"x-service-name\"))\n\t}\n\n\terr := s.messager.Send(mainAPI, queueName, body)\n\tif err != nil {\n\t\ts.error(ctx, fasthttp.StatusInternalServerError, err.Error())\n\t\treturn\n\t}\n\n\ts.write(ctx, fasthttp.StatusOK, &ResponseModel{Message: \"Successfully queued.\"})\n}", "title": "" }, { "docid": "5d37579e6e9b2f718ad50d2729d6488f", "score": "0.5378142", "text": "func (d *Database) StackExchangeQuestionCreate(seq StackExchangeQuestion) (msg string, err error) {\n\terr = d.open()\n\tif err != nil {\n\t\treturn msg, err\n\t}\n\ttx, err := d.db.Begin()\n\tif err != nil {\n\t\treturn msg, err\n\t}\n\n\tstmt, err := d.db.Prepare(`INSERT INTO StackExchangeQuestion\n (QID, UID, title, creationDate, lastActivityDate, shareLink, closedReason,\n tags, site, isAnswered, score, viewCount, answerCount, commentCount,\n upVoteCount, downVoteCount, deleteVoteCount, favoriteCount, reOpenVoteCount)\n VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19);`)\n\tdefer stmt.Close()\n\tif err != nil {\n\t\treturn msg, err\n\t}\n\n\tif _, err := stmt.Exec(\n\t\tseq.QID,\n\t\tseq.UID,\n\t\tseq.Title,\n\t\tseq.CreationDate,\n\t\tseq.LastActivityDate,\n\t\tseq.ShareLink,\n\t\tseq.ClosedReason,\n\t\tseq.Tags,\n\t\tseq.Site,\n\t\tseq.IsAnswered,\n\t\tseq.Score,\n\t\tseq.ViewCount,\n\t\tseq.AnswerCount,\n\t\tseq.CommentCount,\n\t\tseq.UpVoteCount,\n\t\tseq.DownVoteCount,\n\t\tseq.DeleteVoteCount,\n\t\tseq.FavoriteCount,\n\t\tseq.ReOpenVoteCount,\n\t); err != nil {\n\t\ttx.Rollback()\n\t\treturn \"Error had to Rollback question table\", err\n\t}\n\n\treturn fmt.Sprintf(\"Question: %d created.\", seq.QID), nil\n\n}", "title": "" }, { "docid": "2f1735fa417e8f5429841f22ee8ccea7", "score": "0.53718334", "text": "func (e *nodeEnqueue) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface) {\n\tif evt.Meta == nil {\n\t\treturn\n\t}\n\tq.Add(reconcile.Request{NamespacedName: types.NamespacedName{\n\t\tName: evt.Meta.GetName(),\n\t}})\n}", "title": "" }, { "docid": "29b4d2797553eb2f63765400fc2b39e5", "score": "0.53683704", "text": "func (c *Consumer) Save() *Consumer {\r\n\tif !c.isSaved() {\r\n\t\tc.getContainer().AddQueueDeclare(*c.GetQueueDeclare())\r\n\t\tc.getContainer().AddQueueBind(*c.GetQueueBind())\r\n\t\tc.save()\r\n\t}\r\n\treturn c\r\n}", "title": "" }, { "docid": "95695b76bde7581b998f007cf5b19119", "score": "0.536833", "text": "func EmailQueueEmailTemplateCreate(w http.ResponseWriter, r *http.Request) {\n\n\taccount, err := utilsCr.GetWorkAccount(w,r)\n\tif err != nil || account == nil {\n\t\tu.Respond(w, u.MessageError(u.Error{Message:\"Ошибка авторизации\"}))\n\t\treturn\n\t}\n\n\t// Get JSON-request\n\tvar input struct{\n\t\tmodels.EmailQueueEmailTemplate\n\t}\n\n\tif err := json.NewDecoder(r.Body).Decode(&input); err != nil {\n\t\tu.Respond(w, u.MessageError(err, \"Техническая ошибка в запросе\"))\n\t\treturn\n\t}\n\t\n\temailQueueEmailTemplate, err := account.CreateEntity(&input.EmailQueueEmailTemplate)\n\tif err != nil {\n\t\tu.Respond(w, u.MessageError(u.Error{Message:\"Ошибка во время создания серии\"}))\n\t\treturn\n\t}\n\n\tresp := u.Message(true, \"POST EmailQueueEmailTemplate Created\")\n\tresp[\"email_queue_email_template\"] = emailQueueEmailTemplate\n\tu.Respond(w, resp)\n}", "title": "" }, { "docid": "7746e5ce08533aa48f1b453e89dfab1f", "score": "0.53645", "text": "func (b *Batch) Queue(query string, arguments ...interface{}) {\n\tb.items = append(b.items, &batchItem{\n\t\tquery: query,\n\t\targuments: arguments,\n\t})\n}", "title": "" }, { "docid": "0ca331abd11d939091fa085631437628", "score": "0.53568673", "text": "func (h LoggingEnqueueRequestForOwner) Create(e event.CreateEvent, q workqueue.RateLimitingInterface) {\n\th.logEvent(\"Create\", e.Object, nil)\n\th.EnqueueRequestForOwner.Create(e, q)\n}", "title": "" }, { "docid": "4e70984811512c9841029731813f7064", "score": "0.5353709", "text": "func (post *Post) CreateNewQuestAndSetFieldsOnPost(user *User) {\n var quest Quest\n quest.Description = post.Caption\n quest.UserID = user.ID\n DB.Create(&quest)\n fmt.Println(\"Created a new quest for post: \", post.ID, \". New questID:\", quest.ID)\n\n post.QuestID = quest.ID\n post.QuestOrder = 1\n}", "title": "" }, { "docid": "3a532351ad59881b5c44382b1d1e5c55", "score": "0.5344012", "text": "func (t *TSDBQueueManager) Queue(s clientmodel.Samples) {\n\tselect {\n\tcase t.queue <- s:\n\tdefault:\n\t\tsamplesCount.IncrementBy(map[string]string{result: dropped}, float64(len(s)))\n\t\tglog.Warningf(\"TSDB queue full, discarding %d samples\", len(s))\n\t}\n}", "title": "" }, { "docid": "92d815a8685ac0de6774b6ffe51d1cb7", "score": "0.5338424", "text": "func NewQueue(s *Service) *Queue {\n\treturn &Queue{\n\t\ts,\n\t\t[]*Torrent{},\n\t}\n}", "title": "" }, { "docid": "fcd99ab5d74b50b0151dd14e897a19e5", "score": "0.5328726", "text": "func (m *Manager) DeclareQueue(name string) (*ManagerModel, error) {\n\tch, err := m.createChannel()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// defer ch.Close()\n\n\tq, err := ch.QueueDeclare(name, true, false, false, false, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &ManagerModel{channel: ch, queue: q}, nil\n}", "title": "" }, { "docid": "2fcc12aa6971f4979720c480123bd6cc", "score": "0.532502", "text": "func NewQueue() *Queue {\r\n\r\n\treturn &Queue{}\r\n}", "title": "" }, { "docid": "04e8bcaadfcdbe488721e2245f0b7992", "score": "0.5324153", "text": "func (b *AMQPBroker) Queue(name string) (Queue, error) {\n\tburiedQueue, rex, err := b.newBuriedQueue(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tq, err := b.ch.QueueDeclare(\n\t\tname, // name\n\t\ttrue, // durable\n\t\tfalse, // delete when unused\n\t\tfalse, // exclusive\n\t\tfalse, // no-wait\n\t\tamqp.Table{\n\t\t\t\"x-dead-letter-exchange\": rex,\n\t\t\t\"x-dead-letter-routing-key\": name,\n\t\t\t\"x-max-priority\": uint8(PriorityUrgent),\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &AMQPQueue{\n\t\tconn: b,\n\t\tqueue: q,\n\t\tburiedQueue: &AMQPQueue{conn: b, queue: buriedQueue},\n\t}, nil\n}", "title": "" }, { "docid": "90574167f3379b39a3862200b197812f", "score": "0.5319437", "text": "func NewQueue() Queue {\n\tnewQueue := Queue{}\n\tnewQueue.Setup()\n\n\treturn newQueue\n}", "title": "" }, { "docid": "7685212c4d0edbd049b3cbd731cbc805", "score": "0.531753", "text": "func (handler *TasksHandler) Create(Data per.IDataItem) SQLL.SQLLiteQueryResult {\n\tdata := Data.(models.Task)\n\treturn handler.ConvertResult(handler.Executor.ExecuteInsertQuery(\"INSERT INTO \" + tasksTName + \" ( \"+ \"[\"+tasksDisplaynameCName+\"]\" + \",[\"+tasksArchivedCName+\"]\" + \",[\"+tasksCompletedCName+\"]\" +\" ) VALUES (?,?,?)\", data.Displayname,data.Archived,data.Completed))\n}", "title": "" }, { "docid": "9338e29699f2a8e22ab46a8189f0cc1e", "score": "0.5308589", "text": "func (st *InMemoryStore) Create(ctx context.Context, job *Job) error {\n\tst.mu.Lock()\n\tdefer st.mu.Unlock()\n\tst.jobs[job.ID] = *job\n\treturn nil\n}", "title": "" }, { "docid": "392e8f9f2955a4395e80a5198147b1b0", "score": "0.53029543", "text": "func NewQueue(ctx *pulumi.Context,\n\tname string, args *QueueArgs, opts ...pulumi.ResourceOption) (*Queue, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.InstanceId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'InstanceId'\")\n\t}\n\tif args.QueueName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'QueueName'\")\n\t}\n\tif args.VirtualHostName == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'VirtualHostName'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Queue\n\terr := ctx.RegisterResource(\"alicloud:amqp/queue:Queue\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "64ab03e347818c8faa334b4f00cc4f89", "score": "0.530198", "text": "func (t *OpenconfigQos_Qos_Queues) NewQueue(Name string) (*OpenconfigQos_Qos_Queues_Queue, error){\n\n\t// Initialise the list within the receiver struct if it has not already been\n\t// created.\n\tif t.Queue == nil {\n\t\tt.Queue = make(map[string]*OpenconfigQos_Qos_Queues_Queue)\n\t}\n\n\tkey := Name\n\n\t// Ensure that this key has not already been used in the\n\t// list. Keyed YANG lists do not allow duplicate keys to\n\t// be created.\n\tif _, ok := t.Queue[key]; ok {\n\t\treturn nil, fmt.Errorf(\"duplicate key %v for list Queue\", key)\n\t}\n\n\tt.Queue[key] = &OpenconfigQos_Qos_Queues_Queue{\n\t\tName: &Name,\n\t}\n\n\treturn t.Queue[key], nil\n}", "title": "" }, { "docid": "fb55a35d4bdf3f75acdaf69dc8bb9488", "score": "0.52882564", "text": "func (s *QuestionServer) CreateQuestion(ctx context.Context, in *qpb.CreateQuestionRequest) (*qpb.CreateQuestionResponse, error) {\n\tfmt.Println(\"*** CreateQuestion ***\")\n\tfmt.Println(\"Request: \", in)\n\tvar result *qpb.CreateQuestionResponse\n\tdbString := fmt.Sprintf(\"host=%s dbname=%s user=%s password=%s sslmode=%s\", os.Getenv(\"DEV_HOST\"), os.Getenv(\"DEV_DBNAME\"), os.Getenv(\"DEV_USERNAME\"), os.Getenv(\"DEV_PASSWORD\"), os.Getenv(\"DEV_SSLMODE\"))\n\tdb, err := gorm.Open(os.Getenv(\"DEV_DB_DRIVER\"), dbString)\n\tdefer db.Close()\n\tif err != nil {\n\t\tlog.Errorf(\"Error opening DB connection: %+v\", err)\n\t} else {\n\t\tresult, err = s.question.CreateInDB(ctx, in, db)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"Error in CreateInDB: %+v\", err)\n\t\t}\n\t}\n\tfmt.Println(\"Result: \", result)\n\treturn result, nil\n}", "title": "" }, { "docid": "fad2a3802e1fedeaa06a5b4f36cfce1c", "score": "0.5286946", "text": "func CreateJob(commandString, issuedUser string, jobid int) *Job {\n\tjob := &Job{\n\t\tID: jobid, //#CHANGE\n\t\tStatus: StatusCode(Created),\n\t\tCommand: commandString,\n\t\tUserId: issuedUser,\n\t\tStartTime: time.Now(),\n\t\t// StopTime: nil,\n\t}\n\tJobDB = append(JobDB, *job)\n\treturn job\n}", "title": "" }, { "docid": "d9fc9f1ae732d95f6682d41dd905898f", "score": "0.5282437", "text": "func (f *S3ServerQueue) Push(queueName string) {\n\n}", "title": "" }, { "docid": "27c639d95ddafa3a4bb770a876d4f6c0", "score": "0.5259923", "text": "func New(q blobqueue.Queue, zeroValue encoding.BinaryMarshaler) *Queue {\n\tt := reflect.TypeOf(zeroValue)\n\t// Checks of the contract for values\n\t_ = decodeValue(t, encodeValue(t, zeroValue))\n\n\treturn &Queue{q: q, t: t, zero: zeroValue}\n}", "title": "" }, { "docid": "0436bd3ef96619ff4bebb900737f8919", "score": "0.5257875", "text": "func NewQueue(ch *amqp.Channel) (amqp.Queue, error) {\n\tq, err := ch.QueueDeclare(\n\t\t\"delete-cats\",\n\t\ttrue,\n\t\tfalse,\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\treturn q, err\n}", "title": "" }, { "docid": "d3e4cb2187e8e26fb43cb4a0b2a86eb7", "score": "0.52489847", "text": "func (sc *schedulerCache) addQueue(queue *arbv1.Queue) error {\n\tif _, ok := sc.queues[queue.Name]; ok {\n\t\treturn fmt.Errorf(\"queue %v exist\", queue.Name)\n\t}\n\n\tinfo := &QueueInfo{\n\t\tname: queue.Name,\n\t\tqueue: queue.DeepCopy(),\n\t\tPods: make([]*v1.Pod, 0),\n\t}\n\n\t// init Request if it is nil\n\tif info.Queue().Spec.Request.Resources == nil {\n\t\tinfo.Queue().Spec.Request.Resources = map[arbv1.ResourceName]resource.Quantity{\n\t\t\t\"cpu\": resource.MustParse(\"0\"),\n\t\t\t\"memory\": resource.MustParse(\"0\"),\n\t\t}\n\t}\n\n\t// init Deserved/Allocated/Used/Preemping if it is nil\n\tif info.Queue().Status.Deserved.Resources == nil {\n\t\tinfo.Queue().Status.Deserved.Resources = map[arbv1.ResourceName]resource.Quantity{\n\t\t\t\"cpu\": resource.MustParse(\"0\"),\n\t\t\t\"memory\": resource.MustParse(\"0\"),\n\t\t}\n\t}\n\tif info.Queue().Status.Allocated.Resources == nil {\n\t\tinfo.Queue().Status.Allocated.Resources = map[arbv1.ResourceName]resource.Quantity{\n\t\t\t\"cpu\": resource.MustParse(\"0\"),\n\t\t\t\"memory\": resource.MustParse(\"0\"),\n\t\t}\n\t}\n\tif info.Queue().Status.Used.Resources == nil {\n\t\tinfo.Queue().Status.Used.Resources = map[arbv1.ResourceName]resource.Quantity{\n\t\t\t\"cpu\": resource.MustParse(\"0\"),\n\t\t\t\"memory\": resource.MustParse(\"0\"),\n\t\t}\n\t}\n\tif info.Queue().Status.Preempting.Resources == nil {\n\t\tinfo.Queue().Status.Preempting.Resources = map[arbv1.ResourceName]resource.Quantity{\n\t\t\t\"cpu\": resource.MustParse(\"0\"),\n\t\t\t\"memory\": resource.MustParse(\"0\"),\n\t\t}\n\t}\n\tsc.queues[queue.Name] = info\n\treturn nil\n}", "title": "" }, { "docid": "25a7416df744efd6a62888165696f5e3", "score": "0.52319807", "text": "func (p *DB) Create(task *common_proto.Task, uid string) error {\n\tsession := p.session.Copy()\n\tdefer session.Close()\n\n\ttaskRecord := TaskRecord{}\n\ttaskRecord.ID = task.Id\n\ttaskRecord.Userid = uid\n\ttaskRecord.Name = task.Name\n\ttaskRecord.Image = getTaskImage(task)\n\ttaskRecord.Type = task.Type\n\ttaskRecord.Status = task.Status\n\ttaskRecord.Replica = task.Attributes.Replica\n\tif task.Type == common_proto.TaskType_CRONJOB {\n\t\ttaskRecord.Schedule = task.GetTypeCronJob().Schedule\n\t}\n\n\tnow := time.Now().Unix()\n\ttaskRecord.Last_modified_date = uint64(now)\n\ttaskRecord.Creation_date = uint64(now)\n\treturn p.collection(session).Insert(taskRecord)\n}", "title": "" }, { "docid": "0fc77bbc1fa0a46882c962f5c27f38a0", "score": "0.52272415", "text": "func (repo *QueuesRepo) Update(q *Queue) (*Queue, error) {\n\tquery := \"UPDATE queues SET name = ?, description = ?, is_active = ?, updated_at = CURRENT_TIMESTAMP() WHERE id = ?\"\n\n\t_, err := repo.db.Exec(query, q.Name, q.Description, q.IsActive, q.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn repo.Get(q.ID)\n}", "title": "" }, { "docid": "04966c65035b427a89f82bd5b7894724", "score": "0.5213178", "text": "func (c *Controller) CreateDatabase(ctx context.Context, qdb *dax.QualifiedDatabase) error {\n\ttx, err := c.Transactor.BeginTx(ctx, true)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"beginning tx\")\n\t}\n\tdefer tx.Rollback()\n\n\t// Create Database ID.\n\tif _, err := qdb.CreateID(); err != nil {\n\t\treturn errors.Wrap(err, \"creating database ID\")\n\t}\n\n\tif err := c.Schemar.CreateDatabase(tx, qdb); err != nil {\n\t\treturn errors.Wrap(err, \"creating database in schemar\")\n\t}\n\n\treturn tx.Commit()\n}", "title": "" }, { "docid": "8b503fb01528e41fd8149a473df237f4", "score": "0.5209208", "text": "func (repo *QueuesRepo) Delete(id int64) error {\n\tquery := \"DELETE FROM queues WHERE id = ?\"\n\n\t_, err := repo.db.Exec(query, id)\n\n\treturn err\n}", "title": "" }, { "docid": "959e5d651db778a42f835c5eef5eb945", "score": "0.519862", "text": "func (m *Manager) addQueue(q *Queue) {\n\tm.queues[q.name] = q\n}", "title": "" }, { "docid": "5b9e291e01683efb660ff807e49ca08d", "score": "0.51983804", "text": "func NewQueue(name string, healthyLimit int) rmq.Queue {\n\tinitDefault()\n\tqueue := rmqConnection.OpenQueue(name)\n\tif _, ok := queueHealthLimits.Load(name); ok {\n\t\treturn queue\n\t}\n\tqueueHealthLimits.Store(name, healthyLimit)\n\treturn queue\n}", "title": "" }, { "docid": "61a5fc866f5e8935be40956a4007eb45", "score": "0.51799184", "text": "func CreateQuota(c *gin.Context) {\n\n\tvar (\n\t\tquota models.Quota\n\t)\n\tif c.ShouldBindJSON(&quota) != nil {\n\t\treplyError(c, _WRONG_PARAMS)\n\t\treturn\n\t}\n\tquota.CreatedAt = time.Now()\n\tid := models.CreateQuota(&quota)\n\n\tc.JSON(http.StatusOK, gin.H{`id`: id})\n}", "title": "" }, { "docid": "6fbc1bee0cd6b8951f7bc5a5fa9fd36f", "score": "0.5179556", "text": "func (s *server) CreateOrder(cxt context.Context, order *pb.Order) (*pb.Order, error) {\n\tlog.Println(\"CreateOrder\")\n\tif err := validate(order); err != nil {\n\t\treturn order, err\n\t}\n\tnewOrder := pb.Order{}\n\tdborder := createOrderInDb(newOrder)\n\torder.OrderId = dborder.OrderId\n\tif err := updateOrderPublisher.Publish(context.Background(), order); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn order, nil\n}", "title": "" }, { "docid": "27ede2160260fe56f680dc2cbe4755d2", "score": "0.5179142", "text": "func New(s store.Store, name string) Queue {\n\treturn queue{s: s, name: name}\n}", "title": "" }, { "docid": "4fbf2b138b0d6174795cfd917513adfd", "score": "0.51787287", "text": "func (q *NfQueue) CreateQueue(num uint16, callback func(*NFPacket, interface{}), errorCallback func(err error, data interface{}), privateData interface{}) error {\n\tq.QueueNum = num\n\tq.callback = callback\n\tq.errorCallback = errorCallback\n\tq.privateData = privateData\n\tconfig := &NfqMsgConfigCommand{\n\t\tCommand: NfqnlCfgCmdBind, //NFQNL_CFG_CMD_BIND,\n\t\t_pad: 0,\n\t\tpf: syscall.AF_UNSPEC,\n\t}\n\thdr := common.BuildNlMsgHeader(common.NfqnlMsgConfig, common.NlmFRequest|common.NlmFAck, 0)\n\tnfgen := common.BuildNfgenMsg(syscall.AF_UNSPEC, common.NFNetlinkV0, num, hdr)\n\tattr := common.BuildNfAttrMsg(NfqaCfgCmd, hdr, config.Length())\n\tnfgenData := nfgen.ToWireFormat()\n\tnfgenData = append(nfgenData, attr.ToWireFormat()...)\n\tnfgenData = append(nfgenData, config.ToWireFormat()...)\n\tnetlinkMsg := &syscall.NetlinkMessage{\n\t\tHeader: *hdr,\n\t\tData: nfgenData,\n\t}\n\n\tif q.queueHandle != nil {\n\t\treturn q.queueHandle.query(netlinkMsg)\n\t}\n\treturn fmt.Errorf(\"NfqOpen was not called. No Socket open\")\n}", "title": "" }, { "docid": "d35685db30c7308964794f920ff1aa16", "score": "0.51763785", "text": "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "title": "" }, { "docid": "d35685db30c7308964794f920ff1aa16", "score": "0.51763785", "text": "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "title": "" }, { "docid": "d35685db30c7308964794f920ff1aa16", "score": "0.51763785", "text": "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "title": "" }, { "docid": "d35685db30c7308964794f920ff1aa16", "score": "0.51763785", "text": "func NewQueue() *Queue {\n\treturn &Queue{}\n}", "title": "" }, { "docid": "1d21bb9b262781bb9f684a4bf708f9e6", "score": "0.5161067", "text": "func New() *queue {\n\treturn &queue{}\n}", "title": "" }, { "docid": "8c4b63129129348889693954392ccb2e", "score": "0.51593953", "text": "func CreateQuestion(db *gorm.DB, q Question) (*Question, error) {\n\tvar err error\n\tif err = db.Create(&q).Error; err != nil {\n\t\treturn &Question{}, err\n\t}\n\treturn &q, err\n}", "title": "" }, { "docid": "0f5692aa1896b65567a1ee555cb56666", "score": "0.515844", "text": "func (db *TestDB) Create(tsk *task.Task) (task *task.Task) {\n\treturn tsk\n}", "title": "" }, { "docid": "db7e7624f267b96ae075f47c90cef806", "score": "0.515288", "text": "func (db *DataBase) CreatePost(posts []models.Post, slug string, t time.Time, done chan error) {\n\n\tvar (\n\t\ttx *sql.Tx\n\t\tthatThread models.Thread\n\t\tcount int\n\t\terr error\n\t)\n\tif tx, err = db.Db.Begin(); err != nil {\n\t\tdone <- err\n\t\treturn\n\t}\n\tdefer tx.Rollback()\n\n\tif thatThread, err = db.threadFindByIDorSlug(tx, slug); err != nil {\n\t\tdone <- err\n\t\treturn\n\t}\n\n\tcount = len(posts)\n\tif err = db.postsCreate(tx, posts, thatThread, t); err != nil {\n\t\tdone <- err\n\t\treturn\n\t}\n\tdebug(\"posts created\")\n\n\tif err = db.forumUpdatePosts(tx, thatThread.Forum, count); err != nil {\n\t\treturn\n\t}\n\n\tif err = db.statusAddPost(tx, count); err != nil {\n\t\treturn\n\t}\n\n\terr = tx.Commit()\n\tdone <- err // it is stop for outter functions\n\n\tdb.userInForumCreatePosts(posts, thatThread)\n\t//done <- err\n\t//done <- nil\n\treturn\n}", "title": "" }, { "docid": "5a973e79e3fef1fa2ec50b7e869c862d", "score": "0.5152058", "text": "func CreateOrder(w http.ResponseWriter, r *http.Request) {\n\n\tdecoder := json.NewDecoder(r.Body)\n\n\tvar data Orders\n\terr := decoder.Decode(&data)\n\tif err != nil {\n\t\t//panic(err)\n\t\treturn\n\t}\n\n\tdb, err := sql.Open(\"mysql\", \"root:root123@tcp(127.0.0.1:3306)/test\")\n\tif err != nil {\n\t\tlog.Print(err.Error())\n\t}\n\tdefer db.Close()\n\n\tdata.OrderID = random(1, 1000)\n\tdata.OrderID = 955\n\n\tfor {\n\t\tresults, err := db.Query(\"select * from orders where OrderID = ?;\", data.OrderID)\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t\tif results.Next() {\n\t\t\tdata.OrderID = random(1, 1000)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tresults, err := db.Query(\"insert into orders values(?, ?, ?);\", data.Item, data.Quantity, data.OrderID)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Println(results)\n\tjson.NewEncoder(w).Encode(data)\n\treturn\n}", "title": "" }, { "docid": "300985bbdf411640a84a7d1e10dfc1d3", "score": "0.5149201", "text": "func CreateNewOrder(c *gin.Context) {\n\tr := new(rabbitmq.RabbitMQ)\n\temail := new(helpers.Email)\n\n\tif err := r.Start(); err != nil {\n\t\tc.JSON(500, gin.H{\n\t\t\t\"status\": \"ERROR\",\n\t\t\t\"msg\": \"Problema interno no RabbitMQ\",\n\t\t})\n\t}\n\n\tif err := email.Start(); err != nil {\n\t\tc.JSON(500, gin.H{\n\t\t\t\"status\": \"ERROR\",\n\t\t\t\"msg\": \"Problema interno no gRPC\",\n\t\t})\n\t}\n\n\tdefer r.Close()\n\tdefer email.Close()\n\n\torder := &models.Order{}\n\tif err := c.ShouldBindJSON(order); err != nil {\n\t\tlog.Println(err)\n\t\tc.JSON(http.StatusBadRequest, gin.H{\n\t\t\t\"status\": \"ERROR\",\n\t\t\t\"msg\": err.Error(),\n\t\t})\n\t} else {\n\t\torder.ID = bson.NewObjectId()\n\t\torder.Date = time.Now().String()\n\t\torder.Status = \"PROCESSING\"\n\n\t\t// *NÃO É O IDEAL!!!!!!!!!!!!!!*\n\t\tif err := order.CreateNewOrder(); err != nil {\n\t\t\tlog.Println(err)\n\t\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\t\"status\": \"ERROR\",\n\t\t\t\t\"msg\": \"Algo inesperado aconteceu...\",\n\t\t\t})\n\t\t} else {\n\t\t\tsendOrderToQueues(r, order)\n\n\t\t\tsuccess, _ := email.SendEmail(\n\t\t\t\torder.Client.Email,\n\t\t\t\t\"Novo Pedido!\",\n\t\t\t\torder.ID.Hex(),\n\t\t\t\t\"PROCESSING\",\n\t\t\t)\n\n\t\t\tif success {\n\t\t\t\tc.JSON(http.StatusCreated, gin.H{\n\t\t\t\t\t\"status\": \"OK\",\n\t\t\t\t\t\"msg\": \"Pedido realizado com sucesso\",\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tc.JSON(http.StatusInternalServerError, gin.H{\n\t\t\t\t\t\"status\": \"ERROR\",\n\t\t\t\t\t\"msg\": \"Algo inesperado aconteceu...\",\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e27c79ee3ea7c7ac9cf513e5584590c7", "score": "0.51480097", "text": "func (b *AMQPBackend) Put(queueName string, value interface{}) error {\n\tdata, err := b.codec.Marshal(value)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tch, err := b.conn.Channel()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer ch.Close()\n\n\tq, err := ch.QueueDeclare(\n\t\tqueueName, // name\n\t\ttrue, // durable\n\t\ttrue, // delete when unused\n\t\tfalse, // exclusive\n\t\tfalse, // no-wait\n\t\tnil, // arguments\n\t)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn ch.Publish(\n\t\t\"\", // exchange\n\t\tq.Name, // routing key\n\t\tfalse, // mandatory\n\t\tfalse, // immediate\n\t\tamqp.Publishing{\n\t\t\tContentType: \"application/octet-stream\",\n\t\t\tBody: data,\n\t\t})\n}", "title": "" }, { "docid": "59e4b94024a1f54761b8d000f0424f0c", "score": "0.5146134", "text": "func createUnManagedQueue(parentQI *SchedulingQueue, name string, parent bool) (*SchedulingQueue, error) {\n\tchild, err := cache.NewUnmanagedQueue(name, !parent, parentQI.QueueInfo)\n\t// something failed in the cache return early\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newSchedulingQueueInfo(child, parentQI), err\n}", "title": "" }, { "docid": "81b599002eb97ca875cf590ec9fea335", "score": "0.51271486", "text": "func cacheQueue(batch *leveldb.Batch, node *osmpbf.Node) {\n\tid, val := formatLevelDB(node)\n\tbatch.Put([]byte(id), []byte(val))\n}", "title": "" }, { "docid": "8f3b32257f2872453e7210e308391470", "score": "0.5122399", "text": "func (s *Storage) CreateTopic(request *Topic) (*Topic, error) {\n\tresult, err := s.db.NamedExec(inserTopic, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttopicID, err := result.LastInsertId()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttopic, err := s.GetTopicByID(topicID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn topic, nil\n}", "title": "" } ]
1f6288d2aa4d8d34088408e519467455
CreateBuildLogger allows NullLogger to implement logger.Factory.
[ { "docid": "5a3e7c1c78d54b02c5bdfa60a23a56b0", "score": "0.8343249", "text": "func (n *NullLogger) CreateBuildLogger(_ string) Logger {\n\treturn &NullLogger{}\n}", "title": "" } ]
[ { "docid": "b3027b175a76249c179edf7489c0e527", "score": "0.6883884", "text": "func (cfg Config) Build() (Factory, error) {\n\tif cfg == (Config{}) {\n\t\treturn NewNopFactory(), nil\n\t}\n\n\tvar c zap.Config\n\tswitch cfg.Format {\n\tcase \"console\":\n\t\tc = zap.NewDevelopmentConfig()\n\tcase \"json\":\n\t\tc = zap.NewProductionConfig()\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported logging format: %q\", cfg.Format)\n\t}\n\n\tvar level zapcore.Level\n\tif err := level.Set(cfg.Level); err != nil {\n\t\treturn nil, fmt.Errorf(\"setting log level: %w\", err)\n\t}\n\tc.Level = zap.NewAtomicLevelAt(level)\n\n\tlogger, err := c.Build(zap.AddStacktrace(zap.DPanicLevel))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating logger: %w\", err)\n\t}\n\treturn NewFactory(logger), nil\n}", "title": "" }, { "docid": "7e4c7550a2cd288503bbe933621bf3e9", "score": "0.68106896", "text": "func CreateLogger(debugLevel string) *Logger {\n\n\tlogger := zerolog.New(os.Stdout).With().Timestamp().Logger()\n\n\tzerolog.SetGlobalLevel(zerolog.InfoLevel)\n\tif debugLevel == \"debug\" {\n\t\tzerolog.SetGlobalLevel(zerolog.DebugLevel)\n\t}\n\n\tl := &Logger{\n\t\tLgr: logger,\n\t}\n\treturn l\n}", "title": "" }, { "docid": "8062010c1f12287dd99e3ed913d8bf6e", "score": "0.65475476", "text": "func createLoggerImpl(l LogContext, level int, vlogging bool) *LoggerImpl {\n\treturn &LoggerImpl{\n\t\tLevel: level,\n\t\tVlogging: vlogging,\n\t\tStdLogger: log.New(os.Stderr, l.App+\":\", log.Ldate|log.Ltime),\n\t}\n}", "title": "" }, { "docid": "bce98ffadac0ef8244f8e11fcdb91dd8", "score": "0.6458608", "text": "func CreateLogger(systemID string) *logrus.Entry {\n\tl := CreateDefaultLogger()\n\tlogger = l.WithField(\"systemID\", systemID)\n\treturn logger\n}", "title": "" }, { "docid": "b8981cd79153e7b5540d308bf718de94", "score": "0.6142628", "text": "func (n *NullLogger) CreatePullLogger(_ string) Logger {\n\treturn &NullLogger{}\n}", "title": "" }, { "docid": "17a8c25c1b5cb97560c36477c9863c97", "score": "0.6116251", "text": "func New(config *log.LoggerConfig) log.Logger {\n\tl, _ := log.ParseLevel(config.Level)\n\tif l == log.OffLevel {\n\t\treturn log.NewDummyLogger()\n\t}\n\n\tif bf, ok := builders[config.Backend]; ok {\n\t\treturn bf(config)\n\t}\n\n\tvar logger log.Logger\n\tswitch config.Backend {\n\tcase \"dummy\", \"none\", \"off\":\n\t\tlogger = log.NewDummyLogger()\n\tcase \"std\", \"standard\":\n\t\tlogger = savedStdLogger // log.NewStdLogger()\n\t// case \"logrus\":\n\tdefault:\n\t\tlogger = logrus.NewWithConfig(config)\n\t\t// case \"zero\",\"zerolog:\n\t\t// \tlogger = zerolog.NewWithConfig(config)\n\t\t// case \"zap\":\n\t\t// \tlogger = zap.NewWithConfig(config)\n\t\t// case \"sugar\":\n\t\t// \tlogger = sugar.NewWithConfig(config)\n\t\t// default:\n\t\t// \tlogger = zap.NewWithConfig(config)\n\t\t// \t// logger = zap.New(config.Level, config.TraceMode, config.DebugMode)\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "8b491ccc07f8c8e771064e8691aa2274", "score": "0.6073511", "text": "func New(otions ...Option) (*Logger, error) {\n\n\tlogger := &Logger{\n\n\t\tformat: AUTO,\n\t\tlevel: InfoLevel,\n\t\tout: os.Stdout,\n\t}\n\n\tfor _, opt := range otions {\n\t\topt.apply(logger)\n\t}\n\tif logger.name == \"\" {\n\t\tlogger.name = \"root\"\n\t}\n\tlogger.initWrappedLogger()\n\n\treturn logger, nil\n}", "title": "" }, { "docid": "3316e9ba347145d7e867b8dae9be6bc6", "score": "0.60710156", "text": "func createLogger(name string, level Level, format string, timeFormat string, out io.Writer, sync bool) (*Logger, error) {\n\treturn createCustomizedLogger(name, level, format, timeFormat, out, sync, DefaultQueueSize, DefaultRequestSize, DefaultBufferSize, DefaultTimeInterval)\n}", "title": "" }, { "docid": "bfa40554d01e1600496ec5e8fdc5b206", "score": "0.60437375", "text": "func CreateLogger(filename string) *lumberjack.Logger {\n\tvar filePath string\n\tif strings.Contains(filename, \"/\") {\n\t\tfilePath = filename\n\t} else {\n\t\tfilePath = fmt.Sprintf(\"%s/%s\", Inst().LogLoc, filename)\n\t}\n\t_, err := os.Create(filePath)\n\tif err != nil {\n\t\tlog.Infof(\"Error creating log file. Err: %v\", err)\n\t\treturn nil\n\t}\n\n\tlogger := &lumberjack.Logger{\n\t\tFilename: filePath,\n\t\tMaxSize: 10, // megabytes\n\t\tMaxBackups: 10,\n\t\tMaxAge: 30, //days\n\t\tCompress: true, // disabled by default\n\t\tLocalTime: true,\n\t}\n\n\treturn logger\n\n}", "title": "" }, { "docid": "68b3b89ec6820128262b98972a28828b", "score": "0.6026814", "text": "func CreateDefaultLogInstance(f string, d int) *XLogger {\n\tLogInstance = new(XLogger)\n\tLogInstance.Init(f)\n\tLogInstance.SetLogFunCallDepth(d)\n\treturn LogInstance\n}", "title": "" }, { "docid": "8ee37ae9bd34e12ebf377619c5bf459e", "score": "0.5988296", "text": "func New(component string) zerolog.Logger {\n\tif os.Getenv(constants.EnvVarHumanReadableLogMessages) == \"true\" {\n\t\treturn NewPretty(component)\n\t}\n\treturn newLogger(component)\n}", "title": "" }, { "docid": "91176a6848f1bdd8cdde786d515fea5a", "score": "0.5981069", "text": "func NewBuildloggerV2LoggerProducer() LoggerProducer { return &BuildloggerV2Options{} }", "title": "" }, { "docid": "ce32ed71c3f5cd4f262d588c2357876c", "score": "0.5970237", "text": "func New(name string) Logger {\n\treturn &logger{log{core: newCore(name)}}\n}", "title": "" }, { "docid": "52a35cecf3a4ccd1121078f2dda29a01", "score": "0.5961224", "text": "func (f *logFactoryImpl) NewLogger(meta map[string]string) Logger {\n\tlogMeta := combineMetas(meta, f.baseMeta)\n\n\tcfg := log.NewLoggerConfig()\n\tcfg.AppGroup = logMeta[\"entry.applicationgroup\"]\n\tcfg.AppName = logMeta[\"entry.applicationname\"]\n\tcfg.AppVersion = logMeta[\"entry.applicationversion\"]\n\tcfg.HostName = logMeta[\"entry.machinename\"]\n\n\tswitch f.logLevel {\n\tcase minDebugLevel:\n\t\tcfg.LogLevel = log.DebugLevel\n\tcase minInfoLevel:\n\t\tcfg.LogLevel = log.InfoLevel\n\tdefault:\n\t\tcfg.LogLevel = log.WarnLevel\n\t}\n\n\tlogger := log.NewLogger(cfg)\n\n\treturn &loggerImpl{\n\t\tlogger: logger,\n\t\tlogMinLevel: f.logLevel,\n\t}\n}", "title": "" }, { "docid": "94e22e987d1a653ba608151d382053cc", "score": "0.5952325", "text": "func MustNewLogger(logConfig *config.Log) (logger *logging.Logger) {\n\tlogger, _ = NewLogger(logConfig)\n\treturn logger\n}", "title": "" }, { "docid": "4e5ba4aae29596e5da06ee5f484165ac", "score": "0.5950813", "text": "func newNilLogger() Logger {\n\treturn &nilLogger{}\n}", "title": "" }, { "docid": "6cf555073251c6db6165848c4c26962a", "score": "0.5934913", "text": "func NewStdLogger() Logger { return stdLogger{} }", "title": "" }, { "docid": "23f3b64ed1c92cee8e854b6f4c505ca1", "score": "0.59090143", "text": "func New(name string, parent *Logger) *Logger {\n\n\tself := new(Logger)\n\tself.name = name\n\tself.prefix = name\n\tself.enabled = true\n\tself.level = ERROR\n\tself.format = FDATE | FTIME | FMICROS\n\tself.outputs = make([]LoggerWriter, 0)\n\tself.children = make([]*Logger, 0)\n\tself.parent = parent\n\tif parent != nil {\n\t\tself.prefix = parent.prefix + \"/\" + name\n\t\tself.enabled = parent.enabled\n\t\tself.level = parent.level\n\t\tself.format = parent.format\n\t\tparent.children = append(parent.children, self)\n\t} else {\n\t\trootLoggers = append(rootLoggers, self)\n\t}\n\treturn self\n}", "title": "" }, { "docid": "e880f712ece004906facb2de4d5e87e1", "score": "0.5908602", "text": "func createNoConfigGlobalLogger() {\n\tholder := configuration.NewHolder().MustInit(false)\n\tlogCfg := holder.Configuration.Log\n\n\t// enforce buffer-less for a non-configured logger\n\tlogCfg.BufferSize = 0\n\tlogCfg.LLBufferSize = -1\n\n\tlogger, err := NewLog(logCfg)\n\n\tif err == nil {\n\t\terr = setGlobalLogger(logger, true, true)\n\t}\n\n\tif err != nil || logger == nil {\n\t\tstdlog.Println(\"warning: \", err)\n\t\tpanic(\"unable to initialize global logger with default config\")\n\t}\n}", "title": "" }, { "docid": "fa3e002a2313b09b5e812522b1ed7968", "score": "0.5901024", "text": "func createLogger(filepath string) (*zap.Logger, error) {\n\tcfg := zap.NewProductionConfig()\n\tcfg.OutputPaths = []string{filepath}\n\tlogger, err := cfg.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn logger, nil\n}", "title": "" }, { "docid": "f2d7848df16d696adfb5b4e78fc27c1c", "score": "0.5884707", "text": "func NewFactory() Factory {\n\treturn Factory{\n\t\tbaseLogger: DefaultLogger,\n\t}\n}", "title": "" }, { "docid": "201793146c7fac48228680a7b1f086f1", "score": "0.5884587", "text": "func getLogger(cfg Logging) (*Logger, error) {\n\tmodules := make(map[string]zerolog.Level)\n\tif len(cfg.Modules) > 0 {\n\t\tif len(cfg.Modules) != len(cfg.Levels) {\n\t\t\treturn nil, fmt.Errorf(\"modules %v don't match levels %v\", cfg.Modules, cfg.Levels)\n\t\t}\n\t\tfor i, v := range cfg.Modules {\n\t\t\tlvl, err := zerolog.ParseLevel(cfg.Levels[i])\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.WithMessagef(err, \"unknown module level %s\", v)\n\t\t\t}\n\t\t\tmodules[strings.ToUpper(v)] = lvl\n\t\t}\n\t}\n\tlvl, err := zerolog.ParseLevel(cfg.Level)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar w io.Writer\n\tdevelopment := strings.EqualFold(cfg.Env, \"DEV\")\n\n\tif development {\n\t\tcw := zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}\n\t\tcw.FormatLevel = func(i interface{}) string {\n\t\t\treturn strings.ToUpper(fmt.Sprintf(\"| %-6s|\", i))\n\t\t}\n\t\tw = io.Writer(cw)\n\t} else {\n\t\tw = os.Stderr\n\t}\n\tctx := zerolog.New(w).Level(lvl).With().Timestamp()\n\tif development {\n\t\tctx = ctx.Stack().Caller()\n\t}\n\tl := ctx.Logger()\n\treturn &Logger{module: rootName, Logger: &l, modules: modules, development: development}, nil\n}", "title": "" }, { "docid": "d6c81728eeefdbe3ad3eea24e8426ddf", "score": "0.5869431", "text": "func createLogger() *log.Logger {\n\n\tt := time.Now()\n\tformat := \"20060102\"\n\n\tfilePart := t.Format(format)\n\n\tlogDir := ensureUserHomeDir()\n\tlogDir = path.Join(logDir, \"logs\")\n\terr := os.MkdirAll(logDir, perms)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfilePath := path.Join(logDir, \"fsync-\"+filePart+\".log\")\n\tvar fi *os.File\n\tif !pathExists(filePath) {\n\t\tfi, _ = os.Create(filePath)\n\t} else {\n\t\tfi, _ = os.OpenFile(filePath, os.O_RDWR|os.O_APPEND, 0755)\n\t}\n\n\tl := log.New(fi, \"\", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile)\n\treturn l\n}", "title": "" }, { "docid": "b46eb4a621a20580275417b9db54fb3f", "score": "0.58513725", "text": "func Create(configuration model.Config) *logger.Logger {\n\tif configuration.Config == \"\" {\n\t\tlog.Fatal(\"Must supply a configuration file. Check the example file if needed\")\n\t}\n\n\tif configuration.Log == \"\" {\n\t\tfmt.Println(\"Log path not supplied, logs will not be persisted\")\n\t}\n\n\tlogger := logger.Logger{\n\t\tLevels: config.Read(configuration.Config),\n\t\tPath: configuration.Log,\n\t}\n\treturn &logger\n}", "title": "" }, { "docid": "b9e1bdd2aa78fa72791ebaf4fdc02e26", "score": "0.58450913", "text": "func (l *Logging) CreateWriter() (io.WriteCloser, error) {\n\t// TODO: config package should probably concentrate on parsing and validating\n\t// config files and this should be moved to the server.\n\tswitch l.Target {\n\tcase \"stdout\":\n\t\treturn &nopCloser{os.Stdout}, nil\n\tcase \"stderr\":\n\t\treturn &nopCloser{os.Stderr}, nil\n\n\tdefault:\n\t\t// Currently, only file path is supported\n\t\tf, err := os.OpenFile(l.Target, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot open the file %v: %v\", l.Target, err)\n\t\t}\n\t\tf.Close()\n\n\t\treturn &lumberjack.Logger{\n\t\t\tFilename: l.Target,\n\t\t\t// TODO: set rotation options\n\t\t}, nil\n\t}\n}", "title": "" }, { "docid": "5e4b0618217a3242f500c7c1f26065d7", "score": "0.5838283", "text": "func New(ctx ...interface{}) Logger {\n\treturn root.New(ctx...)\n}", "title": "" }, { "docid": "5e4b0618217a3242f500c7c1f26065d7", "score": "0.5838283", "text": "func New(ctx ...interface{}) Logger {\n\treturn root.New(ctx...)\n}", "title": "" }, { "docid": "819a95977829104f027e2048c3a83939", "score": "0.58300203", "text": "func New(w io.Writer) *Logger {\n\treturn &Logger{\n\t\tdebug: false,\n\t\tw: w,\n\t}\n}", "title": "" }, { "docid": "2b3e74d859d1432c55bef6d88b1385ee", "score": "0.58236015", "text": "func New(logger interface{}) *Logger {\n\tif logger == nil {\n\t\treturn &Logger{}\n\t}\n\n\treturn &Logger{}\n}", "title": "" }, { "docid": "c78e3f452b9b96daaae00882c42b2e19", "score": "0.5823255", "text": "func New(config *Config) *Logger {\n\tif config == nil {\n\t\tconfig = defaultConfig()\n\t}\n\n\tdefaultLogger = newLogger(config)\n\n\treturn defaultLogger\n}", "title": "" }, { "docid": "1fe2063ff08e060dd85e06509c5dc5e8", "score": "0.5822883", "text": "func getLogger(cfg Logging) (*Logger, error) {\n\tlvl, err := zerolog.ParseLevel(cfg.Level)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar w io.Writer\n\tswitch cfg.Env {\n\tcase \"dev\":\n\t\tcw := zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}\n\t\tcw.FormatLevel = func(i interface{}) string {\n\t\t\treturn strings.ToUpper(fmt.Sprintf(\"| %-6s|\", i))\n\t\t}\n\t\tcw.FormatMessage = func(i interface{}) string {\n\t\t\treturn fmt.Sprintf(\"***%s****\", i)\n\t\t}\n\t\tcw.FormatFieldName = func(i interface{}) string {\n\t\t\treturn fmt.Sprintf(\"%s:\", i)\n\t\t}\n\t\tcw.FormatFieldValue = func(i interface{}) string {\n\t\t\treturn strings.ToUpper(fmt.Sprintf(\"%s\", i))\n\t\t}\n\t\tw = io.Writer(cw)\n\tdefault:\n\t\tw = os.Stderr\n\t}\n\tl := zerolog.New(w).Level(lvl).With().Timestamp().Logger()\n\treturn &Logger{module: \"root\", Logger: &l}, nil\n}", "title": "" }, { "docid": "95670eb3da4a65b5439978320b13fbc6", "score": "0.5816729", "text": "func NewLogger(lc fx.Lifecycle, params Params, config config.LogConfig) (Component, error) {\n\tif params.logLevelFn == nil {\n\t\treturn nil, errors.New(\"must call one of core.BundleParams.LogForOneShot or LogForDaemon\")\n\t}\n\n\terr := pkgconfig.SetupLogger(\n\t\tpkgconfig.LoggerName(params.loggerName),\n\t\tparams.logLevelFn(config),\n\t\tparams.logFileFn(config),\n\t\tparams.logSyslogURIFn(config),\n\t\tparams.logSyslogRFCFn(config),\n\t\tparams.logToConsoleFn(config),\n\t\tparams.logFormatJSONFn(config))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tl := &logger{}\n\tlc.Append(fx.Hook{OnStop: func(context.Context) error {\n\t\tl.Flush()\n\t\treturn nil\n\t}})\n\n\treturn l, nil\n}", "title": "" }, { "docid": "d417edfb2db5350892a27090825b18d5", "score": "0.58034456", "text": "func makeLogger(w io.Writer, ldir, fname, pfx string) *log.Logger {\n\tlogFile := w\n\tif !pShowConsole {\n\t\tvar err error\n\t\tlogFile, err = os.OpenFile(formatLogger(ldir, fname, pfx), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t}\n\t//give it\n\treturn log.New(logFile,\n\t\tpfx,\n\t\tlog.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile)\n\n}", "title": "" }, { "docid": "d8b093a2d9411d33554cd58a4327b055", "score": "0.58033067", "text": "func NewLogging(log logger.Logger) *Logging { return &Logging{log: log} }", "title": "" }, { "docid": "bfac9e2b26c3cf077fc59fb1812e1177", "score": "0.58032674", "text": "func New(options Config) ZrLogger {\n\t// Create new logger\n\tlogger := zerolog.New(os.Stderr).With().Timestamp().Logger()\n\t// Enable stack trace\n\tzerolog.ErrorStackMarshaler = pkgerrors.MarshalStack\n\t// Define file log\n\twriter := NewRotateWriter(options.RwConfig)\n\t// Set rotate writer as the global output\n\tlogger = logger.Output(writer)\n\t// Add console writer hook\n\thook := NewConsoleWriterHook(options.CwConfig)\n\treturn logger.Hook(hook)\n}", "title": "" }, { "docid": "d0d4c5a23479640c71edc8ed62c3a695", "score": "0.5798991", "text": "func NullLogger() *log.Logger {\n\treturn log.New(ioutil.Discard, \"\", log.Ltime)\n}", "title": "" }, { "docid": "b4041ed9f2d24aabb2e6ca25b4dffa54", "score": "0.57946223", "text": "func (c *loggerConfiguratorFromEnvironment) CreateLogger(ctx context.Context) *zap.SugaredLogger {\n\treturn c.env.GetLogger()\n}", "title": "" }, { "docid": "ac0e33984363098f4425c087bf6cf4a4", "score": "0.57894254", "text": "func CreateInstance(context LogContext, level int, vlogging bool) {\n\tonce.Do(func() {\n\t\tLogger = createLoggerImpl(context, level, vlogging)\n\t})\n}", "title": "" }, { "docid": "3c188ff866375cceb358249d192c08bd", "score": "0.57852656", "text": "func (c Configuration) Build(opts ...zap.Option) (*zap.Logger, error) {\n\tlogger, err := c.Config.Build(opts...)\n\tif err != nil || c.Sentry == nil {\n\t\t// If there's an error or there's no Sentry config, we don't need to do\n\t\t// anything but delegate.\n\t\treturn logger, err\n\t}\n\tsentry, err := c.Sentry.Build()\n\tif err != nil {\n\t\treturn logger, err\n\t}\n\treturn logger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {\n\t\treturn zapcore.NewTee(core, sentry)\n\t})), nil\n}", "title": "" }, { "docid": "71a46d39f42be73d8d653bf7ac413c21", "score": "0.57800484", "text": "func New(logger logur.Logger) *Logger {\n\treturn &Logger{logger: logger}\n}", "title": "" }, { "docid": "dcee52a95df4c7702401deed021db982", "score": "0.5778913", "text": "func NewFactory(logger logrus.FieldLogger) Factory {\n\treturn Factory{logger: logger}\n}", "title": "" }, { "docid": "1d041c5ac1201de43a6506fbc92165fe", "score": "0.5778626", "text": "func NewLogger(debug io.Writer, info io.Writer) Logger {\n\tvar logger Logger\n\n\tif debug != nil {\n\t\tlogger.debug = bufio.NewWriter(debug)\n\t}\n\n\tif info != nil {\n\t\tlogger.info = bufio.NewWriter(info)\n\t}\n\n\treturn logger\n}", "title": "" }, { "docid": "8710c795db709405a13871773ed45412", "score": "0.57531756", "text": "func New(t testing.TB) *log.Logger {\n\tt.Helper()\n\treturn log.New(testWriter{TB: t}, t.Name()+\" \", log.LstdFlags|log.Lshortfile|log.LUTC)\n}", "title": "" }, { "docid": "56706bf7ec20dbe3927e206b05503641", "score": "0.5751382", "text": "func (r *Resolver) LogkeeperBuild() LogkeeperBuildResolver { return &logkeeperBuildResolver{r} }", "title": "" }, { "docid": "33be4871c942911a947831acd26ddcff", "score": "0.57369506", "text": "func New(core zapcore.Core, options ...Option) *Logger {\n\tif core == nil {\n\t\treturn NewNop()\n\t}\n\tlog := &Logger{\n\t\tcore: core,\n\t\terrorOutput: zapcore.Lock(os.Stderr),\n\t\taddStack: zapcore.FatalLevel + 1,\n\t\tclock: zapcore.DefaultClock,\n\t}\n\treturn log.WithOptions(options...)\n}", "title": "" }, { "docid": "6c0583a22cf5234e4776079304767213", "score": "0.5725745", "text": "func New(w io.Writer) Logger {\n\treturn &logger{out: w}\n}", "title": "" }, { "docid": "11ee6c097d1a6d7cd5d13396ba86b9a6", "score": "0.5718396", "text": "func New(l api.LoggerProvider) *Logger {\n\treturn &Logger{l: l}\n}", "title": "" }, { "docid": "dd822c303f5ff3acae7f0cf04a811d0d", "score": "0.57092416", "text": "func NewLogger(name string) Watchdog {\n\treturn New(name, \"\")\n}", "title": "" }, { "docid": "ee49e803331686f15d3631ab70751941", "score": "0.570869", "text": "func NewNullLogger() (*logrus.Logger, *Hook) {\n\treturn New()\n}", "title": "" }, { "docid": "7db42ce93a3f835de26bc26d0d38892c", "score": "0.569663", "text": "func NewLogger(channellen int64) *Logger {\r\n\tbl := new(Logger)\r\n\tbl.level = LevelDebug\r\n\tbl.loggerFuncCallDepth = 3\r\n\tbl.msg = make(chan *logMsg, channellen)\r\n\tbl.outputs = make(map[string]LoggerInterface)\r\n\treturn bl\r\n}", "title": "" }, { "docid": "c083311359b20e0c82882525d492364a", "score": "0.5694744", "text": "func NewNullLogger() Logger {\n\treturn &defaultLogger{\n\t\tlogger: log.New(ioutil.Discard, \"\", 0),\n\t}\n}", "title": "" }, { "docid": "e50183259f96dfac42c07c4f70ed6ffd", "score": "0.5689013", "text": "func CreateLog() *Log {\n\treturn &Log{\n\t\tlogger: logger,\n\t}\n}", "title": "" }, { "docid": "019289104626661895e5d90faa9b5545", "score": "0.5682473", "text": "func New(opts ...Option) Logger {\n\treturn newLogger(opts...)\n}", "title": "" }, { "docid": "77a23823be83509f18ebc7b2da3ab893", "score": "0.5672216", "text": "func New(conf *Config) *Logger {\n\tl := &Logger{\n\t\tclock: nowUTC,\n\t}\n\tif conf != nil {\n\t\t// Config is copied so callers can't mess things up.\n\t\tl.conf = *conf\n\t}\n\tif l.conf.Out == nil {\n\t\tl.conf.Out = os.Stdout\n\t}\n\treturn l\n}", "title": "" }, { "docid": "d5d47372752df618da2f25cc8fddb9d9", "score": "0.5670766", "text": "func New(l *log.Logger) logger {\r\n\tl1 := *l\r\n\tswitch {\r\n\tcase l1.Caller > 0:\r\n\t\tl1.Caller++\r\n\tcase l1.Caller < 0:\r\n\t\tl1.Caller--\r\n\t}\r\n\treturn logger{logger: l1}\r\n}", "title": "" }, { "docid": "1abf1f75b8b543f23fdd36a9221c853d", "score": "0.5670061", "text": "func New() writer.LogWriterCreator {\n\treturn &LogWriterCreator{}\n}", "title": "" }, { "docid": "a09bbbb539cd4bff2bf3857ea43edaa9", "score": "0.5665515", "text": "func NewLogger(debug bool, module string) *zerolog.Logger {\n\t// Default level for this example is info, unless debug flag is present\n\tzerolog.SetGlobalLevel(zerolog.InfoLevel)\n\tif debug {\n\t\tzerolog.SetGlobalLevel(zerolog.DebugLevel)\n\t}\n\toutput := zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}\n\t/*\n\t\toutput.FormatLevel = func(i interface{}) string {\n\t\t\treturn strings.ToUpper(fmt.Sprintf(\"| %-6s|\", i))\n\t\t}\n\t\toutput.FormatMessage = func(i interface{}) string {\n\t\t\treturn fmt.Sprintf(\"%s |\", i)\n\t\t}\n\t\toutput.FormatFieldName = func(i interface{}) string {\n\t\t\treturn fmt.Sprintf(\"%s:\", i)\n\t\t}\n\t\toutput.FormatFieldValue = func(i interface{}) string {\n\t\t\treturn fmt.Sprintf(\"%v\", i)\n\t\t}\n\n\t\toutput.PartsOrder = []string{\n\t\t\tzerolog.TimestampFieldName,\n\t\t\tzerolog.LevelFieldName,\n\t\t\tzerolog.CallerFieldName,\n\t\t\tzerolog.MessageFieldName,\n\t\t}\n\t*/\n\tl := zerolog.New(output).With().Caller().Str(\"module\", module).Timestamp().Logger()\n\n\treturn &l\n}", "title": "" }, { "docid": "cc42c5b310b8d09a3d29bc5bf7fedd5a", "score": "0.5657392", "text": "func NewLoggerEmpty() Logger {\r\n\treturn emptyLogger\r\n}", "title": "" }, { "docid": "704d7bcace62b42cd19849774da79cae", "score": "0.5652643", "text": "func New() *Logger {\n\treturn &Logger{}\n}", "title": "" }, { "docid": "704d7bcace62b42cd19849774da79cae", "score": "0.5652643", "text": "func New() *Logger {\n\treturn &Logger{}\n}", "title": "" }, { "docid": "704d7bcace62b42cd19849774da79cae", "score": "0.5652643", "text": "func New() *Logger {\n\treturn &Logger{}\n}", "title": "" }, { "docid": "af48508c52d57733590bb4b5134f7b6b", "score": "0.5645254", "text": "func CreateLoggerInstance() *Logger {\n\tonce.Do(func() {\n\t\tlogger = createLogger(\"application.log\")\n\t})\n\treturn logger\n}", "title": "" }, { "docid": "70296203a213b2c207739b1e8e945175", "score": "0.56426746", "text": "func (r *Runner) createLog() error {\n\n\tlogfile := \"\"\n\t// logfile input argument is NOT empty...\n\tif r.logfile != \"\" {\n\t\t// and represents absolute path, take it as it is.\n\t\tif path.IsAbs(r.logfile) {\n\t\t\tlogfile = r.logfile\n\t\t} else {\n\t\t\t// if not absolute path, get working dir and join the path to filename\n\t\t\tlogfile = path.Join(r.workdir, r.logfile)\n\t\t}\n\t} else {\n\t\tlogfile = path.Join(r.workdir, \"output.log\")\n\t}\n\tr.logfile = logfile\n\t// now the real thing...\n\tformat := \"%s %s %s\"\n\terr := r.createLoggers(format, r.debug)\n\tif err != nil {\n\t\treturn err\n\t}\n\tr.logger.Start()\n\n\t// if logger is created, this message should print...\n\tr.logger.Warning(\"Log successfully created\\n\")\n\treturn nil\n}", "title": "" }, { "docid": "375be5225667937c420a28cc797075f1", "score": "0.5641307", "text": "func New(core zapcore.Core, options ...Option) *Logger {\n\n\tlog := &Logger{\n\t\tcore: core,\n\t}\n\treturn log.WithOptions(options...)\n}", "title": "" }, { "docid": "093a8dcd0272a3b2967beb319b1aac5e", "score": "0.56359035", "text": "func New(options ...OptionsFunc) (*Logger, error) {\n\ta := zap.NewAtomicLevelAt(zapcore.InfoLevel)\n\tl := &Logger{\n\t\tConfig: zap.Config{\n\t\t\tDevelopment: false,\n\t\t\tDisableCaller: true,\n\t\t\tDisableStacktrace: true,\n\t\t\tEncoderConfig: zap.NewProductionEncoderConfig(),\n\t\t\tEncoding: \"json\",\n\t\t\tErrorOutputPaths: []string{\"stderr\"},\n\t\t\tLevel: a,\n\t\t\tOutputPaths: []string{\"stdout\"},\n\t\t},\n\t\tLevel: a,\n\t}\n\n\tfor _, f := range options {\n\t\tif err := f(l); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"options function failed\")\n\t\t}\n\t}\n\n\tlogger, err := l.Config.Build()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to build logger\")\n\t}\n\tl.Logger = logger\n\treturn l, nil\n}", "title": "" }, { "docid": "457f36e0460b2aad32feb4cbbfe22a6d", "score": "0.56257105", "text": "func New(logger interface{}) (*Log, error) {\n\tl := &Log{}\n\tif logger == nil {\n\t\tl.out = log.New(os.Stderr, \"\", log.LstdFlags)\n\t} else if g, ok := logger.(*Log); ok {\n\t\tl = g\n\t} else if g, ok := logger.(logrus.FieldLogger); ok {\n\t\tl.field = g\n\t} else if g, ok := logger.(OutputLogger); ok {\n\t\tl.out = g\n\t} else if g, ok := logger.(StdLogger); ok {\n\t\tl.std = g\n\t} else {\n\t\treturn nil, errors.New(\"unknown logging engine\")\n\t}\n\n\treturn l, nil\n}", "title": "" }, { "docid": "fcdaeb6ef31f9ddca16e3190a6a99c81", "score": "0.56221116", "text": "func NewLogger(project config.ProjectConfig, cores ...CoreMakeFunc) (*zap.Logger, error) {\n\tzapCores := make([]zapcore.Core, 0, len(cores)+1)\n\n\tif len(cores) == 0 {\n\t\tswitch project.Mode {\n\t\tcase config.ModeLocal:\n\t\t\tcores = append(cores, DefaultDevelopmentCore)\n\t\tcase config.ModeRelease:\n\t\t\tcores = append(cores, DefaultProductionCore)\n\t\tcase config.ModeTest:\n\t\t\treturn zap.NewNop(), nil\n\t\tdefault:\n\t\t\tcores = append(cores, DefaultDevelopmentCore)\n\t\t}\n\t}\n\n\tfor _, coreFunc := range cores {\n\t\tcore, err := coreFunc(project.Name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tzapCores = append(zapCores, core)\n\t}\n\n\tlogger := zap.New(\n\t\tzapcore.NewTee(zapCores...),\n\t)\n\n\treturn logger, nil\n}", "title": "" }, { "docid": "0fb0266f5268e401b26ce0c142d6328d", "score": "0.56186855", "text": "func MustGetLogger(module string) *Logger {\r\n\tfabModule := \"fabsdk/fab\"\r\n\tlogger := logging.NewLogger(fabModule)\r\n\treturn &Logger{\r\n\t\tLogger: logger,\r\n\t\tmodule: fabModule,\r\n\t}\r\n}", "title": "" }, { "docid": "203f97d003f9828f2de06208d9090926", "score": "0.5618441", "text": "func New(packageName string, logLevel LogLevel, writer io.Writer) Logger {\n\tvar logger Logger\n\tlogger.logLevel = logLevel\n\n\tlogger.trace = log.New(writer,\n\t\t\"\",\n\t\tlog.Ldate|log.Ltime)\n\ttraceLogWriter := &logWriter{packageName: packageName, logLevel: Trace}\n\tlogger.trace.SetOutput(traceLogWriter)\n\n\tlogger.info = log.New(writer,\n\t\t\"\",\n\t\tlog.Ldate|log.Ltime)\n\tinfoLogWriter := &logWriter{packageName: packageName, logLevel: Info}\n\tlogger.info.SetOutput(infoLogWriter)\n\n\tlogger.warning = log.New(writer,\n\t\t\"\",\n\t\tlog.Ldate|log.Ltime)\n\twarningLogWriter := &logWriter{packageName: packageName, logLevel: Warning}\n\tlogger.warning.SetOutput(warningLogWriter)\n\n\tlogger.error = log.New(writer,\n\t\t\"\",\n\t\tlog.Ldate|log.Ltime)\n\terrorLogWriter := &logWriter{packageName: packageName, logLevel: Error}\n\tlogger.error.SetOutput(errorLogWriter)\n\n\treturn logger\n}", "title": "" }, { "docid": "41dd46c0c0d7384d2d77c8948b668288", "score": "0.5616121", "text": "func newLogger(out io.Writer, lvl Level, callDepth int) *Logger {\n return &Logger{sink: out, level: lvl, callDepth: callDepth}\n}", "title": "" }, { "docid": "875147b2c0703f266519c8ceca5565dd", "score": "0.561496", "text": "func New(ctx context.Context) Logger {\n\treturn &logger{ctx}\n}", "title": "" }, { "docid": "4819b15b04d0a4319e19b82080e7424b", "score": "0.5613947", "text": "func newTestLogger() Logger {\n\tif testLogger == nil {\n\t\ttestLogger = &TestLogger{Fields: map[string]interface{}{}}\n\t}\n\treturn testLogger\n}", "title": "" }, { "docid": "f5c917e67bc9794dcf729c9e7c0b5b6b", "score": "0.560023", "text": "func NewLogger(conf Config) Logger {\n\treturn Logger{\n\t\tname: conf.Name,\n\t\tCaller: conf.Caller,\n\t\tCallDepth: conf.CallDepth,\n\t\tlog: conf.Logger,\n\t\texcludes: conf.Excludes,\n\t}\n}", "title": "" }, { "docid": "211583de21359e48e6434e2ce6ed3fbe", "score": "0.55993164", "text": "func New(out io.Writer, prefix string, flag int) *Logger {\n\treturn &Logger{log.New(out, prefix, flag)}\n}", "title": "" }, { "docid": "cd6c4fcbb939b8e391585dfb4cc7891c", "score": "0.5598615", "text": "func NewLogger() logapi.Logger {\n\tlogLevel := strings.ToLower(os.Getenv(\"LOG_LEVEL\"))\n\n\tl := &LoggerImpl{}\n\tif logLevel == \"info\" {\n\t\tl.InfoLevel = true\n\t}\n\tif logLevel == \"debug\" {\n\t\tl.InfoLevel = true\n\t\tl.DebugLevel = true\n\t}\n\n\tl.Logger = zerolog.New(os.Stdout).With().Timestamp().Logger()\n\treturn l\n}", "title": "" }, { "docid": "706ede13627fc39f3b36faaf205d3d8d", "score": "0.5596601", "text": "func New() *Logger {\n\treturn NewWithName(\"-\")\n}", "title": "" }, { "docid": "241dfbfa6998ef765daf6efa719bc7a2", "score": "0.5591633", "text": "func NewLogger(opts ...logger.Option) logger.Logger {\n\tl := &zeroLogger{}\n\t_ = l.Init(opts...)\n\treturn l\n}", "title": "" }, { "docid": "a7b1f7205f49552cbe838258f614278c", "score": "0.5583759", "text": "func New(prefix string, verbose bool, sinks ...Sink) *Logger {\n\treturn &Logger{\n\t\tsinks: sinks,\n\t\tverbose: verbose,\n\t\tprefix: prefix,\n\n\t\tcreated: time.Now(),\n\t\tseq: 0,\n\t\texecutable: getExecutableName(),\n\t}\n}", "title": "" }, { "docid": "0c7d5501a1072cbad115df42a92c64be", "score": "0.5580572", "text": "func NewLogWrapper(logger RawLogger, prefix string, logLevel LogLevel) Logger {\n\tif logLevel > LogLevelFatal {\n\t\tgll, ok := logger.(GetLogLeveler)\n\t\tif ok {\n\t\t\tgllLevel := gll.GetLogLevel()\n\t\t\tif gllLevel < logLevel {\n\t\t\t\tlogLevel = gllLevel\n\t\t\t}\n\t\t}\n\t}\n\n\tprefixC := prefix\n\tif prefixC != \"\" {\n\t\tprefixC += \": \"\n\t}\n\n\tl := &BasicLogger{\n\t\tprefix: prefix,\n\t\tprefixC: prefixC,\n\t\tlogger: logger,\n\t\tlogLevel: logLevel,\n\t}\n\treturn l\n}", "title": "" }, { "docid": "2fb51a530856e4f236090b551b3940e8", "score": "0.5578416", "text": "func CreateLoggerTLS(logging, loggingFile string, s3Conf types.S3Configuration, alwaysLog bool, dbConf backend.JSONConfigurationDB, mgr *settings.Settings, nodes *nodes.NodeManager, queries *queries.Queries, redis *cache.RedisManager) (*LoggerTLS, error) {\n\tl := &LoggerTLS{\n\t\tLogging: logging,\n\t\tNodes: nodes,\n\t\tQueries: queries,\n\t\tRedisCache: redis,\n\t}\n\tswitch logging {\n\tcase settings.LoggingSplunk:\n\t\ts, err := CreateLoggerSplunk(loggingFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ts.Settings(mgr)\n\t\tl.Logger = s\n\tcase settings.LoggingGraylog:\n\t\tg, err := CreateLoggerGraylog(loggingFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tg.Settings(mgr)\n\t\tl.Logger = g\n\tcase settings.LoggingDB:\n\t\td, err := CreateLoggerDBFile(loggingFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Settings(mgr)\n\t\tl.Logger = d\n\tcase settings.LoggingStdout:\n\t\td, err := CreateLoggerStdout()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Settings(mgr)\n\t\tl.Logger = d\n\tcase settings.LoggingFile:\n\t\t// TODO: All this should be customizable\n\t\trotateCfg := LumberjackConfig{\n\t\t\tMaxSize: 25,\n\t\t\tMaxBackups: 5,\n\t\t\tMaxAge: 10,\n\t\t\tCompress: true,\n\t\t}\n\t\td, err := CreateLoggerFile(DefaultFileLog, rotateCfg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Settings(mgr)\n\t\tl.Logger = d\n\tcase settings.LoggingNone:\n\t\td, err := CreateLoggerNone()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Settings(mgr)\n\t\tl.Logger = d\n\tcase settings.LoggingKinesis:\n\t\td, err := CreateLoggerKinesis(loggingFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\td.Settings(mgr)\n\t\tl.Logger = d\n\tcase settings.LoggingS3:\n\t\tvar d *LoggerS3\n\t\tvar err error\n\t\tif s3Conf.Bucket != \"\" {\n\t\t\td, err = CreateLoggerS3(s3Conf)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\td, err = CreateLoggerS3File(loggingFile)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\td.Settings(mgr)\n\t\tl.Logger = d\n\t}\n\t// Initialize the logger that will always log to DB\n\tif alwaysLog {\n\t\talways, err := CreateLoggerDBConfig(dbConf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\talways.Settings(mgr)\n\t\tl.AlwaysLogger = always\n\t}\n\treturn l, nil\n}", "title": "" }, { "docid": "567a7a8fbc2d0c21ecf66fdec363f8a9", "score": "0.55739987", "text": "func New(cfg *logger.Config) logger.Logger {\n\tvar flags int\n\tprefix := \"[\" + config.SERVICENAME + \":\" + cfg.Level.String() + \"] \"\n\tif cfg.Out == nil {\n\t\tcfg.Out = os.Stdout\n\t}\n\tif cfg.Err == nil {\n\t\tcfg.Err = os.Stderr\n\t}\n\tif cfg.Time {\n\t\tflags = log.Ldate | log.Ltime | log.Lmicroseconds\n\t\tif cfg.UTC {\n\t\t\tflags = flags | log.LUTC\n\t\t}\n\t}\n\treturn &stdLogger{\n\t\tLevel: cfg.Level,\n\t\tTime: cfg.Time,\n\t\tUTC: cfg.UTC,\n\t\tstdlog: log.New(cfg.Out, prefix, flags),\n\t\terrlog: log.New(cfg.Err, prefix, flags),\n\t}\n}", "title": "" }, { "docid": "d6a7c28669ed2dd5d8a96bf8a0b60f41", "score": "0.55532795", "text": "func New() logger {\n\treturn regular{}\n}", "title": "" }, { "docid": "b59bbd4ec5b5d7f21a306cd1deff2ed1", "score": "0.55528766", "text": "func NewLogger(opts ...Option) Logger {\n\toptions := newOptions(opts...)\n\n\t// set GlobalLevel() to the minimum value -1 = TraceLevel, so that only the services' log level matter\n\tzerolog.SetGlobalLevel(zerolog.TraceLevel)\n\n\tvar logLevel zerolog.Level\n\tswitch strings.ToLower(options.Level) {\n\tcase \"panic\":\n\t\tlogLevel = zerolog.PanicLevel\n\tcase \"fatal\":\n\t\tlogLevel = zerolog.FatalLevel\n\tcase \"error\":\n\t\tlogLevel = zerolog.ErrorLevel\n\tcase \"warn\":\n\t\tlogLevel = zerolog.WarnLevel\n\tcase \"info\":\n\t\tlogLevel = zerolog.InfoLevel\n\tcase \"debug\":\n\t\tlogLevel = zerolog.DebugLevel\n\tcase \"trace\":\n\t\tlogLevel = zerolog.TraceLevel\n\tdefault:\n\t\tlogLevel = zerolog.ErrorLevel\n\t}\n\n\tvar logger zerolog.Logger\n\n\tif options.Pretty {\n\t\tlogger = log.Output(\n\t\t\tzerolog.NewConsoleWriter(\n\t\t\t\tfunc(w *zerolog.ConsoleWriter) {\n\t\t\t\t\tw.TimeFormat = time.RFC3339\n\t\t\t\t\tw.Out = os.Stderr\n\t\t\t\t\tw.NoColor = !options.Color\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t} else if options.File != \"\" {\n\t\tf, err := os.OpenFile(options.File, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644)\n\t\tif err != nil {\n\t\t\tprint(fmt.Sprintf(\"file could not be opened for writing: %s. error: %v\", options.File, err))\n\t\t\tos.Exit(1)\n\t\t}\n\t\tlogger = logger.Output(f)\n\t} else {\n\t\tlogger = zerolog.New(os.Stderr)\n\t}\n\n\tlogger = logger.With().\n\t\tStr(\"service\", options.Name).\n\t\tTimestamp().\n\t\tLogger().Level(logLevel)\n\n\tif logLevel <= zerolog.InfoLevel {\n\t\tvar lineInfoHook LineInfoHook\n\t\tlogger = logger.Hook(lineInfoHook)\n\t}\n\n\treturn Logger{\n\t\tlogger,\n\t}\n}", "title": "" }, { "docid": "0faf898dfd4ad54a195c15fd1e75fa08", "score": "0.5548587", "text": "func New(module string, hooks ...*Hook) *Logger {\n\tif len(hooks) == 0 {\n\t\thooks = []*Hook{NewConsoleHook(\"\", logrus.WarnLevel)}\n\t}\n\tlogger := &Logger{\n\t\tEntry: createInnerLogger(ParseBool(os.Getenv(CallerEnvVar)), logrus.Fields{moduleFieldName: module}),\n\t\tCatcher: true,\n\t}\n\tlogger.AddHooks(hooks...)\n\tlogger.PrintLevel = outputLevel\n\treturn logger\n}", "title": "" }, { "docid": "d2e2dfe78de71f4b0d51660efae71417", "score": "0.55419296", "text": "func NewLogger(infoLogger, traceLogger kitlog.Logger) loggers.InfoTraceLogger {\n\tinfoTraceLogger := loggers.NewInfoTraceLogger(\n\t\tloggers.MonaxFormatLogger(infoLogger),\n\t\tloggers.MonaxFormatLogger(traceLogger))\n\t// Create a random ID based on start time\n\tuuid, _ := simpleuuid.NewTime(time.Now())\n\tvar runId string\n\tif uuid != nil {\n\t\trunId = uuid.String()\n\t}\n\treturn logging.WithMetadata(infoTraceLogger.With(structure.RunId, runId))\n}", "title": "" }, { "docid": "39f78a709b54f2d52e6d287809437ddc", "score": "0.5534688", "text": "func New(prefix string) Logs {\n\treturn &Logger{\n\t\tlvl,\n\t\tprefix,\n\t\tout,\n\t}\n}", "title": "" }, { "docid": "87b469485ac78e466e5e70253526b42f", "score": "0.5533034", "text": "func NewLogger(\n\tnodes *NodeManager,\n\tsubs *pubsub.PubSub,\n\tcap int,\n\tlevel LogLevel,\n\tsystemID string,\n) *Logger {\n\treturn &Logger{\n\t\tnodes: nodes,\n\t\tsubs: subs,\n\t\tcap: cap,\n\t\tlevel: level,\n\t\tsystemID: systemID,\n\t\tlogEntryIDs: make([]string, cap*2),\n\t\tstdoutLog: log.New(os.Stdout, \"\", log.LstdFlags),\n\t\tstderrLog: log.New(os.Stderr, \"\", log.LstdFlags),\n\t}\n}", "title": "" }, { "docid": "e5c5bd3f0f6cccd594d768e7ee4aa8c0", "score": "0.5531228", "text": "func New(w io.Writer, options ...Option) zerolog.Logger {\n\tzerolog.MessageFieldName = \"message\"\n\tzerolog.ErrorFieldName = \"error.message\"\n\tzerolog.ErrorStackMarshaler = internal.MarshallStack\n\tzerolog.ErrorStackFieldName = \"error.stack_trace\"\n\tzerolog.TimeFieldFormat = \"2006-01-02T15:04:05.999Z\" // RFC3339 at millisecond resolution in zulu timezone\n\tzerolog.TimestampFieldName = \"@timestamp\"\n\tzerolog.TimestampFunc = func() time.Time { return time.Now().UTC() }\n\tzerolog.LevelFieldName = \"log.level\"\n\tzerolog.CallerSkipFrameCount = 4\n\n\tl := zerolog.New(w).With().Timestamp().Str(\"ecs.version\", ecsVersion).Logger()\n\tfor _, option := range options {\n\t\tl = option(l)\n\t}\n\treturn l\n}", "title": "" }, { "docid": "f5ae9151df82e45fad2b955218c80374", "score": "0.5516567", "text": "func fake() *Logger {\n\tlogger := New()\n\tf, _ := os.Open(\"/dev/null\")\n\tlogger.defaultLogger = kitlog.NewJSONLogger(f)\n\treturn logger\n}", "title": "" }, { "docid": "917cb5d3c4e0e0e1b98b9f5ac980a344", "score": "0.55165577", "text": "func NewLogger(out io.Writer, lvl Level) *Logger {\n return newLogger(out, lvl, 2)\n}", "title": "" }, { "docid": "4f766e3d429eae267d8d59f0877a9c1a", "score": "0.55141497", "text": "func createLogger(fname string) *Logger {\n\tfile, err := os.OpenFile(fname, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0777)\n\tif err != nil {\n\t\tError(\"Error creating logger\", err)\n\t\tFatal(err)\n\t}\n\treturn &Logger{\n\t\tfilename: fname,\n\t\tLogger: log.New(file, \"\", log.Ldate|log.Ltime),\n\t}\n}", "title": "" }, { "docid": "1a15c21d3c973b008d4d3e0c90e22ce5", "score": "0.55117077", "text": "func New(out io.Writer, maxLevel logger.Level) logger.Logger {\n\treturn &DefaultLogger{\n\t\tLogger: log.New(out, \"\", defaultLFlag),\n\t\tMaxLevel: maxLevel,\n\t}\n}", "title": "" }, { "docid": "fed5548b43d7de9a646c21ad57acb3f8", "score": "0.551123", "text": "func NewLoggerMaker(writer io.Writer, debugLevel string, utc ...bool) (*LoggerMaker, error) {\n\tvar opts []slog.BackendOption\n\tif len(utc) > 0 && utc[0] {\n\t\topts = append(opts, inUTC())\n\t}\n\tlm := &LoggerMaker{\n\t\tBackend: slog.NewBackend(writer, opts...),\n\t\tLevels: make(map[string]slog.Level),\n\t\tDefaultLevel: DefaultLogLevel,\n\t}\n\n\terr := lm.SetLevels(debugLevel)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn lm, nil\n}", "title": "" }, { "docid": "b6c11e9e4b94d54bff977c4b2c90eb10", "score": "0.5506502", "text": "func New(name string, description string) *Logger {\n\tif _, ok := loggers[name]; ok {\n\t\tpanic(\"redefining logger\")\n\t}\n\n\tif flag.Parsed() {\n\t\tpanic(\"flags were already parsed\")\n\t}\n\n\tl := &Logger{\n\t\tname: name,\n\t\tenabled: false, // value does not matter\n\t}\n\tflag.BoolVar(&l.enabled, \"log-\"+name, false, description)\n\tloggers[name] = l\n\treturn l\n}", "title": "" }, { "docid": "c4f825f2b763a949c5503da5d90df7e1", "score": "0.5502484", "text": "func New(verbose bool) *log.Logger {\n\tif verbose {\n\t\treturn log.New(os.Stdout, \"\", log.LstdFlags)\n\t}\n\treturn log.New(io.Discard, \"\", 0)\n}", "title": "" }, { "docid": "14d957f9ac066a411c9ebc3422f83cc1", "score": "0.5501893", "text": "func New(opt *Option) (log.Logger, error) {\n\n\tif opt == nil {\n\t\treturn nil, ErrNilOption\n\t}\n\tl := &logBundle{logger: logrus.New()}\n\twriter, err := getLoggerWriter(opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tl.logger.SetOutput(writer)\n\tl.logger.SetFormatter(&logrus.JSONFormatter{})\n\n\treturn l, nil\n}", "title": "" }, { "docid": "b938f236465df2509bd4acbe670d3cf9", "score": "0.5495031", "text": "func setupLogger(cfg *conf.SplitSdkConfig) logging.LoggerInterface {\n\tvar logger logging.LoggerInterface\n\tif cfg.Logger != nil {\n\t\t// If a custom logger is supplied, use it.\n\t\tlogger = cfg.Logger\n\t} else {\n\t\tlogger = logging.NewLogger(&cfg.LoggerConfig)\n\t}\n\treturn logger\n}", "title": "" }, { "docid": "238a43d77dd73387e660f268b89959cf", "score": "0.54948336", "text": "func NewNopLogger() Logger { return nopLogger{} }", "title": "" }, { "docid": "238a43d77dd73387e660f268b89959cf", "score": "0.54948336", "text": "func NewNopLogger() Logger { return nopLogger{} }", "title": "" }, { "docid": "238a43d77dd73387e660f268b89959cf", "score": "0.54948336", "text": "func NewNopLogger() Logger { return nopLogger{} }", "title": "" } ]
3f3927596038863f7ef85e3dca71aae1
acquire loops calling tryAcquireOrRenew and returns true immediately when tryAcquireOrRenew succeeds. Returns false if ctx signals done.
[ { "docid": "8e47f8fadd17c5ba39d1a828aba17977", "score": "0.69548583", "text": "func (le *LeaderElector) acquire(ctx context.Context) bool {\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\tsucceeded := false\n\tdesc := le.config.Lock.Describe()\n\tklog.Infof(\"attempting to acquire leader lease %v...\", desc)\n\twait.JitterUntil(func() {\n\t\tsucceeded = le.tryAcquireOrRenew(ctx)\n\t\tle.maybeReportTransition()\n\t\tif !succeeded {\n\t\t\tklog.V(4).Infof(\"failed to acquire lease %v\", desc)\n\t\t\treturn\n\t\t}\n\t\tle.config.Lock.RecordEvent(\"became leader\")\n\t\tle.metrics.leaderOn(le.config.Name)\n\t\tklog.Infof(\"successfully acquired lease %v\", desc)\n\t\tcancel()\n\t}, le.config.RetryPeriod, JitterFactor, true, ctx.Done())\n\treturn succeeded\n}", "title": "" } ]
[ { "docid": "7c2b3d502a97383271ad8774677678da", "score": "0.6882102", "text": "func (s Sema) TryAcquire() (ok bool) {\n\ts.check()\n\tselect {\n\tcase s <- struct{}{}:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "53a203f71037456802467ee029fa69fd", "score": "0.6771497", "text": "func (l *listener) acquire() bool {\n\tif l.semaphore == nil {\n\t\tl.active.Add(1.0)\n\t\treturn true\n\t}\n\n\tselect {\n\tcase l.semaphore <- struct{}{}:\n\t\tl.active.Add(1.0)\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "87d2175187991821926e6b86d4412487", "score": "0.66691077", "text": "func (s Semaphore) TryAcquire() bool {\n\tselect {\n\tcase s <- struct{}{}:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "7bd8bd7c1b3eea3e9b9500d64bf2a265", "score": "0.6659929", "text": "func (tb *TokenBucket) TryAcquire() bool {\n\ttb.refill()\n\tif tb.availableToken > 0 {\n\t\ttb.availableToken--\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "b47d8aaf65e78cf3c070f6bd62c4fd3b", "score": "0.66023225", "text": "func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool {\n\tnow := metav1.NewTime(le.clock.Now())\n\tleaderElectionRecord := rl.LeaderElectionRecord{\n\t\tHolderIdentity: le.config.Lock.Identity(),\n\t\tLeaseDurationSeconds: int(le.config.LeaseDuration / time.Second),\n\t\tRenewTime: now,\n\t\tAcquireTime: now,\n\t}\n\n\t// 1. obtain or create the ElectionRecord\n\toldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx)\n\tif err != nil {\n\t\tif !errors.IsNotFound(err) {\n\t\t\tklog.Errorf(\"error retrieving resource lock %v: %v\", le.config.Lock.Describe(), err)\n\t\t\treturn false\n\t\t}\n\t\tif err = le.config.Lock.Create(ctx, leaderElectionRecord); err != nil {\n\t\t\tklog.Errorf(\"error initially creating leader election record: %v\", err)\n\t\t\treturn false\n\t\t}\n\n\t\tle.setObservedRecord(&leaderElectionRecord)\n\n\t\treturn true\n\t}\n\n\t// 2. Record obtained, check the Identity & Time\n\tif !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) {\n\t\tle.setObservedRecord(oldLeaderElectionRecord)\n\n\t\tle.observedRawRecord = oldLeaderElectionRawRecord\n\t}\n\tif len(oldLeaderElectionRecord.HolderIdentity) > 0 &&\n\t\tle.observedTime.Add(time.Second*time.Duration(oldLeaderElectionRecord.LeaseDurationSeconds)).After(now.Time) &&\n\t\t!le.IsLeader() {\n\t\tklog.V(4).Infof(\"lock is held by %v and has not yet expired\", oldLeaderElectionRecord.HolderIdentity)\n\t\treturn false\n\t}\n\n\t// 3. We're going to try to update. The leaderElectionRecord is set to it's default\n\t// here. Let's correct it before updating.\n\tif le.IsLeader() {\n\t\tleaderElectionRecord.AcquireTime = oldLeaderElectionRecord.AcquireTime\n\t\tleaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions\n\t} else {\n\t\tleaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1\n\t}\n\n\t// update the lock itself\n\tif err = le.config.Lock.Update(ctx, leaderElectionRecord); err != nil {\n\t\tklog.Errorf(\"Failed to update lock: %v\", err)\n\t\treturn false\n\t}\n\n\tle.setObservedRecord(&leaderElectionRecord)\n\treturn true\n}", "title": "" }, { "docid": "1f13cb0a1dc1b70cca648573aa9a4cf6", "score": "0.65687215", "text": "func (p *Pool) acquire() (got bool) {\n\tif got = (p.sem == nil); !got {\n\t\tselect {\n\t\tcase p.sem <- struct{}{}:\n\t\t\tgot = true\n\t\tdefault:\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "0c99444c7998e5871d4b0716458867c2", "score": "0.64719987", "text": "func (l *Listener) acquire() bool {\r\n\tselect {\r\n\tcase <-l.done:\r\n\t\treturn false\r\n\tcase l.sem <- struct{}{}:\r\n\t\treturn true\r\n\t}\r\n}", "title": "" }, { "docid": "c8d349c649f69ebd69d4ee8c6e0079f2", "score": "0.64663774", "text": "func (s *semaphore) acquire(timeout time.Duration) bool {\n\ttt := &time.Timer{}\n\tif timeout != 0 {\n\t\ttt = time.NewTimer(timeout)\n\t\tdefer tt.Stop()\n\t}\n\n\tselect {\n\tcase <-s.queue:\n\t\treturn true\n\tcase <-tt.C:\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "6110d1c97b7c918536da7f52d39faa94", "score": "0.64206094", "text": "func (l *limitListener) acquire() bool {\n\tfor {\n\t\ttimer := time.NewTimer(l.waitConnQuotaTimeout)\n\t\tstopTimer := func() {\n\t\t\tif !timer.Stop() {\n\t\t\t\t<-timer.C\n\t\t\t}\n\t\t}\n\t\tselect {\n\t\tcase <-l.done:\n\t\t\tstopTimer()\n\t\t\treturn false\n\t\tcase l.sem <- struct{}{}:\n\t\t\tstopTimer()\n\t\t\treturn true\n\t\tcase <-timer.C:\n\t\t\tl.closeForce()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "859c6a106adc907de8fd07647a42b8bb", "score": "0.63444465", "text": "func (ep *Lock) IsAcquired() bool {\n\tep.mutex.Lock()\n\tdefer ep.mutex.Unlock()\n\treturn ep.isAcquired\n}", "title": "" }, { "docid": "50964cb01f38cb969a4b46ec95bd7b23", "score": "0.63366175", "text": "func (lock *Lock) Acquire(stop <-chan struct{}) (<-chan struct{}, error) {\n\tfor {\n\t\tlost, err := lock.tryAcquire()\n\t\tif err == nil {\n\t\t\treturn lost, nil\n\t\t}\n\n\t\tif err == database.ErrLockAlreadyHeld {\n\t\t\treturn nil, database.ErrLockAlreadyHeld\n\t\t}\n\n\t\tswitch e := err.(type) {\n\t\tcase *database.ErrLockNotAcquired:\n\t\t\tif e.Err != redsync.ErrFailed {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tselect {\n\t\tcase <-stop:\n\t\t\t{\n\t\t\t\treturn nil, database.ErrLockAcquireInterrupted\n\t\t\t}\n\t\tcase <-time.After(lock.ttl / 3): //nolint\n\t\t\t{\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c4dc7566a294ed3e6d8234d08fa451c2", "score": "0.6301543", "text": "func (l *limitListener) acquire() bool {\n\tselect {\n\tcase <-l.done:\n\t\treturn false\n\tcase l.sem <- struct{}{}:\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "e6989ae2d06e3ca80af3ff75b3209e9c", "score": "0.61863077", "text": "func (s Sema) AcquireWith(ctx context.Context) (ok bool) {\n\ts.check()\n\tselect {\n\tcase s <- struct{}{}:\n\t\treturn true\n\tcase <-ctx.Done():\n\t\treturn false\n\t}\n\n}", "title": "" }, { "docid": "14a975dc99a6733bfc0cdd6f485eaf9f", "score": "0.6178546", "text": "func (f *flowController) tryAcquire(size int) bool {\n\tif f.semCount != nil {\n\t\tif !f.semCount.TryAcquire(1) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif f.semSize != nil {\n\t\tif !f.semSize.TryAcquire(f.bound(size)) {\n\t\t\tif f.semCount != nil {\n\t\t\t\tf.semCount.Release(1)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\tatomic.AddInt64(&f.countRemaining, 1)\n\treturn true\n}", "title": "" }, { "docid": "f21b1584fa773cd6f9686aa703eaf3e5", "score": "0.6112635", "text": "func (ep *Lock) acquireLock() {\n\tkeyName := \"/contiv.io/lock/\" + ep.name\n\n\t// Start a watch on the lock first so that we dont loose any notifications\n\tgo ep.watchLock()\n\n\t// Wait in this loop forever till lock times out or released\n\tfor {\n\t\tlog.Infof(\"Getting the lock %s to see if its acquired\", keyName)\n\t\t// Get the key and see if we or someone else has already acquired the lock\n\t\tresp, err := ep.client.Get(keyName, false, false)\n\t\tif err != nil {\n\t\t\tif err.(*etcd.EtcdError).ErrorCode != EtcdErrorCodeNotFound {\n\t\t\t\tlog.Errorf(\"Error getting the key %s. Err: %v\", keyName, err)\n\t\t\t} else {\n\t\t\t\tlog.Infof(\"Lock %s does not exist. trying to acquire it\", keyName)\n\t\t\t}\n\n\t\t\t// Try to acquire the lock\n\t\t\tresp, err := ep.client.Create(keyName, ep.myID, ep.ttl)\n\t\t\tif err != nil {\n\t\t\t\tif err.(*etcd.EtcdError).ErrorCode != EtcdErrorCodeKeyExists {\n\t\t\t\t\tlog.Errorf(\"Error creating key %s. Err: %v\", keyName, err)\n\t\t\t\t} else {\n\t\t\t\t\tlog.Infof(\"Lock %s acquired by someone else\", keyName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog.Infof(\"Acquired lock %s. Resp: %#v, Node: %+v\", keyName, resp, resp.Node)\n\n\t\t\t\tep.mutex.Lock()\n\t\t\t\t// Successfully acquired the lock\n\t\t\t\tep.isAcquired = true\n\t\t\t\tep.holderID = ep.myID\n\t\t\t\tep.mutex.Unlock()\n\n\t\t\t\t// Send acquired message to event channel\n\t\t\t\tep.eventChan <- LockEvent{EventType: LockAcquired}\n\n\t\t\t\t// refresh it\n\t\t\t\tep.refreshLock()\n\n\t\t\t\tep.mutex.Lock()\n\t\t\t\t// If lock is released, we are done, else go back and try to acquire it\n\t\t\t\tif ep.isReleased {\n\t\t\t\t\tep.mutex.Unlock()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tep.mutex.Unlock()\n\t\t\t}\n\t\t} else if resp.Node.Value == ep.myID {\n\t\t\tlog.Infof(\"Already Acquired key %s. Resp: %#v, Node: %+v\", keyName, resp, resp.Node)\n\n\t\t\tep.mutex.Lock()\n\t\t\t// We have already acquired the lock. just keep refreshing it\n\t\t\tep.isAcquired = true\n\t\t\tep.holderID = ep.myID\n\t\t\tep.mutex.Unlock()\n\n\t\t\t// Send acquired message to event channel\n\t\t\tep.eventChan <- LockEvent{EventType: LockAcquired}\n\n\t\t\t// Refresh lock\n\t\t\tep.refreshLock()\n\n\t\t\tep.mutex.Lock()\n\t\t\t// If lock is released, we are done, else go back and try to acquire it\n\t\t\tif ep.isReleased {\n\t\t\t\tep.mutex.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tep.mutex.Unlock()\n\t\t} else if resp.Node.Value != ep.myID {\n\t\t\tlog.Infof(\"Lock already acquired by someone else. Resp: %+v, Node: %+v\", resp, resp.Node)\n\n\t\t\tep.mutex.Lock()\n\t\t\t// Set the current holder's ID\n\t\t\tep.holderID = resp.Node.Value\n\t\t\tep.mutex.Unlock()\n\n\t\t\t// Wait for changes on the lock\n\t\t\tep.waitForLock()\n\n\t\t\tep.mutex.Lock()\n\t\t\tif ep.isReleased {\n\t\t\t\tep.mutex.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tep.mutex.Unlock()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "05c4399558abf0684717625ab63d48a3", "score": "0.60789937", "text": "func Acquire(ctx context.Context, lock Lock) error {\n\terr := lock.Lock(ctx)\n\n\tfor {\n\t\tswitch err {\n\t\tcase ErrLockFailed:\n\t\t\terr = lock.Lock(ctx)\n\t\tcase ErrLockClosed:\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a19b30f08281308666e47e64b41da154", "score": "0.6049342", "text": "func (rl *RateLimiter) TryAcquire(permits uint) (bool, error) {\n\treturn rl.TryAcquireWithTimeout(permits, 0)\n}", "title": "" }, { "docid": "cbb706e829d9263c554914d4229491fe", "score": "0.6005655", "text": "func (s *Semaphore) Acquire(ctx context.Context) error {\n\tselect {\n\tcase s.cur <- struct{}{}:\n\t\treturn nil\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}", "title": "" }, { "docid": "3d0a6876fd0582902fd805d15ad8d201", "score": "0.5965666", "text": "func (me *serviceGraphStateImpl) acquire(pod *core.Pod) bool {\n\tme.referencedByMutex.Lock()\n\tdefer me.referencedByMutex.Unlock()\n\n\tif me.referencedBy != nil {\n\t\tme.referencedBy[pod.Name] = true\n\t\treturn true\n\t}\n\n\t// This state object is ready for deletion, it cannot be acquired anymore.\n\treturn false\n}", "title": "" }, { "docid": "5cdad49ab29291820bd81f48474f5b06", "score": "0.5958451", "text": "func (sess *Session) TryAcquireLock (path api.FilePath, mode api.LockMode) (bool, error) {\n\t// Validate mode of the lock.\n\tif mode != api.EXCLUSIVE && mode != api.SHARED {\n\t\treturn false, errors.New(fmt.Sprintf(\"Invalid mode.\"))\n\t}\n\n\t// Do we already own the lock? Fail with error\n\t/*_, owned := app.locks[path]\n\tif owned {\n\t\treturn false, errors.New(fmt.Sprintf(\"We already own the lock at %s\", path))\n\t}*/\n\n\t// Check if lock exists in persistent store\n\t_, err := app.store.Get(string(path))\n\n\tif err != nil {\n\t\treturn false, errors.New(fmt.Sprintf(\"Lock at %s has not been opened\", path))\n\t}\n\n\t// Check if lock exists in in-mem struct\n\tlock, exists := app.locks[path]\n\tif !exists {\n\t\t// Assume that some failure has occurred\n\t\t// Lazily recover lock struct: add lock to in-memory struct of locks\n\t\t// TODO: check if this is correct?\n\t\tapp.logger.Printf(\"Lock Doesn't Exist with Client ID\", sess.clientID)\n\n\t\tlock = &Lock{\n\t\t\tpath: path,\n\t\t\tmode: api.FREE,\n\t\t\towners: make(map[api.ClientID]bool),\n\t\t\tcontent: \"\",\n\t\t}\n\t\tapp.locks[path] = lock\n\t\tsess.locks[path] = lock\n\t}\n\n\t// Check the mode of the lock\n\tswitch lock.mode {\n\tcase api.EXCLUSIVE:\n\t\t// Should fail: someone probably already owns the lock\n\t\tif len(lock.owners) == 0 {\n\t\t\t// Throw an error if there are no owners but lock.mode is api.EXCLUSIVE:\n\t\t\t// this means ReleaseLock was not implemented correctly\n\t\t\treturn false, errors.New(\"Lock has EXCLUSIVE mode despite having no owners\")\n\t\t} else if len(lock.owners) > 1 {\n\t\t\treturn false, errors.New(\"Lock has EXCLUSIVE mode but has multiple owners\")\n\t\t} else {\n\t\t\t// Fail with no error\n\t\t\tapp.logger.Printf(\"Failed to acquire lock %s: already held in EXCLUSIVE mode\", path)\n\t\t\treturn false, nil\n\t\t}\n\tcase api.SHARED:\n\t\t// If our mode is api.SHARED, then succeed; else fail\n\t\tif mode == api.EXCLUSIVE {\n\t\t\tapp.logger.Printf(\"Failed to acquire lock %s in EXCLUSIVE mode: already held in SHARED mode\", path)\n\t\t\treturn false, nil\n\t\t} else { // mode == api.SHARED\n\t\t\t// Update lock owners\n\t\t\tlock.owners[sess.clientID] = true\n\n\t\t\t// Add lock to session lock struct\n\t\t\tsess.locks[path] = lock\n\t\t\tapp.locks[path] = lock\n\t\t\t// Return success\n\t\t\t//app.logger.Printf(\"Lock %s acquired successfully with mode SHARED\", path)\n\t\t\treturn true, nil\n\t\t}\n\tcase api.FREE:\n\t\t// If lock has owners, either TryAcquireLock or ReleaseLock was not implemented correctly\n\t\tif len(lock.owners) > 0 {\n\t\t\treturn false, errors.New(\"Lock has FREE mode but is owned by 1 or more clients\")\n\t\t}\n\n\t\t// Should succeed regardless of mode\n\t\t// Update lock owners\n\t\tlock.owners[sess.clientID] = true\n\n\t\t// Update lock mode\n\t\tlock.mode = mode\n\n\t\t// Add lock to session lock struct\n\t\tsess.locks[path] = lock\n\n\t\t// Update Lock Mode in the global Map\n\t\tapp.locks[path] = lock\n\n\t\t// Return success\n\t\t//if mode == api.SHARED {\n\t\t//\tapp.logger.Printf(\"Lock %s acquired successfully with mode SHARED\", path)\n\t\t//} else {\n\t\t//\tapp.logger.Printf(\"Lock %s acquired successfully with mode EXCLUSIVE\", path)\n\t\t//}\n\t\treturn true, nil\n\tdefault:\n\t\treturn false, errors.New(fmt.Sprintf(\"Lock at %s has undefined mode %d\", path, lock.mode))\n\t}\n}", "title": "" }, { "docid": "d2a80935c717636199fe3606de67015e", "score": "0.59012353", "text": "func (c *Consul) RetryLockAcquire(value map[string]string, acquired chan<- struct{}, released chan<- struct{}) {\n\tticker := time.NewTicker(c.LockRetryInterval)\n\tfor range ticker.C {\n\t\tvalue[\"lockAcquisitionTime\"] = time.Now().Format(time.RFC3339)\n\t\tlock, err := c.acquireLock(value, released)\n\t\tif err != nil {\n\t\t\tlogger.LogYellow(\"Cannot connect to consul, \" + err.Error())\n\t\t\tswitch err.(type) {\n\t\t\tcase *url.Error:\n\t\t\t\tgoto ACQUIRED\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif lock {\n\t\t\tgoto ACQUIRED\n\t\t}\n\t}\n\nACQUIRED:\n\tticker.Stop()\n\tacquired <- struct{}{}\n}", "title": "" }, { "docid": "5113d075657d494872a9f10dcc69962b", "score": "0.5880388", "text": "func acquireContext() (*context, bool) {\n\t// Check if we could write into the trace buffer. gContextRef has two\n\t// counters inside. prolongedCounter is incremented when the trace is\n\t// started and decremented when the trace is stopped. Another is the\n\t// buffer reference counter. If both counters are zero, we can't write\n\t// into the buffer. See the comments for gContextRefs for more details.\n\tif atomic.LoadInt64(&gContextRefs) == 0 {\n\t\treturn nil, false\n\t}\n\t// Increment the buffer reference counter.\n\tatomic.AddInt64(&gContextRefs, bufferCounterIncrement)\n\treturn gContext, true\n}", "title": "" }, { "docid": "fe80834b9db6db27d6a99a166ebf7d3c", "score": "0.5876416", "text": "func (p *Pool) Acquire(ctx context.Context) error {\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase p.tokens <- token{}:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "65f856057459f79b6b66523b10bfe08e", "score": "0.5868713", "text": "func (mg *Gateway) Acquire() {\n\tmg.host.Acquire()\n}", "title": "" }, { "docid": "f16691a6ff9f2b25ef178e4200dc89ce", "score": "0.585639", "text": "func (k *KV) Acquire(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) {\n\tparams := make(map[string]string, 2)\n\tif p.Flags != 0 {\n\t\tparams[\"flags\"] = strconv.FormatUint(p.Flags, 10)\n\t}\n\tparams[\"acquire\"] = p.Session\n\treturn k.put(p.Key, params, p.Value, q)\n}", "title": "" }, { "docid": "52fe53b466f8831d4960f13c61aa4b25", "score": "0.58354443", "text": "func TestSemaphore_acquire_HasCapacity(t *testing.T) {\n\tgotChan := make(chan struct{}, 1)\n\twant := 1\n\n\tsem := newSemaphore(1, 0)\n\ttryAcquire(sem, gotChan)\n\tsem.release() // Allows 1 acquire\n\n\tfor i := 0; i < want; i++ {\n\t\tselect {\n\t\tcase <-gotChan:\n\t\t\t// Successfully acquired a token.\n\t\tcase <-time.After(semAcquireTimeout):\n\t\t\tt.Error(\"Was not able to acquire token before timeout\")\n\t\t}\n\t}\n\n\tselect {\n\tcase <-gotChan:\n\t\tt.Errorf(\"Got more acquires than wanted, want = %d, got at least %d\", want, want+1)\n\tcase <-time.After(semNoChangeTimeout):\n\t\t// No change happened, success.\n\t}\n}", "title": "" }, { "docid": "b63e124005dbfea54f4f8eca17e1ca32", "score": "0.5824833", "text": "func (s Semaphore) Acquire(ctx context.Context) error {\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\tcase s <- struct{}{}:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "0a9595305a42a2016cb6ec3fbb885964", "score": "0.5789164", "text": "func (s Sema) AcquireWithin(timeout time.Duration) (ok bool) {\n\ts.check()\n\tselect {\n\tcase s <- struct{}{}:\n\t\treturn true\n\tcase <-time.After(timeout):\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "93e77e2f80773bf02fe0ec32c81a83ca", "score": "0.57840943", "text": "func (s Sema) Acquire() {\n\ts.check()\n\ts <- struct{}{}\n}", "title": "" }, { "docid": "78869940e1e63d0e39ed72ad9e7fb54e", "score": "0.57709634", "text": "func (i *IdentityACL) TryAcquireLock(token string, ttl time.Duration) error {\n\treturn i.identity.TryAcquireLock(token, ttl)\n}", "title": "" }, { "docid": "4eebfe44b6d3bd158a66fc68e02fe38f", "score": "0.57568556", "text": "func (sl *spinLock) Acquire() *State {\n\tif sl.state.tryLock() {\n\t\t// acquire the lock, return directly\n\t\treturn &State{Acquired: true, WithLimit: false}\n\t}\n\n\t// can not get the lock.\n\tsl.cond.L.Lock()\n\tfor !sl.signal {\n\t\t// wait until the lock is released.\n\t\tsl.cond.Wait()\n\t}\n\tsl.cond.L.Unlock()\n\n\tif sl.withLimit.Load() {\n\t\t// need to limit the request, then pick one bucket from\n\t\t// the limiter, so that the caller can be released slowly.\n\t\t_ = sl.limiter.Wait(context.TODO())\n\n\t\treturn &State{Acquired: false, WithLimit: true}\n\t}\n\n\t// not acquired the lock.\n\treturn &State{Acquired: false, WithLimit: false}\n}", "title": "" }, { "docid": "7df12bb7ea6a41baafac980b22f15395", "score": "0.57272774", "text": "func AcquireLockInt64(p *sql.DB, ctx context.Context, lockID int64) (bool, error) {\n\tvar isLockAquired bool = false\n\n\terr := p.QueryRowContext(ctx, \"SELECT pg_try_advisory_lock($1);\", lockID).Scan(&isLockAquired)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn isLockAquired, nil\n}", "title": "" }, { "docid": "d8adec6a9f70af47290ec7077373e9fe", "score": "0.5706723", "text": "func (actor Actor) acquire(ctx context.Context, session string) (*actorEntry, bool, error) {\n\te := &actorEntry{actor: actor, lock: make(chan struct{}, 1)}\n\te.lock <- struct{}{} // lock entry\n\tfor {\n\t\tif v, loaded := actorTable.LoadOrStore(actor, e); loaded {\n\t\t\te := v.(*actorEntry) // found existing entry, := is required here!\n\t\t\te.lock <- struct{}{} // lock entry\n\t\t\tif e.valid {\n\t\t\t\tif e.session == \"\" { // start new session\n\t\t\t\t\te.session = session\n\t\t\t\t\te.depth = 1\n\t\t\t\t\te.busy = make(chan struct{})\n\t\t\t\t\t<-e.lock\n\t\t\t\t\treturn e, false, nil\n\t\t\t\t}\n\t\t\t\tif session == \"reminder\" || session != \"exclusive\" && session == e.session { // reenter existing session\n\t\t\t\t\te.depth++\n\t\t\t\t\t<-e.lock\n\t\t\t\t\treturn e, false, nil\n\t\t\t\t}\n\t\t\t\t// another session is in progress\n\t\t\t\tbusy := e.busy // read while holding the lock\n\t\t\t\t<-e.lock\n\t\t\t\tif config.ActorBusyTimeout > 0 {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-busy: // wait\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\treturn nil, false, ctx.Err()\n\t\t\t\t\tcase <-time.After(config.ActorBusyTimeout):\n\t\t\t\t\t\treturn nil, false, errActorAcquireTimeout\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-busy: // wait\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\treturn nil, false, ctx.Err()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// loop around\n\t\t\t\t// no fairness issue trying to reacquire because we waited on busy\n\t\t\t} else {\n\t\t\t\t<-e.lock // invalid entry\n\t\t\t\t// loop around\n\t\t\t\t// no fairness issue trying to reacquire because this entry is dead\n\t\t\t}\n\t\t} else { // new entry\n\t\t\tsidecar, err := pubsub.GetSidecar(ctx, actor.Type, actor.ID)\n\t\t\tif err != nil {\n\t\t\t\t<-e.lock\n\t\t\t\treturn nil, false, err\n\t\t\t}\n\t\t\tif sidecar == config.ID { // start new session\n\t\t\t\te.valid = true\n\t\t\t\te.session = session\n\t\t\t\te.depth = 1\n\t\t\t\te.busy = make(chan struct{})\n\t\t\t\t<-e.lock\n\t\t\t\treturn e, true, nil\n\t\t\t}\n\t\t\tactorTable.Delete(actor)\n\t\t\t<-e.lock // actor has moved\n\t\t\treturn nil, false, errActorHasMoved\n\t\t}\n\t}\n}", "title": "" }, { "docid": "002b0f489674fa8d6d4a845614ab9898", "score": "0.5680584", "text": "func (c *Pool) Acquire() Context {\n\tctx := c.pool.Get().(Context)\n\tctx.BeginRequest()\n\treturn ctx\n}", "title": "" }, { "docid": "d3b6a2af2f03abcfac7300a743c53a1e", "score": "0.56789327", "text": "func MaybeAcquireLeadership(client *api.Client, leaderKey string, leadershipCheckInterval int, sessionTTL int, sessionName string, exitOnLockFound bool, j DoJob) {\n\tl := leader{}\n\tsleepTime := time.Duration(leadershipCheckInterval)\n\t// buffered to accept if we receive the stop signal.\n\tdoneCh := make(chan bool, 1)\n\tfor {\n\t\tselect {\n\t\tcase <-doneCh:\n\t\t\tlog.Println(\"Received done signal, exiting..\")\n\t\t\treturn\n\t\tdefault:\n\t\t\tid, seq, success, err := acquireKey(client, leaderKey, sessionTTL, sessionName)\n\t\t\tif err != nil {\n\t\t\t\tl.errorRetryCount++\n\t\t\t\tgoto LABEL\n\t\t\t}\n\t\t\tif success {\n\t\t\t\t// Maybe the key/session got removed by administrator. Close the renewperiodic channel.\n\t\t\t\tif l.isLeader {\n\t\t\t\t\tclose(l.stopSessionRenewCh)\n\t\t\t\t}\n\t\t\t\tlog.Println(\"Consul leadership lock acquired. Assuming leadership.\")\n\n\t\t\t\tstopSessionRenewCh := make(chan struct{})\n\t\t\t\tl.stopSessionRenewCh = stopSessionRenewCh\n\t\t\t\tgo client.Session().RenewPeriodic(strconv.Itoa(sessionTTL)+\"s\", id, nil, l.stopSessionRenewCh)\n\t\t\t\tif !l.isLeader {\n\t\t\t\t\tstopCh := make(chan bool)\n\t\t\t\t\tl.stopCh = stopCh\n\t\t\t\t\tgo j.DoJobFunc(l.stopCh, doneCh)\n\t\t\t\t}\n\t\t\t\tl.isLeader = true\n\t\t\t\tl.seq = seq\n\t\t\t\ttime.Sleep(sleepTime * time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// We reached here becoz we could not acquire the key although it is possible that we are still the master.\n\t\t\tremoveSession(client, id)\n\t\t\tif !l.isLeader && exitOnLockFound {\n\t\t\t\tlog.Println(\"Consul leadership lock already acquired by some other process. Exiting...\")\n\t\t\t\tos.Exit(0)\n\t\t\t}\n\t\t\tif l.isLeader {\n\t\t\t\tlog.Printf(\"I still hold the consul leadership lock. Checking again in %d secs.\", sleepTime)\n\t\t\t} else {\n\t\t\t\tlog.Printf(\"Consul leadership lock is already aquired by some other process. Checking again in %d secs.\", sleepTime)\n\t\t\t}\n\t\tLABEL:\n\t\t\tif l.isLeader {\n\t\t\t\tif err != nil && l.errorRetryCount > errorRetryThreshold {\n\t\t\t\t\tlog.Println(\"I might have lost leadership. Sending stop signal..\")\n\t\t\t\t\tclose(l.stopCh)\n\t\t\t\t\tclose(l.stopSessionRenewCh)\n\t\t\t\t\tl.isLeader = false\n\t\t\t\t\tl.seq = nil\n\t\t\t\t} else if !reflect.DeepEqual(l.seq, seq) {\n\t\t\t\t\tlog.Println(\"Lost leadership. Sending stop signal...\")\n\t\t\t\t\tclose(l.stopCh)\n\t\t\t\t\tclose(l.stopSessionRenewCh)\n\t\t\t\t\tl.isLeader = false\n\t\t\t\t\tl.seq = nil\n\t\t\t\t}\n\t\t\t}\n\t\t\ttime.Sleep(sleepTime * time.Second)\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "ded8d1c8229dee52a4119eae20a68852", "score": "0.5642247", "text": "func (c *connector) acquire() {\n\tc.wg.Add(1)\n\tc.limit <- struct{}{}\n}", "title": "" }, { "docid": "1828cb4f8256d278de94cdf48fc4bfc0", "score": "0.5630899", "text": "func (m *Network) Acquire() {\n\tm.item.Acquire()\n}", "title": "" }, { "docid": "2930442f76ca87ac53eed3d16ff46cfe", "score": "0.55875665", "text": "func (bk *Backend) AcquireLock(token string, ttl time.Duration) (err error) {\n\tbk.log.Debugf(\"AcquireLock(%s)\", token)\n\n\tif err = backend.ValidateLockTTL(ttl); err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\n\tbucket := []string{locksBucket}\n\tfor {\n\t\t// GetVal will clear TTL on a lock\n\t\tbk.GetVal(bucket, token)\n\n\t\t// CreateVal is atomic:\n\t\terr = bk.CreateVal(bucket, token, []byte{1}, ttl)\n\t\tif err == nil {\n\t\t\tbreak // success\n\t\t}\n\t\tif trace.IsAlreadyExists(err) { // locked? wait and repeat:\n\t\t\tbk.Clock().Sleep(250 * time.Millisecond)\n\t\t\tcontinue\n\t\t}\n\t\treturn trace.ConvertSystemError(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b7d39a8d49c4dee80363d6ec4a5f25ee", "score": "0.5568633", "text": "func (l *Limiter) Acquire() {\n\n\tfor {\n\t\twindow := l.window()\n\t\tif int(atomic.AddInt64(&l.count, 1)) <= l.max {\n\t\t\treturn\n\t\t}\n\t\tduration := window.End.Sub(time.Now())\n\t\tif duration > 0 {\n\t\t\ttime.Sleep(duration)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "11af4d66159f6ad717cf8811e7fc98b0", "score": "0.5531881", "text": "func (self *TraitPermission) GetCanAcquire() (return__ bool) {\n\tvar __cgo__return__ C.gboolean\n\t__cgo__return__ = C.g_permission_get_can_acquire(self.CPointer)\n\treturn__ = __cgo__return__ == C.gboolean(1)\n\treturn\n}", "title": "" }, { "docid": "9a4d4c39bc42d15d953910b40735a854", "score": "0.5530478", "text": "func (g *group) acquire(ctx context.Context) (context.Context, context.CancelFunc, error) {\n\tif g.limiter == nil {\n\t\t// nil limiter means unlimited\n\t\treturn ctx, func() {}, nil\n\t}\n\tctx, release, err := g.limiter.Acquire(ctx)\n\treturn ctx, release, errors.Wrap(err, \"acquire limiter\")\n}", "title": "" }, { "docid": "cd02e4b13498f60d9a4710bf2ba047f4", "score": "0.5519179", "text": "func (le *LeaderElector) renew(ctx context.Context) {\n\tdefer le.config.Lock.RecordEvent(\"stopped leading\")\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\twait.Until(func() {\n\t\ttimeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline)\n\t\tdefer timeoutCancel()\n\t\terr := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) {\n\t\t\treturn le.tryAcquireOrRenew(timeoutCtx), nil\n\t\t}, timeoutCtx.Done())\n\n\t\tle.maybeReportTransition()\n\t\tdesc := le.config.Lock.Describe()\n\t\tif err == nil {\n\t\t\tklog.V(5).Infof(\"successfully renewed lease %v\", desc)\n\t\t\treturn\n\t\t}\n\t\tle.metrics.leaderOff(le.config.Name)\n\t\tklog.Infof(\"failed to renew lease %v: %v\", desc, err)\n\t\tcancel()\n\t}, le.config.RetryPeriod, ctx.Done())\n\n\t// if we hold the lease, give it up\n\tif le.config.ReleaseOnCancel {\n\t\tle.release()\n\t}\n}", "title": "" }, { "docid": "43906ab0973c549145d0948d15bcb8f2", "score": "0.55098224", "text": "func AcquireLock(p *sql.DB, ctx context.Context, lockID string) (bool, int64, error) {\n\tlockIDHash := int64(xxh3.HashString(lockID))\n\tok, err := AcquireLockInt64(p, ctx, lockIDHash)\n\tif err != nil {\n\t\treturn false, 0, err\n\t}\n\n\treturn ok, lockIDHash, nil\n}", "title": "" }, { "docid": "8cd1de94fe0da6d4b15b9a1c6409e526", "score": "0.54972714", "text": "func (backend *Backend) Lease(\n\tctx context.Context,\n\tleaseName, leaseID string,\n\tttl time.Duration,\n) (acquired bool, err error) {\n\tctx, cancel := contextutil.Merge(ctx, backend.closeCtx)\n\tdefer cancel()\n\n\t_, conn, err := backend.init(ctx)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tleaseHolderID, err := maybeAcquireLease(ctx, conn, leaseName, leaseID, ttl)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\treturn leaseHolderID == leaseID, nil\n}", "title": "" }, { "docid": "c98acd8c359f7ac3288597c732509087", "score": "0.54972374", "text": "func (l *dynamodbLock) Lock(stopChan chan struct{}) (<-chan struct{}, error) {\n\tlockHeld := make(chan struct{})\n\n\tsuccess, err := l.tryLock(lockHeld, stopChan)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif success {\n\t\treturn lockHeld, nil\n\t}\n\n\t// if we have disabled renewals then return straight away\n\tif !l.tryLockPollingEnable {\n\t\treturn nil, ErrLockAcquireFailed\n\t}\n\n\t// FIXME: This really needs a jitter for backoff\n\tticker := time.NewTicker(DefaultLockBackOff)\n\n\tfor {\n\t\tselect {\n\t\tcase <-ticker.C:\n\t\t\tsuccess, err := l.tryLock(lockHeld, stopChan)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif success {\n\t\t\t\treturn lockHeld, nil\n\t\t\t}\n\t\tcase <-stopChan:\n\t\t\treturn nil, ErrLockAcquireCancelled\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "d31568ff4506a1172fef4a2ac04d9c93", "score": "0.54883343", "text": "func (rl *RateLimiter) TryAcquireWithTimeout(permits uint, timeout time.Duration) (bool, error) {\n\tif permits == 0 {\n\t\treturn false, ErrBadPermit\n\t}\n\n\trl.Lock()\n\tnowMicros := rl.stopwatch.ReadMicros()\n\tif !rl.canAcquire(nowMicros, int64(timeout/time.Microsecond)) {\n\t\trl.Unlock()\n\t\treturn false, nil\n\t}\n\twait := rl.reserveAndGetWaitLength(permits, nowMicros)\n\trl.Unlock()\n\n\trl.stopwatch.Sleep(wait)\n\treturn true, nil\n}", "title": "" }, { "docid": "505d31f3721b71a7d88a50c1f01fa206", "score": "0.54794836", "text": "func (p *publisher) acquire() (*channel, error) {\n\tselect {\n\tcase ch := <-p.channels:\n\t\treturn ch, nil\n\tdefault:\n\t}\n\n\tc, err := p.conn.Channel()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := c.Confirm(false); err != nil { // false = noWait\n\t\treturn nil, err\n\t}\n\n\tch := &channel{\n\t\tChannel: c,\n\t\tClose: make(chan *amqp.Error),\n\t\tReturn: make(chan amqp.Return, 1),\n\t\tConfirm: make(chan amqp.Confirmation, 1),\n\t}\n\n\tc.NotifyClose(ch.Close)\n\tc.NotifyReturn(ch.Return)\n\tc.NotifyPublish(ch.Confirm)\n\n\treturn ch, nil\n}", "title": "" }, { "docid": "c5ffb11b05a323c1153bb6ea1d2572e4", "score": "0.54731965", "text": "func AcquireTxnLock(p *sql.Tx, ctx context.Context, lockID int64) (bool, error) {\n\tvar isLockAquired bool = false\n\t// fmt.Println(\"Acquiring lock on id:\", lockID)\n\terr := p.QueryRowContext(ctx, \"SELECT pg_try_advisory_xact_lock($1);\", lockID).Scan(&isLockAquired)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn isLockAquired, nil\n}", "title": "" }, { "docid": "0d61fcabd121e82d4b9713ab11beca7d", "score": "0.5470194", "text": "func TestSemaphore_acquire_HasNoCapacity(t *testing.T) {\n\tgotChan := make(chan struct{}, 1)\n\n\tsem := newSemaphore(1, 0)\n\ttryAcquire(sem, gotChan)\n\n\tselect {\n\tcase <-gotChan:\n\t\tt.Error(\"Token was acquired but shouldn't have been\")\n\tcase <-time.After(semNoChangeTimeout):\n\t\t// Test succeeds, semaphore didn't change in configured time.\n\t}\n}", "title": "" }, { "docid": "ea1703fa269c2fabffc5685486127ac7", "score": "0.54632765", "text": "func (mr *MocktimeoutSemaphoreMockRecorder) Acquire(ctx interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Acquire\", reflect.TypeOf((*MocktimeoutSemaphore)(nil).Acquire), ctx)\n}", "title": "" }, { "docid": "9844897fd6475181dfb427b0d2a51dc9", "score": "0.5389087", "text": "func (rw *CRWMutex) TryLock() bool {\n\treturn rw.sema.TryAcquire(rwmutexMaxReaders)\n}", "title": "" }, { "docid": "d4212a735c1817face2812c39aadff7b", "score": "0.53869224", "text": "func acquireSpool(ctx context.Context, r *replica) (spool fragment.Spool, err error) {\n\tselect {\n\tcase <-ctx.Done():\n\t\terr = ctx.Err() // |ctx| cancelled.\n\t\treturn\n\tcase <-r.ctx.Done():\n\t\terr = r.ctx.Err() // replica cancelled.\n\t\treturn\n\tcase spool = <-r.spoolCh:\n\t\t// Pass.\n\t}\n\n\taddTrace(ctx, \"<-replica.spoolCh => %s\", spool)\n\treturn\n}", "title": "" }, { "docid": "6a7c4f338c6824a6df52fffe06d239d3", "score": "0.53097653", "text": "func (m *MockPool) Acquire(arg0 context.Context) (*pgxpool.Conn, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Acquire\", arg0)\n\tret0, _ := ret[0].(*pgxpool.Conn)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "09f8634ad9e3264db40d2bb8426175d7", "score": "0.5303415", "text": "func (l *Lock) Acquire(ctx context.Context, end time.Time) error {\n\tkey := datastore.NameKey(lockKind, l.name, nil)\n\tf := func(tx *datastore.Transaction) error {\n\t\tnow := time.Now()\n\n\t\tlock := &lockData{}\n\t\terr := tx.Get(key, lock)\n\t\tif err != nil && err != datastore.ErrNoSuchEntity {\n\t\t\treturn status.Errorf(codes.Internal, \"reading %q failed: %v\", l.name, err)\n\t\t}\n\t\tif lock.End.After(now) {\n\t\t\treturn status.Errorf(codes.FailedPrecondition, \"lock %q is reserved till %v > now = %v\", l.name, lock.End, now)\n\t\t}\n\t\tlock = &lockData{Holder: l.holder, End: end}\n\t\tif _, err := tx.Put(key, lock); err != nil {\n\t\t\treturn status.Errorf(codes.Internal, \"writing lock %q failed: %v\", l.name, err)\n\t\t}\n\t\treturn nil\n\t}\n\tif _, err := l.client.RunInTransaction(ctx, f, datastore.MaxAttempts(1)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "be042a891669ad58d0e0bf0a6bdf397e", "score": "0.5297381", "text": "func (r *resolver) Acquire(ctx context.Context) (types.Lease, error) {\n\treturn r.leases.Acquire(ctx, r.target.Raw())\n}", "title": "" }, { "docid": "d97a3bb3a6a85dbfe0daff60fc91948b", "score": "0.5282062", "text": "func (l *LeaderElect) TryAcquire(lock int) (isLeader bool, leaderName string, err error) {\n\tisLeader = false\n\n\t// MariaDB does not have an equivalent to UPDATE ... RETURNING, so let's do that as transaction\n\ttx, err := l.connection.connection.Begin()\n\tdefer tx.Rollback()\n\tif err != nil {\n\t\treturn\n\t}\n\t_, err = tx.Exec(\"UPDATE bouncer_election SET nodeid=? WHERE id=? AND time < TIMESTAMPADD(SECOND, -30, CURRENT_TIMESTAMP());\", l.nodeID, lock)\n\tif err != nil {\n\t\treturn\n\t}\n\tresult, err := tx.Query(\"SELECT nodeid FROM bouncer_election WHERE id=?\", lock)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer result.Close()\n\tvar actualNodeID string\n\tif !result.Next() {\n\t\t// No lock entry is in the table - lets add ourselves!\n\t\t_, err = tx.Exec(\"INSERT INTO bouncer_election(nodeid, id, time) VALUES (?, ?, TIMESTAMPADD(SECOND, -30, CURRENT_TIMESTAMP()));\", l.nodeID, lock)\n\t\tif err != nil {\n\t\t\terr = errors.New(\"couldn't create new lock entry\")\n\t\t\treturn\n\t\t}\n\t\tactualNodeID = l.nodeID\n\t} else {\n\t\terr = result.Scan(&actualNodeID)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tresult.Close()\n\t}\n\terr = tx.Commit()\n\tif err != nil {\n\t\treturn\n\t}\n\tisLeader = actualNodeID == l.nodeID\n\tleaderName = actualNodeID\n\treturn\n}", "title": "" }, { "docid": "52eca9045d03b0fe6232d20a88acbbfc", "score": "0.5276285", "text": "func (m *MocktimeoutSemaphore) Acquire(ctx context.Context) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Acquire\", ctx)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "66ededa0fbb266f6be3eb917ecabc34d", "score": "0.524047", "text": "func (p *Pool) Acquire() (io.Closer, error) {\n\tselect {\n\tcase r, ok := <-p.resources:\n\t\tif ok == false {\n\t\t\treturn nil, ErrPoolClosed\n\t\t}\n\t\tlog.Println(\"acquire the old resource from pool\")\n\t\treturn r, nil\n\tdefault:\n\t\tlog.Println(\"create new resource from factory\")\n\t\treturn p.factory()\n\t}\n}", "title": "" }, { "docid": "03ef4a077caae5ee86a6b698dfb3467f", "score": "0.523945", "text": "func (s *Server) acquire(subject lease.Subject, props lease.Properties, policies policy.Set) (ls lease.Lease, snapshot lease.Snapshot, err error) {\n\tprefix := subject.String()\n\n\tstrat := policies.Strategy()\n\tlimit := policies.Limit()\n\tduration := policies.Duration()\n\tdecay := policies.Decay()\n\trefresh := policies.Refresh()\n\n\tmode := \"Creation\" // Only used for logging\n\n\tfor attempt := 0; attempt < 5; attempt++ {\n\t\tvar revision uint64\n\t\tvar leases lease.Set\n\n\t\trevision, leases, err = s.LeaseProvider.LeaseView(subject.Resource)\n\t\tif err != nil {\n\t\t\tprintf(s.Logger, \"%s: Lease retrieval failed: %v\\n\", prefix, err)\n\t\t\tcontinue\n\t\t}\n\t\tnow := time.Now()\n\n\t\tls = lease.Lease{\n\t\t\tSubject: subject,\n\t\t\tStarted: now,\n\t\t\tRenewed: now,\n\t\t\tStrategy: strat,\n\t\t\tLimit: limit,\n\t\t\tDuration: duration,\n\t\t\tDecay: decay,\n\t\t\tRefresh: refresh,\n\t\t\tProperties: props,\n\t\t}\n\n\t\tif ls.Refresh.Active != 0 {\n\t\t\tif ls.Duration <= ls.Refresh.Active {\n\t\t\t\tprintf(s.Logger, \"%s: The lease policy specified an active refresh interval of %s for a lease with a duration of %s. The refresh interval will be overridden.\\n\", prefix, ls.Refresh.Active.String(), ls.Duration.String())\n\t\t\t\tls.Refresh.Active = 0 // Use the default refresh rate instead of nonsense\n\t\t\t}\n\t\t}\n\t\tif ls.Refresh.Queued != 0 {\n\t\t\tif ls.Duration <= ls.Refresh.Queued {\n\t\t\t\tprintf(s.Logger, \"%s: The lease policy specified a queued refresh interval of %s for a lease with a duration of %s. The refresh interval will be overridden.\\n\", prefix, ls.Refresh.Queued.String(), ls.Duration.String())\n\t\t\t\tls.Refresh.Queued = 0 // Use the default refresh rate instead of nonsense\n\t\t\t}\n\t\t}\n\n\t\ttx := lease.NewTx(subject.Resource, revision, leases)\n\n\t\tacc := leaseutil.Refresh(tx, now)\n\t\tconsumed := acc.Total(strat)\n\t\treleased := acc.Released(subject.HostUser())\n\n\t\texisting, found := tx.Instance(subject.Instance)\n\t\tif found {\n\t\t\tif existing.Status == lease.Released {\n\t\t\t\t// Renewal of a released lease, possibly because of timing skew\n\t\t\t\t// Because the lease has expired we treat this as a creation\n\t\t\t\tif consumed <= limit {\n\t\t\t\t\tls.Status = lease.Active\n\t\t\t\t} else {\n\t\t\t\t\tls.Status = lease.Queued\n\t\t\t\t}\n\t\t\t\ttx.Update(existing.Instance, ls)\n\t\t\t} else {\n\t\t\t\t// Renewal of active or queued lease\n\t\t\t\tmode = \"Renewal\"\n\t\t\t\tls.Status = existing.Status\n\t\t\t\tls.Started = existing.Started\n\t\t\t\ttx.Update(existing.Instance, ls)\n\t\t\t}\n\t\t} else {\n\t\t\tif released > 0 && consumed <= limit {\n\t\t\t\t// Lease replacement (for an expired or released lease previously\n\t\t\t\t// issued to the the same consumer, that's in a decaying state)\n\t\t\t\treplaceable := tx.HostUser(subject.Instance.Host, subject.Instance.User).Status(lease.Released)\n\t\t\t\tif uint(len(replaceable)) != released {\n\t\t\t\t\tpanic(\"server: acquireHandler: accumulator returned a different count for relased leases than the transaction\")\n\t\t\t\t}\n\t\t\t\treplaced := replaceable[released-1]\n\t\t\t\tls.Status = lease.Active\n\t\t\t\ttx.Update(replaced.Instance, ls)\n\t\t\t} else {\n\t\t\t\t// New lease\n\t\t\t\tif leaseutil.CanActivate(strat, acc.Active(subject.HostUser()), consumed, limit) {\n\t\t\t\t\tls.Status = lease.Active\n\t\t\t\t} else {\n\t\t\t\t\tls.Status = lease.Queued\n\t\t\t\t}\n\t\t\t\ttx.Create(ls)\n\t\t\t}\n\t\t}\n\n\t\t// Retain the snapshot even if this ends up being an empty transaction\n\t\tsnapshot.Resource = tx.Resource()\n\t\tsnapshot.Revision = tx.Revision()\n\t\tsnapshot.Leases = tx.Leases()\n\t\tsnapshot.Stats = snapshot.Leases.Stats()\n\n\t\t// Don't bother committing empty transactions\n\t\tif tx.Empty() {\n\t\t\tbreak\n\t\t}\n\n\t\t// Attempt to commit the transaction\n\t\terr = s.LeaseProvider.LeaseCommit(tx)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tprintf(s.Logger, \"%s: Lease acquisition failed: %v\\n\", prefix, err)\n\t}\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\tsummary := statsSummary(limit, snapshot.Stats, strat)\n\tprintf(s.Logger, \"%s: %s of %s lease succeeded (%s)\\n\", prefix, mode, ls.Status, summary)\n\n\ts.publishLeaseUpdate(snapshot, summary)\n\n\treturn\n}", "title": "" }, { "docid": "4e14472d1d75792e05e2a2aa5c2d68a3", "score": "0.5218809", "text": "func (ep *Lock) waitForLock() {\n\t// If timeout is not specified, set it to high value\n\ttimeoutIntvl := time.Second * time.Duration(20000)\n\tif ep.timeout != 0 {\n\t\ttimeoutIntvl = time.Second * time.Duration(ep.timeout)\n\t}\n\n\tlog.Infof(\"Waiting to acquire lock (%s/%s)\", ep.name, ep.myID)\n\n\t// Create a timer\n\ttimer := time.NewTimer(timeoutIntvl)\n\tdefer timer.Stop()\n\n\t// Wait for changes\n\tfor {\n\t\t// wait on watch channel for holder to release the lock\n\t\tselect {\n\t\tcase <-timer.C:\n\t\t\tep.mutex.Lock()\n\t\t\tif ep.timeout != 0 {\n\t\t\t\tep.mutex.Unlock()\n\t\t\t\tlog.Infof(\"Lock timeout on lock %s/%s\", ep.name, ep.myID)\n\n\t\t\t\tep.eventChan <- LockEvent{EventType: LockAcquireTimeout}\n\n\t\t\t\tlog.Infof(\"Lock acquire timed out. Stopping lock\")\n\n\t\t\t\tep.watchStopCh <- true\n\n\t\t\t\t// Release the lock\n\t\t\t\tep.Release()\n\n\t\t\t\treturn\n\t\t\t}\n\t\t\tep.mutex.Unlock()\n\t\tcase watchResp := <-ep.watchCh:\n\t\t\tif watchResp != nil {\n\t\t\t\tlog.Debugf(\"Received watch notification(%s/%s): %+v\", ep.name, ep.myID, watchResp)\n\n\t\t\t\tif watchResp.Action == \"expire\" || watchResp.Action == \"delete\" ||\n\t\t\t\t\twatchResp.Action == \"compareAndDelete\" {\n\t\t\t\t\tlog.Infof(\"Retrying to acquire lock\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-ep.stopChan:\n\t\t\tlog.Infof(\"Stopping lock\")\n\t\t\tep.watchStopCh <- true\n\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cfc4a5bff8688b59723af63518892fca", "score": "0.5217884", "text": "func TestAcquireLease(t *testing.T) {\n\tdefer leaktest.AfterTest(t)()\n\n\tgArgs := getArgs([]byte(\"a\"))\n\tpArgs := putArgs([]byte(\"b\"), []byte(\"1\"))\n\n\ttestCases := []roachpb.Request{&gArgs, &pArgs}\n\n\tfor i, test := range testCases {\n\t\ttc := testContext{}\n\t\ttc.Start(t)\n\t\t// This is a single-replica test; since we're automatically pushing back\n\t\t// the start of a lease as far as possible, and since there is an auto-\n\t\t// matic lease for us at the beginning, we'll basically create a lease from\n\t\t// then on.\n\t\tlease, _ := tc.rng.getLease()\n\t\texpStart := lease.Start\n\t\ttc.manualClock.Set(leaseExpiry(tc.rng))\n\n\t\tts := tc.clock.Now().Next()\n\t\tif _, pErr := tc.SendWrappedWith(roachpb.Header{Timestamp: ts}, test); pErr != nil {\n\t\t\tt.Error(pErr)\n\t\t}\n\t\tif held, expired := hasLease(tc.rng, ts); !held || expired {\n\t\t\tt.Errorf(\"%d: expected lease acquisition\", i)\n\t\t}\n\t\tlease, _ = tc.rng.getLease()\n\t\tif !lease.Start.Equal(expStart) {\n\t\t\tt.Errorf(\"%d: unexpected lease start: %s; expected %s\", i, lease.Start, expStart)\n\t\t}\n\n\t\tif !ts.Less(lease.StartStasis) {\n\t\t\tt.Errorf(\"%d: %s already in stasis (or beyond): %+v\", i, ts, lease)\n\t\t}\n\n\t\tshouldRenewTS := lease.StartStasis.Add(-1, 0)\n\t\ttc.manualClock.Set(shouldRenewTS.WallTime + 1)\n\t\tif _, pErr := tc.SendWrapped(test); pErr != nil {\n\t\t\tt.Error(pErr)\n\t\t}\n\t\t// Since the command we sent above does not get blocked on the lease\n\t\t// extension, we need to wait for it to go through.\n\t\tutil.SucceedsSoon(t, func() error {\n\t\t\tnewLease, _ := tc.rng.getLease()\n\t\t\tif !lease.StartStasis.Less(newLease.StartStasis) {\n\t\t\t\treturn errors.Errorf(\"%d: lease did not get extended: %+v to %+v\", i, lease, newLease)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\ttc.Stop()\n\t\tif t.Failed() {\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b7526d4d2f4903ecff330c58db7e189e", "score": "0.51995516", "text": "func (r *Registry) acquireLeadership(item string, machine string, ttl time.Duration) bool {\n\tlog.V(2).Infof(\"Machine(%s) is attempting to acquire leadership of Item(%s)\", machine, item)\n\tkey := path.Join(keyPrefix, leadershipPrefix, item)\n\t_, err := r.etcd.Create(key, machine, uint64(ttl.Seconds()))\n\tif err == nil {\n\t\tlog.V(2).Infof(\"Machine(%s) successfully acquired leadership of Item(%s)\", machine, item)\n\t\treturn true\n\t} else {\n\t\tlog.V(2).Infof(\"Machine(%s) failed to acquire leadership of Item(%s)\", machine, item)\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "31062126ddb405dd514b8fe598d3b3c7", "score": "0.5187672", "text": "func (t *OneAtTheTime) tryLock() bool {\n\treturn atomic.CompareAndSwapUint32(&t.mu, 0, 1)\n}", "title": "" }, { "docid": "dd30a32cd6c8e019b366f0bbd5184576", "score": "0.5185955", "text": "func run_time_Semacquire(s *uint32) { panic(\"todo\")}", "title": "" }, { "docid": "7298a487b712388dbe6adde7161f75d3", "score": "0.5181399", "text": "func (c *client) acquireTopologyCacheLock(ctx context.Context) {\n\tadvisoryLockId := convertLockIdToAdvisoryLockId(topologyCacheLockId)\n\tticker := time.NewTicker(time.Second * 10)\n\n\t// Infinitely try to acquire the advisory lock\n\t// Once the lock is acquired we start caching, this is a blocking operation\n\tfor {\n\t\tc.log.Info(\"trying to acquire advisory lock\")\n\n\t\t// We create our own connection to use for acquiring the advisory lock\n\t\t// If the connection is severed for any reason the advisory lock will automatically unlock\n\t\tconn, err := c.db.Conn(ctx)\n\t\tswitch err {\n\t\tcase nil:\n\t\t\t// TODO: We could in the future spread the load of the topology caching\n\t\t\t// across many clutch instances by having an a lock per service (e.g. AWS, k8s, etc)\n\t\t\tif c.tryAdvisoryLock(ctx, conn, advisoryLockId) {\n\t\t\t\tc.log.Info(\"acquired the advisory lock, starting to cache topology now...\")\n\t\t\t\tgo c.expireCache(ctx)\n\t\t\t\tc.startTopologyCache(ctx)\n\t\t\t}\n\t\tdefault:\n\t\t\tc.log.Error(\"lost connection to database, trying to reconnect...\", zap.Error(err))\n\t\t}\n\t\t// Closes the db connection which will also release the advisory lock\n\t\tconn.Close()\n\n\t\tselect {\n\t\tcase <-ticker.C:\n\t\t\tcontinue\n\t\tcase <-ctx.Done():\n\t\t\tticker.Stop()\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "afd19adf71128c2d975bdb485209d147", "score": "0.5179032", "text": "func (kvclient *MockResKVClient) AcquireLock(ctx context.Context, lockName string, timeout time.Duration) error {\n\treturn nil\n}", "title": "" }, { "docid": "c35add9e57d251bbb39265965a6910bd", "score": "0.5160158", "text": "func (rw *CRWMutex) TryRLock() bool {\n\treturn rw.sema.TryAcquire(1)\n}", "title": "" }, { "docid": "a30aafe265416efec6f6dd1e7a56eac4", "score": "0.51517886", "text": "func (p *Pool) Acquire() (io.Closer, error) {\n\tselect {\n\tcase r, ok := <-p.resources:\n\t\tlog.Println(\"Acquire: \", \"Shared Resource\")\n\t\tif !ok {\n\t\t\treturn nil, ErrPoolClosed\n\t\t}\n\t\treturn r, nil\n\t\t// Provide a new resource if none available\n\tdefault:\n\t\tlog.Println(\"Acquire: \", \"Shared Resource\")\n\t\treturn p.factory()\n\t}\n}", "title": "" }, { "docid": "e416638050ea596bd80b6d2f3da62fec", "score": "0.51467884", "text": "func (c *Cache) EnableRenewOnGet() {\n\tc.mu.Lock()\n\tc.renewOnGet = true\n\tc.mu.Unlock()\n}", "title": "" }, { "docid": "9ee2f0c45a0195e26650325f51f56c00", "score": "0.51377064", "text": "func (p *Peer) ShouldAutoLock() bool {\n\treturn p.Spec.ExpireAction != PeerExpireActionDefault && p.IsExpired()\n}", "title": "" }, { "docid": "5e335065306e1eb2a1d32819eb24dc3a", "score": "0.51336724", "text": "func (mr *MockLockMockRecorder) Acquire() *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Acquire\", reflect.TypeOf((*MockLock)(nil).Acquire))\n}", "title": "" }, { "docid": "857b2125410a813da55ca4d32c3ce729", "score": "0.5132829", "text": "func TestAcceptRenewal(t *testing.T) {\n\tt.Parallel()\n\n\t// acceptable\n\terr := renewAllowed(true, 0, revisionSubmissionBuffer+1)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// not accepting new contracts\n\terr = renewAllowed(false, 0, revisionSubmissionBuffer+1)\n\tif !errors.Contains(err, ErrNotAcceptingContracts) {\n\t\tt.Fatal(err)\n\t}\n\n\t// too close to submission.\n\terr = renewAllowed(true, 0, revisionSubmissionBuffer)\n\tif !errors.Contains(err, ErrLateRevision) {\n\t\tt.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "6750c4825debc3cfd3e8b1832c20fec2", "score": "0.51323754", "text": "func Acquire(path string) (int, error) {\n\tlock, err := unix.Open(path, unix.O_CREAT|unix.O_RDWR|unix.O_CLOEXEC, 0600)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn lock, unix.Flock(lock, unix.LOCK_EX)\n}", "title": "" }, { "docid": "7b0dc78f6c7718cd1d26010e3bc0d1ce", "score": "0.5128051", "text": "func (le *LeaderElector) release() bool {\n\tif !le.IsLeader() {\n\t\treturn true\n\t}\n\tnow := metav1.NewTime(le.clock.Now())\n\tleaderElectionRecord := rl.LeaderElectionRecord{\n\t\tLeaderTransitions: le.observedRecord.LeaderTransitions,\n\t\tLeaseDurationSeconds: 1,\n\t\tRenewTime: now,\n\t\tAcquireTime: now,\n\t}\n\tif err := le.config.Lock.Update(context.TODO(), leaderElectionRecord); err != nil {\n\t\tklog.Errorf(\"Failed to release lock: %v\", err)\n\t\treturn false\n\t}\n\n\tle.setObservedRecord(&leaderElectionRecord)\n\treturn true\n}", "title": "" }, { "docid": "3d8645e907cb658af62563bfe8be36d6", "score": "0.5121787", "text": "func (i *IdentityACL) AcquireLock(token string, ttl time.Duration) error {\n\treturn i.identity.AcquireLock(token, ttl)\n}", "title": "" }, { "docid": "4cd992eb2a8aa7bcc695ee7535f9097a", "score": "0.5118262", "text": "func (t *inboundMsgBufferThrottler) Acquire(ctx context.Context, nodeID ids.NodeID) ReleaseFunc {\n\tstartTime := time.Now()\n\tdefer func() {\n\t\tt.metrics.acquireLatency.Observe(float64(time.Since(startTime)))\n\t}()\n\n\tt.lock.Lock()\n\tif t.nodeToNumProcessingMsgs[nodeID] < t.maxProcessingMsgsPerNode {\n\t\tt.nodeToNumProcessingMsgs[nodeID]++\n\t\tt.lock.Unlock()\n\t\treturn func() {\n\t\t\tt.release(nodeID)\n\t\t}\n\t}\n\n\t// We're currently processing the maximum number of\n\t// messages from [nodeID]. Wait until we've finished\n\t// processing some messages from [nodeID].\n\t// [closeOnAcquireChan] will be closed inside Release()\n\t// when we've acquired space on the inbound message buffer\n\t// for this message.\n\tcloseOnAcquireChan := make(chan struct{})\n\tt.awaitingAcquire[nodeID] = closeOnAcquireChan\n\tt.lock.Unlock()\n\tt.metrics.awaitingAcquire.Inc()\n\tdefer t.metrics.awaitingAcquire.Dec()\n\n\tvar releaseFunc ReleaseFunc\n\tselect {\n\tcase <-closeOnAcquireChan:\n\t\tt.lock.Lock()\n\t\tt.nodeToNumProcessingMsgs[nodeID]++\n\t\treleaseFunc = func() {\n\t\t\tt.release(nodeID)\n\t\t}\n\tcase <-ctx.Done():\n\t\tt.lock.Lock()\n\t\tdelete(t.awaitingAcquire, nodeID)\n\t\treleaseFunc = noopRelease\n\t}\n\n\tt.lock.Unlock()\n\treturn releaseFunc\n}", "title": "" }, { "docid": "57ada4b8f2974b99b5494b86ff4560fe", "score": "0.51116407", "text": "func (d *DLock) lock() (isLockObtained bool, err error) {\n\tkopts := model.PluginKVSetOptions{\n\t\tEncodeJSON: true,\n\t\tAtomic: true,\n\t\tOldValue: nil,\n\t\tExpireInSeconds: int64(lockTTL.Seconds()),\n\t}\n\tisLockObtained, aerr := d.store.KVSetWithOptions(d.key, true, kopts)\n\tif aerr != nil {\n\t\treturn false, errors.Wrap(aerr, \"KVSetWithOptions() error, cannot lock\")\n\t}\n\tif isLockObtained {\n\t\td.startRefreshLoop()\n\t}\n\treturn isLockObtained, nil\n}", "title": "" }, { "docid": "ca7dcd6dfa9748652f1c280a5755439b", "score": "0.5062456", "text": "func (p *K8sSA) AuthorizeRenew(ctx context.Context, cert *x509.Certificate) error {\n\treturn p.ctl.AuthorizeRenew(ctx, cert)\n}", "title": "" }, { "docid": "62dc41d6560030a68839307280995cdd", "score": "0.5057337", "text": "func (s *spooledHandler) lock(ctx context.Context, errs chan<- error, workerID string) chan bool {\n\trenewTimer := time.After(0)\n\tlocked := make(chan bool)\n\n\tgo func(locked chan bool) {\n\t\tvar firstLock sync.Once\n\t\tdefer close(locked)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-renewTimer:\n\t\t\t\terr := s.locker.Renew(workerID, s.ViewModel(), systemID, s.LockDuration())\n\t\t\t\tfirstLock.Do(func() {\n\t\t\t\t\tlocked <- err == nil\n\t\t\t\t})\n\t\t\t\tif err == nil {\n\t\t\t\t\trenewTimer = time.After(s.LockDuration())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif ctx.Err() == nil {\n\t\t\t\t\terrs <- err\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}(locked)\n\n\treturn locked\n}", "title": "" }, { "docid": "12fc3b87691cdc45ac81278c3437735a", "score": "0.5051561", "text": "func (s *stateLock) tryLock() bool {\n\ts.lo.Lock()\n\tdefer s.lo.Unlock()\n\tif s.status {\n\t\t// already locked by others,\n\t\t// not acquire the lock.\n\t\treturn false\n\t}\n\n\t// get lock success, set status to true which is\n\t// used to tell others that this lock is already\n\t// acquired by someone.\n\ts.status = true\n\treturn true\n}", "title": "" }, { "docid": "1e6f599521a47c4e6efb7d39f8f41737", "score": "0.5042238", "text": "func (t *Token) CanAutoRenew() bool {\n\tif t.AutoRenew.IsZero() || t.AutoRenew.After(time.Now()) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4dde9b44b98aa107122c81942f5c1d61", "score": "0.50382125", "text": "func (self *TraitPermission) AcquireFinish(result *C.GAsyncResult) (return__ bool, __err__ error) {\n\tvar __cgo_error__ *C.GError\n\tvar __cgo__return__ C.gboolean\n\t__cgo__return__ = C.g_permission_acquire_finish(self.CPointer, result, &__cgo_error__)\n\treturn__ = __cgo__return__ == C.gboolean(1)\n\tif __cgo_error__ != nil {\n\t\t__err__ = errors.New(C.GoString((*C.char)(unsafe.Pointer(__cgo_error__.message))))\n\t}\n\treturn\n}", "title": "" }, { "docid": "4448f0d3e5c7b722265f9c6946518b47", "score": "0.50312626", "text": "func AcquireSharedLockInt64(p *sql.DB, ctx context.Context, lockID int64) (bool, error) {\n\tvar isLockAquired bool = false\n\n\terr := p.QueryRowContext(ctx, \"SELECT pg_try_advisory_lock_shared($1);\", lockID).Scan(&isLockAquired)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn isLockAquired, nil\n}", "title": "" }, { "docid": "23ecb87476d89cdf8edb70d95f1476cc", "score": "0.5015519", "text": "func (op *placeOp) waitForLock(ctx context.Context) {\n\tif op.stateCST != nil {\n\t\treturn\n\t}\n\top.c.Log.Debugf(\"VolumeSeriesRequest %s: acquiring state lock\", op.rID)\n\tcst, err := op.c.App.StateGuard.Enter(string(op.rID))\n\tif err != nil {\n\t\top.rhs.SetRequestMessage(\"state lock error: %s\", err.Error())\n\t\top.rhs.RetryLater = true\n\t\treturn\n\t}\n\top.c.Log.Debugf(\"VolumeSeriesRequest %s: obtained state lock\", op.rID)\n\top.stateCST = cst\n}", "title": "" }, { "docid": "a08c2b57ac9f6b97513e6484fad5cd5d", "score": "0.5010799", "text": "func (s *Server) acquireHandler(w http.ResponseWriter, r *http.Request) {\n\treq, policies, err := s.initRequest(r)\n\tif err != nil {\n\t\tprintf(s.Logger, \"Bad acquire request: %v\\n\", err)\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// TODO: When the matching policy set dictates consumption of more than\n\t// one resource, produce a lease for each one.\n\n\t// Determine what resource the lease should be issued for\n\tif resource := policies.Resource(); resource != req.Resource {\n\t\tif req.Resource != \"\" {\n\t\t\t// This is a renewal and the current set of policies dictate\n\t\t\t// use of a different resource than before, or none at all.\n\t\t\t// Attempt to release the previously held resource before\n\t\t\t// acquiring the new one.\n\t\t\tif err := s.release(req.Subject, policies); err != nil {\n\t\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\treq.Resource = resource\n\t}\n\n\t// Return HTTP 204 if there are no matching policies\n\tif req.Resource == \"\" {\n\t\tw.Header().Set(\"Cache-Control\", \"max-age=300\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t\treturn\n\t}\n\n\t// Merge the client-provided properties with the policy-provided properties\n\tprops := lease.MergeProperties(req.Properties, policies.Properties())\n\n\tprefix := req.Subject.String()\n\n\tprintf(s.Logger, \"%s: Lease acquisition requested\\n\", prefix)\n\n\tls, snapshot, err := s.acquire(req.Subject, props, policies)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tresponse := transport.AcquireResponse{\n\t\tRequest: req,\n\t\tLease: ls,\n\t\tLeases: snapshot.Leases,\n\t}\n\n\tdata, err := json.Marshal(response)\n\tif err != nil {\n\t\tprintf(s.Logger, \"%s: Failed to marshal response: %v\\n\", prefix, err)\n\t\thttp.Error(w, \"Failed to marshal response\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tfmt.Fprintf(w, string(data))\n}", "title": "" }, { "docid": "9244c6fe39e3f2f960064db5f76ba47c", "score": "0.50083256", "text": "func (m *Manager) acquireSemaphore(ctx context.Context) error {\n\tif err, ok := m.sigs.term.Get(); ok {\n\t\treturn err\n\t} else if err := ctx.Err(); err != nil {\n\t\treturn err\n\t}\n\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\n\tcase <-m.sigs.term.Signal():\n\t\treturn m.sigs.term.Err()\n\n\tcase m.sem.Get() <- struct{}{}:\n\t\tif err := m.waitForPreviousStream(ctx); err != nil {\n\t\t\tm.sem.Recv()\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "b89cdc9d75eb52a052f6ebeb375726c2", "score": "0.499834", "text": "func (m *Mutex) TryRelease() bool {\n\treturn atomic.CompareAndSwapUint32(&m.l, 1, 0)\n}", "title": "" }, { "docid": "eeba574218ffbf739d9f589da012fa6e", "score": "0.49917424", "text": "func (s *TokenizedSemaphore) Acquire(ctx context.Context, token string) error {\n\ts.l.Lock()\n\tif s.count < s.limit && !s.tokens[token] {\n\t\ts.tokens[token] = true\n\t\ts.count++\n\t\ts.l.Unlock()\n\t\treturn nil\n\t}\n\n\ts.seq++ // Overflow?? no such thing..\n\tseq := s.seq\n\ttd := tokenWrapper{\n\t\ttoken: token,\n\t\tdoneC: make(chan struct{}),\n\t}\n\ts.pending[seq] = td\n\ts.l.Unlock()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\ts.l.Lock()\n\t\tdefer s.l.Unlock()\n\t\tselect {\n\t\tcase <-td.doneC: // Double check.\n\t\t\treturn nil // Must let user to release it.\n\t\tdefault:\n\t\t\tdelete(s.pending, seq)\n\t\t}\n\t\treturn ctx.Err()\n\tcase <-td.doneC:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "dc6c1a118e5534c671fbde77011c53d0", "score": "0.4989254", "text": "func (f *flowController) acquire(ctx context.Context, size int) error {\n\tif f.semCount != nil {\n\t\tif err := f.semCount.Acquire(ctx, 1); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif f.semSize != nil {\n\t\tif err := f.semSize.Acquire(ctx, f.bound(size)); err != nil {\n\t\t\tif f.semCount != nil {\n\t\t\t\tf.semCount.Release(1)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n\tatomic.AddInt64(&f.countRemaining, 1)\n\treturn nil\n}", "title": "" }, { "docid": "7fd9a976e6e6c4825840d3d2b20c6f88", "score": "0.49781707", "text": "func (p *pool) Acquire(ctx context.Context, metrics metrics.Metrics) (*vm, error) {\n\tmetrics.Timer(\"wasm_pool_acquire\").Start()\n\tdefer metrics.Timer(\"wasm_pool_acquire\").Stop()\n\n\tselect {\n\tcase <-ctx.Done():\n\t\treturn nil, ctx.Err()\n\tcase <-p.available:\n\t}\n\n\tp.mutex.Lock()\n\tdefer p.mutex.Unlock()\n\n\tif !p.initialized || p.closed {\n\t\treturn nil, ErrNotReady\n\t}\n\n\tfor i, vm := range p.vms {\n\t\tif !p.acquired[i] {\n\t\t\tp.acquired[i] = true\n\t\t\treturn vm, nil\n\t\t}\n\t}\n\n\tpolicy, parsedData, parsedDataAddr := p.policy, p.parsedData, p.parsedDataAddr\n\n\tp.mutex.Unlock()\n\tvm, err := newVM(vmOpts{\n\t\tpolicy: policy,\n\t\tdata: nil,\n\t\tparsedData: parsedData,\n\t\tparsedDataAddr: parsedDataAddr,\n\t\tmemoryMin: p.memoryMinPages,\n\t\tmemoryMax: p.memoryMaxPages,\n\t})\n\tp.mutex.Lock()\n\n\tif err != nil {\n\t\tp.available <- struct{}{}\n\t\treturn nil, fmt.Errorf(\"%v: %w\", err, ErrInternal)\n\t}\n\n\tp.acquired = append(p.acquired, true)\n\tp.vms = append(p.vms, vm)\n\treturn vm, nil\n}", "title": "" }, { "docid": "173b58c46d656ca15f9de8de88fb1370", "score": "0.49781036", "text": "func (s *GoServer) acquireLock(lockName string) (time.Time, bool, error) {\n\tctx, cancel := utils.ManualContext(lockName, time.Minute)\n\tdefer cancel()\n\n\tconn, err := s.FDialServer(ctx, \"versionserver\")\n\tif err != nil {\n\t\treturn time.Now(), false, err\n\t}\n\tdefer conn.Close()\n\n\tclient := pbv.NewVersionServerClient(conn)\n\tresp, err := client.SetIfLessThan(ctx, &pbv.SetIfLessThanRequest{\n\t\tTriggerValue: time.Now().Unix(),\n\t\tSet: &pbv.Version{\n\t\t\tKey: lockName,\n\t\t\tValue: time.Now().Add(time.Hour).Unix(),\n\t\t\tSetter: s.Registry.Name,\n\t\t},\n\t})\n\n\tif err != nil {\n\t\treturn time.Now(), false, err\n\t}\n\n\treturn time.Unix(resp.Response.Value, 0), resp.Success, nil\n}", "title": "" }, { "docid": "ca342a97a32d055fada566769a2d3ca8", "score": "0.49630022", "text": "func (m *MockLock) Acquire() error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Acquire\")\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "66b6b68de672106a28a1aa146c87c307", "score": "0.49602526", "text": "func (cm *ClosableMutex) TryLock() bool {\n\t_, ok := <-cm.ch\n\treturn ok\n}", "title": "" }, { "docid": "55a2469662972818b37f260520e2c3a6", "score": "0.49573502", "text": "func (f *FileClient) Acquire(ctx context.Context, options *FileAcquireOptions) (FileAcquireResponse, error) {\n\topts := options.format(f.LeaseID())\n\tresp, err := f.generated().AcquireLease(ctx, (int32)(-1), opts)\n\treturn resp, err\n}", "title": "" }, { "docid": "bd3f3256ef263949879b4c05b6ee2b08", "score": "0.49488565", "text": "func (lock *ZkLock) Lock(ctx context.Context) (LockContext, error) {\n\tlock.localLock.Lock()\n\tunlockLocal := true\n\tdefer func() {\n\t\tif unlockLocal {\n\t\t\tlock.localLock.Unlock()\n\t\t}\n\t}()\n\n\tif lock.acquired {\n\t\tpanic(\"bad zklock state\")\n\t}\n\n\tvar cancelled int32\n\tcancelChannel := make(chan int32, 1)\n\tdefer close(cancelChannel)\n\tgo func() {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tif ctx.Err() == context.DeadlineExceeded || ctx.Err() == context.Canceled {\n\t\t\t\tatomic.StoreInt32(&cancelled, 1)\n\t\t\t\tcancelChannel <- 1\n\t\t\t}\n\t\tcase <-cancelChannel:\n\t\t\tbreak\n\t\t}\n\t}()\n\tfor atomic.LoadInt32(&cancelled) == 0 {\n\t\texists, _, ch, err := lock.conn.ExistsW(lock.path)\n\t\tif err != nil {\n\t\t\tzap.L().Error(\"failed to check node\", zap.String(\"path\", lock.path), zap.Error(err))\n\t\t\treturn nil, ErrLockFailed\n\t\t}\n\n\t\tif !exists {\n\t\t\t_, err = lock.conn.Create(lock.path, []byte{}, zk.FlagEphemeral, zk.WorldACL(zk.PermAll))\n\t\t\tif err == nil {\n\t\t\t\t// wait and drop the create event\n\t\t\t\tevent := <-ch\n\t\t\t\tif event.Type != zk.EventNodeCreated {\n\t\t\t\t\tzap.L().Error(\"unexpected event, NodeCreated is expected\", zap.String(\"path\", lock.path), zap.Int32(\"event\", int32(event.Type)))\n\t\t\t\t\treturn nil, ErrLockFailed\n\t\t\t\t}\n\n\t\t\t\tlock.acquired = true\n\t\t\t\tbreak\n\t\t\t} else if err == zk.ErrNodeExists {\n\t\t\t\t// lock has been placed by other process\n\t\t\t\tevent := <-ch\n\t\t\t\tif event.Type != zk.EventNodeCreated {\n\t\t\t\t\tzap.L().Error(\"unexpected event type\", zap.String(\"path\", lock.path), zap.Int32(\"type\", int32(event.Type)))\n\t\t\t\t\treturn nil, ErrLockFailed\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tzap.L().Error(\"unexpected create error\", zap.String(\"path\", lock.path), zap.Error(err))\n\t\t\t\treturn nil, ErrLockFailed\n\t\t\t}\n\t\t} else {\n\t\t\t// wait for lock to be released or cancel event\n\t\t\tselect {\n\t\t\tcase event := <-ch:\n\t\t\t\tif event.Type != zk.EventNodeDeleted {\n\t\t\t\t\tzap.L().Error(\"unexpected event type\", zap.String(\"path\", lock.path), zap.Int32(\"type\", int32(event.Type)))\n\t\t\t\t\treturn nil, ErrLockFailed\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase <-cancelChannel:\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// if lock is acquired, local lock will be unlocked in Release\n\tunlockLocal = !lock.acquired\n\tif atomic.LoadInt32(&cancelled) == 1 {\n\t\tif lock.acquired {\n\t\t\tlock.Release()\n\t\t}\n\n\t\treturn nil, ErrLockCancelled\n\t}\n\n\treturn nil, nil\n}", "title": "" }, { "docid": "d6e0e6eb7c54b59f4f511011b6dd1994", "score": "0.49347103", "text": "func (h *ha) realAcquireLock(pod *apiv1.Pod) (*apiv1.PersistentVolumeClaim, *apiv1.PersistentVolumeClaim, error) {\n\tns := pod.GetNamespace()\n\tcomponent := pod.Labels[label.ComponentLabelKey]\n\tinstanceName := pod.Labels[label.InstanceLabelKey]\n\tpodName := pod.GetName()\n\tpvcList, err := h.pvcListFn(ns, instanceName, component)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tcurrentPVCName := pvcName(component, podName)\n\tvar currentPVC *apiv1.PersistentVolumeClaim\n\tvar schedulingPVC *apiv1.PersistentVolumeClaim\n\titems := pvcList.Items\n\tfor i := range items {\n\t\tif items[i].GetName() == currentPVCName {\n\t\t\tcurrentPVC = &items[i]\n\t\t}\n\t\tif items[i].Annotations[label.AnnPVCPodScheduling] != \"\" && schedulingPVC == nil {\n\t\t\tschedulingPVC = &items[i]\n\t\t}\n\t}\n\n\tif currentPVC == nil {\n\t\treturn schedulingPVC, currentPVC, fmt.Errorf(\"can't find current Pod %s/%s's PVC\", ns, podName)\n\t}\n\tif schedulingPVC == nil {\n\t\treturn schedulingPVC, currentPVC, h.setCurrentPodScheduling(currentPVC)\n\t}\n\tif schedulingPVC == currentPVC {\n\t\treturn schedulingPVC, currentPVC, nil\n\t}\n\n\t// if pvc is not defer deleting(has AnnPVCDeferDeleting annotation means defer deleting), we must wait for its scheduling\n\t// else clear its AnnPVCPodScheduling annotation and acquire the lock\n\tif schedulingPVC.Annotations[label.AnnPVCDeferDeleting] == \"\" {\n\t\tschedulingPodName := getPodNameFromPVC(schedulingPVC)\n\t\tschedulingPod, err := h.podGetFn(ns, schedulingPodName)\n\t\tif err != nil {\n\t\t\treturn schedulingPVC, currentPVC, err\n\t\t}\n\t\tif schedulingPVC.Status.Phase != apiv1.ClaimBound || schedulingPod.Spec.NodeName == \"\" {\n\t\t\treturn schedulingPVC, currentPVC, fmt.Errorf(\"waiting for Pod %s/%s scheduling\", ns, schedulingPodName)\n\t\t}\n\t}\n\n\tdelete(schedulingPVC.Annotations, label.AnnPVCPodScheduling)\n\terr = h.updatePVCFn(schedulingPVC)\n\tif err != nil {\n\t\tklog.Errorf(\"ha: failed to delete pvc %s/%s annotation %s, %v\",\n\t\t\tns, schedulingPVC.GetName(), label.AnnPVCPodScheduling, err)\n\t\treturn schedulingPVC, currentPVC, err\n\t}\n\tklog.Infof(\"ha: delete pvc %s/%s annotation %s successfully\",\n\t\tns, schedulingPVC.GetName(), label.AnnPVCPodScheduling)\n\treturn schedulingPVC, currentPVC, h.setCurrentPodScheduling(currentPVC)\n}", "title": "" }, { "docid": "244c18e5cdf00899c99ceca7aa2877e8", "score": "0.49287778", "text": "func (mr *MockPoolMockRecorder) Acquire(arg0 interface{}) *gomock.Call {\n\tmr.mock.ctrl.T.Helper()\n\treturn mr.mock.ctrl.RecordCallWithMethodType(mr.mock, \"Acquire\", reflect.TypeOf((*MockPool)(nil).Acquire), arg0)\n}", "title": "" }, { "docid": "793b5c230dec0eca5fda39d70cb826e2", "score": "0.49268463", "text": "func (rec *Recorder) Acquire() error {\n\tcreds, err := GenerateUserCredentials(rec.Channel, false, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trec.UID = int32(creds.UID)\n\trec.Token = creds.Rtc\n\n\trequestBody, err := json.Marshal(&AcquireRequest{\n\t\tCname: rec.Channel,\n\t\tUID: strconv.Itoa(int(rec.UID)),\n\t\tClientRequest: AcquireClientRequest{\n\t\t\tResourceExpiredHour: 24,\n\t\t},\n\t})\n\n\treq, err := http.NewRequest(\"POST\", \"https://api.agora.io/v1/apps/\"+viper.GetString(\"APP_ID\")+\"/cloud_recording/acquire\",\n\t\tbytes.NewBuffer(requestBody))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.SetBasicAuth(viper.GetString(\"CUSTOMER_ID\"), viper.GetString(\"CUSTOMER_CERTIFICATE\"))\n\n\tresp, err := rec.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tvar result map[string]string\n\tjson.NewDecoder(resp.Body).Decode(&result)\n\n\trec.RID = result[\"resourceId\"]\n\n\trec.Logger.Debug().Interface(\"Result\", result).Msg(\"Recording Result\")\n\n\treturn nil\n}", "title": "" }, { "docid": "fb27f026ce69b7d784e712a66feeb781", "score": "0.4922356", "text": "func (t *TargetPool) Acquire() (ctrl.Target, error) {\n\tc, err := t.o.Acquire(context.Background())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Target{\n\t\tConn: c.Conn().PgConn().Conn(),\n\t\tpool: t,\n\t\tpoolConn: c,\n\t}, nil\n}", "title": "" }, { "docid": "3c28788977c943ceb80fbeb8631f0f48", "score": "0.49165288", "text": "func (s *Semaphore) Acquire() *Semaphore {\n\tatomic.AddInt64(&s.waiting, 1)\n\tdefer atomic.AddInt64(&s.waiting, -1)\n\tdefer atomic.AddInt64(&s.acquired, 1)\n\n\ts.ch <- struct{}{}\n\treturn s\n}", "title": "" } ]
ab7fafef1ad55b90c23d2a8fa5e1c4e1
word tree // export golangPostfixSets
[ { "docid": "676940b57cbcd0fac29b0e622bd28c59", "score": "0.7086383", "text": "func golangPostfixSets(pText, pFilter *C.char) string {\n return wordtree.PostfixSets(C.GoString(pText), C.GoString(pFilter))\n}", "title": "" } ]
[ { "docid": "20e57d3153ad4e01f6fd0562fd0a8b6a", "score": "0.5162699", "text": "func buildTree(in []int, post []int, len int) *Node {\r\n\tmp = make(map[int]int)\r\n\tfor i := range in {\r\n\t\tk := in[i]\r\n\t\tv := i\r\n\t\tmp[k] = v\r\n\t}\r\n\r\n\tindex := len - 1 //index in postorder\r\n\treturn buildUtil(in[:], post[:], 0, len-1, &index)\r\n}", "title": "" }, { "docid": "e76cd2cb261a9520f7ecf4eb31bf8473", "score": "0.51229715", "text": "func CreateTree(file string) LongParseTree {\n\tpTree := LongParseTree{dictionary : CreateTrie(file)}\n\n\tpTree.frontDepChar = make(map[rune]bool)\n\tpTree.frontDepChar['Ð'] = true\n\tpTree.frontDepChar['Ñ'] = true\n\tpTree.frontDepChar['Ò'] = true\n\tpTree.frontDepChar['Ó'] = true\n\tpTree.frontDepChar['Ô'] = true\n\tpTree.frontDepChar['Õ'] = true\n\tpTree.frontDepChar['Ö'] = true\n\tpTree.frontDepChar['×'] = true\n\tpTree.frontDepChar['Ø'] = true\n\tpTree.frontDepChar['Ù'] = true\n\tpTree.frontDepChar['å'] = true\n\tpTree.frontDepChar['ç'] = true\n\tpTree.frontDepChar['ì'] = true\n\tpTree.frontDepChar['í'] = true\n\n\tpTree.rearDepChar = make(map[rune]bool)\n\tpTree.rearDepChar['Ñ'] = true\n\tpTree.rearDepChar['×'] = true\n\tpTree.rearDepChar['à'] = true\n\tpTree.rearDepChar['á'] = true\n\tpTree.rearDepChar['â'] = true\n\tpTree.rearDepChar['ã'] = true\n\tpTree.rearDepChar['ä'] = true\n\tpTree.rearDepChar['í'] = true\n\n\tpTree.tonalChar = make(map[rune]bool)\n\tpTree.tonalChar['è'] = true\n\tpTree.tonalChar['é'] = true\n\tpTree.tonalChar['ê'] = true\n\tpTree.tonalChar['ë'] = true\n\n\tpTree.endingChar = make(map[rune]bool)\n\tpTree.endingChar['æ'] = true\n\tpTree.endingChar['Ï'] = true\n\n\treturn pTree\n}", "title": "" }, { "docid": "c3fbf583451f455b4d3f5962b8dc2edb", "score": "0.5080108", "text": "func main() {\n\torbits := tree{}\n\n\tif len(os.Args) < 2 {\n\t\tlog.Fatalf(\"Missing parameter, provide file name!\")\n\t\treturn\n\t}\n\n\t// raw reading of the file\n\tdata, err := ioutil.ReadFile(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't read file: %v\\n\", os.Args[1])\n\t\tpanic(err)\n\t}\n\n\t// take the read file and convert it from strings to ints\n\tfor _, line := range bytes.Split(data, []byte(\"\\n\")) {\n\t\tplanets := strings.Split(strings.TrimSpace(string(line)), \")\")\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Could not extract planets from line. %v\\n\", err)\n\t\t}\n\n\t\torbits[planets[0]] = append(orbits[planets[0]], planets[1])\n\t}\n\n\tspew.Dump(\"Result:\")\n\t//\tspew.Dump(orbits)\n\n\t//\tfmt.Printf(\"nodes:%d\\n\", orbits.height(\"COM\"))\n\t//\tfmt.Printf(\"count:%d\\n\", orbits.count(\"COM\", 0))\n\tfmt.Printf(\"p:%v\\n\", orbits.parent(\"B\"))\n\tfmt.Printf(\"p:%v\\n\", orbits.parent(\"COM\"))\n\tfmt.Printf(\"q:%v\\n\", orbits.ancestry(\"YOU\"))\n\tfmt.Printf(\"q:%v\\n\", orbits.ancestry(\"SAN\"))\n\tfmt.Printf(\"q:%v\\n\", orbits.transfers(\"YOU\", \"SAN\"))\n\n}", "title": "" }, { "docid": "f735a8fa2e4d8fe3c9ba1cb1322a4218", "score": "0.5037112", "text": "func main() {\n\tout := TreeNode(txt2web.Generate(filenames(os.Args[1:]...)))\n\n\tfor tree := range out {\n\t\tfmt.Println(tree)\n\t}\n}", "title": "" }, { "docid": "990d905c6a174e3bf6b4d3d1ade01921", "score": "0.501699", "text": "func main() {\r\n\ttest := \"abcdefghijklmnopqrstuvwxyz\"\r\n\r\n\tsymFreqs := make(map[rune]int)\r\n\t// read each symbol and record the frequencies\r\n\tfor _, c := range test {\r\n\t\tsymFreqs[c]++\r\n\t}\r\n\r\n\t// example tree\r\n\texampleTree := buildTree(symFreqs)\r\n\r\n\t// print out results\r\n\tfmt.Println(\"SYMBOL\\tWEIGHT\\tHUFFMAN CODE\")\r\n\tprintCodes(exampleTree, []byte{})\r\n}", "title": "" }, { "docid": "4a8e6d8d594fa687015b6700eecf3e18", "score": "0.4998539", "text": "func ToPostfix(tokens Stack) Stack {\n\tops := Stack{}\n\toutput := Stack{}\n\tfun := Stack{}\n\tfor _, v := range tokens.Values {\n\t\tswitch v.Type {\n\t\tcase Operator:\n\t\t\tif fun.Length() > 0 {\n\t\t\t\ttok := fun.Pop()\n\t\t\t\ttok.Value.Push(v)\n\t\t\t\tfun.Push(tok)\n\t\t\t} else {\n\t\t\t\tfor !ops.IsEmpty() {\n\t\t\t\t\tval := v.Lexeme\n\t\t\t\t\ttop := ops.Peek().Lexeme\n\t\t\t\t\tif (oprData[val].prec <= oprData[top].prec && oprData[val].rAsoc == false) || (oprData[val].prec < oprData[top].prec && oprData[val].rAsoc == true) {\n\t\t\t\t\t\toutput.Push(ops.Pop())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tops.Push(v)\n\t\t\t}\n\t\tcase LParen:\n\t\t\tif fun.Length() > 0 {\n\t\t\t\ttok := fun.Pop()\n\t\t\t\ttok.Value.Push(v)\n\t\t\t\tfun.Push(tok)\n\t\t\t} else {\n\t\t\t\tops.Push(v)\n\t\t\t}\n\t\tcase RParen:\n\t\t\tif fun.Length() > 0 {\n\t\t\t\ttok := fun.Pop()\n\t\t\t\tcloseparen := 0\n\t\t\t\tfor i := tok.Value.Length() - 1; i >= 0; i-- {\n\t\t\t\t\tif tok.Value.Values[i].Type == RParen {\n\t\t\t\t\t\tcloseparen++\n\t\t\t\t\t}\n\t\t\t\t\tif tok.Value.Values[i].Type != LParen {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else if i > 0 && closeparen == 0 {\n\t\t\t\t\t\ttok.Value.Push(v)\n\t\t\t\t\t\tfun.Push(tok)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttok.Value.Push(v)\n\t\t\t\t\t\toutput.Push(tok)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor i := ops.Length() - 1; i >= 0; i-- {\n\t\t\t\t\tif ops.Values[i].Type != LParen {\n\t\t\t\t\t\toutput.Push(ops.Pop())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tops.Pop()\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tcase Function:\n\t\t\tif fun.Length() > 0 {\n\t\t\t\ttok := fun.Pop()\n\t\t\t\ttok.Value.Push(v)\n\t\t\t\tfun.Push(tok)\n\t\t\t} else {\n\t\t\t\tfun.Push(v)\n\t\t\t}\n\t\tdefault:\n\t\t\tif fun.Length() > 0 {\n\t\t\t\ttok := fun.Pop()\n\t\t\t\ttok.Value.Push(v)\n\t\t\t\tfun.Push(tok)\n\t\t\t} else {\n\t\t\t\toutput.Push(v)\n\t\t\t}\n\t\t}\n\t}\n\tops.EmptyInto(&output)\n\treturn output\n}", "title": "" }, { "docid": "f4e86d3f5bb2f1f974ad44cb32534409", "score": "0.49749076", "text": "func (p *Parser) PostfixToTree(queue *tokenQueue) (*ParseNode, error) {\n\tstack := &nodeStack{}\n\tcurrNode := &ParseNode{}\n\n\tt := queue.Head\n\tfor t != nil {\n\t\tt = t.Next\n\t}\n\n\tfor !queue.Empty() {\n\t\t// push the token onto the stack as a tree node\n\t\tcurrNode = &ParseNode{queue.Dequeue(), nil, make([]*ParseNode, 0)}\n\t\tstack.Push(currNode)\n\n\t\tif stack.Peek().Token.Type == FilterTokenFunc {\n\t\t\t// if the top of the stack is a function\n\t\t\tnode := stack.Pop()\n\t\t\tf := p.Functions[node.Token.Value]\n\t\t\t// pop off function parameters\n\t\t\tfor i := 0; i < f.Params; i++ {\n\t\t\t\tif stack.Empty() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// prepend children so they get added in the right order\n\t\t\t\tnode.Children = append([]*ParseNode{stack.Pop()}, node.Children...)\n\t\t\t}\n\t\t\tstack.Push(node)\n\t\t} else if _, ok := p.Operators[stack.Peek().Token.Value]; ok {\n\t\t\t// if the top of the stack is an operator\n\t\t\tnode := stack.Pop()\n\t\t\to := p.Operators[node.Token.Value]\n\t\t\t// pop off operands\n\t\t\tfor i := 0; i < o.Operands; i++ {\n\t\t\t\tif stack.Empty() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// prepend children so they get added in the right order\n\t\t\t\tnode.Children = append([]*ParseNode{stack.Pop()}, node.Children...)\n\t\t\t}\n\t\t\tstack.Push(node)\n\t\t}\n\n\t\tstack.Peek().Token.Value = strings.TrimSpace(stack.Peek().Token.Value)\n\t}\n\n\treturn currNode, nil\n}", "title": "" }, { "docid": "95e611948312ba7b26bcd67f61650c74", "score": "0.49664792", "text": "func (o *Operators) prune() {\n\t// Step through the tree towards the root\n\tnode := o\n\tfor node != nil {\n\t\t// Only concerned about empty nodes\n\t\tif node.Sym != nil || (node.children != nil && len(node.children) > 0) {\n\t\t\tbreak\n\t\t}\n\n\t\t// Find this node in parent and delete it\n\t\tif node.parent != nil {\n\t\t\tr, _ := utf8.DecodeLastRuneInString(node.prefix)\n\t\t\tdelete(node.parent.children, r)\n\t\t}\n\n\t\t// Step toward the root\n\t\tnode = node.parent\n\t}\n}", "title": "" }, { "docid": "ec720bc9d0301f82e73e8dce2a00153c", "score": "0.49426675", "text": "func search(start *node, end *node , sp [676]wordlists, ep [676]wordlists) (*node){\n if start.name == end.name {\n return start\n }\n\n var st_index, en_index uint16\n var _arr_st_index, _arr_en_index []uint16\n var wlen uint8\n\n var cur [110000]node\n var child node\n var ndC uint64\n ndC = 0\n ftr := []node{}\n exp := []node{}\n depth := 0\n\n ftr = append(ftr, *start)\n\n for len(ftr) != 0 {\n cur[ndC], ftr = ftr[0], ftr[1:len(ftr)]\n\n if in_queue(cur[ndC], exp) {\n continue\n }\n\n child.parent = &cur[ndC]\n child.cost = cur[ndC].cost+1\n\n st_index = 26*(uint16(cur[ndC].name[0])-'a') + (uint16(cur[ndC].name[1])-'a')\n if !in_index_arr(st_index, _arr_st_index) {\n _arr_st_index = append(_arr_st_index, st_index)\n\n child.end = false\n for i:=0; i<len(ep[st_index].word); i++ {\n child.name = ep[st_index].word[i]\n if child.name == end.name {\n return &child\n }\n ftr = append(ftr, child)\n } \n } \n\n wlen = uint8(len(cur[ndC].name))\n en_index = 26*(uint16(cur[ndC].name[wlen-2])-'a') + (uint16(cur[ndC].name[wlen-1])-'a')\n if !in_index_arr(en_index, _arr_en_index) {\n _arr_en_index = append(_arr_en_index, en_index)\n\n child.end = true\n for i:=0; i<len(sp[en_index].word); i++ {\n child.name = sp[en_index].word[i]\n if child.name == end.name {\n return &child\n }\n ftr = append(ftr, child)\n } \n }\n if cur[ndC].cost != depth {\n depth = cur[ndC].cost\n }\n exp = append(exp, cur[ndC])\n ndC++\n }\n\n child.name = \"\"\n return &child\n}", "title": "" }, { "docid": "dacb8d6e9d13bbf9eaa2ac6441ae0a86", "score": "0.4934042", "text": "func convertToPostfix(tokens []interface{}, precedence precedenceMapper) []interface{} {\n\tvar output []interface{}\n\tvar operators utils.Stack\n\tfor _, token := range tokens {\n\t\tswitch t := token.(type) {\n\t\tcase number:\n\t\t\toutput = append(output, t)\n\t\tcase par:\n\t\t\tif t.open {\n\t\t\t\toperators.Push(t)\n\t\t\t} else {\n\t\t\t\tfor operators.Peek() != (par{open: true}) {\n\t\t\t\t\toutput = append(output, operators.Pop())\n\t\t\t\t}\n\t\t\t\toperators.Pop()\n\t\t\t}\n\t\tcase mult, add:\n\t\t\tfor tos := operators.Peek(); isOperator(tos) && precedence(tos) >= precedence(t); tos = operators.Peek() {\n\t\t\t\toutput = append(output, operators.Pop())\n\t\t\t}\n\t\t\toperators.Push(t)\n\t\t}\n\t}\n\tfor operators.Peek() != nil {\n\t\toutput = append(output, operators.Pop())\n\t}\n\treturn output\n}", "title": "" }, { "docid": "190e8ae9d63c7fbe459bee8135972e37", "score": "0.487394", "text": "func main() {\n\tfset := token.NewFileSet()\n\tf, err := parser.ParseFile(fset, \"p.go\", src, 0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tconf := types.Config{}\n\tpkg, err := conf.Check(\"typesets\", fset, []*ast.File{f}, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := PrintNormalTerms(pkg); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "0b315d4638e55ed290b357b56785b7ba", "score": "0.48660308", "text": "func (t *Type1) Subset(runelist []rune) (string, error) {\n\tvar err error\n\tt.SubsetID = getCharTag(runelist)\n\tdecoded := decodeEexec(t.Segments[1])\n\tr := bytes.NewReader(decoded)\n\n\tindexCharstrings := bytes.Index(decoded, []byte(\"/CharStrings\"))\n\tbb := new(bytes.Buffer)\n\t_, err = bb.Write(decoded[:indexCharstrings])\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t_, err = r.Seek(int64(indexCharstrings+len(\"/CharStrings\")+1), os.SEEK_SET)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\terr = forwardTo(r, '/')\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfor {\n\t\tcharname, codes, err := readCharstring(r)\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\n\t\tc := t.CharsName[charname]\n\t\tc.Charstring = codes\n\n\t\tt.CharsName[charname] = c\n\t\tt.CharsCodepoint[c.Codepoint] = c\n\t}\n\n\tfmt.Fprintf(bb, \"/CharStrings %d dict dup begin\\n\", len(runelist)+1)\n\tfor _, r := range runelist {\n\t\tc := t.CharsCodepoint[r]\n\t\tfmt.Fprintf(bb, \"/%s %d RD \", c.Name, len(c.Charstring))\n\t\tbb.Write(c.Charstring)\n\t\tfmt.Fprintln(bb, \" ND\")\n\t}\n\tcs := t.CharsName[\".notdef\"].Charstring\n\tfmt.Fprintf(bb, \"/.notdef %d RD \", len(cs))\n\tbb.Write(cs)\n\tfmt.Fprintln(bb, \" ND\")\n\n\t_, err = io.Copy(bb, r)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tt.Segments[1] = encodeEexec([]byte{1, 1, 1, 1}, bb.Bytes())\n\n\t// segment 1 done, now segment 0\n\tsegments0 := t.Segments[0]\n\n\t// Is there a requirement for line ending? I don't know, so I try out two common ways\n\tvar lines []string\n\t{\n\t\tlineenda := regexp.MustCompile(\"\\r\\n?\")\n\t\tlineendb := regexp.MustCompile(\"\\r?\\n\")\n\t\ta := lineenda.Split(string(segments0), -1)\n\t\tb := lineendb.Split(string(segments0), -1)\n\t\tif len(a) > len(b) {\n\t\t\tlines = a\n\t\t} else {\n\t\t\tlines = b\n\t\t}\n\t}\n\n\tfontnameRegexp := regexp.MustCompile(\"/FontName /(.*) def\")\n\tfor i := 0; i < len(lines); i++ {\n\t\tif strings.HasPrefix(lines[i], \"/FontName\") {\n\t\t\tlines[i] = fontnameRegexp.ReplaceAllString(lines[i], \"/FontName /\"+t.SubsetID+\"+$1 def\")\n\t\t}\n\t}\n\tsegments0 = []byte(strings.Join(lines, \"\\n\"))\n\n\tindexEncoding := bytes.Index(segments0, []byte(\"/Encoding\"))\n\tindexReadonlyDef := bytes.Index(segments0[indexEncoding:], []byte(\"readonly def\"))\n\tr = bytes.NewReader(segments0)\n\tr.Seek(int64(indexEncoding+len(\"/Encoding\")+1), os.SEEK_SET)\n\t_, err = readInt(r)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tassertString(r, \"array\")\n\tbb = new(bytes.Buffer)\n\tbb.Write(segments0[:indexEncoding])\n\tfmt.Fprintf(bb, \"/Encoding 256 array\\n\")\n\tfmt.Fprintln(bb, \"0 1 255 {1 index exch /.notdef put } for\")\n\n\tret := make([]string, len(runelist))\n\tfor _, r := range runelist {\n\t\tfmt.Fprintf(bb, \"dup %d /%s put\\n\", t.CharsCodepoint[r].OrigCodepoint, t.CharsCodepoint[r].Name)\n\t\tret = append(ret, \"/\", t.CharsCodepoint[r].Name)\n\t}\n\tbb.Write(segments0[indexEncoding+indexReadonlyDef:])\n\tt.Segments[0] = bb.Bytes()\n\treturn strings.Join(ret, \"\"), nil\n}", "title": "" }, { "docid": "e52f990ccef0752f61a119a5a6a7da84", "score": "0.4842412", "text": "func main() {\n\tfmt.Println(genNumTreesDP(5))\n}", "title": "" }, { "docid": "c51eb4aefe7199ec155aa4e0b76894f1", "score": "0.48415187", "text": "func (t *zsTree) tree(i int) *Tree {\n\treturn t.labels[i-1]\n}", "title": "" }, { "docid": "59975fe495915175511b4c7d903e6f41", "score": "0.48067877", "text": "func (t *Tree) Prune() {\n\tlogrus.Info(\"Pruning\")\n\tfor name, leaf := range t.packageMap {\n\t\tif !leaf.keep {\n\t\t\tdelete(t.packageMap, name)\n\t\t\tcontinue\n\t\t}\n\t\tnewDeps := []string{}\n\t\tfor _, importName := range leaf.deps {\n\t\t\tif importLeaf, ok := t.packageMap[importName]; ok && importLeaf.keep {\n\t\t\t\tnewDeps = append(newDeps, importName)\n\t\t\t}\n\t\t\tleaf.deps = newDeps\n\t\t\tt.packageMap[name] = leaf\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fa9e00df8b2a9a1df985ca13f3366240", "score": "0.47228244", "text": "func getTree(st interface{}, tree []interface{}, bp map[SubTree]interface{}) []interface{} {\n\tswitch vv := st.(type) {\n\tcase UnaryRule:\n\t\ttree = append(tree, vv.X)\n\t\ttree = append(tree, vv.Y)\n\tcase BPSubTree:\n\t\tleft := getTree(bp[vv.Left], tree, bp)\n\t\tright := getTree(bp[vv.Right], tree, bp)\n\t\ttree = append(tree, vv.Root)\n\t\ttree = append(tree, left)\n\t\ttree = append(tree, right)\n\t}\n\treturn tree\n}", "title": "" }, { "docid": "b34591d1fd570df4141c9a07e88a9f76", "score": "0.4717223", "text": "func (bt *BinaryTree) PostOrder() string {\n\tif bt.head.left != bt.head.right {\n\t\treturn \"\"\n\t}\n\n\tvar r []string\n\tpostOrder(bt.head.left, &r)\n\n\treturn strings.Join(r, \"->\")\n}", "title": "" }, { "docid": "b2e9675d1cc84e357aa6e5a0fa2767de", "score": "0.46957138", "text": "func buildMoreComplicatedWordsTree() *GreedyWordTreeNode {\n\thead := NewGreedyWordTreeElement(\"aaaa\", 0, nil)\n\tabaa := NewGreedyWordTreeElement(\"abaa\", 0, head)\n\thead.NextElements = append(head.NextElements, abaa)\n\tabea := NewGreedyWordTreeElement(\"abea\", 1, abaa)\n\tabaa.NextElements = append(abaa.NextElements, abea)\n\tabee := NewGreedyWordTreeElement(\"abee\", 2, abea)\n\tabea.NextElements = append(abea.NextElements, abee)\n\taeee := NewGreedyWordTreeElement(\"aeee\", 3, abee)\n\tabee.NextElements = append(abee.NextElements, aeee)\n\teeee := NewGreedyWordTreeElement(\"eeee\", 4, aeee)\n\taeee.NextElements = append(aeee.NextElements, eeee)\n\n\treturn head\n}", "title": "" }, { "docid": "048bdb8e8bb7ef65e1cab6554ba9983c", "score": "0.4691433", "text": "func (f *Forest) dump(t *testing.T) {\n\tt.Logf(\"---------------- TRIE BEGIN ------------------\")\n\tchildNodes := make(map[string]*Node, len(f.nodes))\n\tfor _, n := range f.nodes {\n\t\tfor _, childHash := range n.branches {\n\t\t\tif len(childHash) != 0 {\n\t\t\t\tchildNodes[childHash.KeyForMap()] = f.nodes[childHash.KeyForMap()]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor nodeHash := range f.nodes {\n\t\tif _, isChild := childNodes[nodeHash]; !isChild {\n\t\t\tf.nodes[nodeHash].printNode(\" Ω\", 0, f, t)\n\t\t}\n\t}\n\tt.Logf(\"---------------- TRIE END --------------------\")\n}", "title": "" }, { "docid": "ad5301444428e257dc4cb36f6a653b1e", "score": "0.46866724", "text": "func rePrint(b *bytes.Buffer, re *reSyntax, d *Dict) {\n\tswitch re.op {\n\tcase opEmpty:\n\t\tb.WriteString(\"(( ))\")\n\tcase opConcat:\n\t\tif len(re.sub) == 0 {\n\t\t\tb.WriteString(\"«empty concat»\")\n\t\t}\n\t\tfor i, sub := range re.sub {\n\t\t\tif i > 0 && b.Len() > 0 && b.Bytes()[b.Len()-1] != '\\n' {\n\t\t\t\tb.WriteString(\" \")\n\t\t\t}\n\t\t\trePrint(b, sub, d)\n\t\t}\n\n\tcase opAlternate:\n\t\tnl(b)\n\t\tb.WriteString(\"((\")\n\t\tfor i, sub := range re.sub {\n\t\t\tif i > 0 {\n\t\t\t\tb.WriteString(\" || \")\n\t\t\t}\n\t\t\trePrint(b, sub, d)\n\t\t}\n\t\tb.WriteString(\"))\\n\")\n\n\tcase opWild:\n\t\tfmt.Fprintf(b, \"__%d__\", re.n)\n\n\tcase opQuest:\n\t\tsub := re.sub[0]\n\t\tnl(b)\n\t\tif sub.op == opAlternate {\n\t\t\trePrint(b, sub, d)\n\t\t\tb.Truncate(b.Len() - 1) // strip \\n\n\t\t} else {\n\t\t\tb.WriteString(\"((\")\n\t\t\trePrint(b, sub, d)\n\t\t\tb.WriteString(\"))\")\n\t\t}\n\t\tb.WriteString(\"??\\n\")\n\n\tcase opWords:\n\t\tif len(re.w) == 0 {\n\t\t\tb.WriteString(\"«empty opWords»\")\n\t\t}\n\t\tfor i, w := range re.w {\n\t\t\tif i > 0 && b.Len() > 0 && b.Bytes()[b.Len()-1] != '\\n' {\n\t\t\t\tb.WriteString(\" \")\n\t\t\t}\n\t\t\ts := d.Words()[w]\n\t\t\tif s == \"\" {\n\t\t\t\tb.WriteString(\"''\")\n\t\t\t} else {\n\t\t\t\tb.WriteString(d.Words()[w])\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9b225d58b947a46ad0fc3710dbd5acfc", "score": "0.4667559", "text": "func (bt *BinaryTree) PostOrder1() string {\n\tif bt.head.left != bt.head.right {\n\t\treturn \"\"\n\t}\n\n\tvar r []string\n\tvar n *Node\n\tstack := []*Node{bt.head.left}\n\tvisited := set.NewSet()\n\tlength := len(stack)\n\n\tfor 0 != length {\n\t\tn = stack[length-1]\n\n\t\tif visited.Contains(n.data) {\n\t\t\tr = append(r, n.data)\n\t\t\tstack = stack[0 : length-1]\n\t\t} else {\n\t\t\tif nil != n.right {\n\t\t\t\tstack = append(stack, n.right)\n\t\t\t}\n\n\t\t\tif nil != n.left {\n\t\t\t\tstack = append(stack, n.left)\n\t\t\t}\n\n\t\t\tvisited.Add(n.data)\n\t\t}\n\n\t\tlength = len(stack)\n\t}\n\n\treturn strings.Join(r, \"->\")\n}", "title": "" }, { "docid": "2d0b6f5ec369f93b9c254db3adfd282c", "score": "0.46450272", "text": "func findSets(body yObj, vars locTable, env locTable, m *vm) error {\n\tvar err error\n\tx := body\n\tv := vars\nFINDSETSLOOP:\n\tfor {\n\t\ttyp := typeOf(x)\n\t\tswitch typ {\n\t\tcase tSymbol, tConstant, tIntnum, tFlonum, tRatinum, tCmplnum, tChar, tString, tVector:\n\t\t\tbreak FINDSETSLOOP\n\t\tcase tPair:\n\t\t\txCar := pair(x).car\n\t\t\tif typeOf(xCar) == tSymbol {\n\t\t\t\t//symName := symbolVal(xCar)\n\t\t\t\top := lookUp(xCar, env, m)\n\t\t\t\tswitch op {\n\t\t\t\tcase tSyntaxQuote:\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxLambda:\n\t\t\t\t\tvar (\n\t\t\t\t\t\tlmbdVars locTable\n\t\t\t\t\t\tlmbdBody yObj\n\t\t\t\t\t)\n\t\t\t\t\tlmbdVars, lmbdBody, _, _, err = recordLambda(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tx = lmbdBody\n\t\t\t\t\tv = locTblMinus(v, lmbdVars)\n\t\t\t\t\tcontinue\n\t\t\t\tcase tSyntaxLet:\n\t\t\t\t\tvar (\n\t\t\t\t\t\tl1vars locTable\n\t\t\t\t\t\tl1vals []yObj\n\t\t\t\t\t\tl1body yObj\n\t\t\t\t\t\tl1tag yObj\n\t\t\t\t\t)\n\t\t\t\t\tl1vars, l1vals, l1body, l1tag, err = recordLet(x, false)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\textLetVars := locTblMinus(v, l1vars)\n\t\t\t\t\tdelete(extLetVars, l1tag)\n\t\t\t\t\terr = findSets(l1body, extLetVars, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, xx := range l1vals {\n\t\t\t\t\t\terr = findSets(xx, v, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxLetseq:\n\t\t\t\t\tvar (\n\t\t\t\t\t\tlsvars, extLetVars locTable\n\t\t\t\t\t\tlsvals []yObj\n\t\t\t\t\t\tlsbody yObj\n\t\t\t\t\t)\n\t\t\t\t\tlsvars, lsvals, lsbody, _, err = recordLet(x, false)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\n\t\t\t\t\tlength := len(lsvars)\n\t\t\t\t\torderedLocTbl := make([]locTable, length)\n\t\t\t\t\tfor vr, info := range lsvars {\n\t\t\t\t\t\torderedLocTbl[info.index] = locTable{vr: info}\n\t\t\t\t\t}\n\n\t\t\t\t\textLetVars = v\n\t\t\t\t\tfor i := 0; i < length; i++ {\n\t\t\t\t\t\terr = findSets(lsvals[i], extLetVars, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t\textLetVars = locTblMinus(extLetVars, orderedLocTbl[i])\n\t\t\t\t\t}\n\n\t\t\t\t\terr = findSets(lsbody, extLetVars, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxLetrec:\n\t\t\t\t\tvar (\n\t\t\t\t\t\tlrvars locTable\n\t\t\t\t\t\tlrvals []yObj\n\t\t\t\t\t\tlrbody yObj\n\t\t\t\t\t)\n\t\t\t\t\tlrvars, lrvals, lrbody, _, err = recordLet(x, true)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\textLetVars := locTblMinus(v, lrvars)\n\t\t\t\t\terr = findSets(lrbody, extLetVars, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, xx := range lrvals {\n\t\t\t\t\t\terr = findSets(xx, extLetVars, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxIf:\n\t\t\t\t\tvar tst, thn, els yObj\n\t\t\t\t\ttst, thn, els, err = recordIf(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\terr = findSets(tst, v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\terr = findSets(thn, v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\terr = findSets(els, v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxDefine:\n\t\t\t\t\tvar defvar, defval yObj\n\t\t\t\t\tdefvar, defval, err = recordDefine(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tv = locTblMinus(v, locTable{defvar: nil})\n\t\t\t\t\tx = defval\n\t\t\t\t\tcontinue\n\t\t\t\tcase tSyntaxSet:\n\t\t\t\t\tvar svar, sval yObj\n\t\t\t\t\tsvar, sval, err = recordSet(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tif sv, exist := v[svar]; exist {\n\t\t\t\t\t\tsv.indirect = true\n\t\t\t\t\t}\n\t\t\t\t\terr = findSets(sval, v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxBegin, tSyntaxAnd, tSyntaxOr:\n\t\t\t\t\tvar exps []yObj\n\t\t\t\t\texps, err = recordBegin(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, e := range exps {\n\t\t\t\t\t\terr = findSets(e, v, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxCond:\n\t\t\t\t\telsSym := mkSymbol(\"else\")\n\t\t\t\t\tarrSym := mkSymbol(\"=>\")\n\t\t\t\t\tif typeOf(pair(x).cdr) != tPair {\n\t\t\t\t\t\terr = mkYerror(errComp, errSyntax, \"malformed cond\")\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tvar clauses []yObj\n\t\t\t\t\tclauses, err = recordBegin(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, clause := range clauses {\n\t\t\t\t\t\tif typeOf(clause) != tPair {\n\t\t\t\t\t\t\terr = mkYerror(errComp, errSyntax, \"malformed cond\")\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcarClause := pair(clause).car\n\t\t\t\t\t\tif carClause == elsSym {\n\t\t\t\t\t\t\terr = findSets(pair(clause).cdr, v, env, m)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\terr = findSets(carClause, v, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcdrClause := pair(clause).cdr\n\t\t\t\t\t\tif typeOf(cdrClause) != tPair {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif pair(cdrClause).car == arrSym {\n\t\t\t\t\t\t\terr = findSets(pair(cdrClause).cdr, v, env, m)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\terr = findSets(cdrClause, v, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxCase:\n\t\t\t\t\tvar keyAndClauses []yObj\n\t\t\t\t\tif typeOf(pair(x).cdr) != tPair {\n\t\t\t\t\t\terr = mkYerror(errComp, errSyntax, \"malformed case\")\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tkeyAndClauses, err = recordBegin(x)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\terr = findSets(keyAndClauses[0], v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, clause := range keyAndClauses[1:] {\n\t\t\t\t\t\tif typeOf(clause) == tPair {\n\t\t\t\t\t\t\terr = findSets(pair(clause).cdr, v, env, m)\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\tgoto ERROR\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\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxDo:\n\t\t\t\t\tdoExp := pair(x).cdr\n\t\t\t\t\tvar (\n\t\t\t\t\t\tdoVars locTable\n\t\t\t\t\t\tdoInits, doSteps, doPosts, doBodys []yObj\n\t\t\t\t\t\tdoTest yObj\n\t\t\t\t\t)\n\t\t\t\t\tdoVars, doInits, doSteps, doTest, doPosts, doBodys, err = recordDo(doExp)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, e := range doInits {\n\t\t\t\t\t\terr = findSets(e, v, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\textDoVars := locTblMinus(v, doVars)\n\t\t\t\t\terr = findSets(doTest, extDoVars, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tfor _, e := range doSteps {\n\t\t\t\t\t\tif e == nil {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\terr = findSets(e, extDoVars, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor _, e := range doPosts {\n\t\t\t\t\t\terr = findSets(e, extDoVars, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor _, e := range doBodys {\n\t\t\t\t\t\terr = findSets(e, extDoVars, env, m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\tcase tSyntaxQuasiquote:\n\t\t\t\t\terr = findSetsInQq(x, 0, v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tbreak FINDSETSLOOP\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp := pair(x)\n\t\tVARCOLLECT:\n\t\t\tfor {\n\t\t\t\terr = findSets(p.car, v, env, m)\n\t\t\t\tif err != nil {\n\t\t\t\t\tgoto ERROR\n\t\t\t\t}\n\t\t\t\tnxt := p.cdr\n\t\t\t\ttyp = typeOf(nxt)\n\t\t\t\tswitch typ {\n\t\t\t\tcase tConstant:\n\t\t\t\t\tif nxt == yNULL {\n\t\t\t\t\t\tbreak VARCOLLECT\n\t\t\t\t\t}\n\t\t\t\tcase tPair:\n\t\t\t\t\tp = pair(nxt)\n\t\t\t\tdefault:\n\t\t\t\t\terr = findSets(nxt, v, env, m)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto ERROR\n\t\t\t\t\t}\n\t\t\t\t\tbreak VARCOLLECT\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak FINDSETSLOOP\n\t\t}\n\t}\n\treturn nil\n\nERROR:\n\treturn err\n}", "title": "" }, { "docid": "4a67888c2536d8d7dd4cc80459877c72", "score": "0.46388495", "text": "func (t *treeSimplifier) process(tree *parse.Tree) {\n\tt.tree = tree\n\trenameVariables(tree.Root)\n\tfor t.browseNodes(tree.Root) {\n\t\t// printer.PrintContent(tree) // useful for debug sometimes.\n\t\tt.reset()\n\t}\n}", "title": "" }, { "docid": "d8e671ca8e8f2910d8806f7757f79682", "score": "0.46336928", "text": "func parsereplies(x geddit.Comment, words map[string]SubsWordData) {\n\n\t//determine word usage from comment\n\twordcountcomment(x, words)\n\n\t//if there are replies, call this function on each of them.\n\tif len(x.Replies) != 0 {\n\t\tfor i, _ := range x.Replies {\n\n\t\t\tparsereplies(*x.Replies[i], words)\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b1d5b8556b371f809e59ac0a40945b3f", "score": "0.4631713", "text": "func (p *reParser) words(text, next string) {\n\twords := p.dict.InsertSplit(text)\n\tif len(words) == 0 {\n\t\treturn\n\t}\n\n\t// If the next operator is ??, we need to keep the last word\n\t// separate, so that the ?? will only apply to that word.\n\t// There are no other operators that grab the last word.\n\tvar last Word\n\tif next == \"??\" {\n\t\twords, last = words[:len(words)-1], words[len(words)-1]\n\t}\n\n\t// Add the words (with last possibly removed) into an opWords.\n\t// If there's one atop the stack, use it. Otherwise, add one.\n\tif len(words) > 0 {\n\t\tvar re *reSyntax\n\t\tif len(p.stack) > 0 && p.stack[len(p.stack)-1].op == opWords {\n\t\t\tre = p.stack[len(p.stack)-1]\n\t\t} else {\n\t\t\tre = p.push(&reSyntax{op: opWords})\n\t\t}\n\t\tfor _, w := range words {\n\t\t\tre.w = append(re.w, w.ID)\n\t\t}\n\t}\n\n\t// Add the last word if needed.\n\tif next == \"??\" {\n\t\tp.stack = append(p.stack, &reSyntax{op: opWords, w: []WordID{last.ID}})\n\t}\n}", "title": "" }, { "docid": "47532e660e2ba3e39c432aec5b797b36", "score": "0.46211734", "text": "func (b *BST) Postorder() {\n\tif b == nil {\n\t\treturn\n\t}\n\n\tb.Left.Postorder()\n\tb.Right.Postorder()\n\tfmt.Printf(\"%v\", b.Value)\n}", "title": "" }, { "docid": "05bba6aeb6814bf6475e774f9b9f6561", "score": "0.46118993", "text": "func Test_Tree(t *testing.T) {\n\tdictionary, err := LoadBoltDB(\"/Users/wuzuoliang/Documents/workspace/go/src/git.woda.ink/gitcli/\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ttree := MakeOrderTree(dictionary)\n\n\troot := tree.FindByName(\"\")\n\tif root != nil {\n\t\troot.DFS(true)\n\t} else {\n\t\tfmt.Println(\"not found\")\n\t}\n\n\twoda := tree.FindByName(\"woda\")\n\tif woda != nil {\n\t\tfmt.Println(\"DFS=======================\")\n\t\twoda.DFS(false)\n\t\tfmt.Println(\"BFS=======================\")\n\t\twoda.BFS(false)\n\t} else {\n\t\tfmt.Println(\"not found\")\n\t}\n}", "title": "" }, { "docid": "c42ffe8611f81a18155a3b09f8347c65", "score": "0.46034786", "text": "func InfixToPostfix(infix string) string {\n\n\tprec := map[rune]int{'*': 10, '+': 9, '?': 8, '.': 6, '|': 5} //order of precedence of characters\n\t// * 0 or more\n\t// + 1 or more\n\t// ? Makes quantifiers \"lazy\" as states at http://www.rexegg.com/regex-quickstart.html\n\t// . concatenate\n\t// | or\n\n\tpostfix, stack := []rune{}, []rune{} //rune is a character as displayed on the screen(must convert back to string)\n\n\t// ( are added to stack\n\t// ) add each character stack to the postfix while the opening tag not found,remove character from stack\n\t// prec charcter , if it is less presidence value to tge last value add it to the postfix and remove from stack\n\t// (other characters eg 1 0 a b c ) add to postfix\n\tfor _, rangeS := range infix { // range converts string to array of runes\n\t\tswitch {\n\t\tcase rangeS == '(':\n\t\t\tstack = append(stack, rangeS)\n\t\tcase rangeS == ')':\n\t\t\tfor stack[len(stack)-1] != '(' {\n\t\t\t\tpostfix = append(postfix, stack[len(stack)-1])\n\t\t\t\tstack = stack[:len(stack)-1] // retieve everything bar last element\n\t\t\t}\n\t\t\tstack = stack[:len(stack)-1]\n\t\tcase prec[rangeS] > 0: // add precedence characters to stack after ()\n\t\t\tfor len(stack) > 0 && prec[rangeS] <= prec[stack[len(stack)-1]] {\n\t\t\t\tpostfix = append(postfix, stack[len(stack)-1])\n\t\t\t\tstack = stack[:len(stack)-1] // retieve everything bar last element\n\t\t\t}\n\t\t\tstack = append(stack, rangeS)\n\t\tdefault:\n\t\t\tpostfix = append(postfix, rangeS)\n\t\t}\n\t}\n\t// if any characters remain on the stack append them to postix and clear the stack\n\tfor len(stack) > 0 {\n\t\tpostfix = append(postfix, stack[len(stack)-1])\n\t\tstack = stack[:len(stack)-1] // retieve everything bar last element\n\t}\n\n\treturn string(postfix)\n}", "title": "" }, { "docid": "bda0d77145a1a895e79f5e8d4cccb3aa", "score": "0.46006835", "text": "func (subChoreography *SubChoreography) ParseTree(definitions *Definitions) {\n\tsubChoreography.ChoreographyActivity.ParseTree(definitions)\n\n\tfor i := 0; i < len(subChoreography.AdHocSubProcess); i++ {\n\t\tsubChoreography.AdHocSubProcess[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.BoundaryEvent); i++ {\n\t\tsubChoreography.BoundaryEvent[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.BusinessRuleTask); i++ {\n\t\tsubChoreography.BusinessRuleTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.CallActivity); i++ {\n\t\tsubChoreography.CallActivity[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.CallChoreography); i++ {\n\t\tsubChoreography.CallChoreography[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ChoreographyTask); i++ {\n\t\tsubChoreography.ChoreographyTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ComplexGateway); i++ {\n\t\tsubChoreography.ComplexGateway[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.DataObject); i++ {\n\t\tsubChoreography.DataObject[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.DataObjectReference); i++ {\n\t\tsubChoreography.DataObjectReference[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.DataStoreReference); i++ {\n\t\tsubChoreography.DataStoreReference[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.EndEvent); i++ {\n\t\tsubChoreography.EndEvent[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.EventBasedGateway); i++ {\n\t\tsubChoreography.EventBasedGateway[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ExclusiveGateway); i++ {\n\t\tsubChoreography.ExclusiveGateway[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ImplicitThrowEvent); i++ {\n\t\tsubChoreography.ImplicitThrowEvent[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.InclusiveGateway); i++ {\n\t\tsubChoreography.InclusiveGateway[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.IntermediateCatchEvent); i++ {\n\t\tsubChoreography.IntermediateCatchEvent[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.IntermediateThrowEvent); i++ {\n\t\tsubChoreography.IntermediateThrowEvent[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ManualTask); i++ {\n\t\tsubChoreography.ManualTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ParallelGateway); i++ {\n\t\tsubChoreography.ParallelGateway[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ReceiveTask); i++ {\n\t\tsubChoreography.ReceiveTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ScriptTask); i++ {\n\t\tsubChoreography.ScriptTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.SendTask); i++ {\n\t\tsubChoreography.SendTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.SequenceFlow); i++ {\n\t\tsubChoreography.SequenceFlow[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.ServiceTask); i++ {\n\t\tsubChoreography.ServiceTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.StartEvent); i++ {\n\t\tsubChoreography.StartEvent[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.SubChoreography); i++ {\n\t\tsubChoreography.SubChoreography[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.SubProcess); i++ {\n\t\tsubChoreography.SubProcess[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.Task); i++ {\n\t\tsubChoreography.Task[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.Transaction); i++ {\n\t\tsubChoreography.Transaction[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.UserTask); i++ {\n\t\tsubChoreography.UserTask[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.Association); i++ {\n\t\tsubChoreography.Association[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.Group); i++ {\n\t\tsubChoreography.Group[i].ParseTree(definitions)\n\t}\n\n\tfor i := 0; i < len(subChoreography.TextAnnotation); i++ {\n\t\tsubChoreography.TextAnnotation[i].ParseTree(definitions)\n\t}\n\n}", "title": "" }, { "docid": "14e7890d89decffa0ac093a9c0fb112e", "score": "0.45846507", "text": "func (t *GiST) delet(ctx context.Context,q interface{},node int64, prepend []Element, chk func(p Pair) bool) (x_key []Element,x_sub []Element,x_err error) {\n\tif node<=16 { x_err = ErrInternal; return }\n\terr := ctx.Err()\n\tif err!=nil { x_err = err; return }\n\tb,err := t.Read(node)\n\tdefer b.Free()\n\tif err!=nil { x_err = err; return }\n\tnobj := &Node{KT:t.Ops.KT}\n\terr = msgpack.Unmarshal(b.Ptr,nobj)\n\tif err!=nil { x_err = err; return }\n\tvar keys,prev,nelems []Element\n\tnelems = make([]Element,0,len(nobj.Elems)+len(prepend))\n\t\n\tfor _,e := range prepend {\n\t\tnelems = append(nelems,e)\n\t}\n\tfor _,e := range nobj.Elems {\n\t\tif !t.Ops.Consistent(e.P,q) {\n\t\t\tnelems = append(nelems,e)\n\t\t\tcontinue\n\t\t}\n\t\t\n\t\tif len(e.Data)>0 {\n\t\t\tif !chk(Pair{e.P,WrapBuffer(e.Data)}) {\n\t\t\t\tnelems = append(nelems,e)\n\t\t\t}\n\t\t} else if e.Ptr>=16 {\n\t\t\tkeys,prev,err = t.delet(ctx,q,e.Ptr,prev,chk)\n\t\t\tif err!=nil { x_err = err; return }\n\t\t\tnelems = append(nelems,keys...)\n\t\t}\n\t}\n\tif len(prev)>0 {\n\t\tapper := true\n\t\tif len(nelems)>0 {\n\t\t\tlst := len(nelems)-1\n\t\t\tif nelems[lst].Ptr>=16 { /* This pointer should be valid, but safety first. */\n\t\t\t\tne,err := t.joinNodes(nelems[lst].Ptr,prev)\n\t\t\t\tif err!=nil { x_err = err; return }\n\t\t\t\tnelems = append(nelems[:lst],ne...)\n\t\t\t\tapper = false\n\t\t\t}\n\t\t}\n\t\tif apper {\n\t\t\tdata,err := msgpack.Marshal(&Node{Elems:prev})\n\t\t\tif err!=nil { x_err = err; return }\n\t\t\tnptr,err := t.Insert(data)\n\t\t\tnelems = append(nelems,Element{P:t.Ops.Union(prev),Ptr:nptr})\n\t\t}\n\t}\n\tif len(nelems)<2 {\n\t\terr = t.Delete(node)\n\t\treturn nil,nelems,err\n\t}\n\tshouldSplit := len(nelems)>t.TreeM\n\tafter := []Element(nil)\n\tif shouldSplit {\n\t\tnelems,after = t.Ops.PickSplit(nelems)\n\t}\n\t\n\txn := &Node{Elems:nelems}\n\tt.sort(xn)\n\t\n\tdata,err := msgpack.Marshal(xn)\n\tif err!=nil { x_err = err; return }\n\tnptr,err := t.write(node,data)\n\tif err!=nil { x_err = err; return }\n\t\n\tx_key = []Element{{P:t.Ops.Union(nelems),Ptr:nptr}}\n\t\n\tif shouldSplit {\n\t\txn = &Node{Elems:after}\n\t\tt.sort(xn)\n\t\t\n\t\tdata,err = msgpack.Marshal(xn)\n\t\tif err!=nil { x_err = err; return }\n\t\tnptr,err = t.Insert(data)\n\t\tif err!=nil { x_err = err; return }\n\t\tx_key = append(x_key,Element{P:t.Ops.Union(after),Ptr:nptr})\n\t}\n\treturn\n}", "title": "" }, { "docid": "f6fdf8ef26b396ab2332d7d47229fc5c", "score": "0.4573855", "text": "func (tw *Topwords) readword() (w *Wordcount, ok bool) {\n\tok = true\n\tif len(tw.wordheap) == 0 {\n\t\treturn nil, false\n\t}\n\tw = tw.wordheap[0]\n\t//fmt.Printf(\"heap: top= %v\\n\", tw.wordheap[0])\n\t// tw.dumpheap()\n\n\theaplen := len(tw.wordheap) - 1\n\tif heaplen >= 1 {\n\t\t// put the wc from the back of the heap at the head\n\t\ttw.wordheap[0] = tw.wordheap[heaplen]\n\n\t\t// If there is only 1 wc remaining then we've already finished.\n\t\tif heaplen > 1 {\n\t\t\t// ... the tree has at least 2 wc's so it may be unordered.\n\t\t\tleft_child := 1\n\t\t\tright_child := 2\n\n\t\t\t// fmt.Printf(\"heap: len %v\\n\", heaplen)\n\t\t\tparent := 0\n\t\t\tfor parent < heaplen-1 {\n\t\t\t\t// Handle the case of a leaf node or a node\n\t\t\t\t// with only a left child\n\n\t\t\t\t//fmt.Printf(\"heap: loop top\\n\")\n\t\t\t\tif right_child >= heaplen {\n\t\t\t\t\t//fmt.Printf(\"heap: right child > heaplen %v > %v\\n\", right_child, heaplen)\n\t\t\t\t\tif left_child < heaplen { // Not a leaf node\n\t\t\t\t\t\t// No right child exists so compare left one, swap(?) and stop\n\t\t\t\t\t\t//fmt.Printf(\"heap: noright, moving left len %v l%v P%v\\n\", heaplen, left_child, parent)\n\n\t\t\t\t\t\tif tw.wordheap[parent].count < tw.wordheap[left_child].count {\n\t\t\t\t\t\t\ttmp := tw.wordheap[parent]\n\t\t\t\t\t\t\ttw.wordheap[parent] = tw.wordheap[left_child]\n\t\t\t\t\t\t\ttw.wordheap[left_child] = tmp\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\t//fmt.Printf(\"heap: parent: %v=%v left: =%v right: =%v\\n\", parent, tw.wordheap[parent].count, tw.wordheap[left_child].count, tw.wordheap[right_child].count)\n\t\t\t\tif tw.wordheap[left_child].count > tw.wordheap[right_child].count {\n\t\t\t\t\t// the left child is bigger so swap it up if it is bigger than the parent.\n\t\t\t\t\t//fmt.Printf(\"heap: left bigger than right\\n\")\n\t\t\t\t\tif tw.wordheap[parent].count < tw.wordheap[left_child].count {\n\t\t\t\t\t\t//fmt.Printf(\"heap: swap parent and left %v\\n\",tw.wordheap[parent].count)\n\t\t\t\t\t\ttmp := tw.wordheap[parent]\n\t\t\t\t\t\ttw.wordheap[parent] = tw.wordheap[left_child]\n\t\t\t\t\t\ttw.wordheap[left_child] = tmp\n\t\t\t\t\t}\n\t\t\t\t\tparent = left_child\n\t\t\t\t} else {\n\t\t\t\t\t// fmt.Printf(\"heap: left not bigger than right so choose right\\n\")\n\t\t\t\t\tif tw.wordheap[right_child].count > tw.wordheap[parent].count {\n\t\t\t\t\t\t// left child moves up if it's bigger\n\t\t\t\t\t\t// fmt.Printf(\"heap: swap parent and right %v\\n\",tw.wordheap[parent].count)\n\t\t\t\t\t\ttmp := tw.wordheap[parent]\n\t\t\t\t\t\ttw.wordheap[parent] = tw.wordheap[right_child]\n\t\t\t\t\t\ttw.wordheap[right_child] = tmp\n\t\t\t\t\t}\n\t\t\t\t\tparent = right_child\n\t\t\t\t}\n\n\t\t\t\tleft_child = parent<<1 + 1\n\t\t\t\tright_child = left_child + 1\n\t\t\t\t//fmt.Printf(\"heap: parent now %v=%v heaplen-1 is %v - parent < heaplen -1=%v\\n\", parent, tw.wordheap[parent].count, heaplen - 1, parent < heaplen -1)\n\t\t\t}\n\t\t\t// fmt.Printf(\"heap: end parent is at %v heaplen-1 is %v\\n\", parent, heaplen - 1)\n\t\t\t// tw.dumpheap()\n\t\t}\n\n\t}\n\n\ttw.wordheap = tw.wordheap[:heaplen]\n\t// fmt.Printf(\"heap: resizing %v\\n\", tw.wordheap)\n\n\treturn w, ok\n}", "title": "" }, { "docid": "d8fdc52f34057a4efa91d87a6df5275e", "score": "0.45710438", "text": "func (m *RawMapper) TagSets() []string { return TagSetCursors(m.cursors).Keys() }", "title": "" }, { "docid": "6f0d5ae1193b385a5c29a29ebd0d195c", "score": "0.45579374", "text": "func makeTreeFromSetList(setOverlay []string) (string, error) {\n\tif len(setOverlay) == 0 {\n\t\treturn \"\", nil\n\t}\n\ttree := make(map[string]interface{})\n\tfor _, kv := range setOverlay {\n\t\tkvv := strings.Split(kv, \"=\")\n\t\tif len(kvv) != 2 {\n\t\t\treturn \"\", fmt.Errorf(\"bad argument %s: expect format key=value\", kv)\n\t\t}\n\t\tk := kvv[0]\n\t\tv := util.ParseValue(kvv[1])\n\t\tif err := tpath.WriteNode(tree, util.PathFromString(k), v); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\t// To make errors more user friendly, test the path and error out immediately if we cannot unmarshal.\n\t\ttestTree, err := yaml.Marshal(tree)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tiops := &v1alpha1.IstioOperatorSpec{}\n\t\tif err := util.UnmarshalWithJSONPB(string(testTree), iops, false); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"bad path=value: %s\", kv)\n\t\t}\n\t}\n\tout, err := yaml.Marshal(tree)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn tpath.AddSpecRoot(string(out))\n}", "title": "" }, { "docid": "fa69665f5e8c70c4acc98e600ea00f01", "score": "0.45450515", "text": "func (tw *Topwords) get_inserter() func(uint8) {\n\tcurrent := &tw.start\n\tinword := false\n\n\treturn func(b uint8) {\n\t\tb = filterToLower(b)\n\n\t\tif b == ' ' {\n\t\t\t//fmt.Printf(\"_\")\n\t\t\tif inword {\n\t\t\t\tif current.word_count == 0 {\n\t\t\t\t\ttw.uniquewordcount += 1\n\t\t\t\t}\n\t\t\t\tcurrent.word_count += 1\n\t\t\t\tcurrent = &tw.start // Start at the beginning again\n\t\t\t}\n\t\t\tinword = false\n\t\t\treturn\n\t\t}\n\t\t//fmt.Printf(\"%v\", string(b))\n\t\tinword = true\n\t\tchildren := &(current.children)\n\t\tfor e := range *children {\n\t\t\tif (*children)[e].char == b {\n\t\t\t\t//fmt.Printf(\"<\")\n\t\t\t\tcurrent = (*children)[e]\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\t//fmt.Printf(\"^\")\n\t\tnew_node := &Node{b, 0, nil}\n\t\tcurrent.children = append(current.children, new_node)\n\t\tcurrent = new_node\n\t\t// fmt.Printf(\"\\n+%v\\n\", current.children)\n\t\treturn\n\n\t}\n\n}", "title": "" }, { "docid": "4ffe1a330fbf85cdb7855b931c0710d4", "score": "0.45356512", "text": "func evalWord(w syntax.Word, c context) interface{} {\n\tif len(w.Specials) == 0 {\n\t\tname := w.Strings[0]\n\t\tfor cNow := c; cNow != nil; cNow = cNow.Parent {\n\t\t\tif entry, ok := cNow.Entries[name]; !ok {\n\t\t\t} else if rel, isRel := entry.(Rel); isRel {\n\t\t\t\treturn rel.Copy(make(map[*TypePtr]*TypePtr))\n\t\t\t} else {\n\t\t\t\treturn entry\n\t\t\t}\n\t\t}\n\n\t\tdir := \"\"\n\t\tfor cNow := c; dir == \"\"; cNow = cNow.Parent {\n\t\t\tif cNow == nil {\n\t\t\t\tpanic(\"No filesystem\")\n\t\t\t}\n\t\t\tdir = cNow.Dir\n\t\t}\n\t\tval := EvalFile(pathJoin(dir, name)).It\n\t\tif c.Entries == nil {\n\t\t\tc.Entries = make(map[string]interface{}, 1)\n\t\t}\n\t\tc.Entries[name] = val\n\t\tif rel, isRel := val.(Rel); isRel {\n\t\t\treturn rel.Copy(make(map[*TypePtr]*TypePtr))\n\t\t} else {\n\t\t\treturn val\n\t\t}\n\t} else {\n\t\tswitch specialPayload := w.Specials[0].(type) {\n\t\tcase syntax.WordSpecialDelimited:\n\t\t\tif len(w.Specials) > 1 {\n\t\t\t\tpanic(\n\t\t\t\t\t\"Overly special word: \" + w.String(),\n\t\t\t\t)\n\t\t\t}\n\t\t\tif w.Strings[0] != \"\" || w.Strings[1] != \"\" {\n\t\t\t\tpanic(\"Delimitation embedded in name: \" + w.String())\n\t\t\t}\n\t\t\tif specialPayload.LeftDelim != specialPayload.RightDelim {\n\t\t\t\tpanic(\n\t\t\t\t\t\"Unmatched delimiters: \" +\n\t\t\t\t\t\tspecialPayload.LeftDelim.String() +\n\t\t\t\t\t\t\" and \" +\n\t\t\t\t\t\tspecialPayload.RightDelim.String(),\n\t\t\t\t)\n\t\t\t}\n\t\t\tswitch specialPayload.LeftDelim {\n\t\t\tcase syntax.MaybeDelimNone:\n\t\t\t\tpanic(\"Missing delimiters\")\n\t\t\tcase syntax.MaybeDelimParen:\n\t\t\t\treturn evalWords(specialPayload.Words, c)\n\t\t\tcase syntax.MaybeDelimBrace:\n\t\t\t\treturn specialPayload.Words\n\t\t\t}\n\t\t\tpanic(\"Unreachable\")\n\t\tcase syntax.WordSpecialJunct:\n\t\t\tif 1 < len(w.Specials) {\n\t\t\t\tpanic(\n\t\t\t\t\t\"Overly special word: \" + w.String(),\n\t\t\t\t)\n\t\t\t}\n\t\t\tif w.Strings[0] == \"\" {\n\t\t\t\tif w.Strings[1] == \"\" {\n\t\t\t\t\tpanic(\"Junct with no name: \" + w.String())\n\t\t\t\t} else {\n\t\t\t\t\treturn Collect(Junctive(specialPayload), w.Strings[1])\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif w.Strings[1] == \"\" {\n\t\t\t\t\treturn Select(Junctive(specialPayload), w.Strings[0])\n\t\t\t\t} else {\n\t\t\t\t\tpanic(\"Junct with two names: \" + w.String())\n\t\t\t\t}\n\t\t\t}\n\t\tcase syntax.WordSpecialCommentMarker:\n\t\t\tif w.Strings[0] != \"\" {\n\t\t\t\tpanic(\"Named comment: \" + w.String())\n\t\t\t}\n\t\t\treturn Comment{}\n\t\t}\n\t\tpanic(\"Unreachable\")\n\t}\n}", "title": "" }, { "docid": "7cd7fc5ae7e1c118d907e02cec21dc12", "score": "0.45349503", "text": "func (bpt *BplusTree) writeTree(printLayout bool) {\n\tdefer glog.Flush()\n\tnode, _ := bpt.fetch(bpt.rootKey)\n\tif node == nil {\n\t\tglog.Errorf(\"failed to fetch root key: %v\", bpt.rootKey)\n\t\treturn\n\t}\n\t// Print tree layout.\n\tif printLayout == true {\n\t\tbpt.writeLayout()\n\t}\n\n\t// Go to the left most leaf node and start printing in order.\n\tfor node != nil {\n\t\tif node.IsLeaf {\n\t\t\tbreak\n\t\t}\n\t\tnode, _ = bpt.fetch(node.Children[0].NodeKey)\n\t\tif node == nil {\n\t\t\tglog.Errorf(\"failed to fetch key: %v\", node.Children[0].NodeKey)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif node == nil {\n\t\tglog.Infof(\"tree is empty\")\n\t\treturn\n\t}\n\n\tindex := 0\n\tfor {\n\t\tglog.Infof(\"leaf node: %d (DK: %v, NK: %v, XK: %v, PK: %v)\\n\",\n\t\t\tindex, node.DataKey, node.NodeKey, node.NextKey, node.PrevKey)\n\t\tfor _, child := range node.Children {\n\t\t\tglog.Infof(\"\\t%v\\n\", child)\n\t\t}\n\n\t\tif node.NextKey.IsNil() {\n\t\t\tbreak\n\t\t}\n\n\t\tif !node.NextKey.IsNil() {\n\t\t\tnextKey := node.NextKey\n\t\t\tnode, _ = bpt.fetch(nextKey)\n\t\t\tif node == nil {\n\t\t\t\tglog.Errorf(\"failed to fetch key: %v\", nextKey)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tindex++\n\t}\n}", "title": "" }, { "docid": "0103c9886f2d870054580875fb7de71d", "score": "0.45291096", "text": "func Tree(e interface{}) string {\n\tswitch e := e.(type) {\n\tcase *gst.File:\n\t\treturn fmt.Sprintf(\"(package %s %s)\", e.PkgName, Tree(e.Decls))\n\tcase []gst.FuncDecl:\n\t\ts := \"\"\n\t\tfor _, fn := range e {\n\t\t\ts += fmt.Sprintf(\"func %s() {\\n%s\\n}\", fn.Name, Tree(fn.Body))\n\t\t}\n\t\treturn s\n\tcase *gst.RetStmt:\n\t\treturn fmt.Sprintf(\"ret\")\n\tcase *gst.ExprStmt:\n\t\treturn fmt.Sprintf(\"%s\", Tree(e.Exprs))\n\tcase value.Int:\n\t\treturn fmt.Sprintf(\"<int %s>\", e)\n\tcase variableExpr:\n\t\treturn fmt.Sprintf(\"<var %s>\", e.name)\n\tcase *unary:\n\t\treturn fmt.Sprintf(\"(%s %s)\", e.op, Tree(e.right))\n\tcase *binary:\n\t\t// Special case for [].\n\t\tif e.op == \"[]\" {\n\t\t\treturn fmt.Sprintf(\"(%s[%s])\", Tree(e.left), Tree(e.right))\n\t\t}\n\t\treturn fmt.Sprintf(\"(%s %s %s)\", Tree(e.left), e.op, Tree(e.right))\n\tcase sliceExpr:\n\t\ts := \"<TODO>\"\n\t\treturn s\n\tcase []value.Expr:\n\t\tif len(e) == 1 {\n\t\t\treturn Tree(e[0])\n\t\t}\n\t\ts := \"<\"\n\t\tfor i, expr := range e {\n\t\t\tif i > 0 {\n\t\t\t\ts += \"; \"\n\t\t\t}\n\t\t\ts += Tree(expr)\n\t\t}\n\t\ts += \">\"\n\t\treturn s\n\tdefault:\n\t\treturn fmt.Sprintf(\"%T\", e)\n\t}\n}", "title": "" }, { "docid": "3eacd3dc01a3e18d90743f0a96830880", "score": "0.45244294", "text": "func (t *treeSimplifier) reset() {\n\tt.nodesDepth = make([]parse.Node, 0)\n}", "title": "" }, { "docid": "102eb73a262363b6badd2e1512a03c6f", "score": "0.45156136", "text": "func bild() {\n\n root.word = words[0]\n d := 0 \n var( \n tmp ,tmp2 *Node\n )\n\n for i := range words{\n if i == 0 {continue}\n if words[i] == \"\" {continue}\n \n tmp = new(Node)\n (*tmp).word = words[i]\n\n d = dist(root.word, (*tmp).word)\n if d == 0{\n //fmt.Printf(\"problem %s %d\",words[i],i)\n }\n tmp2 = &root\n\n for ;;{\n \n d = dist(((*tmp).word),((*tmp2).word))\n\n if ((*tmp2).child)[d] == nil {\n ((*tmp2).child)[d] = tmp\n break\n } else{\n tmp2 = ((*tmp2).child)[d]\n } \n } \n }\n}", "title": "" }, { "docid": "475912eba119c6f5aca0e5bbeeb04f10", "score": "0.45039573", "text": "func genTable(rules []string, nontermlist map[string]nonterm, termlist map[string]term, strToIdx map[string]int) (map[string][]byte, bool){\n\tsize := len(termlist)\n\n\t//build a map , size is the length of termlist\n\ttable := make(map[string][]byte)\n\ti := 0\n\tfor k, _ := range termlist {\n\t\ti++\n\t\ttable[k] = make([]byte, size)\n\t}\n\n\t//first, we should get the realtion ship between $ and start symbol\n\ttable[\"$\"][strToIdx[\"$\"]] = '='\n\tnonsymbol := rules[0][0]\n\n\tfor _, v := range nontermlist[string(nonsymbol)].first {\n\t\ttable[\"$\"][strToIdx[v]]= '<'\n\t}\n\n\tfor _, v := range nontermlist[string(nonsymbol)].last {\n\t\ttable[v][strToIdx[\"$\"]] = '>'\n\t}\n\n\tvar preSymbol []string\n\tvar preNonSymbol []byte\n\tfor i=0; i<len(rules); i++ {\n\t\tflag := false\n\t\tpreNonSymbol = nil\n\t\tpreSymbol = nil\n\t\tfor j:=0; j<len(rules[i]); j++ {\n\t\t\tif !flag && rules[i][j] == '-' && j < len(rules[i])-1 && rules[i][j+1] == '>' {\n\t\t\t\tflag = true\n\t\t\t\tj++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tif rules[i][j] == ' ' {\n\t\t\t\t\tcontinue\n\t\t\t\t} else if rules[i][j] == '|' {\n\t\t\t\t\tpreSymbol = nil\n\t\t\t\t\tpreNonSymbol = nil\n\t\t\t\t} else if unicode.IsUpper(rune(rules[i][j])) {\n\t\t\t\t\tif ok := insertFirst(preSymbol, table, nontermlist[string(rules[i][j])].first, strToIdx, '<'); !ok {\n\t\t\t\t\t\tfmt.Println(\"文法具有二义性!\")\n\t\t\t\t\t\treturn table, false\n\t\t\t\t\t}\n\t\t\t\t\t//preSymbol = nil\n\t\t\t\t\tpreNonSymbol = append(preNonSymbol, rules[i][j])\n\t\t\t\t} else {\n\t\t\t\t\tif preNonSymbol != nil {\n\t\t\t\t\t\tif ok := insertLast(rules[i][j], table, nontermlist[string(preNonSymbol[0])].last, strToIdx, '>'); !ok {\n\t\t\t\t\t\t\tfmt.Println(\"文法具有二义性!\")\n\t\t\t\t\t\t\treturn table, false\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif len(preSymbol) != 0 {\n\t\t\t\t\t\tfor _, k := range preSymbol {\n\t\t\t\t\t\t\ttable[k][strToIdx[string(rules[i][j])]] = '='\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpreSymbol = append(preSymbol, string(rules[i][j]))\n\t\t\t\t\tpreNonSymbol = nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn table, true\n}", "title": "" }, { "docid": "96b999952fc3241c64265f95c389f97e", "score": "0.45028874", "text": "func main() {\n\tvar stack\t*Stack\t\t\t\t// The stack, for the machine\n\n\tflag.StringVar(&prompt, \"p\", \"» \", \"Prompt to display\")\n\tflag.Parse()\n\n\treader := bufio.NewReader(os.Stdin)\n\n\t// Built-in symbols\n\tsymbols = map[string]Word {\n\t\t\"+\":\tWord{Procedure, Add},\n\t\t\"-\":\tWord{Procedure, Subtract},\n\t\t\"*\":\tWord{Procedure, Multiply},\n\t\t\"/\":\tWord{Procedure, Divide},\n\t\t\".\":\tWord{Procedure, Pop},\n\t\t\"pop\":\tWord{Procedure, Pop},\n\t\t\"swap\":\tWord{Procedure, Swap},\n\t\t// TODO - more builtins\n\t}\n\n\tstack = MkStack()\n\n\t// Main loop\n\trepl:\n\tfor {\n\t\tfmt.Print(prompt)\n\n\t\t// Just read a line, TODO - make by-rune reading later\n\t\ttext, err := reader.ReadString('\\n')\n\t\tif err == io.EOF {\n\t\t\tbreak repl\n\t\t}\n\n\t\t// Ignore empty lines\n\t\tif len(text) < 2 {\n\t\t\tcontinue repl\n\t\t}\n\n\t\t// Strip newline\n\t\ttext = text[:len(text)-1]\n\n\t\t/* Tokenizing */\n\n\t\t// Special repl commands\n\t\tswitch text {\n\t\tcase \"size\":\n\t\t\tfmt.Println(stack.Size())\n\t\t\tcontinue repl\n\n\t\tcase \"peek\":\n\t\t\tfmt.Println(stack.Word)\n\t\t\tcontinue repl\n\n\t\tcase \"stack\":\n\t\t\tfallthrough\n\t\tcase \"show\":\n\t\t\tfmt.Print(stack)\n\t\t\tcontinue repl\n\n\t\tcase \"bye\":\n\t\t\tbreak repl\n\n\t\tdefault:\n\t\t\t;\n\t\t}\n\n\t\ttokens, err := tokenize(text)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"err: could not parse -\", err)\n\t\t\tcontinue repl\n\t\t}\n\n\t\t//fmt.Println(\"Tokens =\", tokens)\n\n\t\t/* Convert tokens to full - operable - words */\n\n\t\twords, err := tokens2words(tokens)\n\n\t\t//fmt.Println(\"Words =\", symbols)\n\n\t\t/* Push tokens on to stack */\n\n\t\tfor i, word := range words {\n\t\t\tproposed, err := stack.Push(word)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\"err: could not push word #%d: %v - %v\\n\", i, word, err)\n\t\t\t\tcontinue repl\n\t\t\t}\n\n\t\t\tstack = proposed\n\n\t\t\tfmt.Println(\"ok.\")\n\t\t}\n\t}\n\n\tfmt.Println(\"\\nGoodbye ☺\")\n}", "title": "" }, { "docid": "dd7ed5502661706553b433619aa835b0", "score": "0.44847777", "text": "func treeSet(ctx context.Context, t tree, store bs.Store, keyHash []byte, mutate func(tree, int32, bool) Outcome) (bs.Ref, Outcome, error) {\n\ttn := t.treenode()\n\tif tn.Left != nil {\n\t\tvar subnode *SubNode\n\t\tif nthbit(keyHash, tn.Depth) {\n\t\t\tsubnode = tn.Right\n\t\t} else {\n\t\t\tsubnode = tn.Left\n\t\t}\n\t\tsubref := subnode.Ref\n\n\t\tsub := t.newAt(0)\n\t\terr := bs.GetProto(ctx, store, bs.RefFromBytes(subref), sub)\n\t\tif err != nil {\n\t\t\treturn bs.Ref{}, ONone, errors.Wrapf(err, \"getting child %x at depth %d\", subref, tn.Depth+1)\n\t\t}\n\n\t\tnewSubref, outcome, err := treeSet(ctx, sub, store, keyHash, mutate)\n\t\tif err != nil {\n\t\t\treturn bs.Ref{}, ONone, errors.Wrapf(err, \"updating child %x at depth %d\", subref, tn.Depth+1)\n\t\t}\n\t\tif outcome == ONone {\n\t\t\tselfRef, err := bs.ProtoRef(t)\n\t\t\treturn selfRef, ONone, errors.Wrap(err, \"computing self ref\")\n\t\t}\n\n\t\tsubnode.Ref = newSubref[:]\n\t\tif outcome == OAdded {\n\t\t\tsubnode.Size++\n\t\t\ttn.Size++\n\t\t}\n\n\t\tselfRef, _, err := bs.PutProto(ctx, store, t)\n\t\treturn selfRef, outcome, errors.Wrap(err, \"storing updated object\")\n\t}\n\n\tindex := treeSearch(t, keyHash)\n\tif index < t.numMembers() && bytes.Equal(t.keyHash(index), keyHash) {\n\t\toutcome := mutate(t, index, false)\n\t\tif outcome == ONone {\n\t\t\tselfRef, err := bs.ProtoRef(t)\n\t\t\treturn selfRef, ONone, errors.Wrap(err, \"computing self ref\")\n\t\t}\n\t\tselfRef, _, err := bs.PutProto(ctx, store, t)\n\t\treturn selfRef, OUpdated, errors.Wrap(err, \"storing updated tree node\")\n\t}\n\n\tmutate(t, index, true)\n\n\tif t.numMembers() > maxNode {\n\t\tvar (\n\t\t\tleftChild = t.newAt(tn.Depth + 1)\n\t\t\trightChild = t.newAt(tn.Depth + 1)\n\t\t)\n\t\tfor i := int32(0); i < t.numMembers(); i++ {\n\t\t\tif nthbit(t.keyHash(i), tn.Depth) {\n\t\t\t\trightChild.copyMember(t, i)\n\t\t\t} else {\n\t\t\t\tleftChild.copyMember(t, i)\n\t\t\t}\n\t\t}\n\t\tleftRef, _, err := bs.PutProto(ctx, store, leftChild)\n\t\tif err != nil {\n\t\t\treturn bs.Ref{}, ONone, errors.Wrap(err, \"storing new left child after split\")\n\t\t}\n\t\trightRef, _, err := bs.PutProto(ctx, store, rightChild)\n\t\tif err != nil {\n\t\t\treturn bs.Ref{}, ONone, errors.Wrap(err, \"storing new right child after split\")\n\t\t}\n\t\ttn.Left = &SubNode{\n\t\t\tRef: leftRef[:],\n\t\t\tSize: leftChild.numMembers(),\n\t\t}\n\t\ttn.Right = &SubNode{\n\t\t\tRef: rightRef[:],\n\t\t\tSize: rightChild.numMembers(),\n\t\t}\n\t\tt.zeroMembers()\n\t}\n\ttn.Size++\n\n\tselfRef, _, err := bs.PutProto(ctx, store, t)\n\treturn selfRef, OAdded, errors.Wrap(err, \"storing updated tree node\")\n}", "title": "" }, { "docid": "4e1310d3b34239e497c510c1cf1305c6", "score": "0.4484171", "text": "func definition(s selection, args []string) {\n\tvar gd serial.Definition\n\tjs := runWithStdin(s.archive(), \"guru\", \"-json\", \"-modified\", \"definition\", s.pos())\n\tif err := json.Unmarshal([]byte(js), &gd); err != nil {\n\t\tlog.Fatalf(\"failed to unmarshal guru json: %v\\n\", err)\n\t}\n\tif err := plumbText(gd.ObjPos); err != nil {\n\t\tfmt.Println(gd.ObjPos)\n\t\tlog.Fatalf(\"failed to plumb: %v\\n\", err)\n\t}\n}", "title": "" }, { "docid": "299827d9656d2e5b4d60ec42a77bf51c", "score": "0.44804934", "text": "func (s *nodeSet) all() []*treeNode {\n\tall := make([]*treeNode, 0, len(s.itemMap))\n\tp := s.head.right\n\tfor p != s.tail {\n\t\tall = append(all, p.val)\n\t\tp = p.right\n\t}\n\treturn all\n}", "title": "" }, { "docid": "1f36ab50165ae6c8eaa2f95e4f8d9ba6", "score": "0.4479238", "text": "func main() {\n\tbase := initBTree()\n\tfmt.Println(\"pre order\")\n\tbase.preOrder()\n\tfmt.Println(\"in order\")\n\tbase.inOrder()\n\tfmt.Println(\"post order\")\n\tbase.postOrder()\n}", "title": "" }, { "docid": "7e710fc0922fc4cf5d286a37be64ca60", "score": "0.44782287", "text": "func main() {\n\tfmt.Println(numTreesDp(19))\n}", "title": "" }, { "docid": "c99ce2397ea8ac79ae02ef17329873a8", "score": "0.44743347", "text": "func re2post(re string) string {\n\tr := preprocess(re)\n\n\ts := NewStack()\n\n\tvar rs string\n\tfor _, c := range r {\n\t\tcur := string(c)\n\n\t\tswitch cur {\n\t\tcase \"(\":\n\t\t\ts.push(cur)\n\t\tcase \")\":\n\t\t\tfor {\n\t\t\t\tif v, ok := s.pop(); !ok || v == \"(\" {\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\trs += v\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"+\":\n\t\t\tfallthrough\n\t\tcase \"?\":\n\t\t\tfallthrough\n\t\tcase \"*\":\n\t\t\tfallthrough\n\t\tcase \".\":\n\t\t\tfallthrough\n\t\tcase \"|\":\n\t\t\tfor {\n\t\t\t\tif v, ok := s.peek(); ok && priority(v) >= priority(cur) {\n\t\t\t\t\tv, _ = s.pop()\n\t\t\t\t\trs += v\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\ts.push(cur)\n\t\tdefault:\n\t\t\trs += cur\n\t\t}\n\t}\n\n\tfor !s.empty() {\n\t\tv, _ := s.pop()\n\t\trs += v\n\t}\n\n\treturn rs\n}", "title": "" }, { "docid": "ed14957fbe69247b8ee6853dd99af6f7", "score": "0.4455776", "text": "func (node *URLNode) generateTree(tabSize int) string {\n\tsubTree := \"\"\n\tfor _, child := range node.children {\n\t\tline := strings.Repeat(\"\\t\", tabSize)\n\t\tline += \"└── \"\n\t\tsubTree += line + child.generateTree(tabSize+1)\n\t}\n\treturn node.url + \"\\n\" + subTree\n}", "title": "" }, { "docid": "4c2421dc7fdbf9ed57ee5944de8286b1", "score": "0.44536087", "text": "func reversepostorder(root *BasicBlock, rpo *int32) {\n\troot.mark = VISITED\n\tfor _, bb := range root.succ {\n\t\tif bb.mark == UNVISITED {\n\t\t\treversepostorder(bb, rpo)\n\t\t}\n\t}\n\t*rpo -= 1\n\troot.rpo = int(*rpo)\n}", "title": "" }, { "docid": "abcb02327fda67c47c93147bec5a139a", "score": "0.44497186", "text": "func recoverTree(text *string) *Tree{\n\tif len(*text) == 0 {\n\t\treturn nil\n\t}\n\n\tif (*text)[0] == '1' {\n\t\t*text = (*text)[1:]\n\t\treturn &Tree{rune((*text)[0]), -1, nil, nil}\n\t}\n\n\troot := &Tree{'$', -1, nil, nil}\n\t*text = (*text)[1:]\n\troot.LeftNode = recoverTree(text)\n\t*text = (*text)[1:]\n\troot.RightNode = recoverTree(text)\n\treturn root\n\t\n}", "title": "" }, { "docid": "23da66084bab2811bda7d10eefa9d928", "score": "0.4442825", "text": "func (r *Replacer) Subwords() []Subword {\n\tr.commit()\n\n\tvar subwords []Subword\n\n\tif len(r.levels) == 0 {\n\t\treturn subwords\n\t}\n\n\tlevel := r.levels[0]\n\n\tvar buf bytes.Buffer\n\n\tfor i, ch := range r.word {\n\t\tif r.levels[i] != level {\n\t\t\tsubwords = append(subwords, New(buf.String(), level))\n\t\t\tlevel = r.levels[i]\n\t\t\tbuf.Reset()\n\t\t}\n\t\tbuf.WriteRune(ch)\n\t}\n\tsubwords = append(subwords, New(buf.String(), level))\n\n\treturn subwords\n}", "title": "" }, { "docid": "4262cb8f1872a621d74b45d4eb2729e2", "score": "0.44293278", "text": "func PostOrder(root *Node) {\n\tif root == nil {\n\t\treturn\n\t}\n\tPostOrder(root.left)\n\tPostOrder(root.right)\n\tfmt.Printf(\"%d \", root.data)\n}", "title": "" }, { "docid": "bcb07440e67e4c9ffc88d31d107a4ca6", "score": "0.44151282", "text": "func IntToPost(infix string) string {\n\n\t// Map to store all the special characters and their precedences\n\t// Found regex operator precedence here https://stackoverflow.com/questions/36870168/operator-precedence-in-regular-expressions\n\tspecials := map[rune]int{\n\t\t'*': 10,\n\t\t'.': 9,\n\t\t'+': 8,\n\t\t'?': 7,\n\t\t'|': 6,\n\t}\n\n\t// Array of runes to hold the postfix regular expression\n\t// and the stack for the infix operators\n\tpofix, stack := []rune{}, []rune{}\n\n\t// Loop over infix, throw the index of the char with the blank identifier as it's unneeded\n\t// r is the rune at the index\n\tfor _, r := range infix {\n\n\t\tswitch {\n\t\t// If the token is a closing bracket, push it onto the operator stack\n\t\tcase r == '(':\n\t\t\tstack = append(stack, r)\n\n\t\t// If the token is a right bracket, pop the closing bracket from the stack\n\t\t// If the token on top of the operator stack is not a closing bracket pop it onto the output queue\n\t\tcase r == ')':\n\t\t\tfor stack[len(stack)-1] != '(' {\n\t\t\t\tpofix = append(pofix, stack[len(stack)-1])\n\t\t\t\tstack = stack[:len(stack)-1] // Everything on the stack up to the closing bracket (the last character)\n\t\t\t}\n\n\t\t\tstack = stack[:len(stack)-1] // Pop the closing bracket off the stack\n\n\t\t// If the rune is a special character\n\t\t// '> 0' is used because accessing a key not contained in a map returns 0\n\t\tcase specials[r] > 0:\n\t\t\tfor len(stack) > 0 && specials[r] <= specials[stack[len(stack)-1]] {\n\n\t\t\t\t// Pop operators from the operator stack onto the output queue\n\t\t\t\tpofix = append(pofix, stack[len(stack)-1])\n\t\t\t\tstack = stack[:len(stack)-1]\n\t\t\t}\n\n\t\t\tstack = append(stack, r)\n\n\t\t// If the rune is not a bracket or a special character\n\t\tdefault:\n\t\t\tpofix = append(pofix, r)\n\n\t\t}\n\n\t}\n\n\tfor len(stack) > 0 {\n\t\t// Pop element off of stack and onto the output queue\n\t\tpofix = append(pofix, stack[len(stack)-1])\n\t\tstack = stack[:len(stack)-1]\n\t}\n\n\treturn string(pofix)\n}", "title": "" }, { "docid": "12cae91e25400b9839a41e52725bcb2f", "score": "0.4413528", "text": "func tree(e interface{}) string {\n\tswitch e := e.(type) {\n\tcase value.Int:\n\t\treturn fmt.Sprintf(\"<int %s>\", e)\n\tcase value.BigInt:\n\t\treturn fmt.Sprintf(\"<bigint %s>\", e)\n\tcase value.BigRat:\n\t\treturn fmt.Sprintf(\"<rat %s>\", e)\n\tcase value.BigFloat:\n\t\treturn fmt.Sprintf(\"<float %s>\", e)\n\tcase value.Complex:\n\t\treturn fmt.Sprintf(\"<complex %s>\", e)\n\tcase sliceExpr:\n\t\ts := \"<\"\n\t\tfor i, x := range e {\n\t\t\tif i > 0 {\n\t\t\t\ts += \" \"\n\t\t\t}\n\t\t\ts += x.ProgString()\n\t\t}\n\t\ts += \">\"\n\t\treturn s\n\tcase *variableExpr:\n\t\treturn fmt.Sprintf(\"<var %s>\", e.name)\n\tcase *unary:\n\t\treturn fmt.Sprintf(\"(%s %s)\", e.op, tree(e.right))\n\tcase *binary:\n\t\treturn fmt.Sprintf(\"(%s %s %s)\", tree(e.left), e.op, tree(e.right))\n\tcase conditional:\n\t\treturn tree(e.binary)\n\tcase *index:\n\t\ts := fmt.Sprintf(\"(%s[\", tree(e.left))\n\t\tfor i, v := range e.right {\n\t\t\tif i > 0 {\n\t\t\t\ts += \"; \"\n\t\t\t}\n\t\t\ts += tree(v)\n\t\t}\n\t\ts += \"])\"\n\t\treturn s\n\tcase []value.Expr:\n\t\tif len(e) == 1 {\n\t\t\treturn tree(e[0])\n\t\t}\n\t\ts := \"<\"\n\t\tfor i, expr := range e {\n\t\t\tif i > 0 {\n\t\t\t\ts += \"; \"\n\t\t\t}\n\t\t\ts += tree(expr)\n\t\t}\n\t\ts += \">\"\n\t\treturn s\n\tdefault:\n\t\treturn fmt.Sprintf(\"%T\", e)\n\t}\n}", "title": "" }, { "docid": "f10e611381247a090b2504ddf510f8d3", "score": "0.44083285", "text": "func SolvePostfix(tokens Stack, vars map[string]interface{}) interface{} {\n\tstack := Stack{}\n\tfor _, v := range tokens.Values {\n\t\tswitch v.Type {\n\t\tcase Number:\n\t\t\tstack.Push(v)\n\t\tcase Function:\n\t\t\tstack = SolveFunction(v, vars, stack)\n\t\tcase String:\n\t\t\tstack.Push(Token{String, v.Lexeme, Stack{}})\n\t\tcase Constant:\n\t\t\tif v.Lexeme == \"true\" {\n\t\t\t\tstack.Push(Token{Boolean, strconv.FormatBool(true), Stack{}})\n\t\t\t} else {\n\t\t\t\tdata := vars[v.Lexeme]\n\t\t\t\tif data == nil {\n\t\t\t\t\tstack.Push(Token{Number, \"\", Stack{}})\n\t\t\t\t} else {\n\t\t\t\t\tstack = PushStringToStack(data, stack)\n\t\t\t\t}\n\t\t\t}\n\t\tcase Operator:\n\t\t\tif v.Lexeme == \"=\" || v.Lexeme == \"<>\" || v.Lexeme == \">\" || v.Lexeme == \"<\" || v.Lexeme == \">=\" || v.Lexeme == \"<=\" {\n\t\t\t\tvar x, y interface{}\n\t\t\t\ty = stack.Pop().Lexeme\n\t\t\t\tx = stack.Pop().Lexeme\n\t\t\t\tfx := chkData[v.Lexeme].fx\n\t\t\t\tresult := fx(x, y)\n\t\t\t\tstack.Push(Token{Boolean, strconv.FormatBool(result.(bool)), Stack{}})\n\t\t\t} else if v.Lexeme == \"AND\" || v.Lexeme == \"OR\" {\n\t\t\t\tvar x, y bool\n\t\t\t\ty, _ = strconv.ParseBool(stack.Pop().Lexeme)\n\t\t\t\tx, _ = strconv.ParseBool(stack.Pop().Lexeme)\n\t\t\t\tfx := cmpData[v.Lexeme].fx\n\t\t\t\tresult := fx(x, y)\n\t\t\t\tstack.Push(Token{Boolean, strconv.FormatBool(result.(bool)), Stack{}})\n\t\t\t} else {\n\t\t\t\tf := oprData[v.Lexeme].fx\n\t\t\t\tvar x, y float64\n\t\t\t\ty, _ = strconv.ParseFloat(stack.Pop().Lexeme, 64)\n\t\t\t\tx, _ = strconv.ParseFloat(stack.Pop().Lexeme, 64)\n\t\t\t\tresult := f(x, y)\n\t\t\t\tstack.Push(Token{Number, strconv.FormatFloat(result.(float64), 'f', -1, 64), Stack{}})\n\t\t\t}\n\t\t}\n\t}\n\tout := stack.Values[0].Lexeme\n\treturn out\n}", "title": "" }, { "docid": "4a2a109e88f993d78c4d63f1defd8815", "score": "0.44048592", "text": "func (s *DatatypeGeoShape) Tree(tree string) *DatatypeGeoShape {\n\ts.tree = tree\n\treturn s\n}", "title": "" }, { "docid": "7f7c6a98087e4b1962cb786c3ef86242", "score": "0.44009995", "text": "func (tnode *TNode) collectPrefix(res *IntSet) {\n\n\tif tnode.isword == true {\n\t\tfor _, v := range tnode.ids {\n\t\t\tres.add(v)\n\t\t}\n\t}\n\n\tfor _, tn := range tnode.cnodes {\n\t\ttn.collectPrefix(res)\n\t}\n}", "title": "" }, { "docid": "3d33e2d7fa86cf880586f985e2240f3d", "score": "0.4400353", "text": "func (g *GitHubRepository) getYamlFromTree() []string {\n\tvar urls []string\n\tfor _, path := range g.tree.InnerTrees {\n\t\tif strings.HasSuffix(path.Path, \".yaml\") {\n\t\t\turls = append(urls, fmt.Sprintf(\"%s/%s\", g.rowYamlUrl(), path.Path))\n\t\t}\n\t}\n\treturn urls\n}", "title": "" }, { "docid": "9c5da88fc5cfe08c7a957cbd915fe940", "score": "0.4395965", "text": "func (i *IpldRawNode) Tree(p string, depth int) []string {\n\treturn nil\n}", "title": "" }, { "docid": "3d55695394892420ba2695780458b7b0", "score": "0.43941852", "text": "func (g Graph) SpanningTree() {\n\t/* TODO: Kruska algorithm\n\t1. Initialize a Tk wich is a Spanning tree algorithm\n\t2. Put all edges in a min Priority Queue ordered by weight.\n\t3. Create a disjoint ds set ds where each node exists on its own set.\n\t4. For each edge e {v,w}\n\t\t \tif ds.Find(v) != ds.Find(w)\n\t\t\t\tadd edge v,w to Tk\n\t\t\t\tds.Union(v, w)\n\t*/\n}", "title": "" }, { "docid": "49592521ddeda87e42f6e58efb474b3c", "score": "0.43917277", "text": "func getPageWords(url string) *hashset.Set {\n\treturnSet := hashset.New()\n\t//url = formatUrl(url) // Get the corrected url for a particular page\n\treadable := getByteArr(url)\n\n\tresponse := bytes.NewReader(readable) // Get the content of a web page\n\n\tz := html.NewTokenizer(response) // Get the text of a web page\n\n\tinBody := false\n\tfor {\n\t\ttt := z.Next() // Get each element of a web apge\n\n\t\tswitch {\n\t\tcase tt == html.ErrorToken:\n\t\t\t// End of the document, we're done\n\t\t\treturn returnSet\n\t\tcase tt == html.StartTagToken:\n\t\t\tt := z.Token()\n\n\t\t\tfor i := 0; i < len(t.Attr); i++ {\n\t\t\t\ta := t.Attr[i]\n\n\t\t\t\tif a.Val == \"bodyContent\" {\n\t\t\t\t\tinBody = true\n\t\t\t\t}\n\t\t\t\tif a.Val == \"catlinks\" {\n\n\t\t\t\t\treturn returnSet\n\t\t\t\t}\n\n\t\t\t\tif inBody == true {\n\t\t\t\t\tvar temp string\n\t\t\t\t\ttemp = a.Val\n\t\t\t\t\tif strings.HasPrefix(temp, \"../../../\") {\n\t\t\t\t\t\treturnSet.Add(temp)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t//fmt.Println(a.Val)\n\t\t\t\t//for _, a := range t.Attr {\n\t\t\t\t// If an element is one we are looking for add it to the return set.\n\n\t\t\t}\n\t\t}\n\t}\n\treturn returnSet\n}", "title": "" }, { "docid": "7bdd58547b360386f86f49f25b31f291", "score": "0.4376339", "text": "func TestDefinition(t *testing.T) {\n\tt.Parallel()\n\n\ttree := writeTree(t, `\n-- go.mod --\nmodule example.com\ngo 1.18\n\n-- a.go --\npackage a\nimport \"fmt\"\nfunc f() {\n\tfmt.Println()\n}\nfunc g() {\n\tf()\n}\n`)\n\t// missing position\n\t{\n\t\tres := gopls(t, tree, \"definition\")\n\t\tres.checkExit(false)\n\t\tres.checkStderr(\"expects 1 argument\")\n\t}\n\t// intra-package\n\t{\n\t\tres := gopls(t, tree, \"definition\", \"a.go:7:2\") // \"f()\"\n\t\tres.checkExit(true)\n\t\tres.checkStdout(\"a.go:3:6-7: defined here as func f\")\n\t}\n\t// cross-package\n\t{\n\t\tres := gopls(t, tree, \"definition\", \"a.go:4:7\") // \"Println\"\n\t\tres.checkExit(true)\n\t\tres.checkStdout(\"print.go.* defined here as func fmt.Println\")\n\t\tres.checkStdout(\"Println formats using the default formats for its operands\")\n\t}\n\t// -json and -markdown\n\t{\n\t\tres := gopls(t, tree, \"definition\", \"-json\", \"-markdown\", \"a.go:4:7\")\n\t\tres.checkExit(true)\n\t\tvar defn cmd.Definition\n\t\tif res.toJSON(&defn) {\n\t\t\tif !strings.HasPrefix(defn.Description, \"```go\\nfunc fmt.Println\") {\n\t\t\t\tt.Errorf(\"Description does not start with markdown code block. Got: %s\", defn.Description)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c854c683ee447eabd5b235b663e03a1f", "score": "0.43715587", "text": "func printerConvertSelectionSet(selectionSet ast.SelectionSet) (*gAst.SelectionSet, error) {\n\t// the list of selections for this\n\tselections := []gAst.Selection{}\n\n\tfor _, selection := range selectionSet {\n\t\tswitch selection := selection.(type) {\n\t\tcase *ast.Field:\n\t\t\t// convert the field\n\t\t\tfield, err := printerConvertField(selection)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\t// add the field to the selection\n\t\t\tselections = append(selections, field)\n\t\tcase *ast.InlineFragment:\n\t\t\tfragment, err := printerConvertInlineFragment(selection)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// add the field to the selection\n\t\t\tselections = append(selections, fragment)\n\t\tcase *ast.FragmentSpread:\n\t\t\tfragment, err := printerConvertFragmentSpread(selection)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// add the field to the selection\n\t\t\tselections = append(selections, fragment)\n\t\t}\n\t}\n\n\treturn &gAst.SelectionSet{\n\t\tKind: \"SelectionSet\",\n\t\tSelections: selections,\n\t}, nil\n}", "title": "" }, { "docid": "2af227f0d523800b94fe05e89c725720", "score": "0.43707", "text": "func (m *Immutable) Trees() []string {\n\treturn m.contained.Trees()\n}", "title": "" }, { "docid": "fd59cf44e59c3d15be3e050bdd4c7c2e", "score": "0.43564138", "text": "func ParseChangesets(rev *revision) ([]changeset, error){\n s := NewScanner(rev.data)\n for s.HasMoreTokens() {\n tok, err := s.NextToken()\n if err != nil {\n log.Println(err)\n } else {\n log.Println(string(tok.runes), \" : \", s.offset)\n }\n }\n return nil, nil\n}", "title": "" }, { "docid": "f2eca2add999eb27761f282b64ef96e9", "score": "0.4354624", "text": "func stringTree(builder *strings.Builder, depth int, node *TreeNode) (*strings.Builder, error) {\n\tvar err error\n\tfor i := 0; i < depth; i++ {\n\t\tif _, err = builder.WriteString(\" \"); err != nil {\n\t\t\treturn builder, err\n\t\t}\n\t}\n\tfmt.Fprintf(builder, \"└ %d\\n\", node.Val)\n\n\tif node.Left != nil {\n\t\tif builder, err = stringTree(builder, depth+1, node.Left); err != nil {\n\t\t\treturn builder, err\n\t\t}\n\t}\n\tif node.Right != nil {\n\t\tif builder, err = stringTree(builder, depth+1, node.Right); err != nil {\n\t\t\treturn builder, err\n\t\t}\n\t}\n\treturn builder, nil\n}", "title": "" }, { "docid": "ebcafffd27c4d7b31289b366e770ce79", "score": "0.43419614", "text": "func minTreeFromWordList(t *testing.T, words []string) *MinTree {\n\tsort.Strings(words)\n\tintree := New()\n\tfor _, word := range words {\n\t\tintree.Insert(word)\n\t}\n\tintree.Finish()\n\n\tenc, err := new(Encoder).Encode(intree)\n\tif err != nil {\n\t\tt.Fatalf(\"Encode produced an error before we could even test the numbers: %v\", err)\n\t}\n\n\touttree, err := new(Decoder).Decode(enc)\n\tif err != nil {\n\t\tt.Fatalf(\"Decode produced an error before we could even test the numbers: %v\", err)\n\t}\n\n\treturn outtree\n}", "title": "" }, { "docid": "59bdc43834895e591ba30a237d94133f", "score": "0.43357897", "text": "func doPrintTree(cmd *cobra.Command, args []string) {\n\tassembly, err := model.LoadAssembly(applicationSettings.ArtifactConfigLocation)\n\tif err != nil {\n\t\tmodel.Fatalf(\"tree failed, unable to load assembly descriptor:%v\", err)\n\t}\n\tfmt.Println(\"|\", assembly.StorageBase())\n\tfor _, each := range assembly.Parts {\n\t\tfmt.Println(\"|-- \", each.StorageBase())\n\t}\n}", "title": "" }, { "docid": "ead76bb05a3f03e9df38b4be002b5f85", "score": "0.4330631", "text": "func buildUtil(in []int, post []int, inStrt int, inEnd int, pIndex *int) *Node {\r\n\r\n\t// Base case\r\n\tif inStrt > inEnd {\r\n\t\treturn nil\r\n\t}\r\n\r\n\t// take current node from Postorder traversal using postIndex\r\n\t// decrement postIndex\r\n\r\n\tcurr := post[*pIndex]\r\n\r\n\tnode := newNode(curr)\r\n\t*pIndex--\r\n\r\n\t// If this node has no children then return\r\n\tif inStrt == inEnd {\r\n\t\treturn node\r\n\t}\r\n\r\n\t// find index of node in Inorder traversal\r\n\tiIndex := mp[curr]\r\n\r\n\t//construct left and right subtress\r\n\tnode.right = buildUtil(in[:], post[:], iIndex+1, inEnd, pIndex)\r\n\tnode.left = buildUtil(in[:], post[:], inStrt, iIndex-1, pIndex)\r\n\r\n\treturn node\r\n}", "title": "" }, { "docid": "6a210bea96ec0bb4800ba49a0ca8019f", "score": "0.43302855", "text": "func main() {\n\n\t// Set up a slice of strings.\n\tvalues := []string{\"d\", \"b\", \"c\", \"e\", \"a\"}\n\tdata := []string{\"delta\", \"bravo\", \"charlie\", \"echo\", \"alpha\"}\n\n\t// Create a tree and fill it from the values.\n\ttree := &Tree{}\n\tfor i := 0; i < len(values); i++ {\n\t\terr := tree.Insert(values[i], data[i])\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"Error inserting value '\", values[i], \"': \", err)\n\t\t}\n\t}\n\n\t// Print the sorted values.\n\tfmt.Print(\"Sorted values: | \")\n\ttree.Traverse(tree.Root, func(n *Node) { fmt.Print(n.Value, \": \", n.Data, \" | \") })\n\tfmt.Println()\n\n\t// Find values.\n\ts := \"d\"\n\tfmt.Print(\"Find node '\", s, \"': \")\n\td, found := tree.Find(s)\n\tif !found {\n\t\tlog.Fatal(\"Cannot find '\" + s + \"'\")\n\t}\n\tfmt.Println(\"Found \" + s + \": '\" + d + \"'\")\n\n\t// Delete a value.\n\terr := tree.Delete(s)\n\tif err != nil {\n\t\tlog.Fatal(\"Error deleting \"+s+\": \", err)\n\t}\n\tfmt.Print(\"After deleting '\" + s + \"': \")\n\ttree.Traverse(tree.Root, func(n *Node) { fmt.Print(n.Value, \": \", n.Data, \" | \") })\n\tfmt.Println()\n}", "title": "" }, { "docid": "4cd536cd5c6dae923dbf22456dcb4ddb", "score": "0.4328402", "text": "func (self *FinderNode) Prune(dir string) {\n\tif self.prune == nil {\n\t\tself.prune = make(dirset)\n\t}\n\tself.prune[dir] = true\n}", "title": "" }, { "docid": "27aa6e6052db4431be1458b8b4fb5fd1", "score": "0.43232182", "text": "func build_constructFromPrePost(pre []int,pre_start int,pre_end int,post []int,post_start int,post_end int)*TreeNode{\n\tif pre_end >= len(pre) || post_end >= len(post) || pre_start > pre_end || post_start > post_end{\n\t\treturn nil\n\t}\n\tvar node TreeNode\n\tnode.Val = pre[pre_start]\n\tif pre_start == pre_end && post_start == post_end{\n\t\treturn &node\n\t}\n\tvar left_end_in_post int = post_end\n\tfor post[left_end_in_post] != pre[pre_start + 1] && left_end_in_post > post_start{\n\t\tleft_end_in_post--\n\t}\n\tleft_end_in_pre := pre_start + left_end_in_post - post_start + 1\n\tnode.Left = build_constructFromPrePost(pre,pre_start + 1, left_end_in_pre,post,post_start,left_end_in_post)\n\tnode.Right = build_constructFromPrePost(pre,left_end_in_pre + 1,pre_end,post,left_end_in_post + 1,post_end - 1)\n\treturn &node\n}", "title": "" }, { "docid": "28759cdca0989a9b7f37cce592286ae3", "score": "0.43203172", "text": "func (set *Set) String() string {\n\tstr := \"TreeSet\\n\"\n\titems := []string{}\n\tfor _, v := range set.tree.Keys() {\n\t\titems = append(items, fmt.Sprintf(\"%v\", v))\n\t}\n\tstr += strings.Join(items, \", \")\n\treturn str\n}", "title": "" }, { "docid": "a509d03c63d402446a6c45df7bd459c1", "score": "0.43196648", "text": "func BuildTree(defined map[string]*Policy, defaultPolicy *Policy) *Tree {\n\treturn buildTreeNode(defined, \".\", defaultPolicy)\n}", "title": "" }, { "docid": "9944da1cd3931accecafe8f6500829ec", "score": "0.43182224", "text": "func GetBranchesMethods(w *wiki.WikiData) (r entities.Result) {\n\tr.WikiData, _ = wiki.FilterPagesRegs(w, wiki.MakeRegs(false, []string{`\\[\\[Kategorie:VSgS.*\\]\\]`, `\\[\\[Kategorie:Směry, školy, teorie a koncepce sociologického a sociálního myšlení\\]\\]`}))\n\tfor _, p := range r.WikiData.Page {\n\t\tr.Nodes = append(r.Nodes, entities.Node{\"Metody\", p.Title, p.Revision.Text, []string{}, GetLinks(string(p.Revision.Text)), \"\"})\n\t}\n\treturn r\n}", "title": "" }, { "docid": "cbfb302beede0d50cfa6ca8a7b27daf5", "score": "0.4309205", "text": "func main() {\n\tnode5 := &LevelOrderTreeNode{Val:5}\n\tnode4 := &LevelOrderTreeNode{Val:3}\n\tnode3 := &LevelOrderTreeNode{Val:1}\n\tnode2 := &LevelOrderTreeNode{Val:2, Left:node3, Right:node4}\n\tnode1 := &LevelOrderTreeNode{Val:4, Left:node2, Right:node5}\n\tfmt.Println(levelOrder(node1))\n}", "title": "" }, { "docid": "12ec7a0e14d35269a30ffe41415aa330", "score": "0.43089825", "text": "func main() {\n\t// -----------二叉树-----------------\n\tnode3 := &TreeNode{Val: 15}\n\tnode4 := &TreeNode{Val: 7}\n\tnode5 := &TreeNode{Val: 1}\n\tnode1 := &TreeNode{Val: 9, Left: node3, Right: node4}\n\tnode2 := &TreeNode{Val: 20, Left: node5}\n\troot := TreeNode{Val: 3, Left: node1, Right: node2}\n\tfmt.Println(binaryTreePaths(&root))\n}", "title": "" }, { "docid": "02ca01d8e13e0e0a9cec334150f4fe59", "score": "0.43062088", "text": "func api_gretel_show_tree(q *Context) {\n\tq.w.Header().Set(\"Access-Control-Allow-Origin\", \"*\")\n\n\t// [${corpus}, ${dactfile}, ${sentenceid}]\n\tpathSegments := strings.Split(q.r.URL.EscapedPath(), \"/\")\n\tsentID := pathSegments[len(pathSegments)-1]\n\tdactFileID := pathSegments[len(pathSegments)-2]\n\tcorpus := pathSegments[len(pathSegments)-3]\n\n\tif !mayAccess(q, corpus) {\n\t\thttp.Error(q.w, \"\", 403)\n\t\treturn\n\t}\n\n\tdactFile, errval := getDactFileById(corpus, dactFileID)\n\tif gretelSendErr(\"Error finding component \"+dactFileID+\" for corpus \"+corpus, q, errval) {\n\t\treturn\n\t}\n\n\tdb, errval := dbxml.OpenRead(dactFile.path)\n\tif gretelSendErr(\"Error opening component database \"+dactFile.path, q, errval) {\n\t\treturn\n\t}\n\n\txquery := xquery_gretel_show_tree(sentID)\n\n\tvar qu *dbxml.Query\n\tqu, errval = db.PrepareRaw(xquery)\n\tif gretelSendErr(\"Invalid query: \"+xquery, q, errval) {\n\t\treturn\n\t}\n\n\tdocs, errval := qu.Run()\n\tif gretelSendErr(\"Cannot execute query: \"+xquery, q, errval) {\n\t\treturn\n\t}\n\n\t// read results\n\tdocs.Next()\n\tresult := docs.Match()\n\n\tif result == \"\" {\n\t\tgretelSendErr(\"Could not retrieve tree \"+sentID, q, errors.New(\"Document not found\"))\n\t\treturn\n\t}\n\n\tq.w.Header().Set(\"Content-Type\", \"text/xml; charset=utf-8\")\n\tq.w.Header().Set(\"Cache-Control\", \"no-cache\")\n\tq.w.Header().Add(\"Pragma\", \"no-cache\")\n\n\tfmt.Fprint(q.w, result)\n}", "title": "" }, { "docid": "eac7dfd2fb68d704e9c618da8ceac997", "score": "0.4300004", "text": "func PostOrder(node *Node) {\n\tif node != nil {\n\t\tPostOrder(node.left)\n\t\tPostOrder(node.right)\n\t\tfmt.Println(node.val)\n\t}\n}", "title": "" }, { "docid": "394c57ee473d7a66b19c246dd99e44ca", "score": "0.42888921", "text": "func (t *Tables) FileTree() filetree.FileTree { return t }", "title": "" }, { "docid": "69389ef1fc1fc194fb4ca189505de54b", "score": "0.42850703", "text": "func buildSimpleMockWordsTree() *GreedyWordTreeNode {\n\thead := NewGreedyWordTreeElement(\"cat\", 0, nil)\n\thead.NextElements = append(head.NextElements, NewGreedyWordTreeElement(\"cot\", 1, head))\n\thead.NextElements[0].NextElements = append(head.NextElements[0].NextElements,\n\t\tNewGreedyWordTreeElement(\"cog\", 2, head.NextElements[0]),\n\t\tNewGreedyWordTreeElement(\"dot\", 2, head.NextElements[0]),\n\t)\n\thead.NextElements[0].NextElements[0].NextElements = append(head.NextElements[0].NextElements[0].NextElements,\n\t\tNewGreedyWordTreeElement(\"dog\", 3, head.NextElements[0].NextElements[0]))\n\thead.NextElements[0].NextElements[1].NextElements = append(head.NextElements[0].NextElements[1].NextElements,\n\t\tNewGreedyWordTreeElement(\"dog\", 3, head.NextElements[0].NextElements[1]))\n\treturn head\n}", "title": "" }, { "docid": "a0d54c84f76aeaf7376339bf1ea0c711", "score": "0.42817792", "text": "func (n *Node) print() string {\n\n\th := n.height()\n\tprintMap = make(map[int][]int, h)\n\tfor i := 1; i <= h; i++ {\n\t\tn.printByLevel(i)\n\t}\n\tfor key := h; key > 0; key-- {\n\t\tfor j := h; j > key; j-- {\n\t\t\tfor _, k := range printMap[j] {\n\t\t\t\tif arrayutils.InInt(printMap[key], k) {\n\t\t\t\t\tprintMap[key] = arrayutils.RemoveByValue[int](printMap[key], k)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ts := fmt.Sprintf(\"Tree: %+v\", printMap)\n\tprintMap = nil\n\n\treturn s\n}", "title": "" }, { "docid": "6f7a5408f45290c2ff20cef60f75d19a", "score": "0.4277969", "text": "func parseWord(tokens []*Token, env parseEnvironemnt) (*Node, parseEnvironemnt, error) {\n\tif nt := tokens[env.idx+1]; nt.TokenType == EOF || nt.TokenType == RParen || nt.TokenType == KeywordThen || nt.TokenType == KeywordElse {\n\t\tret := buildVariableNode(env, tokens[env.idx].Text)\n\t\tenv.idx++\n\t\treturn ret, env, nil\n\t}\n\tnodes := []*Node{buildVariableNode(env, tokens[env.idx].Text)}\n\tenv.idx++\napplyLoop:\n\tfor i := env.idx; ; {\n\t\tswitch t := tokens[i]; t.TokenType {\n\t\tcase RParen, EOF:\n\t\t\tenv.idx = i\n\t\t\tbreak applyLoop\n\t\tcase Word:\n\t\t\tv := buildVariableNode(env, tokens[i].Text)\n\t\t\tnodes = append(nodes, v)\n\t\t\ti++\n\t\tcase KeywordTrue:\n\t\t\tv := &Node{NodeType: True}\n\t\t\tnodes = append(nodes, v)\n\t\t\ti++\n\t\tcase KeywordFalse:\n\t\t\tv := &Node{NodeType: False}\n\t\t\tnodes = append(nodes, v)\n\t\t\ti++\n\t\tcase Number:\n\t\t\tv := &Node{NodeType: NodeNumber}\n\t\t\tnodes = append(nodes, v)\n\t\t\ti++\n\t\tcase KeywordThen, KeywordElse:\n\t\t\tenv.idx = i\n\t\t\tbreak applyLoop\n\t\tdefault:\n\t\t\treturn nil, env, fmt.Errorf(\"unexpected token %v at %d\", t, i)\n\t\t}\n\t}\n\tapp := nodesToApply(nodes)\n\treturn app, env, nil\n}", "title": "" }, { "docid": "838bfcbfd7bb22d58c1c0e5239f24da2", "score": "0.4273686", "text": "func NewPMA(patterns [][]rune, base rune) *PMA {\n\troot := new(pmaNode)\n\troot.failure = root\n\n\tpma := new(PMA)\n\tpma.root = root\n\tpma.base = base\n\n\t// build Trie by pattern strings\n\tvar curNode *pmaNode\n\tfor i := 0; i < len(patterns); i++ {\n\t\tcurNode = root\n\t\tfor _, r := range patterns[i] {\n\t\t\tc := r - base\n\t\t\tif curNode.next[c] == nil {\n\t\t\t\tcurNode.next[c] = new(pmaNode)\n\t\t\t}\n\t\t\tcurNode = curNode.next[c]\n\t\t}\n\t\tcurNode.accept = append(curNode.accept, i)\n\t}\n\n\t// Aho-Corasick method\n\tque := []*pmaNode{}\n\t// Initialize queue\n\tfor i := 0; i < _PMA_CHAR_SIZE; i++ {\n\t\tif root.next[i] == nil {\n\t\t\troot.next[i] = root\n\t\t} else {\n\t\t\troot.next[i].failure = root\n\t\t\tque = append(que, root.next[i])\n\t\t}\n\t}\n\t// BFS\n\tfor len(que) > 0 {\n\t\tcurNode = que[0]\n\t\tque = que[1:]\n\n\t\tfor i := 0; i < _PMA_CHAR_SIZE; i++ {\n\t\t\tif curNode.next[i] == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tbeforeFailNode := curNode.failure\n\t\t\tfor beforeFailNode.next[i] == nil {\n\t\t\t\tbeforeFailNode = beforeFailNode.failure\n\t\t\t}\n\n\t\t\tcurNode.next[i].failure = beforeFailNode.next[i]\n\t\t\tcurNode.next[i].accept = pma._setUnion(curNode.next[i].accept, beforeFailNode.next[i].accept)\n\n\t\t\tque = append(que, curNode.next[i])\n\t\t}\n\t}\n\n\treturn pma\n}", "title": "" }, { "docid": "f2170dedcaa505cc36cb1973b8daf30e", "score": "0.42593658", "text": "func init() {\n\twithoutWhitespace := func(s string) string {\n\t\treturn strings.Map(func(r rune) rune {\n\t\t\tif !unicode.IsPrint(r) {\n\t\t\t\treturn -1\n\t\t\t} else {\n\t\t\t\treturn r\n\t\t\t}\n\t\t}, s)\n\t}\n\tfmt.Printf(\"fixtures:\\n\"+strings.Repeat(\"\\t%v\\t%v\\n\", 5),\n\t\tleafAlphaLnk, withoutWhitespace(string(storage[leafAlphaLnk])),\n\t\tleafBetaLnk, withoutWhitespace(string(storage[leafBetaLnk])),\n\t\tmiddleMapNodeLnk, withoutWhitespace(string(storage[middleMapNodeLnk])),\n\t\tmiddleListNodeLnk, withoutWhitespace(string(storage[middleListNodeLnk])),\n\t\trootNodeLnk, withoutWhitespace(string(storage[rootNodeLnk])),\n\t)\n}", "title": "" }, { "docid": "fe3066714435b9732b626a4ddcce4266", "score": "0.4256936", "text": "func dump(solutions [][]int) [][]string {\n\tvar results [][]string\n\tfor _, solution := range solutions {\n\t\tvar result []string\n\t\tfor _, pos := range solution {\n\t\t\tresult = append(result,\n\t\t\t\tstrings.Repeat(\".\", pos)+\"Q\"+\n\t\t\t\t\tstrings.Repeat(\".\", len(solution)-pos-1))\n\t\t}\n\t\tresults = append(results, result)\n\t}\n\treturn results\n}", "title": "" }, { "docid": "cab8245f3a9da76d908b5720ecff7fd6", "score": "0.4252251", "text": "func (t *ASCIITree) PrintTree(w io.Writer) {\n\tancestorPrefix := \"\"\n\tfor _, parent := range t.Ancestors() {\n\t\tif parent.Level() <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif parent.Last() {\n\t\t\tancestorPrefix += \" \"\n\t\t} else {\n\t\t\tancestorPrefix += \" │\"\n\t\t}\n\t}\n\n\tmyPrefix := \"\"\n\tmultilinePrefix := \"\"\n\tif t.Level() > 0 {\n\t\tif t.Last() {\n\t\t\tif t.Empty() {\n\t\t\t\tmyPrefix += \" └── \"\n\t\t\t\tmultilinePrefix += \" \"\n\t\t\t} else {\n\t\t\t\tmyPrefix += \" └─┬ \"\n\t\t\t\tmultilinePrefix += \" └─┬ \"\n\t\t\t}\n\t\t} else {\n\t\t\tif t.Empty() {\n\t\t\t\tmyPrefix += \" ├── \"\n\t\t\t\tmultilinePrefix += \" │ \"\n\t\t\t} else {\n\t\t\t\tmyPrefix += \" ├─┬ \"\n\t\t\t\tmultilinePrefix += \" │ │ \"\n\t\t\t}\n\t\t}\n\t}\n\n\tif t.Text != \"\" {\n\t\tlines := strings.Split(t.Text, \"\\n\")\n\t\tfmt.Fprintf(w, \"%s%s%s\\n\", ancestorPrefix, myPrefix, lines[0])\n\t\tfor _, line := range lines[1:] {\n\t\t\tfmt.Fprintf(w, \"%s%s%s\\n\", ancestorPrefix, multilinePrefix, line)\n\t\t}\n\t}\n\n\tfor _, child := range t.children {\n\t\tchild.PrintTree(w)\n\t}\n}", "title": "" }, { "docid": "115bb06dcd7884126df65fd35b89638a", "score": "0.4248411", "text": "func evalWords(ws syntax.Words, c context) interface{} {\n\tif 0 < len(ws.Operators) {\n\t\tfor j, firstSpecial := range ws.Operators[0].Specials {\n\t\t\tswitch firstSpecialPayload := firstSpecial.(type) {\n\t\t\tcase syntax.WordSpecialJunction:\n\t\t\t\tfirstLeftTuple := false\n\t\t\t\tif j-1 < 0 {\n\t\t\t\t} else if _, isTuple :=\n\t\t\t\t\tws.Operators[0].Specials[j-1].(syntax.WordSpecialTuple); isTuple {\n\t\t\t\t\tfirstLeftTuple = true\n\t\t\t\t}\n\n\t\t\t\tfirstRightTuple := false\n\t\t\t\tif j+1 >= len(ws.Operators[0].Specials) {\n\t\t\t\t} else if _, isTuple :=\n\t\t\t\t\tws.Operators[0].Specials[j+1].(syntax.WordSpecialTuple); isTuple {\n\t\t\t\t\tfirstRightTuple = true\n\t\t\t\t}\n\n\t\t\t\tif len(ws.Compositions[0]) != 0 {\n\t\t\t\t\tpanic(\"Junction doesn't start with operator word\")\n\t\t\t\t}\n\t\t\t\tjunctive := Junctive(firstSpecialPayload)\n\t\t\t\tvar junctRels []Rel\n\t\t\t\tfor i, operator := range ws.Operators {\n\t\t\t\t\torigOperator := operator\n\t\t\t\t\t// 0 < len(operator.Specials)\n\t\t\t\t\t_, commented := operator.Specials[0].(syntax.WordSpecialCommentMarker)\n\t\t\t\t\tif commented {\n\t\t\t\t\t\tif operator.Strings[0] != \"\" {\n\t\t\t\t\t\t\tpanic(\"Bad junction operator word: \" + origOperator.String())\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// There is at least one operator special in `operator`, but a comment\n\t\t\t\t\t\t// marker isn't operative; therefore, 1 < len(operator.Specials)\n\t\t\t\t\t\toperator = syntax.Word{Strings: operator.Strings[1:], Specials: operator.Specials[1:]}\n\t\t\t\t\t}\n\t\t\t\t\t// 0 < len(operator.Specials)\n\t\t\t\t\t_, leftTuple := operator.Specials[0].(syntax.WordSpecialTuple)\n\t\t\t\t\tif leftTuple {\n\t\t\t\t\t\tif operator.Strings[0] != \"\" {\n\t\t\t\t\t\t\tpanic(\"Bad junction operator word: \" + origOperator.String())\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// There is at least one operator special in `operator`, but a tuple\n\t\t\t\t\t\t// isn't operative; therefore, 1 < len(operator.Specials)\n\t\t\t\t\t\toperator = syntax.Word{Strings: operator.Strings[1:], Specials: operator.Specials[1:]}\n\t\t\t\t\t}\n\t\t\t\t\t// 0 < len(operator.Specials)\n\t\t\t\t\tif operator.Strings[0] != \"\" || operator.Strings[1] != \"\" || 2 < len(operator.Specials) {\n\t\t\t\t\t\tpanic(\"Bad junction operator word: \" + origOperator.String())\n\t\t\t\t\t}\n\t\t\t\t\tif specialPayload, isWordSpecialJunction :=\n\t\t\t\t\t\toperator.Specials[0].(syntax.WordSpecialJunction); !isWordSpecialJunction ||\n\t\t\t\t\t\tspecialPayload != firstSpecialPayload {\n\t\t\t\t\t\tpanic(\"Bad junction operator word: \" + origOperator.String())\n\t\t\t\t\t}\n\t\t\t\t\trightTuple := 2 == len(operator.Specials)\n\t\t\t\t\tif !rightTuple {\n\t\t\t\t\t} else if _, isTuple :=\n\t\t\t\t\t\toperator.Specials[1].(syntax.WordSpecialTuple); false {\n\t\t\t\t\t} else if !isTuple || operator.Strings[2] != \"\" {\n\t\t\t\t\t\tpanic(\"Bad junction operator word: \" + origOperator.String())\n\t\t\t\t\t}\n\t\t\t\t\tif leftTuple != firstLeftTuple || rightTuple != firstRightTuple {\n\t\t\t\t\t\tpanic(\"Bad junction operator word: \" + origOperator.String())\n\t\t\t\t\t}\n\n\t\t\t\t\tif !commented {\n\t\t\t\t\t\tvar factors []syntax.Word\n\t\t\t\t\t\tif leftTuple {\n\t\t\t\t\t\t\tfactors = append(factors, Collect(junctive, fmt.Sprint(i)).Syntax().Word())\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfactors = append(factors, ws.Compositions[1:][i]...)\n\t\t\t\t\t\tif rightTuple {\n\t\t\t\t\t\t\tfactors = append(factors, Select(junctive, fmt.Sprint(i)).Syntax().Word())\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjunctRels = append(junctRels, EvalComposition(factors, c).Rel())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif len(junctRels) == 0 {\n\t\t\t\t\tpanic(\"Empty junction: \" + ws.String())\n\t\t\t\t}\n\t\t\t\treturn Junction(junctive, junctRels)\n\t\t\tcase syntax.WordSpecialApplication:\n\t\t\t\tval := EvalComposition(ws.Compositions[0], c)\n\t\t\t\tfor i, operator := range ws.Operators {\n\t\t\t\t\tif len(operator.Specials) != 1 ||\n\t\t\t\t\t\toperator.Strings[0] != \"\" ||\n\t\t\t\t\t\toperator.Strings[1] != \"\" {\n\t\t\t\t\t\tpanic(\"Bad application operator word: \" + operator.String())\n\t\t\t\t\t}\n\t\t\t\t\tif _, isWordSpecialApplication :=\n\t\t\t\t\t\toperator.Specials[0].(syntax.WordSpecialApplication); !isWordSpecialApplication {\n\t\t\t\t\t\tpanic(\"Bad application operator word: \" + operator.String())\n\t\t\t\t\t}\n\n\t\t\t\t\tval = val.Apply(EvalComposition(ws.Compositions[1:][i], c))\n\t\t\t\t}\n\t\t\t\treturn val.It\n\t\t\t}\n\t\t}\n\t\tpanic(\"Unreachable\")\n\t} else {\n\t\treturn evalComposition(ws.Compositions[0], c)\n\t}\n}", "title": "" }, { "docid": "28e4bfa91a4ba3c01c9ce30979dc4d24", "score": "0.4241893", "text": "func GetTree() map[string]interface{} {\n\n\treturn tree\n\n}", "title": "" }, { "docid": "73f940851a59e3a76a28e4124f5f84fa", "score": "0.42403996", "text": "func indirectMap(tree []Node) []Node {\n\tif isTreeList(tree) {\n\t\t// I use square brackets here to emphasize what is 'tree'.\n\t\t// (a [(a)]) as is\n\t\t// (a [()]) indirect to (a ([]))\n\t\t// (a [(())]) indirect to (a ([()]))\n\t\tif t := tree[0].List; len(t) == 0 || !t[0].IsScalar() {\n\t\t\treturn t\n\t\t}\n\t}\n\treturn tree\n}", "title": "" }, { "docid": "93bb554136a991cf3eec77354f0c66db", "score": "0.42385763", "text": "func TestLL3(t *testing.T) {\n\tutil_ut.IsTrue(t, LL.n_back > 0) // setup correctly\n\tutil_ut.IsTrue(t, len(LL.pronoun_set) > 0)\n\n\t// The old lady pulled her spectacles down and looked over them about the room; then she put them up and looked out under them.\n\t// She seldom or never looked THROUGH them for so small a thing as a boy; they were her state pair, the pride of her heart, and were\n\t// built for ”style,” not service—she could have seen through a pair of stove-lids just as well.\n\tconst s_list_1 = `[{\"tokenList\":[{\"index\":0,\"list\":[1,3,18],\"tag\":\"DT\",\"text\":\"The\",\"dep\":\"det\",\"synid\":-1,\"semantic\":\"\"},{\"index\":2,\"list\":[3,18],\"tag\":\"NN\",\"text\":\"old lady\",\"dep\":\"nsubj\",\"synid\":-1,\"semantic\":\"female\"},{\"index\":3,\"list\":[18],\"tag\":\"VBD\",\"text\":\"pulled\",\"dep\":\"ccomp\",\"synid\":-1,\"semantic\":\"\"},{\"index\":4,\"list\":[5,3,18],\"tag\":\"PRP$\",\"text\":\"her\",\"dep\":\"poss\",\"synid\":-1,\"semantic\":\"\"},{\"index\":5,\"list\":[3,18],\"tag\":\"NNS\",\"text\":\"spectacles\",\"dep\":\"dobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":6,\"list\":[3,18],\"tag\":\"RB\",\"text\":\"down\",\"dep\":\"advmod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":7,\"list\":[3,18],\"tag\":\"CC\",\"text\":\"and\",\"dep\":\"cc\",\"synid\":-1,\"semantic\":\"\"},{\"index\":8,\"list\":[3,18],\"tag\":\"VBD\",\"text\":\"looked\",\"dep\":\"conj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":9,\"list\":[8,3,18],\"tag\":\"IN\",\"text\":\"over\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":10,\"list\":[9,8,3,18],\"tag\":\"PRP\",\"text\":\"them\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":12,\"list\":[8,3,18],\"tag\":\"IN\",\"text\":\"about\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":13,\"list\":[14,12,8,3,18],\"tag\":\"DT\",\"text\":\"the\",\"dep\":\"det\",\"synid\":-1,\"semantic\":\"\"},{\"index\":14,\"list\":[12,8,3,18],\"tag\":\"NN\",\"text\":\"room\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"location\"},{\"index\":15,\"list\":[18],\"tag\":\":\",\"text\":\";\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":16,\"list\":[18],\"tag\":\"RB\",\"text\":\"then\",\"dep\":\"advmod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":17,\"list\":[18],\"tag\":\"PRP\",\"text\":\"she\",\"dep\":\"nsubj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":18,\"list\":[],\"tag\":\"VBD\",\"text\":\"put\",\"dep\":\"ROOT\",\"synid\":-1,\"semantic\":\"\"},{\"index\":19,\"list\":[18],\"tag\":\"PRP\",\"text\":\"them\",\"dep\":\"dobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":20,\"list\":[18],\"tag\":\"RP\",\"text\":\"up\",\"dep\":\"prt\",\"synid\":-1,\"semantic\":\"\"},{\"index\":21,\"list\":[18],\"tag\":\"CC\",\"text\":\"and\",\"dep\":\"cc\",\"synid\":-1,\"semantic\":\"\"},{\"index\":22,\"list\":[18],\"tag\":\"VBD\",\"text\":\"looked\",\"dep\":\"conj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":23,\"list\":[22,18],\"tag\":\"RP\",\"text\":\"out\",\"dep\":\"prt\",\"synid\":-1,\"semantic\":\"\"},{\"index\":24,\"list\":[22,18],\"tag\":\"IN\",\"text\":\"under\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":25,\"list\":[24,22,18],\"tag\":\"PRP\",\"text\":\"them\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":26,\"list\":[18],\"tag\":\".\",\"text\":\".\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":27,\"list\":[26,18],\"tag\":\"SP\",\"text\":\"\\n\\t\",\"dep\":\"\",\"synid\":-1,\"semantic\":\"\"}]},{\"tokenList\":[{\"index\":28,\"list\":[32,46],\"tag\":\"PRP\",\"text\":\"She\",\"dep\":\"nsubj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":29,\"list\":[32,46],\"tag\":\"RB\",\"text\":\"seldom\",\"dep\":\"advmod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":30,\"list\":[29,32,46],\"tag\":\"CC\",\"text\":\"or\",\"dep\":\"cc\",\"synid\":-1,\"semantic\":\"\"},{\"index\":31,\"list\":[32,46],\"tag\":\"RB\",\"text\":\"never\",\"dep\":\"neg\",\"synid\":-1,\"semantic\":\"\"},{\"index\":32,\"list\":[46],\"tag\":\"VBD\",\"text\":\"looked\",\"dep\":\"ccomp\",\"synid\":-1,\"semantic\":\"\"},{\"index\":33,\"list\":[32,46],\"tag\":\"IN\",\"text\":\"THROUGH\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":34,\"list\":[33,32,46],\"tag\":\"PRP\",\"text\":\"them\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":35,\"list\":[32,46],\"tag\":\"IN\",\"text\":\"for\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":36,\"list\":[37,39,35,32,46],\"tag\":\"RB\",\"text\":\"so\",\"dep\":\"advmod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":37,\"list\":[39,35,32,46],\"tag\":\"JJ\",\"text\":\"small\",\"dep\":\"amod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":38,\"list\":[39,35,32,46],\"tag\":\"DT\",\"text\":\"a\",\"dep\":\"det\",\"synid\":-1,\"semantic\":\"\"},{\"index\":39,\"list\":[35,32,46],\"tag\":\"NN\",\"text\":\"thing\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":41,\"list\":[39,35,32,46],\"tag\":\"IN\",\"text\":\"as\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":42,\"list\":[43,41,39,35,32,46],\"tag\":\"DT\",\"text\":\"a\",\"dep\":\"det\",\"synid\":-1,\"semantic\":\"\"},{\"index\":43,\"list\":[41,39,35,32,46],\"tag\":\"NN\",\"text\":\"boy\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"male\"},{\"index\":44,\"list\":[46],\"tag\":\":\",\"text\":\";\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":45,\"list\":[46],\"tag\":\"PRP\",\"text\":\"they\",\"dep\":\"nsubj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":46,\"list\":[],\"tag\":\"VBD\",\"text\":\"were\",\"dep\":\"ROOT\",\"synid\":-1,\"semantic\":\"\"},{\"index\":47,\"list\":[49,46],\"tag\":\"PRP$\",\"text\":\"her\",\"dep\":\"poss\",\"synid\":-1,\"semantic\":\"\"},{\"index\":48,\"list\":[49,46],\"tag\":\"NN\",\"text\":\"state\",\"dep\":\"compound\",\"synid\":-1,\"semantic\":\"\"},{\"index\":49,\"list\":[46],\"tag\":\"NN\",\"text\":\"pair\",\"dep\":\"attr\",\"synid\":-1,\"semantic\":\"\"},{\"index\":50,\"list\":[49,46],\"tag\":\",\",\"text\":\",\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":51,\"list\":[52,49,46],\"tag\":\"DT\",\"text\":\"the\",\"dep\":\"det\",\"synid\":-1,\"semantic\":\"\"},{\"index\":52,\"list\":[49,46],\"tag\":\"NN\",\"text\":\"pride\",\"dep\":\"conj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":53,\"list\":[52,49,46],\"tag\":\"IN\",\"text\":\"of\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":54,\"list\":[55,53,52,49,46],\"tag\":\"PRP$\",\"text\":\"her\",\"dep\":\"poss\",\"synid\":-1,\"semantic\":\"\"},{\"index\":55,\"list\":[53,52,49,46],\"tag\":\"NN\",\"text\":\"heart\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":56,\"list\":[52,49,46],\"tag\":\",\",\"text\":\",\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":57,\"list\":[46],\"tag\":\"CC\",\"text\":\"and\",\"dep\":\"cc\",\"synid\":-1,\"semantic\":\"\"},{\"index\":58,\"list\":[60,46],\"tag\":\"VBD\",\"text\":\"were\",\"dep\":\"auxpass\",\"synid\":-1,\"semantic\":\"\"},{\"index\":59,\"list\":[58,60,46],\"tag\":\"SP\",\"text\":\"\\n\\t\",\"dep\":\"\",\"synid\":-1,\"semantic\":\"\"},{\"index\":60,\"list\":[46],\"tag\":\"VBN\",\"text\":\"built\",\"dep\":\"conj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":61,\"list\":[60,46],\"tag\":\"IN\",\"text\":\"for\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":62,\"list\":[63,61,60,46],\"tag\":\"JJ\",\"text\":\"”\",\"dep\":\"amod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":63,\"list\":[61,60,46],\"tag\":\"NN\",\"text\":\"style\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":64,\"list\":[60,46],\"tag\":\",\",\"text\":\",\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":65,\"list\":[60,46],\"tag\":\"NFP\",\"text\":\"”\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":66,\"list\":[67,72,60,46],\"tag\":\"RB\",\"text\":\"not\",\"dep\":\"neg\",\"synid\":-1,\"semantic\":\"\"},{\"index\":67,\"list\":[72,60,46],\"tag\":\"NN\",\"text\":\"service\",\"dep\":\"oprd\",\"synid\":-1,\"semantic\":\"\"},{\"index\":68,\"list\":[72,60,46],\"tag\":\"XX\",\"text\":\"—\",\"dep\":\"dep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":69,\"list\":[72,60,46],\"tag\":\"PRP\",\"text\":\"she\",\"dep\":\"nsubj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":70,\"list\":[72,60,46],\"tag\":\"MD\",\"text\":\"could\",\"dep\":\"aux\",\"synid\":-1,\"semantic\":\"\"},{\"index\":71,\"list\":[72,60,46],\"tag\":\"VB\",\"text\":\"have\",\"dep\":\"aux\",\"synid\":-1,\"semantic\":\"\"},{\"index\":72,\"list\":[60,46],\"tag\":\"VBN\",\"text\":\"seen\",\"dep\":\"conj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":73,\"list\":[72,60,46],\"tag\":\"IN\",\"text\":\"through\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":74,\"list\":[75,73,72,60,46],\"tag\":\"DT\",\"text\":\"a\",\"dep\":\"det\",\"synid\":-1,\"semantic\":\"\"},{\"index\":75,\"list\":[73,72,60,46],\"tag\":\"NN\",\"text\":\"pair\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":77,\"list\":[75,73,72,60,46],\"tag\":\"IN\",\"text\":\"of\",\"dep\":\"prep\",\"synid\":-1,\"semantic\":\"\"},{\"index\":78,\"list\":[80,77,75,73,72,60,46],\"tag\":\"NN\",\"text\":\"stove\",\"dep\":\"compound\",\"synid\":-1,\"semantic\":\"\"},{\"index\":79,\"list\":[80,77,75,73,72,60,46],\"tag\":\"HYPH\",\"text\":\"-\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"},{\"index\":80,\"list\":[77,75,73,72,60,46],\"tag\":\"NNS\",\"text\":\"lids\",\"dep\":\"pobj\",\"synid\":-1,\"semantic\":\"\"},{\"index\":81,\"list\":[83,72,60,46],\"tag\":\"RB\",\"text\":\"just as\",\"dep\":\"advmod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":83,\"list\":[72,60,46],\"tag\":\"RB\",\"text\":\"well\",\"dep\":\"advmod\",\"synid\":-1,\"semantic\":\"\"},{\"index\":84,\"list\":[46],\"tag\":\".\",\"text\":\".\",\"dep\":\"punct\",\"synid\":-1,\"semantic\":\"\"}]}]`\n\tsentence_list_1 := jsonToSentenceList(t, s_list_1)\n\tutil_ut.IsTrue(t, len(sentence_list_1) == 2) // has two sentences\n\n\t// check that we can detect the pronoun\n\tutil_ut.IsTrue(t, LL.HasPronoun(sentence_list_1[0]))\n\tutil_ut.IsTrue(t, LL.HasPronoun(sentence_list_1[1]))\n\n\t// resolve the 11 pronouns\n\tpn_count := LL.ResolvePronouns(sentence_list_1)\n\tutil_ut.IsTrue(t, pn_count == 11)\n\n\t// check the references are correct; she and her refers to token 2 (old lady), and them and they refer to token 5 (spectacles)\n\tcheckPronounReference(t, sentence_list_1, \"old lady\", \"she\", \"her\")\n\tcheckPronounReference(t, sentence_list_1, \"spectacles\", \"them\", \"they\")\n}", "title": "" }, { "docid": "4b81d29ab66a709c10906beac6706648", "score": "0.42358953", "text": "func PrintZigZag[T any](node *trees.MultiNode[T]) {\n\tif node == nil {\n\t\treturn\n\t}\n\n\tqueue := queues.New[*trees.MultiNode[T]]()\n\tqueue.Enqueue(node)\n\n\tlist := doublylinkedlists.New[*trees.MultiNode[T]]()\n\n\tisForwardDirection := true\n\tfor !queue.IsEmpty() {\n\t\tfor size := queue.Size(); size > 0; size-- {\n\t\t\telement, _ := queue.Dequeue()\n\t\t\tfmt.Print(element.Data, \" \")\n\n\t\t\tfor _, child := range element.Children {\n\t\t\t\tlist.Add(child)\n\t\t\t}\n\t\t}\n\n\t\tif isForwardDirection {\n\t\t\tfor _, value := range list.GetValues() {\n\t\t\t\tqueue.Enqueue(value)\n\t\t\t}\n\t\t} else {\n\t\t\tfor _, value := range list.GetReverseValues() {\n\t\t\t\tqueue.Enqueue(value)\n\t\t\t}\n\t\t}\n\n\t\tlist.Clear()\n\t\tisForwardDirection = !isForwardDirection\n\t\tfmt.Println()\n\t}\n}", "title": "" }, { "docid": "8f03591ad6db1413c963b0a456678343", "score": "0.42355812", "text": "func (bt *BinaryTree) PostOrder2() string {\n\tif bt.head.left != bt.head.right {\n\t\treturn \"\"\n\t}\n\n\tvar r []string\n\tvar n *Node\n\tstack := []*Node{bt.head.left}\n\n\tfor 0 != len(stack) {\n\t\tn = stack[len(stack)-1]\n\t\tstack = stack[0 : len(stack)-1]\n\n\t\tr = append(r, n.data)\n\n\t\tif nil != n.left {\n\t\t\tstack = append(stack, n.left)\n\t\t}\n\n\t\tif nil != n.right {\n\t\t\tstack = append(stack, n.right)\n\t\t}\n\t}\n\n\ttools.Reverse(r)\n\n\treturn strings.Join(r, \"->\")\n}", "title": "" }, { "docid": "9a4092687af9a6a66db6ee1d9d4efe17", "score": "0.42232674", "text": "func makeCultureTree(chronicle []types.CultureYearLocalChronicle) types.CultureLocalTreeHistory {\n\ttree := types.CultureLocalTreeHistory{}\n\toriginLocal := types.LocalCultureTreeHistory{chronicle[0].LocalCulture, [2]int{1, 0}}\n\toriginCultura := types.CultureTreeHistory{chronicle[0].Culture, [2]int{1, 0}, []types.LocalCultureTreeHistory{originLocal}}\n\toriginBase := types.BaseCultureTreeHistory{chronicle[0].BaseCulture, [2]int{1, 0}, []types.CultureTreeHistory{originCultura}}\n\ttree = append(tree, originBase)\n\tbase := 0\n\tcul := 0\n\tloc := 0\n\tfor i := 1; i <= len(chronicle)-1; i++ {\n\t\tswitch chronicle[i].Event {\n\t\tcase 2:\n\t\t\ttree[base].Cultures[cul].LocalCultures[loc].AlphaOmega[1] = i + 1\n\t\t\ttree[base].Cultures[cul].LocalCultures = append(tree[base].Cultures[cul].LocalCultures, types.LocalCultureTreeHistory{chronicle[i].LocalCulture, [2]int{i + 1, 0}})\n\t\t\tloc++\n\t\t\tbreak\n\t\tcase 3:\n\t\t\ttree[base].Cultures[cul].LocalCultures[loc].AlphaOmega[1] = i + 1\n\t\t\ttree[base].Cultures[cul].AlphaOmega[1] = i + 1\n\t\t\ttree[base].Cultures = append(tree[base].Cultures, types.CultureTreeHistory{chronicle[i].Culture, [2]int{i + 1, 0}, []types.LocalCultureTreeHistory{{chronicle[0].LocalCulture, [2]int{i + 1, 0}}}})\n\t\t\tloc = 0\n\t\t\tcul++\n\t\t\tbreak\n\t\tcase 4:\n\t\t\ttree[base].Cultures[cul].LocalCultures[loc].AlphaOmega[1] = i + 1\n\t\t\ttree[base].Cultures[cul].AlphaOmega[1] = i + 1\n\t\t\ttree[base].AlphaOmega[1] = i + 1\n\t\t\ttree = append(tree, types.BaseCultureTreeHistory{chronicle[i].BaseCulture, [2]int{i + 1, 0}, []types.CultureTreeHistory{types.CultureTreeHistory{chronicle[i].Culture, [2]int{i + 1, 0}, []types.LocalCultureTreeHistory{{chronicle[0].LocalCulture, [2]int{i + 1, 0}}}}}})\n\t\t\tloc = 0\n\t\t\tcul = 0\n\t\t\tbase++\n\t\t\tbreak\n\t\tdefault:\n\t\t}\n\t}\n\treturn tree\n}", "title": "" }, { "docid": "4f1c9e243737f89562ff96a444f36491", "score": "0.42189953", "text": "func pop_level(){\nif text_info[cur_state.repl_field].text_link<max_texts{/* link to a continuation */\ncur_state.repl_field= text_info[cur_state.repl_field].text_link/* stay on the same level */\ncur_state.byte_field= text_info[cur_state.repl_field].token\nreturn\n}\n\nif len(stack)> 0{\ncur_state= stack[len(stack)-1]\nstack= stack[:len(stack)-1]\n}\n}", "title": "" }, { "docid": "439234af7b5bec85afbb26a52e0b6602", "score": "0.4216936", "text": "func d7getBranches(node *d7nodeT, branch *d7branchT, parVars *d7partitionVarsT) {\n\t// Load the branch buffer\n\tfor index := 0; index < d7maxNodes; index++ {\n\t\tparVars.branchBuf[index] = node.branch[index]\n\t}\n\tparVars.branchBuf[d7maxNodes] = *branch\n\tparVars.branchCount = d7maxNodes + 1\n\n\t// Calculate rect containing all in the set\n\tparVars.coverSplit = parVars.branchBuf[0].rect\n\tfor index := 1; index < d7maxNodes+1; index++ {\n\t\tparVars.coverSplit = d7combineRect(&parVars.coverSplit, &parVars.branchBuf[index].rect)\n\t}\n\tparVars.coverSplitArea = d7calcRectVolume(&parVars.coverSplit)\n}", "title": "" }, { "docid": "860be3eb747230ab65bbb9e3caecc509", "score": "0.42140663", "text": "func Wordmap(word string) {\n\n\tlistOfLines := reuse.ReadLineByLineFromFile(\"iq/text.dat\")\n\n\t// map of word\n\tmapW := make(map[string][]structLoc)\n\n\tfor i, line := range listOfLines {\n\n\t\tpattern := \"[\\\\/\\\\:\\\\,\\\\.\\\\s]+\"\n\t\tlistOfwords := reuse.Tokenize(line,pattern)\n\n\t\tfor _, word := range listOfwords {\n\t\t\tindices := reuse.GetColPos(line, word)\n\n\t\t\tif mapW[word] == nil {\n\t\t\t\tarrStructLoc := make([]structLoc, 0)\n\t\t\t\tarrStructLoc = addToArrStructLoc(i, indices, arrStructLoc)\n\t\t\t\tmapW[word] = arrStructLoc\n\t\t\t} else {\n\t\t\t\tarrStructLoc := mapW[word]\n\t\t\t\tarrStructLoc = addToArrStructLoc(i, indices, arrStructLoc)\n\t\t\t\tmapW[word] = arrStructLoc\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(mapW[word])\n}", "title": "" }, { "docid": "931ff2f9987bf22ea9ac8917e52b1ec0", "score": "0.42134", "text": "func buildPrefixTree(byteFrequencies *dictionary.Dictionary) *huffmanTreeNode {\n\ttree := new(priorityqueue.PriorityQueue)\n\tkeys := byteFrequencies.Keys()\n\n\tfor i := 0; i < keys.Size(); i++ {\n\t\tbyt := keys.MustGet(i)\n\t\tfrequency, _ := byteFrequencies.Get(byt)\n\n\t\ttree.Enqueue(frequency.(int), &huffmanTreeNode{frequency: frequency.(int), value: byt.(byte)})\n\t}\n\n\tfor tree.Size() > 1 {\n\t\taPrio, a := tree.Dequeue()\n\t\tbPrio, b := tree.Dequeue()\n\n\t\tnewPrio := aPrio + bPrio\n\n\t\tnode := &huffmanTreeNode{frequency: newPrio, left: a.(*huffmanTreeNode), right: b.(*huffmanTreeNode)}\n\n\t\ttree.Enqueue(newPrio, node)\n\t}\n\n\t_, root := tree.Dequeue()\n\n\treturn root.(*huffmanTreeNode)\n}", "title": "" }, { "docid": "15d1f52475e09a241ec4cd6ff9db3dbc", "score": "0.4206063", "text": "func PostOrderTraversalIter(root *node) string {\n\tvar reverse []node\n\tvar stack []node\n\tstack = append(stack, *root)\n\tfor len(stack) != 0 {\n\t\tnode := stack[len(stack)-1]\n\t\tstack = stack[:len(stack)-1]\n\t\treverse = append(reverse, node)\n\n\t\tif node.left != nil {\n\t\t\tstack = append(stack, *node.left)\n\t\t}\n\n\t\tif node.right != nil {\n\t\t\tstack = append(stack, *node.right)\n\t\t}\n\t}\n\ts := \" \"\n\tfor i := range reverse {\n\t\ts += fmt.Sprintf(\"%v \", reverse[len(reverse)-1-i].Data)\n\t}\n\treturn \"[\" + s + \"]\"\n}", "title": "" }, { "docid": "bbc0c9ff460bd44d1cc74825021d3023", "score": "0.42050597", "text": "func PrintSet(index int){\n\tset:=table[index]\n\tPrintUnicode(set.start,set.cnt)\n\tfmt.Printf(\"#%3d %4X~%4X %s %s\\n\",index,set.start,set.end(),set.key,set.desc)\n}", "title": "" } ]
321aecf3fbcf0cc2c781c1efc8fecb09
NewIntegrationsPager returns a new IntegrationsPager instance.
[ { "docid": "57be70c831fb919cd65a1bac3cfd7e88", "score": "0.8561445", "text": "func (eventNotifications *EventNotificationsV1) NewIntegrationsPager(options *ListIntegrationsOptions) (pager *IntegrationsPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListIntegrationsOptions = *options\n\tpager = &IntegrationsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: eventNotifications,\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "541f4549d529aeedaadb2cc9af6975e4", "score": "0.602224", "text": "func (eventNotifications *EventNotificationsV1) NewSubscriptionsPager(options *ListSubscriptionsOptions) (pager *SubscriptionsPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListSubscriptionsOptions = *options\n\tpager = &SubscriptionsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: eventNotifications,\n\t}\n\treturn\n}", "title": "" }, { "docid": "86c8b2dfa86284f020266ed7e3927c31", "score": "0.58987075", "text": "func (secretsManager *SecretsManagerV2) NewConfigurationsPager(options *ListConfigurationsOptions) (pager *ConfigurationsPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListConfigurationsOptions = *options\n\tpager = &ConfigurationsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: secretsManager,\n\t}\n\treturn\n}", "title": "" }, { "docid": "8dc98d5036e46b6c71a4e6fafa0c9bc0", "score": "0.5864579", "text": "func NewPager(r *Reader) *Pager {\n\tvar name string\n\tif r == nil || r.name == nil || len(*r.name) == 0 {\n\t\tname = \"Pager\"\n\t} else {\n\t\tname = \"Pager \" + *r.name\n\t}\n\treturn &Pager{\n\t\treader: r,\n\t\tquit: false,\n\t\tShowLineNumbers: true,\n\t\tShowStatusBar: true,\n\t\tDeInit: true,\n\t\tSideScrollAmount: 16,\n\t\tScrollLeftHint: twin.NewCell('<', twin.StyleDefault.WithAttr(twin.AttrReverse)),\n\t\tScrollRightHint: twin.NewCell('>', twin.StyleDefault.WithAttr(twin.AttrReverse)),\n\t\tscrollPosition: newScrollPosition(name),\n\t}\n}", "title": "" }, { "docid": "84d0ae94d350a2a3521fb25665998eb4", "score": "0.58448356", "text": "func NewPager(page, size int) *Pager {\n\treturn &Pager{p: page, s: size}\n}", "title": "" }, { "docid": "e76817cf6f2f28ec959417093d72d7dd", "score": "0.5718827", "text": "func (project *ProjectV1) NewProjectsPager(options *ListProjectsOptions) (pager *ProjectsPager, err error) {\n\tif options.Start != nil && *options.Start != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.Start' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListProjectsOptions = *options\n\tpager = &ProjectsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: project,\n\t}\n\treturn\n}", "title": "" }, { "docid": "1ff7cc4e7599ae8e3b23689edcf7fe57", "score": "0.5692179", "text": "func (eventNotifications *EventNotificationsV1) NewDestinationsPager(options *ListDestinationsOptions) (pager *DestinationsPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListDestinationsOptions = *options\n\tpager = &DestinationsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: eventNotifications,\n\t}\n\treturn\n}", "title": "" }, { "docid": "c59b7db48c68e8632da1434288ed4d9d", "score": "0.5620897", "text": "func NewPager(recordsTotal int, recordsLimit int, pagesNumber int, pagesNumbers int, url string) *Pager {\n\tpager := &Pager{}\n\tpager.Records.Total = recordsTotal\n\tpager.Records.Limit = recordsLimit\n\tpager.Pages.Number = pagesNumber\n\tpager.URL = url\n\tif pager.Records.Total > 0 {\n\t\tpager.initPagesTotal()\n\t\tpager.initRecordsOffset()\n\t\tpager.initRecordsFrom()\n\t\tpager.initRecordsTo()\n\t\tpager.initPagesFirst()\n\t\tpager.initPagesPrevious()\n\t\tpager.initPagesNumbers(pagesNumbers)\n\t\tpager.initPagesNext()\n\t\tpager.initPagesLast()\n\t}\n\treturn pager\n}", "title": "" }, { "docid": "88a947b87c2671372b4e77e83ffd3be2", "score": "0.54898936", "text": "func newPager() *pager {\n\treturn &pager{\n\t\tpageMap: make(map[int]page),\n\t\tpagesize: 500,\n\t}\n}", "title": "" }, { "docid": "d9ceb0fb7d027b46b2fc6a90c6978c58", "score": "0.5423871", "text": "func (enterpriseManagement *EnterpriseManagementV1) NewAccountsPager(options *ListAccountsOptions) (pager *AccountsPager, err error) {\n\tif options.NextDocid != nil && *options.NextDocid != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.NextDocid' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListAccountsOptions = *options\n\tpager = &AccountsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: enterpriseManagement,\n\t}\n\treturn\n}", "title": "" }, { "docid": "f66f5f6e16e09b16afa00dd10b86c6bb", "score": "0.54143536", "text": "func (eventNotifications *EventNotificationsV1) NewTagsSubscriptionPager(options *ListTagsSubscriptionOptions) (pager *TagsSubscriptionPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListTagsSubscriptionOptions = *options\n\tpager = &TagsSubscriptionPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: eventNotifications,\n\t}\n\treturn\n}", "title": "" }, { "docid": "baf321a5e92fedc4823d190f23c29714", "score": "0.53426385", "text": "func NewPagination(page int32, count int32) *Pagination {\n\tvar p, c int32\n\tif page == 0 {\n\t\tp = defaultPage\n\t} else if page > 0 {\n\t\tp = page\n\t}\n\n\tif count == 0 {\n\t\tc = DefaultCount\n\t} else if count > 0 {\n\t\tc = count\n\t} else if count < 0 {\n\t\tc = limitPage\n\t}\n\n\tpagination := &Pagination{\n\t\tCurrentPage: p,\n\t\tPageSize: c,\n\t\tTotalResult: 0,\n\t\tTotalPage: 0,\n\t\tHasPagination: c > 0,\n\t}\n\n\treturn pagination\n}", "title": "" }, { "docid": "aca5ed29941b4cd5d22c69bf664257ff", "score": "0.5333088", "text": "func (eventNotifications *EventNotificationsV1) NewSourcesPager(options *ListSourcesOptions) (pager *SourcesPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListSourcesOptions = *options\n\tpager = &SourcesPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: eventNotifications,\n\t}\n\treturn\n}", "title": "" }, { "docid": "5123bbde5bb46161e2f20d4013d137d4", "score": "0.5300644", "text": "func (secretsManager *SecretsManagerV2) NewSecretsPager(options *ListSecretsOptions) (pager *SecretsPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListSecretsOptions = *options\n\tpager = &SecretsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: secretsManager,\n\t}\n\treturn\n}", "title": "" }, { "docid": "b87befb65ec7c40799dc10c049f74f2b", "score": "0.52278316", "text": "func NewPaginator(req *http.Request, per int, nums interface{}) *Paginator {\n\tp := Paginator{}\n\tp.Request = req\n\tif per <= 0 {\n\t\tper = 10\n\t}\n\tp.PerPageNums = per\n\tp.SetNums(nums)\n\treturn &p\n}", "title": "" }, { "docid": "6c51ae1de770ec9ef048f4340ffe49fd", "score": "0.52202785", "text": "func NewPagination() *Pagination {\n\tthis := Pagination{}\n\tvar limit float32 = 25\n\tthis.Limit = &limit\n\tvar order string = \"desc\"\n\tthis.Order = &order\n\treturn &this\n}", "title": "" }, { "docid": "f910cbea891b9ed6c8965df876938423", "score": "0.52154666", "text": "func (enterpriseManagement *EnterpriseManagementV1) NewEnterprisesPager(options *ListEnterprisesOptions) (pager *EnterprisesPager, err error) {\n\tif options.NextDocid != nil && *options.NextDocid != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.NextDocid' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListEnterprisesOptions = *options\n\tpager = &EnterprisesPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: enterpriseManagement,\n\t}\n\treturn\n}", "title": "" }, { "docid": "edaba273e1fd57c5bbbfaffe6f079272", "score": "0.5166587", "text": "func NewPaging(minlimit, maxlimit, def int, params *PagingParams) *Paging {\n\tpaging := &Paging{\n\t\tMinLimit: minlimit,\n\t\tMaxLimit: maxlimit,\n\t\tDefaultLimit: def,\n\t\tParams: params,\n\t}\n\tpaging.SetLimit(def)\n\treturn paging\n}", "title": "" }, { "docid": "a453d2b546f1cdc9e12355d59008e854", "score": "0.51501256", "text": "func New(log log.Logger, c *Config) (integrations.Integration, error) {\n\tdsn, err := c.getDataSourceNames()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\te := exporter.NewExporter(\n\t\tdsn,\n\t\tlog,\n\t\texporter.DisableDefaultMetrics(c.DisableDefaultMetrics),\n\t\texporter.WithUserQueriesPath(c.QueryPath),\n\t\texporter.DisableSettingsMetrics(c.DisableSettingsMetrics),\n\t\texporter.AutoDiscoverDatabases(c.AutodiscoverDatabases),\n\t\texporter.ExcludeDatabases(strings.Join(c.ExcludeDatabases, \",\")),\n\t\texporter.IncludeDatabases(strings.Join(c.IncludeDatabases, \",\")),\n\t\texporter.MetricPrefix(\"pg\"),\n\t)\n\n\treturn integrations.NewCollectorIntegration(c.Name(), integrations.WithCollectors(e)), nil\n}", "title": "" }, { "docid": "bb73e86310c1630182a0d917ff14e3d4", "score": "0.5138168", "text": "func New(numberOfItems, itemsPerPage, currentPage int) *Pagination {\n\tif currentPage == 0 {\n\t\tcurrentPage = 1\n\t}\n\n\tn := int(math.Ceil(float64(numberOfItems) / float64(itemsPerPage)))\n\tif currentPage > n {\n\t\tcurrentPage = n\n\t}\n\n\treturn &Pagination{\n\t\titemsPerPage: itemsPerPage,\n\t\tnumberOfItems: numberOfItems,\n\t\tcurrentPage: currentPage,\n\t}\n}", "title": "" }, { "docid": "38a5f77e65e53128e7bdac50545574ae", "score": "0.51301205", "text": "func (eventNotifications *EventNotificationsV1) NewTopicsPager(options *ListTopicsOptions) (pager *TopicsPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListTopicsOptions = *options\n\tpager = &TopicsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: eventNotifications,\n\t}\n\treturn\n}", "title": "" }, { "docid": "48ee05c80902a53b4e42650fbf364aa8", "score": "0.51121277", "text": "func New(numberOfItems, itemsPerPage, currentPage int) *Paginator {\n\tif currentPage == 0 {\n\t\tcurrentPage = 1\n\t}\n\n\tn := int(math.Ceil(float64(numberOfItems) / float64(itemsPerPage)))\n\tif currentPage > n {\n\t\tcurrentPage = n\n\t}\n\n\treturn &Paginator{\n\t\titemsPerPage: itemsPerPage,\n\t\tnumberOfItems: numberOfItems,\n\t\tcurrentPage: currentPage,\n\t}\n}", "title": "" }, { "docid": "471435b95da99a90d0f39d0b4ab53a7d", "score": "0.50995207", "text": "func (client *ReplicationsClient) NewListPager(resourceGroupName string, registryName string, options *ReplicationsClientListOptions) *runtime.Pager[ReplicationsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ReplicationsClientListResponse]{\n\t\tMore: func(page ReplicationsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ReplicationsClientListResponse) (ReplicationsClientListResponse, error) {\n\t\t\tctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, \"ReplicationsClient.NewListPager\")\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, registryName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ReplicationsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ReplicationsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ReplicationsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t\tTracer: client.internal.Tracer(),\n\t})\n}", "title": "" }, { "docid": "ad23ca1294afe14dfe3f60084e96562b", "score": "0.50771177", "text": "func (c *Config) NewIntegration(logger log.Logger) (integrations.Integration, error) {\n\treturn New(logger, c)\n}", "title": "" }, { "docid": "6dadd03895a058aa07b370bbd39ee9b9", "score": "0.5045213", "text": "func (enterpriseManagement *EnterpriseManagementV1) NewAccountGroupsPager(options *ListAccountGroupsOptions) (pager *AccountGroupsPager, err error) {\n\tif options.NextDocid != nil && *options.NextDocid != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.NextDocid' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListAccountGroupsOptions = *options\n\tpager = &AccountGroupsPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: enterpriseManagement,\n\t}\n\treturn\n}", "title": "" }, { "docid": "01e38352a822fb0fac43b43715a5e002", "score": "0.5029473", "text": "func (pager *IntegrationsPager) GetNext() (page []IntegrationListItem, err error) {\n\treturn pager.GetNextWithContext(context.Background())\n}", "title": "" }, { "docid": "af72f539e31a22a420f6ce2baf2a4b97", "score": "0.50026774", "text": "func NewPagination(list interface{}, total int, pageSize int, pageNumber int) (p *Pagination, err error) {\n\tif pageSize <= 0 {\n\t\treturn nil, errors.New(\"PageSize Should Not Less than 0\")\n\t}\n\tif pageNumber <= 0 {\n\t\treturn nil, errors.New(\"PageNumber Should Not Less than 0\")\n\t}\n\n\tp = &Pagination{list, total, pageSize, pageNumber, false, false}\n\n\tp.IsFirst = p.isFirst()\n\tp.IsLast = p.isLast()\n\n\tif p.PageNumber > p.TotalPages() {\n\t\tp.PageNumber = p.TotalPages()\n\t}\n\treturn p, nil\n}", "title": "" }, { "docid": "f8823246eeb5f16778871bfb65855162", "score": "0.49768364", "text": "func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error) {\n\treturn New(l, c)\n}", "title": "" }, { "docid": "9b40d6c89dfa597231448fc47660ba7e", "score": "0.49638945", "text": "func (client *ScriptExecutionsClient) NewListPager(resourceGroupName string, privateCloudName string, options *ScriptExecutionsClientListOptions) *runtime.Pager[ScriptExecutionsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ScriptExecutionsClientListResponse]{\n\t\tMore: func(page ScriptExecutionsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ScriptExecutionsClientListResponse) (ScriptExecutionsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, privateCloudName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ScriptExecutionsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ScriptExecutionsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ScriptExecutionsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "a29ef42b7bf46d1f8e36e5dab85a0a5c", "score": "0.4930617", "text": "func (secretsManager *SecretsManagerV2) NewSecretLocksPager(options *ListSecretLocksOptions) (pager *SecretLocksPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListSecretLocksOptions = *options\n\tpager = &SecretLocksPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: secretsManager,\n\t}\n\treturn\n}", "title": "" }, { "docid": "43a429b7123ebc33b6f434ab3ab0b277", "score": "0.48875833", "text": "func (secretsManager *SecretsManagerV2) NewSecretsLocksPager(options *ListSecretsLocksOptions) (pager *SecretsLocksPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListSecretsLocksOptions = *options\n\tpager = &SecretsLocksPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: secretsManager,\n\t}\n\treturn\n}", "title": "" }, { "docid": "7abf3f34a2b7162f647cee19b8b8c0a1", "score": "0.48672464", "text": "func NewPaginator(page, perPage uint) *Pagination {\n\t// Sanitize inputs\n\tif page <= 0 {\n\t\tpage = 1\n\t}\n\tif perPage <= 0 {\n\t\tperPage = DefaultPerPage\n\t}\n\n\t// Return paginator instance\n\treturn &Pagination{\n\t\tPage: page,\n\t\tPerPage: perPage,\n\t\ttotal: 0,\n\t}\n}", "title": "" }, { "docid": "e8a0ef8657bf4f1391e7dce90df522ed", "score": "0.4835995", "text": "func NewIntegration(ctx *pulumi.Context,\n\tname string, args *IntegrationArgs, opts ...pulumi.ResourceOption) (*Integration, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Subdomain == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Subdomain'\")\n\t}\n\tif args.ApiToken != nil {\n\t\targs.ApiToken = pulumi.ToSecret(args.ApiToken).(pulumi.StringPtrInput)\n\t}\n\tsecrets := pulumi.AdditionalSecretOutputs([]string{\n\t\t\"apiToken\",\n\t})\n\topts = append(opts, secrets)\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Integration\n\terr := ctx.RegisterResource(\"datadog:pagerduty/integration:Integration\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "12912c64ee05582062feaf9636bb7dce", "score": "0.47908416", "text": "func (client *WebhooksClient) NewListPager(resourceGroupName string, registryName string, options *WebhooksClientListOptions) *runtime.Pager[WebhooksClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[WebhooksClientListResponse]{\n\t\tMore: func(page WebhooksClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *WebhooksClientListResponse) (WebhooksClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, registryName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn WebhooksClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn WebhooksClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn WebhooksClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "53f3cbc62531175ed6340c199ffb9070", "score": "0.47809392", "text": "func (client *SourceControlConfigurationsClient) NewListPager(resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, options *SourceControlConfigurationsClientListOptions) *runtime.Pager[SourceControlConfigurationsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[SourceControlConfigurationsClientListResponse]{\n\t\tMore: func(page SourceControlConfigurationsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *SourceControlConfigurationsClientListResponse) (SourceControlConfigurationsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn SourceControlConfigurationsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn SourceControlConfigurationsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn SourceControlConfigurationsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "62824156485b2a1f836d9d24925776c5", "score": "0.47739792", "text": "func (client *ReplicationProtectionContainersClient) NewListPager(resourceName string, resourceGroupName string, options *ReplicationProtectionContainersClientListOptions) *runtime.Pager[ReplicationProtectionContainersClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ReplicationProtectionContainersClientListResponse]{\n\t\tMore: func(page ReplicationProtectionContainersClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ReplicationProtectionContainersClientListResponse) (ReplicationProtectionContainersClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceName, resourceGroupName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ReplicationProtectionContainersClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ReplicationProtectionContainersClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ReplicationProtectionContainersClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "0e20dd75aaae9531876f48df9a5b5d30", "score": "0.47499338", "text": "func NewInjector(values ...interface{}) *Injector {\n\tinj := &Injector{\n\t\tdata: make(map[string]reflect.Value),\n\t}\n\tinj.Set(values...)\n\treturn inj\n}", "title": "" }, { "docid": "10d059048b690f7ee7674acfd3d7f2fa", "score": "0.47429493", "text": "func (client *AFDOriginsClient) NewListByOriginGroupPager(resourceGroupName string, profileName string, originGroupName string, options *AFDOriginsClientListByOriginGroupOptions) *runtime.Pager[AFDOriginsClientListByOriginGroupResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[AFDOriginsClientListByOriginGroupResponse]{\n\t\tMore: func(page AFDOriginsClientListByOriginGroupResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *AFDOriginsClientListByOriginGroupResponse) (AFDOriginsClientListByOriginGroupResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listByOriginGroupCreateRequest(ctx, resourceGroupName, profileName, originGroupName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn AFDOriginsClientListByOriginGroupResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn AFDOriginsClientListByOriginGroupResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn AFDOriginsClientListByOriginGroupResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listByOriginGroupHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "6ef048d8b7e95ff46d93a5faf1b3361f", "score": "0.47381517", "text": "func (ac *Client) NewListSubscriptionsPager(topicName string, options *ListSubscriptionsOptions) *runtime.Pager[ListSubscriptionsResponse] {\n\tvar pageSize int32\n\n\tif options != nil {\n\t\tpageSize = options.MaxPageSize\n\t}\n\n\tep := &entityPager[atom.SubscriptionFeed, atom.SubscriptionEnvelope, SubscriptionPropertiesItem]{\n\t\tconvertFn: func(env *atom.SubscriptionEnvelope) (*SubscriptionPropertiesItem, error) {\n\t\t\treturn newSubscriptionItem(env, topicName)\n\t\t},\n\t\tbaseFragment: fmt.Sprintf(\"/%s/Subscriptions?\", topicName),\n\t\tmaxPageSize: pageSize,\n\t\tem: ac.em,\n\t}\n\n\treturn runtime.NewPager(runtime.PagingHandler[ListSubscriptionsResponse]{\n\t\tMore: func(ltr ListSubscriptionsResponse) bool {\n\t\t\treturn ep.More()\n\t\t},\n\t\tFetcher: func(ctx context.Context, t *ListSubscriptionsResponse) (ListSubscriptionsResponse, error) {\n\t\t\titems, err := ep.Fetcher(ctx)\n\n\t\t\tif err != nil {\n\t\t\t\treturn ListSubscriptionsResponse{}, err\n\t\t\t}\n\n\t\t\treturn ListSubscriptionsResponse{\n\t\t\t\tSubscriptions: items,\n\t\t\t}, nil\n\t\t},\n\t})\n}", "title": "" }, { "docid": "1b7ee93b617f916a2722dc1b32c88e53", "score": "0.47327673", "text": "func (client *Client) NewListPager(resourceGroupName string, resourceProviderNamespace string, resourceType string, resourceName string, options *ClientListOptions) *runtime.Pager[ClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ClientListResponse]{\n\t\tMore: func(page ClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ClientListResponse) (ClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, resourceType, resourceName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "df9b4a078f8382440aea5196c7f1a961", "score": "0.4724534", "text": "func (pager *IntegrationsPager) GetAll() (allItems []IntegrationListItem, err error) {\n\treturn pager.GetAllWithContext(context.Background())\n}", "title": "" }, { "docid": "9ba79dbb709ba26f8df764b2027e223a", "score": "0.47176343", "text": "func (client *AgentsClient) NewListPager(resourceGroupName string, storageMoverName string, options *AgentsClientListOptions) *runtime.Pager[AgentsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[AgentsClientListResponse]{\n\t\tMore: func(page AgentsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *AgentsClientListResponse) (AgentsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, storageMoverName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn AgentsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn AgentsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn AgentsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "577807d9b52236b11169dca493ceb410", "score": "0.4710872", "text": "func (client *IotSecuritySolutionClient) NewListBySubscriptionPager(options *IotSecuritySolutionClientListBySubscriptionOptions) *runtime.Pager[IotSecuritySolutionClientListBySubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[IotSecuritySolutionClientListBySubscriptionResponse]{\n\t\tMore: func(page IotSecuritySolutionClientListBySubscriptionResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *IotSecuritySolutionClientListBySubscriptionResponse) (IotSecuritySolutionClientListBySubscriptionResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listBySubscriptionCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn IotSecuritySolutionClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn IotSecuritySolutionClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn IotSecuritySolutionClientListBySubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listBySubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "4888be242106a8fd3c51ce940f022105", "score": "0.46990427", "text": "func (client *ConnectedEnvironmentsClient) NewListBySubscriptionPager(options *ConnectedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ConnectedEnvironmentsClientListBySubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ConnectedEnvironmentsClientListBySubscriptionResponse]{\n\t\tMore: func(page ConnectedEnvironmentsClientListBySubscriptionResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ConnectedEnvironmentsClientListBySubscriptionResponse) (ConnectedEnvironmentsClientListBySubscriptionResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listBySubscriptionCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ConnectedEnvironmentsClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.pl.Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ConnectedEnvironmentsClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ConnectedEnvironmentsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listBySubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "b06e32fc81b8379b3247d4604a40138b", "score": "0.46986705", "text": "func (client *MachineExtensionsClient) NewListPager(resourceGroupName string, name string, options *MachineExtensionsClientListOptions) *runtime.Pager[MachineExtensionsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[MachineExtensionsClientListResponse]{\n\t\tMore: func(page MachineExtensionsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *MachineExtensionsClientListResponse) (MachineExtensionsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, name, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn MachineExtensionsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn MachineExtensionsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn MachineExtensionsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "f2eb2520da4bc81f5b869db367ad0daa", "score": "0.46938026", "text": "func (client *LocalRulestacksClient) NewListBySubscriptionPager(options *LocalRulestacksClientListBySubscriptionOptions) *runtime.Pager[LocalRulestacksClientListBySubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[LocalRulestacksClientListBySubscriptionResponse]{\n\t\tMore: func(page LocalRulestacksClientListBySubscriptionResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *LocalRulestacksClientListBySubscriptionResponse) (LocalRulestacksClientListBySubscriptionResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listBySubscriptionCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn LocalRulestacksClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn LocalRulestacksClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn LocalRulestacksClientListBySubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listBySubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "cd6ac516fcc0707ce15c08ad61e38737", "score": "0.46536094", "text": "func NewPaginator(iter Iterator, tokenizer Tokenizer, filters []Filter,\n\topts structs.QueryOptions, appendFunc func(interface{}) error) (*Paginator, error) {\n\n\tvar evaluator *bexpr.Evaluator\n\tvar err error\n\n\tif opts.Filter != \"\" {\n\t\tevaluator, err = bexpr.CreateEvaluator(opts.Filter)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read filter expression: %v\", err)\n\t\t}\n\t\tfilters = append(filters, evaluator)\n\t}\n\n\treturn &Paginator{\n\t\titer: iter,\n\t\ttokenizer: tokenizer,\n\t\tfilters: filters,\n\t\tperPage: opts.PerPage,\n\t\tseekingToken: opts.NextToken,\n\t\treverse: opts.Reverse,\n\t\tnextTokenFound: opts.NextToken == \"\",\n\t\tappendFunc: appendFunc,\n\t}, nil\n}", "title": "" }, { "docid": "6975b703339c060454266a4230139252", "score": "0.46193498", "text": "func (secretsManager *SecretsManagerV2) NewSecretVersionLocksPager(options *ListSecretVersionLocksOptions) (pager *SecretVersionLocksPager, err error) {\n\tif options.Offset != nil && *options.Offset != 0 {\n\t\terr = fmt.Errorf(\"the 'options.Offset' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListSecretVersionLocksOptions = *options\n\tpager = &SecretVersionLocksPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: secretsManager,\n\t}\n\treturn\n}", "title": "" }, { "docid": "26a69c16db5d785fae6d811c663cf171", "score": "0.4611573", "text": "func (client *ServersClient) NewListBySubscriptionPager(options *ServersClientListBySubscriptionOptions) *runtime.Pager[ServersClientListBySubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ServersClientListBySubscriptionResponse]{\n\t\tMore: func(page ServersClientListBySubscriptionResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ServersClientListBySubscriptionResponse) (ServersClientListBySubscriptionResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listBySubscriptionCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ServersClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ServersClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ServersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listBySubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "451b40a43f3d4597f3bde0044d551541", "score": "0.46038178", "text": "func (client *RegistrationDefinitionsClient) NewListPager(scope string, options *RegistrationDefinitionsClientListOptions) *runtime.Pager[RegistrationDefinitionsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[RegistrationDefinitionsClientListResponse]{\n\t\tMore: func(page RegistrationDefinitionsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *RegistrationDefinitionsClientListResponse) (RegistrationDefinitionsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, scope, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn RegistrationDefinitionsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn RegistrationDefinitionsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn RegistrationDefinitionsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "dca3fd0552c936ca172895f394650fff", "score": "0.45976362", "text": "func CreatePaginated(p *Page, array interface{}, count ...int) (*Paginated, error) {\n\tresultv := reflect.ValueOf(array)\n\tif resultv.Kind() != reflect.Ptr || resultv.Elem().Kind() != reflect.Slice && resultv.Kind() != reflect.Array {\n\t\treturn nil, fmt.Errorf(\"unable to create Paginated, 'array' arg must be a Slice or Array, %v\", resultv.Kind())\n\t}\n\n\tarr := resultv.Elem()\n\tl := arr.Len()\n\tc := l\n\n\tif len(count) > 0 {\n\t\tc = count[0]\n\t}\n\n\tif p == nil {\n\t\tp = &Page{1, l, nil}\n\t}\n\n\treturn &Paginated{\n\t\tItems: arr.Interface(),\n\t\tPaginatedBase: &PaginatedBase{\n\t\t\tItemsCount: l,\n\t\t\tTotalPages: int(math.Ceil(float64(c) / float64(p.Size))),\n\t\t\tTotalCount: c,\n\t\t\tSize: p.Size,\n\t\t\tPage: p.Page,\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "4b26b2c4c29b6b33aaf759bf178359ea", "score": "0.45876515", "text": "func NewMerger() merger {\n\treturn merger{}\n}", "title": "" }, { "docid": "b86c999eda9ef7febb27c827421e532e", "score": "0.45790923", "text": "func NewPaginator(pageType string) *Paginator {\n\tif pageType == \"number\" {\n\t\treturn &Paginator{\n\t\t\tPageNo: 1,\n\t\t\tNextID: \"\",\n\t\t\tHasNextPage: true,\n\t\t}\n\t}\n\tif pageType == \"cursor\" {\n\t\treturn &Paginator{\n\t\t\tPageNo: 0,\n\t\t\tNextID: \"*\",\n\t\t\tHasNextPage: true,\n\t\t}\n\t}\n\treturn &Paginator{}\n}", "title": "" }, { "docid": "8fa8114cf3aaac977ac75e457778d767", "score": "0.45742646", "text": "func (client *NotebookClient) NewGetNotebooksByWorkspacePager(options *NotebookClientGetNotebooksByWorkspaceOptions) *runtime.Pager[NotebookClientGetNotebooksByWorkspaceResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[NotebookClientGetNotebooksByWorkspaceResponse]{\n\t\tMore: func(page NotebookClientGetNotebooksByWorkspaceResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *NotebookClientGetNotebooksByWorkspaceResponse) (NotebookClientGetNotebooksByWorkspaceResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.getNotebooksByWorkspaceCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn NotebookClientGetNotebooksByWorkspaceResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn NotebookClientGetNotebooksByWorkspaceResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn NotebookClientGetNotebooksByWorkspaceResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.getNotebooksByWorkspaceHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "ea522298f74dd553f33ebe04608b242a", "score": "0.45675838", "text": "func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[CloudServicesClientListResponse]{\n\t\tMore: func(page CloudServicesClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *CloudServicesClientListResponse) (CloudServicesClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn CloudServicesClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.pl.Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn CloudServicesClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn CloudServicesClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "237e1f315197ada759e4d1a25c89b546", "score": "0.4544345", "text": "func NewPagingLinks(basePath string, opts FindOptions, f PagingFilter, num int) *PagingLinks {\n\tu := url.URL{\n\t\tPath: basePath,\n\t}\n\n\tvalues := url.Values{}\n\tfor k, vs := range f.QueryParams() {\n\t\tfor _, v := range vs {\n\t\t\tif v != \"\" {\n\t\t\t\tvalues.Add(k, v)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar self, next, prev string\n\tfor k, vs := range opts.QueryParams() {\n\t\tfor _, v := range vs {\n\t\t\tif v != \"\" {\n\t\t\t\tvalues.Add(k, v)\n\t\t\t}\n\t\t}\n\t}\n\n\tu.RawQuery = values.Encode()\n\tself = u.String()\n\n\tif num >= opts.Limit {\n\t\tnextOffset := opts.Offset + opts.Limit\n\t\tvalues.Set(\"offset\", strconv.Itoa(nextOffset))\n\t\tu.RawQuery = values.Encode()\n\t\tnext = u.String()\n\t}\n\n\tif opts.Offset > 0 {\n\t\tprevOffset := opts.Offset - opts.Limit\n\t\tif prevOffset < 0 {\n\t\t\tprevOffset = 0\n\t\t}\n\t\tvalues.Set(\"offset\", strconv.Itoa(prevOffset))\n\t\tu.RawQuery = values.Encode()\n\t\tprev = u.String()\n\t}\n\n\tlinks := &PagingLinks{\n\t\tPrev: prev,\n\t\tSelf: self,\n\t\tNext: next,\n\t}\n\n\treturn links\n}", "title": "" }, { "docid": "428010c0c403376d67b665de2453a98d", "score": "0.45370936", "text": "func (client *CompliancesClient) NewListPager(scope string, options *CompliancesClientListOptions) *runtime.Pager[CompliancesClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[CompliancesClientListResponse]{\n\t\tMore: func(page CompliancesClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *CompliancesClientListResponse) (CompliancesClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, scope, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn CompliancesClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn CompliancesClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn CompliancesClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "e1df416992c936907a8311b9fd219fcf", "score": "0.45291558", "text": "func NewImpi(numWorkers int) (*Impi, error) {\n\tnewImpi := &Impi{\n\t\tnumWorkers: numWorkers,\n\t\tresultChan: make(chan interface{}, 1024),\n\t\tfilePathsChan: make(chan string),\n\t\tstopChan: make(chan bool),\n\t}\n\n\treturn newImpi, nil\n}", "title": "" }, { "docid": "5352e0dd07d714a61422b2b7cb6570ea", "score": "0.4521855", "text": "func (client *SpatialAnchorsAccountsClient) NewListBySubscriptionPager(options *SpatialAnchorsAccountsClientListBySubscriptionOptions) *runtime.Pager[SpatialAnchorsAccountsClientListBySubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[SpatialAnchorsAccountsClientListBySubscriptionResponse]{\n\t\tMore: func(page SpatialAnchorsAccountsClientListBySubscriptionResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *SpatialAnchorsAccountsClientListBySubscriptionResponse) (SpatialAnchorsAccountsClientListBySubscriptionResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listBySubscriptionCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn SpatialAnchorsAccountsClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn SpatialAnchorsAccountsClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn SpatialAnchorsAccountsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listBySubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "f990ede68fca62f9e62395529050b3f6", "score": "0.45183918", "text": "func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error) {\n\tif err := c.validate(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to validate config: %w\", err)\n\t}\n\n\tt, err := sql_exporter.NewTarget(\n\t\t\"mssqlintegration\",\n\t\t\"\",\n\t\tstring(c.ConnectionString),\n\t\t[]*config.CollectorConfig{\n\t\t\t&collectorConfig,\n\t\t},\n\t\tprometheus.Labels{},\n\t\t&config.GlobalConfig{\n\t\t\tScrapeTimeout: model.Duration(c.Timeout),\n\t\t\tTimeoutOffset: model.Duration(500 * time.Millisecond),\n\t\t\tMaxConns: c.MaxOpenConnections,\n\t\t\tMaxIdleConns: c.MaxIdleConnections,\n\t\t},\n\t)\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create mssql target: %w\", err)\n\t}\n\n\tcol := newTargetCollectorAdapter(t, l)\n\n\treturn integrations.NewCollectorIntegration(\n\t\tc.Name(),\n\t\tintegrations.WithCollectors(col),\n\t), nil\n}", "title": "" }, { "docid": "1256c63b7afaf28f40a3dcb49754254b", "score": "0.45145026", "text": "func New(config config.Config) Plugins {\n\tpkg := Plugins{\n\t\tclient: http.NewClient(config),\n\t\tpager: &http.LinkHeaderPager{},\n\t}\n\n\treturn pkg\n}", "title": "" }, { "docid": "13f07ce74095a234e94a4011706bb546", "score": "0.4512584", "text": "func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ExpressRoutePortsLocationsClientListResponse]{\n\t\tMore: func(page ExpressRoutePortsLocationsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ExpressRoutePortsLocationsClientListResponse) (ExpressRoutePortsLocationsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ExpressRoutePortsLocationsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ExpressRoutePortsLocationsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ExpressRoutePortsLocationsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "4fdbbd985e747bf4ed2cefb8295163a9", "score": "0.4509328", "text": "func New(m marshaler.Type, conf config.IntegrationGCPConfig) (*Integration, error) {\n\tif conf.Marshaler != \"\" {\n\t\tswitch conf.Marshaler {\n\t\tcase \"PROTOBUF\":\n\t\t\tm = marshaler.Protobuf\n\t\tcase \"JSON\":\n\t\t\tm = marshaler.ProtobufJSON\n\t\tcase \"JSON_V3\":\n\t\t\tm = marshaler.JSONV3\n\t\t}\n\t}\n\n\ti := Integration{\n\t\tmarshaler: m,\n\t\tproject: conf.ProjectID,\n\t\ttopic: conf.TopicName,\n\t}\n\n\tvar err error\n\tif conf.CredentialsFile != \"\" {\n\t\ti.jsonCredentialsFile, err = ioutil.ReadFile(conf.CredentialsFile)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"read credentials file error\")\n\t\t}\n\t} else {\n\t\ti.jsonCredentialsFile = []byte(conf.CredentialsFileBytes)\n\t}\n\n\tcreds, err := google.CredentialsFromJSON(context.Background(), i.jsonCredentialsFile, \"https://www.googleapis.com/auth/pubsub\")\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"credentials from json error\")\n\t}\n\ti.client = oauth2.NewClient(context.Background(), creds.TokenSource)\n\n\treturn &i, nil\n}", "title": "" }, { "docid": "8376626af100fbd3f476ed2f23843222", "score": "0.4490099", "text": "func (client *SubscriptionClient) NewListPager(resourceGroupName string, serviceName string, options *SubscriptionClientListOptions) *runtime.Pager[SubscriptionClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[SubscriptionClientListResponse]{\n\t\tMore: func(page SubscriptionClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *SubscriptionClientListResponse) (SubscriptionClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn SubscriptionClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn SubscriptionClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn SubscriptionClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "3b3808374b4dbe7005bdd15c0c606d9d", "score": "0.44828498", "text": "func (client *TablesClient) NewListByWorkspacePager(resourceGroupName string, workspaceName string, options *TablesClientListByWorkspaceOptions) *runtime.Pager[TablesClientListByWorkspaceResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[TablesClientListByWorkspaceResponse]{\n\t\tMore: func(page TablesClientListByWorkspaceResponse) bool {\n\t\t\treturn false\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *TablesClientListByWorkspaceResponse) (TablesClientListByWorkspaceResponse, error) {\n\t\t\treq, err := client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options)\n\t\t\tif err != nil {\n\t\t\t\treturn TablesClientListByWorkspaceResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn TablesClientListByWorkspaceResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn TablesClientListByWorkspaceResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listByWorkspaceHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "26a01295d3627493186d1c85b8a5b778", "score": "0.4439612", "text": "func NewIntegrationEmailsOnPush(ctx *pulumi.Context,\n\tname string, args *IntegrationEmailsOnPushArgs, opts ...pulumi.ResourceOption) (*IntegrationEmailsOnPush, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.Project == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Project'\")\n\t}\n\tif args.Recipients == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'Recipients'\")\n\t}\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource IntegrationEmailsOnPush\n\terr := ctx.RegisterResource(\"gitlab:index/integrationEmailsOnPush:IntegrationEmailsOnPush\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "9ce0e87d17e545364f43936dd9154cac", "score": "0.44285712", "text": "func (client *CassandraClustersClient) NewListBySubscriptionPager(options *CassandraClustersClientListBySubscriptionOptions) *runtime.Pager[CassandraClustersClientListBySubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[CassandraClustersClientListBySubscriptionResponse]{\n\t\tMore: func(page CassandraClustersClientListBySubscriptionResponse) bool {\n\t\t\treturn false\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *CassandraClustersClientListBySubscriptionResponse) (CassandraClustersClientListBySubscriptionResponse, error) {\n\t\t\treq, err := client.listBySubscriptionCreateRequest(ctx, options)\n\t\t\tif err != nil {\n\t\t\t\treturn CassandraClustersClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn CassandraClustersClientListBySubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn CassandraClustersClientListBySubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listBySubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "1531eeeebd50390e250db21d8c9f433f", "score": "0.44237056", "text": "func (client *ManagedInstancesClient) NewListPager(options *ManagedInstancesClientListOptions) *runtime.Pager[ManagedInstancesClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListResponse]{\n\t\tMore: func(page ManagedInstancesClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ManagedInstancesClientListResponse) (ManagedInstancesClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ManagedInstancesClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ManagedInstancesClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ManagedInstancesClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "fbea08911ebed4d0f4d348d680c62354", "score": "0.44078046", "text": "func (client *IPAllocationsClient) NewListPager(options *IPAllocationsClientListOptions) *runtime.Pager[IPAllocationsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[IPAllocationsClientListResponse]{\n\t\tMore: func(page IPAllocationsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *IPAllocationsClientListResponse) (IPAllocationsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn IPAllocationsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn IPAllocationsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn IPAllocationsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "20a4e2dd0a5ff34db976948e073b8bf0", "score": "0.44073522", "text": "func NewPG() (*PGCtrl, error) {\n\treturn &PGCtrl{}, nil\n}", "title": "" }, { "docid": "f5b26811832ca76d873c08e5ad5c6d10", "score": "0.4382108", "text": "func (client *SapMonitorsClient) NewListPager(options *SapMonitorsClientListOptions) *runtime.Pager[SapMonitorsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[SapMonitorsClientListResponse]{\n\t\tMore: func(page SapMonitorsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *SapMonitorsClientListResponse) (SapMonitorsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn SapMonitorsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn SapMonitorsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn SapMonitorsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "a162b3c010598b3f16bbbd191920b218", "score": "0.43687424", "text": "func New(page, pageSize int32) *PaginationRequest {\n\tpr := NewRequest(page, pageSize)\n\n\treturn &pr\n}", "title": "" }, { "docid": "e1412456b4edecf574a92503ff5b683f", "score": "0.43661183", "text": "func NewSplitter(ctx context.Context, pi *PathInfo, chunkCnt int, c HTTPClient) *Splitter {\n\treturn &Splitter{Ctx: ctx, PI: pi, ChunkCnt: chunkCnt, client: c}\n}", "title": "" }, { "docid": "956b79a377304674bfec7ce6da2b85b3", "score": "0.4365338", "text": "func (client *ContainerAppsDiagnosticsClient) NewListDetectorsPager(resourceGroupName string, containerAppName string, options *ContainerAppsDiagnosticsClientListDetectorsOptions) *runtime.Pager[ContainerAppsDiagnosticsClientListDetectorsResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[ContainerAppsDiagnosticsClientListDetectorsResponse]{\n\t\tMore: func(page ContainerAppsDiagnosticsClientListDetectorsResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *ContainerAppsDiagnosticsClientListDetectorsResponse) (ContainerAppsDiagnosticsClientListDetectorsResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listDetectorsCreateRequest(ctx, resourceGroupName, containerAppName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn ContainerAppsDiagnosticsClientListDetectorsResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn ContainerAppsDiagnosticsClientListDetectorsResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn ContainerAppsDiagnosticsClientListDetectorsResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listDetectorsHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "7cf93cd29c8d005f34b963fec3ad0ef3", "score": "0.43629733", "text": "func (client *LiveOutputsClient) NewListPager(resourceGroupName string, accountName string, liveEventName string, options *LiveOutputsClientListOptions) *runtime.Pager[LiveOutputsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[LiveOutputsClientListResponse]{\n\t\tMore: func(page LiveOutputsClientListResponse) bool {\n\t\t\treturn page.ODataNextLink != nil && len(*page.ODataNextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *LiveOutputsClientListResponse) (LiveOutputsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.ODataNextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn LiveOutputsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn LiveOutputsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn LiveOutputsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "43370c438893375cd37799e129f33ee3", "score": "0.43618253", "text": "func New(m marshaler.Type, conf config.IntegrationAMQPConfig) (*Integration, error) {\n\tvar err error\n\ti := Integration{\n\t\tmarshaler: m,\n\t}\n\n\tlog.Info(\"integration/amqp: connecting to amqp broker\")\n\ti.chPool, err = newPool(10, conf.URL)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"new amqp channel pool error\")\n\t}\n\n\ti.eventRoutingKey, err = template.New(\"event\").Parse(conf.EventRoutingKeyTemplate)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"parse event routing-key template error\")\n\t}\n\n\treturn &i, nil\n}", "title": "" }, { "docid": "41cc3dfbef714edbd5e528397bb4a97d", "score": "0.43544817", "text": "func (client *HCRPAssignmentsClient) NewListPager(resourceGroupName string, machineName string, options *HCRPAssignmentsClientListOptions) *runtime.Pager[HCRPAssignmentsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[HCRPAssignmentsClientListResponse]{\n\t\tMore: func(page HCRPAssignmentsClientListResponse) bool {\n\t\t\treturn false\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *HCRPAssignmentsClientListResponse) (HCRPAssignmentsClientListResponse, error) {\n\t\t\treq, err := client.listCreateRequest(ctx, resourceGroupName, machineName, options)\n\t\t\tif err != nil {\n\t\t\t\treturn HCRPAssignmentsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn HCRPAssignmentsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn HCRPAssignmentsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "21d3b539e008f3014c3a04531a733463", "score": "0.43501028", "text": "func (c *ContainerClient) NewQueryItemsPager(query string, partitionKey PartitionKey, o *QueryOptions) *runtime.Pager[QueryItemsResponse] {\n\tcorrelatedActivityId, _ := uuid.New()\n\th := headerOptionsOverride{\n\t\tpartitionKey: &partitionKey,\n\t\tcorrelatedActivityId: &correlatedActivityId,\n\t}\n\n\tqueryOptions := &QueryOptions{}\n\tif o != nil {\n\t\toriginalOptions := *o\n\t\tqueryOptions = &originalOptions\n\t}\n\n\toperationContext := pipelineRequestOptions{\n\t\tresourceType: resourceTypeDocument,\n\t\tresourceAddress: c.link,\n\t\theaderOptionsOverride: &h,\n\t}\n\n\tpath, _ := generatePathForNameBased(resourceTypeDocument, operationContext.resourceAddress, true)\n\n\treturn runtime.NewPager(runtime.PagingHandler[QueryItemsResponse]{\n\t\tMore: func(page QueryItemsResponse) bool {\n\t\t\treturn page.ContinuationToken != \"\"\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *QueryItemsResponse) (QueryItemsResponse, error) {\n\t\t\tif page != nil {\n\t\t\t\tif page.ContinuationToken != \"\" {\n\t\t\t\t\t// Use the previous page continuation if available\n\t\t\t\t\tqueryOptions.ContinuationToken = page.ContinuationToken\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tazResponse, err := c.database.client.sendQueryRequest(\n\t\t\t\tpath,\n\t\t\t\tctx,\n\t\t\t\tquery,\n\t\t\t\tqueryOptions.QueryParameters,\n\t\t\t\toperationContext,\n\t\t\t\tqueryOptions,\n\t\t\t\tnil)\n\n\t\t\tif err != nil {\n\t\t\t\treturn QueryItemsResponse{}, err\n\t\t\t}\n\n\t\t\treturn newQueryResponse(azResponse)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "b317bfaf787af45443444375d0711c0f", "score": "0.43429816", "text": "func NewOperationsPage(cur Operations, getNextPage func(context.Context, Operations) (Operations, error)) OperationsPage {\n\treturn OperationsPage{\n\t\tfn: getNextPage,\n\t\to: cur,\n\t}\n}", "title": "" }, { "docid": "5f9f2ee3252c38bdb89872c3d83b5dcc", "score": "0.4337196", "text": "func NewSliding(maxSize int) *Sliding {\n\treturn &Sliding{\n\t\tmaxSize: maxSize,\n\t\tbatch: make(Batch, maxSize),\n\t}\n}", "title": "" }, { "docid": "30f00e5f166a0b43b71127e66fd1c454", "score": "0.43358037", "text": "func (client *VendorNetworkFunctionsClient) NewListPager(locationName string, vendorName string, options *VendorNetworkFunctionsClientListOptions) *runtime.Pager[VendorNetworkFunctionsClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[VendorNetworkFunctionsClientListResponse]{\n\t\tMore: func(page VendorNetworkFunctionsClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *VendorNetworkFunctionsClientListResponse) (VendorNetworkFunctionsClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, locationName, vendorName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn VendorNetworkFunctionsClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn VendorNetworkFunctionsClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn VendorNetworkFunctionsClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "dcf490b792bafee1c6e70e1048d13201", "score": "0.43321043", "text": "func (client *VirtualMachinesClient) NewListPager(options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListResponse]{\n\t\tMore: func(page VirtualMachinesClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *VirtualMachinesClientListResponse) (VirtualMachinesClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn VirtualMachinesClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn VirtualMachinesClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn VirtualMachinesClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "9a30be2666e12e156a7143e0bb9d0692", "score": "0.43257427", "text": "func (c *Config) NewIntegration(log log.Logger, globals integrations_v2.Globals) (integrations_v2.Integration, error) {\n\tmodules, err := blackbox_exporter.LoadBlackboxConfig(log, c.BlackboxConfigFile, c.BlackboxTargets, &c.BlackboxConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tc.globals = globals\n\tbbh := &blackboxHandler{\n\t\tcfg: c,\n\t\tmodules: modules,\n\t\tlog: log,\n\t}\n\treturn bbh, nil\n}", "title": "" }, { "docid": "90fa2e8ff95534328715a7c588ecccb8", "score": "0.43208483", "text": "func NewPaginatePage(page *Page) *PaginatePage {\n\tvar count int // harus pisan pake reflect?\n\tswitch reflect.TypeOf(page.Data).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(page.Data)\n\t\tcount = s.Len()\n\tdefault:\n\t\tcount = 1\n\t}\n\n\tp := &Paginate{\n\t\tTotal: page.Total,\n\t\tCount: int64(count),\n\t\tPerPage: page.PerPage,\n\t\tCurrentPage: page.Page,\n\t\tTotalPages: page.PageCount,\n\t}\n\tmeta := &PaginateMeta{\n\t\tPagination: p,\n\t}\n\tres := &PaginatePage{\n\t\tMeta: meta,\n\t\tData: page.Data,\n\t}\n\treturn res\n}", "title": "" }, { "docid": "cd6ffbe49c53e86621c8b4cc5db00a13", "score": "0.43185446", "text": "func (client *WCFRelaysClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *WCFRelaysClientListByNamespaceOptions) *runtime.Pager[WCFRelaysClientListByNamespaceResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[WCFRelaysClientListByNamespaceResponse]{\n\t\tMore: func(page WCFRelaysClientListByNamespaceResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *WCFRelaysClientListByNamespaceResponse) (WCFRelaysClientListByNamespaceResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn WCFRelaysClientListByNamespaceResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn WCFRelaysClientListByNamespaceResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn WCFRelaysClientListByNamespaceResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listByNamespaceHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "41f19f25f7311101c2f22314c9ceb0fd", "score": "0.43155333", "text": "func newIntegrals(src image.Image) (*integral, *integral) {\n\tb := src.Bounds()\n\tsrcg, ok := src.(*image.Gray)\n\tif !ok {\n\t\tsrcg = image.NewGray(b)\n\t\tdraw.Draw(srcg, b, src, b.Min, draw.Src)\n\t}\n\n\tm := integral{\n\t\tpix: make([]uint64, b.Max.Y*b.Max.X),\n\t\tstride: b.Max.X,\n\t\trect: b,\n\t}\n\tmSq := integral{\n\t\tpix: make([]uint64, b.Max.Y*b.Max.X),\n\t\tstride: b.Max.X,\n\t\trect: b,\n\t}\n\tfor y := b.Min.Y; y < b.Max.Y; y++ {\n\t\tfor x := b.Min.X; x < b.Max.X; x++ {\n\t\t\tos := (y-b.Min.Y)*srcg.Stride + x - b.Min.X\n\t\t\tom := (y-b.Min.Y)*m.stride + x - b.Min.X\n\t\t\tc := uint64(srcg.Pix[os])\n\t\t\tm.pix[om] = c\n\t\t\tmSq.pix[om] = c * c\n\t\t}\n\t}\n\tm.integrate()\n\tmSq.integrate()\n\treturn &m, &mSq\n}", "title": "" }, { "docid": "0de942ed0a81093fa074f0713d338883", "score": "0.43093446", "text": "func NewPaginationOptions(pageSize int) *PaginationOptions {\n\treturn &PaginationOptions{\n\t\tPageSize: pageSize,\n\t}\n}", "title": "" }, { "docid": "0ab529fd286952efbafceda23df47d7a", "score": "0.43089774", "text": "func NewMessagingInfrastructureLister(indexer cache.Indexer) MessagingInfrastructureLister {\n\treturn &messagingInfrastructureLister{indexer: indexer}\n}", "title": "" }, { "docid": "0ca675c42ddd7ba85e4c436148111d4b", "score": "0.42937228", "text": "func New() Interface {\n\treturn new(impl)\n}", "title": "" }, { "docid": "054d1cfd94abce6cebab857058e838c9", "score": "0.42833692", "text": "func NewIter(iter *gocql.Iter) IterInterface {\n\treturn &Iter{\n\t\titer,\n\t}\n}", "title": "" }, { "docid": "d6357c1fa6cfba594250a823dc10c804", "score": "0.42795846", "text": "func (client *TriggersClient) NewListByShareSubscriptionPager(resourceGroupName string, accountName string, shareSubscriptionName string, options *TriggersClientListByShareSubscriptionOptions) *runtime.Pager[TriggersClientListByShareSubscriptionResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[TriggersClientListByShareSubscriptionResponse]{\n\t\tMore: func(page TriggersClientListByShareSubscriptionResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *TriggersClientListByShareSubscriptionResponse) (TriggersClientListByShareSubscriptionResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listByShareSubscriptionCreateRequest(ctx, resourceGroupName, accountName, shareSubscriptionName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn TriggersClientListByShareSubscriptionResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn TriggersClientListByShareSubscriptionResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn TriggersClientListByShareSubscriptionResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listByShareSubscriptionHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "0515189a8e642cc2a8863becbc7186bb", "score": "0.42750677", "text": "func (c *Client) NewListSettingsPager(selector SettingSelector, options *ListSettingsOptions) *runtime.Pager[ListSettingsPage] {\n\tpagerInternal := c.appConfigClient.NewGetKeyValuesPager(selector.toGeneratedGetKeyValues())\n\treturn runtime.NewPager(runtime.PagingHandler[ListSettingsPage]{\n\t\tMore: func(ListSettingsPage) bool {\n\t\t\treturn pagerInternal.More()\n\t\t},\n\t\tFetcher: func(ctx context.Context, cur *ListSettingsPage) (ListSettingsPage, error) {\n\t\t\tpage, err := pagerInternal.NextPage(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn ListSettingsPage{}, err\n\t\t\t}\n\t\t\treturn fromGeneratedGetSettingsPage(page), nil\n\t\t},\n\t})\n}", "title": "" }, { "docid": "24f7fe6bc7002501a3fffb5cea94acc0", "score": "0.427187", "text": "func (c *Client) NewListRevisionsPager(selector SettingSelector, options *ListRevisionsOptions) *runtime.Pager[ListRevisionsPage] {\n\tpagerInternal := c.appConfigClient.NewGetRevisionsPager(selector.toGeneratedGetRevisions())\n\treturn runtime.NewPager(runtime.PagingHandler[ListRevisionsPage]{\n\t\tMore: func(ListRevisionsPage) bool {\n\t\t\treturn pagerInternal.More()\n\t\t},\n\t\tFetcher: func(ctx context.Context, cur *ListRevisionsPage) (ListRevisionsPage, error) {\n\t\t\tpage, err := pagerInternal.NextPage(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn ListRevisionsPage{}, err\n\t\t\t}\n\t\t\treturn fromGeneratedGetRevisionsPage(page), nil\n\t\t},\n\t})\n}", "title": "" }, { "docid": "1bd3ff45a157563002e7757d2fc487c0", "score": "0.4251059", "text": "func New(opts ...Option) *Interpolator {\n\topts2 := &Options{}\n\tsetOptions(opts, newOptionSetter(opts2))\n\treturn NewWithOptions(opts2)\n}", "title": "" }, { "docid": "94d30bf7789bc48152c19d0236d45e2d", "score": "0.42371938", "text": "func NewMerger(args *Args) *Merger {\n\tm := &Merger{workdir: args.WorkDir, content: make(map[string]bool)}\n\tif args.SkipDocs == \"true\" || args.SkipDocs == \"1\" {\n\t\tm.skipDocs = true\n\t}\n\treturn m\n}", "title": "" }, { "docid": "a5a1c51414a0a51928ee712a0b85e647", "score": "0.42308468", "text": "func New(ctx context.Context, l logger.Logger, migConf migration.Config) (storage.Storage, error) {\n\tl.Infof(\"applying database migrations from %s\", migConf.Path)\n\n\tdb, err := postgres.New(ctx, migConf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &pg{db: db, logger: l}, nil\n}", "title": "" }, { "docid": "a1857ca7dbc8bcad9cd01faa96ac1a0f", "score": "0.4220437", "text": "func NewInterfaceImplementationInjector() *InterfaceImplementationInjector {\n\tresult := &InterfaceImplementationInjector{}\n\n\tresult.visitor = TypeVisitorBuilder{\n\t\tVisitObjectType: result.injectInterfaceImplementationIntoObject,\n\t\tVisitResourceType: result.injectInterfaceImplementationIntoResource,\n\t}.Build()\n\n\treturn result\n}", "title": "" }, { "docid": "259b0253d638111f3291b1523cbd16cc", "score": "0.42148402", "text": "func NewProjects(dbconn *sql.DB, cfg *conf.Config) Projects {\n\treturn &ProjectsPG{dbconn: dbconn, cfg: cfg}\n}", "title": "" }, { "docid": "0aa66e6b20dc0ba9af7e3f5f97d518ed", "score": "0.4207798", "text": "func New() *Aggregator {\n\treturn &Aggregator{}\n}", "title": "" }, { "docid": "586fa72a45c991fdb0807cbe7e882e97", "score": "0.41939455", "text": "func (client *APIClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *APIClientListByTagsOptions) *runtime.Pager[APIClientListByTagsResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[APIClientListByTagsResponse]{\n\t\tMore: func(page APIClientListByTagsResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *APIClientListByTagsResponse) (APIClientListByTagsResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listByTagsCreateRequest(ctx, resourceGroupName, serviceName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn APIClientListByTagsResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn APIClientListByTagsResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn APIClientListByTagsResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listByTagsHandleResponse(resp)\n\t\t},\n\t})\n}", "title": "" }, { "docid": "46ee365d9570d45c5c3b0a83662fdd6c", "score": "0.41854748", "text": "func NewIntegration(ctx *adapters.ServiceContext, genesis InputGenesis, stack *node.Node) *gossip.Service {\n\tgossipCfg := gossip.FakeConfig(1, cachescale.Identity)\n\tcfg := Configs{\n\t\tOpera: gossipCfg,\n\t\tOperaStore: gossip.DefaultStoreConfig(cachescale.Identity),\n\t\tLachesis: abft.DefaultConfig(),\n\t\tLachesisStore: abft.DefaultStoreConfig(cachescale.Identity),\n\t\tVectorClock: vecmt.DefaultConfig(cachescale.Identity),\n\t}\n\n\tengine, dagIndex, gdb, _, _, blockProc := MakeEngine(DBProducer(ctx.Config.DataDir, cachescale.Identity), genesis, cfg)\n\t_ = genesis.Close()\n\n\tvalKeystore := valkeystore.NewDefaultMemKeystore()\n\n\tpubKey := validatorpk.PubKey{\n\t\tRaw: crypto.FromECDSAPub(&ctx.Config.PrivateKey.PublicKey),\n\t\tType: validatorpk.Types.Secp256k1,\n\t}\n\n\t// unlock the key\n\t_ = valKeystore.Add(pubKey, crypto.FromECDSA(ctx.Config.PrivateKey), validatorpk.FakePassword)\n\t_ = valKeystore.Unlock(pubKey, validatorpk.FakePassword)\n\tsigner := valkeystore.NewSigner(valKeystore)\n\n\t// find a genesis validator which corresponds to the key\n\tfor id, v := range gdb.GetEpochState().ValidatorProfiles {\n\t\tif v.PubKey.String() == pubKey.String() {\n\t\t\tgossipCfg.Emitter.Validator.ID = id\n\t\t\tgossipCfg.Emitter.Validator.PubKey = v.PubKey\n\t\t}\n\t}\n\n\tgossipCfg.Emitter.EmitIntervals.Max = 3 * time.Second\n\tgossipCfg.Emitter.EmitIntervals.DoublesignProtection = 0\n\n\tsvc, err := gossip.NewService(stack, gossipCfg, gdb, signer, blockProc, engine, dagIndex)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = engine.Bootstrap(svc.GetConsensusCallbacks())\n\tif err != nil {\n\t\treturn nil\n\t}\n\n\treturn svc\n}", "title": "" } ]
65cde040081262ba467a7b1126111fb4
PlatformPAndroid returns a pointer to PlatformVAndroid
[ { "docid": "0923b4aee62dcb948db0f712efe05819", "score": "0.84075737", "text": "func PlatformPAndroid() *Platform {\n\tv := PlatformVAndroid\n\treturn &v\n}", "title": "" } ]
[ { "docid": "6c2fe3df1ec50b5b25b4b79a4bb9dd7e", "score": "0.7147564", "text": "func ConditionalAccessDevicePlatformPAndroid() *ConditionalAccessDevicePlatform {\n\tv := ConditionalAccessDevicePlatformVAndroid\n\treturn &v\n}", "title": "" }, { "docid": "2c3fb8f24066c8f4f1ab40cf94c3b591", "score": "0.6685025", "text": "func DeviceTypePAndroidForWork() *DeviceType {\n\tv := DeviceTypeVAndroidForWork\n\treturn &v\n}", "title": "" }, { "docid": "7be609fa72aca38dd6e3a8ce148ec194", "score": "0.65732414", "text": "func DeviceTypePAndroid() *DeviceType {\n\tv := DeviceTypeVAndroid\n\treturn &v\n}", "title": "" }, { "docid": "c0760ba0e58e36821672597601e41a72", "score": "0.614859", "text": "func NewAndroidMinimumOperatingSystem()(*AndroidMinimumOperatingSystem) {\n m := &AndroidMinimumOperatingSystem{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "97ed7f840cef5bcba85a76863b2ca03a", "score": "0.6112882", "text": "func DeviceTypePAndroidEnterprise() *DeviceType {\n\tv := DeviceTypeVAndroidEnterprise\n\treturn &v\n}", "title": "" }, { "docid": "257eb8eec148717fa5d4e5ea05bf7f6a", "score": "0.6021646", "text": "func PlatformPWindowsMobile() *Platform {\n\tv := PlatformVWindowsMobile\n\treturn &v\n}", "title": "" }, { "docid": "ba193149a8660ed6029fb818b00d1c65", "score": "0.60169256", "text": "func (s *Service) platform(resID string) (platform string) {\n\tvar (\n\t\terr error\n\t\tios, android bool\n\t\tmobiAPPs []string\n\t)\n\tplatform = _platAll // default value\n\tif mobiAPPs, err = s.pushDao.Platform(ctx, resID); err != nil {\n\t\treturn\n\t}\n\tfor _, value := range mobiAPPs {\n\t\tswitch value {\n\t\tcase _vAndroid:\n\t\t\tandroid = true\n\t\tcase _vAndroidB:\n\t\t\tandroid = true\n\t\tcase _vIPad:\n\t\t\tios = true\n\t\tcase _vIPhone:\n\t\t\tios = true\n\t\tdefault:\n\t\t\tlog.Error(\"ResourceID %d, Limit Wrong Value %s\", resID, value)\n\t\t}\n\t}\n\tif ios && !android {\n\t\treturn _platIOS\n\t}\n\tif !ios && android {\n\t\treturn _platAndroid\n\t}\n\treturn // other case like all or none, just return the default value\n}", "title": "" }, { "docid": "525f3ec1b3fd40a77fd9839ff59d0c5f", "score": "0.6003616", "text": "func PlatformPWindows() *Platform {\n\tv := PlatformVWindows\n\treturn &v\n}", "title": "" }, { "docid": "ad3710db18df8409575083c0f7052655", "score": "0.5960092", "text": "func PlatformPMacOS() *Platform {\n\tv := PlatformVMacOS\n\treturn &v\n}", "title": "" }, { "docid": "a0b91b3c79c8e5a8c53158d0cd3e3344", "score": "0.5935541", "text": "func NewPlatform(tune TuneFlag, cpu CpuFeature) Platform { return hs.NewPlatformInfo(tune, cpu) }", "title": "" }, { "docid": "5e106a4eb03ced80fd672a3876a702e1", "score": "0.5893648", "text": "func NewAndroidManagedAppProtection()(*AndroidManagedAppProtection) {\n m := &AndroidManagedAppProtection{\n TargetedManagedAppProtection: *NewTargetedManagedAppProtection(),\n }\n odataTypeValue := \"#microsoft.graph.androidManagedAppProtection\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "title": "" }, { "docid": "926e5a0bc7bf12d368e2900c317f2547", "score": "0.5884155", "text": "func (r *Container) Platform(ctx context.Context) (Platform, error) {\n\tq := r.q.Select(\"platform\")\n\n\tvar response Platform\n\tq = q.Bind(&response)\n\treturn response, q.Execute(ctx, r.c)\n}", "title": "" }, { "docid": "feecc26aa0f8cf23d4a04018e9b039a8", "score": "0.58550113", "text": "func (user *CurrentUser) Platform() string {\n\tswitch strconv.Itoa(user.applicationID) {\n\tcase os.Getenv(\"GKKKB_ANDROID_APP_ID\"):\n\t\treturn \"gkkkbandroid\"\n\tcase os.Getenv(\"GKKKB_IOS_APP_ID\"):\n\t\treturn \"gkkkbios\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "8f877ebe7cf1f034381e5b6cb4ee328d", "score": "0.584914", "text": "func (r TEnvironmentOnEnvironmentHolder) Platform() TPlatform {\n\treturn CreateTPlatformForPlatform(*r.h.ekara)\n}", "title": "" }, { "docid": "c62dfe057beec1440d91e907d40dad43", "score": "0.5841909", "text": "func PlatformPIOS() *Platform {\n\tv := PlatformVIOS\n\treturn &v\n}", "title": "" }, { "docid": "761b8df182c1bc62d6675a036d42e36e", "score": "0.5792946", "text": "func Platform() (*gcp.Platform, error) {\n\treturn &gcp.Platform{}, nil\n}", "title": "" }, { "docid": "1cd01d84646270baecabe9453f3fb43b", "score": "0.5774301", "text": "func PlatformPUnknown() *Platform {\n\tv := PlatformVUnknown\n\treturn &v\n}", "title": "" }, { "docid": "e4dd2e12816bebf5fe7c5c20ac9e6be0", "score": "0.5771116", "text": "func AndroidForWorkVpnConnectionTypePCheckPointCapsuleVpn() *AndroidForWorkVpnConnectionType {\n\tv := AndroidForWorkVpnConnectionTypeVCheckPointCapsuleVpn\n\treturn &v\n}", "title": "" }, { "docid": "42f1f2dbd4d867f35a070a5b70765650", "score": "0.57700217", "text": "func (m *AndroidLobApp) GetMinimumSupportedOperatingSystem()(AndroidMinimumOperatingSystemable) {\n return m.minimumSupportedOperatingSystem\n}", "title": "" }, { "docid": "7baed8769f0ec8f0cc436bfb586b6594", "score": "0.5759493", "text": "func AndroidForWorkVpnConnectionTypePCitrix() *AndroidForWorkVpnConnectionType {\n\tv := AndroidForWorkVpnConnectionTypeVCitrix\n\treturn &v\n}", "title": "" }, { "docid": "ae7e8a27c7d51204e0bb29552e802262", "score": "0.5691962", "text": "func NewPlatform(ctx context.Context,\n\tparentLogger logger.Logger,\n\tplatformConfiguration *platformconfig.Config,\n\tdefaultNamespace string) (*Platform, error) {\n\tnewPlatform := &Platform{}\n\n\t// create base\n\tnewAbstractPlatform, err := abstract.NewPlatform(parentLogger, newPlatform, platformConfiguration, defaultNamespace)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create an abstract platform\")\n\t}\n\n\t// init platform\n\tnewPlatform.Platform = newAbstractPlatform\n\n\t// create a command runner\n\tif newPlatform.cmdRunner, err = cmdrunner.NewShellRunner(newPlatform.Logger); err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create a command runner\")\n\t}\n\n\tswitch runtime.GOARCH {\n\tcase \"arm64\":\n\t\tnewPlatform.storeImageName = \"gcr.io/iguazio/arm64v8/alpine:3.17\"\n\tcase \"arm\":\n\t\tnewPlatform.storeImageName = \"gcr.io/iguazio/arm32v7/alpine:3.17\"\n\tdefault:\n\t\tnewPlatform.storeImageName = \"gcr.io/iguazio/alpine:3.17\"\n\t}\n\n\tif newPlatform.ContainerBuilder, err = containerimagebuilderpusher.NewDocker(newPlatform.Logger,\n\t\tplatformConfiguration.ContainerBuilderConfiguration); err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create container image builder pusher\")\n\t}\n\n\t// create a docker client\n\tif newPlatform.dockerClient, err = dockerclient.NewShellClient(newPlatform.Logger, nil); err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create a Docker client\")\n\t}\n\n\t// create a local store for configs and stuff\n\tif newPlatform.localStore, err = client.NewStore(parentLogger,\n\t\tnewPlatform,\n\t\tnewPlatform.dockerClient,\n\t\tnewPlatform.storeImageName); err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create a local store\")\n\t}\n\n\t// create projects client\n\tnewPlatform.projectsClient, err = NewProjectsClient(newPlatform, platformConfiguration)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Failed to create projects client\")\n\t}\n\n\t// ignite goroutine to check function container healthiness\n\tif newPlatform.Config.Local.FunctionContainersHealthinessEnabled {\n\t\tnewPlatform.Logger.DebugWithCtx(ctx, \"Igniting container healthiness validator\")\n\t\tgo func(newPlatform *Platform) {\n\t\t\tuptimeTicker := time.NewTicker(newPlatform.Config.Local.FunctionContainersHealthinessInterval)\n\t\t\tdefer uptimeTicker.Stop()\n\t\t\tfor range uptimeTicker.C {\n\t\t\t\tnewPlatform.ValidateFunctionContainersHealthiness(ctx)\n\t\t\t}\n\t\t}(newPlatform)\n\t}\n\treturn newPlatform, nil\n}", "title": "" }, { "docid": "232ef65a2412e2416a53af3edfa0c14c", "score": "0.5684921", "text": "func AndroidForWorkEnrollmentTargetPTargeted() *AndroidForWorkEnrollmentTarget {\n\tv := AndroidForWorkEnrollmentTargetVTargeted\n\treturn &v\n}", "title": "" }, { "docid": "d1c05a4d8ec5f0bc6172c93ca5e7b179", "score": "0.56837213", "text": "func Platform() (*alibabacloud.Platform, error) {\n\tclient, err := NewClient(defaultRegion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tregion, err := selectRegion(client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tclient, err = NewClient(region)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresourceGroup, err := selectResourceGroup(client)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &alibabacloud.Platform{\n\t\tRegion: region,\n\t\tResourceGroupID: resourceGroup,\n\t}, nil\n}", "title": "" }, { "docid": "162c75791642a9961ffc16b41683147a", "score": "0.5673724", "text": "func Platform() (*ovirt.Platform, error) {\n\tp := ovirt.Platform{}\n\n\tvar c *ovirtsdk4.Connection\n\n\tovirtConfig, err := NewConfig()\n\tfor tries := 0; tries < platformValidationMaxTries; tries++ {\n\t\tif err != nil {\n\t\t\tovirtConfig, err = engineSetup()\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Error(errors.Wrap(err, \"oVirt configuration failed\"))\n\t\t\t}\n\t\t}\n\n\t\tif err == nil {\n\t\t\tc, err = ovirtConfig.getValidatedConnection()\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Error(errors.Wrap(err, \"failed to validate oVirt configuration\"))\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif err != nil {\n\t\t// Last error is not nil, we don't have a valid config.\n\t\treturn nil, errors.Wrap(err, \"maximum retries for configuration exhausted\")\n\t}\n\tdefer c.Close()\n\tif err = ovirtConfig.Save(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tclusterName, err := askCluster(c, &p)\n\tif err != nil {\n\t\treturn &p, err\n\t}\n\n\terr = askStorage(c, &p, clusterName)\n\tif err != nil {\n\t\treturn &p, err\n\t}\n\n\terr = askNetwork(c, &p)\n\tif err != nil {\n\t\treturn &p, err\n\t}\n\n\terr = askVNICProfileID(c, &p)\n\tif err != nil {\n\t\treturn &p, err\n\t}\n\n\terr = askVIPs(&p)\n\tif err != nil {\n\t\treturn &p, err\n\t}\n\n\treturn &p, nil\n}", "title": "" }, { "docid": "c5c0a81d7ba34cb52fdadd9991b00e1b", "score": "0.5654496", "text": "func (r *Run) Platform() (*Platform, *Error) {\n\tif r.PlatformData == nil {\n\t\tif len(r.System.Platform) > 0 {\n\t\t\treturn PlatformByID(r.System.Platform)\n\t\t}\n\n\t\treturn nil, nil\n\t}\n\n\treturn toPlatform(r.PlatformData, true), nil\n}", "title": "" }, { "docid": "24e251d74ae242b346e647d12e9490a3", "score": "0.5623775", "text": "func Platform(ic *interop.Context) error {\n\tic.VM.Estack().PushItem(stackitem.NewByteArray([]byte(\"NEO\")))\n\treturn nil\n}", "title": "" }, { "docid": "ed5e55b0df69b4af8d27d0aa484a9995", "score": "0.56235874", "text": "func getPlatform(trackInclude *TrackInclude, terragruntOptions *options.TerragruntOptions) (string, error) {\n\treturn runtime.GOOS, nil\n}", "title": "" }, { "docid": "08386c3c652d59911ae0b4b68d6adaaf", "score": "0.5588899", "text": "func AndroidForWorkEnrollmentTargetPNone() *AndroidForWorkEnrollmentTarget {\n\tv := AndroidForWorkEnrollmentTargetVNone\n\treturn &v\n}", "title": "" }, { "docid": "f213f68bf9f55f0046488cd47af20837", "score": "0.55785596", "text": "func (p Platform) BuildPlatform() api.Build_Platform {\n\tswitch p {\n\tcase PlatformLinuxGlibc:\n\t\treturn api.Build_LINUX_GLIBC\n\tcase PlatformDarwin:\n\t\treturn api.Build_DARWIN\n\tdefault:\n\t\tpanic(fmt.Errorf(\"unknown platform %q\", p))\n\t}\n}", "title": "" }, { "docid": "2e15059da39da6be847ccb5ffaec1308", "score": "0.55716485", "text": "func IsAndroid(plat int8) bool {\n\treturn plat == PlatAndroid || plat == PlatAndroidG\n}", "title": "" }, { "docid": "f5e8d8f2be233545fdb9f3ab65de93fc", "score": "0.5569741", "text": "func NewPlatform(arch byte) *Platform {\n\tspace := byte(0x20)\n\tif arch == PlatformMainframe {\n\t\tspace = byte(0x40)\n\t}\n\tvar order binary.ByteOrder\n\tif arch == PlatformLUWLowOrder {\n\t\torder = binary.LittleEndian\n\t} else {\n\t\torder = binary.BigEndian\n\t}\n\tpl := &Platform{architecture: arch, spaceByte: space, order: order}\n\tCentral.Log.Debugf(\"New platform mainframe=%v(%d)\", pl.IsMainframe(), arch)\n\treturn pl\n}", "title": "" }, { "docid": "b26157fcd28750819644e19c3582cd97", "score": "0.5529464", "text": "func (pa PlatformAvailability) Platform() string {\n\to := cxstring{pa.c.Platform}\n\tdefer o.Dispose()\n\n\treturn o.String()\n}", "title": "" }, { "docid": "c87783dff4e1f1d474e937ffdd5eb23d", "score": "0.55178773", "text": "func (m *AndroidMinimumOperatingSystem) GetV8_1()(*bool) {\n return m.v8_1\n}", "title": "" }, { "docid": "9933475ccf46e987034cd862a804a97e", "score": "0.55071926", "text": "func detectPlatform(c *cli.Context) (string, error) {\n\tUI.Debug(\"Attempting to determine the platform\")\n\n\tcontext := context.New(middleware.GetSession(c))\n\tif c.String(\"instances\") != \"\" {\n\t\treturn ec2utils.DetectPlatformForInstances(\n\t\t\tcontext,\n\t\t\tinstanceList(c),\n\t\t)\n\t}\n\n\tif c.String(\"autoscale-group\") != \"\" {\n\t\tUI.Debug(\"Determining Autoscale Group Platform\")\n\t\treturn ec2utils.DetectPlatformForAutoscaleGroup(\n\t\t\tcontext,\n\t\t\tc.String(\"autoscale-group\"),\n\t\t)\n\t}\n\n\treturn ec2utils.DetectPlatformForTag(\n\t\tcontext,\n\t\tc.String(\"tag-key\"),\n\t\tc.String(\"tag-value\"),\n\t)\n}", "title": "" }, { "docid": "b11f9a59d10d11e72270cafefa5f2d18", "score": "0.5503213", "text": "func AndroidForWorkEnrollmentTargetPAll() *AndroidForWorkEnrollmentTarget {\n\tv := AndroidForWorkEnrollmentTargetVAll\n\treturn &v\n}", "title": "" }, { "docid": "589865399634d87e89174bd46bdf272c", "score": "0.5493265", "text": "func AndroidForWorkVpnConnectionTypePPulseSecure() *AndroidForWorkVpnConnectionType {\n\tv := AndroidForWorkVpnConnectionTypeVPulseSecure\n\treturn &v\n}", "title": "" }, { "docid": "a2a6ddaf4958c7dc92434064525806cf", "score": "0.545572", "text": "func NewPointerFromGdnativeExtAndroidApiStruct(obj GdnativeExtAndroidApiStruct) Pointer {\n\treturn Pointer{base: unsafe.Pointer(obj.getBase())}\n}", "title": "" }, { "docid": "cba6c8ef84113d8aedfc6fc00574d0d8", "score": "0.54379004", "text": "func IsAndroid(plat int8) bool {\n\treturn plat == PlatAndroid || plat == PlatAndroidG || plat == PlatAndroidI || plat == PlatAndroidB\n}", "title": "" }, { "docid": "02e7e77762e108b744af3d7d982e42e2", "score": "0.5421773", "text": "func (o NetworkEndpointGroupServerlessDeploymentPtrOutput) Platform() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *NetworkEndpointGroupServerlessDeployment) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Platform\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "7709834ccab864526b24e2be17f41de6", "score": "0.54127157", "text": "func Platform() string {\n\treturn js.Global.Get(\"navigator\").Get(\"platform\").String()\n}", "title": "" }, { "docid": "3c6f2656ffce917cdae88fe5aeff1dab", "score": "0.54110765", "text": "func (m *AndroidMinimumOperatingSystem) GetV8_0()(*bool) {\n return m.v8_0\n}", "title": "" }, { "docid": "259ef368daf33cb43d08e26f24e0c912", "score": "0.54030913", "text": "func AndroidForWorkVpnConnectionTypePCiscoAnyConnect() *AndroidForWorkVpnConnectionType {\n\tv := AndroidForWorkVpnConnectionTypeVCiscoAnyConnect\n\treturn &v\n}", "title": "" }, { "docid": "dbd4e4cf36778d4ade855aeabe516df4", "score": "0.5373955", "text": "func (m *AndroidMinimumOperatingSystem) GetV4_1()(*bool) {\n return m.v4_1\n}", "title": "" }, { "docid": "fce5ee742f4928c6dd42a34d0e110b39", "score": "0.53461444", "text": "func newPlatformList() []*platform {\n\tplatforms := [8]*platform{}\n\tplatforms[linuxArm6] = &platform{OS: \"linux\", Arch: \"arm\", Variant: \"v6\"}\n\tplatforms[linuxArm7] = &platform{OS: \"linux\", Arch: \"arm\", Variant: \"v7\"}\n\tplatforms[linuxArm8] = &platform{OS: \"linux\", Arch: \"arm64\", Variant: \"v8\"}\n\tplatforms[linuxArm9] = &platform{OS: \"linux\", Arch: \"arm\", Variant: \"v9\"}\n\tplatforms[linuxAmd64] = &platform{OS: \"linux\", Arch: \"amd64\"}\n\tplatforms[windows1709] = &platform{OS: \"windows\", Arch: \"arm64\", Kernel: \"1709\"}\n\tplatforms[windows1803] = &platform{OS: \"windows\", Arch: \"arm64\", Kernel: \"1803\"}\n\tplatforms[windows1809] = &platform{OS: \"windows\", Arch: \"arm64\", Kernel: \"1809\"}\n\treturn platforms[:]\n}", "title": "" }, { "docid": "bb13ce0938a1d35dc56af4b6e6b2bd73", "score": "0.53364223", "text": "func (o *NewApplicationApiKey) GetPlatform() string {\n\tif o == nil || o.Platform == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Platform\n}", "title": "" }, { "docid": "35f2f867e769b16cd393bbe20c61be2a", "score": "0.53308636", "text": "func (m *AndroidMinimumOperatingSystem) GetV7_1()(*bool) {\n return m.v7_1\n}", "title": "" }, { "docid": "b07c13fbdda09533f8d67b4ff7d05548", "score": "0.53238237", "text": "func (m *AndroidMinimumOperatingSystem) GetV9_0()(*bool) {\n return m.v9_0\n}", "title": "" }, { "docid": "3215612ace5116a26ad47821f71a7158", "score": "0.5300337", "text": "func (n *nopSystemInfo) Platform() (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "b708f7d8608e10a23437087584ac88e4", "score": "0.5295321", "text": "func (o NetworkEndpointGroupServerlessDeploymentOutput) Platform() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v NetworkEndpointGroupServerlessDeployment) *string { return v.Platform }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "1a4b9c10e48f26c4380224abc8f39e85", "score": "0.5293771", "text": "func NewAndroidLobApp()(*AndroidLobApp) {\n m := &AndroidLobApp{\n MobileLobApp: *NewMobileLobApp(),\n }\n odataTypeValue := \"#microsoft.graph.androidLobApp\";\n m.SetOdataType(&odataTypeValue);\n return m\n}", "title": "" }, { "docid": "4533d4dee7801bc06035b54fc78a4c4c", "score": "0.52467364", "text": "func AndroidForWorkVpnConnectionTypePDellSonicWallMobileConnect() *AndroidForWorkVpnConnectionType {\n\tv := AndroidForWorkVpnConnectionTypeVDellSonicWallMobileConnect\n\treturn &v\n}", "title": "" }, { "docid": "2618de6c5efa847f81c128d5efbd1b24", "score": "0.52465403", "text": "func resolvePlatform(ref name.Reference, p types.Platform, options []remote.Option) (types.Platform, error) {\n\tif p.OS != \"\" {\n\t\treturn p, nil\n\t}\n\n\t// OS wildcard, implicitly pick up the first os found in the image list.\n\t// e.g. */amd64\n\td, err := remote.Get(ref, options...)\n\tif err != nil {\n\t\treturn types.Platform{}, xerrors.Errorf(\"image get error: %w\", err)\n\t}\n\tswitch d.MediaType {\n\tcase v1types.OCIManifestSchema1, v1types.DockerManifestSchema2:\n\t\t// We want an index but the registry has an image, not multi-arch. We just ignore \"--platform\".\n\t\tlog.Logger.Debug(\"Ignore --platform as the image is not multi-arch\")\n\t\treturn types.Platform{}, nil\n\tcase v1types.OCIImageIndex, v1types.DockerManifestList:\n\t\t// These are expected.\n\t}\n\n\tindex, err := d.ImageIndex()\n\tif err != nil {\n\t\treturn types.Platform{}, xerrors.Errorf(\"image index error: %w\", err)\n\t}\n\n\tm, err := index.IndexManifest()\n\tif err != nil {\n\t\treturn types.Platform{}, xerrors.Errorf(\"remote index manifest error: %w\", err)\n\t}\n\tif len(m.Manifests) == 0 {\n\t\tlog.Logger.Debug(\"Ignore '--platform' as the image is not multi-arch\")\n\t\treturn types.Platform{}, nil\n\t}\n\tif m.Manifests[0].Platform != nil {\n\t\tnewPlatform := p.DeepCopy()\n\t\t// Replace with the detected OS\n\t\t// e.g. */amd64 => linux/amd64\n\t\tnewPlatform.OS = m.Manifests[0].Platform.OS\n\n\t\t// Return the platform with the found OS\n\t\treturn types.Platform{\n\t\t\tPlatform: newPlatform,\n\t\t\tForce: p.Force,\n\t\t}, nil\n\t}\n\treturn types.Platform{}, nil\n}", "title": "" }, { "docid": "a5654002572064f99b71fa67c5c07206", "score": "0.5234111", "text": "func (m *AndroidMinimumOperatingSystem) GetV4_2()(*bool) {\n return m.v4_2\n}", "title": "" }, { "docid": "e8586d287b344d908e3c559cde24c8bd", "score": "0.52196705", "text": "func platformFromEnv(env []string) *ocispecs.Platform {\n\tvar p ocispecs.Platform\n\tvar set bool\n\tfor _, v := range env {\n\t\tparts := strings.SplitN(v, \"=\", 2)\n\t\tswitch parts[0] {\n\t\tcase \"TARGETPLATFORM\":\n\t\t\tp, err := platforms.Parse(parts[1])\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn &p\n\t\tcase \"TARGETOS\":\n\t\t\tp.OS = parts[1]\n\t\t\tset = true\n\t\tcase \"TARGETARCH\":\n\t\t\tp.Architecture = parts[1]\n\t\t\tset = true\n\t\tcase \"TARGETVARIANT\":\n\t\t\tp.Variant = parts[1]\n\t\t\tset = true\n\t\t}\n\t}\n\tif !set {\n\t\treturn nil\n\t}\n\treturn &p\n}", "title": "" }, { "docid": "c7ba472bd6279c2118d2c0dddabf701f", "score": "0.51960367", "text": "func (m *AndroidMinimumOperatingSystem) GetV4_0()(*bool) {\n return m.v4_0\n}", "title": "" }, { "docid": "56ff386b96036cb700df228cfb58d908", "score": "0.51939243", "text": "func (m *DeviceEvidence) GetOsPlatform()(*string) {\n val, err := m.GetBackingStore().Get(\"osPlatform\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "9fea90e303ad9f1a843dcd7995a74f50", "score": "0.51731384", "text": "func (m *AndroidMinimumOperatingSystem) GetV4_3()(*bool) {\n return m.v4_3\n}", "title": "" }, { "docid": "cc87287aace63081cd5599319bbbb045", "score": "0.5165051", "text": "func platform(results chan *bundlev1.Package, templateContext engine.Context, quality, name string) (visitor.PlatformVisitor, error) {\n\t// Parse selector values\n\tplatformQuality, err := engine.RenderContext(templateContext, quality)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif strings.TrimSpace(platformQuality) == \"\" {\n\t\treturn nil, fmt.Errorf(\"quality selector must not be empty\")\n\t}\n\n\tplatformName, err := engine.RenderContext(templateContext, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif strings.TrimSpace(platformName) == \"\" {\n\t\treturn nil, fmt.Errorf(\"platform selector must not be empty\")\n\t}\n\n\treturn &platformSecretBuilder{\n\t\tresults: results,\n\t\ttemplateContext: templateContext,\n\t\tquality: platformQuality,\n\t\tname: platformName,\n\t}, nil\n}", "title": "" }, { "docid": "a2b134663b66112cfc134462264316ca", "score": "0.5164197", "text": "func AndroidForWorkCrossProfileDataSharingTypePDeviceDefault() *AndroidForWorkCrossProfileDataSharingType {\n\tv := AndroidForWorkCrossProfileDataSharingTypeVDeviceDefault\n\treturn &v\n}", "title": "" }, { "docid": "ab3b821b367b098663a46d908e234ed9", "score": "0.51497924", "text": "func (r *Registry) LookupPlatform(ctx context.Context) (Platform, error) {\n\tv, err := r.platform.load(\"platform\", r.ttl(), func() (interface{}, error) {\n\t\tsubnets, err := r.LookupSubnets(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn whereAmI(subnets)\n\t})\n\tp, _ := v.(Platform)\n\treturn p, err\n}", "title": "" }, { "docid": "b133efdd585de6576a31f6397d4ecfb6", "score": "0.5145281", "text": "func (v *DeviceManager) Native() uintptr {\n\treturn uintptr(unsafe.Pointer(v.native()))\n}", "title": "" }, { "docid": "2e4f401250dbd5d9283d676843a43f3c", "score": "0.514041", "text": "func (m *AndroidMinimumOperatingSystem) GetV4_4()(*bool) {\n return m.v4_4\n}", "title": "" }, { "docid": "95b6c30e7ea69e2d047f91db4a480e33", "score": "0.5136177", "text": "func (v *Device) Native() uintptr {\n\treturn uintptr(unsafe.Pointer(v.native()))\n}", "title": "" }, { "docid": "f573e3d734357bca5d6b3a6734214fd8", "score": "0.5122992", "text": "func (m *AndroidMinimumOperatingSystem) GetV7_0()(*bool) {\n return m.v7_0\n}", "title": "" }, { "docid": "33da10716c8e3dd87aed3300fdbcf0f4", "score": "0.5117988", "text": "func GeneratePlatform(url string) Platform {\n\treturn Platform{url: url, client: model.NewClient(url)}\n}", "title": "" }, { "docid": "0e5c5be2f8b699ff95ed1548dfeed629", "score": "0.5116675", "text": "func (m *AndroidMinimumOperatingSystem) GetV4_0_3()(*bool) {\n return m.v4_0_3\n}", "title": "" }, { "docid": "a8a1a3f1fb651b29a0f48201c30c1f3a", "score": "0.51094383", "text": "func (o *NewApplicationApiKey) GetPlatformOk() (string, bool) {\n\tif o == nil || o.Platform == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.Platform, true\n}", "title": "" }, { "docid": "c1bd1a46dd3641e423a639419d5948d4", "score": "0.5104997", "text": "func New(ctx context.Context, host string) (platform remote.Platform, err error) {\n\treturn NewWithAuth(ctx, host, nil)\n}", "title": "" }, { "docid": "5e5a0af832380f2b0f757f82c6111580", "score": "0.50957954", "text": "func ConditionalAccessDevicePlatformPWindowsPhone() *ConditionalAccessDevicePlatform {\n\tv := ConditionalAccessDevicePlatformVWindowsPhone\n\treturn &v\n}", "title": "" }, { "docid": "84385649ef8d5a81b373064b13bf7621", "score": "0.50813854", "text": "func (a *Android) Name() string {\n\treturn \"android\"\n}", "title": "" }, { "docid": "f7b6152474f9be82cc4ae7c01a4ac282", "score": "0.5080146", "text": "func (m *ModuleBase) MakeAsPlatform() {\n\tm.commonProperties.Vendor = boolPtr(false)\n\tm.commonProperties.Proprietary = boolPtr(false)\n\tm.commonProperties.Soc_specific = boolPtr(false)\n\tm.commonProperties.Product_specific = boolPtr(false)\n\tm.commonProperties.System_ext_specific = boolPtr(false)\n\tm.commonProperties.Vendor_overlay = boolPtr(false)\n}", "title": "" }, { "docid": "c0af51ef60b83fcb5924101a44c28b8a", "score": "0.50800663", "text": "func (m *AndroidMinimumOperatingSystem) GetV11_0()(*bool) {\n return m.v11_0\n}", "title": "" }, { "docid": "a40888006d855f618bd0a2b70b079797", "score": "0.50778735", "text": "func PlatformDriver() Driver {\n\treturn driver\n}", "title": "" }, { "docid": "7245f1cfa8e53b5f496177733e9758a0", "score": "0.50668335", "text": "func NewAndroidDeviceOwnerGlobalProxyDirect()(*AndroidDeviceOwnerGlobalProxyDirect) {\n m := &AndroidDeviceOwnerGlobalProxyDirect{\n AndroidDeviceOwnerGlobalProxy: *NewAndroidDeviceOwnerGlobalProxy(),\n }\n odataTypeValue := \"#microsoft.graph.androidDeviceOwnerGlobalProxyDirect\"\n m.SetOdataType(&odataTypeValue)\n return m\n}", "title": "" }, { "docid": "fdaffbcbe8e0a094c0b702e033b0d71b", "score": "0.5065797", "text": "func (m *AndroidMinimumOperatingSystem) GetV10_0()(*bool) {\n return m.v10_0\n}", "title": "" }, { "docid": "444761f77142a2064f26ad63c55f1f98", "score": "0.5065438", "text": "func (b *BidRequest) GetPlatform(ctx context.Context) (logic.Platform, error) {\n\treturn logic.Platform(b.Device.Type), nil\n}", "title": "" }, { "docid": "183211ecab7d4eb255b4bc4114405cbb", "score": "0.5065065", "text": "func (p *UserAgent) Platform() string {\n\treturn p.platform\n}", "title": "" }, { "docid": "27d492e189ac83c20efdd9fb1769ef0c", "score": "0.5047086", "text": "func (t *TemplateResolver) Platform() string {\n\treturn *t.Scope.Flags.Platform\n}", "title": "" }, { "docid": "16a28b297320da8e5e9f05b4f8bd2837", "score": "0.50449187", "text": "func getPlatform() (string, error) {\n\tif runtime.GOOS == \"linux\" {\n\t\treturn \"x86_64-unknown-linux-gnu\", nil\n\t}\n\n\tif runtime.GOOS == \"darwin\" {\n\t\treturn \"x86_64-apple-darwin\", nil\n\t}\n\n\treturn \"\", errors.New(\"Not supported envionment\")\n}", "title": "" }, { "docid": "6b7bcd90df2595523555da6f07ebe3fe", "score": "0.5042033", "text": "func TransformToPlatform(name string) (platform Platform, err error) {\n\tplatform = EmptyPlatform\n\n\tswitch name {\n\tcase EmptyPlatform:\n\t\treturn\n\n\tcase SteamPlatform:\n\t\tplatform = SteamPlatform\n\t\treturn\n\n\tcase PsnPlatform:\n\t\tplatform = PsnPlatform\n\t\treturn\n\n\tcase XboxPlatform:\n\t\tplatform = XboxPlatform\n\t\treturn\n\n\tcase KakaoPlatform:\n\t\tplatform = KakaoPlatform\n\t\treturn\n\n\tcase ConsolePlatform:\n\t\tplatform = ConsolePlatform\n\t\treturn\n\n\tcase TournamentPlatform:\n\t\tplatform = TournamentPlatform\n\t\treturn\n\n\tcase StadiaPlatform:\n\t\tplatform = StadiaPlatform\n\t\treturn\n\t}\n\n\terr = errors.New(\"Platform not found. \")\n\treturn\n}", "title": "" }, { "docid": "e7e574f479eda06ef3b7dad0d0cefc6c", "score": "0.50390595", "text": "func unmarshalPlatformResponseBodyToResourceviewsPlatformView(v *PlatformResponseBody) *resourceviews.PlatformView {\n\tres := &resourceviews.PlatformView{\n\t\tID: v.ID,\n\t\tName: v.Name,\n\t}\n\n\treturn res\n}", "title": "" }, { "docid": "c8fb98851592f54f778e09c2a0c60699", "score": "0.5038898", "text": "func (c *Config) Platform() platform.Platform {\n\treturn c.platform\n}", "title": "" }, { "docid": "1954b1bbeca7843a17addc366dc48c34", "score": "0.50367975", "text": "func AndroidWiFiSecurityTypePOpen() *AndroidWiFiSecurityType {\n\tv := AndroidWiFiSecurityTypeVOpen\n\treturn &v\n}", "title": "" }, { "docid": "d442604510f7a66d6ba15d427fe5a17d", "score": "0.50202125", "text": "func NewAndroidForWorkAppConfigurationSchema()(*AndroidForWorkAppConfigurationSchema) {\n m := &AndroidForWorkAppConfigurationSchema{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "64d4e7e533ddfc9ca07256a1c1cf4d42", "score": "0.5007756", "text": "func (o *FirmwarePolicyAllOf) GetTargetPlatform() string {\n\tif o == nil || o.TargetPlatform == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.TargetPlatform\n}", "title": "" }, { "docid": "ce009322301d5bf9ae967897033769c0", "score": "0.5006716", "text": "func NewGdnativeExtAndroidApiStructFromPointer(ptr Pointer) GdnativeExtAndroidApiStruct {\n\n\treturn GdnativeExtAndroidApiStruct{base: (*C.godot_gdnative_ext_android_api_struct)(ptr.getBase())}\n}", "title": "" }, { "docid": "a36f2bb2d63a139cd4f75bef59d9b891", "score": "0.5004401", "text": "func PluginPlatform() string {\n\treturn \"win64\"\n}", "title": "" }, { "docid": "e82deb4e09efba14cc34408f972bbd6b", "score": "0.5001759", "text": "func (m *AndroidLobApp) GetVersionCode()(*string) {\n return m.versionCode\n}", "title": "" }, { "docid": "b16539bbba160f34b0c2943f41d468f2", "score": "0.49891815", "text": "func (a *SawAdapter) Platform() string {\n\treturn sawPlatform\n}", "title": "" }, { "docid": "3e2b6a7c5ea7a1748412d46d12d687c7", "score": "0.49871355", "text": "func ConditionalAccessDevicePlatformPMacOS() *ConditionalAccessDevicePlatform {\n\tv := ConditionalAccessDevicePlatformVMacOS\n\treturn &v\n}", "title": "" }, { "docid": "bd3d3f17e58dd34c16056ac477552fa4", "score": "0.49841046", "text": "func NewAndroidForWorkEnrollmentProfile()(*AndroidForWorkEnrollmentProfile) {\n m := &AndroidForWorkEnrollmentProfile{\n Entity: *NewEntity(),\n }\n return m\n}", "title": "" }, { "docid": "a793aded153e3728778a168d6e556e5a", "score": "0.49835917", "text": "func NewPlatform() (deployment.Platform, error) {\n\tconfig, err := clientcmd.BuildConfigFromFlags(\"\", filepath.Join(homedir.HomeDir(), \".kube\", \"config\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tclientset, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn &k8sPlatform{clientset}, nil\n}", "title": "" }, { "docid": "b86a63149ea738173cd7a6eddd982715", "score": "0.49750727", "text": "func (m *ManagedDevice) GetAndroidSecurityPatchLevel()(*string) {\n return m.androidSecurityPatchLevel\n}", "title": "" }, { "docid": "f50064950212e8750c5528dc7d4cfd50", "score": "0.49701744", "text": "func AndroidManagedStoreAccountEnrollmentTargetPTargeted() *AndroidManagedStoreAccountEnrollmentTarget {\n\tv := AndroidManagedStoreAccountEnrollmentTargetVTargeted\n\treturn &v\n}", "title": "" }, { "docid": "58fa8325e5d72c00ccd9cb2390c1714a", "score": "0.49528876", "text": "func NormalizePlatform(platform v1.Platform) v1.Platform {\n\tos, arch, variant := libimage.NormalizePlatform(platform.OS, platform.Architecture, platform.Variant)\n\treturn v1.Platform{\n\t\tOS: os,\n\t\tArchitecture: arch,\n\t\tVariant: variant,\n\t}\n}", "title": "" }, { "docid": "63b4ec960db8c25a42ce8776017d6c97", "score": "0.49404284", "text": "func LibraryFactory() android.Module {\n\tmodule := &Library{}\n\n\tmodule.addHostAndDeviceProperties()\n\n\tmodule.initModuleAndImport(module)\n\n\tandroid.InitApexModule(module)\n\tandroid.InitSdkAwareModule(module)\n\tInitJavaModule(module, android.HostAndDeviceSupported)\n\treturn module\n}", "title": "" }, { "docid": "b1fb22fa6fc7e5daea7d23fa63223e07", "score": "0.49391836", "text": "func AndroidForWorkCrossProfileDataSharingTypePAllowPersonalToWork() *AndroidForWorkCrossProfileDataSharingType {\n\tv := AndroidForWorkCrossProfileDataSharingTypeVAllowPersonalToWork\n\treturn &v\n}", "title": "" }, { "docid": "6b2df4e448130da006de857d1cc8cb16", "score": "0.49365124", "text": "func (cmd *Android) Name() string {\n\treturn \"android\"\n}", "title": "" }, { "docid": "0848b2833cce53a421cb37dfb71c2115", "score": "0.49183658", "text": "func MobileAppDependencyTypePDetect() *MobileAppDependencyType {\n\tv := MobileAppDependencyTypeVDetect\n\treturn &v\n}", "title": "" }, { "docid": "0848b2833cce53a421cb37dfb71c2115", "score": "0.49183658", "text": "func MobileAppDependencyTypePDetect() *MobileAppDependencyType {\n\tv := MobileAppDependencyTypeVDetect\n\treturn &v\n}", "title": "" } ]
24b3416fced226bb91b6277a22ec3dfb
Iter return the cursor after aggregate In most scenario do not use Iter
[ { "docid": "e0cbef6d703e8a5dbe7f948d359ded54", "score": "0.64903706", "text": "func (a *Aggregate) Iter() qmgo.CursorI {\n\treturn a.ai.Iter()\n}", "title": "" } ]
[ { "docid": "c65b8821d9ba894b88d678eaf16b2ce3", "score": "0.61319226", "text": "func (q Query) Aggregate(f func(interface{}, interface{}) interface{}) interface{} {\n\tnext := q.Iterate()\n\n\tresult, any := next()\n\tif !any {\n\t\treturn nil\n\t}\n\n\tfor current, ok := next(); ok; current, ok = next() {\n\t\tresult = f(result, current)\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "778a307c7e851cd9c1a9d4582f5700ef", "score": "0.5916055", "text": "func (dao *FiatPriceDao) Aggregate(q []bson.M) ([]*types.FiatPriceItem, error) {\n\tvar res []*types.FiatPriceItem\n\n\terr := db.Aggregate(dao.dbName, dao.collectionName, q, &res)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "34271032a7c357d1a271e7b0051bfa88", "score": "0.5814728", "text": "func (a *Aggregate) Result(opts driver.CursorOptions) (*driver.BatchCursor, error) {\r\n\r\n\tclientSession := a.session\r\n\r\n\tclock := a.clock\r\n\treturn driver.NewBatchCursor(a.result, clientSession, clock, opts)\r\n}", "title": "" }, { "docid": "c493558a934dc715447634429d1dd98f", "score": "0.57859606", "text": "func (b *bucket) Cursor() database.Cursor {\n\tif err := b.tx.checkClosed(); err != nil {\n\t\treturn &cursor{bucket: b}\n\t}\n\n\tc := newCursor(b, b.id[:], ctFull)\n\truntime.SetFinalizer(c, cursorFinalizer)\n\treturn c\n}", "title": "" }, { "docid": "80c409d6588d5f6e1d9e25f5654014cb", "score": "0.56527287", "text": "func (db *DB) Aggregate(ctx context.Context, collName string, pipeline interface{}, results interface{}) error {\n\tcoll := db.Collection(collName)\n\n\tcursor, err := coll.Aggregate(ctx, pipeline)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn cursor.All(ctx, results)\n}", "title": "" }, { "docid": "f5f20ffe6db9f2a91e3631491c5ca0c2", "score": "0.56194323", "text": "func (r *result) setCursor() error {\n\tif r.iter == nil {\n\t\tq, err := r.query()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.iter = q.Iter()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7664c0695c675cc1133f93223d1ec330", "score": "0.5591086", "text": "func (db *Bolt) Cursor() (*bolt.Cursor, func() error, error) {\n\ttx, err := db.Begin(false)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tb := tx.Bucket([]byte(bucketName))\n\tteardown := func() error {\n\t\treturn tx.Rollback()\n\t}\n\treturn b.Cursor(), teardown, nil\n}", "title": "" }, { "docid": "bb29b1223119056875ba2f832a94fd7e", "score": "0.5569769", "text": "func (it *MongoIterDAL) All(result interface{}) error {\n\treturn it.iter.All(result)\n}", "title": "" }, { "docid": "259cd8ba52775dd2663a0ff809c98232", "score": "0.55665404", "text": "func (t *Object) Collect(dbh *sql.DB) {\n\tt.current = selectRows(dbh)\n\tt.SetLastCollectTimeNow()\n\n\tt.makeResults()\n}", "title": "" }, { "docid": "a020e42d20a46ce9ed974d46e097a17f", "score": "0.5505426", "text": "func (db *MongoConn) Aggregate(collection string, query QuerySlice, result interface{}) error {\n\treturn db.Session.\n\t\tDB(db.DialInfo.Database).\n\t\tC(collection).\n\t\tPipe(query).\n\t\tAll(result)\n}", "title": "" }, { "docid": "7b5701a9b74e89b7207b4f03c96e9b2c", "score": "0.54884636", "text": "func (tx *LevelDBTransaction) Cursor(bucket *database.Bucket) (database.Cursor, error) {\n\tif tx.isClosed {\n\t\treturn nil, errors.New(\"cannot open a cursor from a closed transaction\")\n\t}\n\n\treturn tx.db.Cursor(bucket)\n}", "title": "" }, { "docid": "6b6976972386e56fd7b01583c6294ab5", "score": "0.5479191", "text": "func Aggregate(\n\tctx context.Context,\n\tcmd command.Aggregate,\n\ttopo *topology.Topology,\n\treadSelector, writeSelector description.ServerSelector,\n\tclientID uuid.UUID,\n\tpool *session.Pool,\n\tregistry *bsoncodec.Registry,\n\topts ...*options.AggregateOptions,\n) (*BatchCursor, error) {\n\n\tdollarOut := cmd.HasDollarOut()\n\n\tvar ss *topology.SelectedServer\n\tvar err error\n\tswitch dollarOut {\n\tcase true:\n\t\tss, err = topo.SelectServer(ctx, writeSelector)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase false:\n\t\tss, err = topo.SelectServer(ctx, readSelector)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tdesc := ss.Description()\n\tconn, err := ss.Connection(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer conn.Close()\n\n\trp, err := getReadPrefBasedOnTransaction(cmd.ReadPref, cmd.Session)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcmd.ReadPref = rp\n\n\t// If no explicit session and deployment supports sessions, start implicit session.\n\tif cmd.Session == nil && topo.SupportsSessions() {\n\t\tcmd.Session, err = session.NewClientSession(pool, clientID, session.Implicit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\taggOpts := options.MergeAggregateOptions(opts...)\n\n\tif aggOpts.AllowDiskUse != nil {\n\t\tcmd.Opts = append(cmd.Opts, bsonx.Elem{\"allowDiskUse\", bsonx.Boolean(*aggOpts.AllowDiskUse)})\n\t}\n\tvar batchSize int32\n\tif aggOpts.BatchSize != nil {\n\t\telem := bsonx.Elem{\"batchSize\", bsonx.Int32(*aggOpts.BatchSize)}\n\t\tcmd.Opts = append(cmd.Opts, elem)\n\t\tcmd.CursorOpts = append(cmd.CursorOpts, elem)\n\t\tbatchSize = *aggOpts.BatchSize\n\t}\n\tif aggOpts.BypassDocumentValidation != nil && desc.WireVersion.Includes(4) {\n\t\tcmd.Opts = append(cmd.Opts, bsonx.Elem{\"bypassDocumentValidation\", bsonx.Boolean(*aggOpts.BypassDocumentValidation)})\n\t}\n\tif aggOpts.Collation != nil {\n\t\tif desc.WireVersion.Max < 5 {\n\t\t\treturn nil, ErrCollation\n\t\t}\n\t\tcollDoc, err := bsonx.ReadDoc(aggOpts.Collation.ToDocument())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcmd.Opts = append(cmd.Opts, bsonx.Elem{\"collation\", bsonx.Document(collDoc)})\n\t}\n\tif aggOpts.MaxTime != nil {\n\t\tcmd.Opts = append(cmd.Opts, bsonx.Elem{\"maxTimeMS\", bsonx.Int64(int64(*aggOpts.MaxTime / time.Millisecond))})\n\t}\n\tif aggOpts.MaxAwaitTime != nil {\n\t\t// specified as maxTimeMS on getMore commands\n\t\tcmd.CursorOpts = append(cmd.CursorOpts, bsonx.Elem{\n\t\t\t\"maxTimeMS\", bsonx.Int64(int64(*aggOpts.MaxAwaitTime / time.Millisecond)),\n\t\t})\n\t}\n\tif aggOpts.Comment != nil {\n\t\tcmd.Opts = append(cmd.Opts, bsonx.Elem{\"comment\", bsonx.String(*aggOpts.Comment)})\n\t}\n\tif aggOpts.Hint != nil {\n\t\thintElem, err := interfaceToElement(\"hint\", aggOpts.Hint, registry)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcmd.Opts = append(cmd.Opts, hintElem)\n\t}\n\n\tres, err := cmd.RoundTrip(ctx, desc, conn)\n\tif err != nil {\n\t\tif wce, ok := err.(result.WriteConcernError); ok {\n\t\t\tss.ProcessWriteConcernError(&wce)\n\t\t}\n\t\tcloseImplicitSession(cmd.Session)\n\t\treturn nil, err\n\t}\n\n\tif desc.WireVersion.Max < 4 {\n\t\treturn buildLegacyCommandBatchCursor(res, batchSize, ss.Server)\n\t}\n\n\treturn NewBatchCursor(bsoncore.Document(res), cmd.Session, cmd.Clock, ss.Server, cmd.CursorOpts...)\n}", "title": "" }, { "docid": "3c9001da6b6a89a86a434047f399f077", "score": "0.5458133", "text": "func getCursorValues(result bson.Raw) (*bsoncore.DocumentSequence, command.Namespace, int64, error) {\n\tcur, err := result.LookupErr(\"cursor\")\n\tif err != nil {\n\t\treturn nil, command.Namespace{}, 0, err\n\t}\n\tif cur.Type != bson.TypeEmbeddedDocument {\n\t\treturn nil, command.Namespace{}, 0, fmt.Errorf(\"cursor should be an embedded document but it is a BSON %s\", cur.Type)\n\t}\n\n\telems, err := cur.Document().Elements()\n\tif err != nil {\n\t\treturn nil, command.Namespace{}, 0, err\n\t}\n\n\tvar ok bool\n\tvar namespace command.Namespace\n\tvar cursorID int64\n\tbatch := new(bsoncore.DocumentSequence)\n\n\tfor _, elem := range elems {\n\t\tswitch elem.Key() {\n\t\tcase \"firstBatch\":\n\t\t\tarr, ok := elem.Value().ArrayOK()\n\t\t\tif !ok {\n\t\t\t\treturn nil, command.Namespace{}, 0, fmt.Errorf(\"firstBatch should be an array but it is a BSON %s\", elem.Value().Type)\n\t\t\t}\n\n\t\t\tbatch.Style = bsoncore.ArrayStyle\n\t\t\tbatch.Data = arr\n\t\tcase \"ns\":\n\t\t\tif elem.Value().Type != bson.TypeString {\n\t\t\t\treturn nil, command.Namespace{}, 0, fmt.Errorf(\"namespace should be a string but it is a BSON %s\", elem.Value().Type)\n\t\t\t}\n\t\t\tnamespace = command.ParseNamespace(elem.Value().StringValue())\n\t\t\terr = namespace.Validate()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, command.Namespace{}, 0, err\n\t\t\t}\n\t\tcase \"id\":\n\t\t\tcursorID, ok = elem.Value().Int64OK()\n\t\t\tif !ok {\n\t\t\t\treturn nil, command.Namespace{}, 0, fmt.Errorf(\"id should be an int64 but it is a BSON %s\", elem.Value().Type)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn batch, namespace, cursorID, nil\n}", "title": "" }, { "docid": "65e22f6dcba69b09951dc02886a4116d", "score": "0.5458074", "text": "func (dao *OrderDao) Aggregate(q []bson.M) ([]*types.OrderData, error) {\n\torderData := []*types.OrderData{}\n\terr := db.Aggregate(dao.dbName, dao.collectionName, q, &orderData)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn []*types.OrderData{}, err\n\t}\n\n\treturn orderData, nil\n}", "title": "" }, { "docid": "9063e99186f2016f23967eefb990cf4e", "score": "0.54433644", "text": "func (c *Cursor) All(result interface{}) error {\n\tresultv := reflect.ValueOf(result)\n\tif resultv.Kind() != reflect.Ptr || resultv.Elem().Kind() != reflect.Slice {\n\t\tpanic(\"result argument must be a slice address\")\n\t}\n\tslicev := resultv.Elem()\n\tslicev = slicev.Slice(0, slicev.Cap())\n\telemt := slicev.Type().Elem()\n\ti := 0\n\tfor {\n\t\tif slicev.Len() == i {\n\t\t\telemp := reflect.New(elemt)\n\t\t\tif !c.Next(elemp.Interface()) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tslicev = reflect.Append(slicev, elemp.Elem())\n\t\t\tslicev = slicev.Slice(0, slicev.Cap())\n\t\t} else {\n\t\t\tif !c.Next(slicev.Index(i).Addr().Interface()) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ti++\n\t}\n\tresultv.Elem().Set(slicev.Slice(0, i))\n\n\tif err := c.Err(); err != nil {\n\t\tc.Close()\n\t\treturn err\n\t}\n\n\tif err := c.Close(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "12c1e8f892039784f1c1546c27045c99", "score": "0.5396876", "text": "func (ag *aggregator) Next() (sqlbase.EncDatumRow, *ProducerMetadata) {\n\tif ag.maybeStart(\"aggregator\", \"Agg\") {\n\t\tlog.VEventf(ag.ctx, 2, \"starting aggregation process\")\n\t\tag.cancelChecker = sqlbase.NewCancelChecker(ag.ctx)\n\t\tag.accumulating = true\n\t}\n\n\tif ag.accumulating {\n\t\tfor {\n\t\t\trow, meta := ag.input.Next()\n\t\t\tif meta != nil {\n\t\t\t\tif meta.Err != nil {\n\t\t\t\t\treturn nil, ag.producerMeta(meta.Err)\n\t\t\t\t}\n\t\t\t\treturn nil, meta\n\t\t\t}\n\t\t\tif row == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ag.closed || ag.consumerStatus != NeedMoreRows {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := ag.accumulateRow(row); err != nil {\n\t\t\t\treturn nil, ag.producerMeta(err)\n\t\t\t}\n\t\t}\n\n\t\t// Queries like `SELECT MAX(n) FROM t` expect a row of NULLs if nothing was\n\t\t// aggregated.\n\t\tif len(ag.buckets) < 1 && len(ag.groupCols) == 0 {\n\t\t\tag.buckets[\"\"] = struct{}{}\n\t\t}\n\n\t\tag.bucketsIter = make([]string, 0, len(ag.buckets))\n\t\tfor bucket := range ag.buckets {\n\t\t\tag.bucketsIter = append(ag.bucketsIter, bucket)\n\t\t}\n\t\tag.buckets = nil\n\n\t\tag.accumulating = false\n\t\tlog.VEvent(ag.ctx, 1, \"accumulation complete\")\n\n\t\tag.row = make(sqlbase.EncDatumRow, len(ag.funcs))\n\t}\n\n\tif ag.draining {\n\t\tfor {\n\t\t\trow, meta := ag.input.Next()\n\t\t\tif row != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif meta != nil {\n\t\t\t\treturn nil, meta\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tag.draining = false\n\t}\n\n\tif ag.closed || ag.consumerStatus != NeedMoreRows {\n\t\treturn nil, ag.producerMeta(nil /* err */)\n\t}\n\n\tfor {\n\t\tif len(ag.bucketsIter) == 0 {\n\t\t\treturn nil, ag.producerMeta(nil /* err */)\n\t\t}\n\n\t\tbucket := ag.bucketsIter[0]\n\t\tag.bucketsIter = ag.bucketsIter[1:]\n\n\t\tfor i, f := range ag.funcs {\n\t\t\tresult, err := f.get(bucket)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, ag.producerMeta(err)\n\t\t\t}\n\t\t\tif result == nil {\n\t\t\t\t// Special case useful when this is a local stage of a distributed\n\t\t\t\t// aggregation.\n\t\t\t\tresult = tree.DNull\n\t\t\t}\n\t\t\tag.row[i] = sqlbase.DatumToEncDatum(ag.outputTypes[i], result)\n\t\t}\n\n\t\toutRow, status, err := ag.out.ProcessRow(ag.ctx, ag.row)\n\t\tif outRow != nil {\n\t\t\treturn outRow, nil\n\t\t}\n\t\tif outRow == nil && err == nil && status == NeedMoreRows {\n\t\t\tcontinue\n\t\t}\n\t\treturn nil, ag.producerMeta(err)\n\t}\n}", "title": "" }, { "docid": "214b41f839eb0104cd2457c4914bc561", "score": "0.5387133", "text": "func (m MongoOperator) Aggregate(ctx context.Context, collectionType int, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error) {\n\targs := m.Called(ctx, collectionType, pipeline, opts)\n\treturn args.Get(0).(*mongo.Cursor), args.Error(1)\n}", "title": "" }, { "docid": "aedb1fb6bba062de3aad494b8648a58b", "score": "0.53769183", "text": "func (con Connection) Aggregate(ctx context.Context, db string, collection string, command string) (wrapper.ICursor, error) {\n\tvar pipeline interface{}\n\terr := bson.UnmarshalExtJSON([]byte(command), true, &pipeline)\n\tif err != nil {\n\t\tfmt.Println(command)\n\t\treturn nil, err\n\t}\n\topts := options.Aggregate().SetMaxTime(2 * time.Second)\n\treturn con.client.Database(db).Collection(collection).Aggregate(ctx, pipeline, opts)\n}", "title": "" }, { "docid": "03754387fb7fdd5fb3f63aca7f68ddad", "score": "0.5321373", "text": "func (c *Cursor) All(_ context.Context, out interface{}) error {\n\t// acquire mutex\n\tc.mutex.Lock()\n\tdefer c.mutex.Unlock()\n\n\t// check if closed\n\tif c.closed {\n\t\treturn fmt.Errorf(\"cursor closed\")\n\t}\n\n\t// decode items\n\terr := bsonkit.DecodeList(c.list, out)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// close cursor\n\tc.closed = true\n\n\treturn nil\n}", "title": "" }, { "docid": "9f4644f9d1a7cb7d1394c83eb40f9cc3", "score": "0.52937925", "text": "func iterObjects(obj db.Object, iter *firestore.DocumentIterator) ([]db.Object, error) {\n\tlist := []db.Object{}\n\tfor {\n\t\tsnapshot, err := iter.Next()\n\t\tif err == iterator.Done {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"iter next %v\", obj.Collection())\n\t\t}\n\t\tnewObj := obj.Factory()\n\t\tif newObj == nil {\n\t\t\treturn nil, errors.New(obj.Collection() + \" not implement Factory()\")\n\t\t}\n\n\t\t_, err = snapshotToObject(newObj, snapshot.Ref, snapshot, err)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"iter snapshot to object %v-%v\", obj.Collection(), snapshot.Ref.ID)\n\t\t}\n\t\tlist = append(list, newObj)\n\t}\n\treturn list, nil\n}", "title": "" }, { "docid": "c4a1dbbe30e585bfbe182525bd9934d0", "score": "0.529028", "text": "func (c *cursor) consume() {\n\tdefer close(c.events)\n\n\tfor {\n\t\terr := c.recv()\n\n\t\tif err != nil {\n\t\t\tc.close(err)\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4e6ff99ef48dfb6b18b9ee28c8c157b6", "score": "0.52792686", "text": "func (e *ExecutionEngine) Aggregate() (interface{}, error) {\n\tfunctionName := C.CString(\"sky_aggregate\")\n\tdefer C.free(unsafe.Pointer(functionName))\n\n\tC.lua_getfield(e.state, -10002, functionName)\n\tC.lua_pushlightuserdata(e.state, unsafe.Pointer(e.cursor))\n\trc := C.lua_pcall(e.state, 1, 1, 0)\n\tif rc != 0 {\n\t\tluaErrString := C.GoString(C.lua_tolstring(e.state, -1, nil))\n\t\tfmt.Println(e.FullAnnotatedSource())\n\t\treturn nil, fmt.Errorf(\"skyd.ExecutionEngine: Unable to aggregate: %s\", luaErrString)\n\t}\n\n\treturn e.decodeResult()\n}", "title": "" }, { "docid": "be9becc369e612c66740811924e44d26", "score": "0.52651954", "text": "func getResultsFromCursor(cur *mongo.Cursor) ([]interface{}, error) {\n\tvar results []interface{}\n\tfor cur.Next(context.TODO()) {\n\t\tvar elem TestColl\n\t\terr := cur.Decode(&elem)\n\t\tif err != nil {\n\t\t\treturn []interface{}{}, err\n\t\t}\n\t\tresults = append(results, elem)\n\t}\n\treturn results, nil\n}", "title": "" }, { "docid": "2ba0a43b9788c7ca4f7a5e3fd3b207e2", "score": "0.52604204", "text": "func (b *GetDialogsQueryBuilder) Collect(ctx context.Context) ([]Elem, error) {\n\titer := b.Iter()\n\tc, err := iter.Total(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get total\")\n\t}\n\n\tr := make([]Elem, 0, c)\n\tfor iter.Next(ctx) {\n\t\tr = append(r, iter.Value())\n\t}\n\n\treturn r, iter.Err()\n}", "title": "" }, { "docid": "1a408ac52d847eed5f28fbff61757d23", "score": "0.5254142", "text": "func AggregateQuery(model, pipe, out interface{}) error {\n\tif Document, ok := app.Mapper.GetModel(model); ok {\n\t\treturn Document.Pipe(pipe, out)\n\t}\n\n\treturn ErrDocument\n}", "title": "" }, { "docid": "6ba562551b4c9d3437161c164494836b", "score": "0.52498937", "text": "func (f *Finder) aggregate(s *Searcher) {\n\tf.Batches = append(f.Batches, s.Batches...)\n\tf.Titles = append(f.Titles, s.Titles...)\n\tfor _, i := range s.Issues {\n\t\tf.Issues = append(f.Issues, i)\n\t\tf.IssueNamespace[i] = s.Namespace\n\t}\n\tfor _, e := range s.Errors.All() {\n\t\tf.Errors.Append(e)\n\t}\n}", "title": "" }, { "docid": "6163b454325620de6204869080b4a6e7", "score": "0.52445406", "text": "func agg(aggregate AttrInfo, aggrFunc AggrFunc,aggrColumn []Column, alreadyGrouped bool, GoroutineNumber int) {\n\tvar aggrPos int\n\tvar RowLength int\n\tColumnLength := len(aggrColumn)\n\tHasSameValues := false\n\tif !alreadyGrouped {\n\t\tif aggregate.Type == STRING && aggrFunc != COUNT {\n\t\t\tfmt.Println(\"Only COUNT for string supported\")\t\t\n\t\t}\t\n\t\t//find the aggregate Column\n\t\tfor i := 0; i < ColumnLength; i++ {\n\t\t\tif aggrColumn[i].Signature == aggregate {\n\t\t\t\taggrPos = i\n\t\t\t\tbreak\n\t\t}\t}\n\t\t//place aggregate Column at the end\n\t\tif aggrPos != ColumnLength - 1 {\n\t\t\ttemp := aggrColumn[aggrPos]\n\t\t\taggrColumn[aggrPos] = aggrColumn[ColumnLength -1] \n\t\t\taggrColumn[ColumnLength -1] = temp\t\n\t\t\taggrPos = ColumnLength - 1\t\t\n\t\t}\n\t\t//COUNT replaces the aggregate Column with an empty int list if it is not already an int list\n\t\tif aggrFunc == COUNT && aggregate.Type == FLOAT || aggregate.Type == STRING {\n\t\t\taggrColumn[aggrPos].Data = make([]int, 0)\t\n\t\t}\n\t} else {\n\t\taggrPos = ColumnLength - 1\n\t}\n\t//get row length\n\tswitch aggrColumn[0].Signature.Type {\n\tcase INT:\n\t\tRowLength = len(aggrColumn[0].Data.([]int))\n\tcase FLOAT:\n\t\tRowLength = len(aggrColumn[0].Data.([]float64))\n\tcase STRING:\n\t\tRowLength = len(aggrColumn[0].Data.([]string))\n\t}\t\t\n\tAlreadyAggregatedRows := 0\n\t//the main loop\n\tfor i:=0; i < RowLength; i++ {\n\t\tfor RowIndex:=0; RowIndex < AlreadyAggregatedRows; RowIndex++ {\t\n\t\t\tHasSameValues = true\n\t\t\t//check if the current viewed row matches an already aggregated row \n\t\t\tfor CurrentColumn :=0; CurrentColumn < aggrPos; CurrentColumn++ {\t\t\t\t\n\t\t\t\tswitch aggrColumn[CurrentColumn].Signature.Type {\n\t\t\t\t\tcase INT:\n\t\t\t\t\t\tif aggrColumn[CurrentColumn].Data.([]int)[RowIndex] != aggrColumn[CurrentColumn].Data.([]int)[i] {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tHasSameValues = false\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\tcase FLOAT:\n\t\t\t\t\t\tif aggrColumn[CurrentColumn].Data.([]float64)[RowIndex] != aggrColumn[CurrentColumn].Data.([]float64)[i] {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tHasSameValues = false\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\tcase STRING:\n\t\t\t\t\t\tif aggrColumn[CurrentColumn].Data.([]string)[RowIndex] != aggrColumn[CurrentColumn].Data.([]string)[i] {\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tHasSameValues = false\t\n\t\t\t\t}\t\t}\n\t\t\t\tif HasSameValues == false {\n\t\t\t\t\tbreak\n\t\t\t}\t}\n\t\t\t//current row matches, change aggregate Column if necessary\n\t\t\tif HasSameValues {\n\t\t\t\tswitch aggrFunc {\n\t\t\t\t\tcase COUNT:\n\t\t\t\t\t\taggrColumn[aggrPos].Data.([]int)[RowIndex] = aggrColumn[aggrPos].Data.([]int)[RowIndex] + 1 \t\t\t\t\t\n\t\t\t\t\tcase MAX:\n\t\t\t\t\t\tswitch aggregate.Type {\n\t\t\t\t\t\t\tcase INT:\n\t\t\t\t\t\t\t\tif aggrColumn[aggrPos].Data.([]int)[RowIndex] < aggrColumn[aggrPos].Data.([]int)[i] {\n\t\t\t\t\t\t\t\t\taggrColumn[aggrPos].Data.([]int)[RowIndex] = aggrColumn[aggrPos].Data.([]int)[i] }\n\t\t\t\t\t\t\tcase FLOAT:\n\t\t\t\t\t\t\t\tif aggrColumn[aggrPos].Data.([]float64)[RowIndex] < aggrColumn[aggrPos].Data.([]float64)[i] {\n\t\t\t\t\t\t\t\t\taggrColumn[aggrPos].Data.([]float64)[RowIndex] = aggrColumn[aggrPos].Data.([]float64)[i] }\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\tcase MIN:\n\t\t\t\t\t\tswitch aggregate.Type {\n\t\t\t\t\t\t\tcase INT:\n\t\t\t\t\t\t\t\tif aggrColumn[aggrPos].Data.([]int)[RowIndex] > aggrColumn[aggrPos].Data.([]int)[i] {\n\t\t\t\t\t\t\t\t\taggrColumn[aggrPos].Data.([]int)[RowIndex] = aggrColumn[aggrPos].Data.([]int)[i] }\n\t\t\t\t\t\t\tcase FLOAT:\n\t\t\t\t\t\t\t\tif aggrColumn[aggrPos].Data.([]float64)[RowIndex] > aggrColumn[aggrPos].Data.([]float64)[i] {\n\t\t\t\t\t\t\t\t\taggrColumn[aggrPos].Data.([]float64)[RowIndex] = aggrColumn[aggrPos].Data.([]float64)[i] }\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\tcase SUM:\n\t\t\t\t\t\tswitch aggregate.Type {\n\t\t\t\t\t\t\tcase INT:\n\t\t\t\t\t\t\t\taggrColumn[aggrPos].Data.([]int)[RowIndex] = aggrColumn[aggrPos].Data.([]int)[RowIndex] + aggrColumn[aggrPos].Data.([]int)[i]\n\t\t\t\t\t\t\tcase FLOAT:\n\t\t\t\t\t\t\t\taggrColumn[aggrPos].Data.([]float64)[RowIndex] = aggrColumn[aggrPos].Data.([]float64)[RowIndex] + aggrColumn[aggrPos].Data.([]float64)[i] }\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\tbreak\n\t\t}\t}\n\t\t//no match for current row found, add it to aggregated rows and replace aggregate column value \n\t\tif !HasSameValues {\n\t\t\tfor j:=0;j < aggrPos; j++ {\n\t\t\t\tswitch aggrColumn[j].Signature.Type{\n\t\t\t\t\tcase INT:\n\t\t\t\t\t\taggrColumn[j].Data.([]int)[AlreadyAggregatedRows] = aggrColumn[j].Data.([]int)[i] \n\t\t\t\t\tcase FLOAT:\n\t\t\t\t\t\taggrColumn[j].Data.([]float64)[AlreadyAggregatedRows] = aggrColumn[j].Data.([]float64)[i] \n\t\t\t\t\tcase STRING:\n\t\t\t\t\t\taggrColumn[j].Data.([]string)[AlreadyAggregatedRows] = aggrColumn[j].Data.([]string)[i] \n\t\t\t}\t}\n\t\t\tif aggrFunc == COUNT && !alreadyGrouped {\n\t\t\t\tswitch aggrColumn[aggrPos].Signature.Type {\n\t\t\t\t\tcase INT:\n\t\t\t\t\taggrColumn[aggrPos].Data.([]int)[AlreadyAggregatedRows] = 1\n\t\t\t\t\tdefault:\n\t\t\t\t\taggrColumn[aggrPos].Data = append(aggrColumn[aggrPos].Data.([]int), 1)\n\t\t\t\t}\t\t\t\t\n\t\t\t} else {\n\t\t\t\tswitch aggrColumn[aggrPos].Signature.Type {\n\t\t\t\t\tcase INT:\n\t\t\t\t\t\taggrColumn[aggrPos].Data.([]int)[AlreadyAggregatedRows] = aggrColumn[aggrPos].Data.([]int)[i] \t\t\t\t\t\t\n\t\t\t\t\tcase FLOAT:\n\t\t\t\t\t\taggrColumn[aggrPos].Data.([]float64)[AlreadyAggregatedRows] = aggrColumn[aggrPos].Data.([]float64)[i] \t\t\t\t\t\t\t\t\n\t\t\t}\t}\t\n\t\t\tAlreadyAggregatedRows++\n\t}\t}\n\t//all rows tested, change aggregate type if necessary and cut off all rows after the last aggregated one\n\tif aggrFunc == COUNT && aggregate.Type == FLOAT || aggregate.Type == STRING {\n\t\taggrColumn[aggrPos].Signature.Type = INT\t\n\t}\n\tfor j:=0; j < ColumnLength; j++ {\n\t\tswitch aggrColumn[j].Signature.Type{\n\t\t\tcase INT:\n\t\t\t\taggrColumn[j].Data = aggrColumn[j].Data.([]int)[0:AlreadyAggregatedRows] \t\n\t\t\tcase FLOAT:\n\t\t\t\taggrColumn[j].Data = aggrColumn[j].Data.([]float64)[0:AlreadyAggregatedRows] \n\t\t\tcase STRING:\n\t\t\t\taggrColumn[j].Data = aggrColumn[j].Data.([]string)[0:AlreadyAggregatedRows] \n\t}\t}\t\n\t//notify the main program that this goroutine has finished\n\tGoroutineFinished[GoroutineNumber] = true\n}", "title": "" }, { "docid": "34410c3c03a8d5f3827f5fe22bea98e2", "score": "0.52347934", "text": "func (ba *BigQueryAggregator) Aggregate(ctx context.Context, ce coster.CostData) error {\n\tcr := CostRow{ce}\n\tlog.Log.Debugw(\"aggregating object\", zap.Object(\"CostData\", &ce))\n\tif err := ba.uploader.Put(ctx, cr); err != nil {\n\t\tlog.Log.Errorw(\"could not insert row\", zap.Error(err))\n\t\tif pmErr, ok := err.(bigquery.PutMultiError); ok {\n\t\t\tfor _, rowInsertionError := range pmErr {\n\t\t\t\tlog.Log.Debugw(\"row insertion error\", zap.Error(&rowInsertionError))\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2c5687d3ca12edd90f441f10e798c122", "score": "0.5231843", "text": "func collect(dbh *sql.DB) Rows {\n\tvar t Rows\n\n\tlog.Println(\"events_stages_summary_global_by_event_name.collect()\")\n\tsql := \"SELECT EVENT_NAME, COUNT_STAR, SUM_TIMER_WAIT FROM events_stages_summary_global_by_event_name WHERE SUM_TIMER_WAIT > 0\"\n\n\trows, err := dbh.Query(sql)\n\tif err != nil {\n\t\tmylog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar r Row\n\t\tif err := rows.Scan(\n\t\t\t&r.Name,\n\t\t\t&r.CountStar,\n\t\t\t&r.SumTimerWait); err != nil {\n\t\t\tmylog.Fatal(err)\n\t\t}\n\n\t\t// convert the stage name, removing any leading stage/sql/\n\t\tif len(r.Name) > 10 && r.Name[0:10] == \"stage/sql/\" {\n\t\t\tr.Name = r.Name[10:]\n\t\t}\n\n\t\tt = append(t, r)\n\t}\n\tif err := rows.Err(); err != nil {\n\t\tmylog.Fatal(err)\n\t}\n\tlog.Printf(\"recovered %v row(s):\", len(t))\n\tlog.Println(t)\n\n\treturn t\n}", "title": "" }, { "docid": "9486f0c77ba131e195c5afe9717dfbdd", "score": "0.52199566", "text": "func (bkt *BucketStore) Cursor() *Cursor {\n\t// Allocate and return a cursor.\n\treturn &Cursor{\n\t\tbucket: bkt,\n\t}\n}", "title": "" }, { "docid": "cd0f836dea70c377a9b634ecb2e2c4e6", "score": "0.5219841", "text": "func (s *Session) scanStructAll(rows *sql.Rows) error {\n\t// check if there is data waiting\n\t//if !rows.Next() {\n\t//\tif err := rows.Err(); err != nil {\n\t//\t\ts.GetIEngin().GetLogger().Error(err.Error())\n\t//\t\treturn err\n\t//\t}\n\t//\treturn sql.ErrNoRows\n\t//}\n\tvar sfs = structForScan(s.GetBindResult())\n\tfor rows.Next() {\n\t\tif s.GetUnion() != nil {\n\t\t\tvar union interface{}\n\t\t\terr := rows.Scan(&union)\n\t\t\tif err != nil {\n\t\t\t\ts.GetIEngin().GetLogger().Error(err.Error())\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ts.union = union\n\t\t\treturn err\n\t\t}\n\t\t// scan it\n\t\t//fmt.Printf(\"%#v \\n\",structForScan(s.GetBindResult()))\n\t\terr := rows.Scan(sfs...)\n\t\tif err != nil {\n\t\t\ts.GetIEngin().GetLogger().Error(err.Error())\n\t\t\treturn err\n\t\t}\n\t\t// 如果是union操作就不需要绑定数据直接返回, 否则就绑定数据\n\t\tif s.GetUnion() == nil {\n\t\t\t// 如果是多条数据集, 就插入到对应的结果集slice上\n\t\t\tif s.GetBindType() == OBJECT_STRUCT_SLICE {\n\t\t\t\t// add to the result slice\n\t\t\t\ts.GetBindResultSlice().Set(reflect.Append(s.GetBindResultSlice(),\n\t\t\t\t\treflect.Indirect(reflect.ValueOf(s.GetBindResult()))))\n\t\t\t}\n\t\t}\n\t}\n\n\treturn rows.Err()\n}", "title": "" }, { "docid": "dd28121e3d7c3dccbed882dd3e61500a", "score": "0.5203712", "text": "func aggregate(db datastore.Datastore) {\n\tagg := aggregator.New(db)\n\tagg.Run()\n\n\ttimeout := 1 * time.Minute\n\n\tfor {\n\t\tselect {\n\t\tcase <-time.After(timeout):\n\t\t\tagg.Run()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c3bc0af49c8ab24952b10505e4cceb84", "score": "0.5202496", "text": "func (db *DB) Aggregation(aggregation []bson.M, collection string) (interface{}, error) {\n\tsession := db.Session.Clone()\n\tdefer session.Close()\n\tc := session.DB(\"\").C(collection)\n\n\tpipe := c.Pipe(aggregation)\n\tresp := []bson.M{}\n\titer := pipe.Iter()\n\terr := iter.All(&resp)\n\n\treturn resp, err\n}", "title": "" }, { "docid": "45610c19d1b2bcd10d8105dab7035578", "score": "0.5179525", "text": "func m_Currency_Aggregates(rs CurrencySet, fieldNames ...models.FieldName) []m.CurrencyGroupAggregateRow {\n\tlines := rs.RecordCollection.Aggregates(fieldNames...)\n\tres := make([]m.CurrencyGroupAggregateRow, len(lines))\n\tfor i, l := range lines {\n\t\tres[i] = CurrencyGroupAggregateRow{\n\t\t\tvalues: l.Values.Wrap().(m.CurrencyData),\n\t\t\tcount: l.Count,\n\t\t\tcondition: q.CurrencyCondition{\n\t\t\t\tCondition: l.Condition,\n\t\t\t},\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "a11efa6a5b605e71cb677358bbe80a07", "score": "0.5176276", "text": "func (s *streamCacher) accumulateGroup() error {\n\tfor {\n\t\tnext, err := s.nextRow()\n\t\tif err != nil || next == nil {\n\t\t\treturn err\n\t\t}\n\t\tcmp, err := s.rows[0].Compare(&s.datumAlloc, s.ordering, next)\n\t\tif err != nil || cmp != 0 {\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "63deb72c39bc1b99ee2fb6f6831dc0d4", "score": "0.51734984", "text": "func (rs *ObjectResultSet) ForEach(fn func(*Object) error) error {\n\tfor rs.Next() {\n\t\trecord, err := rs.Get()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := fn(record); err != nil {\n\t\t\tif err == kallax.ErrStop {\n\t\t\t\treturn rs.Close()\n\t\t\t}\n\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "80cf2554d23503c7220080c3e9446c35", "score": "0.51462746", "text": "func (db *MapDb) Iterate(bucket Bucket) (iter Iterator) {\n\treturn nil\n}", "title": "" }, { "docid": "431d84d4672403ded8bfd2b3606c92d3", "score": "0.51424205", "text": "func (ag *aggregator) accumulateRow(row sqlbase.EncDatumRow) error {\n\tif err := ag.cancelChecker.Check(); err != nil {\n\t\treturn err\n\t}\n\t// The encoding computed here determines which bucket the non-grouping\n\t// datums are accumulated to.\n\tencoded, err := ag.encode(ag.scratch, row)\n\tif err != nil {\n\t\treturn err\n\t}\n\tag.scratch = encoded[:0]\n\n\tif _, ok := ag.buckets[string(encoded)]; !ok {\n\t\ts, err := ag.arena.AllocBytes(ag.ctx, encoded)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tag.buckets[s] = struct{}{}\n\t}\n\n\t// Feed the func holders for this bucket the non-grouping datums.\n\tfor i, a := range ag.aggregations {\n\t\tif a.FilterColIdx != nil {\n\t\t\tcol := *a.FilterColIdx\n\t\t\tif err := row[col].EnsureDecoded(&ag.inputTypes[col], &ag.datumAlloc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif row[*a.FilterColIdx].Datum != tree.DBoolTrue {\n\t\t\t\t// This row doesn't contribute to this aggregation.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t// Extract the corresponding arguments from the row to feed into the\n\t\t// aggregate function.\n\t\t// Most functions require at most one argument thus we separate\n\t\t// the first argument and allocation of (if applicable) a variadic\n\t\t// collection of arguments thereafter.\n\t\tvar firstArg tree.Datum\n\t\tvar otherArgs tree.Datums\n\t\tif len(a.ColIdx) > 1 {\n\t\t\totherArgs = make(tree.Datums, len(a.ColIdx)-1)\n\t\t}\n\t\tisFirstArg := true\n\t\tfor j, c := range a.ColIdx {\n\t\t\tif err := row[c].EnsureDecoded(&ag.inputTypes[c], &ag.datumAlloc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif isFirstArg {\n\t\t\t\tfirstArg = row[c].Datum\n\t\t\t\tisFirstArg = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\totherArgs[j-1] = row[c].Datum\n\t\t}\n\n\t\tif err := ag.funcs[i].add(ag.ctx, encoded, firstArg, otherArgs); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "834ae122c6bb43898d0ceab4389a5db8", "score": "0.5125486", "text": "func newCursor(b *bucket, bucketID []byte, cursorTyp cursorType) *cursor {\n\tvar dbIter, pendingIter iterator.Iterator\n\tswitch cursorTyp {\n\tcase ctKeys:\n\t\tkeyRange := util.BytesPrefix(bucketID)\n\t\tdbIter = b.tx.snapshot.NewIterator(keyRange)\n\t\tpendingKeyIter := newLdbTreapIter(b.tx, keyRange)\n\t\tpendingIter = pendingKeyIter\n\tcase ctBuckets:\n\t\t// The serialized bucket index key format is:\n\t\t// <bucketindexprefix><parentbucketid><bucketname>\n\t\tprefix := make([]byte, len(bucketIndexPrefix)+4)\n\t\tcopy(prefix, bucketIndexPrefix)\n\t\tcopy(prefix[len(bucketIndexPrefix):], bucketID)\n\t\tbucketRange := util.BytesPrefix(prefix)\n\n\t\tdbIter = b.tx.snapshot.NewIterator(bucketRange)\n\t\tpendingBucketIter := newLdbTreapIter(b.tx, bucketRange)\n\t\tpendingIter = pendingBucketIter\n\tcase ctFull:\n\t\tfallthrough\n\tdefault:\n\t\t// The serialized bucket index key format is:\n\t\t// <bucketindexprefix><parentbucketid><bucketname>\n\t\tprefix := make([]byte, len(bucketIndexPrefix)+4)\n\t\tcopy(prefix, bucketIndexPrefix)\n\t\tcopy(prefix[len(bucketIndexPrefix):], bucketID)\n\t\tbucketRange := util.BytesPrefix(prefix)\n\t\tkeyRange := util.BytesPrefix(bucketID)\n\n\t\t// Since both keys and buckets are needed from the database,\n\t\t// create an individual iterator for each prefix and then create\n\t\t// a merged iterator from them.\n\t\tdbKeyIter := b.tx.snapshot.NewIterator(keyRange)\n\t\tdbBucketIter := b.tx.snapshot.NewIterator(bucketRange)\n\t\titers := []iterator.Iterator{dbKeyIter, dbBucketIter}\n\t\tdbIter = iterator.NewMergedIterator(iters,\n\t\t\tcomparer.DefaultComparer, true)\n\n\t\t// Since both keys and buckets are needed from the pending keys,\n\t\t// create an individual iterator for each prefix and then create\n\t\t// a merged iterator from them.\n\t\tpendingKeyIter := newLdbTreapIter(b.tx, keyRange)\n\t\tpendingBucketIter := newLdbTreapIter(b.tx, bucketRange)\n\t\titers = []iterator.Iterator{pendingKeyIter, pendingBucketIter}\n\t\tpendingIter = iterator.NewMergedIterator(iters,\n\t\t\tcomparer.DefaultComparer, true)\n\t}\n\treturn &cursor{bucket: b, dbIter: dbIter, pendingIter: pendingIter}\n}", "title": "" }, { "docid": "1da5d8dde181a56d48766b0952ddca6d", "score": "0.5119606", "text": "func (m *Map) Iter() <-chan Tuple {\n\n\tsnap := m.Snapshot()\n\t// Fully buffered, trade memory for speed baby!\n\tret := make(chan Tuple, len(snap))\n\tgo func() {\n\t\tfor k, v := range snap {\n\t\t\tret <- Tuple{k, v}\n\t\t}\n\t\tclose(ret)\n\t}()\n\treturn ret\n}", "title": "" }, { "docid": "ddcae00ec4b4f0f6faeb536b13ee8859", "score": "0.51175976", "text": "func (adapter *Adapter) Aggregate(ctx context.Context, query rel.Query, mode string, field string) (int, error) {\n\tvar (\n\t\terr error\n\t\tout sql.NullInt64\n\t\tstatement, args = NewBuilder(adapter.Config).Aggregate(query, mode, field)\n\t)\n\n\tfinish := adapter.Instrument(ctx, \"adapter-aggregate\", statement)\n\tif adapter.Tx != nil {\n\t\terr = adapter.Tx.QueryRowContext(ctx, statement, args...).Scan(&out)\n\t} else {\n\t\terr = adapter.DB.QueryRowContext(ctx, statement, args...).Scan(&out)\n\t}\n\tfinish(err)\n\n\treturn int(out.Int64), err\n}", "title": "" }, { "docid": "a51711e4b1b668fe83b4d73b3af04937", "score": "0.51170796", "text": "func dbProcessedTransactionsIterator(tx *bolt.Tx) *processedTransactionsIter {\n\treturn &processedTransactionsIter{\n\t\tc: tx.Bucket(bucketProcessedTransactions).Cursor(),\n\t}\n}", "title": "" }, { "docid": "26defc1c59907d80202ad4f4420eba70", "score": "0.5100281", "text": "func (q *MongoQuery) Collect(ctx context.Context, db DB, ch chan<- Metric) {\n\tif ctx.Err() != nil {\n\t\tch <- NewInvalidMetric(errors.Wrap(q.logContext, ctx.Err()))\n\t\treturn\n\t}\n\n\tmongodb, err := db.MongoDB(q.logContext)\n\tif err != nil {\n\t\tch <- NewInvalidMetric(errors.Wrap(q.logContext, ctx.Err()))\n\t}\n\n\tc := mongodb.C(q.config.Collection)\n\n\tvar results []map[string]interface{}\n\n\tif err = c.Pipe(q.query).All(&results); err != nil {\n\t\tch <- NewInvalidMetric(errors.Wrap(q.logContext, ctx.Err()))\n\t}\n\n\tfor _, row := range results {\n\t\tdata, err := q.scanRow(row)\n\t\tif err != nil {\n\t\t\tch <- NewInvalidMetric(err)\n\t\t\tcontinue\n\t\t}\n\t\tfor _, mf := range q.metricFamilies {\n\t\t\tmf.Collect(data, ch)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "358997eb819860b8663e83330d3ccfbd", "score": "0.5093778", "text": "func (m *MongoService) Aggregate(s SourceID) *CommentStatistics {\r\n\tquery := []bson.M{\r\n\t\t{\"$match\": bson.M{\r\n\t\t\t\"source_id\": bson.M{\"$eq\": s},\r\n\t\t}},\r\n\t\t{\"$group\": bson.M{\r\n\t\t\t\"_id\": nil,\r\n\t\t\t\"count\": bson.M{\"$sum\": 1},\r\n\t\t\t\"grade\": bson.M{\"$avg\": \"$grade\"},\r\n\t\t}},\r\n\t}\r\n\tvar showsWithInfo []CommentStatistics\r\n\tctx := context.Background()\r\n\tres, err := m.collection.Aggregate(ctx, query)\r\n\tfmt.Printf(\"%vv\", res)\r\n\tif err != nil {\r\n\t\tlog.GetLogger().Error(err)\r\n\t} else {\r\n\t\terr = res.All(ctx, &showsWithInfo)\r\n\t\tif err != nil {\r\n\t\t\tlog.GetLogger().Error(err)\r\n\t\t}\r\n\t}\r\n\treturn &showsWithInfo[0]\r\n}", "title": "" }, { "docid": "fe6c49928798afe8259a8f92acefc775", "score": "0.5093245", "text": "func (a CursorIterators) Stats() CursorStats {\n\tvar stats CursorStats\n\tfor _, itr := range a {\n\t\tstats.Add(itr.Stats())\n\t}\n\treturn stats\n}", "title": "" }, { "docid": "4d44d27779feb199d2e6fa8af130ebf5", "score": "0.50929505", "text": "func (c *Collection) Scan(\n\tdesc bool,\n\tcursor Cursor,\n\tts *txn.Status,\n\titerator func(id string, obj geojson.Object, fields []float64) bool,\n) bool {\n\tdefer c.stats.Scan.record()()\n\tvar keepon = true\n\tvar count uint64\n\tvar offset uint64\n\tif cursor != nil {\n\t\toffset = cursor.Offset()\n\t\tcursor.Step(offset)\n\t}\n\titer := func(key string, value interface{}) bool {\n\t\tcount++\n\t\tif count <= offset {\n\t\t\treturn true\n\t\t}\n\t\tnextStep(count, cursor, ts)\n\t\tiitm := value.(*itemT)\n\t\tkeepon = iterator(iitm.id, iitm.obj, c.fieldValues.get(iitm.fieldValuesSlot))\n\t\treturn keepon\n\t}\n\tif desc {\n\t\tc.items.Reverse(iter)\n\t} else {\n\t\tc.items.Scan(iter)\n\t}\n\treturn keepon\n}", "title": "" }, { "docid": "d4976305e22b52ec8401d5f64114541d", "score": "0.5090702", "text": "func (m *metricMongodbatlasProcessCursors) emit(metrics pmetric.MetricSlice) {\n\tif m.config.Enabled && m.data.Gauge().DataPoints().Len() > 0 {\n\t\tm.updateCapacity()\n\t\tm.data.MoveTo(metrics.AppendEmpty())\n\t\tm.init()\n\t}\n}", "title": "" }, { "docid": "67fa3d1d8c0d5630333b72f01d4ff7d6", "score": "0.5088264", "text": "func (q MongoQuery) Iter() MongoDBIter {\n\treturn &MongoIter{Iter: q.Query.Iter()}\n}", "title": "" }, { "docid": "ed8b16a90013d37f9faff559a5f7ff72", "score": "0.5082379", "text": "func (q queryRetry) Iter() IterInterface {\n\tlog.Debug(\"running queryRetry Iter() method\")\n\n\treturn iterRetry{goCqlIter: q.goCqlQuery.Iter()}\n}", "title": "" }, { "docid": "6fd3780c18cffed500e36326174ee413", "score": "0.5073694", "text": "func (mc *mergeCursor) fill() {\n\tif !mc.done {\n\t\tmc.peeked = mc.underlying.Next()\n\t\tmc.done = (mc.peeked == nil)\n\t}\n}", "title": "" }, { "docid": "6d3c9ed283cff3005188d67c0ce4edac", "score": "0.50647795", "text": "func (aggr *aggregator) Aggregate(param aggrParam) <-chan map[string]interface{} {\n\taggrOut := make(chan map[string]interface{})\n\tf := flow.New().\n\t\tSource(func(out chan map[string]interface{}) {\n\t\t\terr := aggr.src.Read(param.Query, aggr.getSelectedFields(param), out)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}, aggr.shard).\n\t\tMap(func(data map[string]interface{}) flow.KeyValue {\n\t\t\tkey, val := aggr.assignGroup(param, data)\n\t\t\treturn flow.KeyValue{Key: key, Value: val}\n\t\t}).\n\t\tPartition(\n\t\t\taggr.partition,\n\t\t).\n\t\tReduceByKey(func(x int, y int) int {\n\t\t\treturn x + y\n\t\t}).\n\t\tMap(func(group string, count int) flow.KeyValue {\n\t\t\tk := strings.Split(group, \",\")\n\t\t\tv := map[string]int{\n\t\t\t\tstrings.Join(k[:len(k)-1], \",\"): count,\n\t\t\t}\n\t\t\t// key = date, value = [group]\n\t\t\treturn flow.KeyValue{Key: k[len(k)-1], Value: v}\n\t\t}).\n\t\tGroupByKey().\n\t\tMap(func(group string, values []map[string]int) map[string]interface{} {\n\t\t\t// { date, group1, group2, ... }\n\t\t\treturn aggr.flattenResult(group, values)\n\t\t}).AddOutput(aggrOut)\n\n\tgo f.Run()\n\treturn aggrOut\n}", "title": "" }, { "docid": "8cf72d50a9cc8eb887ca2bedd4a3d551", "score": "0.50628096", "text": "func (b *Bucket) Cursor() (kv.Cursor, error) {\n\treturn &Cursor{\n\t\tcursor: b.bucket.Cursor(),\n\t}, nil\n}", "title": "" }, { "docid": "5126db180c805e37c2d8f5bb57416e35", "score": "0.50594115", "text": "func (r *result) All(dst interface{}) (err error) {\n\n\tif r.c.parent.LoggingEnabled() {\n\t\tdefer func(start time.Time) {\n\t\t\tr.c.parent.Logger().Log(&db.QueryStatus{\n\t\t\t\tQuery: fmt.Sprintf(\"find(%s)\", mustJSON(r.queryChunks.Conditions)),\n\t\t\t\tErr: err,\n\t\t\t\tStart: start,\n\t\t\t\tEnd: time.Now(),\n\t\t\t})\n\t\t}(time.Now())\n\t}\n\n\terr = r.setCursor()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = r.iter.All(dst)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tr.Close()\n\n\treturn nil\n}", "title": "" }, { "docid": "3a145eb5f3ea4c77b409555771598334", "score": "0.50554436", "text": "func (n oracleCollector) Collect(ch chan<- prometheus.Metric) {\n\tbegin := time.Now()\n\tdsn := os.Getenv(\"DATA_SOURCE_NAME\")\n\tdb, err := sql.Open(\"goracle\", dsn)\n\tif err != nil {\n\t\tlog.Errorln(\"Error opening connection to database:\", err)\n\t\tch <- prometheus.MustNewConstMetric(oracleUpDesc, prometheus.GaugeValue, float64(0))\n\t\treturn\n\t}\n\tdefer db.Close()\n\n\tisUpRows, err := db.Query(\"SELECT * FROM dual\")\n\tif err != nil {\n\t\tlog.Errorln(\"Error pinging Pracle:\", err)\n\t\tch <- prometheus.MustNewConstMetric(oracleUpDesc, prometheus.GaugeValue, float64(0))\n\t\treturn\n\t}\n\tisUpRows.Close()\n\n\tch <- prometheus.MustNewConstMetric(oracleUpDesc, prometheus.GaugeValue, float64(1))\n\tch <- prometheus.MustNewConstMetric(scrapeDurationDesc, prometheus.GaugeValue, time.Since(begin).Seconds(), \"connection\")\n\n\tfor name, c := range n.Collectors {\n\t\tfunc(name string, c Collector) {\n\t\t\texecute(db, name, c, ch)\n\t\t}(name, c)\n\t}\n}", "title": "" }, { "docid": "56f0f4eecf1a07bc0a570bebfb53db06", "score": "0.5052639", "text": "func (e *NonAggrBatchExecutorImpl) project() {\n\t// Prepare for dimension evaluation.\n\te.prepareForDimEval(e.qc.OOPK.DimRowBytes, e.qc.OOPK.NumDimsPerDimWidth, e.stream)\n\n\te.qc.reportTimingForCurrentBatch(e.stream, &e.start, prepareForDimAndMeasureTiming)\n\t// for non-aggregation query, we always write from start for dimension output\n\te.evalDimensions(0)\n\t// uncompress the result from baseCount\n\te.expandDimensions(e.qc.OOPK.NumDimsPerDimWidth)\n\t// wait for stream to clean up non used buffer before final aggregation\n\tcgoutils.WaitForCudaStream(e.stream, e.qc.Device)\n\te.qc.OOPK.currentBatch.cleanupBeforeAggregation()\n}", "title": "" }, { "docid": "e53c2d83b479010d5aa444c04f851d49", "score": "0.50516206", "text": "func (this *Iter_Amazing_Insert) Each(fun func(*Row_Amazing_Insert) error) error {\n\tdefer this.rows.Close()\n\tfor {\n\t\tselect {\n\t\tcase <-this.ctx.Done():\n\t\t\treturn this.ctx.Err()\n\t\tdefault:\n\t\t\tif row, ok := this.Next(); !ok {\n\t\t\t\treturn nil\n\t\t\t} else if err := fun(row); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c27371d1a8e8e5475eece262e32a6665", "score": "0.504533", "text": "func (sm *streamMerger) computeBatch() error {\n\tsm.outputBuffer = sm.outputBuffer[:0]\n\n\tlrow := sm.left.advanceGroup()\n\trrow := sm.right.advanceGroup()\n\n\tif lrow == nil && rrow == nil {\n\t\treturn nil\n\t}\n\n\tcmp, err := sm.compare(lrow, rrow)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cmp < 0 {\n\t\t// lrow < rrow or rrow == nil, accumulate set of rows \"equal\" to lrow\n\t\t// and emit (lrow, nil) tuples.\n\t\tif err := sm.left.accumulateGroup(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, l := range sm.left.currentGroup() {\n\t\t\tsm.outputBuffer = append(sm.outputBuffer, [2]sqlbase.EncDatumRow{l, nil})\n\t\t}\n\t\treturn nil\n\t}\n\n\tif cmp > 0 {\n\t\t// rrow < lrow or lrow == nil, accumulate set of rows \"equal\" to rrow\n\t\t// and emit (nil, rrow) tuples.\n\t\tif err := sm.right.accumulateGroup(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tfor _, r := range sm.right.currentGroup() {\n\t\t\tsm.outputBuffer = append(sm.outputBuffer, [2]sqlbase.EncDatumRow{nil, r})\n\t\t}\n\t\treturn nil\n\t}\n\n\t// lrow == rrow, accumulate set of rows \"equal\" to lrow and set of rows\n\t// \"equal\" to rrow then emit cross product of the two sets ((lrow, rrow)\n\t// tuples).\n\tif err := sm.right.accumulateGroup(); err != nil {\n\t\treturn err\n\t}\n\tif err := sm.left.accumulateGroup(); err != nil {\n\t\treturn err\n\t}\n\n\t// Output cross-product.\n\tfor _, l := range sm.left.currentGroup() {\n\t\tfor _, r := range sm.right.currentGroup() {\n\t\t\tsm.outputBuffer = append(sm.outputBuffer, [2]sqlbase.EncDatumRow{l, r})\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "66e5321edeef694650bed42325b6cfca", "score": "0.50380754", "text": "func (t *Transaction) Cursor(name string) (*Cursor, error) {\n\tb := t.Bucket(name)\n\tif b == nil {\n\t\treturn nil, ErrBucketNotFound\n\t}\n\treturn b.cursor(), nil\n}", "title": "" }, { "docid": "d7a946321728add376bd964a84dff4b0", "score": "0.5020632", "text": "func (i memRowFinalIterator) Close() {}", "title": "" }, { "docid": "5e2ba2721a67fdeda4759e270ad47182", "score": "0.49977013", "text": "func (m *Map) Iter() <-chan Tuple {\n\n\tsnap := m.av.Load().(innerMap)\n\t// Fully buffered, trade memory for speed baby!\n\tret := make(chan Tuple, len(snap))\n\tgo func() {\n\t\tfor k, v := range snap {\n\t\t\tret <- Tuple{k, v}\n\t\t}\n\t\tclose(ret)\n\t}()\n\treturn ret\n}", "title": "" }, { "docid": "70f92dd35ce8dcfeda1654869cc49583", "score": "0.498505", "text": "func (rl *Relation) Aggregate(aggregate AttrInfo, aggrFunc AggrFunc) Relationer {\n\tvar RowLength int\n\tFirstHalf := make([]Column,0)\n\tSecondHalf := make([]Column,0)\n\tswitch rl.Columns[0].Signature.Type {\n\tcase INT:\n\t\tRowLength = len(rl.Columns[0].Data.([]int))\n\tcase FLOAT:\n\t\tRowLength = len(rl.Columns[0].Data.([]float64))\n\tcase STRING:\n\t\tRowLength = len(rl.Columns[0].Data.([]string))\n\t}\t\n\t//split the rows in half\n\tfor i:=0;i<len(rl.Columns);i++{\n\t\tFirstHalf = append(FirstHalf, rl.Columns[i])\n\t\tFirstHalf[i].Signature.Type = rl.Columns[i].Signature.Type \n\t\tSecondHalf = append(SecondHalf, rl.Columns[i])\n\t\tSecondHalf[i].Signature.Type = rl.Columns[i].Signature.Type \n\t\tswitch rl.Columns[i].Signature.Type{\t\t\t\n\t\t\tcase INT:\n\t\t\t\tFirstHalf[i].Data = rl.Columns[i].Data.([]int)[0:RowLength/2] \t\n\t\t\t\tSecondHalf[i].Data = rl.Columns[i].Data.([]int)[RowLength/2:] \t\n\t\t\tcase FLOAT:\n\t\t\t\tFirstHalf[i].Data = rl.Columns[i].Data.([]float64)[0:RowLength/2] \t\n\t\t\t\tSecondHalf[i].Data = rl.Columns[i].Data.([]float64)[RowLength/2:] \n\t\t\tcase STRING:\n\t\t\t\tFirstHalf[i].Data = rl.Columns[i].Data.([]string)[0:RowLength/2] \t\n\t\t\t\tSecondHalf[i].Data = rl.Columns[i].Data.([]string)[RowLength/2:] \n\t}\t}\t\n\tGoroutineFinished = append(GoroutineFinished,false,false)\n\t//aggregate each half\n\tgo agg(aggregate, aggrFunc, FirstHalf, false, 0)\n\tgo agg(aggregate, aggrFunc, SecondHalf, false, 1)\n\t//wait until both functions finished\n\tfor FinishedGoRoutines := 0; FinishedGoRoutines < 2;{\n\t\tif GoroutineFinished[FinishedGoRoutines] {FinishedGoRoutines++}}\n\t//combine both aggregations...\n\tfor i:=0;i<len(rl.Columns);i++{\n\t\tswitch FirstHalf[i].Signature.Type{\t\t\t\n\t\t\tcase INT:\n\t\t\t\tFirstHalf[i].Data = append(FirstHalf[i].Data.([]int),SecondHalf[i].Data.([]int)...) \t\t\t\t\n\t\t\tcase FLOAT:\n\t\t\t\tFirstHalf[i].Data = append(FirstHalf[i].Data.([]float64),SecondHalf[i].Data.([]float64)...)\t\t\t\t\n\t\t\tcase STRING:\n\t\t\t\tFirstHalf[i].Data = append(FirstHalf[i].Data.([]string),SecondHalf[i].Data.([]string)...) \t\t\t\t\n\t}\t}\n\t//...and aggregate them\n\tagg(aggregate,aggrFunc,FirstHalf,true, 1)\n\tfor i:=0;i<len(rl.Columns);i++{\n\trl.Columns[i].Data = FirstHalf[i].Data\n\t}\t\n\trl.Columns[len(rl.Columns)-1].Signature.Name = \"Aggregate\"\n\tif aggrFunc == COUNT {rl.Columns[len(rl.Columns)-1].Signature.Type = INT}\n\treturn rl\t\n}", "title": "" }, { "docid": "3c1aa1793dd49ce57c9bce87c6d3cb42", "score": "0.4984343", "text": "func (dq *DocQuery) Aggregate(fns ...AggregateFunc) *DocSelect {\n\treturn dq.Select().Aggregate(fns...)\n}", "title": "" }, { "docid": "894a69170646acff701b55efa8bb470e", "score": "0.49823523", "text": "func GetAll(c *mgo.Collection,\nquery map[string]interface{}, // TODO\nfields []string,\nsortBy []string,\noffset int,\nlimit int,\nresult interface{}) (err error) {\n\n\tresultv := reflect.ValueOf(result)\n\tif resultv.Kind() != reflect.Ptr || resultv.Elem().Kind() != reflect.Slice {\n\t\tpanic(\"result argument must be a slice address\")\n\t}\n\n\t// change the ids to be object ids before we go\n\tif len(query) != 0 {\n\t\tConvertObjectIds(query)\n\t}\n\n\terr = c.Find(query).Select(ToBsonMap(fields...)).Skip(offset).Limit(limit).Sort(sortBy...).All(result)\n\n\treturn\n}", "title": "" }, { "docid": "f6c5da69deab0dcfb93735d5fb326cd1", "score": "0.49796978", "text": "func (p *IndexedPool) Recent(start *gnomon.Cursor, count int, convert func(key []byte, value []byte) interface{}) ([]interface{}, *gnomon.Cursor, error) {\n\tif nil == start {\n\t\tstart = &gnomon.Cursor{}\n\t}\n\n\tif count <= 0 {\n\t\treturn nil, nil, fault.ErrInvalidCount\n\t}\n\n\tp.RLock()\n\tdefer p.RUnlock()\n\n\ttimestampRange := util.Range{\n\t\tStart: p.timestampKey(start),\n\t\tLimit: []byte{p.prefix, timestampLimitCode},\n\t}\n\n\titer := poolData.database.NewIterator(&timestampRange, nil)\n\tdefer iter.Release()\n\n\tn := 0\n\ta := make([]interface{}, 0, count)\n\n\tthisKey := make([]byte, prefixSize+8+4) // prefix + int64 + int32\n\n\tfor iter.Next() {\n\t\tprefixedData := iter.Value()\n\t\tdataValue, err := poolData.database.Get(prefixedData, nil)\n\t\tif leveldb.ErrNotFound == err {\n\t\t\tcontinue\n\t\t}\n\n\t\tthisKey = iter.Key()\n\n\t\tif nil == convert {\n\t\t\tdataKey := make([]byte, len(prefixedData)-prefixSize)\n\t\t\tcopy(dataKey, prefixedData[prefixSize:])\n\t\t\te := Element{\n\t\t\t\tKey: dataKey,\n\t\t\t\tValue: dataValue,\n\t\t\t}\n\t\t\ta = append(a, e)\n\t\t} else {\n\t\t\ta = append(a, convert(prefixedData[prefixSize:], dataValue))\n\t\t}\n\t\tn += 1\n\t\tif n >= count {\n\t\t\tbreak\n\t\t}\n\n\t}\n\titer.Release()\n\n\t// only increment the cursor if actual data was found\n\t// otherwise preserve\n\tif n > 0 {\n\t\tnextStart := gnomon.Cursor{}\n\t\terr := nextStart.UnmarshalBinary(thisKey[prefixSize:])\n\t\tif nil != err {\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tnextStart.Next()\n\n\t\treturn a, &nextStart, iter.Error()\n\t}\n\treturn a, start, iter.Error()\n\n}", "title": "" }, { "docid": "021a17e25db45eb479c2afbc68cc6c1e", "score": "0.49768126", "text": "func (q *query) Iter() IteratorI {\n\treturn q.Query.Iter()\n}", "title": "" }, { "docid": "9092274c527737c6e20c41d09bfd4c9a", "score": "0.49756873", "text": "func (db *DB) Scan(begin, end interface{}, maxRows int64) ([]KeyValue, error) {\n\tr, err := runOneResult(db, db.B.Scan(begin, end, maxRows))\n\treturn r.Rows, err\n}", "title": "" }, { "docid": "d43386f9152eafb0ee5eb1b9ef11065f", "score": "0.49750844", "text": "func (iterator *Iterator) All(yield func([]interface{})) error {\n\tif iterator.batchSize == 0 {\n\t\treturn nil\n\t}\n\n\tconnection := iterator.storage.checkout()\n\tdefer iterator.storage.release(connection)\n\n\tfor data, err := iterator.next(connection); ; data, err = iterator.next(connection) {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tyield(iterator.handle(data))\n\n\t\tif iterator.cursor == START {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "72ac6df666acd613b2b9468eb8fd3652", "score": "0.49738488", "text": "func (tq *Query) Iter() *Iter {\n\tspan := tq.newChildSpan(tq.ctx)\n\titer := tq.Query.Iter()\n\tspan.SetTag(ext.CassandraRowCount, strconv.Itoa(iter.NumRows()))\n\tspan.SetTag(ext.CassandraConsistencyLevel, tq.GetConsistency().String())\n\n\tcolumns := iter.Columns()\n\tif len(columns) > 0 {\n\t\tspan.SetTag(ext.CassandraKeyspace, columns[0].Keyspace)\n\t}\n\ttIter := &Iter{iter, span}\n\tif tIter.Host() != nil {\n\t\ttIter.span.SetTag(ext.TargetHost, tIter.Iter.Host().HostID())\n\t\ttIter.span.SetTag(ext.TargetPort, strconv.Itoa(tIter.Iter.Host().Port()))\n\t\ttIter.span.SetTag(ext.CassandraCluster, tIter.Iter.Host().DataCenter())\n\t}\n\treturn tIter\n}", "title": "" }, { "docid": "4acac242e0ec2ebb3a80760f8e3e984c", "score": "0.4973723", "text": "func (sc *sequenceChunker) finalizeCursor(ctx context.Context) error {\n\tfor sc.cur.valid() {\n\t\titem, err := sc.cur.current()\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif ok, err := sc.Append(ctx, item); err != nil {\n\t\t\treturn err\n\t\t} else if ok && sc.cur.atLastItem() {\n\t\t\tbreak // boundary occurred at same place in old & new sequence\n\t\t}\n\n\t\t_, err = sc.cur.advance(ctx)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif sc.cur.parent != nil {\n\t\t_, err := sc.cur.parent.advance(ctx)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Invalidate this cursor, since it is now inconsistent with its parent\n\t\tsc.cur.parent = nil\n\t\tsc.cur.seq = nil\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fd27700fa03625b34a839a974ec35725", "score": "0.4967537", "text": "func (docstore *DocStore) query(L *lua.LState, collection string, query *query, cursor string, limit int, fetchPointers bool, asOf int64) ([]map[string]interface{}, map[string]interface{}, *executionStats, error) {\n\t// Init some stuff\n\ttstart := time.Now()\n\tstats := &executionStats{}\n\tvar err error\n\tvar docPointers map[string]interface{}\n\tpointers := map[string]interface{}{}\n\tdocs := []map[string]interface{}{}\n\n\t// Tweak the internal query batch limit\n\tfetchLimit := int(float64(limit) * 1.3)\n\n\t// Select the ID iterator (XXX sort indexes are a WIP)\n\tvar it IDIterator\n\tvar desc bool\n\tif query.sortIndex == \"\" {\n\t\tquery.sortIndex = \"-_id\"\n\t}\n\tif strings.HasPrefix(query.sortIndex, \"-\") {\n\t\tdesc = true\n\t\tquery.sortIndex = query.sortIndex[1:]\n\t}\n\n\tif query.sortIndex == \"\" || query.sortIndex == \"_id\" {\n\t\t//\tUse the default ID iterator (iter IDs in reverse order\n\t\tit = newNoIndexIterator(docstore.kvStore)\n\t} else {\n\t\tit, err = docstore.GetSortIndex(collection, query.sortIndex)\n\t\tif err != nil {\n\t\t\treturn nil, nil, stats, err\n\t\t}\n\t}\n\tstats.Index = it.Name()\n\n\t// Select the query matcher\n\tvar qmatcher QueryMatcher\n\tswitch {\n\tcase query.isMatchAll():\n\t\tstats.Engine = \"match_all\"\n\t\tqmatcher = &MatchAllEngine{}\n\tdefault:\n\t\tqmatcher, err = docstore.newLuaQueryEngine(L, query)\n\t\tif err != nil {\n\t\t\treturn nil, nil, stats, err\n\t\t}\n\t\tstats.Engine = \"lua\"\n\t}\n\tdefer qmatcher.Close()\n\n\tstart := cursor\n\t// Init the logger\n\tqLogger := docstore.logger.New(\"query\", query, \"query_engine\", stats.Engine, \"id\", logext.RandId(8))\n\tqLogger.Info(\"new query\")\n\nQUERY:\n\tfor {\n\t\t// Loop until we have the number of requested documents, or if we scanned everything\n\t\tqLogger.Debug(\"internal query\", \"limit\", limit, \"start\", start, \"cursor\", cursor, \"desc\", desc, \"nreturned\", stats.NReturned)\n\t\t// FIXME(tsileo): use `PrefixKeys` if ?sort=_id (-_id by default).\n\n\t\t// Fetch a batch from the iterator\n\t\t_ids, cursor, err := it.Iter(collection, start, desc, fetchLimit, asOf)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfor _, _id := range _ids {\n\t\t\tif _id.Flag() == flagDeleted {\n\t\t\t\tqLogger.Debug(\"skipping deleted doc\", \"_id\", _id, \"as_of\", asOf)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tqLogger.Debug(\"fetch doc\", \"_id\", _id, \"as_of\", asOf)\n\t\t\tstats.Cursor = _id.Cursor()\n\t\t\tdoc := map[string]interface{}{}\n\t\t\tvar err error\n\t\t\t// Fetch the version tied to the ID (the iterator is taking care of selecting an ID version)\n\t\t\tif _id, docPointers, err = docstore.Fetch(collection, _id.String(), &doc, true, fetchPointers, _id.Version()); err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tstats.TotalDocsExamined++\n\n\t\t\t// Check if the doc match the query\n\t\t\tok, err := qmatcher.Match(doc)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, stats, err\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// The document matches the query\n\t\t\tif fetchPointers {\n\t\t\t\tfor k, v := range docPointers {\n\t\t\t\t\tpointers[k] = v\n\t\t\t\t}\n\t\t\t}\n\t\t\tdocs = append(docs, doc)\n\t\t\tstats.NReturned++\n\t\t\tstats.LastID = _id.String()\n\t\t\tif stats.NReturned == limit {\n\t\t\t\tbreak QUERY\n\t\t\t}\n\t\t}\n\t\tif len(_ids) == 0 {\n\t\t\tbreak\n\t\t}\n\t\tstart = cursor\n\t}\n\n\tduration := time.Since(tstart)\n\tqLogger.Debug(\"scan done\", \"duration\", duration, \"nReturned\", stats.NReturned, \"nQueryCached\", stats.NQueryCached, \"scanned\", stats.TotalDocsExamined, \"cursor\", stats.Cursor)\n\tstats.ExecutionTimeNano = duration.Nanoseconds()\n\treturn docs, pointers, stats, nil\n}", "title": "" }, { "docid": "cd79c942f6edda35e8bf0a77ba5d69df", "score": "0.49652234", "text": "func (db *MemoryStore) Iter() <-chan es.Event {\n\tc := make(chan es.Event)\n\n\tf := func() {\n\t\tdb.Lock()\n\t\tdefer db.Unlock()\n\n\t\tfor _, event := range db.Data[db.Namespace] {\n\t\t\tc <- event\n\t\t}\n\t\tclose(c)\n\t}\n\tgo f()\n\n\treturn c\n}", "title": "" }, { "docid": "67ac3731a995b1dcf279a88d601dd49c", "score": "0.49647185", "text": "func (i *iterator) cur() *FileMetadata {\n\tif invariants.Enabled && !i.valid() {\n\t\tpanic(\"btree iterator.cur invoked on invalid iterator\")\n\t}\n\treturn i.n.items[i.pos]\n}", "title": "" }, { "docid": "400179da030c1895ec0b09560fdd0f28", "score": "0.49605882", "text": "func (r *Reader) Aggregation() []string { return r.aggregation }", "title": "" }, { "docid": "bb904cfa18da050831cea62db1140aed", "score": "0.49549413", "text": "func (t *Processlist) Collect(dbh *sql.DB) {\n\tlib.Logger.Println(\"Processlist.Collect() - starting collection of data\")\n\tstart := time.Now()\n\n\tt.current = select_processlist(dbh)\n\tlib.Logger.Println(\"t.current collected\", len(t.current), \"row(s) from SELECT\")\n\n\tt.processlist2by_user()\n\n\tt.results.Sort()\n\t// lib.Logger.Println( \"- collecting t.totals from t.results\" )\n\tt.totals = t.results.totals()\n\n\tlib.Logger.Println(\"Processlist.Collect() END, took:\", time.Duration(time.Since(start)).String())\n}", "title": "" }, { "docid": "c600747518bc71237a367462886448fe", "score": "0.49542528", "text": "func _allocateCursor(tls *crt.TLS, _p *TVdbe, _iCur int32, _nField int32, _iDb int32, _eCurType uint8) (r0 *XVdbeCursor) {\n\tvar _nByte int32\n\tvar _pMem *XMem\n\tvar _pCx *XVdbeCursor\n\t_pMem = func() *XMem {\n\t\tif _iCur > int32(0) {\n\t\t\treturn elem25((*XMem)(_p.XaMem), uintptr(_p.XnMem-_iCur))\n\t\t}\n\t\treturn (*XMem)(_p.XaMem)\n\t}()\n\t_pCx = nil\n\t_nByte = int32((uint64(120) + (uint64(8) * uint64(_nField))) + uint64(func() int32 {\n\t\tif int32(_eCurType) == int32(0) {\n\t\t\treturn _sqlite3BtreeCursorSize(tls)\n\t\t}\n\t\treturn int32(0)\n\t}()))\n\tfunc() {\n\t\tif _iCur < int32(0) || _iCur >= _p.XnCursor {\n\t\t\tcrt.X__builtin_fprintf(tls, Xstderr, str(134), unsafe.Pointer(str(170)), int32(78418), unsafe.Pointer(&_allocateCursorØ00__func__Ø000), unsafe.Pointer(str(76219)))\n\t\t\tcrt.X__builtin_abort(tls)\n\t\t}\n\t}()\n\tif (*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur))) != nil {\n\t\t_sqlite3VdbeFreeCursor(tls, _p, *elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)))\n\t\t*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)) = nil\n\t}\n\tif int32(0) != _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) {\n\t\tgoto _8\n\t}\n\t*elem79((**XVdbeCursor)(unsafe.Pointer(_p.XapCsr)), uintptr(_iCur)) = store87(&_pCx, (*XVdbeCursor)(unsafe.Pointer(_pMem.Xz)))\n\tcrt.Xmemset(tls, unsafe.Pointer(_pCx), int32(0), uint64(40))\n\t_pCx.XeCurType = _eCurType\n\t_pCx.XiDb = int8(_iDb)\n\t_pCx.XnField = int16(_nField)\n\t_pCx.XaOffset = elem31((*uint32)(unsafe.Pointer(&_pCx.XaType)), uintptr(_nField))\n\tif int32(_eCurType) == int32(0) {\n\t\t*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc)))) = (*XBtCursor)(unsafe.Pointer(elem1(_pMem.Xz, uintptr(uint64(120)+(uint64(8)*uint64(_nField))))))\n\t\t_sqlite3BtreeCursorZero(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer(&_pCx.Xuc))))\n\t}\n_8:\n\treturn _pCx\n}", "title": "" }, { "docid": "d107ec35ae94ba181e1147720a50e749", "score": "0.4937643", "text": "func (iq *ItemQuery) Aggregate(fns ...AggregateFunc) *ItemSelect {\n\treturn iq.Select().Aggregate(fns...)\n}", "title": "" }, { "docid": "23b0bb222cc246d506b439ea1cc545f6", "score": "0.49301127", "text": "func (d *DB) QueryIter(ctx context.Context, statement string, fields []string, args ...interface{}) (connection.ResultFetchIter, error) {\n\tvar rows pgx.Rows\n\tvar err error\n\tvar connQ func(context.Context, string, ...interface{}) (pgx.Rows, error)\n\tif d.tx != nil {\n\t\tconnQ = d.tx.Query\n\t} else if d.conn != nil {\n\t\tconnQ = d.conn.Query\n\t} else {\n\t\treturn nil, gaumErrors.NoDB\n\t}\n\n\tif len(args) != 0 {\n\t\trows, err = connQ(ctx, statement, args...)\n\t} else {\n\t\trows, err = connQ(ctx, statement)\n\t}\n\tif err != nil {\n\t\treturn func(interface{}) (bool, func(), error) { return false, func() {}, nil },\n\t\t\terrors.Wrap(err, \"querying database\")\n\t}\n\n\tvar fieldMap map[string]reflect.StructField\n\tvar typeName string\n\tif !rows.Next() {\n\t\treturn func(interface{}) (bool, func(), error) { return false, func() {}, nil },\n\t\t\tsql.ErrNoRows\n\t}\n\tif len(fields) == 0 || (len(fields) == 1 && fields[0] == \"*\") {\n\t\t// This seems to make a query each time so perhaps it goes outside.\n\t\tsqlQueryfields := rows.FieldDescriptions()\n\t\tfields = make([]string, len(sqlQueryfields), len(sqlQueryfields))\n\t\tfor i, v := range sqlQueryfields {\n\t\t\tfields[i] = string(v.Name)\n\t\t}\n\t}\n\treturn func(destination interface{}) (bool, func(), error) {\n\t\tvar err error\n\t\tif reflect.TypeOf(destination).Elem().Name() != typeName {\n\t\t\ttypeName, fieldMap, err = srm.MapFromPtrType(destination, []reflect.Kind{}, []reflect.Kind{\n\t\t\t\treflect.Map, reflect.Slice,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\tdefer rows.Close()\n\t\t\t\treturn false, func() {}, errors.Wrapf(err, \"cant fetch data into %T\", destination)\n\t\t\t}\n\t\t}\n\t\tfieldRecipients := srm.FieldRecipientsFromType(d.logger, fields, fieldMap, destination)\n\n\t\terr = rows.Scan(fieldRecipients...)\n\t\tif err != nil {\n\t\t\tdefer rows.Close()\n\t\t\treturn false, func() {}, errors.Wrap(err,\n\t\t\t\t\"scanning values into recipient, connection was closed\")\n\t\t}\n\n\t\treturn rows.Next(), rows.Close, rows.Err()\n\t}, nil\n}", "title": "" }, { "docid": "0154a65e350ff9e8b99fce5a11af78c5", "score": "0.4915232", "text": "func (this *Iter_Amazing_SelectById) Each(fun func(*Row_Amazing_SelectById) error) error {\n\tdefer this.rows.Close()\n\tfor {\n\t\tselect {\n\t\tcase <-this.ctx.Done():\n\t\t\treturn this.ctx.Err()\n\t\tdefault:\n\t\t\tif row, ok := this.Next(); !ok {\n\t\t\t\treturn nil\n\t\t\t} else if err := fun(row); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4f764be9636109a9725c4f1ae2df5e3a", "score": "0.4910113", "text": "func EachResult(cur Cursor, fn func(ResultSet) error) error {\n\tfor {\n\t\tresult, err := cur.NextSet()\n\t\tif 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\n\t\tif err := fn(result); err != nil {\n\t\t\tif err == ErrStop {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5adddaad4260e6686a2bf2f8444fd494", "score": "0.49092078", "text": "func (t *task) entityLoop(session *r.Session) {\n\tlog.Println(\"Executing database query\")\n\tcursor, err := t.query.Run(session)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\tdefer cursor.Close()\n\tvar row map[string]interface{}\n\tfor cursor.Next(&row) {\n\t\tt.results <- t.extractor(row)\n\t}\n\n\tif err = cursor.Err(); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tclose(t.results)\n}", "title": "" }, { "docid": "694047a813c794813d1edb9d96dc81b3", "score": "0.49089766", "text": "func (db *BoltAPI) getRecords(c *bolt.Cursor) (records []Record) {\n\tvar (\n\t\ti int\n\t\tcounter int\n\t)\n\n\t// [ maxOffset * (db.offset - 1); maxOffset * db.offset )\n\tfor k, v := c.First(); k != nil; k, v = c.Next() {\n\t\tif maxOffset*(db.pages.top()-1) <= i && i < maxOffset*db.pages.top() {\n\t\t\tvar r Record\n\t\t\tif v == nil {\n\t\t\t\tr.T = bucketTemplate\n\t\t\t\tr.Key = converters.ConvertKey(k)\n\t\t\t} else {\n\t\t\t\tr.T = recordTemplate\n\t\t\t\tr.Key = converters.ConvertKey(k)\n\t\t\t\tr.Value = converters.ConvertValue(v)\n\t\t\t}\n\t\t\trecords = append(records, r)\n\t\t}\n\t\ti++\n\t\tcounter++\n\t}\n\n\t// Updating number of records\n\tdb.recordsAmount = counter\n\n\tsortRecords(records)\n\treturn records\n}", "title": "" }, { "docid": "1896216898617811d06fc0b952188237", "score": "0.49069154", "text": "func (e *ArangoStore) RunQuery(ctx context.Context, query string, bindVars map[string]interface{}, document interface{}) ([]interface{}, error) {\n\tlog.Printf(\"input query = %s\", query)\n\t// Empty DocList\n\tdocList := []interface{}{}\n\n\tcursor, err := e.connvars.db.Query(ctx, query, bindVars)\n\tif err != nil {\n\t\tcursor.Close()\n\t\treturn nil, fmt.Errorf(\"query failed with reason %w\", err)\n\t}\n\tdefer cursor.Close()\n\n\tfor {\n\t\tmeta, rc := cursor.ReadDocument(ctx, document)\n\t\tlog.Printf(\"returned from readDocument %v\", rc)\n\n\t\tif driver.IsNoMoreDocuments(rc) {\n\t\t\tlog.Printf(\"no more documents Left\")\n\t\t\tbreak\n\t\t} else if rc != nil {\n\t\t\terr = rc\n\t\t\tbreak\n\t\t} else {\n\t\t\tswitch t := document.(type) {\n\t\t\tcase *HardwareIdentityWrapper:\n\t\t\t\tvar lHwIDWrapper HardwareIdentityWrapper\n\t\t\t\tlHwIDWrapper.ID = t.ID\n\t\t\t\tlHwIDWrapper.ID.Entity = make([]PsaEntity, len(t.ID.Entity))\n\t\t\t\tcopy(lHwIDWrapper.ID.Entity, t.ID.Entity)\n\n\t\t\t\t// Append the document to the list\n\t\t\t\tdocList = append(docList, lHwIDWrapper)\n\t\t\tcase *SoftwareIdentityWrapper:\n\t\t\t\tvar lSwIDWrapper SoftwareIdentityWrapper\n\t\t\t\tlSwIDWrapper.ID = t.ID\n\t\t\t\tlSwIDWrapper.ID.Entity = make([]PsaEntity, len(t.ID.Entity))\n\t\t\t\tcopy(lSwIDWrapper.ID.Entity, t.ID.Entity)\n\t\t\t\tlSwIDWrapper.ID.Payload = make([]ResourceCollection, len(t.ID.Payload))\n\t\t\t\tfor index, resource := range t.ID.Payload {\n\t\t\t\t\tlSwIDWrapper.ID.Payload[index].Resources = make([]Resource, len(resource.Resources))\n\t\t\t\t\tcopy(lSwIDWrapper.ID.Payload[index].Resources, resource.Resources)\n\t\t\t\t}\n\n\t\t\t\t// Append the document to the list\n\t\t\t\tdocList = append(docList, lSwIDWrapper)\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"document fetch failed: unsupported doc type\")\n\t\t\t}\n\t\t}\n\t\tlog.Printf(\"got doc with key '%s' from query\", meta.Key)\n\t}\n\treturn docList, err\n}", "title": "" }, { "docid": "08ad82b9ea02f5b9fbbeb84b127008f3", "score": "0.49060005", "text": "func (agb *ArticleGroupBy) Scan(ctx context.Context, v interface{}) error {\n\treturn agb.sqlScan(ctx, v)\n}", "title": "" }, { "docid": "250efe449fcaec3fe1c692d0ae3c759e", "score": "0.48918507", "text": "func (l *LimitedTx) Cursor() *bolt.Cursor {\n\treturn l.tx.Cursor()\n}", "title": "" }, { "docid": "887ec88682ed6f7130ef900dc0da2690", "score": "0.48867026", "text": "func (mongoQuery MongoQuery) GetAll() (interface{}, *fiber.Error) {\n\t//get a collection , context, cancel func\n\tcollection, ctx, cancel := createCtxAndUserCol(mongoQuery.CollectionName)\n\tdefer cancel()\n\n\t//create an empty array to store all fields from collection\n\tvar data []bson.M\n\n\t//get all user record\n\tcur, err := collection.Find(ctx, bson.D{})\n\tif err != nil {\n\t\treturn nil, fiber.NewError(500, err.Error())\n\t}\n\tdefer cur.Close(ctx)\n\t//map data to user variable\n\tif err = cur.All(ctx, &data); err != nil {\n\t\treturn nil, fiber.NewError(500, err.Error())\n\t}\n\t//response data to client\n\tif data == nil {\n\t\treturn []bson.M{}, nil\n\t}\n\treturn data, nil\n}", "title": "" }, { "docid": "989319d6370c343f40035d654572821d", "score": "0.48844534", "text": "func (tc *chunker[S]) finalizeCursor(ctx context.Context) (err error) {\n\tfor tc.cur.Valid() {\n\t\tvar sz uint64\n\t\tsz, err = tc.cur.currentSubtreeSize()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tvar ok bool\n\t\tok, err = tc.append(ctx,\n\t\t\ttc.cur.CurrentKey(),\n\t\t\ttc.cur.currentValue(),\n\t\t\tsz)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif ok && tc.cur.atNodeEnd() {\n\t\t\tbreak // boundary occurred at same place in old & new Node\n\t\t}\n\n\t\terr = tc.cur.advance(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif tc.cur.parent != nil {\n\t\terr := tc.cur.parent.advance(ctx)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Invalidate this cursor to mark it finalized.\n\t\ttc.cur.nd = Node{}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "df12ae041d062a0ee0d616a3e4c16643", "score": "0.48740917", "text": "func (self *syncDb) dbRead(useBatches bool, counter uint64, fun func(interface{}, chan bool) bool) {\n\tkey := make([]byte, 42)\n\tcopy(key, self.start)\n\tbinary.BigEndian.PutUint64(key[34:], counter)\n\tvar batches, n, cnt, total int\n\tvar more bool\n\tvar entry *syncDbEntry\n\tvar it iterator.Iterator\n\tvar del *leveldb.Batch\n\tbatchSizes := make(chan int)\n\n\tfor {\n\t\t// if useBatches is false, cnt is not set\n\t\tif useBatches {\n\t\t\t// this could be called before all cnt items sent out\n\t\t\t// so that loop is not blocking while delivering\n\t\t\t// only relevant if cnt is large\n\t\t\tselect {\n\t\t\tcase self.batch <- batchSizes:\n\t\t\tcase <-self.quit:\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// wait for the write to finish and get the item count in the next batch\n\t\t\tcnt = <-batchSizes\n\t\t\tbatches++\n\t\t\tif cnt == 0 {\n\t\t\t\t// empty\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tit = self.db.NewIterator()\n\t\tit.Seek(key)\n\t\tif !it.Valid() {\n\t\t\tcopy(key, self.start)\n\t\t\tuseBatches = true\n\t\t\tcontinue\n\t\t}\n\t\tdel = new(leveldb.Batch)\n\t\tlog.Trace(fmt.Sprintf(\"syncDb[%v/%v]: new iterator: %x (batch %v, count %v)\", self.key.Log(), self.priority, key, batches, cnt))\n\n\t\tfor n = 0; !useBatches || n < cnt; it.Next() {\n\t\t\tcopy(key, it.Key())\n\t\t\tif len(key) == 0 || key[0] != 0 {\n\t\t\t\tcopy(key, self.start)\n\t\t\t\tuseBatches = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tval := make([]byte, 40)\n\t\t\tcopy(val, it.Value())\n\t\t\tentry = &syncDbEntry{key, val}\n\t\t\t// log.Trace(fmt.Sprintf(\"syncDb[%v/%v] - %v, batches: %v, total: %v, session total from db: %v/%v\", self.key.Log(), self.priority, self.key.Log(), batches, total, self.dbTotal, self.total))\n\t\t\tmore = fun(entry, self.quit)\n\t\t\tif !more {\n\t\t\t\t// quit received when waiting to deliver entry, the entry will not be deleted\n\t\t\t\tlog.Trace(fmt.Sprintf(\"syncDb[%v/%v] batch %v quit after %v/%v items\", self.key.Log(), self.priority, batches, n, cnt))\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// since subsequent batches of the same db session are indexed incrementally\n\t\t\t// deleting earlier batches can be delayed and parallelised\n\t\t\t// this could be batch delete when db is idle (but added complexity esp when quitting)\n\t\t\tdel.Delete(key)\n\t\t\tn++\n\t\t\ttotal++\n\t\t}\n\t\tlog.Debug(fmt.Sprintf(\"syncDb[%v/%v] - db session closed, batches: %v, total: %v, session total from db: %v/%v\", self.key.Log(), self.priority, batches, total, self.dbTotal, self.total))\n\t\tself.db.Write(del) // this could be async called only when db is idle\n\t\tit.Release()\n\t}\n}", "title": "" }, { "docid": "18e88a507f9e05a7078ec14d7ddd2a27", "score": "0.48683023", "text": "func (this *Amazing_InsertIter) Each(fun func(*Amazing_InsertRow) error) error {\n\tfor {\n\t\tselect {\n\t\tcase <-this.ctx.Done():\n\t\t\treturn this.ctx.Err()\n\t\tdefault:\n\t\t\tif row, ok := this.Next(); !ok {\n\t\t\t\treturn nil\n\t\t\t} else if err := fun(row); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4dcab7ab06988a53ef072fe3d94de9ef", "score": "0.486674", "text": "func (s *TxStoreBase) Iterate(query Query, fn IterateFn) error {\n\tif err := s.IsDone(); err != nil {\n\t\treturn err\n\t}\n\treturn s.BatchedStore.Iterate(query, fn)\n}", "title": "" }, { "docid": "eb90116a4301229b21aac44cf8c57d7a", "score": "0.48593467", "text": "func (rd *BadgerStore) Each(fn nstorage.EachItem) error {\n\treturn rd.Db.View(func(txn *badger.Txn) error {\n\t\tvar iterator = txn.NewIterator(rd.iter)\n\t\tdefer iterator.Close()\n\n\t\tfor iterator.Rewind(); iterator.Valid(); iterator.Next() {\n\t\t\tvar item = iterator.Item()\n\t\t\tif item.IsDeletedOrExpired() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar stop = false\n\t\t\tvar err = item.Value(func(value []byte) error {\n\t\t\t\tif dataErr := fn(value, string(item.Key())); dataErr != nil {\n\t\t\t\t\tstop = true\n\t\t\t\t\tif nerror.IsAny(dataErr, nstorage.ErrJustStop) {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\treturn dataErr\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\n\t\t\tif err != nil {\n\t\t\t\treturn nerror.WrapOnly(err)\n\t\t\t}\n\n\t\t\tif stop {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "529339604666527f273e394b8b448fb8", "score": "0.48532242", "text": "func (db *DB) Scan(begin, end interface{}, maxRows int64) ([]KeyValue, error) {\n\treturn db.scan(begin, end, maxRows, false, roachpb.CONSISTENT)\n}", "title": "" }, { "docid": "478d8e03844e0799d87c614bba34242a", "score": "0.4851126", "text": "func (c *Cursor) row() {\n\tc.nextVal = make([]interface{}, len(c.readers), len(c.readers))\n\tfor i, reader := range c.readers {\n\t\tc.nextVal[i] = reader.Value()\n\t}\n}", "title": "" }, { "docid": "c5abc77bb1cfed9c506ffe32cf62aaa4", "score": "0.4849109", "text": "func (q *Query) Exec() *Iterator {\n\tif q.root != nil {\n\t\tq = q.root\n\t}\n\tif q.closed {\n\t\tpanic(errors.New(\"Exec call on already closed query. You shoud create new Query\"))\n\t}\n\tif q.executed {\n\t\tpanic(errors.New(\"Exec call on already executed query. You shoud create new Query\"))\n\t}\n\tq.executed = true\n\n\treturn q.db.execQuery(q)\n}", "title": "" }, { "docid": "1a4923c584a1e131b6576b216fc3c3bc", "score": "0.48490188", "text": "func (b *GetBlockedQueryBuilder) Collect(ctx context.Context) ([]Elem, error) {\n\titer := b.Iter()\n\tc, err := iter.Total(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get total\")\n\t}\n\n\tr := make([]Elem, 0, c)\n\tfor iter.Next(ctx) {\n\t\tr = append(r, iter.Value())\n\t}\n\n\treturn r, iter.Err()\n}", "title": "" }, { "docid": "80e7da17bce3acc5ff96dd6d5b78de93", "score": "0.484828", "text": "func collect(dbh *sql.DB) ProcesslistRows {\n\t// we collect all information even if it's mainly empty as we may reference it later\n\tconst query = \"SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO FROM INFORMATION_SCHEMA.PROCESSLIST\"\n\n\tvar (\n\t\tt ProcesslistRows\n\t\tid sql.NullInt64\n\t\tuser sql.NullString\n\t\thost sql.NullString\n\t\tdb sql.NullString\n\t\tcommand sql.NullString\n\t\ttime sql.NullInt64\n\t\tstate sql.NullString\n\t\tinfo sql.NullString\n\t)\n\n\trows, err := dbh.Query(query)\n\tif err != nil {\n\t\tmylog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\tvar r ProcesslistRow\n\t\tif err := rows.Scan(\n\t\t\t&id,\n\t\t\t&user,\n\t\t\t&host,\n\t\t\t&db,\n\t\t\t&command,\n\t\t\t&time,\n\t\t\t&state,\n\t\t\t&info); err != nil {\n\t\t\tmylog.Fatal(err)\n\t\t}\n\t\tr.ID = uint64(id.Int64)\n\n\t\t// be verbose for debugging.\n\t\tu := user.String\n\t\ta := anonymiser.Anonymise(\"user\", user.String)\n\t\tlog.Println(\"user:\", u, \", anonymised:\", a)\n\t\tr.user = a\n\t\tr.host = host.String\n\t\tif db.Valid {\n\t\t\tr.db = db.String\n\t\t}\n\t\tr.command = command.String\n\t\tr.time = uint64(time.Int64)\n\t\tif state.Valid {\n\t\t\tr.state = state.String\n\t\t}\n\t\tr.info = info.String\n\t\tt = append(t, r)\n\t}\n\tif err := rows.Err(); err != nil {\n\t\tmylog.Fatal(err)\n\t}\n\n\treturn t\n}", "title": "" }, { "docid": "0f352074e22c420b022363d63e9e6921", "score": "0.48425776", "text": "func (eq *ExchangeQuery) Aggregate(fns ...AggregateFunc) *ExchangeSelect {\n\treturn eq.Select().Aggregate(fns...)\n}", "title": "" }, { "docid": "6c8578ef7c6603d39eb152976447c3be", "score": "0.48409992", "text": "func (b *Bolt) Aggregate(ctx context.Context, col string, req *model.AggregateRequest) (interface{}, error) {\n\treturn nil, helpers.Logger.LogError(helpers.GetRequestID(ctx), \"aggregate operation not supported for selected database\", nil, nil)\n}", "title": "" }, { "docid": "b227237e7548c82bb971f372b78eeeac", "score": "0.48405254", "text": "func (this *Underscore) Collect(iterator func(T, T, T) T) *Underscore {\n\treturn this.result(Collect(this.wrapped, iterator))\n}", "title": "" }, { "docid": "a151075b5009be30014e2490a3bfd092", "score": "0.48379028", "text": "func (mc *mergeCursor) next() Element {\n\tif mc.peeked == nil {\n\t\tmc.fill()\n\t}\n\tpeek := mc.peeked\n\tmc.peeked = nil\n\treturn peek\n}", "title": "" }, { "docid": "23d74c9a3e91f7eed1a18069ca8aa0f5", "score": "0.4836047", "text": "func (c *Cursor) Row() []interface{} {\n\treturn c.nextVal\n}", "title": "" } ]
83327bde7870508b9379dcc6051f6f77
go test v bench=.
[ { "docid": "59d18f33dc8fe2de8d75d81eec1c78f5", "score": "0.0", "text": "func TestDirReduc(t *testing.T) {\n\tvar tt = []struct {\n\t\tinput1 string\n\t\tinput2 []string\n\t\texpected []string\n\t}{\n\t\t{\"abba\", []string{\"aabb\", \"abcd\", \"bbaa\", \"dada\"}, []string{\"aabb\", \"bbaa\"}},\n\t\t{\"racer\", []string{\"carer\", \"arcre\", \"carre\", \"racrs\", \"racers\", \"arceer\", \"raccer\", \"carrer\", \"cerarr\"}, []string{\"carer\", \"arcre\", \"carre\"}},\n\t\t{\"laser\", []string{\"lazing\", \"lazy\", \"lacer\"}, nil},\n\t\t{\"\", []string{\"Hello\", \"there\"}, nil},\n\t\t{\"yolo\", []string{}, nil},\n\t}\n\n\tfor _, tc := range tt {\n\t\tt.Run(\"Anagrams1\", func(t *testing.T) {\n\t\t\tres := Anagrams(tc.input1, tc.input2)\n\t\t\tif !reflect.DeepEqual(res, tc.expected) {\n\t\t\t\tt.Errorf(\"expected\\n%v\\ngot\\n%v\", tc.expected, res)\n\t\t\t}\n\t\t})\n\t}\n\tfor _, tc := range tt {\n\t\tt.Run(\"Anagrams2\", func(t *testing.T) {\n\t\t\tres := Anagrams2(tc.input1, tc.input2)\n\t\t\tif !reflect.DeepEqual(res, tc.expected) {\n\t\t\t\tt.Errorf(\"expected\\n%v\\ngot\\n%v\", tc.expected, res)\n\t\t\t}\n\t\t})\n\t}\n\tfor _, tc := range tt {\n\t\tt.Run(\"Anagrams3\", func(t *testing.T) {\n\t\t\tres := Anagrams3(tc.input1, tc.input2)\n\t\t\tif !reflect.DeepEqual(res, tc.expected) {\n\t\t\t\tt.Errorf(\"expected\\n%v\\ngot\\n%v\", tc.expected, res)\n\t\t\t}\n\t\t})\n\t}\n\n}", "title": "" } ]
[ { "docid": "517d21647e8e5584f0a959c2c4248971", "score": "0.7309542", "text": "func main() {\n\tlog.Println(runtime.Version())\n\tflag.Set(\"test.bench\", \"anything\")\n\tflag.Set(\"test.v\", \"true\")\n\n\ttesting.Main(func(pat, str string) (bool, error) { return true, nil },\n\t\t[]testing.InternalTest{{\"TestItoa1\", TestItoa1}, {\"TestItoa2\", TestItoa2}},\n\t\t[]testing.InternalBenchmark{},\n\t\t[]testing.InternalExample{})\n}", "title": "" }, { "docid": "ef6a22f4c432fa6b6da334371e513c78", "score": "0.7122968", "text": "func Benchmark() error {\n\treturn sh.RunV(\"go\", \"test\", srcDir, \"-benchmem\", \"-bench=.\")\n}", "title": "" }, { "docid": "53d5bc0d25184dc043b5b31523955416", "score": "0.67505705", "text": "func main() {\n\tvar t *testing.T = testing.NewT()\n\tTestIt(t)\n\tt.Report()\n}", "title": "" }, { "docid": "ae52d62f55ade954c78357315e7e8dd6", "score": "0.6710446", "text": "func main() {\n\t// Create a graph traversal source object, after which we are ready to submit queries.\n\tg, drc, err := createConnection(Host, Port)\n\n\tif err != nil {\n\t\tlog.Println(\"Error creating the connection - program terminating\", err)\n\t\treturn\n\t}\n\n\t// The connection will close when this function ends.\n\tdefer drc.Close()\n\n\tstart := time.Now()\n\n\trunTests(g)\n\n\tduration := time.Now().Sub(start)\n\tlog.Println(\"Duration : \", duration)\n}", "title": "" }, { "docid": "58b0feb5eeaaaacaa1ed058ddf8e96cd", "score": "0.6654885", "text": "func TestMain(m *testing.M) {\n\tlogs := make([]*Log, 0)\n\tbenchmarks := []*Benchmark{{\n\t\t\"fastCache \", \"get-same\", GetSame, 1,\n\t\tfunc() Cache { return NewBenchFastCache(16) },\n\t}, {\n\t\t\"bigCache \", \"get-same\", GetSame, 1,\n\t\tfunc() Cache { return NewBenchBigCache(16) },\n\t}, {\n\t\t\"freeCache \", \"get-same\", GetSame, 1,\n\t\tfunc() Cache { return NewBenchFreeCache(16) },\n\t}, {\n\t\t\"baseMutex \", \"get-same\", GetSame, 1,\n\t\tfunc() Cache { return NewBenchBaseMutex(16) },\n\t}, {\n\t\t\"ristretto \", \"get-same\", GetSame, 1,\n\t\tfunc() Cache { return NewBenchRistretto(16) },\n\t}}\n\n\tfor _, benchmark := range benchmarks {\n\t\tlog.Printf(\"running: %s (%s) * %d\",\n\t\t\tbenchmark.Name, benchmark.Label, benchmark.Para)\n\t\tn := time.Now()\n\t\t// get testing.BenchMarkResult\n\t\tresult := testing.Benchmark(benchmark.Bencher(benchmark))\n\t\t// append to logs\n\t\tlogs = append(logs, &Log{benchmark, NewResult(result)})\n\t\tlog.Printf(\"\\t ... %v\\n\", time.Since(n))\n\t}\n\n\t// save CSV to disk\n\tif err := save(logs); err != nil {\n\t\tlog.Panic(err)\n\t}\n}", "title": "" }, { "docid": "80ed4cf1ffd6a53ddd65c79efb71499d", "score": "0.6510445", "text": "func TestLoadV(t *testing.T) {\n\n}", "title": "" }, { "docid": "a3eeb0967a3425d433e1e753ed13cb72", "score": "0.617316", "text": "func testSimpleTarget4(t *testing.T) {\n}", "title": "" }, { "docid": "6d740c1a3975b198e902773a205dcfb4", "score": "0.61355853", "text": "func main() {\n\t// for i := 0; i < 100; i++ {\n\t// \tMySTM.Log(\"Iteration #\", i)\n\t// TestAssemble1()\n\t// TestAssemble2()\n\t// \tMySTM.Log()\n\t// }\n\tSantaRun()\n\t// Test1()\n}", "title": "" }, { "docid": "39e4524f82a4d7d4a4a38a1388d51dff", "score": "0.61312747", "text": "func Test() error {\n\treturn sh.RunV(\"go\", \"test\", \"-timeout=20s\", \"./...\")\n}", "title": "" }, { "docid": "5557dfbb0387f81ada8c05dc6b5f8cc8", "score": "0.6104865", "text": "func TestCompile(t *testing.T) {\n\t// tbi\n}", "title": "" }, { "docid": "8e7a8a391db97cdd33272023555a8dad", "score": "0.61046404", "text": "func TestBenchlist(t *testing.T) {\n\tvdrs := validators.NewSet()\n\tvdr0 := validators.GenerateRandomValidator(50)\n\tvdr1 := validators.GenerateRandomValidator(50)\n\tvdr2 := validators.GenerateRandomValidator(50)\n\tvdr3 := validators.GenerateRandomValidator(50)\n\tvdr4 := validators.GenerateRandomValidator(50)\n\n\terrs := wrappers.Errs{}\n\terrs.Add(\n\t\tvdrs.AddWeight(vdr0.ID(), vdr0.Weight()),\n\t\tvdrs.AddWeight(vdr1.ID(), vdr1.Weight()),\n\t\tvdrs.AddWeight(vdr2.ID(), vdr2.Weight()),\n\t\tvdrs.AddWeight(vdr3.ID(), vdr3.Weight()),\n\t\tvdrs.AddWeight(vdr4.ID(), vdr4.Weight()),\n\t)\n\tif errs.Errored() {\n\t\tt.Fatal(errs.Err)\n\t}\n\n\tthreshold := 3\n\tduration := time.Minute\n\tmaxPortion := 0.5\n\tbenchIntf, err := NewQueryBenchlist(\n\t\tvdrs,\n\t\tsnow.DefaultContextTest(),\n\t\tthreshold,\n\t\tminimumFailingDuration,\n\t\tduration,\n\t\tmaxPortion,\n\t\tfalse,\n\t\t\"\",\n\t)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tb := benchIntf.(*queryBenchlist)\n\n\tcurrentTime := time.Now()\n\tb.clock.Set(currentTime)\n\n\trequestID := uint32(0)\n\n\tif ok := b.RegisterQuery(vdr1.ID(), requestID, constants.PullQueryMsg); !ok {\n\t\tt.Fatal(\"RegisterQuery failed early for vdr1\")\n\t}\n\tb.RegisterResponse(vdr1.ID(), requestID)\n\n\tif ok := bench(b, []ids.ShortID{vdr0.ID(), vdr2.ID()}); !ok {\n\t\tt.Fatal(\"RegisterQuery failed early\")\n\t}\n\n\tif ok := b.RegisterQuery(vdr0.ID(), requestID, constants.PullQueryMsg); ok {\n\t\tt.Fatal(\"RegisterQuery should have benchlisted query from unresponsive peer: vdr0\")\n\t}\n\tif ok := b.RegisterQuery(vdr2.ID(), requestID, constants.PullQueryMsg); ok {\n\t\tt.Fatal(\"RegisterQuery should have benchlisted query from unresponsive peer: vdr2\")\n\t}\n\trequestID++\n\tif ok := b.RegisterQuery(vdr1.ID(), requestID, constants.PullQueryMsg); !ok {\n\t\tt.Fatal(\"RegisterQuery should have been successful for responsive peer: vdr1\")\n\t}\n\n\tb.clock.Set(b.clock.Time().Add(duration))\n\tif ok := b.RegisterQuery(vdr0.ID(), requestID, constants.PullQueryMsg); !ok {\n\t\tt.Fatal(\"RegisterQuery should have succeeded after benchlisting time elapsed for vdr0\")\n\t}\n\tif ok := b.RegisterQuery(vdr2.ID(), requestID, constants.PullQueryMsg); !ok {\n\t\tt.Fatal(\"RegisterQuery should have succeeded after benchlisting time elapsed for vdr2\")\n\t}\n}", "title": "" }, { "docid": "7f18b9122b2b78a164e14b58d5ab8726", "score": "0.60929227", "text": "func TestSiegeBenchCommand(t *testing.T) {\n\tvar tool SiegeTool\n\n\tconfig := &cfg.Config{}\n\tconfig.Siege.Concurrent = 1\n\tconfig.Siege.Time = 1\n\ttool = SiegeTool{&config.Siege}\n\t_, err := tool.BenchCommand(\"test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tconfig.Siege.Concurrent = 0\n\tconfig.Siege.Time = 1\n\ttool = SiegeTool{&config.Siege}\n\t_, err = tool.BenchCommand(\"test\")\n\tif err == nil {\n\t\tt.Fatal(\"Unexpected result for Concurrent\")\n\t}\n\n\tconfig.Siege.Concurrent = 1\n\tconfig.Siege.Time = 0\n\ttool = SiegeTool{&config.Siege}\n\t_, err = tool.BenchCommand(\"test\")\n\tif err == nil {\n\t\tt.Fatal(\"Unexpected result for Time\")\n\t}\n}", "title": "" }, { "docid": "5d399492f2208439a6abf40b074b3b8c", "score": "0.60724336", "text": "func TestMain(t *testing.M) {\n\ttesting.CoverMode()\n\tflag.Parse()\n\n\tfmt.Printf(\"Running feature %s\\n\", featureFlag)\n\tstatus := godog.RunWithOptions(\"godog\", findSuite, godog.Options{\n\t\tFormat: \"progress\",\n\t\tPaths: []string{featureFlag},\n\t\tRandomize: time.Now().UTC().UnixNano(), // randomize scenario execution order\n\t})\n\n\tif st := t.Run(); st > status {\n\t\tstatus = st\n\t}\n\tos.Exit(status)\n}", "title": "" }, { "docid": "8c588f16a60c4fcc4c869436aebd0a18", "score": "0.60437787", "text": "func UnitTest() error { return mageextras.UnitTest() }", "title": "" }, { "docid": "a7f9937b67a3f92c5ae747f474faf62c", "score": "0.60360736", "text": "func Test(t *testing.T) {}", "title": "" }, { "docid": "ef726785d8f3f9f53c4b99c9a05f9657", "score": "0.59985995", "text": "func main() {\n\ttest()\n}", "title": "" }, { "docid": "0c6883f6ad3e2ddd4b3cdcf5c1d8553d", "score": "0.599319", "text": "func (b *B) run() {\n\tif b.context != nil {\n\t\t// Running go test --test.bench\n\t\tb.processBench(b.context) // calls doBench and prints results\n\t} else {\n\t\t// Running func Benchmark.\n\t\tb.doBench()\n\t}\n}", "title": "" }, { "docid": "a4e1d80e88523c78aeeb88030b4fd529", "score": "0.5990259", "text": "func Test1(t *testing.T) {\n\tdirList := make([]string, 0, 1000)\n\tdirList = append(dirList, \"stExample\")\n\tif os.Getenv(\"RUN_ALL_EBP_TESTS\") == \"YES\" {\n\t\tdirList = append(dirList, \"stArgsZeroOneBalance\")\n\t\tdirList = append(dirList, \"stAttackTest\")\n\t\tdirList = append(dirList, \"stBadOpcode\")\n\t\tdirList = append(dirList, \"stBugs\")\n\t\tdirList = append(dirList, \"stCallCodes\")\n\t\tdirList = append(dirList, \"stCallCreateCallCodeTest\")\n\t\tdirList = append(dirList, \"stCallDelegateCodesCallCodeHomestead\")\n\t\tdirList = append(dirList, \"stCallDelegateCodesHomestead\")\n\t\tdirList = append(dirList, \"stChainId\")\n\t\tdirList = append(dirList, \"stChangedEIP150\")\n\t\tdirList = append(dirList, \"stCodeCopyTest\")\n\t\tdirList = append(dirList, \"stCodeSizeLimit\")\n\t\tdirList = append(dirList, \"stCreate2\")\n\t\tdirList = append(dirList, \"stCreateTest\")\n\t\tdirList = append(dirList, \"stDelegatecallTestHomestead\")\n\t\tdirList = append(dirList, \"stEIP150Specific\")\n\t\tdirList = append(dirList, \"stEIP150singleCodeGasPrices\")\n\t\tdirList = append(dirList, \"stEIP158Specific\")\n\t\tdirList = append(dirList, \"stExtCodeHash\")\n\t\tdirList = append(dirList, \"stHomesteadSpecific\")\n\t\tdirList = append(dirList, \"stInitCodeTest\")\n\t\tdirList = append(dirList, \"stLogTests\")\n\t\tdirList = append(dirList, \"stMemExpandingEIP150Calls\")\n\t\tdirList = append(dirList, \"stMemoryStressTest\")\n\t\tdirList = append(dirList, \"stMemoryTest\")\n\t\tdirList = append(dirList, \"stNonZeroCallsTest\")\n\t\tdirList = append(dirList, \"stZeroCallsTest\")\n\t\tdirList = append(dirList, \"stRecursiveCreate\")\n\t\tdirList = append(dirList, \"stRefundTest\")\n\t\tdirList = append(dirList, \"stSStoreTest\")\n\t\tdirList = append(dirList, \"stSelfBalance\")\n\t\tdirList = append(dirList, \"stShift\")\n\t\tdirList = append(dirList, \"stSolidityTest\")\n\t\tdirList = append(dirList, \"stStackTests\")\n\t\tdirList = append(dirList, \"stStaticCall\")\n\t\tdirList = append(dirList, \"stTransitionTest\")\n\t\tdirList = append(dirList, \"stWalletTest\")\n\t\tdirList = append(dirList, \"stZeroCallsRevert\")\n\t\tdirList = append(dirList, \"stZeroKnowledge\")\n\t\tdirList = append(dirList, \"stZeroKnowledge2\")\n\t\tdirList = append(dirList, \"stTransactionTest\")\n\t\tdirList = append(dirList, \"stSystemOperationsTest\")\n\t\tdirList = append(dirList, \"stSpecialTest\")\n\t\tdirList = append(dirList, \"stSLoadTest\")\n\t\tdirList = append(dirList, \"stRevertTest\")\n\t\tdirList = append(dirList, \"stReturnDataTest\")\n\t\tdirList = append(dirList, \"stPreCompiledContracts\")\n\t\tdirList = append(dirList, \"stPreCompiledContracts2\")\n\t\tdirList = append(dirList, \"stQuadraticComplexityTest\")\n\t\tdirList = append(dirList, \"stStaticCall\")\n\t\tdirList = append(dirList, \"stTimeConsuming\")\n\t\tdirList = append(dirList, \"stRandom\")\n\t\tdirList = append(dirList, \"stRandom2\")\n\t}\n\tfor _, dir := range dirList {\n\t\tdir = \"../../../testdata/evm/\" + dir\n\t\ttc.RunOneDir([]string{\"run_test_dir\", dir}, true, runTestCase)\n\t}\n}", "title": "" }, { "docid": "ed0bb0a0f8bfbd089a4e75d428438784", "score": "0.59711623", "text": "func (s *Stats) dump(result *BenchResults) {\n\tvar b bytes.Buffer\n\n\t// Go and gRPC version information.\n\tb.WriteString(fmt.Sprintf(\"%s/grpc%s\\n\", result.GoVersion, result.GrpcVersion))\n\n\t// This prints the run mode and all features of the bench on a line.\n\tb.WriteString(fmt.Sprintf(\"%s-%s:\\n\", result.RunMode, result.Features.String()))\n\n\tunit := s.hw.unit\n\ttUnit := fmt.Sprintf(\"%v\", unit)[1:] // stores one of s, ms, μs, ns\n\n\tif l := result.Data.Fiftieth; l != 0 {\n\t\tb.WriteString(fmt.Sprintf(\"50_Latency: %s%s\\t\", strconv.FormatFloat(float64(l)/float64(unit), 'f', 4, 64), tUnit))\n\t}\n\tif l := result.Data.Ninetieth; l != 0 {\n\t\tb.WriteString(fmt.Sprintf(\"90_Latency: %s%s\\t\", strconv.FormatFloat(float64(l)/float64(unit), 'f', 4, 64), tUnit))\n\t}\n\tif l := result.Data.NinetyNinth; l != 0 {\n\t\tb.WriteString(fmt.Sprintf(\"99_Latency: %s%s\\t\", strconv.FormatFloat(float64(l)/float64(unit), 'f', 4, 64), tUnit))\n\t}\n\tif l := result.Data.Average; l != 0 {\n\t\tb.WriteString(fmt.Sprintf(\"Avg_Latency: %s%s\\t\", strconv.FormatFloat(float64(l)/float64(unit), 'f', 4, 64), tUnit))\n\t}\n\tb.WriteString(fmt.Sprintf(\"Bytes/op: %v\\t\", result.Data.AllocedBytes))\n\tb.WriteString(fmt.Sprintf(\"Allocs/op: %v\\t\\n\", result.Data.Allocs))\n\n\t// This prints the histogram stats for the latency.\n\tif s.hw.histogram == nil {\n\t\tb.WriteString(\"Histogram (empty)\\n\")\n\t} else {\n\t\tb.WriteString(fmt.Sprintf(\"Histogram (unit: %s)\\n\", tUnit))\n\t\ts.hw.histogram.PrintWithUnit(&b, float64(unit))\n\t}\n\n\t// Print throughput data.\n\treq := result.Data.SendOps\n\tif req == 0 {\n\t\treq = result.Data.TotalOps\n\t}\n\tresp := result.Data.RecvOps\n\tif resp == 0 {\n\t\tresp = result.Data.TotalOps\n\t}\n\tb.WriteString(fmt.Sprintf(\"Number of requests: %v\\tRequest throughput: %v bit/s\\n\", req, result.Data.ReqT))\n\tb.WriteString(fmt.Sprintf(\"Number of responses: %v\\tResponse throughput: %v bit/s\\n\", resp, result.Data.RespT))\n\tfmt.Println(b.String())\n}", "title": "" }, { "docid": "0f933a4cd86b29b3d3c808dcdc352029", "score": "0.5969083", "text": "func Test(t *testing.T) { gc.TestingT(t) }", "title": "" }, { "docid": "0f933a4cd86b29b3d3c808dcdc352029", "score": "0.5969083", "text": "func Test(t *testing.T) { gc.TestingT(t) }", "title": "" }, { "docid": "0f933a4cd86b29b3d3c808dcdc352029", "score": "0.5969083", "text": "func Test(t *testing.T) { gc.TestingT(t) }", "title": "" }, { "docid": "6e79fb62fc25e06a7b64378c46ea14d3", "score": "0.59660923", "text": "func TestSaveV(t *testing.T) {\n\n}", "title": "" }, { "docid": "115fd91fd416cd2b0c613d7b89f27332", "score": "0.59551376", "text": "func Test(t *testing.T) {TestingT(t) }", "title": "" }, { "docid": "c9973e08639a6b96ea6bcdf748b6b2b1", "score": "0.59378374", "text": "func TestX(t *testing.T) {}", "title": "" }, { "docid": "657bac79a01c0330452f348e474e9fef", "score": "0.59339225", "text": "func usage( ss string){\n fmt.Printf(\"usage:%s is a benchmarktool like ab bench on apache\\n -c concurrency, will open X go routine to run this test\\n -n total request\\n -u URL which will be tested\\n\", ss)\n os.Exit(1)\n}", "title": "" }, { "docid": "ca79ad3acdcfa08aab1dc4e359168d28", "score": "0.59079534", "text": "func TestLoadBCD(t *testing.T) {\n\n}", "title": "" }, { "docid": "6606087bbd5838c67f8b2a290da44252", "score": "0.58897364", "text": "func runTest(ctx context.Context, s *testing.State, t time.Duration, exe string, args ...string) {\n\ts.Log(\"Running \", shutil.EscapeSlice(append([]string{exe}, args...)))\n\n\tf, err := os.Create(filepath.Join(s.OutDir(), filepath.Base(exe)+\".txt\"))\n\tif err != nil {\n\t\ts.Fatal(\"Failed to create a log file: \", err)\n\t}\n\tdefer f.Close()\n\n\tctx, cancel := context.WithTimeout(ctx, t)\n\tdefer cancel()\n\tcmd := testexec.CommandContext(ctx, exe, args...)\n\tcmd.Stdout = f\n\tcmd.Stderr = f\n\tif err := cmd.Run(); err != nil {\n\t\ts.Errorf(\"Failed to run %s: %v\", exe, err)\n\t}\n}", "title": "" }, { "docid": "01bf35d05b496b7dd33607302ec579aa", "score": "0.5866146", "text": "func runTests(g *GraphTraversalSource) {\n\tresult, err := g.V().Count().Next()\n\tif err != nil {\n\t\tlog.Println(err)\n\t} else {\n\t\tlog.Println(\"Raw result object:\", result)\n\t\tcount, _ := result.GetInt64()\n\t\tlog.Println(\"The count is :\", count)\n\t}\n}", "title": "" }, { "docid": "381e28e32429783f2501561e8d626a0d", "score": "0.5865883", "text": "func TestMain(m *testing.M) {\n\tflag.Parse()\n\tsetMaxParallelism()\n\n\tstart := time.Now()\n\tcode := m.Run()\n\tfmt.Printf(\"Tests completed in %s (result code %d)\\n\", time.Since(start), code)\n\tos.Exit(code)\n}", "title": "" }, { "docid": "8b2d6f21cb7d26f2e2d0dff47058b8ca", "score": "0.5859584", "text": "func testDir(ref string) string {\n\treturn filepath.Join(\"benchdiff\", ref)\n}", "title": "" }, { "docid": "50a0ae13070bef4b075510adffff8aba", "score": "0.5850928", "text": "func BenchmarkTest(b *testing.B) {\n\t//b.StopTimer()\n\t// do time consuming things\n\t//b.StartTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\t// do something\n\t}\n}", "title": "" }, { "docid": "e884f81171bbfd487182fdc1d1de96c0", "score": "0.5845256", "text": "func test(t int) {\n\tif *verbosityFlag > 1 {\n\t\tlog.Printf(\"Calling in %d\", t)\n\t}\n\tcode, body := fortio.FetchURL(url)\n\tsize := len(body)\n\tif *verbosityFlag > 1 {\n\t\tlog.Printf(\"Got in %3d sz %d\", code, size)\n\t}\n\tstats[t].retCodes[code]++\n\tstats[t].sizes.Record(float64(size))\n}", "title": "" }, { "docid": "9c49f89e94c8fbb8e4c17c9108d6efcd", "score": "0.58392406", "text": "func TestRun(t *testing.T) {\n /* */\n avconv_exec_mock := `\n\n `\n}", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "07f4e382ffea56ba01853b7e04be5a78", "score": "0.5837016", "text": "func Test(t *testing.T) { TestingT(t) }", "title": "" }, { "docid": "a3c37d0f26edde593907f29dac85ba2b", "score": "0.58181745", "text": "func Test1(t *testing.T) {\n\n}", "title": "" }, { "docid": "bf7de8e571cdd1e66b069cc17c2811af", "score": "0.58140445", "text": "func main() {\n\trand.Seed(time.Now().UnixNano())\n\tsim(1e3)\n\tsim(50)\n}", "title": "" }, { "docid": "2bb447fdfba469ab3da2407f47d3f117", "score": "0.57968295", "text": "func (t *tester) goTest() []string {\n\treturn []string{\n\t\t\"go\", \"test\", \"-short=\" + short(), \"-count=1\", t.tags(), t.runFlag(\"\"),\n\t}\n}", "title": "" }, { "docid": "ac31de311135bbfc573a29527b3cc475", "score": "0.5776873", "text": "func Test(t *testing.T) { gocheck.TestingT(t) }", "title": "" }, { "docid": "ac31de311135bbfc573a29527b3cc475", "score": "0.5776873", "text": "func Test(t *testing.T) { gocheck.TestingT(t) }", "title": "" }, { "docid": "ac31de311135bbfc573a29527b3cc475", "score": "0.5776873", "text": "func Test(t *testing.T) { gocheck.TestingT(t) }", "title": "" }, { "docid": "ac31de311135bbfc573a29527b3cc475", "score": "0.5776873", "text": "func Test(t *testing.T) { gocheck.TestingT(t) }", "title": "" }, { "docid": "aebe471d9c044a823d2256a16ce8ac4f", "score": "0.5765788", "text": "func Bench(format string, a ...interface{}) {\n\tdoLog(4, \"magenta\", format, a...)\n}", "title": "" }, { "docid": "13bbedc80b014b2f656bdb9c55ca0f86", "score": "0.5757603", "text": "func Test(t *testing.T) { C.TestingT(t) }", "title": "" }, { "docid": "ee0f2c11f7505397297b92f6ca4836e2", "score": "0.5736594", "text": "func TestBasic(t *testing.T) {\n\t//initialize MysqlStatDBs\n\ts := initMysqlStatDBs()\n\n\t//set desired test output\n\ttestquerycol = map[string]map[string][]string{\n\t\t//getSlaveStats()\n\t\tslaveQuery: map[string][]string{\n\t\t\t\"Seconds_Behind_Master\": []string{\"8\"},\n\t\t\t\"Relay_Master_Log_File\": []string{\"some-name-bin.010\"},\n\t\t\t\"Exec_Master_Log_Pos\": []string{\"79\"},\n\t\t\t\"Relay_Log_Space\": []string{\"123\"},\n\t\t\t\"Master_Host\": []string{\"abcdef\"},\n\t\t},\n\t\t//getOldest\n\t\toldestQuery: map[string][]string{\n\t\t\t\"time\": []string{\"12345\"},\n\t\t},\n\t\t// getBinlogFiles\n\t\tbinlogQuery: map[string][]string{\n\t\t\t\"Log_name\": []string{\"binlog.00001\", \"binlog.00002\", \"binlog.00003\", \"binlog.00004\"},\n\t\t\t\"File_size\": []string{\"1\", \"10\", \"100\", \"1000\"}, // sum = 1111\n\t\t},\n\t\t//getNumLongRunQueries\n\t\tlongQuery: map[string][]string{\n\t\t\t\"ID\": []string{\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"},\n\t\t},\n\t\t//getVersion\n\t\tversionQuery: map[string][]string{\n\t\t\t\"VERSION()\": []string{\"1.2.34\"},\n\t\t},\n\t\t// getBinlogStats\n\t\tbinlogStatsQuery: map[string][]string{\n\t\t\t\"File\": []string{\"mysql-bin.003\"},\n\t\t\t\"Position\": []string{\"73\"},\n\t\t},\n\t\t// getStackedQueries\n\t\tstackedQuery: map[string][]string{\n\t\t\t\"identical_queries_stacked\": []string{\"5\", \"4\", \"3\"},\n\t\t\t\"max_age\": []string{\"10\", \"9\", \"8\"},\n\t\t},\n\t\t//getSessions\n\t\tsessionQuery1: map[string][]string{\n\t\t\t\"max_connections\": []string{\"10\"},\n\t\t},\n\t\tsessionQuery2: map[string][]string{\n\t\t\t\"COMMAND\": []string{\"Sleep\", \"Connect\", \"Binlog Dump\", \"Binlog Dump GTID\", \"something else\", \"database stuff\"},\n\t\t\t\"USER\": []string{\"unauthenticated\", \"user1\", \"user2\", \"user3\", \"user4\", \"user5\"},\n\t\t\t\"STATE\": []string{\"statistics\", \"copying table\", \"Table Lock\", \"Table Lock\", \"Waiting for global read lock\", \"else\"},\n\t\t},\n\t\tinnodbQuery: map[string][]string{\n\t\t\t\"Value\": []string{\"100\"},\n\t\t},\n\t\tsslQuery: map[string][]string{\n\t\t\t\"@@have_ssl\": []string{\"YES\"},\n\t\t},\n\t}\n\ttestglobalstats = []map[string][]string{map[string][]string{\n\t\t\"Aborted_connects\": []string{\"51\"},\n\t\t\"Queries\": []string{\"8\"},\n\t\t\"Uptime\": []string{\"100\"},\n\t\t\"Threads_running\": []string{\"5\"},\n\t}}\n\t//expected results\n\texpectedValues = map[interface{}]interface{}{\n\t\ts.Metrics.SlaveSecondsBehindMaster: float64(8),\n\t\ts.Metrics.SlaveSeqFile: float64(10),\n\t\ts.Metrics.SlavePosition: uint64(79),\n\t\ts.Metrics.RelayLogSpace: float64(123),\n\t\ts.Metrics.Queries: uint64(8),\n\t\ts.Metrics.Uptime: uint64(100),\n\t\ts.Metrics.ThreadsRunning: float64(5),\n\t\ts.Metrics.MaxConnections: float64(10),\n\t\ts.Metrics.CurrentSessions: float64(6),\n\t\ts.Metrics.ActiveSessions: float64(2),\n\t\ts.Metrics.UnauthenticatedSessions: float64(1),\n\t\ts.Metrics.LockedSessions: float64(0),\n\t\ts.Metrics.SessionTablesLocks: float64(2),\n\t\ts.Metrics.SessionsCopyingToTable: float64(1),\n\t\ts.Metrics.SessionsStatistics: float64(1),\n\t\ts.Metrics.IdenticalQueriesStacked: float64(5),\n\t\ts.Metrics.IdenticalQueriesMaxAge: float64(10),\n\t\ts.Metrics.BinlogSeqFile: float64(3),\n\t\ts.Metrics.BinlogPosition: uint64(73),\n\t\ts.Metrics.Version: float64(1.234),\n\t\ts.Metrics.ActiveLongRunQueries: float64(7),\n\t\ts.Metrics.BinlogSize: float64(1111),\n\t\ts.Metrics.OldestQueryS: float64(12345),\n\t\ts.Metrics.AbortedConnects: uint64(51),\n\t}\n\ts.Collect()\n\ttime.Sleep(time.Millisecond * 1000 * 1)\n\n\t//check Results\n\terr := checkResults()\n\tif err != \"\" {\n\t\tt.Error(err)\n\t}\n\n\tif s.MasterHostname != \"abcdef\" {\n\t\tt.Error(\"MasterHost: expect abcdef, got \" + s.MasterHostname)\n\t}\n}", "title": "" } ]
dd01450dfb7ad5c6a687cd8f27a12b49
SaveLastTwitterCursor todo when we do deeper searches on twitter.
[ { "docid": "5811d79ccebe0f9f16b6ba1214db97ed", "score": "0.8776797", "text": "func (rds *RedisDataStore) SaveLastTwitterCursor(cursor int64) {\n\tfmt.Printf(\"Save cursor: %d\", cursor)\n}", "title": "" } ]
[ { "docid": "d60c15bc55afbdb216202c7289694e6a", "score": "0.5328147", "text": "func (c *Client) Lastsave(args ...interface{}) *Reply {\n\treturn c.call(cmdLastsave, args...)\n}", "title": "" }, { "docid": "3da11e20d57ec87f5aa66a3de2ae6215", "score": "0.5275153", "text": "func (mc *MultiCall) Lastsave(args ...interface{}) {\n\tmc.call(cmdLastsave, args...)\n}", "title": "" }, { "docid": "d67e438ea372cae23ba2fbf60acb0f84", "score": "0.5231475", "text": "func (t *SecondaryTree) SeekLast() (e *SecondaryEnumerator, err error) {\n\tq := t.last\n\tif q == nil {\n\t\treturn nil, io.EOF\n\t}\n\n\treturn btEPool2.get(nil, true, q.c-1, q.d[q.c-1].k, q, t, atomic.LoadUint64(&t.ver)), nil\n}", "title": "" }, { "docid": "c6965d85850c3f7c5b5b583d3c2bcdb4", "score": "0.51872957", "text": "func (t *BTree) SeekLast() (*BTreeCursor, error) {\n\tp, err := t.last()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif p == 0 {\n\t\treturn &BTreeCursor{}, nil\n\t}\n\n\td := t.openDPage(p)\n\tdc, err := t.len(d)\n\tif err != nil {\n\t\treturn &BTreeCursor{}, err\n\t}\n\n\te := t.newEnumerator(d, dc, 0, true)\n\te.i = e.c - 1\n\treturn e, nil\n}", "title": "" }, { "docid": "9d9113dc4bade732c16650eeb9ad567c", "score": "0.51507324", "text": "func (t *Twitter) SaveUserTweets(ctx context.Context) error {\n\tclient, user, err := t.TwitterAuth.Validate(ctx, t.Log)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuserTimelineParams := &twitter.UserTimelineParams{\n\t\tScreenName: user.ScreenName,\n\t\tCount: 200,\n\t\tIncludeRetweets: twitter.Bool(true),\n\t}\n\ttweets, resp, err := client.Timelines.UserTimeline(userTimelineParams)\n\tif resp.Header.Get(\"X-Rate-Limit-Remaining\") == \"0\" {\n\t\ti, err := strconv.ParseInt(resp.Header.Get(\"X-Rate-Limit-Reset\"), 10, 64)\n\t\tif err != nil {\n\t\t\tt.Log.Errorw(\"converting int\", zap.Error(err))\n\t\t\treturn err\n\t\t}\n\t\ttm := time.Unix(i, 0)\n\t\treturn fmt.Errorf(\"out of Rate Limit, returns: %+v\", tm)\n\t}\n\n\tif err != nil {\n\t\tt.Log.Errorw(\"Error getting tweets\", \"resp\", resp, zap.Error(err))\n\t\treturn err\n\t}\n\n\tfor _, tw := range tweets {\n\t\terr := t.UploadTweet(ctx, tw)\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3bf90bca7c786f4d49007f855f433d49", "score": "0.5122915", "text": "func (i *flushableBatchIter) Last() (*InternalKey, base.LazyValue) {\n\ti.err = nil // clear cached iteration error\n\tif len(i.offsets) == 0 {\n\t\treturn nil, base.LazyValue{}\n\t}\n\ti.index = len(i.offsets) - 1\n\ti.key = i.getKey(i.index)\n\tif i.lower != nil && i.cmp(i.key.UserKey, i.lower) < 0 {\n\t\ti.index = -1\n\t\treturn nil, base.LazyValue{}\n\t}\n\treturn &i.key, i.value()\n}", "title": "" }, { "docid": "6481e946bc52c9389a30c7eff70a4eaa", "score": "0.5104831", "text": "func (c *Client) Lastsave() (int64, error) {\n return Send(c.Rw, []byte(\"LASTSAVE\")).intOrErr()\n}", "title": "" }, { "docid": "0dd7870d18785e51c2859cbf8ddeb875", "score": "0.5104605", "text": "func (it *Iterator) SeekToLast() {\n\tit.setNode(it.list.getPrev(it.list.tail, 0), true)\n}", "title": "" }, { "docid": "e25ac285aebfffe77e4a9009fe64be7a", "score": "0.5091496", "text": "func (it *Iterator) SeekToLast() {\n\tif len(it.block.items) > 0 {\n\t\tit.index = len(it.block.items) - 1\n\t}\n}", "title": "" }, { "docid": "8a5bf22f9fdca946c185f8b406a3d20a", "score": "0.50754225", "text": "func SaveCursorPosition() {\n\tos.Stdout.WriteString(RawSaveCursorPosition())\n}", "title": "" }, { "docid": "4faf6e1d423af09625982b07c05046a7", "score": "0.5056175", "text": "func (cn *conn) saveLastUsed() unixTime {\n\treturn unixTime{cn.lastUsed.Unix(), cn.lastUsed.UnixNano()}\n}", "title": "" }, { "docid": "64902df89c1143ae06405550be4a048a", "score": "0.5040212", "text": "func (it *Iterator) SeekToLast() {\n\tit.Reset()\n\tif it.denseIter.ld.height > 0 {\n\t\tit.denseIter.SetToLastInRoot()\n\t\tit.denseIter.MoveToRightMostKey()\n\t\tif it.denseIter.rightComp {\n\t\t\treturn\n\t\t}\n\t\tit.passToSparse()\n\t\tit.sparseIter.MoveToRightMostKey()\n\t} else if it.sparseIter.ls.height > 0 {\n\t\tit.sparseIter.SetToLastInRoot()\n\t\tit.sparseIter.MoveToRightMostKey()\n\t}\n}", "title": "" }, { "docid": "58800d8c9e827487daf4c3758b9879e5", "score": "0.50296515", "text": "func (wg *WindowGeomPrefs) SaveLastSave() {\n\tpdir := oswin.TheApp.GoGiPrefsDir()\n\tpnm := filepath.Join(pdir, WinGeomPrefsFileName+\".lst\")\n\tWinGeomPrefsLastSave = time.Now()\n\tb, _ := WinGeomPrefsLastSave.MarshalJSON()\n\tioutil.WriteFile(pnm, b, 0644)\n}", "title": "" }, { "docid": "b3dcc980b82202ec2e18415944dfeee7", "score": "0.5025623", "text": "func (it *BlockIterator) SeekToLast() {\n\tif len(it.block.items) > 0 {\n\t\tit.index = len(it.block.items) - 1\n\t}\n}", "title": "" }, { "docid": "8d0749d47e90f712dd994848b4ae0d86", "score": "0.5008016", "text": "func (t *Iterator) GetCursorAfter() *Cursor {\n\treturn t.getCursorAt(t.curr)\n}", "title": "" }, { "docid": "b489e94c35a2e49a4591ed0c4115bc78", "score": "0.49895617", "text": "func (ic *IndexCursor) SeekLast(valueType byte, seek []byte) *Index {\n\tif ic.cursor == nil {\n\t\treturn nil\n\t}\n\n\tfilter := genIndexPrefixForSeekLast(valueType, seek)\n\n\t// seek one more biggger item than specified one.\n\tic.cursor.Seek(filter)\n\tk, v := ic.cursor.Prev()\n\tif k == nil {\n\t\treturn nil\n\t}\n\n\tidx := newIndex(ic.bucket, k, v)\n\n\t// check value type\n\tif idx.ValueType() != valueType {\n\t\treturn nil\n\t}\n\n\treturn newIndex(ic.bucket, k, v)\n}", "title": "" }, { "docid": "35c50ed294d9b44579689caafc3113df", "score": "0.49541175", "text": "func (c *Client) LastSave() (int64, error) {\n\tvar ret int64\n\terr := c.command(\n\t\t&ret,\n\t\t[]byte(\"LASTSAVE\"),\n\t)\n\treturn ret, err\n}", "title": "" }, { "docid": "2dd5e8bd46566db03dc680db1d77a1c3", "score": "0.4950893", "text": "func (r *pageInfoResolver) EndCursor(ctx context.Context) *string {\n\treturn r.endCursor\n}", "title": "" }, { "docid": "92ebf67b359988ac1bbb8650d9bcd7b3", "score": "0.49315515", "text": "func (bps *Stats) SetLastPosition(pos mysql.Position) {\n\tbps.lastPositionMutex.Lock()\n\tdefer bps.lastPositionMutex.Unlock()\n\tbps.lastPosition = pos\n}", "title": "" }, { "docid": "2b67fa384863dda9d7fe84ca777d3069", "score": "0.48776576", "text": "func (c *cursor) Last() bool {\n\t// Ensure transaction state is valid.\n\tif err := c.bucket.tx.checkClosed(); err != nil {\n\t\treturn false\n\t}\n\n\t// Seek to the last key in both the database and pending iterators and\n\t// choose the iterator that is both valid and has the larger key.\n\tc.dbIter.Last()\n\tc.pendingIter.Last()\n\treturn c.chooseIterator(false)\n}", "title": "" }, { "docid": "bfd2209bbdde1f91f4c9eacd3de24018", "score": "0.48562872", "text": "func (dao *eventDao) LatestCursor(kit *kit.Kit) (uint32, error) {\n\tm := dao.genQ.Event\n\tq := dao.genQ.Event.WithContext(kit.Ctx)\n\n\tvar cursor uint32\n\tif err := q.Select(m.ResourceID).Where(m.Resource.Eq(string(table.CursorReminder))).Limit(1).Scan(&cursor); err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn cursor, nil\n}", "title": "" }, { "docid": "445bc3591037e0d5dda85f1d1a8b0514", "score": "0.48398107", "text": "func (v *HistoryWidget) UpdateCursor() {\n\tv.MakeCursorVisible()\n\tcurrent, err := v.CurrentReply()\n\tif err != nil {\n\t\tlog.Printf(\"Failed updating cursor state: %v\", err)\n\t\treturn\n\t} else if current == nil {\n\t\treturn\n\t}\n\tauthor, _, err := v.GetIdentity(&current.Author)\n\tif err != nil {\n\t\tlog.Printf(\"Failed updating cursor state, couldn't get author: %v\", err)\n\t}\n\tcommunity, _, err := v.GetCommunity(&current.CommunityID)\n\tif err != nil {\n\t\tlog.Printf(\"Failed updating cursor state, couldn't get community: %v\", err)\n\t}\n\tv.PostEvent(widgets.NewEventReplySelected(v, current, author.(*forest.Identity), community.(*forest.Community)))\n}", "title": "" }, { "docid": "5f065bb1152e5276ac5c224c69a67b1f", "score": "0.4832566", "text": "func (it *MemIterator) SeekToLast() {\n\tit.listIter.SeekToLast()\n}", "title": "" }, { "docid": "5ebab072ab9335f364b716d00453914b", "score": "0.48266956", "text": "func (c *Cursor) last() error {\n\tref := &c.stack[len(c.stack)-1]\n\tvar n *node\n\tif ref.node.pointers[ref.index].pointer == nil {\n\t\tvar err error\n\t\tn, err = c.db.node(ref.node.pointers[ref.index].pos)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tn = ref.node.pointers[ref.index].pointer\n\t}\n\n\te := elemRef{node: n, index: len(n.pointers) - 1}\n\tc.stack = append(c.stack, e)\n\n\tif !n.isLeaf && n.level < c.level>>1 {\n\t\treturn c.last()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "52a9ba2f642eaa132f71793120a3a0f8", "score": "0.47626492", "text": "func (clb *circLineBuffer) EndCursor() {\n\tclb.cursorOff = clb.writeOff\n}", "title": "" }, { "docid": "2b13c67d4cc98641fd4052e411f9c7f7", "score": "0.47359967", "text": "func (ci *UnsubscribesIterator) Last(ctx context.Context, items *[]Unsubscribe) bool {\n\tif ci.err != nil {\n\t\treturn false\n\t}\n\tci.err = ci.fetch(ctx, ci.Paging.Last)\n\tif ci.err != nil {\n\t\treturn false\n\t}\n\tcpy := make([]Unsubscribe, len(ci.Items))\n\tcopy(cpy, ci.Items)\n\t*items = cpy\n\treturn true\n}", "title": "" }, { "docid": "aa0c40874fe7ca30c703acb7e2d95cfe", "score": "0.47157136", "text": "func (s *BasetsqlListener) ExitFetch_cursor(ctx *Fetch_cursorContext) {}", "title": "" }, { "docid": "0ef481a8d4648e3131b238efa3d3a6f1", "score": "0.47141048", "text": "func (af *ApiFeature) saveLastResponseCredentials(resp *http.Response) error {\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\taf.lastResponse = resp\n\taf.lastResponseBody = body\n\n\treturn err\n}", "title": "" }, { "docid": "a11c6ae48a8aa8ec89a5285c6953f81f", "score": "0.47058588", "text": "func (c *Client) AsyncLastsave(args ...interface{}) Future {\n\treturn c.asyncCall(cmdLastsave, args...)\n}", "title": "" }, { "docid": "323cc64a308161f4676df821663bdef4", "score": "0.47004646", "text": "func (md *model) SetCursor(p gruid.Point) {\n\tmd.targ.ex.p = p\n}", "title": "" }, { "docid": "25fcc4ab7a2d46ba1714209457968344", "score": "0.46969652", "text": "func (s *DatabaseAccessServer) SaveTweet(ctx context.Context, in *pb.TweetConfig) (*pb.InsertID, error) {\n\tconf := tweet.Config{UserID: in.UserID, Username: in.Username, Text: in.Text}\n\tinsertID, err := s.TweetRepository.Save(conf)\n\tif err != nil {\n\t\treturn &pb.InsertID{}, err\n\t}\n\n\treturn &pb.InsertID{InsertID: insertID}, nil\n}", "title": "" }, { "docid": "df7cb8d5e7a2d0b350a46bbc6d1203b4", "score": "0.4691503", "text": "func (a *Autopilot) lastTerm() (uint64, error) {\n\treturn strconv.ParseUint(a.raft.Stats()[\"last_log_term\"], 10, 64)\n}", "title": "" }, { "docid": "387ab0ff8d648f6dbd80288e6e2eda48", "score": "0.46836212", "text": "func (o *InlineResponse20039Person) SetTwitter(v string) {\n\to.Twitter = &v\n}", "title": "" }, { "docid": "da06f76f3e29800f35e962a17f6f3232", "score": "0.46763614", "text": "func LastLocation(ctx context.Context, provider LocationProvider) (*LocationRecord, error) {\n\treturn location(ctx, \"last\", provider)\n}", "title": "" }, { "docid": "48f301b378b273edd71971eaa9c4679b", "score": "0.4657716", "text": "func TestCursorEmptyBucketReverse(t *testing.T) {\n\twithOpenDB(func(db *DB, path string) {\n\t\tdb.Update(func(tx *Tx) error {\n\t\t\treturn tx.CreateBucket(\"widgets\")\n\t\t})\n\t\tdb.View(func(tx *Tx) error {\n\t\t\tc := tx.Bucket(\"widgets\").Cursor()\n\t\t\tk, v := c.Last()\n\t\t\tassert.Nil(t, k)\n\t\t\tassert.Nil(t, v)\n\t\t\treturn nil\n\t\t})\n\t})\n}", "title": "" }, { "docid": "655f5abf18bb0c3b8dadc8208853f200", "score": "0.46246302", "text": "func (t *xtree) SeekLast() (e *xenumerator, err error) {\n\tq := t.last\n\tif q == nil {\n\t\treturn nil, io.EOF\n\t}\n\n\treturn &xenumerator{nil, true, q.c - 1, q.xd[q.c-1].k, q, t, t.ver}, nil\n}", "title": "" }, { "docid": "b7a6d29379e027ab94d49def48a6e9f5", "score": "0.46171337", "text": "func (b *BoltStore) LastIndex() (uint64, error) {\n\tvar lastIndex []byte\n\t_ = b.db.View(func(tx *bolt.Tx) error {\n\t\tcur := tx.Bucket(dbLogs).Cursor()\n\t\tlastIndex, _ = cur.Last()\n\t\treturn nil\n\t})\n\tif lastIndex == nil {\n\t\t// INFO: @see https://github.com/hashicorp/raft/blob/v1.3.3/api.go#L486-L490\n\t\treturn 0, nil\n\t} else {\n\t\treturn strconv.ParseUint(string(lastIndex), 10, 64)\n\t}\n}", "title": "" }, { "docid": "8fb68f8a602a78928f9e3760681bf22b", "score": "0.4613599", "text": "func (bps *Stats) LastPosition() mysql.Position {\n\tbps.lastPositionMutex.Lock()\n\tdefer bps.lastPositionMutex.Unlock()\n\treturn bps.lastPosition\n}", "title": "" }, { "docid": "c185e768c30199dd33e101c1b4fab33a", "score": "0.45996788", "text": "func (ei *EventIterator) Last(events *[]Event) bool {\n\tif ei.err != nil {\n\t\treturn false\n\t}\n\tei.err = ei.fetch(ei.LastURL)\n\tif ei.err != nil {\n\t\treturn false\n\t}\n\t*events = ei.events\n\treturn true\n}", "title": "" }, { "docid": "471b5ce6bc1d6c4d8868a4cd3f8d3bec", "score": "0.45990664", "text": "func (r *replicaRaftStorage) LastIndex() (uint64, error) {\n\treturn r.mu.lastIndex, nil\n}", "title": "" }, { "docid": "46f11af6c41223eb5d345ee9ef8127ab", "score": "0.45829046", "text": "func (c *Cursor) Last() (key string, value []byte) {\n k, v := c.cursor.Last()\n return string(k[:]), v\n}", "title": "" }, { "docid": "7c5e77654c9a26d4bda9eb077a9d5f03", "score": "0.4579741", "text": "func (i *Miterator) Last() {\n\ti.iter.Last()\n}", "title": "" }, { "docid": "8bb12657b3b0fa7b4839e48d79505744", "score": "0.45700043", "text": "func (twitterUserL) LoadUserTwitterTweets(e boil.Executor, singular bool, maybeTwitterUser interface{}) error {\n\tvar slice []*TwitterUser\n\tvar object *TwitterUser\n\n\tcount := 1\n\tif singular {\n\t\tobject = maybeTwitterUser.(*TwitterUser)\n\t} else {\n\t\tslice = *maybeTwitterUser.(*[]*TwitterUser)\n\t\tcount = len(slice)\n\t}\n\n\targs := make([]interface{}, count)\n\tif singular {\n\t\tif object.R == nil {\n\t\t\tobject.R = &twitterUserR{}\n\t\t}\n\t\targs[0] = object.ID\n\t} else {\n\t\tfor i, obj := range slice {\n\t\t\tif obj.R == nil {\n\t\t\t\tobj.R = &twitterUserR{}\n\t\t\t}\n\t\t\targs[i] = obj.ID\n\t\t}\n\t}\n\n\tquery := fmt.Sprintf(\n\t\t\"select * from \\\"twitter_tweets\\\" where \\\"user_id\\\" in (%s)\",\n\t\tstrmangle.Placeholders(dialect.IndexPlaceholders, count, 1, 1),\n\t)\n\tif boil.DebugMode {\n\t\tfmt.Fprintf(boil.DebugWriter, \"%s\\n%v\\n\", query, args)\n\t}\n\n\tresults, err := e.Query(query, args...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to eager load twitter_tweets\")\n\t}\n\tdefer results.Close()\n\n\tvar resultSlice []*TwitterTweet\n\tif err = queries.Bind(results, &resultSlice); err != nil {\n\t\treturn errors.Wrap(err, \"failed to bind eager loaded slice twitter_tweets\")\n\t}\n\n\tif singular {\n\t\tobject.R.UserTwitterTweets = resultSlice\n\t\treturn nil\n\t}\n\n\tfor _, foreign := range resultSlice {\n\t\tfor _, local := range slice {\n\t\t\tif local.ID == foreign.UserID {\n\t\t\t\tlocal.R.UserTwitterTweets = append(local.R.UserTwitterTweets, foreign)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9d19673de36efc0cd8d8bf0b8fe9e664", "score": "0.45560312", "text": "func (p *PeerStorage) SaveTerm(term int64) error {\n\tkey := fmt.Sprintf(\"%03d|%s\", META, CURRENT_TERM)\n\tval := fmt.Sprintf(\"%d\", term)\n\treturn p.engine.Set([]byte(key), []byte(val))\n}", "title": "" }, { "docid": "8eaf2c98ba368ab2c9320dd7793c20e8", "score": "0.4544971", "text": "func (o *GetV2CatalogParams) SetLast(last *string) {\n\to.Last = last\n}", "title": "" }, { "docid": "3638a9dc6443a3c185fa0d1097f96091", "score": "0.45434275", "text": "func saveLastEsSeen() {\n\tlastEsSeenTimer := time.NewTicker(time.Second)\n\tfor {\n\t\tselect {\n\t\tcase <-lastEsSeenTimer.C:\n\t\t\tif lastEsSeen == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif f, err := os.Create(*optimeStore); err != nil {\n\t\t\t\tlog.Println(\"Error saving oplog timestamp:\", err)\n\t\t\t} else {\n\t\t\t\tif err := lastEsSeen.Save(f); err != nil {\n\t\t\t\t\tlog.Println(\"Error saving oplog timestamp:\", err)\n\t\t\t\t}\n\t\t\t\tf.Close()\n\t\t\t\tlastEsSeenStat.Set(lastEsSeen.String())\n\t\t\t\tlastEsSeen = nil\n\t\t\t}\n\t\tcase lastEsSeen = <-lastEsSeenC:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4ea8209e6223d1cd2f8b74b4e4f28f25", "score": "0.45408198", "text": "func (rn *remoteNodeDataImpl) SetLastFindNodeCall(nodeID string, t time.Time) {\n\trn.lastFindNodeCall[nodeID] = t\n}", "title": "" }, { "docid": "02b6bc70dd6bdc6ef2dd468bd7f6010e", "score": "0.45404497", "text": "func (bps *Stats) SetLastPosition(pos replication.Position) {\n\tbps.lastPositionMutex.Lock()\n\tdefer bps.lastPositionMutex.Unlock()\n\tbps.lastPosition = pos\n}", "title": "" }, { "docid": "4a13835ec691083112678a52eb61b225", "score": "0.4527916", "text": "func (r *Ring) LastWrite() uint64 {\n\treturn r.write.Load() - 1\n}", "title": "" }, { "docid": "625ccc23409e8132894afd0f79a09fc2", "score": "0.4514944", "text": "func (rf *Raft) getLastTerm() int {\n\treturn rf.logs[rf.getLastIndex()].Term\n}", "title": "" }, { "docid": "33645e6fa0969c12fcc5784d63f2ac26", "score": "0.45032552", "text": "func (w *Writer) Last(height uint64) error {\n\treturn w.apply(w.lib.SaveLast(height))\n}", "title": "" }, { "docid": "25e4a4125f37c8a3f379f64b1a0b88e6", "score": "0.449895", "text": "func (d *Document) CursorOnLastLine() bool {\n\treturn d.CursorRow() == Row(d.LineCount()-1)\n}", "title": "" }, { "docid": "b08fdebc32d8b61d1fd49c38650b4abb", "score": "0.44985616", "text": "func (v *View) CursorEnd() bool {\n\tv.deselect(0)\n\n\tv.Cursor.Loc = v.Buf.End()\n\tv.Cursor.StoreVisualX()\n\n\treturn true\n}", "title": "" }, { "docid": "223a453342d0714036bace6f6e90a09a", "score": "0.44981503", "text": "func (q *BaseQuery) EndCursor(cursor *Cursor) *BaseQuery {\n\tif q.err == nil {\n\t\tif cursor == nil {\n\t\t\tq.pbq.EndCompiledCursor = nil\n\t\t} else if cursor.compiled == nil {\n\t\t\tq.err = errors.New(\"datastore: empty end cursor\")\n\t\t} else {\n\t\t\tq.pbq.EndCompiledCursor = cursor.compiled\n\t\t}\n\t}\n\tif q.err == nil {\n\t\tq.pbq.Compile = proto.Bool(true)\n\t}\n\treturn q\n}", "title": "" }, { "docid": "e3d6ae7dd8c2660150a74799bb765d94", "score": "0.4497606", "text": "func lastCommittedOffset(mb *sarama.MockBroker, group, topic string, partition int32) Offset {\n\tfor i := len(mb.History()) - 1; i >= 0; i-- {\n\t\treq, ok := mb.History()[i].Request.(*sarama.OffsetCommitRequest)\n\t\tif !ok || req.ConsumerGroup != group {\n\t\t\tcontinue\n\t\t}\n\t\toffset, metadata, err := req.Offset(topic, partition)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\treturn Offset{offset, metadata}\n\t}\n\treturn Offset{}\n}", "title": "" }, { "docid": "16409d79bf9739f93f7ba4317acb2fe3", "score": "0.44908243", "text": "func (l *RaftLog) LastIndex() uint64 {\n\t// Your Code Here (2A).\n\ti := len(l.entries) - 1\n\tif i < 0 {\n\t\treturn l.initIdx\n\t}\n\treturn l.entries[i].Index\n}", "title": "" }, { "docid": "9b2882117333cdfafd381a28f2fe62a9", "score": "0.4480731", "text": "func (l *Log) LastTerm() uint64 {\n\treturn l.LastEntry().Term\n}", "title": "" }, { "docid": "44faee0781655b24d7d10061b3d8e4de", "score": "0.44717598", "text": "func GetMostRecentTweet(tx *sql.Tx, author model.TweetAuthor, before time.Time) (t model.DBTweet, err error) {\n\tif len(author.ScreenNames) == 0 {\n\t\treturn model.DBTweet{}, fmt.Errorf(\"Author has no screen names: %v\", author)\n\t}\n\tqueryArgsStr, iArgs := stringQueryArgsList(author.ScreenNames, 1)\n\trow := tx.QueryRow(`\n\t\tSELECT t.tweet_id_str, t.screen_name, t.created_at, t.body\n\t\tFROM tweets t\n\t\tWHERE t.created_at < $1\n\t\t\tAND t.screen_name IN (`+queryArgsStr+`)\n\t\tORDER BY t.created_at DESC\n\t\tLIMIT 1;\n\t`, append([]interface{}{before}, iArgs...)...)\n\terr = row.Scan(&t.IDStr, &t.ScreenName, &t.CreatedAt, &t.Body)\n\treturn\n}", "title": "" }, { "docid": "5399824647689dfedbd05b40bd08c68f", "score": "0.44651526", "text": "func (s *IPCredentialList) LastPage() (*IPCredentialList, error) {\n\treturn s.getPage(s.Meta.LastPageUri)\n}", "title": "" }, { "docid": "a83393b659b3cdc24ac6dc653c5cb3d4", "score": "0.44599885", "text": "func updateUserLastSearch(searchText, username string) {\n\n\tstmt, err := db.Prepare(\"UPDATE usersDB SET lastSearch=? WHERE un=?\")\n\tcheck(err)\n\tdefer stmt.Close()\n\n\tr, err := stmt.Exec(searchText, username)\n\tcheck(err)\n\n\tn, err := r.RowsAffected()\n\t_ = n\n\tcheck(err)\n\n}", "title": "" }, { "docid": "518151e1e900ab1f99b149a67a97307d", "score": "0.4448278", "text": "func (a *Analytics) LastFlush() (time.Time, error) {\n\tinfo, err := os.Stat(filepath.Join(a.root, \"last_flush\"))\n\tif err != nil {\n\t\treturn time.Unix(0, 0), err\n\t}\n\n\treturn info.ModTime(), nil\n}", "title": "" }, { "docid": "e7964f04256481accaa767f59579c05c", "score": "0.4433516", "text": "func (d *DataStore) FindTweet(screenNames []string, before int64, page int) *twitter.Tweet {\n\tif before == 0 {\n\t\tbefore = time.Now().Unix()\n\t}\n\tvar matchingRecords = [][]byte{}\n\n\td.DB.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(\"Tweets\"))\n\n\t\tb.ForEach(func(k, v []byte) error {\n\t\t\tkey := &Key{}\n\t\t\tkey.Deserialize(string(k))\n\t\t\tif len(screenNames) == 1 && screenNames[0] == \"home\" {\n\t\t\t\tif key.CreatedAt < before {\n\t\t\t\t\tmatchingRecords = append(matchingRecords, k)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor _, sn := range screenNames {\n\t\t\t\t\tif sn == key.ScreenName && key.CreatedAt < before {\n\t\t\t\t\t\tmatchingRecords = append(matchingRecords, k)\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\treturn nil\n\t\t})\n\t\treturn nil\n\t})\n\tif len(matchingRecords)-1 < page {\n\t\treturn nil\n\t}\n\n\trecord := matchingRecords[len(matchingRecords)-page-1]\n\ttweet := &twitter.Tweet{}\n\n\td.DB.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket([]byte(\"Tweets\"))\n\t\ttweetJSON := b.Get(record)\n\t\tjson.Unmarshal(tweetJSON, tweet)\n\t\treturn nil\n\t})\n\n\treturn tweet\n}", "title": "" }, { "docid": "be10069f475c14bb8c43a5febb93af3c", "score": "0.44310027", "text": "func (this *Twitter) PostTweet(userId int, tweetId int) {\n this.twitters = append(this.twitters, tweet{tweetId, userId, this.time})\n this.time++\n}", "title": "" }, { "docid": "bf88d7556e9fcfca163f880f8d3c4095", "score": "0.44256642", "text": "func (s *Storage) LastTimePoint(providerName, tokenID, currencyID string) (time.Time, error) {\n\tvar (\n\t\tresult time.Time\n\t)\n\tquery := `SELECT timestamp FROM token_rates WHERE symbol = $1 ORDER BY timestamp DESC LIMIT 1;`\n\tsymbol := fmt.Sprintf(\"%s_%s\", common.GetTokenSymbolFromProviderNameTokenID(providerName, tokenID), currencyID)\n\tif err := s.db.Get(&result, query, symbol); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn result, nil\n\t\t}\n\t\treturn result, err\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "6d972ad77c227b660cd1e3fe19cbc406", "score": "0.4423396", "text": "func (uc *UserCreate) SetLast(s string) *UserCreate {\n\tuc.mutation.SetLast(s)\n\treturn uc\n}", "title": "" }, { "docid": "32465c3faab1700fc4ffa96f05af32ce", "score": "0.44160625", "text": "func (o *TwitterUser) AddUserTwitterTweets(exec boil.Executor, insert bool, related ...*TwitterTweet) error {\n\tvar err error\n\tfor _, rel := range related {\n\t\tif insert {\n\t\t\trel.UserID = o.ID\n\t\t\tif err = rel.Insert(exec); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"failed to insert into foreign table\")\n\t\t\t}\n\t\t} else {\n\t\t\tupdateQuery := fmt.Sprintf(\n\t\t\t\t\"UPDATE \\\"twitter_tweets\\\" SET %s WHERE %s\",\n\t\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, []string{\"user_id\"}),\n\t\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", 2, twitterTweetPrimaryKeyColumns),\n\t\t\t)\n\t\t\tvalues := []interface{}{o.ID, rel.ID}\n\n\t\t\tif boil.DebugMode {\n\t\t\t\tfmt.Fprintln(boil.DebugWriter, updateQuery)\n\t\t\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t\t\t}\n\n\t\t\tif _, err = exec.Exec(updateQuery, values...); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"failed to update foreign table\")\n\t\t\t}\n\n\t\t\trel.UserID = o.ID\n\t\t}\n\t}\n\n\tif o.R == nil {\n\t\to.R = &twitterUserR{\n\t\t\tUserTwitterTweets: related,\n\t\t}\n\t} else {\n\t\to.R.UserTwitterTweets = append(o.R.UserTwitterTweets, related...)\n\t}\n\n\tfor _, rel := range related {\n\t\tif rel.R == nil {\n\t\t\trel.R = &twitterTweetR{\n\t\t\t\tUser: o,\n\t\t\t}\n\t\t} else {\n\t\t\trel.R.User = o\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "42054dbc425d41d567f4443d5519c6c5", "score": "0.4411151", "text": "func (d *DB) Last() string {\n\tif data, err := d.db.Get(pack(last), nil); err == nil {\n\t\treturn string(data)\n\t} else {\n\t\tlog.Print(err)\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "71cc4ba9ad07f8b761aeb7d097520094", "score": "0.44106874", "text": "func (r *records) Cursor() time.Time {\n\treturn r.cursor.Add(-r.period)\n}", "title": "" }, { "docid": "c11c07e7e6dad3fea9a2645072547634", "score": "0.4405961", "text": "func (f *FirehoseBase) persistLastChangeTime(interval time.Duration) {\n\tticker := time.NewTicker(interval)\n\n\tfor {\n\t\tselect {\n\t\tcase <-f.stopCh:\n\t\t\tf.lastChangeIndexCh <- f.lastChangeIndex\n\t\t\tbreak\n\t\tcase <-ticker.C:\n\t\t\tf.lastChangeIndexCh <- f.lastChangeIndex\n\t\t}\n\t}\n}", "title": "" }, { "docid": "25c7d1d6276c801ba39be4ac7917f3ec", "score": "0.44035012", "text": "func (this *Twitter) PostTweet(userId int, tweetId int) {\n\tuser := this.getUser(userId)\n\tnewTweet := &Tweet{tweetId, userId, user.lastTweet}\n\tuser.lastTweet = newTweet\n}", "title": "" }, { "docid": "a4dcb4a7e72022305cd1ce9ccc35556d", "score": "0.44027755", "text": "func TestTxCursorLeafRootReverse(t *testing.T) {\n\twithOpenDB(func(db *DB, path string) {\n\t\tdb.Update(func(tx *Tx) error {\n\t\t\ttx.CreateBucket(\"widgets\")\n\t\t\ttx.Bucket(\"widgets\").Put([]byte(\"baz\"), []byte{})\n\t\t\ttx.Bucket(\"widgets\").Put([]byte(\"foo\"), []byte{0})\n\t\t\ttx.Bucket(\"widgets\").Put([]byte(\"bar\"), []byte{1})\n\t\t\treturn nil\n\t\t})\n\t\ttx, _ := db.Begin(false)\n\t\tc := tx.Bucket(\"widgets\").Cursor()\n\n\t\tk, v := c.Last()\n\t\tassert.Equal(t, string(k), \"foo\")\n\t\tassert.Equal(t, v, []byte{0})\n\n\t\tk, v = c.Prev()\n\t\tassert.Equal(t, string(k), \"baz\")\n\t\tassert.Equal(t, v, []byte{})\n\n\t\tk, v = c.Prev()\n\t\tassert.Equal(t, string(k), \"bar\")\n\t\tassert.Equal(t, v, []byte{1})\n\n\t\tk, v = c.Prev()\n\t\tassert.Nil(t, k)\n\t\tassert.Nil(t, v)\n\n\t\tk, v = c.Prev()\n\t\tassert.Nil(t, k)\n\t\tassert.Nil(t, v)\n\n\t\ttx.Rollback()\n\t})\n}", "title": "" }, { "docid": "10ab55c7144f1af1115fb6b33aa65ea0", "score": "0.44014543", "text": "func (q *Query) Last() {\n\tq.year = 0\n\tq.month = time.January\n\tq.day = 0\n\tq.isNotLast = false\n}", "title": "" }, { "docid": "e92bcd7ad333ce0b28ebfc7619a21f69", "score": "0.4401123", "text": "func (m *RefreshTokenMutation) SetLastUsed(t time.Time) {\n\tm.last_used = &t\n}", "title": "" }, { "docid": "5e45674314041c4aece71fb54a693748", "score": "0.4394452", "text": "func (gmCommand *CommandGetMore) setCursorIDs(newCursorIDs []int64) error {\n\tvar newCursorID int64\n\n\tif len(newCursorIDs) > 1 {\n\t\treturn fmt.Errorf(\"rewriting getmore command cursorIDs requires 1 id, received: %d\", len(newCursorIDs))\n\t}\n\tif len(newCursorIDs) < 1 {\n\t\tnewCursorID = 0\n\t} else {\n\t\tnewCursorID = newCursorIDs[0]\n\t}\n\tvar doc bson.D\n\tswitch t := gmCommand.CommandArgs.(type) {\n\tcase *bson.D:\n\t\tdoc = *t\n\tcase *bson.Raw:\n\t\terr := t.Unmarshal(&doc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to unmarshal bson.Raw into struct: %v\", err)\n\t\t}\n\tdefault:\n\t\tpanic(\"not a *bson.D or *bson.Raw\")\n\t}\n\n\t// loop over the keys of the bson.D and the set the correct one\n\tfor i, bsonDoc := range doc {\n\t\tif bsonDoc.Name == \"getMore\" {\n\t\t\tdoc[i].Value = newCursorID\n\t\t\tbreak\n\t\t}\n\t}\n\tgmCommand.cachedCursor = &newCursorID\n\tgmCommand.CommandArgs = &doc\n\treturn nil\n}", "title": "" }, { "docid": "bc35ab06b6f4ce0a8a4abb2fb08c4b72", "score": "0.43840665", "text": "func (i *singleLevelIterator) Last() (*InternalKey, []byte) {\n\tif i.upper != nil {\n\t\tpanic(\"singleLevelIterator.Last() used despite upper bound\")\n\t}\n\ti.positionedUsingLatestBounds = true\n\ti.maybeFilteredKeysSingleLevel = false\n\treturn i.lastInternal()\n}", "title": "" }, { "docid": "1e1369cc7a600b2e76ac0937c7231dfe", "score": "0.4382047", "text": "func (f *Feeds) setLastPost(feed *models.Feed) {\n\tf.log.Printf(\"Updating last post for feed %d\\n\", feed.ID)\n\n\t// Note that we're not using a transaction here (because the update process can take a while), but there's only one of these methods that can be running at the same time\n\t// The bot can be deleting the feed in the meanwhile, but this would just make the next query fail (and that's why we're ignoring the error here)\n\t_, err := db.GetDB().Exec(\"UPDATE feeds SET feed_title = ?, feed_last_modified = ?, feed_etag = ?, feed_last_post_title = ?, feed_last_post_link = ?, feed_last_post_date = ?, feed_last_post_photo = ? WHERE feed_id = ?\", feed.Title, feed.LastModified, feed.ETag, feed.LastPostTitle, feed.LastPostLink, feed.LastPostDate, feed.LastPostPhoto, feed.ID)\n\tif err != nil {\n\t\tf.log.Printf(\"Error while updating the last post for feed %s (id: %d), but continuing with next. Error: %s\\n\", feed.Url, feed.ID, err)\n\t}\n}", "title": "" }, { "docid": "aaae03d9979bf0acb81835a8c93a34fa", "score": "0.43799806", "text": "func (o LookupObjectTypeResultOutput) LastUpdatedAt() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupObjectTypeResult) *string { return v.LastUpdatedAt }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "303e06c28499fd57806bfab609db2856", "score": "0.4379386", "text": "func (l *RaftLog) LastIndex() uint64 {\n\t// Your Code Here (2A).\n\tif len(l.entries) > 0 {\n\t\treturn l.entries[len(l.entries)-1].Index\n\t}\n\tif l.pendingSnapshot != nil {\n\t\treturn l.pendingSnapshot.Metadata.Index\n\t}\n\treturn l.snapshotIndex // firstIndex 前面可能有一段空洞,在 2b 引入\n}", "title": "" }, { "docid": "d2fc31c011756f822bf08451a639423b", "score": "0.43746614", "text": "func (p *Paginator) SetAfterCursor(afterCursor string) {\n\tp.cursor.After = &afterCursor\n}", "title": "" }, { "docid": "acd12f98861daf35eacbdf1c3c87c771", "score": "0.4373978", "text": "func (u *User) LastPlay() int32 {\n\treturn int32(u.lastPlay)\n}", "title": "" }, { "docid": "c0d55582eee962214262b0eb17f1083d", "score": "0.43727311", "text": "func (rf *Raft) getLastIndex() int {\n\treturn len(rf.logs) - 1\n}", "title": "" }, { "docid": "b6fae1aad5cc39c3577513acf2adc470", "score": "0.436853", "text": "func (app *PersistentApplication) SaveLastBlock(lastBlock LastBlockInfo) {\n\tlb := app.LoadLastBlock()\n\tselector := bson.M{\"height\": lb.Height}\n\tupdator := bson.M{\"$set\": bson.M{\"height\": lastBlock.Height, \"app_hash\": lastBlock.AppHash}}\n\t_, err := app.app.state.DB.C(\"blocks\").Upsert(selector, updator)\n\tif err != nil {\n\t\tapp.app.logger.Error(\"Block saving error\", \"error\", err.Error())\n\t\treturn\n\t}\n\tapp.app.logger.Info(\"Saved block\", \"height\", lastBlock.Height, \"hash\", string(lastBlock.AppHash))\n}", "title": "" }, { "docid": "800deeb125bf9e3807358f357e8db43d", "score": "0.43549138", "text": "func (player *Player) SetLastKnownAddress(address string) {\n\tplayer.lastKnownAddress = address\n}", "title": "" }, { "docid": "056f449647d28f23b7b99e8881b0e6b2", "score": "0.43537697", "text": "func updateCursorPosition(cursor *ui.Cursor, noOfElements int) {\n\tcursor.Max(noOfElements - 1)\n}", "title": "" }, { "docid": "26c6589e55df32e3e4439d94b1c74884", "score": "0.4352068", "text": "func (d *Document) GetWordAfterCursor() string {\n\tend := d.FindEndOfCurrentWord()\n\treturn string(d.textAfterCursor()[:end])\n}", "title": "" }, { "docid": "633ee43f13451933c147f367c54bc47a", "score": "0.434724", "text": "func (s *followerReplication) setLastContact() {\n\ts.lastContactLock.Lock()\n\ts.lastContact = time.Now()\n\ts.lastContactLock.Unlock()\n}", "title": "" }, { "docid": "9ca2bef9d049d92a8f31a8bdbd67b2b7", "score": "0.43394065", "text": "func SaveOAuthSession(tx *sql.Tx, session common.OAuthSession) error {\n\t_, err := tx.Exec(`\n\t\tINSERT INTO oauth_session(state, fingerprint, timestamp) VALUES ($1, $2, $3)\n\t`, session.State, session.Fingerprint, session.Timestamp)\n\treturn err\n}", "title": "" }, { "docid": "4a533390539990f228e5c236d8ad8866", "score": "0.43289813", "text": "func (w *Window) SetCursor(me *mouse.MoveEvent) {\n\tmaxLevel := 0\n\tmaxLevelCursor := cursor.Arrow\n\tmaxLevelWidget := &WidgetBase{}\n\n\tfun := func(k ki.Ki, level int, data any) bool {\n\t\t_, ni := KiToNode2D(k)\n\t\tif ni == nil {\n\t\t\t// could have nodes further down (eg with menu which is ki.Slice), so continue\n\t\t\treturn ki.Continue\n\t\t}\n\t\tif !ni.PosInWinBBox(me.Pos()) {\n\t\t\t// however, if we are out of bbox, there is no way to get back in\n\t\t\treturn ki.Break\n\t\t}\n\t\tif !ni.IsVisible() || level < maxLevel {\n\t\t\t// could have visible or higher level ones further down\n\t\t\treturn ki.Continue\n\t\t}\n\n\t\twb, ok := ni.This().Embed(TypeWidgetBase).(*WidgetBase)\n\t\tif !ok {\n\t\t\t// same logic as with Node2D\n\t\t\treturn ki.Continue\n\t\t}\n\t\tmaxLevel = level\n\t\tmaxLevelCursor = wb.Style.Cursor\n\t\tmaxLevelWidget = wb\n\t\treturn ki.Continue\n\t}\n\n\tpop := w.CurPopup()\n\tif pop == nil {\n\t\t// if no popup, just do on window\n\t\tw.FuncDownMeFirst(0, nil, fun)\n\t} else {\n\t\t_, popni := KiToNode2D(pop)\n\t\tif popni == nil || !popni.PosInWinBBox(me.Pos()) || PopupIsTooltip(pop) {\n\t\t\t// if not in popup (or it is a tooltip), do on window\n\t\t\tw.FuncDownMeFirst(0, nil, fun)\n\t\t} else {\n\t\t\t// if in popup, do on popup\n\t\t\tpopni.FuncDownMeFirst(0, nil, fun)\n\t\t}\n\n\t}\n\n\tif w.IsInSelectionMode() && maxLevelWidget != nil {\n\t\tme.SetProcessed()\n\t\tw.SelectionSprite(maxLevelWidget)\n\t\tw.SelectedWidget = maxLevelWidget\n\t\toswin.TheApp.Cursor(w.OSWin).Set(cursor.Arrow) // always arrow in selection mode\n\t} else {\n\t\t// only set cursor if not in selection mode\n\t\toswin.TheApp.Cursor(w.OSWin).Set(maxLevelCursor)\n\t}\n}", "title": "" }, { "docid": "ebb4f9457acda001a0aa918d70e4d77e", "score": "0.4325215", "text": "func (ms *StorageStableInMemory) LastIndex() (uint64, error) {\n\tms.mu.Lock()\n\tidx := ms.lastIndex()\n\tms.mu.Unlock()\n\n\treturn idx, nil\n}", "title": "" }, { "docid": "e361bff59b67e9ab0e9f29983b627e8c", "score": "0.43169516", "text": "func (m *RefreshTokenMutation) LastUsed() (r time.Time, exists bool) {\n\tv := m.last_used\n\tif v == nil {\n\t\treturn\n\t}\n\treturn *v, true\n}", "title": "" }, { "docid": "78e9f83a89d989ee8906d38b603537bc", "score": "0.43076527", "text": "func (b *Board) UndoLastMove() {\n\t// TODO\n}", "title": "" }, { "docid": "bbef654f58eb70635de738b145bcf169", "score": "0.4295581", "text": "func Last() string {\n\tif len(commandHistory) == 0 {\n\t\treturn \"\"\n\t}\n\thistoryCursor--\n\tif historyCursor < 0 {\n\t\thistoryCursor = len(commandHistory) - 1\n\t}\n\treturn commandHistory[historyCursor]\n}", "title": "" }, { "docid": "5d9d9c2cc67bf8385120a4bf1ce5a5dc", "score": "0.42883462", "text": "func (mc *InstanceCrawler) LastCrawled() time.Time {\n\tmc.LastCrawledFnInvoked = true\n\treturn mc.LastCrawledFn()\n}", "title": "" }, { "docid": "90beab8ed8260f3762430c1e245990a9", "score": "0.42872298", "text": "func (o *Entity) SetLastSeenTms(v int64) {\n\to.LastSeenTms = &v\n}", "title": "" }, { "docid": "35868c7faf8465fcba7a56654da4eb8c", "score": "0.4279129", "text": "func (agt *REINFORCE) LastUpdate(s []float64, a int, r float64, rng *mathlib.Random) {\n\t// If ready to update, update and wipe the states, actions, and rewards.\n\tif agt.ep.LastUpdate(s, a, r) {\n\t\tagt.episodeLimitReached(rng)\n\t}\n}", "title": "" }, { "docid": "74bfe5e199cc980d265b3295d6b8f62a", "score": "0.42775285", "text": "func (cursor *Cursor) IsLastPoint() bool {\n\treturn cursor.AtLastLineOfBuffer() && cursor.AtEndOfLine()\n}", "title": "" }, { "docid": "3c47e47b7e2a2c7981b02728af8289a1", "score": "0.42771626", "text": "func (m *DeviceTokenMutation) SetLastRequest(t time.Time) {\n\tm.last_request = &t\n}", "title": "" }, { "docid": "17c18f538bc5b458b2d3dbba5406aa8d", "score": "0.42759624", "text": "func (r ResourcePage) LastMarker() (string, error) {\n\tvar s ListResp\n\terr := r.ExtractInto(&s)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn s.PageInfo.NextMarker, nil\n}", "title": "" }, { "docid": "d62fafb28d03a9fb32151eed1ba79461", "score": "0.42749152", "text": "func (txn *Txn) Last(table, index string, args ...interface{}) (interface{}, error) {\n\t_, val, err := txn.LastWatch(table, index, args...)\n\treturn val, err\n}", "title": "" }, { "docid": "9902ac65d212072c8e68e3eeb1f73efc", "score": "0.42725503", "text": "func (a *Client) LastFlush() (time.Time, error) {\n\tinfo, err := os.Stat(filepath.Join(a.Dir, \"last_flush\"))\n\tif err != nil {\n\t\treturn time.Unix(0, 0), err\n\t}\n\n\treturn info.ModTime(), nil\n}", "title": "" } ]
425ee7169c6bdf98486cdb782158af6d
Check makes sure that name exists.
[ { "docid": "0e995fe4cd31614223160b498f5c19b0", "score": "0.6375008", "text": "func (c *nameOptions) Check() error {\n\tif c.Name == \"\" {\n\t\treturn ErrNameMissing\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "32b5754d97bc515d11335b62b7749a97", "score": "0.7183531", "text": "func CheckName(name string) error {\n\treturn nil\n}", "title": "" }, { "docid": "0c7ea52bb09d3dc1b815696f7fc2d1ec", "score": "0.71761864", "text": "func (l Lawyer) NameExists(n string) bool {\n\t// Format name\n\tn = strings.ToUpper(n)\n\tn = strings.TrimSpace(n)\n\n\t// Check if name exists\n\tfor _, sa := range l.SubArguments {\n\t\tn2 := strings.ToUpper(sa.Name)\n\t\tif n == n2 {\n\t\t\t// Name found\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "13ea5aa9fedeb9f79b835f43e14cd955", "score": "0.69725144", "text": "func checkName(ctx context.Context, name string) (Info, error) {\n\tm := nameRegexp.FindStringSubmatch(filepath.Base(name))\n\tif m == nil {\n\t\tzlog.Debug(ctx).\n\t\t\tMsg(\"name not useful\")\n\t\treturn Info{}, errUnpopulated\n\t}\n\treturn Info{\n\t\tName: m[1],\n\t\tVersion: m[2],\n\t\tSource: \".\",\n\t}, nil\n}", "title": "" }, { "docid": "13ea5aa9fedeb9f79b835f43e14cd955", "score": "0.69725144", "text": "func checkName(ctx context.Context, name string) (Info, error) {\n\tm := nameRegexp.FindStringSubmatch(filepath.Base(name))\n\tif m == nil {\n\t\tzlog.Debug(ctx).\n\t\t\tMsg(\"name not useful\")\n\t\treturn Info{}, errUnpopulated\n\t}\n\treturn Info{\n\t\tName: m[1],\n\t\tVersion: m[2],\n\t\tSource: \".\",\n\t}, nil\n}", "title": "" }, { "docid": "d16fc66d930f44fbdead9395f0f00376", "score": "0.69211465", "text": "func isNameAvailable(name string) bool {\n\tif fileExists(name) {\n\t\tfmt.Println(\"Cannot use folder/file name as alias name.\")\n\t\treturn false\n\t} else if strings.Index(name, \" \") != -1 {\n\t\tfmt.Println(\"Cannot use spaces in alias name.\")\n\t\treturn false\n\t} else if name == \"\" {\n\t\tfmt.Println(\"Cannot use empty string as alias name. \")\n\t\treturn false\n\t} else if commandExists(name) && !isInArray(name, currentAliases) {\n\t\tfmt.Println(\"Cannot use existing command as alias name.\")\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "7647c45534efdb829016c9851a2d8079", "score": "0.6874639", "text": "func checkIfName(name string) error {\n\tnl := len(name)\n\tif nl == 0 {\n\t\treturn fmt.Errorf(\"empty interface name\")\n\t} else if nl > rt.IF_NAMESIZE {\n\t\treturn fmt.Errorf(\"interface name too long\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d912e32e8879e1ae4e51c0f5d18a3eb2", "score": "0.6811777", "text": "func (n Name) Valid() bool { return n.name != \"\" }", "title": "" }, { "docid": "05d7dbd6f87519753f0640674930d061", "score": "0.6755382", "text": "func nameChecker(name string) error {\n\tforbiddenChars := \"'\\\" ! # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \\\\ ] ^ _` { | }\"\n\tif strings.ContainsAny(name, forbiddenChars) {\n\t\treturn fmt.Errorf(\"name shouldn't containt any of: %s\", forbiddenChars)\n\t}\n\tif len(name) == 0 {\n\t\treturn fmt.Errorf(\"please write your name\")\n\t}\n\tif len(name) > 32 {\n\t\treturn fmt.Errorf(\"name shouldn't containt more of 32 characters\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a026e0ee5097f49c004c307acf6774a3", "score": "0.66254026", "text": "func checkName(typ token.Token, name *ast.Ident, errs *[]error) {\n\tif !strings.HasPrefix(name.Name, \"__\") {\n\t\treturn\n\t}\n\n\t*errs = append(*errs, fmt.Errorf(\"%s is an invalid name for type: %s\", name.Name, typ))\n}", "title": "" }, { "docid": "016202cb145d80a1cf9492f3eab90d86", "score": "0.6601461", "text": "func nameIsValid(s string) bool {\n\treturn s != \"\" && s == validPkgName(s)\n}", "title": "" }, { "docid": "8d74a26014efb89120292b4d35a84e50", "score": "0.65876704", "text": "func (obj *update) HasName() bool {\n\treturn obj.name != \"\"\n}", "title": "" }, { "docid": "8d74a26014efb89120292b4d35a84e50", "score": "0.65876704", "text": "func (obj *update) HasName() bool {\n\treturn obj.name != \"\"\n}", "title": "" }, { "docid": "be297cfd64437e70c359533b8e58d9f7", "score": "0.65733874", "text": "func CheckTourName(name string) (err error) {\n\tnames, _ := serverstore.Tours.GetName()\n\terr = errSC.Success\n\tfor _, v := range names {\n\t\tif v == name {\n\t\t\terr = errSC.ErrTourName\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d18e5328ac82360ba55da0a5ae5122e2", "score": "0.6537526", "text": "func (data *DataSource) NameExists(name string) bool {\n\tvar count int\n\tdata.db.Model(&User{}).Where(\"name = ?\", name).Count(&count)\n\treturn count > 0\n}", "title": "" }, { "docid": "ed3808780594f8f9e0fde001ffbe8fce", "score": "0.65341765", "text": "func checkNamePath(val string) (bool) {\n\tsanit, _ := regexp.MatchString(\"^[a-zA-Z0-9_ -\\\\/]*$\", val)\n\treturn sanit\n}", "title": "" }, { "docid": "63ae2029938e68e930bc1e5465019bcc", "score": "0.6495504", "text": "func isValidName(argName string) bool {\n\n\tif argName == \"\" {\n\t\treturn false\n\t}\n\n\tregex := regexp.MustCompile(\"([a-zA-Z][\\x2Ea-zA-Z0-9_-]*)\")\n\tmatches := regex.FindAllString(argName, 1)\n\tif len(matches) == 0 {\n\t\treturn false\n\t} else if matches[0] != argName {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "a4a54c8d2fc01a3549ab25935cdf56ab", "score": "0.64717174", "text": "func checkName(name string) error {\n\tvalid, err := regexp.Match(pattern, []byte(name))\n\tif err != nil {\n\t\treturn errors.New(\"Regular expression error=\" + err.Error())\n\t}\n\tif !valid {\n\t\treturn errors.New(`Name contains by [letters, numbers, \"_\", \"@\", \".\" and \"-\"] and length must be [1-40] `)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2b318730dd37bb7e9e62dfd3086014ab", "score": "0.6452229", "text": "func isUnnamed(name string) bool {\n\treturn len(name) == 0\n}", "title": "" }, { "docid": "de0a5722c731f23acdd44340f5a3ad7a", "score": "0.64437777", "text": "func isName(id string) bool {\n\treturn !strings.HasPrefix(id, \"urn:\")\n}", "title": "" }, { "docid": "3294e80f14e76bb5a22a12724f9ce643", "score": "0.6416591", "text": "func exist(name string) bool {\n\tif _, err := os.Stat(name); os.IsNotExist(err) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "47e413a6af5c72a409db89af411463e4", "score": "0.6412931", "text": "func (c Command) HasName(name string) bool {\n\treturn c.Name == name || c.ShortName == name\n}", "title": "" }, { "docid": "dbdd36b90ed08a1ab9b2a5b759acbd7a", "score": "0.6392199", "text": "func checkName(name string, validNames chan string, waitgroup *sync.WaitGroup) {\n\n\tresp, err := http.Get(baseURL + name)\n\n\tif err != nil {\n\t\tfmt.Printf(\"[*] Response error on: %s\\n\", baseURL+name)\n\t\treturn\n\t}\n\n\tdefer resp.Body.Close()\n\tdefer waitgroup.Done()\n\n\tfmt.Printf(\"[*] Trying: %s\\t Status: %d\\n\", name, resp.StatusCode)\n\n\tswitch resp.StatusCode {\n\t// Name is available\n\tcase 404:\n\t\tvalidNames <- name\n\n\t// Name is taken\n\tcase 200:\n\t\tbreak\n\n\t// We made too many requests\n\tcase 429:\n\t\t// TODO wait automatically\n\t\tfmt.Println(\"[*] Made too many requests, try again later...\")\n\t\tos.Exit(1)\n\n\t// Instagram down omg\n\tdefault:\n\t\tfmt.Printf(\"[*] Unhandled Status: %d for %s\", resp.StatusCode, name)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "5f00c9cdc7eec5e64a0254f6e5b72ddb", "score": "0.6382976", "text": "func CheckPlayerName(name string) (err error) {\n\tnames, _ := serverstore.Players.GetName()\n\terr = errSC.Success\n\tfor _, v := range names {\n\t\tif v == name {\n\t\t\terr = errSC.ErrPlayerName\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "662a614fb783d57aca3c0b5c68b4fe43", "score": "0.6363654", "text": "func (o *CdnSiteScript) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "78900cc20cb14713d723054dfe1798a1", "score": "0.63630444", "text": "func isExists(name string) bool {\n\t_, err := os.Stat(name)\n\treturn !os.IsNotExist(err)\n}", "title": "" }, { "docid": "9a76f89b15bf728bc3e813a9981104f0", "score": "0.6357385", "text": "func IsValidName(name string) bool {\n\treturn strings.TrimSpace(name) != \"\"\n}", "title": "" }, { "docid": "47a899c59bbeb64922a3fc293e259b3f", "score": "0.6353689", "text": "func (ps *Store) validateName(name string) error {\n\tfor _, p := range ps.plugins {\n\t\tif p.Name() == name {\n\t\t\treturn alreadyExistsError(name)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8925f237017e4e30567b04701ef23d1d", "score": "0.6343248", "text": "func (*NfsCreator) CheckName(ctx context.Context, name string) error {\n\treturn volumeNameValidation(name)\n}", "title": "" }, { "docid": "97c392229389728e1e00e207ff50550e", "score": "0.6335997", "text": "func (*TemplateDBService) NameExists(name string) (bool, error) {\n\tvar tp Template\n\terr := rdb.Where(&Template{Name: name}).First(&tp).Error\n\tif err != nil {\n\n\t\tif err == gorm.ErrRecordNotFound {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil\n}", "title": "" }, { "docid": "bf61f89c33cb940e0eeef78eaff7ae9a", "score": "0.63258916", "text": "func (p *Names) CheckValid() error {\n\tfor s, n := range p.lazyInit().has {\n\t\tswitch {\n\t\tcase n > 1:\n\t\t\treturn errors.New(\"duplicate name: %q\", s)\n\t\tcase false && !s.IsValid():\n\t\t\t// NOTE: The C++ implementation does not validate the identifier.\n\t\t\t// See https://github.com/protocolbuffers/protobuf/issues/6335.\n\t\t\treturn errors.New(\"invalid name: %q\", s)\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "863f403ef2a9eac9833a17e92d29cde6", "score": "0.6298074", "text": "func checkBundleName(name string) error {\n\tif ok := bundleRE.MatchString(name); ok {\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"Error with bundleName, expected %q, got: %s\", bundleRE, name)\n}", "title": "" }, { "docid": "b7dbecb00b42f94c9f339629c26a4c5c", "score": "0.6294382", "text": "func hasName(name string) func(Object) bool {\n\treturn func(ct Object) bool {\n\t\treturn ct.GetName() == name\n\t}\n}", "title": "" }, { "docid": "6914da4aa8a53b613535c7eb5d46026a", "score": "0.62939394", "text": "func exists(name string) bool {\n\tif _, err := os.Stat(name); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "6914da4aa8a53b613535c7eb5d46026a", "score": "0.62939394", "text": "func exists(name string) bool {\n\tif _, err := os.Stat(name); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "4a3208f19e48e2be3ae94343a03b0e49", "score": "0.6275434", "text": "func (s *SyntheticsTest) HasName() bool {\n\tif s != nil && s.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "2fba1fb98d9d62b76ea43a1bbb600b32", "score": "0.6269502", "text": "func (o *Host) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b0e5e1793a9b931f815329a16aac64f8", "score": "0.6269495", "text": "func exists(name string) bool {\n\t_, err := os.Stat(name)\n\treturn err == nil\n}", "title": "" }, { "docid": "53acbbc39a5eb58d5f85fbca81a80f74", "score": "0.62587917", "text": "func checkIsLocalName(name string) bool {\n\tif len(name) == 0 {\n\t\treturn true\n\t}\n\tif name[0] == '.' {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "38aa407630f1154ec43443f3b93da9a6", "score": "0.625585", "text": "func checkNameFolder(val string) (bool) {\n\tsanit, _ := regexp.MatchString(\"^[a-zA-Z0-9_ -]*$\", val)\n\treturn sanit\n}", "title": "" }, { "docid": "dec0c531c7a0d96507d43e152fa18041", "score": "0.6246531", "text": "func checkNamePathRule(val string) (bool) {\n\tsanit, _ := regexp.MatchString(\"^[a-zA-Z0-9_ -\\\\/]*.yml$\", val)\n\treturn sanit\n}", "title": "" }, { "docid": "d94695531a21a1511f4674f392aaf9df", "score": "0.6245158", "text": "func exists(name string) bool {\n\tif _, err := os.Stat(name); err != nil {\n\t\tif os.IsNotExist(err) || errors.Is(err, os.ErrPermission) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "7f79e04caf53f5ed0486717cd2d3a341", "score": "0.622877", "text": "func (a *APIKey) HasName() bool {\n\tif a != nil && a.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "824d31abaec393d7c0631e3532ecc998", "score": "0.6211794", "text": "func isGenerateNameConflict(meta metav1.ObjectMeta, err error) bool {\n\tif apierrors.IsAlreadyExists(err) && meta.Name == \"\" {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "4f55db72a31f74326a524d83fff9d013", "score": "0.6195105", "text": "func (s *service) CheckNotExist(src string) bool {\n _, err := os.Stat(src)\n return os.IsNotExist(err)\n}", "title": "" }, { "docid": "fa6801aa904ff68b0dcf4748ddd3b742", "score": "0.61857134", "text": "func isNameCorrect(titleName string, strPrefix string) bool {\n\tsplits := strings.Split(titleName, \"_\")\n\n\tif strings.HasPrefix(titleName, strPrefix) && len(splits) == 3 {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "795f1605d8d93aa563a167326c1bcf54", "score": "0.6181455", "text": "func isSafeName(name string) bool {\n\treturn name != \"\" && !strings.Contains(name, \"/\") && name != \".\" && name != \"..\"\n}", "title": "" }, { "docid": "8960265f79e70f58a6cc4584a4115bb4", "score": "0.6165219", "text": "func checkSafeName(name string) error {\n\tif name != \"\" && !strings.Contains(name, \"/\") && name != \".\" && name != \"..\" {\n\t\treturn nil\n\t}\n\treturn unix.EINVAL\n}", "title": "" }, { "docid": "c1b34fa9ac81650eab30e1baaa19dcf9", "score": "0.6164292", "text": "func isNameAvailable(name string) bool {\n\tfor _, u := range userList {\n\t\tif u.Name == name {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "8df1a1db220b8edf9d45a9e73e49df09", "score": "0.61611754", "text": "func ValidateName(name string) bool {\n\treturn nameRegex.MatchString(name) && !dotsRegex.MatchString(name)\n}", "title": "" }, { "docid": "81a6cb4021c5f4286010967fc3bc29f0", "score": "0.61506885", "text": "func TestIsNameValid(t *testing.T) {\n\tvalid := \"yernazar\"\n\tinvalidLength := \"y\"\n\tinvalidWords := \"Qasym Zhomart\"\n\n\tif !helpers.IsNameValid(valid) {\n\t\tt.Errorf(\"%s must be valid\", valid)\n\t}\n\tif helpers.IsNameValid(invalidLength) {\n\t\tt.Errorf(\"%s must be invalid (Length)\", invalidLength)\n\t}\n\tif helpers.IsNameValid(invalidWords) {\n\t\tt.Errorf(\"%s must be invalid (Length of words)\", invalidWords)\n\t}\n}", "title": "" }, { "docid": "720bf19d10866edfdeac903cd83a6290", "score": "0.6145056", "text": "func (o *Authentication) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b91baa141c5954b7fc285cb3f88047c7", "score": "0.61411434", "text": "func (s *SyntheticsLocation) HasName() bool {\n\tif s != nil && s.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bfe593d2bd4d9deee795cb4eee7b52f8", "score": "0.61406684", "text": "func ValidateName(name string) error {\n\treturn nil\n}", "title": "" }, { "docid": "034e0631cbd9c9d93bb8dab9ad5e6ca8", "score": "0.61380154", "text": "func checkValidName(username string, conn net.Conn) bool {\n\tfor _, name := range allNames {\n\t\tif name == username {\n\t\t\tmsg := \"No\"\n\t\t\tconn.Write([]byte(msg + \"\\n\"))\n\t\t\treturn true\n\t\t}\n\t}\n\tmsg := \"Yes\"\n\tconn.Write([]byte(msg + \"\\n\"))\n\treturn false\n}", "title": "" }, { "docid": "f7f73e451d247a76c793a0fa13e038ba", "score": "0.6134805", "text": "func (l *Local) NamesExist() bool {\n\treturn l.NamesExistAt(time.Now())\n}", "title": "" }, { "docid": "7444277d4e40e4e34111cb6275dc6fba", "score": "0.61242086", "text": "func Namecheck(c *gumble.Client, player string) bool {\n\t//var player2 string\n\n\tlobby := c.Channels.Find(\"AmongUs\", \"Lobby\")\n\tlobbyusers := c.Channels[lobby.ID].Users\n\n\tlog.Println(\"Checking if\", player, \"has a mumble user set\")\n\tmumbleUser := FindUserForPlayer(lobbyusers, player)\n\tif mumbleUser != nil {\n\t\tlog.Println(\"User set:\", mumbleUser.Name, \"==\", player)\n\t\treturn true\n\t}\n\n\tlog.Println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\")\n\tlog.Println(\"Player\", player, \"does not have a mumble user set.\")\n\tlog.Println(\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\")\n\treturn false\n}", "title": "" }, { "docid": "178309832a3578de0652e049b4d9b5b4", "score": "0.61221683", "text": "func (o *SystemInfo) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9f6a7edef202db59a6a3564d734f1fd3", "score": "0.61188585", "text": "func (o *Resource) HasName() bool {\n\tif o != nil && o.Name.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "af407cbe30d3425d4fcb6b97fed9f579", "score": "0.610752", "text": "func Name(s string) bool {\n\tif m, _ := regexp.MatchString(`^[a-zA-Z]+$`, s); !m {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "9a40550b434bd761277cb77ac104059a", "score": "0.60991645", "text": "func validateName(name *Name) error {\n\tn := strings.ToLower(string(*name))\n\tif n == \"\" {\n\t\treturn fmt.Errorf(\"Insert a valid name\")\n\t}\n\t*name = Name(n)\n\treturn nil\n}", "title": "" }, { "docid": "36f2f1de4104e75b8db03bd31f56948c", "score": "0.609655", "text": "func (instance *Instance) Exists(name string) bool {\n\trow := instance.DB.QueryRow(\"SELECT Name FROM metadata WHERE name = ?;\", name)\n\tvar receivedName string\n\terr := row.Scan(&receivedName)\n\n\tif err != nil {\n\t\t// if no rows were selected, return false\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn false\n\t\t}\n\n\t\tpanic(fmt.Errorf(\"Instance.Exists: got error:\\n%s\", err))\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "f247e06eb59deeb8ef525cd3493331bb", "score": "0.60933805", "text": "func (r *reqUpdateUser) HasName() bool {\n\tif r != nil && r.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "6cbc844c24d9f334b150e2cbbb74e13f", "score": "0.6081333", "text": "func (p *ImagePool) ExistsName(n string) bool {\n\tfor _, image := range p.Images {\n\t\tif image.Name == n {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1c06c7ac24c5791952d745e53d90656f", "score": "0.60736054", "text": "func (o *LogsURLParser) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8fd3c414c15f61c564cc232f32eafa2b", "score": "0.6066747", "text": "func (o *ComputePersonality) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c699f8aa74a4b5e96612c7f49f4647fe", "score": "0.6050186", "text": "func (*SCSICreator) CheckName(ctx context.Context, name string) error {\n\treturn volumeNameValidation(name)\n}", "title": "" }, { "docid": "6f16e0affe2769d047fffbc2ff4276ea", "score": "0.6039653", "text": "func (c *Create) usrNameValid() {\n\tif c.hasErr() {\n\t\treturn\n\t}\n\n\terr := c.UserName.Valid()\n\tif err != nil {\n\t\tc.err = errors.Wrap(err, \"data.api.user.create.usrNameValid\")\n\t}\n}", "title": "" }, { "docid": "6c1cd8744520e232e27565c910c7b229", "score": "0.6031065", "text": "func VerifyName(args []string) error {\n\tif len(args) == 0 {\n\t\treturn errors.New(\"a name is required\")\n\t}\n\tif len(args) > 1 {\n\t\treturn fmt.Errorf(\"too many arguments supplied: %s\", strings.Join(args, \", \"))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3a500d33690bc3c3b639076aa49b1130", "score": "0.60264856", "text": "func (o *ServerCertificate) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9c2392b3527a560a479dd4c8096c16dc", "score": "0.6025224", "text": "func isUsableName(names, patterns []string, name string) error {\n\tname = strings.TrimSpace(strings.ToLower(name))\n\tif utf8.RuneCountInString(name) == 0 {\n\t\treturn errors.EmptyName{}\n\t}\n\n\tfor i := range names {\n\t\tif name == names[i] {\n\t\t\treturn ErrNameReserved{name}\n\t\t}\n\t}\n\n\tfor _, pat := range patterns {\n\t\tif pat[0] == '*' && strings.HasSuffix(name, pat[1:]) ||\n\t\t\t(pat[len(pat)-1] == '*' && strings.HasPrefix(name, pat[:len(pat)-1])) {\n\t\t\treturn ErrNamePatternNotAllowed{pat}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "53f3c4ec8c44d888a1d74349ca31b758", "score": "0.6021618", "text": "func (d *common) validateName(name string) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"Name is required\")\n\t}\n\n\t// Don't allow ACL names to start with special port selector characters to allow LXD to define special port\n\t// selectors without risking conflict with user defined ACL names.\n\tif shared.StringHasPrefix(name, \"@\", \"%\", \"#\") {\n\t\treturn fmt.Errorf(\"Name cannot start with reserved character %q\", name[0])\n\t}\n\n\t// Ensures we can differentiate an ACL name from an IP in rules that reference this ACL.\n\terr := shared.ValidHostname(name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7b7de742b50156a373d6c054bc5702c4", "score": "0.6018788", "text": "func ifPetExist(nameOfPet string) bool {\n _, ok := pets[nameOfPet]\n return ok\n}", "title": "" }, { "docid": "87f488c1ec058f927decf9f213d4906d", "score": "0.6018659", "text": "func (o *Me) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "29ca32803bc0373492aea49fb9621970", "score": "0.60148865", "text": "func validateName(name string) error {\n\tif utils.IsZeroOfUnderlyingType(name) {\n\t\treturn fmt.Errorf(\"Name cannot be blank\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d9e17d45876ae238058775b313fe72d7", "score": "0.60130614", "text": "func isUsableName(names, patterns []string, name string) error {\n\tname = strings.TrimSpace(strings.ToLower(name))\n\tif utf8.RuneCountInString(name) == 0 {\n\t\treturn ErrNameEmpty\n\t}\n\n\tfor i := range names {\n\t\tif name == names[i] {\n\t\t\treturn ErrNameReserved{name}\n\t\t}\n\t}\n\n\tfor _, pat := range patterns {\n\t\tif pat[0] == '*' && strings.HasSuffix(name, pat[1:]) ||\n\t\t\t(pat[len(pat)-1] == '*' && strings.HasPrefix(name, pat[:len(pat)-1])) {\n\t\t\treturn ErrNamePatternNotAllowed{pat}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "225ad8df140d1203297b19b307a8c7ff", "score": "0.60041666", "text": "func (o *BillingResource) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "91a092130d0d74a0137fc3362b101d8b", "score": "0.6003122", "text": "func (s *SyntheticsUser) HasName() bool {\n\tif s != nil && s.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9d6f6b0b5fdc857db45a10672a9830bc", "score": "0.6002349", "text": "func Exists(name string) bool {\n\tif _, err := os.Stat(name); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tfmt.Println(name + \" is missing\")\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f5a5ec20eb2882649f1159ea424932a2", "score": "0.5999158", "text": "func (l *OSFileSystemLoader) Exists(name string) (string, bool) {\n\tfor i := 0; i < len(l.dirs); i++ {\n\t\tvar fileName string\n\n\t\tif !strings.Contains(name, \"::\") {\n\t\t\tfileName = path.Join(l.dirs[i], name)\n\t\t} else {\n\t\t\tif strings.Contains(l.dirs[i], \"{name}\") {\n\t\t\t\tvar customName = l.getCustomTemplate(name)\n\t\t\t\tfileName = path.Join(l.dirs[i], customName[1])\n\t\t\t\tfileName = strings.Replace(fileName, \"{name}\", customName[0], -1)\n\t\t\t}\n\t\t}\n\n\t\tif _, err := os.Stat(fileName); err == nil {\n\t\t\treturn fileName, true\n\t\t}\n\t}\n\treturn \"\", false\n}", "title": "" }, { "docid": "def16bc8bb395bcb989402dccfa65b2e", "score": "0.59882045", "text": "func (o *ModelsResourceSettingsTemplate) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "43185f4159df47a05c7db1beb3c58afa", "score": "0.5987816", "text": "func validateNameUniqueness(names map[string]nameInfo, name string,\n\tobjectName string, issues []YamlValidationIssue, line int, column int) []YamlValidationIssue {\n\tresult := issues\n\t// try to find name in the global map\n\tprevObject, ok := names[name]\n\t// name found -> add issue\n\tif ok {\n\t\tvar article string\n\t\tif objectName == prevObject.object {\n\t\t\tarticle = \"another\"\n\t\t} else {\n\t\t\tarticle = \"a\"\n\t\t}\n\t\tresult = appendIssue(result,\n\t\t\tfmt.Sprintf(`the \"%s\" %s name is already in use; %s %s was found with the same name on line %d`,\n\t\t\t\tname, objectName, article, prevObject.object, prevObject.Line), line, column)\n\t} else {\n\t\t// name not found -> add it to the global map\n\t\tnames[name] = nameInfo{object: objectName, Line: line, Column: column}\n\t}\n\treturn result\n}", "title": "" }, { "docid": "065bc7cbb39ffd267156d13af4a41d65", "score": "0.59863925", "text": "func (a *APPKey) HasName() bool {\n\tif a != nil && a.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "e2be95ffd3bc001b692a1569b657d42b", "score": "0.597439", "text": "func checkName(file *os.File,ptstart int64, nombre[16]byte)bool{\n\tif(ptstart>=178){\n\t\treturn false;\n\t}\n\tfile.Seek(ptstart,0);\n\tvar buffer[16]byte;\n\terr := binary.Read(file, binary.LittleEndian, &buffer)\n\tCheckBR(err);\n\tif (nombre == buffer){\n\t\treturn true;\n\t}\n\treturn checkName(file,ptstart+35,nombre);\n}", "title": "" }, { "docid": "c59755544d840fee6ddbcd69f883f91c", "score": "0.59717876", "text": "func checkPrefix(name string, prefix string) bool {\n\treturn strings.HasPrefix(name, prefix)\n}", "title": "" }, { "docid": "eb97d26b575fc22b12462b7f299a6066", "score": "0.5967242", "text": "func (o *HyperflexHealthCheckDefinitionAllOf) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "515cfe142192efe6db159d9735f047c5", "score": "0.596638", "text": "func validate_name(qn string, qt uint16, resolver string, debug bool) (supp string, ad bool, msg string) {\n\tname, timeout := doLookup(qn, qt, resolver)\n\tif timeout {\n\t\treturn \" T \", false, \"Lookup Errorr\"\n\t}\n\tsupp = \" - \"\n\tcounts := number[len(name.Answer)] + \" \" + number[len(name.Ns)] + \" \" + number[len(name.Extra)]\n\tad = name.AuthenticatedData\n\tswitch {\n\tcase name.Rcode == dns.RcodeSuccess && len(name.Answer) > 0:\n\t\t// got an actual answer\n\t\tPrintSection(\"ANSWER\", name.Answer, debug)\n\t\tsupp = \" A \" // Answer\n\tcase name.Rcode == dns.RcodeSuccess:\n\t\t// Got empty answer expect stuff in Authority\n\t\tPrintSection(\"Empty answer \"+counts, name.Ns, debug)\n\t\tsupp = \" + \"\n\tcase name.Rcode == dns.RcodeNameError:\n\t\t// No name exepect stuff in Authority\n\t\tPrintSection(\"DoesNotExist \"+counts, name.Ns, debug)\n\t\tsupp = \" x \"\n\tcase name.Rcode == dns.RcodeServerFailure:\n\t\tif debug { // lookup failed\n\t\t\tfmt.Printf(\"ServFail, %s %s\\n\", qn, counts)\n\t\t}\n\t\tsupp = \" S \"\n\tdefault:\n\t\t// bad case\n\t\tfmt.Printf(\"unexpected %s rcode= %d %s\\n\", qn, counts)\n\t\tfmt.Printf(name.String())\n\t\tsupp = \" F \"\n\t}\n\treturn\n}", "title": "" }, { "docid": "31d845634fa89f5fc1a284c26801b645", "score": "0.5965745", "text": "func (o *EnvironmentShortRepresentation) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7f408a6b01bdd902a18fa440b9a867ae", "score": "0.59648937", "text": "func (o *NetworkingProjectNetgwCreate) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8c4c1903019c0385070f841a1dc09fb6", "score": "0.5954886", "text": "func (c *Creator) HasName() bool {\n\tif c != nil && c.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "fb3c382767d3bf8419717e889d9bc87b", "score": "0.5953711", "text": "func IsNameValid(name string) bool {\n\tfor _, c := range name {\n\t\t//If the name doesn't match the guide it will return false\n\t\tif !regexp.MustCompile(`[a-zA-Z_ '-]`).MatchString(string(c)) {\n\t\t\treturn false\n\t\t}\n\t}\n\t//Return that the name is valid\n\treturn true\n}", "title": "" }, { "docid": "9e1953719e408d5e6683eb474af99ad0", "score": "0.59528214", "text": "func validateName(ctx ValidateFieldContext, errorString string) (bool, error) {\n\tl := GetLogger()\n\n\tswitch ctx.Inter.(type) {\n\tcase string:\n\t\tif ctx.Inter.(string) != \"\" && !NameRegex.MatchString(ctx.Inter.(string)) {\n\t\t\tl.Error(\"Field \\\"\"+ctx.Field.Name+\"\\\" is not a name (\"+errorString+\")\")\n\t\t\treturn false, l.ErrorQueue\n\t\t}\n\tdefault:\n\t\tl.Error(\"Invalid type for \\\"\"+ctx.Field.Name+\"\\\" field, expected string (\"+\n\t\t\terrorString+\")\")\n\t\treturn false, l.ErrorQueue\n\t}\n\n\treturn true, nil\n}", "title": "" }, { "docid": "70279948736bb16442091eed07d54fc3", "score": "0.5952009", "text": "func IsValidName(name string) error {\n\tif !nameRegex.MatchString(name) {\n\t\treturn errors.Errorf(\"invalid name '%s': %s\", name, DosaNamingRule)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "272ae440ddb1650dccd32f7992ff6f72", "score": "0.594609", "text": "func (o *RackUnitPersonalityAllOf) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1bbd84b3dc7eaf70696bbe71c3ae47a9", "score": "0.5944562", "text": "func ValidateName(projectName string) bool {\n\tstrlen := utf8.RuneCountInString(projectName)\n\tif strlen > 20 || strlen < 4 {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9ab2ab33ef6e235d738fdb45fb0fb9bf", "score": "0.5940469", "text": "func goodName(name string) bool {\n\tif name == \"\" {\n\t\treturn false\n\t}\n\tfor i, r := range name {\n\t\tswitch {\n\t\tcase r == '_':\n\t\tcase i == 0 && !unicode.IsLetter(r):\n\t\t\treturn false\n\t\tcase !unicode.IsLetter(r) && !unicode.IsDigit(r):\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9ab2ab33ef6e235d738fdb45fb0fb9bf", "score": "0.5940469", "text": "func goodName(name string) bool {\n\tif name == \"\" {\n\t\treturn false\n\t}\n\tfor i, r := range name {\n\t\tswitch {\n\t\tcase r == '_':\n\t\tcase i == 0 && !unicode.IsLetter(r):\n\t\t\treturn false\n\t\tcase !unicode.IsLetter(r) && !unicode.IsDigit(r):\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "bd159e7a4fdbb8c814fd77460c68fc1e", "score": "0.5932955", "text": "func Exist(name string) bool {\n\t_, err := os.Stat(name)\n\treturn err == nil\n}", "title": "" }, { "docid": "937f65df40d25acbe9f82f40d9ecd68d", "score": "0.59245825", "text": "func (o *LicensedWorkload) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7f3e1248ac9c58dc18130d4dc201a634", "score": "0.5922385", "text": "func (o *PipelineStepStateReady) HasName() bool {\n\tif o != nil && o.Name != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c6a6df911b11c3e8dab408580123736b", "score": "0.59186864", "text": "func (l *Local) NamesExistAt(t time.Time) bool {\n\t// rounded to start of day\n\trounded := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.UTC)\n\n\tpath := filepath.Join(config.DataDir, config.NamesDir, strconv.FormatInt(rounded.Unix(), 10), config.NamesJSON)\n\n\treturn l.Exists(path)\n}", "title": "" } ]
369f32e3719131213320b17d6800a499
Create initializes the builder
[ { "docid": "4aeb9c173db43de05df2c02ff7353f99", "score": "0.675671", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.operationBuilder)\n}", "title": "" } ]
[ { "docid": "2905ef5a81adb97f31cd0ed64fcf98c0", "score": "0.71149504", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(\n\t\tapp.blocksFactory,\n\t\tapp.bucketsFactory,\n\t\tapp.permanentBucketsFactory,\n\t)\n}", "title": "" }, { "docid": "8b23d1652b09b2651ee6d4e409eaffe0", "score": "0.6952624", "text": "func (app *testableBuilder) Create() TestableBuilder {\n\treturn createTestableBuilder()\n}", "title": "" }, { "docid": "904e4e2b4ad207efcf7939d8d87432e0", "score": "0.6923222", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter, app.immutableBuilder)\n}", "title": "" }, { "docid": "27a3f95df2da7edf141747cc9cfc972d", "score": "0.69226277", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(\n\t\tapp.hashAdapter,\n\t\tapp.mutableBuilder,\n\t\tapp.walletsBuilder,\n\t\tapp.bucketsBuilder,\n\t)\n}", "title": "" }, { "docid": "c6c27f81196c6b2d63d982132cba6b2a", "score": "0.69153064", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "fbbc517ba3541f734a82d9d7ee10fcf1", "score": "0.6854121", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter, app.resourceBuilder)\n}", "title": "" }, { "docid": "b02cc9179e77655adfe1b18fe1357325", "score": "0.67790145", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "b02cc9179e77655adfe1b18fe1357325", "score": "0.67790145", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "b02cc9179e77655adfe1b18fe1357325", "score": "0.67790145", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "b02cc9179e77655adfe1b18fe1357325", "score": "0.67790145", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "b02cc9179e77655adfe1b18fe1357325", "score": "0.67790145", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "b02cc9179e77655adfe1b18fe1357325", "score": "0.67790145", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "40780008d2f2a65ace3e5750ee19e32e", "score": "0.6758558", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.immutableBuilder)\n}", "title": "" }, { "docid": "95d08dd01accd4ef8621a8e63e49efd1", "score": "0.6547604", "text": "func (app *externalBuilder) Create() ExternalBuilder {\n\treturn createExternalBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "e2849a513c9b5d25bc4df05c5efb6231", "score": "0.6458771", "text": "func (app *callBuilder) Create() CallBuilder {\n\treturn createCallBuilder()\n}", "title": "" }, { "docid": "6b9110dc38688a1127a73f3c5a3360d2", "score": "0.64203197", "text": "func (app *contentBuilder) Create() ContentBuilder {\n\treturn createContentBuilder(app.hashAdapter, app.minPubKeys)\n}", "title": "" }, { "docid": "edbccd1f03b368946ca7e9a62741fce9", "score": "0.6360873", "text": "func (app *declarationBuilder) Create() DeclarationBuilder {\n\treturn createDeclarationBuilder()\n}", "title": "" }, { "docid": "c5174e174897d2cfbaba844a649ae4c4", "score": "0.63522226", "text": "func (app *contentBuilder) Create() ContentBuilder {\n\treturn createContentBuider(app.hashAdapter, app.pubKeyAdapter)\n}", "title": "" }, { "docid": "d429ed8c58faee5d6d7f328405719c7a", "score": "0.63269526", "text": "func (fac *ChainedCommandsBuilderFactory) Create() commands.ChainedCommandsBuilder {\n\tout := createChainedCommandsBuilder(fac.metaDataBuilderFactory, fac.htBuilderFactory)\n\treturn out\n}", "title": "" }, { "docid": "8eab075916bd4f553881de5d9d811174", "score": "0.6312763", "text": "func New() *Builder {\n\treturn &Builder{\n\t\tBuildscript: \"bundle-chroot-builder.py\",\n\t\tYumtemplate: \"/usr/share/defaults/mixer/yum.conf.in\",\n\n\t\tSigning: 1,\n\t\tBump: 0,\n\t}\n}", "title": "" }, { "docid": "e3370a3bc54a34e99429b45d5300daf2", "score": "0.62945294", "text": "func (app *immutableAccessibleBuilder) Create() ImmutableAccessibleBuilder {\n\treturn createImmutableAccessibleBuilder(app.immutableBuilder)\n}", "title": "" }, { "docid": "65f96de0919dcc3ad443c7fe415d5803", "score": "0.6290998", "text": "func (app *possibilityBuilder) Create() PossibilityBuilder {\n\treturn createPossibilityBuilder()\n}", "title": "" }, { "docid": "6fdb1035d6a45631e4df97fd1e73b526", "score": "0.62786895", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.connectionsBuilder)\n}", "title": "" }, { "docid": "65e5054ffa4876cda543cb46f9cbb78a", "score": "0.6269105", "text": "func New() *Builder {\n\treturn &Builder{}\n}", "title": "" }, { "docid": "65e5054ffa4876cda543cb46f9cbb78a", "score": "0.6269105", "text": "func New() *Builder {\n\treturn &Builder{}\n}", "title": "" }, { "docid": "aafb5fa3483beb8c218a83663cc8ca56", "score": "0.6264692", "text": "func (f *Factory) Build() {\n\tf.builder.MountChasis(\"F23J4543K\")\n\tf.builder.MountEngine(\"E20205422J\")\n\tf.builder.SetWheels()\n\tf.builder.SetSeats()\n}", "title": "" }, { "docid": "d2a425dd035f45b00d18113d5a717a54", "score": "0.62620026", "text": "func (fac *BlockBuilderFactory) Create() stored_blocks.BlockBuilder {\n\tout := createBlockBuilder()\n\treturn out\n}", "title": "" }, { "docid": "7a2796dcbec70d10f19f827514efde65", "score": "0.6248804", "text": "func (app *instructionBuilder) Create() InstructionBuilder {\n\treturn createInstructionBuilder()\n}", "title": "" }, { "docid": "28229536b373c50387398fd34cd01d40", "score": "0.6245789", "text": "func (app *materialBuilder) Create() MaterialBuilder {\n\treturn createMaterialBuilder(app.layerBuilder)\n}", "title": "" }, { "docid": "d5c113835e187157cef693fc6cee7371", "score": "0.62414324", "text": "func (app *elementBuilder) Create() ElementBuilder {\n\treturn createElementBuilder()\n}", "title": "" }, { "docid": "45e28a6b42f188163f1990c9261523be", "score": "0.62305427", "text": "func (app *graphbaseBuilder) Create() GraphbaseBuilder {\n\treturn createGraphbaseBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "8dda083f390a122a46e3dadefac0dda3", "score": "0.6218642", "text": "func (build *atomicTransactionsBuilder) Create() signed_transactions.AtomicTransactionsBuilder {\n\tbuild.id = nil\n\tbuild.met = nil\n\tbuild.trs = nil\n\tbuild.crOn = nil\n\treturn build\n}", "title": "" }, { "docid": "e94fbe9795ae5f092f85bc308552479e", "score": "0.6211645", "text": "func NewBuilder() *Builder {\n b := &Builder{}\n\n b.filter = &Filter{}\n b.labels = make(map[string]int)\n b.jumps_k = make(map[int]string)\n b.jumps_jt = make(map[int]string)\n b.jumps_jf = make(map[int]string)\n\n return b\n}", "title": "" }, { "docid": "7ba839bfe2354b6e03b951fbaf3343df", "score": "0.6189311", "text": "func (app *propertiesBuilder) Create() PropertiesBuilder {\n\treturn createPropertiesBuilder()\n}", "title": "" }, { "docid": "f8a7132bc9b841e44804b95d79966b8e", "score": "0.6172405", "text": "func (app *builder) Create() application_windows.Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "772c2598c151a7de39f34e6821cf4a5f", "score": "0.6160846", "text": "func (app *skipBuilder) Create() SkipBuilder {\n\treturn createSkipBuilder()\n}", "title": "" }, { "docid": "17f13accd4a8db7ff496809278081eee", "score": "0.61488026", "text": "func (app *switchBuilder) Create() SwitchBuilder {\n\treturn createSwitchBuilder()\n}", "title": "" }, { "docid": "23cd0933cee30990500ee9cb3635fa9e", "score": "0.6144228", "text": "func (b *mediatorBuilder) Create() *mediator {\n\tinstance := &mediator{\n\t\trequestHandlers: b.requestHandlers,\n\t\tnotificationHandlers: b.notificationHandlers,\n\t}\n\n\tinstance.initialize()\n\n\treturn instance\n}", "title": "" }, { "docid": "62ac25d54a00d29c53e5deddc54eef46", "score": "0.61404645", "text": "func (app *scriptTestBuilder) Create() ScriptTestBuilder {\n\treturn createScriptTestBuilder()\n}", "title": "" }, { "docid": "4b0e62b09a97c5808ed87a467e64be38", "score": "0.6126057", "text": "func (fac *SignedBlockBuilderFactory) Create() stored_validated_block.SignedBlockBuilder {\n\tout := createSignedBlockBuilder()\n\treturn out\n}", "title": "" }, { "docid": "0da07d76f3dcc8451f2573ccbbaa4f6c", "score": "0.6116882", "text": "func (t kind) Build(reason Reason, format string) Factory {\n\treturn &factory{code: int(t), reason: reason, format: format}\n}", "title": "" }, { "docid": "d6be7e51395b794d4a5fe51da6bf752e", "score": "0.60965765", "text": "func (app *shareHolderBuilder) Create() ShareHolderBuilder {\n\treturn createShareHolderBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "8b2052ae61710c5b18d11b2103a597b1", "score": "0.609562", "text": "func (fac *SignedBlockBuilderFactory) Create() stored_blocks.SignedBlockBuilder {\n\tout := createSignedBlockBuilder()\n\treturn out\n}", "title": "" }, { "docid": "e72447ad15c854cf1db4146c54843913", "score": "0.60835105", "text": "func (c Creator[T]) Create(qs string) (T, error) {\n\tvar t T\n\tbuilderAst, err := c.builder.Build(qs)\n\tif err != nil {\n\t\treturn t, err\n\t}\n\n\tt, err = c.compiler.Compile(builderAst)\n\tif err != nil {\n\t\treturn t, err\n\t}\n\n\treturn t, nil\n}", "title": "" }, { "docid": "459d66d5e14b13b90ea7d9b5a8579cd3", "score": "0.608165", "text": "func (app *linesBuilder) Create() LinesBuilder {\n\treturn createLinesBuilder()\n}", "title": "" }, { "docid": "d92e384e9f8f78b68acefa6412d28e88", "score": "0.60684127", "text": "func (fac *TransactionBuilderFactory) Create() signed_transactions.TransactionBuilder {\n\tout := createTransactionBuilder(fac.htBuilderFactory, fac.metaDataBuilderFactory)\n\treturn out\n}", "title": "" }, { "docid": "4335d2abfea96a951d2d4034ce7d69eb", "score": "0.60419023", "text": "func (fac *TransactionBuilderFactory) Create() stored_transactions.TransactionBuilder {\n\tout := createTransactionBuilder()\n\treturn out\n}", "title": "" }, { "docid": "18e6171a2e84a41fd69ed7ab4b484a1e", "score": "0.6023392", "text": "func (build *transactionsBuilder) Create() stored_aggregated_transactions.TransactionsBuilder {\n\tbuild.metaData = nil\n\tbuild.trs = nil\n\tbuild.atomicTrs = nil\n\treturn build\n}", "title": "" }, { "docid": "673fe559a6e26fea7559c62c719d06d7", "score": "0.6020934", "text": "func (build *publicKeyBuilder) Create() cryptography.PublicKeyBuilder {\n\tbuild.encodedString = \"\"\n\tbuild.key = nil\n\treturn build\n}", "title": "" }, { "docid": "92a1bed74377fb8e54e8e11e2f90192f", "score": "0.60196507", "text": "func (app *popBuilder) Create() PopBuilder {\n\treturn createPopBuilder()\n}", "title": "" }, { "docid": "fb91e122c9951abce53aee1cb3598331", "score": "0.59812766", "text": "func (app *miscBuilder) Create() MiscBuilder {\n\treturn createMiscBuilder()\n}", "title": "" }, { "docid": "fb91e122c9951abce53aee1cb3598331", "score": "0.59812766", "text": "func (app *miscBuilder) Create() MiscBuilder {\n\treturn createMiscBuilder()\n}", "title": "" }, { "docid": "f1457101f6ba609a91ec9be499bf4800", "score": "0.59544253", "text": "func (app *propositionBuilder) Create() PropositionBuilder {\n\treturn createPropositionBuilder()\n}", "title": "" }, { "docid": "b29948aa17b8188d3138f705763ed697", "score": "0.59523296", "text": "func (app *scopeBuilder) Create() ScopeBuilder {\n\treturn createScopeBuilder()\n}", "title": "" }, { "docid": "41187a12807d9d37c1030dea7e98e38d", "score": "0.5942067", "text": "func (build *transactionsBuilder) Create() transactions.TransactionsBuilder {\n\tbuild.id = nil\n\tbuild.crOn = nil\n\tbuild.met = nil\n\tbuild.trs = nil\n\treturn build\n}", "title": "" }, { "docid": "2b56bca1da448cb502c26654f0d9cb8e", "score": "0.59297854", "text": "func (b *Builder) Build() *Factory {\n\treturn NewFactory(b.proto, b.fGens...)\n}", "title": "" }, { "docid": "3b3ee6c3720ff6865b5c16a4b2a5a964", "score": "0.59288764", "text": "func (app *ruleTreeBuilder) Create() RuleTreeBuilder {\n\treturn createRuleTreeBuilder(app.ruleNodeBuilder)\n}", "title": "" }, { "docid": "c368a4188e7ef5b7b02b07f471e742ce", "score": "0.59260803", "text": "func (app *applicationBuilder) Create() ApplicationBuilder {\n\treturn createApplicationBuilder()\n}", "title": "" }, { "docid": "f6791c706f15809fe02c6fcd1b0c05c3", "score": "0.5906484", "text": "func (app *nodeTreeBuilder) Create() NodeTreeBuilder {\n\treturn createNodeTreeBuilder(app.elementBuilder, app.nodeBuilder)\n}", "title": "" }, { "docid": "ca10af73792aa6a3ff64872f504af947", "score": "0.5904144", "text": "func Create() Implementation {\n\treturn Implementation{Config: NewConfig()}\n}", "title": "" }, { "docid": "543d7823166797c1cb5158b0fb7c9d97", "score": "0.5897428", "text": "func (fac *AtomicTransactionBuilderFactory) Create() stored_signed_transactions.AtomicTransactionBuilder {\n\tout := createAtomicTransactionBuilder()\n\treturn out\n}", "title": "" }, { "docid": "3383dbd3f34b1760e5d290f5c60f9306", "score": "0.5886847", "text": "func NewBuilder() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "3383dbd3f34b1760e5d290f5c60f9306", "score": "0.5886847", "text": "func NewBuilder() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "3383dbd3f34b1760e5d290f5c60f9306", "score": "0.5886847", "text": "func NewBuilder() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "3383dbd3f34b1760e5d290f5c60f9306", "score": "0.5886847", "text": "func NewBuilder() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "3383dbd3f34b1760e5d290f5c60f9306", "score": "0.5886847", "text": "func NewBuilder() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "3383dbd3f34b1760e5d290f5c60f9306", "score": "0.5886847", "text": "func NewBuilder() Builder {\n\treturn createBuilder()\n}", "title": "" }, { "docid": "1c727d5af8933bbca87338c94c4becee", "score": "0.58738256", "text": "func (fac *SignaturesBuilderFactory) Create() user.SignaturesBuilder {\n\tout := createSignaturesBuilder(fac.metaDataBuilderFactory)\n\treturn out\n}", "title": "" }, { "docid": "c7d41cddc43ceb0d021101389affef6f", "score": "0.5872867", "text": "func (app *patternMatchBuilder) Create() PatternMatchBuilder {\n\treturn createPatternMatchBuilder()\n}", "title": "" }, { "docid": "4f96de70ed4d3750ca3052e7b259a9f4", "score": "0.58503455", "text": "func (app *updateBuilder) Create() UpdateBuilder {\n\treturn createUpdateBuilder()\n}", "title": "" }, { "docid": "536ae930554feb9576d970785f6a67c4", "score": "0.58475393", "text": "func New(opts *Opts) (*Builder, error) {\n\tif err := opts.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Builder{\n\t\twrapper: &Wrap{},\n\t\topts: opts,\n\t}, nil\n}", "title": "" }, { "docid": "4bf72003b5b4ea9f6df862a3d9f8c45a", "score": "0.5813051", "text": "func Create(ctx context.Context) *Fnh {\n\treturn &Fnh{\n\t\tContext: fdk.GetContext(ctx),\n\t\tClient: http.DefaultClient,\n\t}\n}", "title": "" }, { "docid": "b6d31ebc7528bba12f4f615780695b1f", "score": "0.57937026", "text": "func (app *valueRepresentationBuilder) Create() ValueRepresentationBuilder {\n\treturn createValueRepresentationBuilder()\n}", "title": "" }, { "docid": "00e1c27c1b662765a1a2224bafeaeb01", "score": "0.5784756", "text": "func New(order int) *Builder {\r\n\treturn &Builder{\r\n\t\torder: order,\r\n\t\tstart: make(map[string]int64),\r\n\t\tproduct: make(map[string]map[string]int64),\r\n\t}\r\n}", "title": "" }, { "docid": "8a939088869d4eacb8abe839b9023b44", "score": "0.57655585", "text": "func NewBuilder() Builder {\n\treturn builder{map[string]interface{}{}, \"\"}\n}", "title": "" }, { "docid": "dc81d5cb2b310f402f3b2511be26fc7a", "score": "0.57603353", "text": "func (app *rangeBuilder) Create() RangeBuilder {\n\treturn createRangeBuilder()\n}", "title": "" }, { "docid": "d7c2a5c27bda7b3c9158e8d6d6810e9d", "score": "0.5755092", "text": "func (c *DevelopperClient) Create() *DevelopperCreate {\n\tmutation := newDevelopperMutation(c.config, OpCreate)\n\treturn &DevelopperCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "8a4bf757c77856d04121674bedaf2069", "score": "0.5754914", "text": "func New(opt *Option) *Builder {\n\tif !com.IsDir(opt.SrcDir) {\n\t\treturn &Builder{Error: ErrSrcDirMissing}\n\t}\n\tif !com.IsDir(opt.TplDir) {\n\t\treturn &Builder{Error: ErrTplDirMissing}\n\t}\n\tbuilder := &Builder{\n\t\tparsers: []parser.Parser{\n\t\t\tparser.NewMdParser(),\n\t\t},\n\t\tVersion: opt.Version,\n\t\topt: opt,\n\t}\n\tbuilder.render = render.New(builder.opt.TplDir)\n\tbuilder.tasks = []*Task{\n\t\t{\"Data\", builder.ReadData, nil},\n\t\t{\"Compile\", builder.Compile, nil},\n\t\t{\"Feed\", builder.WriteFeed, nil},\n\t\t{\"Copy\", builder.CopyAssets, nil},\n\t}\n\tlog15.Debug(\"Build.Source.\" + opt.SrcDir)\n\tlog15.Debug(\"Build.Template.\" + opt.TplDir)\n\tlog15.Debug(\"Build.Theme.\" + opt.Theme)\n\treturn builder\n}", "title": "" }, { "docid": "11f4408806eea5665a585fa354ce6072", "score": "0.57527184", "text": "func (fac *TransactionsBuilderFactory) Create() aggregated.TransactionsBuilder {\n\tout := createTransactionsBuilder(fac.htBuilderFactory, fac.metaDataBuilderFactory)\n\treturn out\n}", "title": "" }, { "docid": "9d5982ee8c8b7fbd21784d2c4faa6b95", "score": "0.5751689", "text": "func (build *insertBuilder) Create() commands.InsertBuilder {\n\tbuild.js = nil\n\treturn build\n}", "title": "" }, { "docid": "d0cd567b2ac37be9f41d8e3df5a88162", "score": "0.57468116", "text": "func Build(options ...CreateNFTOption) (result *CreateNFTOptions, err error) {\n\t// create options to collect the arguments provided\n\tresult = &CreateNFTOptions{}\n\n\t// apply arguments to our options\n\tfor _, option := range options {\n\t\tif err = option(result); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tif result.InitialBalance == nil {\n\t\tresult.InitialBalance = map[devnetvm.Color]uint64{devnetvm.ColorIOTA: devnetvm.DustThresholdAliasOutputIOTA}\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "9222324b8343877ed450244e62e15659", "score": "0.5731561", "text": "func (build *userBuilder) Create() stored_users.UserBuilder {\n\tbuild.met = nil\n\tbuild.pubKey = nil\n\treturn build\n}", "title": "" }, { "docid": "23cefaf4e976062534b3c786aa1807e7", "score": "0.57213676", "text": "func (fac *ServerBuilderFactory) Create() servers.ServerBuilder {\n\tout := createServerBuilder()\n\treturn out\n}", "title": "" }, { "docid": "5ff55af20c239ca6e6be4f799be50918", "score": "0.5711988", "text": "func NewBuilder() *Builder {\n\treturn &Builder{\n\t\tset: Set{\n\t\t\tIndex: []uint16{0},\n\t\t},\n\t\tindex: map[string]int{},\n\t}\n}", "title": "" }, { "docid": "ddabcaec1736c4041a7083d8031f2ce1", "score": "0.57026696", "text": "func (app *factory) Create(typ parsers.Type) (Value, error) {\n\tbuilder := app.computableBuilder.Create()\n\tif typ.IsBool() {\n\t\tbuilder.WithBool(defaultBool)\n\t}\n\n\tif typ.IsString() {\n\t\tbuilder.WithString(defaultString)\n\t}\n\n\tif typ.IsInt8() {\n\t\tbuilder.WithInt8(int8(defaultInt))\n\t}\n\n\tif typ.IsInt16() {\n\t\tbuilder.WithInt16(int16(defaultInt))\n\t}\n\n\tif typ.IsInt32() {\n\t\tbuilder.WithInt32(int32(defaultInt))\n\t}\n\n\tif typ.IsInt64() {\n\t\tbuilder.WithInt64(int64(defaultInt))\n\t}\n\n\tif typ.IsUint8() {\n\t\tbuilder.WithUint8(uint8(defaultUint))\n\t}\n\n\tif typ.IsUint16() {\n\t\tbuilder.WithUint16(uint16(defaultUint))\n\t}\n\n\tif typ.IsUint32() {\n\t\tbuilder.WithUint32(uint32(defaultUint))\n\t}\n\n\tif typ.IsUint64() {\n\t\tbuilder.WithUint64(uint64(defaultUint))\n\t}\n\n\tif typ.IsFloat32() {\n\t\tbuilder.WithFloat32(float32(defaultFloat))\n\t}\n\n\tif typ.IsFloat64() {\n\t\tbuilder.WithFloat64(float64(defaultFloat))\n\t}\n\n\tcomputable, err := builder.Now()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn app.builder.Create().WithComputable(computable).Now()\n}", "title": "" }, { "docid": "36ac0fc9d50d659804879e1b203aee33", "score": "0.57026047", "text": "func Create(configFile string, cmdHandlers []*CommandHandler) *Bot {\n\tconfig := GetConfig(\"./settings.json\")\n\n\tsettings := &Settings{}\n\tsettings.Debug = config.Debug\n\tsettings.Nickname = config.Nickname\n\tsettings.Oauth = config.Oauth\n\tsettings.Server = Server{}\n\tsettings.Server.Domain = config.Server\n\tsettings.Channel = config.Channel\n\tsettings.CommandHandlers = cmdHandlers\n\n\tbot := Bot{}\n\tbot.Channels = &Channels{make(chan error), make(chan *Command)}\n\tbot.Settings = settings\n\tbot.irccon = NewConnection(&bot)\n\n\treturn &bot\n}", "title": "" }, { "docid": "537a39c9ff5b0f73d7e909077b719800", "score": "0.56935793", "text": "func (b *Builder) Create() error {\n\tif Exists(b.name) {\n\t\treturn ErrDockerMachineExists\n\t}\n\tif IsAvailable() {\n\t\treturn ErrDockerMachineNotAvailable\n\t}\n\tmem := b.memory\n\tif mem == 0 {\n\t\tmem = determineMachineMemory()\n\t}\n\tproc := b.processors\n\tif proc == 0 {\n\t\tproc = determineMachineProcessors()\n\t}\n\treturn localcmd.New(dockerMachineBinary()).Args(\n\t\t\"create\",\n\t\t\"--driver\", \"virtualbox\",\n\t\t\"--virtualbox-cpu-count\", strconv.Itoa(proc),\n\t\t\"--virtualbox-memory\", strconv.Itoa(mem),\n\t\t\"--engine-insecure-registry\", \"172.30.0.0/16\",\n\t\tb.name).Run()\n}", "title": "" }, { "docid": "b34a1432d5819f637ea694cad5371576", "score": "0.568128", "text": "func (c *DeveloperClient) Create() *DeveloperCreate {\n\tmutation := newDeveloperMutation(c.config, OpCreate)\n\treturn &DeveloperCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "cceae4120b24aef1317d43cdfb6fe902", "score": "0.56770355", "text": "func (app *replacementTokenBuilder) Create() ReplacementTokenBuilder {\n\treturn createReplacementTokenBuilder()\n}", "title": "" }, { "docid": "4b3ab86a1d929a6c241391a74c1b7740", "score": "0.56743777", "text": "func NewBuilder() Builder {\n\tfilesFactory := files.NewFactory()\n\treturn createBuilder(filesFactory)\n}", "title": "" }, { "docid": "8ad3ac1427a232b0a557447e326cb401", "score": "0.56454605", "text": "func NewBuilder(inputFile string, modelName string, pkgName string) (builder Builder) {\n\tbuilder = Builder{}\n\t// try to read input file\n\traw, err := ioutil.ReadFile(inputFile)\n\tif err != nil {\n\t\tmsg := fmt.Sprintf(\"File error: %s\", err)\n\t\tbuilder.Errors = append(builder.Errors, msg)\n\t\treturn\n\t}\n\tbuilder.InputFile = inputFile\n\tbuilder.SchemaRaw = raw\n\t// try parsing json\n\tif err := json.Unmarshal(builder.SchemaRaw, &builder.SchemaJSON); err != nil {\n\t\tmsg := fmt.Sprintf(\"JSON error: %s\", err)\n\t\tbuilder.Errors = append(builder.Errors, msg)\n\t\treturn\n\t}\n\n\t// defer model name from schema.title if not given as argument, schema['title'] MUST be set\n\tif len(modelName) > 0 {\n\t\tbuilder.ModelName = modelName\n\t} else {\n\t\tbuilder.ModelName = inflect.Typeify(builder.SchemaJSON[\"title\"].(string))\n\t}\n\t// defer package name from schema.title if not given as argument\n\tif len(pkgName) > 0 {\n\t\tbuilder.PkgName = pkgName\n\t} else {\n\t\t//Pluralize no underscores\n\t\tbuilder.PkgName = strings.ToLower(inflect.Camelize(inflect.Pluralize(builder.SchemaJSON[\"title\"].(string))))\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "e8ece3ca29604c184e9a4b4d1d6d04c8", "score": "0.56326693", "text": "func New(cfg config.Config) {\n\n}", "title": "" }, { "docid": "226c4e9131ab255b9a9b2b2c631f241e", "score": "0.56268704", "text": "func (g *JFrogFactory) Create(dt Data) Tool {\n\treturn &JFrogTool{\n\t\tCore: dt,\n\t}\n}", "title": "" }, { "docid": "7dcb26f95ebca547f8c581b8f12c056e", "score": "0.56233495", "text": "func (app *stackFrameBuilder) Create() StackFrameBuilder {\n\treturn createStackFrameBuilder(app.frameBuilder)\n}", "title": "" }, { "docid": "d4131b5243ba7567659da1ac0bd6cb4e", "score": "0.5589426", "text": "func (c *QQModelClient) Create() *QQModelCreate {\n\tmutation := newQQModelMutation(c.config, OpCreate)\n\treturn &QQModelCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "eb9a050dacab8a2d12382d68c5ccff6d", "score": "0.55844903", "text": "func (m *apiMock) Create(ctx context.Context, project *types.Project, opts api.CreateOptions) error {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "3db5dc91cfaff9038b3ec8f82f5af49a", "score": "0.55828106", "text": "func (o *Orderer) Create() {\n\to.CreateConfigMap()\n\to.CreateDeployment()\n\to.CreateService()\n}", "title": "" }, { "docid": "866ee916156a6317d8934b00e50046db", "score": "0.55778193", "text": "func (b *Builder) Build() (*Seed, error) {\n\tseed := &Seed{}\n\n\tseedObject, err := b.seedObjectFunc()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tseed.Info = seedObject\n\n\tif seedObject.Spec.Settings != nil && seedObject.Spec.Settings.LoadBalancerServices != nil {\n\t\tseed.LoadBalancerServiceAnnotations = seedObject.Spec.Settings.LoadBalancerServices.Annotations\n\t}\n\n\treturn seed, nil\n}", "title": "" }, { "docid": "3c9e1e6187c83f6466696e2384111c4c", "score": "0.5572653", "text": "func (app *unregisterBuilder) Create() UnregisterBuilder {\n\treturn createUnregisterBuilder()\n}", "title": "" } ]
f333f7cdfca76d2815e38b5c0d78397e
Parse returns the key or certificate PEMencoded in the given bytes.
[ { "docid": "597353b3fbb9594fd250161fb2e790a0", "score": "0.6632504", "text": "func Parse(b []byte, opts ...Options) (interface{}, error) {\n\t// Populate options\n\tctx := newContext(\"PEM\")\n\tif err := ctx.apply(opts); err != nil {\n\t\treturn nil, err\n\t}\n\n\tblock, rest := pem.Decode(b)\n\tswitch {\n\tcase block == nil:\n\t\treturn nil, errors.Errorf(\"error decoding %s: not a valid PEM encoded block\", ctx.filename)\n\tcase len(bytes.TrimSpace(rest)) > 0 && !ctx.firstBlock:\n\t\treturn nil, errors.Errorf(\"error decoding %s: contains more than one PEM encoded block\", ctx.filename)\n\t}\n\n\t// PEM is encrypted: ask for password\n\tif block.Headers[\"Proc-Type\"] == \"4,ENCRYPTED\" || block.Type == \"ENCRYPTED PRIVATE KEY\" {\n\t\tpass, err := ctx.promptPassword()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tblock.Bytes, err = DecryptPEMBlock(block, pass)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"error decrypting %s\", ctx.filename)\n\t\t}\n\t}\n\n\tswitch block.Type {\n\tcase \"PUBLIC KEY\":\n\t\tpub, err := x509.ParsePKIXPublicKey(block.Bytes)\n\t\treturn pub, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"RSA PRIVATE KEY\":\n\t\tpriv, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"EC PRIVATE KEY\":\n\t\tpriv, err := x509.ParseECPrivateKey(block.Bytes)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"PRIVATE KEY\", \"ENCRYPTED PRIVATE KEY\":\n\t\tpriv, err := x509.ParsePKCS8PrivateKey(block.Bytes)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"OPENSSH PRIVATE KEY\":\n\t\tpriv, err := ParseOpenSSHPrivateKey(b, withContext(ctx))\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"CERTIFICATE\":\n\t\tcrt, err := x509.ParseCertificate(block.Bytes)\n\t\treturn crt, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"CERTIFICATE REQUEST\", \"NEW CERTIFICATE REQUEST\":\n\t\tcsr, err := x509.ParseCertificateRequest(block.Bytes)\n\t\treturn csr, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"ENCRYPTED COSIGN PRIVATE KEY\":\n\t\tpass, err := ctx.promptPassword()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpriv, err := ParseCosignPrivateKey(block.Bytes, pass)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"NEBULA X25519 PUBLIC KEY\":\n\t\tif len(block.Bytes) != x25519.PublicKeySize {\n\t\t\treturn nil, errors.Errorf(\"error parsing %s: key is not 32 bytes\", ctx.filename)\n\t\t}\n\t\treturn x25519.PublicKey(block.Bytes), nil\n\tcase \"NEBULA X25519 PRIVATE KEY\":\n\t\tif len(block.Bytes) != x25519.PrivateKeySize {\n\t\t\treturn nil, errors.Errorf(\"error parsing %s: key is not 32 bytes\", ctx.filename)\n\t\t}\n\t\treturn x25519.PrivateKey(block.Bytes), nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"error decoding %s: contains an unexpected header '%s'\", ctx.filename, block.Type)\n\t}\n}", "title": "" } ]
[ { "docid": "89b4f70804f297a3ca902f0b424d5947", "score": "0.6778437", "text": "func Parse(b []byte, opts ...Options) (interface{}, error) {\n\t// Populate options\n\tctx := newContext(\"PEM\")\n\tfor _, f := range opts {\n\t\tif err := f(ctx); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tblock, rest := pem.Decode(b)\n\tswitch {\n\tcase block == nil:\n\t\treturn nil, errors.Errorf(\"error decoding %s: is not a valid PEM encoded key\", ctx.filename)\n\tcase len(rest) > 0:\n\t\treturn nil, errors.Errorf(\"error decoding %s: contains more than one key\", ctx.filename)\n\t}\n\n\t// PEM is encrypted: ask for password\n\tif block.Headers[\"Proc-Type\"] == \"4,ENCRYPTED\" || block.Type == \"ENCRYPTED PRIVATE KEY\" {\n\t\tvar err error\n\t\tvar pass []byte\n\n\t\tif len(ctx.password) > 0 {\n\t\t\tpass = ctx.password\n\t\t} else {\n\t\t\tpass, err = ui.PromptPassword(fmt.Sprintf(\"Please enter the password to decrypt %s\", ctx.filename))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\tblock.Bytes, err = DecryptPEMBlock(block, pass)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"error decrypting %s\", ctx.filename)\n\t\t}\n\t}\n\n\tswitch block.Type {\n\tcase \"PUBLIC KEY\":\n\t\tpub, err := ParsePKIXPublicKey(block.Bytes)\n\t\treturn pub, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"RSA PRIVATE KEY\":\n\t\tpriv, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"EC PRIVATE KEY\":\n\t\tpriv, err := x509.ParseECPrivateKey(block.Bytes)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"PRIVATE KEY\", \"OPENSSH PRIVATE KEY\", \"ENCRYPTED PRIVATE KEY\":\n\t\tpriv, err := ParsePKCS8PrivateKey(block.Bytes)\n\t\treturn priv, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"CERTIFICATE\":\n\t\tif ctx.stepCrypto {\n\t\t\tcrt, err := x509.ParseCertificate(block.Bytes)\n\t\t\treturn crt, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\t\t}\n\t\tcrt, err := realx509.ParseCertificate(block.Bytes)\n\t\treturn crt, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tcase \"CERTIFICATE REQUEST\":\n\t\tif ctx.stepCrypto {\n\t\t\tcsr, err := x509.ParseCertificateRequest(block.Bytes)\n\t\t\treturn csr, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\t\t}\n\t\tcsr, err := realx509.ParseCertificateRequest(block.Bytes)\n\t\treturn csr, errors.Wrapf(err, \"error parsing %s\", ctx.filename)\n\tdefault:\n\t\treturn nil, errors.Errorf(\"error decoding %s: contains an unexpected header '%s'\", ctx.filename, block.Type)\n\t}\n}", "title": "" }, { "docid": "9ca49edf302cf65771177404ee246827", "score": "0.6534103", "text": "func parsePrivateKey(pemBytes []byte) (Signer, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tvar rawkey interface{}\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\trsa, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawkey = rsa\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\treturn newSignerFromKey(rawkey)\n}", "title": "" }, { "docid": "9ca49edf302cf65771177404ee246827", "score": "0.6534103", "text": "func parsePrivateKey(pemBytes []byte) (Signer, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tvar rawkey interface{}\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\trsa, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawkey = rsa\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\treturn newSignerFromKey(rawkey)\n}", "title": "" }, { "docid": "5519b1b54d15a488e6886bed93dcbc1c", "score": "0.653084", "text": "func AuthKeyFromBytes(key []byte) (*ecdsa.PrivateKey, error) {\n\tvar err error\n\n\t// Parse PEM block\n\tvar block *pem.Block\n\tif block, _ = pem.Decode(key); block == nil {\n\t\tpp.Println(\"token: AuthKey must be a valid .p8 PEM file\")\n\t\treturn nil, errors.New(\"token: AuthKey must be a valid .p8 PEM file\")\n\t}\n\n\t// Parse the key\n\tvar parsedKey interface{}\n\tif parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar pkey *ecdsa.PrivateKey\n\tvar ok bool\n\tif pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok {\n\t\tpp.Println(\"token: AuthKey must be of type ecdsa.PrivateKey\")\n\t\treturn nil, errors.New(\"token: AuthKey must be of type ecdsa.PrivateKey\")\n\t}\n\n\treturn pkey, nil\n}", "title": "" }, { "docid": "1f099c20a24f3f78f945d9171ee4aaaf", "score": "0.6428732", "text": "func parsePrivateKey(pemBytes []byte) (signer, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"crypto: no key found\")\n\t}\n\n\tvar rawkey interface{}\n\tvar alg jose.SignatureAlgorithm\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\talg = jose.RS256\n\t\trsa, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawkey = rsa\n\tcase \"PRIVATE KEY\":\n\t\talg = jose.ES256\n\t\tecdsa, err := x509.ParsePKCS8PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawkey = ecdsa\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"crypto: unsupported private key type %q\", block.Type)\n\t}\n\ts, err := jose.NewSigner(jose.SigningKey{Algorithm: alg, Key: rawkey}, &jose.SignerOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &jwtSigner{signer: s}, nil\n}", "title": "" }, { "docid": "6dcfbfc0b38818a17bc2465afbdf039b", "score": "0.6406999", "text": "func parsePrivateKey(pemBytes []byte) (Signer, error) {block, _ := pem.Decode(pemBytes)\n\tif block == nil {return nil, errors.New(\"ssh: no key found\")}\n\n\tvar rawkey interface{}\n\tswitch block.Type {case\"RSA PRIVATE KEY\":\n\t\trsa, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\tif err != nil {return nil, err}\n\t\trawkey = rsa\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\treturn newSignerFromKey(rawkey)\n}", "title": "" }, { "docid": "7a2e5912a60b90772016a0b8b8a92be0", "score": "0.63366187", "text": "func ParsePemEncodedCertificate(certBytes []byte) (*x509.Certificate, error) {\n\tcb, _ := pem.Decode(certBytes)\n\tif cb == nil {\n\t\treturn nil, fmt.Errorf(\"invalid PEM encoded certificate\")\n\t}\n\n\tcert, err := x509.ParseCertificate(cb.Bytes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse X.509 certificate\")\n\t}\n\n\treturn cert, nil\n}", "title": "" }, { "docid": "1d00579bff2e93f14309a159e4a1b1eb", "score": "0.62758934", "text": "func ParsePrivateKey(pemBytes []byte) (*rsa.PrivateKey, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\trsa, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn rsa, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n}", "title": "" }, { "docid": "c9f4bd8a534f49ed9921ec9f09fc6937", "score": "0.6243869", "text": "func ParseCert(pemValue string) (*x509.Certificate, error) {\n\t// The _ result below is not an error but the remaining PEM bytes.\n\tblock, _ := pem.Decode([]byte(pemValue))\n\tif block == nil {\n\t\treturn nil, fmt.Errorf(\"no PEM-encoded data found\")\n\t}\n\n\tif block.Type != \"CERTIFICATE\" {\n\t\treturn nil, fmt.Errorf(\"first PEM-block should be CERTIFICATE type\")\n\t}\n\n\treturn x509.ParseCertificate(block.Bytes)\n}", "title": "" }, { "docid": "0ce7d3de0dcf6ef014af62b0e5879a44", "score": "0.62403613", "text": "func testOpenSSLParse(t *testing.T, certBytes []byte) {\n\ttmpCertFile, err := ioutil.TempFile(\"\", \"testCertificate\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tdefer os.Remove(tmpCertFile.Name()) // clean up\n\n\tif _, err := tmpCertFile.Write(certBytes); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\topensslCMD := exec.Command(\"openssl\", \"pkcs7\", \"-inform\", \"der\", \"-in\", tmpCertFile.Name())\n\t_, err = opensslCMD.Output()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif err := tmpCertFile.Close(); err != nil {\n\t\tt.Fatal(err)\n\t}\n\n}", "title": "" }, { "docid": "47b8d778c7ad1c9be12a186f6fc46d47", "score": "0.6232099", "text": "func parseCertificatePEM(certPEM string) ([]byte, []byte, error) {\n\tvar certificateBytes, privateBytes []byte\n\tblock, rest := pem.Decode([]byte(certPEM))\n\tfor block != nil {\n\t\tswitch block.Type {\n\t\tcase constants.CertificatePEMBlock:\n\t\t\tcertificateBytes = block.Bytes\n\t\tcase constants.RSAPrivateKeyPEMBlock:\n\t\t\tprivateBytes = block.Bytes\n\t\t}\n\t\t// parse the next block\n\t\tblock, rest = pem.Decode(rest)\n\t}\n\tif len(certificateBytes) == 0 || len(privateBytes) == 0 {\n\t\treturn nil, nil, trace.BadParameter(\"could not parse the license\")\n\t}\n\treturn certificateBytes, privateBytes, nil\n}", "title": "" }, { "docid": "59086744f088355946508e331c862efd", "score": "0.6193035", "text": "func ParsePrivateKey(bs []byte) (*rsa.PrivateKey, error) {\n\tif len(bs) == 0 {\n\t\treturn nil, errNoKey\n\t}\n\n\tb, _ := pem.Decode(bs)\n\tif b == nil {\n\t\treturn nil, errors.New(\"pem decode failed\")\n\t}\n\n\tif x509.IsEncryptedPEMBlock(b) {\n\t\treturn nil, errors.New(\"key is encrypted\")\n\t}\n\n\treturn x509.ParsePKCS1PrivateKey(b.Bytes)\n}", "title": "" }, { "docid": "e5a9c78d6235ce5746181a38e1ab3aae", "score": "0.6185361", "text": "func parseCertificate(asn1Data []byte, pkAlgo PubKeyAlgorithm) (interface{}, error) {\n\tif pkAlgo == SM2 {\n\t\tx509Cert, err := sm2x509.ParseCertificate(asn1Data)\n\t\tif err != nil {\n\t\t\treturn nil, sdkerrors.Wrap(ErrInvalidCertificate, err.Error())\n\t\t}\n\n\t\treturn x509Cert, nil\n\t}\n\n\tx509Cert, err := x509.ParseCertificate(asn1Data)\n\tif err != nil {\n\t\treturn nil, sdkerrors.Wrap(ErrInvalidCertificate, err.Error())\n\t}\n\n\treturn x509Cert, nil\n}", "title": "" }, { "docid": "67f4b10bc2b16626950cd183808f8ab2", "score": "0.61730725", "text": "func ParsePemEncodedKey(keyBytes []byte) (crypto.PrivateKey, error) {\n\tkb, _ := pem.Decode(keyBytes)\n\tif kb == nil {\n\t\treturn nil, fmt.Errorf(\"invalid PEM-encoded key\")\n\t}\n\n\tswitch kb.Type {\n\tcase blockTypeECPrivateKey:\n\t\tkey, err := x509.ParseECPrivateKey(kb.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse the ECDSA private key\")\n\t\t}\n\t\treturn key, nil\n\tcase blockTypeRSAPrivateKey:\n\t\tkey, err := x509.ParsePKCS1PrivateKey(kb.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse the RSA private key\")\n\t\t}\n\t\treturn key, nil\n\tcase blockTypePKCS8PrivateKey:\n\t\tkey, err := x509.ParsePKCS8PrivateKey(kb.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse the PKCS8 private key\")\n\t\t}\n\t\treturn key, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported PEM block type for a private key: %s\", kb.Type)\n\t}\n}", "title": "" }, { "docid": "eed2430d8368d46553fceccd80281660", "score": "0.6168952", "text": "func ParseSigner(pemValue string) (crypto.Signer, error) {\n\t// The _ result below is not an error but the remaining PEM bytes.\n\tblock, _ := pem.Decode([]byte(pemValue))\n\tif block == nil {\n\t\treturn nil, fmt.Errorf(\"no PEM-encoded data found\")\n\t}\n\n\tswitch block.Type {\n\tcase \"EC PRIVATE KEY\":\n\t\treturn x509.ParseECPrivateKey(block.Bytes)\n\n\tcase \"RSA PRIVATE KEY\":\n\t\treturn x509.ParsePKCS1PrivateKey(block.Bytes)\n\n\tcase \"PRIVATE KEY\":\n\t\tsigner, err := x509.ParsePKCS8PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpk, ok := signer.(crypto.Signer)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"private key is not a valid format\")\n\t\t}\n\n\t\treturn pk, nil\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown PEM block type for signing key: %s\", block.Type)\n\t}\n}", "title": "" }, { "docid": "c62154792e1c287a00f13ca4843aec55", "score": "0.6094575", "text": "func ParsePrivateKey(bytes []byte) (crypto.Signer, error) {\n\tblock, _ := pem.Decode(bytes)\n\tif block == nil {\n\t\treturn nil, trace.BadParameter(\"failed to decode private key PEM block\")\n\t}\n\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\treturn x509.ParsePKCS1PrivateKey(block.Bytes)\n\tdefault:\n\t\treturn nil, trace.BadParameter(\"unsupported private key type %q\", block.Type)\n\t}\n}", "title": "" }, { "docid": "11d287efb00b219071fa3d2138dbefbf", "score": "0.6063549", "text": "func parsePublicKey(pemBytes []byte) (Unsigner, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tlogger.Debug(fmt.Sprintf(\"Public key parse %v\\n\", block))\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tvar rawkey interface{}\n\tswitch block.Type {\n\tcase \"RSA PUBLIC KEY\":\n\t\trsa, err := x509.ParsePKIXPublicKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawkey = rsa\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\n\tlogger.Trace(fmt.Sprintf(\"Public rawkey %v\\n\", rawkey))\n\treturn newUnsignerFromKey(rawkey)\n}", "title": "" }, { "docid": "11d287efb00b219071fa3d2138dbefbf", "score": "0.6063549", "text": "func parsePublicKey(pemBytes []byte) (Unsigner, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tlogger.Debug(fmt.Sprintf(\"Public key parse %v\\n\", block))\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tvar rawkey interface{}\n\tswitch block.Type {\n\tcase \"RSA PUBLIC KEY\":\n\t\trsa, err := x509.ParsePKIXPublicKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawkey = rsa\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\n\tlogger.Trace(fmt.Sprintf(\"Public rawkey %v\\n\", rawkey))\n\treturn newUnsignerFromKey(rawkey)\n}", "title": "" }, { "docid": "ab1d8d3925901182c25610eebd689b8d", "score": "0.60238105", "text": "func (s *Signature) parsePrivateKey(pemBytes []byte) (Signer, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tvar rawKey interface{}\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\trsaKey, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawKey = rsaKey\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\treturn s.newSignerFromKey(rawKey)\n}", "title": "" }, { "docid": "cf04f7b93efcdb242a1bf5faa8b2dc33", "score": "0.6016345", "text": "func PEMtox509(bytes []byte) (*x509.Certificate, error) {\n\tcertDERBlock, _ := pem.Decode(bytes)\n\tif certDERBlock == nil {\n\t\treturn nil, fmt.Errorf(\"failed to decode PEM block\")\n\t}\n\tcertificate, err := x509.ParseCertificate(certDERBlock.Bytes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to decode DER bytes\")\n\t}\n\treturn certificate, nil\n}", "title": "" }, { "docid": "951b4e56146542c2abf9ccf77360ec15", "score": "0.5983692", "text": "func ParseCertificatePEM(data PEM, k *PrivateKey) (c Certificate, err error) {\n\treturn parseCertificatePEM(data, k)\n}", "title": "" }, { "docid": "010612107de3ed8c0bd6ba644a50e708", "score": "0.59705704", "text": "func ParsePrivateKey(block []byte) (PrivateKey, error) {\n\tblocks, err := getPEMBytes(block)\n\tif nil != err {\n\t\treturn nil, ErrParsePrivateKey\n\t}\n\n\t// Parse PEM blocks (openssl generates junk metadata blocks for ECs)\n\t// or the original DER, or the JWK\n\tfor i := range blocks {\n\t\tblock = blocks[i]\n\t\tif key, err := parsePrivateKey(block); nil == err {\n\t\t\treturn key, nil\n\t\t}\n\t}\n\n\tfor i := range blocks {\n\t\tblock = blocks[i]\n\t\tif _, err := parsePublicKey(block); nil == err {\n\t\t\treturn nil, ErrUnexpectedPublicKey\n\t\t}\n\t}\n\n\t// If we didn't parse a key arleady, we failed\n\treturn nil, ErrParsePrivateKey\n}", "title": "" }, { "docid": "21b11d1830b73acf26b23d20794def8f", "score": "0.5968128", "text": "func ParseDER(b []byte) (interface{}, error) {\n\t// Try private keys\n\tkey, err := x509.ParsePKCS8PrivateKey(b)\n\tif err != nil {\n\t\tif key, err = x509.ParseECPrivateKey(b); err != nil {\n\t\t\tkey, err = x509.ParsePKCS1PrivateKey(b)\n\t\t}\n\t}\n\n\t// Try public key\n\tif err != nil {\n\t\tif key, err = x509.ParsePKIXPublicKey(b); err != nil {\n\t\t\tif key, err = x509.ParsePKCS1PublicKey(b); err != nil {\n\t\t\t\treturn nil, errors.New(\"error decoding DER; bad format\")\n\t\t\t}\n\t\t}\n\t}\n\n\treturn key, nil\n}", "title": "" }, { "docid": "3c5fe86f2a659eb3504f4125930277a5", "score": "0.5950799", "text": "func (s *Signer) Parse(b []byte) ([]byte, error) {\n\tif len(b) < encHeaderLen {\n\t\treturn nil, ErrTooShort\n\t}\n\n\tvar header [headerLen]byte\n\tnext := header[:]\n\t_, err := base64.RawURLEncoding.Decode(next, b[:encHeaderLen])\n\tif err != nil {\n\t\treturn nil, ErrInvalidEncoding\n\t}\n\tb = b[encHeaderLen:]\n\n\tif next[0] != version {\n\t\treturn nil, ErrInvalidVersion\n\t}\n\tnext = next[versionLen:]\n\n\tts := int64(binary.LittleEndian.Uint64(next[:issueLen]))\n\tissue := time.Unix(0, ts)\n\tif issue.Add(s.TTL).Before(time.Now()) {\n\t\treturn nil, ErrTimestampExpired\n\t}\n\tnext = next[issueLen:]\n\n\tvar payload []byte\n\tif payloadLen := len(b); payloadLen > 0 {\n\t\tpayload = make([]byte, base64.RawURLEncoding.DecodedLen(payloadLen))\n\t\tn, err := base64.RawURLEncoding.Decode(payload, b)\n\t\tif err != nil {\n\t\t\treturn nil, ErrInvalidEncoding\n\t\t}\n\t\tpayload = payload[:n]\n\t}\n\n\tvar expectedSig [sha256.Size]byte\n\ts.sign(header[:sigOffset], payload, expectedSig[:0])\n\tif !hmac.Equal(expectedSig[:], header[sigOffset:]) {\n\t\treturn nil, ErrSignatureMismatch\n\t}\n\treturn payload, nil\n}", "title": "" }, { "docid": "d37f2c21d7f4c6ebf689fdfd8b640895", "score": "0.5917164", "text": "func (s *Signature) parsePublicKey(pemBytes []byte) (Unsigner, error) {\n\tblock, _ := pem.Decode(pemBytes)\n\tif block == nil {\n\t\treturn nil, errors.New(\"ssh: no key found\")\n\t}\n\n\tvar rawKey interface{}\n\tswitch block.Type {\n\tcase \"PUBLIC KEY\":\n\t\trsaKey, err := x509.ParsePKIXPublicKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawKey = rsaKey\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"ssh: unsupported key type %q\", block.Type)\n\t}\n\n\treturn s.newUnsignerFromKey(rawKey)\n}", "title": "" }, { "docid": "92f19d42250b9325e28d3e1c33a52fb0", "score": "0.591631", "text": "func parsePrivateKey(der []byte) (crypto.PrivateKey, error) {\n\tif key, err := x509.ParsePKCS1PrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\tif key, err := x509.ParsePKCS8PrivateKey(der); err == nil {\n\t\tswitch key := key.(type) {\n\t\tcase *rsa.PrivateKey, *ecdsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"crypto/tls: found unknown private key type in PKCS#8 wrapping\")\n\t\t}\n\t}\n\tif key, err := x509.ParseECPrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\treturn nil, errors.New(\"crypto/tls: failed to parse private key\")\n}", "title": "" }, { "docid": "a655972bd17d27131b282f08f1a494ec", "score": "0.5910421", "text": "func ParseCertificate(pemData []byte) (*x509.Certificate, error) {\n\tvar block *pem.Block\n\tfor len(pemData) > 0 {\n\t\tblock, pemData = pem.Decode(pemData)\n\t\tif block == nil {\n\t\t\treturn nil, errors.New(\"error decoding pem block\")\n\t\t}\n\t\tif block.Type != \"CERTIFICATE\" || len(block.Headers) != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tcert, err := x509.ParseCertificate(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"error parsing certificate\")\n\t\t}\n\t\treturn cert, nil\n\t}\n\n\treturn nil, errors.New(\"error parsing certificate: no certificate found\")\n}", "title": "" }, { "docid": "44cef9e8150cc496dee28096663ecd59", "score": "0.59100586", "text": "func LoadPemEncodedCertificate(name string) (certificate *x509.Certificate, err error) {\n\tvar content []byte\n\n\tif content, err = Load(name); err != nil {\n\t\tlog.Fatalf(\"%s\\n\", err)\n\t} else {\n\t\tcertificate, err = tlsutil.ParsePEMEncodedCACert(content)\n\t\tif err != nil {\n\t\t\tlog.Println(\"LoadPemEncodedCertificate\", name)\n\t\t\tpanic(err)\n\t\t}\n\t\tif app.Debug {\n\t\t\tfmt.Println(Jsonify(certificate))\n\t\t}\n\t}\n\treturn certificate, err\n}", "title": "" }, { "docid": "1b6e1b1f3c80e53682a135cf0b29f56e", "score": "0.5909371", "text": "func parsePrivateKey(der []byte) (crypto.PrivateKey, error) {\n\t// try to parse as a PKCS1 private key\n\tif key, err := x509.ParsePKCS1PrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\t// try to parse as a PCKSC8 private key\n\tif key, err := x509.ParsePKCS8PrivateKey(der); err == nil {\n\t\tswitch key := key.(type) {\n\t\tcase *rsa.PrivateKey, *ecdsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"crypto/tls: found unknown private key type in PKCS#8 wrapping\")\n\t\t}\n\t}\n\n\t// try to parse as an EC private key\n\tif key, err := x509.ParseECPrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\t// was not able to parse so return appropriate error\n\treturn nil, errors.New(\"crypto/tls: failed to parse private key\")\n}", "title": "" }, { "docid": "47357fd3929488fbe175b090db478bb8", "score": "0.59086484", "text": "func ParseCertificatePEM(bytes []byte) (*x509.Certificate, error) {\n\tblock, _ := pem.Decode(bytes)\n\tif block == nil {\n\t\treturn nil, trace.BadParameter(\"expected PEM-encoded block\")\n\t}\n\tcert, err := x509.ParseCertificate(block.Bytes)\n\tif err != nil {\n\t\treturn nil, trace.BadParameter(err.Error())\n\t}\n\treturn cert, nil\n}", "title": "" }, { "docid": "47357fd3929488fbe175b090db478bb8", "score": "0.59086484", "text": "func ParseCertificatePEM(bytes []byte) (*x509.Certificate, error) {\n\tblock, _ := pem.Decode(bytes)\n\tif block == nil {\n\t\treturn nil, trace.BadParameter(\"expected PEM-encoded block\")\n\t}\n\tcert, err := x509.ParseCertificate(block.Bytes)\n\tif err != nil {\n\t\treturn nil, trace.BadParameter(err.Error())\n\t}\n\treturn cert, nil\n}", "title": "" }, { "docid": "17af81d514a363ddc7db7e53d62d77c9", "score": "0.5907741", "text": "func ParsePEMEncodedCACert(pemdata []byte) (*x509.Certificate, error) {\n\tdecoded, _ := pem.Decode(pemdata)\n\tif decoded == nil {\n\t\treturn nil, errors.New(\"no PEM data found\")\n\t}\n\treturn x509.ParseCertificate(decoded.Bytes)\n}", "title": "" }, { "docid": "47145ffe1bc6580024bd9a392c560fc2", "score": "0.58953404", "text": "func ParsePEMEncodedCert(pemdata []byte) (*x509.Certificate, error) {\n\tdecoded, _ := pem.Decode(pemdata)\n\tif decoded == nil {\n\t\treturn nil, errors.New(\"no PEM data found\")\n\t}\n\treturn x509.ParseCertificate(decoded.Bytes)\n}", "title": "" }, { "docid": "afa25f3cc861c749cee22ec1825f32d6", "score": "0.5890531", "text": "func ParseCertificate(der []byte) (*x509.Certificate, error) {\n\tcert, err := parseCertificate(der)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(der) != len(cert.Raw) {\n\t\treturn nil, xerrors.New(\"x509: trailing data\")\n\t}\n\treturn cert, err\n}", "title": "" }, { "docid": "65423fbca658c8f46d67af41360380db", "score": "0.58476174", "text": "func parsePrivateKey(privateKey []byte) (*rsa.PrivateKey, error) {\n\tdecoded, _ := pem.Decode(privateKey)\n\tif decoded == nil {\n\t\treturn nil, errors.New(\"private key error\")\n\t}\n\tprikey, err := x509.ParsePKCS1PrivateKey(decoded.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn prikey, nil\n}", "title": "" }, { "docid": "e35691fc995cec3a7895d8d9931696f1", "score": "0.5847551", "text": "func parseDSAPrivateKey(asn1Bytes []byte) (key *dsa.PrivateKey, err error) {\n\tvar src struct {\n\t\tE1, P, Q, G, Y, X *big.Int\n\t}\n\tif _, err = asn1.Unmarshal(asn1Bytes, &src); err != nil {\n\t\treturn\n\t}\n\n\treturn &dsa.PrivateKey{\n\t\tX: src.X,\n\t\tPublicKey: dsa.PublicKey{\n\t\t\tY: src.Y,\n\t\t\tParameters: dsa.Parameters{\n\t\t\t\tP: src.P,\n\t\t\t\tQ: src.Q,\n\t\t\t\tG: src.G,\n\t\t\t},\n\t\t},\n\t}, nil\n}", "title": "" }, { "docid": "3692efa57e21c3e5227892eabd425461", "score": "0.58465225", "text": "func ParsePrivateKeyPEM(bytes []byte) (crypto.Signer, error) {\n\tblock, _ := pem.Decode(bytes)\n\tif block == nil {\n\t\treturn nil, trace.BadParameter(\"expected PEM-encoded block\")\n\t}\n\treturn ParsePrivateKeyDER(block.Bytes)\n}", "title": "" }, { "docid": "4bb14fdfcf3c30fb9a898d29718a06ea", "score": "0.58373535", "text": "func parsePrivateKey(der []byte) (crypto.Signer, error) {\n\tif key, err := x509.ParsePKCS1PrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\tif key, err := x509.ParsePKCS8PrivateKey(der); err == nil {\n\t\tswitch key := key.(type) {\n\t\tcase *rsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tcase *ecdsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"acme/autocert: unknown private key type in PKCS#8 wrapping\")\n\t\t}\n\t}\n\tif key, err := x509.ParseECPrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\treturn nil, errors.New(\"acme/autocert: failed to parse private key\")\n}", "title": "" }, { "docid": "4bb14fdfcf3c30fb9a898d29718a06ea", "score": "0.58373535", "text": "func parsePrivateKey(der []byte) (crypto.Signer, error) {\n\tif key, err := x509.ParsePKCS1PrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\tif key, err := x509.ParsePKCS8PrivateKey(der); err == nil {\n\t\tswitch key := key.(type) {\n\t\tcase *rsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tcase *ecdsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"acme/autocert: unknown private key type in PKCS#8 wrapping\")\n\t\t}\n\t}\n\tif key, err := x509.ParseECPrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\treturn nil, errors.New(\"acme/autocert: failed to parse private key\")\n}", "title": "" }, { "docid": "4bb14fdfcf3c30fb9a898d29718a06ea", "score": "0.58373535", "text": "func parsePrivateKey(der []byte) (crypto.Signer, error) {\n\tif key, err := x509.ParsePKCS1PrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\tif key, err := x509.ParsePKCS8PrivateKey(der); err == nil {\n\t\tswitch key := key.(type) {\n\t\tcase *rsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tcase *ecdsa.PrivateKey:\n\t\t\treturn key, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"acme/autocert: unknown private key type in PKCS#8 wrapping\")\n\t\t}\n\t}\n\tif key, err := x509.ParseECPrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\treturn nil, errors.New(\"acme/autocert: failed to parse private key\")\n}", "title": "" }, { "docid": "7ac7b213b5f0ed96e3e628fb941c5396", "score": "0.5826317", "text": "func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error) {\n\tdecoded, _ := pem.Decode(pemdata)\n\tif decoded == nil {\n\t\treturn nil, errors.New(\"no PEM data found\")\n\t}\n\treturn x509.ParsePKCS1PrivateKey(decoded.Bytes)\n}", "title": "" }, { "docid": "7ac7b213b5f0ed96e3e628fb941c5396", "score": "0.5826317", "text": "func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error) {\n\tdecoded, _ := pem.Decode(pemdata)\n\tif decoded == nil {\n\t\treturn nil, errors.New(\"no PEM data found\")\n\t}\n\treturn x509.ParsePKCS1PrivateKey(decoded.Bytes)\n}", "title": "" }, { "docid": "ca6b06d1f019ee08afb96081c2972de8", "score": "0.5809719", "text": "func ParsePEM(pemBytes []byte) ([]*x509.Certificate, error) {\n\tvar certchain []*x509.Certificate\n\n\t// Step through pemBytes decoding PEM certificate until there's nothing left.\n\tfor {\n\t\tblock, rest := pem.Decode(pemBytes)\n\t\tif block == nil {\n\t\t\t// When no PEM data is found block is nil, all PEM data has been read.\n\t\t\tbreak\n\t\t}\n\n\t\tcert, err := x509.ParseCertificate(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcertchain = append(certchain, cert)\n\t\tpemBytes = rest\n\t}\n\n\treturn certchain, nil\n}", "title": "" }, { "docid": "331decdcc0f7902b677ca0379174dd61", "score": "0.5807706", "text": "func ParsePrivateKey(b []byte) (*PrivateKey, error) {\n\tif len(b) != PrivateKeyLen {\n\t\treturn nil, errors.New(\"InvalidKeyLength\")\n\t}\n\tb2 := make([]byte, len(b))\n\tcopy(b2, b)\n\treturn &PrivateKey{b2}, nil\n}", "title": "" }, { "docid": "e99081308527c97ac8b8c5153e9b280a", "score": "0.57887554", "text": "func ParseVerify(serialized []byte, signingKey interface{}) ([]byte, error) {\n\tobject, err := jose.ParseSigned(string(serialized))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\toutput, err := object.Verify(signingKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn output, nil\n}", "title": "" }, { "docid": "acdde3bebfe272d219ba41516e069ddd", "score": "0.57847005", "text": "func ParsePrivateKeyPEM(keyData []byte) (interface{}, error) {\n\tvar privateKeyPemBlock *pem.Block\n\tfor {\n\t\tprivateKeyPemBlock, keyData = pem.Decode(keyData)\n\t\tif privateKeyPemBlock == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tswitch privateKeyPemBlock.Type {\n\t\tcase ECPrivateKeyBlockType:\n\t\t\t// ECDSA Private Key in ASN.1 format\n\t\t\tif key, err := x509.ParseECPrivateKey(privateKeyPemBlock.Bytes); err == nil {\n\t\t\t\treturn key, nil\n\t\t\t}\n\t\tcase RSAPrivateKeyBlockType:\n\t\t\t// RSA Private Key in PKCS#1 format\n\t\t\tif key, err := x509.ParsePKCS1PrivateKey(privateKeyPemBlock.Bytes); err == nil {\n\t\t\t\treturn key, nil\n\t\t\t}\n\t\tcase PrivateKeyBlockType:\n\t\t\t// RSA or ECDSA Private Key in unencrypted PKCS#8 format\n\t\t\tif key, err := x509.ParsePKCS8PrivateKey(privateKeyPemBlock.Bytes); err == nil {\n\t\t\t\treturn key, nil\n\t\t\t}\n\t\t}\n\n\t\t// tolerate non-key PEM blocks for compatibility with things like \"EC PARAMETERS\" blocks\n\t\t// originally, only the first PEM block was parsed and expected to be a key block\n\t}\n\n\t// we read all the PEM blocks and didn't recognize one\n\treturn nil, fmt.Errorf(\"data does not contain a valid RSA or ECDSA private key\")\n}", "title": "" }, { "docid": "acdde3bebfe272d219ba41516e069ddd", "score": "0.57847005", "text": "func ParsePrivateKeyPEM(keyData []byte) (interface{}, error) {\n\tvar privateKeyPemBlock *pem.Block\n\tfor {\n\t\tprivateKeyPemBlock, keyData = pem.Decode(keyData)\n\t\tif privateKeyPemBlock == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tswitch privateKeyPemBlock.Type {\n\t\tcase ECPrivateKeyBlockType:\n\t\t\t// ECDSA Private Key in ASN.1 format\n\t\t\tif key, err := x509.ParseECPrivateKey(privateKeyPemBlock.Bytes); err == nil {\n\t\t\t\treturn key, nil\n\t\t\t}\n\t\tcase RSAPrivateKeyBlockType:\n\t\t\t// RSA Private Key in PKCS#1 format\n\t\t\tif key, err := x509.ParsePKCS1PrivateKey(privateKeyPemBlock.Bytes); err == nil {\n\t\t\t\treturn key, nil\n\t\t\t}\n\t\tcase PrivateKeyBlockType:\n\t\t\t// RSA or ECDSA Private Key in unencrypted PKCS#8 format\n\t\t\tif key, err := x509.ParsePKCS8PrivateKey(privateKeyPemBlock.Bytes); err == nil {\n\t\t\t\treturn key, nil\n\t\t\t}\n\t\t}\n\n\t\t// tolerate non-key PEM blocks for compatibility with things like \"EC PARAMETERS\" blocks\n\t\t// originally, only the first PEM block was parsed and expected to be a key block\n\t}\n\n\t// we read all the PEM blocks and didn't recognize one\n\treturn nil, fmt.Errorf(\"data does not contain a valid RSA or ECDSA private key\")\n}", "title": "" }, { "docid": "e349a557ae17f04802f124a283ecb66e", "score": "0.57332003", "text": "func ParseFromPEM(key []byte) (interface{}, error) {\n\tvar err error\n\n\t// Parse PEM block\n\tvar block *pem.Block\n\tif block, _ = pem.Decode(key); block == nil {\n\t\treturn nil, jwa.ErrKeyMustBePEMEncoded(0)\n\t}\n\n\tvar parsedKey interface{}\n\tfor _, v := range parsers {\n\t\tif parsedKey, err = v(block.Bytes); err == nil {\n\t\t\treturn parsedKey, nil\n\t\t}\n\t}\n\n\treturn nil, jwa.ErrParsingFromPEM(0)\n}", "title": "" }, { "docid": "0dd81d9811fa65a43964323c13750e5a", "score": "0.57202476", "text": "func ParsePemEncodedCertificateChain(certBytes []byte) ([]*x509.Certificate, error) {\n\tvar (\n\t\tcerts []*x509.Certificate\n\t\tcb *pem.Block\n\t)\n\tfor {\n\t\tcb, certBytes = pem.Decode(certBytes)\n\t\tif cb == nil {\n\t\t\tbreak\n\t\t}\n\t\tcert, err := x509.ParseCertificate(cb.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse X.509 certificate\")\n\t\t}\n\t\tcerts = append(certs, cert)\n\t}\n\tif len(certs) == 0 {\n\t\treturn nil, fmt.Errorf(\"no PEM encoded X.509 certificates parsed\")\n\t}\n\treturn certs, nil\n}", "title": "" }, { "docid": "c68444814b53727ea2ba37db081ee1f7", "score": "0.57145447", "text": "func DecodePublicKeyPEM(sigAlgo SignatureAlgorithm, s string) (PublicKey, error) {\n\tblock, rest := pem.Decode([]byte(s))\n\tif len(rest) > 0 {\n\t\treturn nil, fmt.Errorf(\"crypto: failed to parse PEM string, all not bytes in PEM key were decoded: %s\", string(rest))\n\t}\n\n\t// TODO: Replace with function that is compatible with secp256k1\n\tpublicKey, err := x509.ParsePKIXPublicKey(block.Bytes)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"crypto: failed to parse PEM string: %w\", err)\n\t}\n\n\tgoPublicKey, ok := publicKey.(*ecdsa.PublicKey)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"only ECDSA public keys are supported\")\n\t}\n\txBytes := goPublicKey.X.Bytes()\n\tyBytes := goPublicKey.Y.Bytes()\n\texpectedLength := bitsToBytes(goPublicKey.Params().P.BitLen())\n\t// If an expected length for the point byte slice sizes, make sure to\n\t// pad up to the expected length\n\trawPublicKey := make([]byte, 0, 2*expectedLength)\n\trawPublicKey = appendWithLeftPad(rawPublicKey, xBytes, expectedLength)\n\trawPublicKey = appendWithLeftPad(rawPublicKey, yBytes, expectedLength)\n\n\treturn DecodePublicKey(sigAlgo, rawPublicKey)\n}", "title": "" }, { "docid": "f9003f68db04090d1250eb80892b9600", "score": "0.56776494", "text": "func LoadPublicCertFormBytes(input []byte) (publicKey *rsa.PublicKey, err error) {\n\tvar (\n\t\tblock *pem.Block\n\t\tpubKey *x509.Certificate\n\t\tok bool\n\t)\n\tif block, _ = pem.Decode(input); block == nil {\n\t\terr = errors.New(\"支付宝公钥Decode错误\")\n\t\treturn\n\t}\n\tif pubKey, err = x509.ParseCertificate(block.Bytes); err != nil {\n\t\terr = fmt.Errorf(\"x509.ParsePKIXPublicKey:%w\", err)\n\t\treturn\n\t}\n\tif _, ok = pubKey.PublicKey.(*rsa.PublicKey); !ok {\n\t\terr = errors.New(\"public key 类型断言错误\")\n\t\treturn\n\t}\n\treturn pubKey.PublicKey.(*rsa.PublicKey), nil\n}", "title": "" }, { "docid": "4481e3423f361e7583edc759889b5dbc", "score": "0.5673559", "text": "func (c *Certificates) parse(r io.ReadCloser) (map[int]*x509.Certificate, error) {\n\tcertArray := new([]Certs)\n\tif err := json.NewDecoder(r).Decode(certArray); err != nil {\n\t\treturn nil, err\n\t}\n\n\tcerts := make(map[int]*x509.Certificate)\n\tfor k, v := range (*certArray)[0].Certs {\n\t\tblock, _ := pem.Decode([]byte(v.Cert))\n\t\tc, err := x509.ParseCertificate(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcerts[k] = c\n\n\t}\n\treturn certs, nil\n}", "title": "" }, { "docid": "6e3dc75a28cebd8290542fda564d3131", "score": "0.565931", "text": "func (k *Key) ParseRawPrivateKey(password []byte) (interface{}, error) {\n\tif k.Encryption != \"none\" && len(password) == 0 {\n\t\treturn nil, fmt.Errorf(\"expecting password\")\n\t}\n\n\terr := k.decrypt(password)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch k.Algo {\n\tcase \"ssh-rsa\":\n\t\treturn k.readRSAPrivateKey()\n\tcase \"ecdsa-sha2-nistp256\",\n\t\t\"ecdsa-sha2-nistp384\",\n\t\t\"ecdsa-sha2-nistp521\":\n\t\treturn k.readECDSAPrivateKey()\n\tcase \"ssh-dss\":\n\t\treturn k.readDSAPrivateKey()\n\tcase \"ssh-ed25519\":\n\t\treturn k.readED25519PrivateKey()\n\t}\n\n\treturn nil, fmt.Errorf(\"unsupported key type %q\", k.Algo)\n}", "title": "" }, { "docid": "7e0d5a98c45884c10f286ea77c754a09", "score": "0.56348705", "text": "func (f *EncryptedFormatter) ParsePair(encryptedDocumentBytes []byte) (string, []byte, error) {\n\tstructuredDocument, err := f.getStructuredDocFromEncryptedDoc(encryptedDocumentBytes)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(failGetStructuredDocFromEncryptedDocBytes, err)\n\t}\n\n\tpayloadValue, ok := structuredDocument.Content[payloadContentKey]\n\tif !ok {\n\t\treturn \"\", nil, errPayloadKeyMissing\n\t}\n\n\tpayloadValueString, ok := payloadValue.(string)\n\tif !ok {\n\t\treturn \"\", nil, errPayloadNotAssertableAsString\n\t}\n\n\toriginalKeyValue, ok := structuredDocument.Content[originalKeyContentKey]\n\tif !ok {\n\t\treturn \"\", nil, errOriginalKeyMissing\n\t}\n\n\toriginalKeyValueString, ok := originalKeyValue.(string)\n\tif !ok {\n\t\treturn \"\", nil, errOriginalKeyNotAssertableAsString\n\t}\n\n\treturn originalKeyValueString, []byte(payloadValueString), nil\n}", "title": "" }, { "docid": "b6763e90f903f4bd3900d4316e89974d", "score": "0.56033313", "text": "func ParseKeyFile(location string) ([]byte, error) {\n\tr, err := regexp.Compile(\"<data>(.+)<\\\\/data>\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfile, err := os.Open(location)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar data []byte\n\tif data, err = ioutil.ReadAll(file); err != nil {\n\t\treturn nil, err\n\t}\n\tif r.Match(data) { //If keyfile is in xml form, extract key data\n\t\tdata = r.FindSubmatch(data)[1]\n\t}\n\tsum := sha256.Sum256(data)\n\treturn sum[:], nil\n}", "title": "" }, { "docid": "58b3ef52d2968af9b0690bd654d29564", "score": "0.5602765", "text": "func ParsePrivateKeyFromPEM(key []byte) (interface{}, error) {\n\tvar err error\n\n\t// Parse PEM block\n\tvar block *pem.Block\n\tif block, _ = pem.Decode(key); block == nil {\n\t\treturn nil, ErrKeyMustBePEMEncoded\n\t}\n\n\tvar parsedKey interface{}\n\tswitch block.Type {\n\tcase \"RSA PRIVATE KEY\":\n\t\tif parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\tcase \"PRIVATE KEY\":\n\t\tif parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\tcase \"EC PRIVATE KEY\":\n\t\tif parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\tdefault:\n\t\treturn nil, ErrNotPrivateKey\n\t}\n\n\tswitch parsedKey.(type) {\n\tcase *rsa.PrivateKey, *ecdsa.PrivateKey:\n\t\treturn parsedKey, nil\n\tdefault:\n\t\treturn nil, ErrUnsupportedPrivateKey\n\t}\n}", "title": "" }, { "docid": "96d2a2d0de4cf58e3708a90bfb83c6a7", "score": "0.5583576", "text": "func DecodePrivateKeyBytes(bytes []byte) (interface{}, error) {\n\tkey, err := ssh.ParseRawPrivateKey(bytes)\n\treturn key, err\n}", "title": "" }, { "docid": "c426bccfe17037196902bacbccc5d92c", "score": "0.55824745", "text": "func parseRSA256PrivateKey(str string) (*rsa.PrivateKey, error) {\n\n\t// Base64 decode string\n\tkeyBytes, err := base64.StdEncoding.DecodeString(str)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Decode PEM\n\tkeyPem, _ := pem.Decode(keyBytes)\n\tif keyPem == nil {\n\t\treturn nil, fmt.Errorf(\"Failed to get secret\")\n\t}\n\n\t// Validate PEM type\n\tif keyPem.Type != \"RSA PRIVATE KEY\" {\n\t\treturn nil, fmt.Errorf(\"Decoded key is of the wrong type (%v)\", keyPem.Type)\n\t}\n\n\t// Parse to key bytes\n\tvar parsedKey interface{}\n\tif parsedKey, err = x509.ParsePKCS1PrivateKey(keyPem.Bytes); err != nil {\n\t\tif parsedKey, err = x509.ParsePKCS8PrivateKey(keyPem.Bytes); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Cast to RSA private key type\n\tprivKey, ok := parsedKey.(*rsa.PrivateKey)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"Failed to parse private key\")\n\t}\n\treturn privKey, nil\n}", "title": "" }, { "docid": "0f58b10a6c25253401188a88391caf04", "score": "0.55806214", "text": "func parseECPrivateKey(b []byte) (*ecdsa.PrivateKey, error) {\n\tvar privKey ecPrivateKey\n\tif _, err := asn1.Unmarshal(b, &privKey); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse EC private key: %w\", err)\n\t}\n\tif privKey.Version != ecPrivateKeyVersion {\n\t\t//nolint:goerr113\n\t\treturn nil, fmt.Errorf(\"unknown EC private key version %d\", privKey.Version)\n\t}\n\n\tcurve := secp256k1.S256()\n\tk := new(big.Int).SetBytes(privKey.PrivateKey)\n\tcurveOrder := curve.Params().N\n\tif k.Cmp(curveOrder) >= 0 {\n\t\treturn nil, ErrInvalidEC\n\t}\n\n\tpriv := new(ecdsa.PrivateKey)\n\tpriv.Curve = curve\n\tpriv.D = k\n\n\tprivateKey := make([]byte, (curveOrder.BitLen()+7)/8)\n\n\t// Some private keys have leading zero padding. This is invalid\n\t// according to [SEC1], but this code will ignore it.\n\tfor len(privKey.PrivateKey) > len(privateKey) {\n\t\tif privKey.PrivateKey[0] != 0 {\n\t\t\treturn nil, ErrInvalidPrivateKey\n\t\t}\n\t\tprivKey.PrivateKey = privKey.PrivateKey[1:]\n\t}\n\n\t// Some private keys remove all leading zeros, this is also invalid\n\t// according to [SEC1] but since OpenSSL used to do this, we ignore\n\t// this too.\n\tcopy(privateKey[len(privateKey)-len(privKey.PrivateKey):], privKey.PrivateKey)\n\tpriv.X, priv.Y = curve.ScalarBaseMult(privateKey)\n\n\treturn priv, nil\n}", "title": "" }, { "docid": "f469514b4e4a20ba0baa348b57171c29", "score": "0.55747133", "text": "func ParsePublicKey(bytes []byte) (crypto.PublicKey, error) {\n\tblock, _ := pem.Decode(bytes)\n\tif block == nil {\n\t\treturn nil, trace.BadParameter(\"failed to decode public key PEM block\")\n\t}\n\n\tswitch block.Type {\n\tcase \"RSA PUBLIC KEY\":\n\t\treturn x509.ParsePKCS1PublicKey(block.Bytes)\n\tdefault:\n\t\treturn nil, trace.BadParameter(\"unsupported public key type %q\", block.Type)\n\t}\n}", "title": "" }, { "docid": "343201c25a00a070703dc9af61f66341", "score": "0.5573407", "text": "func ParsePrivateKey(data58 string) (*PrivateKey, error) {\n\t// decodePublicKey is applicable here too !!!\n\tpub, err := decodePublicKey(data58)\n\tif nil != err {\n\t\treturn nil, err\n\t}\n\n\tpriv := &PrivateKey{\n\t\tPublicKey: *pub,\n\t\tData: pub.Data[1:], // simply trims out the 0x00 prefix\n\t}\n\tpriv.Version = priv.PublicKey.Version\n\tpriv.PublicKey.Data, priv.PublicKey.Version = nil, nil\n\n\t// load the public key data eagerly\n\t/*\n\t\tx, y := secp256k1Curve.ScalarBaseMult(priv.Data)\n\t\tpubKey := btcec.PublicKey{Curve: secp256k1Curve, X: x, Y: y}\n\t\tpriv.PublicKey.Data = pubKey.SerializeCompressed()\n\t*/\n\t//priv.PublicKey.Data = derivePublicKey(priv.Data)\n\n\treturn priv, nil\n}", "title": "" }, { "docid": "6a8faacb732ae588824c86a4ced16e93", "score": "0.5573164", "text": "func Priv(raw []byte) (*rsa.PrivateKey, error) {\n\tblock, _ := pem.Decode(raw)\n\tif block == nil {\n\t\treturn nil, errors.New(\"Need PEM block\")\n\t}\n\treturn x509.ParsePKCS1PrivateKey(block.Bytes)\n}", "title": "" }, { "docid": "d54da697d33c8a94ef883f123acaea40", "score": "0.55641973", "text": "func ParseCert(cert []byte) (epoch uint64, signature []byte, err error) {\n\tbuf := bytes.NewBuffer(cert)\n\n\terr = binary.Read(buf, binary.BigEndian, &epoch)\n\tif err != nil {\n\t\treturn uint64(0), nil, fmt.Errorf(\"failed to extract epoch from USIG cert: %s\", err)\n\t}\n\n\treturn epoch, buf.Bytes(), nil\n}", "title": "" }, { "docid": "3d92eaddedf8d73f4f2ff04e038d563c", "score": "0.555872", "text": "func decodeECDSAPrivateKey(pemPrivateKey string) (*ecdsa.PrivateKey, string, error) {\n\n\tvar ecdsaPrivateKey *ecdsa.PrivateKey = nil\n\n\t// Remove any white space before decoding\n\tvar trimmedPrivateKey = strings.TrimSpace(pemPrivateKey)\n\n\t// Capture all key decode errors and collapse them at the end\n\tvar decodeErrors = make([]error, 0)\n\n\t// Check for proper key count before attempting to decode.\n\t// ECDSA keys can have 1 or 2 PEM blocks if the 'EC PARAM' block is included.\n\tvar blockCount = strings.Count(trimmedPrivateKey, \"\\n-----END\")\n\n\tif blockCount < 1 {\n\t\treturn nil, \"\", errors.New(\"private key validation error: no EC private key PEM blocks found\")\n\t}\n\n\tif blockCount > 2 {\n\t\treturn nil, \"\", errors.New(\"private key validation error: too many EC related PEM blocks found\")\n\t}\n\n\t// Attempt to decode pem encoded text into PEM block.\n\tvar pemData = []byte(trimmedPrivateKey)\n\tfor len(pemData) > 0 {\n\t\tvar block *pem.Block = nil\n\n\t\t// Check for at least one END marker\n\t\tif strings.Count(string(pemData), \"\\n-----END\") == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// Attempt to decode the first PEM Block\n\t\tblock, pemData = pem.Decode(pemData)\n\t\tif block == nil {\n\t\t\treturn nil, \"\", errors.New(\"private key validation error: could not decode pem-encoded block\")\n\t\t}\n\n\t\t// Check that the key was decoded and validate key isn't encrypted and\n\t\t// other common validation shared between PKI algorithms\n\t\terr := commonPrivateKeyValidation(block)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\n\t\t// Check if this pem block has 'KEY' contained in the type and try to decode it.\n\t\tif !strings.Contains(block.Type, \"KEY\") {\n\t\t\tcontinue\n\t\t}\n\n\t\t// First try to parse an EC key the normal way, before attempting PKCS8\n\t\tecdsaPrivateKey, err = x509.ParseECPrivateKey(block.Bytes)\n\t\tif ecdsaPrivateKey == nil || err != nil {\n\t\t\tdecodeErrors = append(decodeErrors, errors.New(\"private key validation error: failed to parse EC ANSI X9.62: \"+err.Error()))\n\t\t} else {\n\t\t\treturn ecdsaPrivateKey, trimmedPrivateKey, nil\n\t\t}\n\n\t\t// Second, try to parse PEM block as a PKCS#8 formatted RSA Private Key.\n\t\tprivateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\tdecodeErrors = append(decodeErrors, errors.New(\"private key validation error: parse pkcs#8 error: %s\"+err.Error()))\n\t\t\treturn nil, \"\", util.JoinErrsSep(decodeErrors, \", \")\n\t\t}\n\n\t\t// Make sure the privateKey is of the correct type (ecdsa.PrivateKey)\n\t\tecdsaPrivateKey, ok := privateKey.(*ecdsa.PrivateKey)\n\t\tif !ok || ecdsaPrivateKey == nil {\n\t\t\tdecodeErrors = append(decodeErrors, fmt.Errorf(\"private key validation error: incorrect private key type: %T\", privateKey))\n\t\t\treturn nil, \"\", util.JoinErrsSep(decodeErrors, \", \")\n\t\t}\n\n\t\treturn ecdsaPrivateKey, trimmedPrivateKey, nil\n\t}\n\n\treturn nil, \"\", errors.New(\"private key validation error: no ECDSA private keys found\")\n}", "title": "" }, { "docid": "4111ac365fc24df843a4e1f59a5529e7", "score": "0.5556956", "text": "func ParsePubKey(pubKeyStr []byte) (key *PublicKey, err error) {\n\tpubkey := PublicKey{}\n\n\tif len(pubKeyStr) == 0 {\n\t\treturn nil, errors.New(\"pubkey string is empty\")\n\t}\n\n\tformat := pubKeyStr[0]\n\tybit := (format & 0x1) == 0x1\n\tformat &= ^byte(0x1)\n\n\tswitch len(pubKeyStr) {\n\tcase PubKeyBytesLenUncompressed:\n\t\tif format != pubkeyUncompressed {\n\t\t\treturn nil, fmt.Errorf(\"invalid magic in pubkey str: \"+\n\t\t\t\t\"%d\", pubKeyStr[0])\n\t\t}\n\n\t\tpubkey.x = new(big.Int).SetBytes(pubKeyStr[1:33])\n\t\tpubkey.y = new(big.Int).SetBytes(pubKeyStr[33:])\n\tcase PubKeyBytesLenCompressed:\n\t\t// format is 0x2 | solution, <X coordinate>\n\t\t// solution determines which solution of the curve we use.\n\t\t/// y^2 = x^3 + Curve.B\n\t\tif format != pubkeyCompressed {\n\t\t\treturn nil, fmt.Errorf(\"invalid magic in compressed \"+\n\t\t\t\t\"pubkey string: %d\", pubKeyStr[0])\n\t\t}\n\t\tpubkey.x = new(big.Int).SetBytes(pubKeyStr[1:33])\n\t\tpubkey.y, err = decompressPoint(pubkey.x, ybit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault: // wrong!\n\t\treturn nil, fmt.Errorf(\"invalid pub key length %d\",\n\t\t\tlen(pubKeyStr))\n\t}\n\n\tcurve := S256()\n\tif pubkey.x.Cmp(curveParams.P) >= 0 {\n\t\treturn nil, fmt.Errorf(\"pubkey X parameter is >= to P\")\n\t}\n\tif pubkey.y.Cmp(curveParams.P) >= 0 {\n\t\treturn nil, fmt.Errorf(\"pubkey Y parameter is >= to P\")\n\t}\n\tif !curve.IsOnCurve(pubkey.x, pubkey.y) {\n\t\treturn nil, fmt.Errorf(\"pubkey [%v,%v] isn't on secp256k1 curve\",\n\t\t\tpubkey.x, pubkey.y)\n\t}\n\treturn &pubkey, nil\n}", "title": "" }, { "docid": "597d372964736a6b6f449e66b4a66a62", "score": "0.55522037", "text": "func BytesToPrivateKey(priv string) *rsa.PrivateKey {\n\tblock, _ := pem.Decode([]byte(priv))\n\tif block == nil {\n\t\tlog.Error(\"failed to parse PEM block containing the public key\")\n\t}\n\tenc := x509.IsEncryptedPEMBlock(block)\n\tb := block.Bytes\n\tvar err error\n\tif enc {\n\t\tlog.Println(\"is encrypted pem block\")\n\t\tb, err = x509.DecryptPEMBlock(block, nil)\n\t\tif err != nil {\n\t\t\tlog.Error(err)\n\t\t}\n\t}\n\tkey, err := x509.ParsePKCS1PrivateKey(b)\n\tif err != nil {\n\t\tlog.Error(err)\n\t}\n\treturn key\n\n\t// var pk rsa.PrivateKey\n\t// asn1.Unmarshal(block.Bytes, &pk)\n\t// return &pk\n}", "title": "" }, { "docid": "747cfaadeadeb1ddf6687b1039e3df40", "score": "0.5543097", "text": "func ParseCertificate(certPEM string) (*x509.Certificate, error) {\n\tbl, _ := pem.Decode([]byte(certPEM))\n\tif bl == nil {\n\t\treturn nil, ErrInvalidPEM\n\t}\n\n\treturn x509.ParseCertificate(bl.Bytes)\n}", "title": "" }, { "docid": "aba04e42a4e453e82cab09ad6a24de12", "score": "0.55264044", "text": "func (a *agent) parsePrivateKey(der []byte) (crypto.PrivateKey, error) {\n\tif key, err := x509.ParsePKCS1PrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\tif key, err := x509.ParsePKCS8PrivateKey(der); err == nil {\n\t\tswitch key := key.(type) {\n\t\tcase *rsa.PrivateKey, *ecdsa.PrivateKey, ed25519.PrivateKey:\n\t\t\treturn key, nil\n\t\tdefault:\n\t\t\treturn nil, errors.New(\"found unknown private key type in PKCS#8 wrapping\")\n\t\t}\n\t}\n\tif key, err := x509.ParseECPrivateKey(der); err == nil {\n\t\treturn key, nil\n\t}\n\n\treturn nil, errors.New(\"failed to parse private key\")\n}", "title": "" }, { "docid": "d8467a54643c1441ae1be0a3a6ba9366", "score": "0.5522009", "text": "func ParseCertificate(asn1Data []byte) (*Certificate, error) {\r\n\tvar cert certificate\r\n\trest, err := asn1.Unmarshal(asn1Data, &cert)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\tif len(rest) > 0 {\r\n\t\treturn nil, asn1.SyntaxError{Msg: \"trailing data\"}\r\n\t}\r\n\r\n\tvar result *x509.Certificate\r\n\tresult, err = parseCertificate(&cert)\r\n\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn &Certificate{*result}, nil\r\n}", "title": "" }, { "docid": "ea21e2c2baf16e79cf76d14747daaf33", "score": "0.5520477", "text": "func ParseEncodedPrivateKey(keyBase64 string, encoding Encoding) (key *rsa.PrivateKey, err error) {\n\tif encoding == nil {\n\t\tencoding = base64.StdEncoding\n\t}\n\n\tder, err := encoding.DecodeString(keyBase64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ParseDERPrivateKey(der)\n}", "title": "" }, { "docid": "0c38565999d96cc8fcc5598bb56ddedb", "score": "0.5515449", "text": "func (sig *Signature) ParseBytes(v []byte) {\n\tif len(v) != 64 {\n\t\tlog.Panic(\"Signature.ParseBytes requires 64 bytes\")\n\t}\n\tsig.R.SetBytes(v[0:32])\n\tsig.S.SetBytes(v[32:64])\n}", "title": "" }, { "docid": "0c38565999d96cc8fcc5598bb56ddedb", "score": "0.5515449", "text": "func (sig *Signature) ParseBytes(v []byte) {\n\tif len(v) != 64 {\n\t\tlog.Panic(\"Signature.ParseBytes requires 64 bytes\")\n\t}\n\tsig.R.SetBytes(v[0:32])\n\tsig.S.SetBytes(v[32:64])\n}", "title": "" }, { "docid": "1f52e95b54f456442a34fa35a1e65c97", "score": "0.55104005", "text": "func (a *AppleConfig) LoadP8CertByByte(str []byte) (err error) {\n\tblock, _ := pem.Decode(str)\n\tcert, err := x509.ParsePKCS8PrivateKey(block.Bytes)\n\tif err != nil {\n\t\treturn\n\t}\n\ta.AESCert = cert\n\treturn nil\n}", "title": "" }, { "docid": "2dac472d866089966122399ed20db247", "score": "0.5508857", "text": "func Parse(pks string) (algorithm Algorithm, sum []byte, err error) {\n\t// Determine the signature hash algorithm\n\tparts := strings.Split(pks, \":\")\n\tif len(parts) != 2 {\n\t\treturn UnknownSignatureAlgorithm, nil, errors.New(\"could not parse the signature hash algorithm\")\n\t}\n\n\talgorithm = ParseAlgorithm(parts[0])\n\tif algorithm == UnknownSignatureAlgorithm {\n\t\treturn UnknownSignatureAlgorithm, nil, errors.New(\"unknown signature hash algorithm\")\n\t}\n\n\tif sum, err = base64.RawStdEncoding.DecodeString(parts[1]); err != nil {\n\t\treturn UnknownSignatureAlgorithm, nil, errors.New(\"could not base64 decode the signature hash sum\")\n\t}\n\n\treturn algorithm, sum, nil\n}", "title": "" }, { "docid": "4cf006bee04ea4273d5e9e3fe782137b", "score": "0.5495562", "text": "func FromBytes(data []byte) (Certificates, error) {\n\n\tcs, err := DecodeCertificatesPEM(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn FromX509Certificates(cs), nil\n}", "title": "" }, { "docid": "95071be5b7a721bd78f359ae206b4e46", "score": "0.5493355", "text": "func loadPrivateKey(path string) (Signer, error) {return parsePrivateKey([]byte(`-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQCODpInJjTexIWIeaH51iKpLyfZ7u59WxJkja6aMzyRqrHQYmbz\nIgJ4ChHcg7yoj4vLmMvPYImQR/Dx0BRG0fxuKi8Javm8Vh4gJ2dRcwuz4rCpGRwM\njDHPl7NGY+YMcNFS/lghPfJDosThyBBMbq9K3QdJJ/xz7pfJsCpwJbbHzwIDAQAB\nAoGAPpvFZmO8YYITqDaTYN0zoYUa9z4K9kyxKogXL/bs9vZYMBNudDHFDMrDXIDj\nIRdC8ZSCHv/ZITHTy399sEjUC8CYLn5qqPRoALOcRXoFEMIxipSw6q3ir6VErmjn\nRQLB50mNrGJ/OyDIoTt6BTTs0YOPykD5I/Q+jY/ZfBcLFKECQQDUEPxblTswMHdQ\nDWPnIyfBsytP+Fqwiz/JYJYOBGhTJdnedFr7XtpEfpE4LwGX9OiKK4+sHtt1UP4L\nB+ufM1CDAkEAq3ycKE4jxoSj88Z5B8qHvUdCqsv94MdyoRVJ3V1aJQ2xZFbe069V\nX4SD7mbw3t02QNZIxlIMNnZkR95hEZBxxQJBAMSu6E9MjjO4j8BIWwLxwRrOwPoP\nnpUk4Uk1cpaXkeakMXg3tHZ1V7y1IpzYRAMam14i3sLFb8dUEfpLI0ZpQl8CQC13\nfG+zSAj6Yf3gQXavXA3zNtnR/B38w4ex/UOT3LK2TrIr1iiJ9Di/CbvLz1FHlXrb\nVbA/UL2f5jan31So14ECQF5Q0UonkL/oYXScIzhTQ4NBGSU5dn3mxtrrLk9/1TFq\nWcwVr40XHVtE/Yc5U46YNBF6kzQ0y0IEX3zDlqmXcBE=\n-----END RSA PRIVATE KEY-----`))\n}", "title": "" }, { "docid": "147c62b61d4a464ec60defe1ed794a74", "score": "0.54842496", "text": "func parseECPrivateKey(data []byte) (*ecdsa.PrivateKey, error) {\n\tvar err error\n\n\t// Parse the key\n\tvar parsedKey interface{}\n\tif parsedKey, err = x509.ParseECPrivateKey(data); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Test if parsed key is an ECDSA Private Key\n\tvar privKey *ecdsa.PrivateKey\n\tvar ok bool\n\tif privKey, ok = parsedKey.(*ecdsa.PrivateKey); !ok {\n\t\treturn nil, fmt.Errorf(\"data doesn't contain valid ECDSA Private Key\")\n\t}\n\n\treturn privKey, nil\n}", "title": "" }, { "docid": "b228b43fbc28ccd9a0cad608a182ea81", "score": "0.54826933", "text": "func ParseBase64PemCert(certPemBase64 string) (*x509.Certificate, error) {\n\tcertPEM, err := base64.StdEncoding.DecodeString(certPemBase64)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tblock, _ := pem.Decode([]byte(certPEM))\n\tif block == nil {\n\t\treturn nil, errors.New(\"failed to parse certificate PEM\")\n\t}\n\n\tcert, err := x509.ParseCertificate(block.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cert, nil\n}", "title": "" }, { "docid": "96c7f867ca89ba3530d623788c0adb2c", "score": "0.5478236", "text": "func UnmarshalPrivateKeyPem(in []byte, format KeyFormat) (*ecdsa.PrivateKey, error) {\n\tswitch format {\n\tcase KeyFormatASN1:\n\t\tblock, _ := pem.Decode(in)\n\t\tif block == nil {\n\t\t\treturn nil, errors.New(\"failed to find a PEM file in input\")\n\t\t}\n\n\t\tpKeyMaybe, err := x509.ParsePKCS8PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tpKey, ok := pKeyMaybe.(*ecdsa.PrivateKey)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"the encoded public key is not an ECDSA key\")\n\t\t}\n\n\t\treturn pKey, nil\n\tdefault:\n\t\treturn nil, ErrInvalidKeyFormat\n\t}\n}", "title": "" }, { "docid": "72b2d02514d9fffd42bad467dd41d1fa", "score": "0.5474883", "text": "func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error) {\n\tif len(raw) == 0 {\n\t\treturn nil, errors.New(\"Invalid PEM. It must be different from nil\")\n\t}\n\tblock, _ := pem.Decode(raw)\n\tif block == nil {\n\t\treturn nil, fmt.Errorf(\"Failed decoding PEM. Block must be different from nil. [% x]\", raw)\n\t}\n\n\t// TODO: derive from header the type of the key\n\n\tif x509.IsEncryptedPEMBlock(block) {\n\t\tif len(pwd) == 0 {\n\t\t\treturn nil, errors.New(\"Encrypted Key. Need a password\")\n\t\t}\n\n\t\tif block.Type == \"SM2 PRIVATE KEY\" {\n\t\t\tdecrypted, err := SM4DecryptPEMBlock(block, pwd)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"Failed PEM decryption [%s]\", err)\n\t\t\t}\n\n\t\t\tkey, err := ParseSM2PrivateKey(decrypted)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn key, err\n\t\t}\n\n\t\tdecrypted, err := x509.DecryptPEMBlock(block, pwd)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed PEM decryption [%s]\", err)\n\t\t}\n\n\t\tkey, err := DERToPrivateKey(decrypted)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn key, err\n\t}\n\n\tif block.Type == \"SM2 PRIVATE KEY\" {\n\t\tcert, err := ParsePKCS8SM2PrivateKey(block.Bytes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn cert, err\n\t}\n\n\tcert, err := DERToPrivateKey(block.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn cert, err\n}", "title": "" }, { "docid": "197931d4d2877d5990d90ed5f46d8029", "score": "0.54501456", "text": "func ParseKey(key []byte) (*rsa.PrivateKey, error) {\n\tblock, _ := pem.Decode(key)\n\tif block != nil {\n\t\tkey = block.Bytes\n\t}\n\tparsedKey, err := x509.ParsePKCS8PrivateKey(key)\n\tif err != nil {\n\t\tparsedKey, err = x509.ParsePKCS1PrivateKey(key)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"private key should be a PEM or plain PKCS1 or PKCS8: %w\", err)\n\t\t}\n\t}\n\tparsed, ok := parsedKey.(*rsa.PrivateKey)\n\tif !ok {\n\t\treturn nil, errors.New(\"private key is invalid\")\n\t}\n\treturn parsed, nil\n}", "title": "" }, { "docid": "7c4a7ee8fcea849b324e0eeded791535", "score": "0.544803", "text": "func CertBytes(bytes []byte, password string) (tls.Certificate, error) {\n\tcert, err := certificate.FromP12Bytes(bytes, password)\n\tif err != nil {\n\t\tcert, err = certificate.FromPemBytes(bytes, password)\n\t}\n\treturn cert, err\n}", "title": "" }, { "docid": "01096c565eec442e20de701efa6fe1ff", "score": "0.54472935", "text": "func x509KeyPair(certPEMBlock, keyPEMBlock []byte) (cert tls.Certificate, err error) {\n\tvar certDERBlock *pem.Block\n\tfor {\n\t\tcertDERBlock, certPEMBlock = pem.Decode(certPEMBlock)\n\t\tif certDERBlock == nil {\n\t\t\tbreak\n\t\t}\n\t\t// parse certificates\n\t\tcerts, err2 := x509.ParseCertificates(certDERBlock.Bytes)\n\t\tif err2 == nil {\n\t\t\t// assign the Leaf\n\t\t\tcert.Leaf = certs[0]\n\n\t\t\tfor _, c := range certs {\n\t\t\t\tif !isValid(c) {\n\t\t\t\t\terr = errors.New(\"Certificate is expired\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tif certDERBlock.Type == \"CERTIFICATE\" {\n\t\t\tcert.Certificate = append(cert.Certificate, certDERBlock.Bytes)\n\t\t}\n\t}\n\n\tif len(cert.Certificate) == 0 {\n\t\terr = errors.New(\"crypto/tls: failed to parse certificate PEM data\")\n\t\treturn\n\t}\n\n\tkeyDERBlock, _ := pem.Decode(keyPEMBlock)\n\tif keyDERBlock == nil {\n\t\terr = errors.New(\"crypto/tls: failed to parse key PEM data\")\n\t\treturn\n\t}\n\n\t// OpenSSL 0.9.8 generates PKCS#1 private keys by default, while\n\t// OpenSSL 1.0.0 generates PKCS#8 keys. We try both.\n\tvar key *rsa.PrivateKey\n\tif key, err = x509.ParsePKCS1PrivateKey(keyDERBlock.Bytes); err != nil {\n\t\tvar privKey interface{}\n\t\tif privKey, err = x509.ParsePKCS8PrivateKey(keyDERBlock.Bytes); err != nil {\n\t\t\terr = errors.New(\"crypto/tls: failed to parse key: \" + err.Error())\n\t\t\treturn\n\t\t}\n\n\t\tvar ok bool\n\t\tif key, ok = privKey.(*rsa.PrivateKey); !ok {\n\t\t\terr = errors.New(\"crypto/tls: found non-RSA private key in PKCS#8 wrapping\")\n\t\t\treturn\n\t\t}\n\t}\n\tcert.PrivateKey = key\n\treturn\n}", "title": "" }, { "docid": "1e3853bdca38f3b7f511f66e89698192", "score": "0.5447057", "text": "func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error) {\n\tblock, _ := pem.Decode([]byte(privPEM))\n\tif block == nil {\n\t\treturn nil, errors.New(\"failed to parse PEM block containing the key\")\n\t}\n\n\tpriv, err := x509.ParsePKCS1PrivateKey(block.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn priv, nil\n}", "title": "" }, { "docid": "f32635704422c9175346d82f7ec7766e", "score": "0.5444175", "text": "func (car CredentialAssertionResponse) Parse() (par *ParsedCredentialAssertionData, err error) {\n\tif car.ID == \"\" {\n\t\treturn nil, ErrBadRequest.WithDetails(\"CredentialAssertionResponse with ID missing\")\n\t}\n\n\tif _, err = base64.RawURLEncoding.DecodeString(car.ID); err != nil {\n\t\treturn nil, ErrBadRequest.WithDetails(\"CredentialAssertionResponse with ID not base64url encoded\")\n\t}\n\n\tif car.Type != \"public-key\" {\n\t\treturn nil, ErrBadRequest.WithDetails(\"CredentialAssertionResponse with bad type\")\n\t}\n\n\tvar attachment AuthenticatorAttachment\n\n\tswitch car.AuthenticatorAttachment {\n\tcase \"platform\":\n\t\tattachment = Platform\n\tcase \"cross-platform\":\n\t\tattachment = CrossPlatform\n\t}\n\n\tpar = &ParsedCredentialAssertionData{\n\t\tParsedPublicKeyCredential{\n\t\t\tParsedCredential{car.ID, car.Type}, car.RawID, car.ClientExtensionResults, attachment,\n\t\t},\n\t\tParsedAssertionResponse{\n\t\t\tSignature: car.AssertionResponse.Signature,\n\t\t\tUserHandle: car.AssertionResponse.UserHandle,\n\t\t},\n\t\tcar,\n\t}\n\n\t// Step 5. Let JSONtext be the result of running UTF-8 decode on the value of cData.\n\t// We don't call it cData but this is Step 5 in the spec.\n\tif err = json.Unmarshal(car.AssertionResponse.ClientDataJSON, &par.Response.CollectedClientData); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = par.Response.AuthenticatorData.Unmarshal(car.AssertionResponse.AuthenticatorData); err != nil {\n\t\treturn nil, ErrParsingData.WithDetails(\"Error unmarshalling auth data\")\n\t}\n\n\treturn par, nil\n}", "title": "" }, { "docid": "938c7cc5b029a1aa997aca5f89e502a0", "score": "0.5441714", "text": "func ParseKey(data string) ([]byte, bool, error) {\n\ts := strings.TrimSpace(string(data))\n\tif strings.HasPrefix(s, taggedPrivate) {\n\t\th, err := hex.DecodeString(s[len(taggedPrivate):])\n\t\tif err != nil {\n\t\t\treturn []byte{}, false, err\n\t\t}\n\t\tif len(h) != privateLength {\n\t\t\treturn []byte{}, false, fault.InvalidPrivateKey\n\t\t}\n\t\treturn h, true, nil\n\t} else if strings.HasPrefix(s, taggedPublic) {\n\t\th, err := hex.DecodeString(s[len(taggedPublic):])\n\t\tif err != nil {\n\t\t\treturn []byte{}, false, err\n\t\t}\n\t\tif len(h) != publicLength {\n\t\t\treturn []byte{}, false, fault.InvalidPublicKey\n\t\t}\n\t\treturn h, false, nil\n\t}\n\n\treturn []byte{}, false, fault.InvalidPublicKey\n}", "title": "" }, { "docid": "0d38769c11e44bb64e712a222f742546", "score": "0.54239357", "text": "func CertificateFromPEM(pemBytes []byte) (*x509.Certificate, error) {\n\tblock, rest := pem.Decode(pemBytes)\n\tif len(rest) != 0 {\n\t\treturn nil, errors.New(\"trailing data found after PEM block\")\n\t}\n\tif block == nil {\n\t\treturn nil, errors.New(\"PEM block is nil\")\n\t}\n\tif block.Type != \"CERTIFICATE\" {\n\t\treturn nil, errors.New(\"PEM block is not a CERTIFICATE\")\n\t}\n\treturn x509.ParseCertificate(block.Bytes)\n}", "title": "" }, { "docid": "b1dc368ef585aa54dd1a634a6ee8c360", "score": "0.5414599", "text": "func parseRawX509Certificates(raw [][]byte) ([]*x509.Certificate, error) {\n\tres := []*x509.Certificate{}\n\n\t// Iterate on all raw certificates\n\tfor _, data := range raw {\n\t\t// To parse them\n\t\tk, err := x509.ParseCertificate(data)\n\t\tif err != nil {\n\t\t\treturn nil, ErrorParsingPublicKey\n\t\t}\n\n\t\t// And append the parse certificate to the result array\n\t\tres = append(res, k)\n\t}\n\n\treturn res, nil\n}", "title": "" }, { "docid": "811e017c3059733c2c1983360d123849", "score": "0.5410104", "text": "func parsePublicKey(publicKey []byte) (*rsa.PublicKey, error) {\n\tdecoded, _ := pem.Decode(publicKey)\n\tif decoded == nil {\n\t\treturn nil, errors.New(\"public key error\")\n\t}\n\tpubkey, err := x509.ParsePKIXPublicKey(decoded.Bytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pubkey.(*rsa.PublicKey), nil\n}", "title": "" }, { "docid": "c632240fad170adce9052b4cf5ffa14d", "score": "0.54078513", "text": "func GetCertificatePEM(prefix string, host string) ([]byte, []byte, error) {\n\n\tstorageDir := path.Join(GetRosieDir(), certsDirName, prefix)\n\tif _, err := os.Stat(storageDir); os.IsNotExist(err) {\n\t\treturn nil, nil, err\n\t}\n\n\thost = path.Base(host)\n\tcertFileName := fmt.Sprintf(\"%s-cert.pem\", host)\n\tkeyFileName := fmt.Sprintf(\"%s-key.pem\", host)\n\n\tcertFilePath := path.Join(storageDir, certFileName)\n\tkeyFilePath := path.Join(storageDir, keyFileName)\n\n\tcertPEM, err := ioutil.ReadFile(certFilePath)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to load %v\", err)\n\t\treturn nil, nil, err\n\t}\n\n\tkeyPEM, err := ioutil.ReadFile(keyFilePath)\n\tif err != nil {\n\t\tlog.Printf(\"Failed to load %v\", err)\n\t\treturn nil, nil, err\n\t}\n\n\treturn certPEM, keyPEM, nil\n}", "title": "" }, { "docid": "73feedd9fb7980dc9de32999f5633ffd", "score": "0.53926975", "text": "func SplitPEM(pemData []byte) (certPEM []byte, keyPEM []byte, err error) {\n\tblock, rest := pem.Decode(pemData)\n\tfor block != nil {\n\t\tswitch block.Type {\n\t\tcase constants.CertificatePEMBlock:\n\t\t\tcertPEM = pem.EncodeToMemory(block)\n\t\tcase constants.RSAPrivateKeyPEMBlock:\n\t\t\tkeyPEM = pem.EncodeToMemory(block)\n\t\t}\n\t\tblock, rest = pem.Decode(rest)\n\t}\n\tif len(certPEM) == 0 || len(keyPEM) == 0 {\n\t\treturn nil, nil, trace.BadParameter(\"cert or key PEM data is missing\")\n\t}\n\treturn certPEM, keyPEM, nil\n}", "title": "" }, { "docid": "942ea02375c1ab8d09881f563bd7491e", "score": "0.5389797", "text": "func ParsePEMPrivateKey(path string) (crypto.PrivateKey, error) {\n\taccountKeyPEM, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\tlog.Fatal(\"failed to read account key:\", err)\n\t}\n\n\tblock, _ := pem.Decode(accountKeyPEM)\n\tif block == nil {\n\t\tlog.Fatal(\"bad account key data, not PEM encoded:\", err)\n\t}\n\n\tif block.Type == \"RSA PRIVATE KEY\" {\n\t\treturn x509.ParsePKCS1PrivateKey(block.Bytes)\n\t}\n\n\treturn x509.ParseECPrivateKey(block.Bytes)\n}", "title": "" }, { "docid": "55612f146057326dc50fa5dfe52e21a2", "score": "0.5389043", "text": "func (info *CommitteeInfo) ParseCertificate() (*x509.Certificate, error) {\n\treturn x509.ParseCertificate(info.Certificate)\n}", "title": "" }, { "docid": "5e4039facc9364af5c2597756008525a", "score": "0.5384314", "text": "func (s Secp256k1) PrivKeyFromBytes(data []byte) crypto.PrivKey {\n\tpvtkey, err := underlyingSecp256k1.UnmarshalSecp256k1PrivateKey(data)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn pvtkey\n}", "title": "" }, { "docid": "d3fc57530cb74e07824773e592aa6241", "score": "0.5382975", "text": "func loadPrivateKey(data []byte) (crypto.PrivateKey, error) {\n\tinput := data\n\n\tblock, _ := pem.Decode(data)\n\tif block != nil {\n\t\tinput = block.Bytes\n\t}\n\n\tvar priv interface{}\n\tpriv, err0 := x509.ParsePKCS1PrivateKey(input)\n\tif err0 == nil {\n\t\treturn priv, nil\n\t}\n\n\tpriv, err1 := x509.ParsePKCS8PrivateKey(input)\n\tif err1 == nil {\n\t\treturn priv, nil\n\t}\n\n\tpriv, err2 := x509.ParseECPrivateKey(input)\n\tif err2 == nil {\n\t\treturn priv, nil\n\t}\n\n\treturn nil, fmt.Errorf(\"unable to parse private key data: '%s', '%s' and '%s'\", err0, err1, err2)\n}", "title": "" }, { "docid": "47a597bec4150915ec1c9421e3d41977", "score": "0.53792256", "text": "func decodePKCS12(value string) (content string, err error) {\n\tpfxRaw, err := base64.StdEncoding.DecodeString(value)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// using ToPEM to extract more than one certificate and key in pfxData\n\tpemBlock, err := pkcs12.ToPEM(pfxRaw, \"\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar pemKeyData, pemCertData, pemData []byte\n\tfor _, block := range pemBlock {\n\t\t// PEM block encoded form contains the headers\n\t\t// -----BEGIN Type-----\n\t\t// Headers\n\t\t// base64-encoded Bytes\n\t\t// -----END Type-----\n\t\t// Setting headers to nil to ensure no headers included in the encoded block\n\t\tblock.Headers = make(map[string]string)\n\t\tif block.Type == certificateType {\n\t\t\tpemCertData = append(pemCertData, pem.EncodeToMemory(block)...)\n\t\t} else {\n\t\t\tkey, err := parsePrivateKey(block.Bytes)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\t// pkcs1 RSA private key PEM file is specific for RSA keys. RSA is not used exclusively inside X509\n\t\t\t// and SSL/TLS, a more generic key format is available in the form of PKCS#8 that identifies the type\n\t\t\t// of private key and contains the relevant data.\n\t\t\t// Converting to pkcs8 private key as ToPEM uses pkcs1\n\t\t\t// The driver determines the key type from the pkcs8 form of the key and marshals appropriately\n\t\t\tblock.Bytes, err = x509.MarshalPKCS8PrivateKey(key)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tpemKeyData = append(pemKeyData, pem.EncodeToMemory(block)...)\n\t\t}\n\t}\n\n\t// construct the pem chain in the order\n\t// SERVER, INTERMEDIATE, ROOT\n\tif *ConstructPEMChain {\n\t\tpemCertData, err = fetchCertChains(pemCertData)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\n\tpemData = append(pemData, pemKeyData...)\n\tpemData = append(pemData, pemCertData...)\n\treturn string(pemData), nil\n}", "title": "" }, { "docid": "572822bb03b97f67205f5ed492e53bdf", "score": "0.53665", "text": "func PrivKeyFromBytes(privKeyBytes []byte) (privKey tmcrypto.PrivKey, err error) {\n\terr = cdc.UnmarshalBinaryBare(privKeyBytes, &privKey)\n\treturn\n}", "title": "" }, { "docid": "f36ba0096e5f226c5f0926333ffa423e", "score": "0.53550607", "text": "func PEMDecode(pemBytes []byte, mode string) []byte {\n\tif mode != PEMTypePrivateKey && mode != PEMTypePublicKey && mode != PEMTypeCertificate {\n\t\treturn nil\n\t}\n\tp, _ := pem.Decode(pemBytes)\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Bytes\n}", "title": "" }, { "docid": "9e13275bc89ce875805b2d6689e580a5", "score": "0.53542286", "text": "func PrivKeyFromBytes(pk []byte) (*ecdsa.PrivateKey,\n\t*ecdsa.PublicKey) {\n\tcurve := elliptic.P256()\n\tx, y := curve.ScalarBaseMult(pk)\n\n\tpriv := &ecdsa.PrivateKey{\n\t\tPublicKey: ecdsa.PublicKey{\n\t\t\tCurve: elliptic.P256(),\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t},\n\t\tD: new(big.Int).SetBytes(pk),\n\t}\n\n\treturn priv, &priv.PublicKey\n}", "title": "" }, { "docid": "d916ed4f62354ce399970fd18d8551d1", "score": "0.53490466", "text": "func ParsePrivateKeyString(block string) (PrivateKey, error) {\n\treturn ParsePrivateKey([]byte(block))\n}", "title": "" } ]
90a40a2d808e2e6e74c0922521128af2
Opposite returns the opposite color. If the color is unknown or empty, just return the same color.
[ { "docid": "dcedf72d9e03772cb4378db46103488e", "score": "0.8022881", "text": "func (c Color) Opposite() Color {\n\tif c == Black {\n\t\treturn White\n\t} else if c == White {\n\t\treturn Black\n\t}\n\tfmt.Println()\n\tfmt.Println(\"Test printout edit after restart 06? for github\" +\n\t\t\" linkup\")\n\treturn c\n}", "title": "" } ]
[ { "docid": "12481499ea62f07354194e6b8ae83703", "score": "0.6639707", "text": "func (b *BoardState) isSquareOppositeColor(position int, c colorType) (bool, bool) {\n\tif !b.isSquareEmpty(position) {\n\t\tif b.squares[position].piecePointer.color != c {\n\t\t\treturn true, true\n\t\t} else {\n\t\t\treturn false, true\n\t\t}\n\t}\n\treturn false, false\n}", "title": "" }, { "docid": "85f8c3b00f9169b6f075d23dc4c1c443", "score": "0.6345533", "text": "func (gdt *Color) Inverted() Color {\n\targ0 := gdt.getBase()\n\n\tret := C.go_godot_color_inverted(GDNative.api, arg0)\n\n\treturn Color{base: &ret}\n\n}", "title": "" }, { "docid": "c224c29e5fb765b663a2614ed921ae18", "score": "0.6235903", "text": "func NoColor(noColor bool) {\n\tcolor.NoColor = noColor\n}", "title": "" }, { "docid": "335eb82974756c253b2e90b4ddd19239", "score": "0.6165084", "text": "func Invert(colour color.RGBA) color.RGBA {\n\tif colour.A == 0 {\n\t\treturn color.RGBA{}\n\t}\n\n\treturn color.RGBA{\n\t\tR: 255 - colour.R,\n\t\tG: 255 - colour.G,\n\t\tB: 255 - colour.B,\n\t\tA: colour.A,\n\t}\n}", "title": "" }, { "docid": "f96afb0e40113aa7944548e59e490255", "score": "0.59900707", "text": "func Invert(color string) (string, bool) {\n\tswitch color {\n\tcase Base03:\n\t\treturn Base3, true\n\tcase Base02:\n\t\treturn Base2, true\n\tcase Base01:\n\t\treturn Base1, true\n\tcase Base00:\n\t\treturn Base0, true\n\tcase Base0:\n\t\treturn Base00, true\n\tcase Base1:\n\t\treturn Base01, true\n\tcase Base2:\n\t\treturn Base02, true\n\tcase Base3:\n\t\treturn Base03, true\n\t}\n\n\treturn color, false\n}", "title": "" }, { "docid": "a69c5ec74fcd5c1112b68cdaa1801dc9", "score": "0.5938084", "text": "func InverseRed(text interface{}) string {\n\treturn makeString(inverse, text, red)\n}", "title": "" }, { "docid": "359b8743091025dc1fdb8139495c8815", "score": "0.59111935", "text": "func (c RGBA) WithoutAlpha() RGB {\n\treturn RGB{R: c.R, G: c.G, B: c.B}\n}", "title": "" }, { "docid": "47c5910d77c007b7cfdecb17c32100cb", "score": "0.5822719", "text": "func (c Color) Subtract(other Color) Color {\n\treturn Color{c.tuple.Subtract(other.tuple)}\n}", "title": "" }, { "docid": "abde29b3fd2e4784ff3000fcd48a58ef", "score": "0.58059853", "text": "func Inverse(arg interface{}) Value {\n\tif val, ok := arg.(value); ok {\n\t\tval.color |= InverseFm\n\t\treturn val\n\t}\n\treturn value{arg, InverseFm, 0}\n}", "title": "" }, { "docid": "61d8f89699f220cff200f037e25acb93", "score": "0.57649565", "text": "func (pixelColor *PixelColor) RemoveNegativeColors() {\n\tif pixelColor.R < 0 {\n\t\tpixelColor.R = 0\n\t}\n\tif pixelColor.B < 0 {\n\t\tpixelColor.B = 0\n\t}\n\tif pixelColor.G < 0 {\n\t\tpixelColor.G = 0\n\t}\n}", "title": "" }, { "docid": "f85fa9d73f238235719146070580361c", "score": "0.5755742", "text": "func (me TLinearReferencingDirectionEnum) IsOpposite() bool { return me.String() == \"opposite\" }", "title": "" }, { "docid": "89b09791721e1174651198c94738b243", "score": "0.57497334", "text": "func InverseBlue(text interface{}) string {\n\treturn makeString(inverse, text, blue)\n}", "title": "" }, { "docid": "83e15b9f9973b9cf2db9cfd34a15185e", "score": "0.5627665", "text": "func (c *Color) DisableColor() {\n\tc.noColor = boolPtr(true)\n}", "title": "" }, { "docid": "582ccc2593071130dafaaca3f05d42e5", "score": "0.5586402", "text": "func InverseBlack(text interface{}) string {\n\treturn makeString(inverse, text, black)\n}", "title": "" }, { "docid": "3e2c726b2fa2e78d8bd07dd2566329ce", "score": "0.5580602", "text": "func (r RGBA) Inverted() RGBA {\n\tr.R = 1 - r.R\n\tr.G = 1 - r.G\n\tr.B = 1 - r.B\n\treturn r\n}", "title": "" }, { "docid": "09b11a740654635855863795c72f05a2", "score": "0.55590403", "text": "func (me TDirectionEnum) IsOpposite() bool { return me.String() == \"opposite\" }", "title": "" }, { "docid": "c9f3a0974a69fac0d594403caefa13a9", "score": "0.55211264", "text": "func orOpposite(out string) string {\n\tif out == \"\" {\n\t\tfmt.Println(\"not computing\")\n\t\treturn \"\"\n\t}\n\tvar aux string\n\tcharToCheck := rune(out[len(out)-1])\n\tif unicode.IsLower(charToCheck){\n\t\taux = reverse(out)\n\t\taux = strings.Replace(aux, string(charToCheck), string(unicode.ToUpper(charToCheck)), 1)\n\t} else {\n\t\taux = reverse(out)\n\t\taux = strings.Replace(aux, string(charToCheck), string(unicode.ToLower(charToCheck)), 1)\t\t\n\t}\n\tretVal := reverse(aux)\n\treturn retVal\n}", "title": "" }, { "docid": "d51638b97a20833ae0fd7700cd33ae93", "score": "0.5517381", "text": "func NoTaboo(board ClickBoard) (chaingame.Color, Mode) {\n\t_ = board\n\treturn chaingame.NoColor, PerSampling\n}", "title": "" }, { "docid": "21dd370f42033234638ca46262284c97", "score": "0.55120087", "text": "func (whiteboard *Whiteboard) Invert() {\n\n\tdata := whiteboard.Serialize()\n\n\tcolors := []rl.Color{}\n\n\tfor i := len(data) - 1; i >= 0; i-- {\n\t\togData, _ := base64.StdEncoding.DecodeString(data[i])\n\t\tfor _, value := range ogData {\n\t\t\tif value == 1 {\n\t\t\t\tcolors = append(colors, whiteboard.Colors[0])\n\t\t\t} else if value == 0 {\n\t\t\t\tcolors = append(colors, whiteboard.Colors[1])\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\trl.UpdateTexture(whiteboard.Texture.Texture, colors)\n\n\twhiteboard.Task.UndoChange = true\n\n}", "title": "" }, { "docid": "24552b1e6274be888926a0248a5461fb", "score": "0.5507497", "text": "func InverseYellow(text interface{}) string {\n\treturn makeString(inverse, text, yellow)\n}", "title": "" }, { "docid": "0cda639b6f7428f847fb3aa271e13bd1", "score": "0.54661304", "text": "func InverseGreen(text interface{}) string {\n\treturn makeString(inverse, text, green)\n}", "title": "" }, { "docid": "3e65d616211d84cb499e67a47e27a2ef", "score": "0.5451971", "text": "func (u Int256) Neg() (z Int256) {\n\tz.Hi = u.Hi.Neg()\n\tz.Lo.Lo = -u.Lo.Lo\n\tz.Lo.Hi = -u.Lo.Hi\n\t// TODO, I'm not sure here.\n\tif z.Lo.Hi > 0 || z.Lo.Lo > 0 {\n\t\tz.Hi.Lo--\n\t}\n\treturn z\n}", "title": "" }, { "docid": "7fb392d09e5a0628bbad558c47761c8c", "score": "0.5451932", "text": "func (o *Output) DisableColor() *Output {\n\to.setting.Color = false\n\treturn o\n}", "title": "" }, { "docid": "02d8b5d438013e0a76f538fc828e5849", "score": "0.54517305", "text": "func FlipColor(nd *Node) {\n\t// nd is parent node\n\tnd.Black = !nd.Black\n\tnd.Left.Black = !nd.Left.Black\n\tnd.Right.Black = !nd.Right.Black\n}", "title": "" }, { "docid": "5d6dfa321f7875e51de08b70df34fc6a", "score": "0.54205775", "text": "func (c *Color) Subtract(c2 Color) *Color {\n\tc.Red = c.Red - c2.Red\n\tc.Green = c.Green - c2.Green\n\tc.Blue = c.Blue - c2.Blue\n\treturn c\n}", "title": "" }, { "docid": "a1d4a9487122dc3e94ae9079ab96b577", "score": "0.5407335", "text": "func opposite(s Side) Side {\n\treturn arrOpposite[s]\n}", "title": "" }, { "docid": "b66eb7bd73f84f8b48ef9a333ee0c461", "score": "0.5353377", "text": "func ImageColorInvert(image *Image) {\n\timage.ColorInvert()\n}", "title": "" }, { "docid": "2fe2d50fc22a584258d8c59911873886", "score": "0.53319776", "text": "func WithoutColours() Option {\n\treturn func(c *Conf) {\n\t\tc.colour = false\n\t}\n}", "title": "" }, { "docid": "aab72724b1281fba0fa1896b455544b0", "score": "0.53132707", "text": "func Subtract(c1, c2 Color) *Color {\n\treturn &Color{\n\t\tRed: c1.Red - c2.Red,\n\t\tGreen: c1.Green - c2.Green,\n\t\tBlue: c1.Blue - c2.Blue,\n\t}\n}", "title": "" }, { "docid": "1ca6850cdcb01f1e104cae10a26ed4b0", "score": "0.5308296", "text": "func (w *Writer) NoColor() {\n\tif !w.s.nocolor {\n\t\tif w.s.bg|w.s.fg|w.s.intensity != 0 {\n\t\t\tw.ForceReset()\n\t\t}\n\t\tw.s.nocolor = true\n\t}\n}", "title": "" }, { "docid": "160c5128938a60c44da9254a199b4c14", "score": "0.52935594", "text": "func (*Log) NoColor() {\n\tcolor.NoColor = true\n}", "title": "" }, { "docid": "c3048c2cc972cbe5fcd3fe2ea5528a41", "score": "0.5288442", "text": "func Clipping(color float64) float64 {\n\tif color > 255 {\n\t\tcolor = 255\n\t} else if color < 0 {\n\t\tcolor = 0\n\t}\n\treturn color\n}", "title": "" }, { "docid": "29e02cc3599339b74bc7f60094a35faa", "score": "0.5286493", "text": "func DisableColors() {\n\treset = \"\"\n\tred = \"\"\n\tgreen = \"\"\n\tyellow = \"\"\n\tblue = \"\"\n\tpurple = \"\"\n\tcyan = \"\"\n\tgray = \"\"\n\twhite = \"\"\n}", "title": "" }, { "docid": "114e28c1b0aaf94ed0ebaed01089f90a", "score": "0.52760047", "text": "func (me TCarriagewayEnum) IsOppositeCarriageway() bool { return me.String() == \"oppositeCarriageway\" }", "title": "" }, { "docid": "ecc672f3a5dcc9304e87306ebee4d1f4", "score": "0.52376616", "text": "func (image *Image) ColorInvert() {\n\tcimage := image.cptr()\n\tC.ImageColorInvert(cimage)\n}", "title": "" }, { "docid": "dcf912eadd1e610e8e21dd2ea1ad4f26", "score": "0.5221449", "text": "func Black(str string) string {\n\tvar r = black + str + noColor\n\n\treturn r\n}", "title": "" }, { "docid": "c8b4880ac578b3bd28ce766bf81fd415", "score": "0.5201512", "text": "func Black(arg interface{}) Value {\n\tif val, ok := arg.(value); ok {\n\t\tval.color = (val.color & (^maskFg)) | BlackFg\n\t\treturn val\n\t}\n\treturn value{arg, BlackFg, 0}\n}", "title": "" }, { "docid": "cdce6b9244808b0dceb7232a8e087039", "score": "0.5196243", "text": "func InvertPalette(palette Palette) Palette {\n\tinvertedPalette := Palette{}\n\n\tfor key, value := range palette {\n\t\tcolor, _ := Invert(value)\n\t\tinvertedPalette[key] = color\n\t}\n\n\treturn invertedPalette\n}", "title": "" }, { "docid": "fae848aa8bb273b743e835e658161b61", "score": "0.5168152", "text": "func (s Side) Opposite() Side {\n\tif s == SideBUY {\n\t\treturn SideSELL\n\t}\n\treturn SideBUY\n}", "title": "" }, { "docid": "12b331d1312eb7beaf5d34b41a5d6ad0", "score": "0.5155929", "text": "func (u undef) ClearColor(red float32, green float32, blue float32, alpha float32) {\n\tpanic(\"not implemented\") // TODO: Implement\n}", "title": "" }, { "docid": "c97b9bb11019290097a87785ee069374", "score": "0.51455486", "text": "func DisableColor() {\n\tmessageColors = map[messageLevel]string{\n\t\tfatal: \"\",\n\t\terror: \"\",\n\t\twarn: \"\",\n\t\tinfo: \"\",\n\t}\n\tcolorReset = \"\"\n}", "title": "" }, { "docid": "f55bccd2a382d20f777f517804dc0fcd", "score": "0.51154625", "text": "func BlackString(format string, a ...interface{}) string { return colorString(format, FgBlack, a...) }", "title": "" }, { "docid": "1d73c43dcf5446db319d4217e7803edc", "score": "0.50984395", "text": "func Reverse(img image.Image) image.Image {\n\tbounds := img.Bounds()\n\tw, h := bounds.Max.X, bounds.Max.Y\n\tnewRgba := image.NewRGBA(bounds)\n\tfor x := 0; x < w; x++ {\n\t\tfor y := 0; y < h; y++ {\n\t\t\timageColor := img.At(x, y)\n\t\t\trr, gg, bb, aa := imageColor.RGBA()\n\t\t\tr := uint8(255 - (rr >> 8))\n\t\t\tg := uint8(255 - (gg >> 8))\n\t\t\tb := uint8(255 - (bb >> 8))\n\t\t\ta := uint8(aa >> 8)\n\t\t\tnewRgba.SetRGBA(x, y, color.RGBA{R: r, G: g, B: b, A: a})\n\t\t}\n\t}\n\treturn newRgba\n}", "title": "" }, { "docid": "84ef1326a733cbd08fb4832fe4e9a461", "score": "0.5040024", "text": "func (board *Board) getCurrColour() Colour {\n\tswitch board.currTurn {\n\tcase 0:\n\t\treturn Black\n\n\tcase 1:\n\t\treturn White\n\n\tdefault:\n\t\tpanic(\"Unexpected turn value\")\n\t}\n}", "title": "" }, { "docid": "c1d9c1c641d13a89d4efc3301e25fb23", "score": "0.50084573", "text": "func DisableColors(disable bool) {\n\tplain = disable\n}", "title": "" }, { "docid": "9f7409610b69f1b2cb21c11d797cfe7f", "score": "0.50001955", "text": "func (t *TileDefStyle) GetPaletteFlip() string {\n\tif t == nil || t.PaletteFlip == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.PaletteFlip\n}", "title": "" }, { "docid": "daf9aeb2d7a5cb63c5b3858e7b7b6bf3", "score": "0.49695212", "text": "func RGB2Negative(file io.Reader) (io.Reader, error) {\n\timg, _, err := image.Decode(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbounds := img.Bounds()\n\timgNeg := image.NewRGBA(bounds)\n\tfor x := 0; x < bounds.Max.X; x++ {\n\t\tfor y := 0; y < bounds.Max.Y; y++ {\n\t\t\tsrc := img.At(x, y)\n\t\t\tneg := negative(src)\n\t\t\timgNeg.Set(x, y, neg)\n\t\t}\n\t}\n\treturn util.ImageToReader(imgNeg)\n}", "title": "" }, { "docid": "eac362c75a83069024d6cdd72fe4d79e", "score": "0.49565402", "text": "func opposite(player Player) Player {\n\n\tif player == Computer {\n\t\treturn Human\n\t} else if player == Human {\n\t\treturn Computer\n\t} else {\n\t\treturn NoOne\n\t}\n\n}", "title": "" }, { "docid": "deb48272748e229e008f20c58b4c07f8", "score": "0.49336308", "text": "func TestBlackColor(t *testing.T) {\n\tc := color.NewHex(\"#000\")\n\te := NewHistEntry(c)\n\tvalid := ValidHue(*e)\n\tif valid {\n\t\tt.Fatalf(`ValidHue(\"#000\") = %v, want false`, valid)\n\t}\n}", "title": "" }, { "docid": "e2ceac0ff98cd6f00516ad057778d886", "score": "0.49193615", "text": "func NewFormatWithoutColor(tfmt func(time.Time) string, srcfmt, mfmt func(string) string) *Format {\n\treturn NewFormat(tfmt, srcfmt, mfmt, nil)\n}", "title": "" }, { "docid": "b3635e72337f4a4222531b9cac4bc2f4", "score": "0.49184206", "text": "func disableColors() {\n\tcheckup.DisableColor()\n}", "title": "" }, { "docid": "8fa165d6434779c68e0a08c798cdf315", "score": "0.4913292", "text": "func (color *Color) Sub(c *Color) *Color {\n\treturn &Color{\n\t\tcolor[0] - c[0],\n\t\tcolor[1] - c[1],\n\t\tcolor[2] - c[2],\n\t\tcolor[3] - c[3],\n\t}\n}", "title": "" }, { "docid": "f6da531c86172e0f1fbbf971fef58790", "score": "0.49128434", "text": "func (a V2) Neg() V2 {\n\treturn V2{-a.X, -a.Y}\n}", "title": "" }, { "docid": "16bfdffacb20ff3dde502723cd71ff33", "score": "0.4874681", "text": "func isBlack(col color.Color) bool {\n\treturn (col == color.RGBA{0, 0, 0, 255})\n}", "title": "" }, { "docid": "708187ee9e87ffda7339a87c1548f235", "score": "0.4874464", "text": "func getColor(n *Node) Color {\n\tif n == nil {\n\t\treturn BLACK\n\t}\n\treturn n.color\n}", "title": "" }, { "docid": "708187ee9e87ffda7339a87c1548f235", "score": "0.4874464", "text": "func getColor(n *Node) Color {\n\tif n == nil {\n\t\treturn BLACK\n\t}\n\treturn n.color\n}", "title": "" }, { "docid": "0ad6271cb95962cdcd5b460b19401dd8", "score": "0.48603952", "text": "func DefaultFormatWithoutColor() *Format {\n\tf := NewFormatWithoutColor(DefaultTimeFormat, DefaultSourceFormat, DefaultMessageFormat)\n\tf.CutPathWith(NewSource(1), 0)\n\treturn f\n}", "title": "" }, { "docid": "240ec2994d7902276b6756fdae6d7cc4", "score": "0.48298088", "text": "func BgBlack(arg interface{}) Value {\n\tif val, ok := arg.(value); ok {\n\t\tval.color = (val.color & (^maskBg)) | BlackBg\n\t\treturn val\n\t}\n\treturn value{arg, BlackBg, 0}\n}", "title": "" }, { "docid": "4ee030a50adf8d53a813cafe9b220123", "score": "0.48170513", "text": "func SetColorOff() {\n\tprivateMutex.Lock()\n\tdefer privateMutex.Unlock()\n\tcolor.NoColor = true\n}", "title": "" }, { "docid": "c676c640e94497419a0c451ab1667842", "score": "0.48122603", "text": "func darkBlend(z complex128) color.Color {\n\treturn draw.Blend(\n\t\tdraw.NewColorizer(green, mandelbrot.NewImageBuilder().SetMaxIterations(125).Build())(z),\n\t\tdraw.NewColorizer(blue, mandelbrot.NewImageBuilder().SetMaxIterations(250).Build())(z),\n\t\tdraw.NewColorizer(red, mandelbrot.NewImageBuilder().SetMaxIterations(500).Build())(z),\n\t)\n}", "title": "" }, { "docid": "74ef6e74d4a54e071ef5b7b15ec0eb92", "score": "0.47879544", "text": "func NewColor(s discord.Color) Color { return &s }", "title": "" }, { "docid": "33b3ed48bbd9c9a98e9ec5a63d309e6d", "score": "0.47610673", "text": "func (s *Style) GetPaletteFlip() bool {\n\tif s == nil || s.PaletteFlip == nil {\n\t\treturn false\n\t}\n\treturn *s.PaletteFlip\n}", "title": "" }, { "docid": "1b746f815842b6e52d767628a0a1baac", "score": "0.47601604", "text": "func (c *Color) Disable() {\r\n\tc.disabled = true\r\n}", "title": "" }, { "docid": "6b1a5149d279b28d70b68e416baaec4f", "score": "0.4757737", "text": "func (s Style) Decompose() (fg Color, bg Color, attr AttrMask) {\n\treturn Color((s >> 16) & 0xffff),\n\t\tColor(s & 0xfffff),\n\t\tAttrMask((s >> 32) & 0xffff)\n}", "title": "" }, { "docid": "2cbf18158adb84228ce7f572e9b83a2a", "score": "0.47539246", "text": "func (o *TextOutput) ColorOff() string {\n\tif !o.color {\n\t\treturn \"\"\n\t}\n\treturn \"\\033[0m\"\n}", "title": "" }, { "docid": "2dd351a187a24c695724c94c908e7314", "score": "0.47529966", "text": "func (n *Node) flipColors() {\n\t// Assumes: n has two children.\n\tn.Color = !n.Color\n\tn.Left.Color = !n.Left.Color\n\tn.Right.Color = !n.Right.Color\n}", "title": "" }, { "docid": "e54ad812ca797b9418eb191439ed5f4d", "score": "0.47223198", "text": "func OppositeOf(p *ast.Pattern) *ast.Pattern {\n\treturn ast.NewNot(p)\n}", "title": "" }, { "docid": "ab93ab016a042244874821aab73227ea", "score": "0.46940583", "text": "func (e Edge) GetColor() string {\n\tif e.color != \"\" {\n\t\treturn e.color\n\t}\n\n\treturn \"black\"\n}", "title": "" }, { "docid": "6dd573347517f157ad4bb209d9752254", "score": "0.46903992", "text": "func (l *Logger) DisableColors() {\n\tl.colorize = false\n}", "title": "" }, { "docid": "bacb294282e0d6d02a3ffeede357d4ce", "score": "0.46869007", "text": "func (e Edge) Reverse() Edge {\n\treturn Edge{e.V, e.U}\n}", "title": "" }, { "docid": "2b6c3c7ca6cd4c2850841e016e49133b", "score": "0.46833688", "text": "func Black(format string, a ...interface{}) string {\n\treturn NewFormatter(FOREGROUND+BLACK).format(format, a...)\n}", "title": "" }, { "docid": "a75a1d5a1caed49640a591338cec3210", "score": "0.4668715", "text": "func GetColor(a Anuncio) string {\n\treturn a.color\n}", "title": "" }, { "docid": "6c1948b319ccb8972382e9f297a1d032", "score": "0.46586353", "text": "func revertColorEscaping(value string) string {\n\tif value != \"\" {\n\t\tresult := strings.ReplaceAll(value, \"\\\\x1b\", \"\\x1b\")\n\t\tresult = strings.ReplaceAll(result, \"\\\\033\", \"\\x1b\")\n\t\treturn result\n\t}\n\treturn value\n}", "title": "" }, { "docid": "90a0c4acb9852184ccdbdd8053ff87f4", "score": "0.46570343", "text": "func (self Color) Modulate(color2 Color) Color {\n\treturn Color{C.sfColor_modulate(self.Cref, color2.Cref)}\n}", "title": "" }, { "docid": "ba5811938b1883047bf1098761f0bf16", "score": "0.46435365", "text": "func TabooColor(board ClickBoard) (chaingame.Color, Mode) {\n\n\ttaboo, max := chaingame.NoColor, 0.0\n\tfor c, n := range board.Histogram() {\n\t\tif n > max {\n\t\t\ttaboo, max = c, n\n\t\t}\n\t}\n\n\treturn taboo, PerSampling\n}", "title": "" }, { "docid": "88c03f98d693cdf50fe5c3970bb1bb2c", "score": "0.4636426", "text": "func flipPaint() func(string, string) string {\n\t// foregroundColor+attributes:backgroundColor+attributes\n\t// language=GoRegExp\n\tcolourExp := regexp.MustCompile(`\\w*\\+?\\w*:?(\\w*)\\+?\\w?`)\n\n\tflipped := func(currentPaint, nextPaint string) string {\n\t\tcurrentParts := colourExp.FindStringSubmatch(currentPaint)\n\t\tnextParts := colourExp.FindStringSubmatch(nextPaint)\n\n\t\tnewFg := \"default\"\n\t\tif len(currentParts) == 2 && currentParts[1] != \"\" {\n\t\t\tnewFg = currentParts[1]\n\t\t}\n\n\t\tnewBg := \"default\"\n\t\tif len(nextParts) == 2 && nextParts[1] != \"\" {\n\t\t\tnewBg = nextParts[1]\n\t\t}\n\n\t\treturn fmt.Sprintf(\"%s:%s\", newFg, newBg)\n\t}\n\n\treturn flipped\n}", "title": "" }, { "docid": "b5e76916cda6e574ee8e1373db897372", "score": "0.46297047", "text": "func InvertedBinaryPalette() color.Palette {\n\tif len(invertedBinaryPalette) == 0 {\n\t\tinvertedBinaryPalette = make(color.Palette, 256)\n\t\tinvertedBinaryPalette[0] = color.Alpha{0}\n\t\tfor i := 1; i < 255; i++ {\n\t\t\tinvertedBinaryPalette[i] = color.Alpha{255}\n\t\t}\n\t}\n\treturn invertedBinaryPalette\n}", "title": "" }, { "docid": "07c6c8eceb48e89b2f402aa891441a90", "score": "0.4629595", "text": "func Black(format string, a ...interface{}) { colorPrint(format, FgBlack, a...) }", "title": "" }, { "docid": "91264ce1848ec42fd809e4d36d2971f8", "score": "0.4627882", "text": "func (a V3) Neg() V3 {\n\treturn V3{-a.X, -a.Y, -a.Z}\n}", "title": "" }, { "docid": "cbf6fcbe16804694909551e3fb5e42f3", "score": "0.46122554", "text": "func (p Piece) Color() Color { return Color(p >> 3) }", "title": "" }, { "docid": "233eacf63979d1919cf0b360098237cf", "score": "0.46110559", "text": "func (_BBronze *BBronzeSession) GetColor() ([32]byte, error) {\n\treturn _BBronze.Contract.GetColor(&_BBronze.CallOpts)\n}", "title": "" }, { "docid": "d3cc967415899e12bcdb82d4f03855cc", "score": "0.4609619", "text": "func BlueColor(color uint16) uint8 {\n\treturn uint8((color & 0x7C00) >> 7)\n}", "title": "" }, { "docid": "5b74cd5136ee380d109e79fc126bb734", "score": "0.46025264", "text": "func (pg *GPPolygon) Reverse() {\n\tc := *pg.getContour()\n\tfor i := 0; i < len(c)/2; i++ { // swap points in place\n\t\tj := len(c) - i - 1\n\t\tc[i], c[j] = c[j], c[i]\n\t}\n}", "title": "" }, { "docid": "8324ce041582d618610effe64617d25d", "score": "0.46017087", "text": "func (c *CallstackOfColoredFunctions) PopBack() {\n\tif len(c.Stack) == 0 {\n\t\treturn\n\t}\n\n\tback := c.Stack[len(c.Stack)-1]\n\tc.Stack = c.Stack[:len(c.Stack)-1]\n\tdelete(c.IndexSet, back)\n\tc.ColorsChain = c.ColorsChain[:len(c.ColorsChain)-len(back.Function.Colors.Colors)]\n\tc.recalcMask(back, false)\n}", "title": "" }, { "docid": "4525d97b97306f692df957f6784fe079", "score": "0.45867455", "text": "func PopStyleColorV(count int) {\n\timgui.PopStyleColorV(count)\n}", "title": "" }, { "docid": "b4200a7350bab0bcdda85e84a3bf3c3b", "score": "0.458261", "text": "func GetMostUsedColor(frame *image.Paletted) color.Color {\n\tcolors := map[color.Color]int{}\n\tfor _, clr := range GetPixels(frame) {\n\t\tcolors[clr]++\n\t}\n\n\tif len(colors) == 0 {\n\t\tlog.Fatal(\"no colors\")\n\t}\n\n\t// Find the color with the most number of occurances\n\t// TODO: Sort might be better\n\tmaxCount := 0\n\tvar maxColor color.Color\n\tfor color, count := range colors {\n\t\tif count > maxCount {\n\t\t\tmaxCount = count\n\t\t\tmaxColor = color\n\t\t}\n\t}\n\treturn maxColor\n}", "title": "" }, { "docid": "0ab6a4de7729c6f082d37d7921d5e279", "score": "0.45819816", "text": "func NewNullableColor(v discord.Color) NullableColor {\n\treturn &NullableColorData{\n\t\tVal: v,\n\t\tInit: true,\n\t}\n}", "title": "" }, { "docid": "37affbe8c34d046e437dbe4d98517d58", "score": "0.457445", "text": "func (c Color) Darken() Color {\n\tval := int(c)\n\tif val >= 90 && val <= 107 {\n\t\treturn Color(uint8(c) - 60)\n\t}\n\n\t// don't change\n\treturn c\n}", "title": "" }, { "docid": "1e78403557d51993314b5f4d8a6b7c02", "score": "0.4570626", "text": "func (bt *BinaryNode) ToRedBlack() error {\n\treturn nil\n}", "title": "" }, { "docid": "4822af8035563d20dfba8a87beff97d7", "score": "0.45637184", "text": "func (c *Color) B() aec.ANSI {\n\tswitch c.Type {\n\tcase ColorTypeNone:\n\t\treturn emptyColor\n\tcase ColorTypeName:\n\t\tb, ok := backColors[c.Name]\n\t\tif ok {\n\t\t\treturn b\n\t\t}\n\tcase ColorType8Bit:\n\t\treturn aec.Color8BitB(aec.RGB8Bit(c.Value8))\n\tcase ColorType24Bit:\n\t\treturn aec.FullColorB(c.ValueR, c.ValueG, c.ValueB)\n\t}\n\treturn emptyColor\n}", "title": "" }, { "docid": "a73544032f1d9979c1be2b89140ef820", "score": "0.45543012", "text": "func (_BBronze *BBronzeCallerSession) GetColor() ([32]byte, error) {\n\treturn _BBronze.Contract.GetColor(&_BBronze.CallOpts)\n}", "title": "" }, { "docid": "006e5f91cb290f48d130730f1f8cdd67", "score": "0.4534619", "text": "func (e *G2) Neg(a *G2) *G2 {\n\tif e.P == nil {\n\t\te.P = &twistPoint{}\n\t}\n\te.P.Neg(a.P)\n\treturn e\n}", "title": "" }, { "docid": "f710dc84f82a7ab65d9c4c888ad9478e", "score": "0.45344493", "text": "func (*Direct) GetColor() int {\n\treturn 0x1C1C1C\n}", "title": "" }, { "docid": "52dcadc906e20fbe201cd53f09d47e2c", "score": "0.45323527", "text": "func (fp *FlowPacket) GetColor() (ret color.Color, err error) {\n\tvar value C.struct_sol_rgb\n\tcr := C.sol_flow_packet_get_rgb(fp.cpacket, &value)\n\tr := uint32(float64(value.red) / float64(value.red_max) * 65536)\n\tg := uint32(float64(value.green) / float64(value.green_max) * 65536)\n\tb := uint32(float64(value.blue) / float64(value.blue_max) * 65536)\n\tret, err = Color{r, g, b, 65536}, nil\n\tif cr < 0 {\n\t\terr = errors.New(\"Error retrieving Color value\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "af48b334b58d9ca1cd0a87d7693454f7", "score": "0.45272678", "text": "func (s *Style) GetPaletteFlipOk() (bool, bool) {\n\tif s == nil || s.PaletteFlip == nil {\n\t\treturn false, false\n\t}\n\treturn *s.PaletteFlip, true\n}", "title": "" }, { "docid": "3b25fc8226ad8f2c647ba74a1382cbdc", "score": "0.45241416", "text": "func (me TLocationDescriptorEnum) IsInTheOppositeDirection() bool {\n\treturn me.String() == \"inTheOppositeDirection\"\n}", "title": "" }, { "docid": "f7479ea71b3520b577e181700babc569", "score": "0.45213988", "text": "func (cl CompositeLiteral) Negate() Literal {\n\treturn NegativeLiteral{cl}\n}", "title": "" }, { "docid": "fd44cff84a6b16e95441e2f93dd54a68", "score": "0.45089224", "text": "func Closeness(one, two color.Color) uint32 {\n\ta, b, c, d := NormalisedRGBA(one)\n\tw, x, y, z := NormalisedRGBA(two)\n\n\treturn (a - w) + (b - x) + (c - y) + (d - z)\n}", "title": "" }, { "docid": "e209f8f9123fb5a54b9e5ebe6c1e07b0", "score": "0.4506074", "text": "func GetColor(language string) string {\n\tif color, ok := data.LanguagesColor[language]; ok {\n\t\treturn color\n\t}\n\n\tif color, ok := data.LanguagesColor[GetLanguageGroup(language)]; ok {\n\t\treturn color\n\t}\n\n\treturn \"#cccccc\"\n}", "title": "" }, { "docid": "c074f36e0d6bef87661d840104ed5737", "score": "0.44998032", "text": "func (z *Float) Neg(x *Float) *Float", "title": "" } ]
fed49ffa8659e9363fdbd820f1eb4c6f
FindNotificationEndpointByID returns a single notification endpoint by ID.
[ { "docid": "1de064cff8fe5f33e58ef12a647ae68a", "score": "0.834771", "text": "func (s *Service) FindNotificationEndpointByID(ctx context.Context, id platform.ID) (influxdb.NotificationEndpoint, error) {\n\treturn s.endpointStore.FindNotificationEndpointByID(ctx, id)\n}", "title": "" } ]
[ { "docid": "ab9d702190db61de67ca263b198bdccc", "score": "0.8309426", "text": "func (s *NotificationEndpointService) FindNotificationEndpointByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationEndpoint, error) {\n\treturn s.FindNotificationEndpointByIDF(ctx, id)\n}", "title": "" }, { "docid": "d1a93d5af7f3e779ebe9e56bad26510f", "score": "0.8265469", "text": "func (s *Service) FindNotificationEndpointByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationEndpoint, error) {\n\tvar (\n\t\tedp influxdb.NotificationEndpoint\n\t\terr error\n\t)\n\n\terr = s.kv.View(ctx, func(tx Tx) error {\n\t\tedp, _, _, err = s.findNotificationEndpointByID(ctx, tx, id)\n\t\treturn err\n\t})\n\n\treturn edp, err\n}", "title": "" }, { "docid": "577703f6c4673bbe02e9817182435008", "score": "0.7091825", "text": "func (h *Handler) EndpointByID(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tgatewayConfig, err := h.GatewayConfig(r)\n\tif err != nil {\n\t\th.WriteErrorResponse(w, http.StatusNotFound, err)\n\t\treturn\n\t}\n\tid := ps.ByName(\"id\")\n\tendpoint, ok := gatewayConfig.Endpoints[id]\n\tif !ok {\n\t\th.WriteErrorResponse(w, http.StatusNotFound, errors.Errorf(\"Endpoint %q is not found.\", id))\n\t\treturn\n\t}\n\th.WriteJSON(w, http.StatusOK, endpoint)\n}", "title": "" }, { "docid": "153a1625e2e809216003beaa2f0cfad2", "score": "0.61772746", "text": "func (d *Daemon) GetEndpointInfoByID(id uint16) (endpoint v1.EndpointInfo, ok bool) {\n\tep := d.endpointManager.LookupCiliumID(id)\n\tif ep == nil {\n\t\treturn nil, false\n\t}\n\treturn ep, true\n}", "title": "" }, { "docid": "7321d08081eae7aa4fd33ec4ab66154b", "score": "0.5926891", "text": "func FindRemoteEndpointForAPIIDAndAccountID(db *apsql.DB, id, apiID, accountID int64) (*RemoteEndpoint, error) {\n\tendpoints, err := _remoteEndpoints(db, \"\", id, apiID, accountID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(endpoints) == 0 {\n\t\treturn nil, fmt.Errorf(\"No endpoint with id %d found\", id)\n\t}\n\treturn endpoints[0], nil\n}", "title": "" }, { "docid": "b8199bd1bc5d439c09a070d900e8af87", "score": "0.58732873", "text": "func (es *Endpoints) GetEndpointByContainerID(id string) (*Endpoint, bool) {\n\tes.mutex.RLock()\n\tdefer es.mutex.RUnlock()\n\tfor _, ep := range es.eps {\n\t\tfor _, containerID := range ep.ContainerIDs {\n\t\t\tif id == containerID {\n\t\t\t\treturn ep.DeepCopy(), true\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, false\n}", "title": "" }, { "docid": "b74bf3a9a8afef74a4eb4d7611751706", "score": "0.5817084", "text": "func (service *Service) FindEndpoint(name string) *ServiceEndpoint {\n\tfor _, endpoint := range service.AdditionalEndpoints {\n\t\tif strings.EqualFold(endpoint.Name, name) {\n\t\t\treturn endpoint\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "5480a64567576ec190ccaacb1a4d06a7", "score": "0.5789024", "text": "func (m *Manager) FindNotificationByID(id int64) (*Notification, error) {\n\tvar res Notification\n\terr := m.GetRDbMap().SelectOne(\n\t\t&res,\n\t\tfmt.Sprintf(\"SELECT %s FROM %s WHERE id=?\", GetSelectFields(NotificationTableFull, \"\"), NotificationTableFull),\n\t\tid,\n\t)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &res, nil\n}", "title": "" }, { "docid": "d34b7b5f8ad7acf3bc084606caa49370", "score": "0.57755136", "text": "func NewGetEndpointIDNotFound() *GetEndpointIDNotFound {\n\treturn &GetEndpointIDNotFound{}\n}", "title": "" }, { "docid": "276b6f8b71617a9d5b96721fa38fa828", "score": "0.57378304", "text": "func (b Base) GetEndpointID() influxdb.ID {\n\treturn b.EndpointID\n}", "title": "" }, { "docid": "3f2d24822e8ca99f9f2ca0d60e459b74", "score": "0.5657513", "text": "func (s *NotificationRuleStore) FindNotificationRuleByID(ctx context.Context, id influxdb.ID) (influxdb.NotificationRule, error) {\n\treturn s.FindNotificationRuleByIDF(ctx, id)\n}", "title": "" }, { "docid": "166ae4937a50f0b3de085d42dc6488a7", "score": "0.5655666", "text": "func (e *Endpoint) GetID() *string {\n\treturn e.EndpointID\n}", "title": "" }, { "docid": "0b4e2cf858aed2eb71aca9379e799d37", "score": "0.56306666", "text": "func (e *endpoint) ID() *stack.NetworkEndpointID {\n\treturn &e.id\n}", "title": "" }, { "docid": "0b4e2cf858aed2eb71aca9379e799d37", "score": "0.56306666", "text": "func (e *endpoint) ID() *stack.NetworkEndpointID {\n\treturn &e.id\n}", "title": "" }, { "docid": "1e0f22a65ff1e82cc5a05bedeee90451", "score": "0.560103", "text": "func (c *Controller) FindAlertByID(gctx *gin.Context) {\n\talertIDStr := gctx.Param(\"alert_id\")\n\talertID, err := strconv.Atoi(alertIDStr)\n\tif err != nil {\n\t\tgctx.JSON(http.StatusBadRequest, gin.H{\"message\": \"alert_id must be valid integer\"})\n\t\treturn\n\t}\n\tresult, err := c.DBClient.GetAlertByID(alertID)\n\tif err != nil {\n\t\tc.HandleDBErrors(gctx, err)\n\t\treturn\n\t}\n\tdata := FormatOneAlert(result)\n\n\tif gctx.Request.Method == http.MethodHead {\n\t\tgctx.String(http.StatusOK, \"\")\n\t\treturn\n\t}\n\tgctx.JSON(http.StatusOK, data)\n}", "title": "" }, { "docid": "e12b4dc8320a87d463825d8f42440a41", "score": "0.55997574", "text": "func FindServiceEndpoint(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*ServiceEndpoint, error) {\n\tserviceEndpointObj := &ServiceEndpoint{}\n\n\tsel := \"*\"\n\tif len(selectCols) > 0 {\n\t\tsel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), \",\")\n\t}\n\tquery := fmt.Sprintf(\n\t\t\"select %s from \\\"service_endpoint\\\" where \\\"id\\\"=$1\", sel,\n\t)\n\n\tq := queries.Raw(query, iD)\n\n\terr := q.Bind(ctx, exec, serviceEndpointObj)\n\tif err != nil {\n\t\tif errors.Cause(err) == sql.ErrNoRows {\n\t\t\treturn nil, sql.ErrNoRows\n\t\t}\n\t\treturn nil, errors.Wrap(err, \"models: unable to select from service_endpoint\")\n\t}\n\n\treturn serviceEndpointObj, nil\n}", "title": "" }, { "docid": "f56dc763b04607685d4aa275a027b604", "score": "0.5545163", "text": "func GetEventByID(settings *config.Schema, ID string) (event model.Event, err error) {\n\t// this is not very fast but it does the job for the moment\n\tevts, err := ListEvents(settings)\n\tif err != nil {\n\t\treturn\n\t}\n\t// search the one\n\tfor _, evt := range evts {\n\t\tif evt.ID() == ID {\n\t\t\tevent = evt\n\t\t\treturn\n\t\t}\n\t}\n\t// if we got here we haven't found it\n\terr = fmt.Errorf(\"no event found with id %s\", ID)\n\treturn\n}", "title": "" }, { "docid": "ccad44d2178ecfc6a71b865656374269", "score": "0.55239767", "text": "func (t *NetworkInstance_ConnectionPoint) GetEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tkey := EndpointId\n\n\tif lm, ok := t.Endpoint[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0d0d0f62e3c7c5a94a739ebbba364732", "score": "0.55037296", "text": "func (t *NetworkInstance_ConnectionPoint) GetEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := EndpointId\n\n\tif lm, ok := t.Endpoint[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0d0d0f62e3c7c5a94a739ebbba364732", "score": "0.5503312", "text": "func (t *NetworkInstance_ConnectionPoint) GetEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := EndpointId\n\n\tif lm, ok := t.Endpoint[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0d0d0f62e3c7c5a94a739ebbba364732", "score": "0.5502501", "text": "func (t *NetworkInstance_ConnectionPoint) GetEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\tkey := EndpointId\n\n\tif lm, ok := t.Endpoint[key]; ok {\n\t\treturn lm\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7ef3b6417b7e18f70ccc41c7f2baacf4", "score": "0.54940045", "text": "func (a ALBIngresses) FindByID(id string) (int, *albingress.ALBIngress) {\n\tfor p, v := range a {\n\t\tif v.ID == id {\n\t\t\treturn p, v\n\t\t}\n\t}\n\treturn -1, nil\n}", "title": "" }, { "docid": "b591d41949f7fc6f2a19dd3f23d9db41", "score": "0.5469659", "text": "func (registry *ExtensionRegistry) GetEndpoint(ctx context.Context, extensionID, serviceID, endpointURL string) (*domain.ExtensionServiceEndpoint, error) {\n\treturn registry.extensionStore.GetExtensionServiceEndpoint(ctx, extensionID, serviceID, endpointURL)\n}", "title": "" }, { "docid": "0cdf138a6c766490bd1a24ca9f67f9bf", "score": "0.5467862", "text": "func NewPatchEndpointIDNotFound() *PatchEndpointIDNotFound {\n\n\treturn &PatchEndpointIDNotFound{}\n}", "title": "" }, { "docid": "22903626fe50694b9642bf0b0b7e9d1e", "score": "0.54664874", "text": "func (s *RuleService) FindNotificationRuleByID(ctx context.Context, id platform.ID) (influxdb.NotificationRule, error) {\n\tvar (\n\t\tnr influxdb.NotificationRule\n\t\terr error\n\t)\n\n\terr = s.kv.View(ctx, func(tx kv.Tx) error {\n\t\tnr, err = s.findNotificationRuleByID(ctx, tx, id)\n\t\treturn err\n\t})\n\n\treturn nr, err\n}", "title": "" }, { "docid": "eceacdfc8307c658af2acd36a11f63c2", "score": "0.5441384", "text": "func (service *Service) Endpoint(ID int) (*model.Endpoint, error) {\n\tvar endpoint model.Endpoint\n\tidentifier := internal.Itob(int(ID))\n\n\terr := internal.GetObject(service.db, BucketName, identifier, &endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &endpoint, nil\n}", "title": "" }, { "docid": "3e34080dac09bce0786ff531417c8310", "score": "0.5423611", "text": "func (m *Gateway) FindByID(ctx context.Context, id uuid.UUID) (*domain.Task, error) {\n\tif m.FindByIDFn == nil {\n\t\tpanic(\"Gateway.FindByIDFn is not implemented\")\n\t}\n\treturn m.FindByIDFn(id)\n}", "title": "" }, { "docid": "299b4b63a4a693f46d494cf255e28a85", "score": "0.5378469", "text": "func (NodeBalancerConfigsPagedResponse) endpointWithID(c *Client, id int) string {\n\tendpoint, err := c.NodeBalancerConfigs.endpointWithID(id)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn endpoint\n}", "title": "" }, { "docid": "1eadd44a0ac5f530e956b74e30e6fd5c", "score": "0.533849", "text": "func NewGetEndpointIDLogNotFound() *GetEndpointIDLogNotFound {\n\treturn &GetEndpointIDLogNotFound{}\n}", "title": "" }, { "docid": "5e520a4b171e8d8b8f38578c34dfad16", "score": "0.53195536", "text": "func (q *MentionQuery) FindByEndpoint(v string) *MentionQuery {\n\treturn q.Where(kallax.Eq(Schema.Mention.Endpoint, v))\n}", "title": "" }, { "docid": "5e520a4b171e8d8b8f38578c34dfad16", "score": "0.53195536", "text": "func (q *MentionQuery) FindByEndpoint(v string) *MentionQuery {\n\treturn q.Where(kallax.Eq(Schema.Mention.Endpoint, v))\n}", "title": "" }, { "docid": "7676191c9d3efaee963a84c4a046a1c6", "score": "0.5309694", "text": "func (s *Service) PatchNotificationEndpoint(ctx context.Context, id influxdb.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error) {\n\tvar edp influxdb.NotificationEndpoint\n\tif err := s.kv.Update(ctx, func(tx Tx) (err error) {\n\t\tedp, err = s.patchNotificationEndpoint(ctx, tx, id, upd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn edp, nil\n}", "title": "" }, { "docid": "748d47549f5dfa538bfd2832dc356fc9", "score": "0.52904934", "text": "func (c *FloatingIPClient) GetByID(ctx context.Context, id int) (*FloatingIP, *Response, error) {\n\treq, err := c.client.NewRequest(ctx, \"GET\", fmt.Sprintf(\"/floating_ips/%d\", id), nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar body schema.FloatingIPGetResponse\n\tresp, err := c.client.Do(req, &body)\n\tif err != nil {\n\t\tif IsError(err, ErrorCodeNotFound) {\n\t\t\treturn nil, resp, nil\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\treturn FloatingIPFromSchema(body.FloatingIP), resp, nil\n}", "title": "" }, { "docid": "70e672e7cc5b732464cca09948bf431a", "score": "0.5258474", "text": "func (s *Service) DeleteNotificationEndpoint(ctx context.Context, id influxdb.ID) (flds []influxdb.SecretField, orgID influxdb.ID, err error) {\n\terr = s.kv.Update(ctx, func(tx Tx) error {\n\t\tflds, orgID, err = s.deleteNotificationEndpoint(ctx, tx, id)\n\t\treturn err\n\t})\n\treturn flds, orgID, err\n}", "title": "" }, { "docid": "fbedb3e237e24cc1fc84b6c52fcd9bb6", "score": "0.52544606", "text": "func (c *endpointClient) Get(ctx context.Context, id regapi.ID) (*regapi.TerminationEndpoint, error) {\n\treq := &regapi.GetTerminationRequest{\n\t\tID: id,\n\t}\n\n\tresp, err := c.client.GetTermination(ctx, req)\n\tif err != nil {\n\t\tstat, ok := status.FromError(err)\n\t\tif ok {\n\t\t\treturn nil, errors.FromStatus(stat)\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn resp.Endpoint, nil\n}", "title": "" }, { "docid": "4fce259618b8e9a52a8b085080d4df8d", "score": "0.52485263", "text": "func (en Endpoints) GetByID(ctx context.Context, id string) (e io.Employee, error error) {\n\trequest := GetByIDRequest{Id: id}\n\tresponse, err := en.GetByIDEndpoint(ctx, request)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn response.(GetByIDResponse).E, response.(GetByIDResponse).Error\n}", "title": "" }, { "docid": "afa6a30647494bfaf3b4f45d9962620a", "score": "0.5247321", "text": "func (e *Endpoint) ID() string { return e.id }", "title": "" }, { "docid": "7b79f5543c6821c249c674ecf66d32da", "score": "0.52258104", "text": "func (st *SMTP) GetByID(c echo.Context) error {\n\ts, err := dao.GetByIDSMTPServer(c.Param(\":ID\"))\n\tif err != nil {\n\t\treturn c.JSON(http.StatusBadRequest, err)\n\t}\n\treturn c.JSON(http.StatusOK, s)\n}", "title": "" }, { "docid": "fcf493ba47f1391f69035807a5d588d7", "score": "0.5205589", "text": "func (s *Service) UpdateNotificationEndpoint(ctx context.Context, id influxdb.ID, edp influxdb.NotificationEndpoint, userID influxdb.ID) (influxdb.NotificationEndpoint, error) {\n\tvar err error\n\terr = s.kv.Update(ctx, func(tx Tx) error {\n\t\tedp, err = s.updateNotificationEndpoint(ctx, tx, id, edp, userID)\n\t\treturn err\n\t})\n\treturn edp, err\n}", "title": "" }, { "docid": "e3f410f367bf43ea618c05e4a42aafe2", "score": "0.51917374", "text": "func NewDeleteEndpointIDNotFound() *DeleteEndpointIDNotFound {\n\n\treturn &DeleteEndpointIDNotFound{}\n}", "title": "" }, { "docid": "d7674da6bab65b594bd80389bf48aa2e", "score": "0.5171727", "text": "func (*DiscoverEndpoint) ID() string {\n\treturn \"DiscoverEndpoint\"\n}", "title": "" }, { "docid": "ecec555740092f15d58a022892f6dde2", "score": "0.5148516", "text": "func (b *BackendAPIRemoteIndex) FindByID(id int64) (*BackendAPIEntity, bool) {\n\titem, ok := b.backendIDIndex[id]\n\treturn item, ok\n}", "title": "" }, { "docid": "18310cfbbc409d2ab0b86355dcd3cd44", "score": "0.5147831", "text": "func (d *sqliteDatastore) FindIntervalByID(id int) (i interval.Interval, err error) {\n\treturn i, d.db.First(&i, id).Error\n}", "title": "" }, { "docid": "7fd0117ec11d973b6bfbbf85ed451ec4", "score": "0.5138104", "text": "func (er *EventRepo) FindByID(id string) *models.Event {\n\treturn &models.Event{ID: \"100\"}\n}", "title": "" }, { "docid": "df58c7b4a3e39f1d60eaeb0e4cec2903", "score": "0.5128817", "text": "func (r Resource) GetEndpoint() string {\n\te := endpoints[r.Endpoint]\n\n\tend := e\n\tif strings.Contains(e, \"%v\") && r.Id != 0 {\n\t\tend = fmt.Sprintf(e, r.Id)\n\t}\n\n\treturn end\n}", "title": "" }, { "docid": "41c4678f3833b7ab5339c421d82456bd", "score": "0.5126118", "text": "func EndpointOne(endpoint string) *models.EndpointConfig {\n\tif cachedData != nil {\n\t\treturn cachedData.endpoints.Endpoint(endpoint)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "fa4e81e3729f3a39dd92fbd17dab859f", "score": "0.5116567", "text": "func (s *Endpoint) SetEndpointId(v string) *Endpoint {\n\ts.EndpointId = &v\n\treturn s\n}", "title": "" }, { "docid": "3298228f68a3931c9e28c1f4631c6ee4", "score": "0.5114092", "text": "func (d *Dao) ETFindByID(id int64) (topic *show.EventTopic, err error) {\n\ttopic = &show.EventTopic{}\n\tw := map[string]interface{}{\n\t\t\"deleted\": common.NotDeleted,\n\t}\n\tif err = d.DB.Model(&show.EventTopic{}).Where(\"id = ?\", id).Where(w).First(topic).Error; err != nil {\n\t\tif err == gorm.ErrRecordNotFound {\n\t\t\ttopic = nil\n\t\t\terr = nil\n\t\t} else {\n\t\t\tlog.Error(\"dao.ormshow.event_topic.findByID error(%v)\", err)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "5e618523640d3d43b331fbcacff42805", "score": "0.51083666", "text": "func (e *EventStore) GetByID(ctx context.Context, eventID eventdb.EventID) (eventdb.Event, error) {\n\tevents, err := e.fetchEvents(ctx, []eventdb.EventID{eventID})\n\tif err != nil {\n\t\treturn eventdb.Event{}, errors.E(err)\n\t}\n\n\tif len(events) == 0 {\n\t\treturn eventdb.Event{}, errors.E(errors.NotExist)\n\t}\n\n\tevent := events[0]\n\treturn event, nil\n}", "title": "" }, { "docid": "19ea19e4e0cc5aebcd3a5c2b23f62701", "score": "0.50996953", "text": "func (a *App) FindDeviceByID(ctx context.Context, ID primitive.ObjectID, device *Device) error {\n\n\tctxC, cancel := context.WithTimeout(ctx, 5*time.Second)\n\tdefer cancel()\n\tcollection := a.mongoClient.Database(utils.MongoDb).Collection(\"pantahub_devices\")\n\tif collection == nil {\n\t\treturn errors.New(\"Error with Database connectivity\")\n\t}\n\n\terr := collection.FindOne(ctxC, bson.M{\n\t\t\"_id\": ID,\n\t}).Decode(&device)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a06495828a26c15780bf6b7e3cb10238", "score": "0.5083509", "text": "func (u *NotificationService) Find(id uint) (*notice.NotificationRecord, error) {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "f9dcce006a04c9ba2e9cf38eea58f510", "score": "0.5080932", "text": "func (s *Service) PatchNotificationEndpoint(ctx context.Context, id platform.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error) {\n\treturn s.endpointStore.PatchNotificationEndpoint(ctx, id, upd)\n}", "title": "" }, { "docid": "2315757ed932494b6e1f87faf41d9513", "score": "0.50790703", "text": "func (r *PostgresStorage) FindByID(ctx context.Context, elem interface{}, id interface{}) error {\n\terr := r.Single(ctx, elem, `\"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": "91e27618115cb6c74c93e18de3b9ce81", "score": "0.50714666", "text": "func AlertByID(ctx context.Context, id primitive.ObjectID) (alert *model.Alert, found bool, err error) {\n\talert = &model.Alert{}\n\tq := AlertsCollection.FindOne(ctx, bson.M{\"_id\": id})\n\n\terr = q.Decode(alert)\n\n\tif err == nil {\n\t\treturn alert, true, nil\n\t}\n\n\tif err == mongo.ErrNoDocuments {\n\t\treturn nil, false, nil\n\t}\n\treturn nil, false, err\n}", "title": "" }, { "docid": "815850f40f4e85efeda1ff46940605e8", "score": "0.50660414", "text": "func (en Endpoints) GetByIDEvent(ctx context.Context, id string) (d io.Event, error error) {\n\trequest := GetByIDEventRequest{Id: id}\n\tresponse, err := en.GetByIDEventEndpoint(ctx, request)\n\tif err != nil {\n\t\treturn\n\t}\n\treturn response.(GetByIDEventResponse).D, response.(GetByIDEventResponse).Error\n}", "title": "" }, { "docid": "4d30dcbe3c1c5da5f6dc80f7f0012ecb", "score": "0.50610936", "text": "func (r *Table) RefreshEndpointById(id string, key string) error {\n\toriEp, exist := r.GetEndpointById(id)\n\tif !exist {\n\t\treturn r.CreateEndpoint(id, key)\n\t}\n\treturn r.RefreshEndpoint(oriEp, key)\n}", "title": "" }, { "docid": "259dabec7f66cae2d0a43d1ded8b258c", "score": "0.5056507", "text": "func (s *Service) DeleteNotificationEndpoint(ctx context.Context, id platform.ID) ([]influxdb.SecretField, platform.ID, error) {\n\treturn s.endpointStore.DeleteNotificationEndpoint(ctx, id)\n}", "title": "" }, { "docid": "303509ea0f0bac0e157799ef5b5cae8f", "score": "0.5045459", "text": "func (store *Store) GetEventByID(s *model.SessionContext, id string) (*config.Event, error) {\n\tlogutil.Debugf(s, \"Store Layer - Get Event By Id\")\n\tvar event *config.Event\n\terr := store.DB().SelectOne(&event, \"Select * from Events where id=$1\", id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn event, nil\n}", "title": "" }, { "docid": "50549375f239d8185ca9bc305a4fb402", "score": "0.50452274", "text": "func (wf *WatchFactory) GetEndpoint(namespace, name string) (*kapi.Endpoints, error) {\n\tendpointsLister := wf.informers[endpointsType].lister.(listers.EndpointsLister)\n\treturn endpointsLister.Endpoints(namespace).Get(name)\n}", "title": "" }, { "docid": "f8a78e2c1cc61099ff7c676729f3cb51", "score": "0.50443345", "text": "func (c *EndpointsClient) GetEndpoint(endpointId int64) (*Endpoint, error) {\n\treq, _ := c.buildGetEnpointApiRequest(c.ApiToken, endpointId)\n\n\tjsonEndpoint, err := logzio_client.CreateHttpRequest(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstr := fmt.Sprintf(\"%s\", jsonEndpoint)\n\tif strings.Contains(str, apiGetEndpointNoEndpoint) {\n\t\treturn nil, fmt.Errorf(errorGetEndpointDoesntExist, endpointId, str)\n\t}\n\n\tendpoint := jsonEndpointToEndpoint(jsonEndpoint)\n\treturn &endpoint, nil\n}", "title": "" }, { "docid": "ff6ae60dfb7c0fe330274be038cd3cdb", "score": "0.5034483", "text": "func (s *PutEventsInput) SetEndpointId(v string) *PutEventsInput {\n\ts.EndpointId = &v\n\treturn s\n}", "title": "" }, { "docid": "31b625daa77ae99f39fad2cee3482639", "score": "0.5022221", "text": "func GetWebhookByID(id int64) (*Webhook, error) {\n\treturn getWebhook(&Webhook{\n\t\tID: id,\n\t})\n}", "title": "" }, { "docid": "f3fab2eb4dc9bcc5764cf730ce83914c", "score": "0.50213224", "text": "func GetEndpoint(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *EndpointState, opts ...pulumi.ResourceOption) (*Endpoint, error) {\n\tvar resource Endpoint\n\terr := ctx.ReadResource(\"aws:sagemaker/endpoint:Endpoint\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "f98278ff60edf42c7682db948809ba5c", "score": "0.50049347", "text": "func (s *NotificationEndpointService) UpdateNotificationEndpoint(ctx context.Context, id influxdb.ID, nr influxdb.NotificationEndpoint, userID influxdb.ID) (influxdb.NotificationEndpoint, error) {\n\treturn s.UpdateNotificationEndpointF(ctx, id, nr, userID)\n}", "title": "" }, { "docid": "10507343d27c6c32df07446ab275bbb2", "score": "0.50003237", "text": "func (es *Endpoints) GetEndpoint(ip net.IP) (endpoint *Endpoint, ok bool) {\n\tes.mutex.RLock()\n\tdefer es.mutex.RUnlock()\n\tfor _, ep := range es.eps {\n\t\tif ep.IPv4.Equal(ip) || ep.IPv6.Equal(ip) {\n\t\t\treturn ep.DeepCopy(), true\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "c404dc247f9f43337ad8a9814390f1d6", "score": "0.49984083", "text": "func (s *UpdateEndpointOutput) SetEndpointId(v string) *UpdateEndpointOutput {\n\ts.EndpointId = &v\n\treturn s\n}", "title": "" }, { "docid": "80841b7114a4c1048168f57627f64ae5", "score": "0.49966785", "text": "func FindMeetingEndpoint(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tmeeting, err := dao.FindById(params[\"id\"])\n\tif err != nil {\n\t\trespondWithError(w, http.StatusBadRequest, \"Invalid meeting ID\")\n\t\treturn\n\t}\n\trespondWithJson(w, http.StatusOK, meeting)\n}", "title": "" }, { "docid": "273762b064788707f13928081d792dc3", "score": "0.4993349", "text": "func (t *NetworkInstance_ConnectionPoint) GetOrCreateEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tkey := EndpointId\n\n\tif v, ok := t.Endpoint[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.NewEndpoint(EndpointId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateEndpoint got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "273762b064788707f13928081d792dc3", "score": "0.4993349", "text": "func (t *NetworkInstance_ConnectionPoint) GetOrCreateEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tkey := EndpointId\n\n\tif v, ok := t.Endpoint[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.NewEndpoint(EndpointId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateEndpoint got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "273762b064788707f13928081d792dc3", "score": "0.4993349", "text": "func (t *NetworkInstance_ConnectionPoint) GetOrCreateEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tkey := EndpointId\n\n\tif v, ok := t.Endpoint[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.NewEndpoint(EndpointId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateEndpoint got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "273762b064788707f13928081d792dc3", "score": "0.49923718", "text": "func (t *NetworkInstance_ConnectionPoint) GetOrCreateEndpoint(EndpointId string) *NetworkInstance_ConnectionPoint_Endpoint {\n\n\tkey := EndpointId\n\n\tif v, ok := t.Endpoint[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.NewEndpoint(EndpointId)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"GetOrCreateEndpoint got unexpected error: %v\", err))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "d0214b4b4b3c4279221724abd0917b28", "score": "0.4992371", "text": "func (s *DescribeEndpointOutput) SetEndpointId(v string) *DescribeEndpointOutput {\n\ts.EndpointId = &v\n\treturn s\n}", "title": "" }, { "docid": "a6277bf543386994d5202fd02989f199", "score": "0.49871054", "text": "func (c *EndpointsClient) GetEndpoint(endpointId int64) (*Endpoint, error) {\n\treq, _ := c.buildGetEnpointApiRequest(c.ApiToken, endpointId)\n\n\thttpClient := client.GetHttpClient(req)\n\tresp, err := httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// @todo: this isn't the idiomatic way to read a response body\n\tjsonBytes, _ := ioutil.ReadAll(resp.Body)\n\n\tif !logzio_client.CheckValidStatus(resp, []int{getEndpointsMethodSuccess}) {\n\t\treturn nil, fmt.Errorf(errorGetEndpointApiCallFailed, resp.StatusCode, jsonBytes)\n\t}\n\n\t// sometimes logz.io returns a string rather than a json object (and a 200 status code), even though the call has failed\n\t// @todo: can this be refactored?\n\tstr := fmt.Sprintf(\"%s\", jsonBytes)\n\tif strings.Contains(str, apiGetEndpointNoEndpoint) {\n\t\treturn nil, fmt.Errorf(errorGetEndpointDoesntExist, endpointId, str)\n\t}\n\n\tvar jsonEndpoint map[string]interface{}\n\terr = json.Unmarshal([]byte(jsonBytes), &jsonEndpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tendpoint := jsonEndpointToEndpoint(jsonEndpoint)\n\n\treturn &endpoint, nil\n}", "title": "" }, { "docid": "73c30e7d37e5d8295e6a835a4141d45c", "score": "0.49869", "text": "func (w *ServerInterfaceWrapper) FindPollById(ctx echo.Context) error {\n\tvar err error\n\t// ------------- Path parameter \"id\" -------------\n\tvar id int64\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\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.FindPollById(ctx, id)\n\treturn err\n}", "title": "" }, { "docid": "a09b15ceb4831688f8a1dd353dece1c3", "score": "0.49827528", "text": "func NewGetEndpointIDInvalid() *GetEndpointIDInvalid {\n\treturn &GetEndpointIDInvalid{}\n}", "title": "" }, { "docid": "0a4834362f0102ac897f19f3411ae291", "score": "0.49820122", "text": "func GetEventByID(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(fmt.Sprintf(\"%s - %s\", r.Method, r.URL))\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\teventID, err := primitive.ObjectIDFromHex(mux.Vars(r)[\"id\"])\n\tif err != nil {\n\t\terrorResponse := util.GenerateErrorResponse(500, \"Unexpected error\", err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tjson.NewEncoder(w).Encode(errorResponse)\n\t\treturn\n\t}\n\n\tevent, err := service.GetEvent(eventID)\n\tif err != nil {\n\t\terrorResponse := util.GenerateErrorResponse(404, \"Id not found\", err)\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\tjson.NewEncoder(w).Encode(errorResponse)\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\tjson.NewEncoder(w).Encode(event)\n}", "title": "" }, { "docid": "cd012847469e86e17ad48374cf8a7eb7", "score": "0.4977", "text": "func (s *Service)FindPaymentByID(paymentID string)(*types.Payment,error){\n for _,i:=range s.payments{\n if(i.ID==paymentID){\n return i ,nil\n }\n }\n return nil, ErrPaymentNotFound\n}", "title": "" }, { "docid": "f7682dc3b1b3f0afd8429dd23de307f7", "score": "0.49762702", "text": "func (sc ServiceCatalog) GetEndpoint(interfaceType, regionName string) (string, error) {\n\tif interfaceType == \"\" {\n\t\t// Set the default value\n\t\tinterfaceType = \"public\"\n\t}\n\n\tfor _, epoint := range sc.Endpoints {\n\t\tif regionName == \"\" || epoint.Region == regionName {\n\t\t\t// Translate passed interface types\n\t\t\tsc_int := strings.ToLower(interfaceType)\n\n\t\t\tif epoint.Interface == sc_int {\n\t\t\t\treturn epoint.URL, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tvar msg string\n\tif regionName != \"\" {\n\t\tmsg = fmt.Sprintf(\"%s endpoint in %s region not found\",\n\t\t\tinterfaceType, regionName)\n\t} else {\n\t\tmsg = fmt.Sprintf(\"%s endpoint not found\", interfaceType)\n\t}\n\treturn \"\", errors.New(msg)\n}", "title": "" }, { "docid": "651b0c9a8715a61d436b9a77e1575197", "score": "0.4971509", "text": "func GetEndpoint(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *EndpointState, opts ...pulumi.ResourceOption) (*Endpoint, error) {\n\tvar resource Endpoint\n\terr := ctx.ReadResource(\"aws:dms/endpoint:Endpoint\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "fe59ea4aab80b9e9ee68ab0d12746b9d", "score": "0.49684787", "text": "func FindResourceEndpoint(c echo.Context) error {\n\tctx := platform.NewHttpContext(c.Request())\n\n\tguid := c.Param(\"id\")\n\tif guid == \"\" {\n\t\treturn api.ErrorResponse(c, http.StatusBadRequest, errordef.ErrInvalidRoute)\n\t}\n\n\tif err := AuthorizeAccessResource(ctx, c, ScopeResourceRead, guid); err != nil {\n\t\treturn api.ErrorResponse(c, http.StatusUnauthorized, err)\n\t}\n\n\tresource, err := backend.GetResourceContent(ctx, guid)\n\tif err != nil {\n\t\treturn api.ErrorResponse(c, http.StatusBadRequest, err)\n\t}\n\tif resource == nil {\n\t\treturn api.StandardResponse(c, http.StatusNotFound, nil)\n\t}\n\n\t// track api access for billing etc\n\tplatform.Meter(ctx, \"api.resource.find\", \"resource\", guid)\n\n\treturn api.StandardResponse(c, http.StatusOK, resource)\n}", "title": "" }, { "docid": "857329f5cde2e0694f12b6f3d6a452e4", "score": "0.49626836", "text": "func (s *NotificationEndpointService) DeleteNotificationEndpoint(ctx context.Context, id influxdb.ID) ([]influxdb.SecretField, influxdb.ID, error) {\n\treturn s.DeleteNotificationEndpointF(ctx, id)\n}", "title": "" }, { "docid": "d8203233a231c2b87297d0ac5ff73910", "score": "0.49608862", "text": "func (s *Service) UpdateNotificationEndpoint(ctx context.Context, id platform.ID, nr influxdb.NotificationEndpoint, userID platform.ID) (influxdb.NotificationEndpoint, error) {\n\tnr.BackfillSecretKeys() // :sadpanda:\n\tupdatedEndpoint, err := s.endpointStore.UpdateNotificationEndpoint(ctx, id, nr, userID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsecrets := make(map[string]string)\n\tfor _, fld := range updatedEndpoint.SecretFields() {\n\t\tif fld.Value != nil {\n\t\t\tsecrets[fld.Key] = *fld.Value\n\t\t}\n\t}\n\n\tif len(secrets) == 0 {\n\t\treturn updatedEndpoint, nil\n\t}\n\n\tif err := s.secretSVC.PatchSecrets(ctx, updatedEndpoint.GetOrgID(), secrets); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn updatedEndpoint, nil\n}", "title": "" }, { "docid": "79b4a39840ebc69f647a446ea2cec688", "score": "0.49548668", "text": "func FindPatimeetingEndpoint(w http.ResponseWriter, r *http.Request) {\n\tparams := mux.Vars(r)\n\tmeeting, err := dao.FindByPatimeeting(params[\"emailid\"])\n\tif err != nil {\n\t\trespondWithError(w, http.StatusBadRequest, \"Invalid meeting ID\")\n\t\treturn\n\t}\n\trespondWithJson(w, http.StatusOK, meeting)\n}", "title": "" }, { "docid": "4922084db009d94a20d46375dfdd051f", "score": "0.49447703", "text": "func (manager *DeviceManager) GetDeviceByID(id string) *Device {\n\tfor _, device := range manager.Devices {\n\t\tif device.ID == id {\n\t\t\treturn device\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c5a9807517e69386811915e3402f60f3", "score": "0.4941417", "text": "func (s *NotificationEndpointService) PatchNotificationEndpoint(ctx context.Context, id influxdb.ID, upd influxdb.NotificationEndpointUpdate) (influxdb.NotificationEndpoint, error) {\n\treturn s.PatchNotificationEndpointF(ctx, id, upd)\n}", "title": "" }, { "docid": "37c164faa600cc0a7428762fb35f6129", "score": "0.49388418", "text": "func (n *nic) findEndpoint(protocol tcpip.NetworkProtocolNumber, address tcpip.Address, peb PrimaryEndpointBehavior) AssignableAddressEndpoint {\n\treturn n.getAddressOrCreateTemp(protocol, address, peb, spoofing)\n}", "title": "" }, { "docid": "054ddfb53b3beec609cf621703b735f6", "score": "0.49385774", "text": "func GetEndpoint(cid, port string) (nat.PortBinding, error) {\n\n\tif v, ok := endpoints[cid]; ok {\n\t\tfor k, _ := range v {\n\t\t\tif port == k.Port() {\n\t\t\t\tlog.Debugf(\"match %+v\", v[k][0])\n\t\t\t\treturn v[k][0], nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nat.PortBinding{}, fmt.Errorf(EnvNotAvailable)\n}", "title": "" }, { "docid": "eecbe3ba8f6381a0bd1ec5315663a9bd", "score": "0.49374726", "text": "func notificationById(conn redis.Conn, id string) (notification models.Notification, edgexErr errors.EdgeX) {\n\tedgexErr = getObjectById(conn, notificationStoredKey(id), &notification)\n\tif edgexErr != nil {\n\t\treturn notification, errors.NewCommonEdgeXWrapper(edgexErr)\n\t}\n\treturn\n}", "title": "" }, { "docid": "a7431078817d215480c0bc1a46871c64", "score": "0.49264297", "text": "func EndpointIDAddresser(id string) net.IP {\n\tfields := strings.SplitN(id, ScopeDelim, 3)\n\tif len(fields) != 3 {\n\t\t//log.Printf(\"EndpointIDAddresser: bad input %q\", id)\n\t\treturn nil\n\t}\n\treturn net.ParseIP(fields[1])\n}", "title": "" }, { "docid": "8f533269190e583478115c329a6b235e", "score": "0.49179825", "text": "func (d *GormDatabase) GetPluginConfByID(id uint) *model.PluginConf {\n\tplugin := new(model.PluginConf)\n\td.DB.Where(\"id = ?\", id).First(plugin)\n\tif plugin.ID == id {\n\t\treturn plugin\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5b42a5d463de6e43aaaa038967730f9e", "score": "0.49167296", "text": "func (e *EndpointManager) GetHashEndpoint(hashcode int64) *endpoint.Endpoint {\r\n\tlength := len(e.index)\r\n\tif length <= 0 {\r\n\t\treturn nil\r\n\t}\r\n\tpos := hashcode % int64(length)\r\n\tep := e.index[pos].(endpoint.Endpoint)\r\n\treturn &ep\r\n}", "title": "" }, { "docid": "348823dded28311aa614a6f62ce2e379", "score": "0.49150887", "text": "func (p *PerformanceProfileDAO) FindByID(id string) (types.PerformanceProfile, error) {\n\tvar performanceProfile types.PerformanceProfile\n\terr := p.db.C(p.Collection).FindId(bson.ObjectIdHex(id)).One(&performanceProfile)\n\treturn performanceProfile,err\n}", "title": "" }, { "docid": "2b2d825199551387e5e60e72c078efd1", "score": "0.49140713", "text": "func (d *DataStore) FindServiceByID(serviceID string) (*api.Service, error) {\n\tservice := &api.Service{}\n\tcol := d.s.DB(defaultDBName).C(serviceCollectionName)\n\terr := col.Find(bson.M{\"_id\": serviceID}).One(service)\n\treturn service, err\n}", "title": "" }, { "docid": "31ccdcda28f5b45c059a837b4c198509", "score": "0.4902655", "text": "func (e *Events) FindEventByID(db *gorm.DB, pid uint64) (*Events, error) {\n\tvar err error\n\n\terr = db.Debug().Model(&Events{}).Where(\"id = ?\", pid).Take(&e).Error\n\tif err != nil {\n\t\treturn &Events{}, err\n\t}\n\n\tif e.ID != 0 {\n\t\terr = db.Debug().Model(&Events{}).Where(\"id = ?\", e.CreatorID).Take(&e.Creator).Error\n\t\tif err != nil {\n\t\t\treturn &Events{}, err\n\t\t}\n\t}\n\n\treturn e, nil\n}", "title": "" }, { "docid": "e5c9ef50f097f97c82389f9d84792c7c", "score": "0.4900061", "text": "func (s *Service) GetByID(id string) (Fridge, error) {\n\tdb := database.GetDB()\n\tvar fridge Fridge\n\n\tif err := db.Where(\"id=?\", id).First(&fridge).Error; err != nil {\n\t\treturn fridge, err\n\t}\n\treturn fridge, nil\n}", "title": "" }, { "docid": "10d20c6b5afb490b304f3726531ee0cc", "score": "0.48922122", "text": "func (c *EndpointsClient) GetEndpointByName(endpointName string) (*Endpoint, error) {\n\tlist, err := c.ListEndpoints()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, endpoint := range list {\n\t\tif endpoint.Title == endpointName {\n\t\t\treturn &endpoint, nil\n\t\t}\n\t}\n\n\treturn nil, err\n}", "title": "" }, { "docid": "10d20c6b5afb490b304f3726531ee0cc", "score": "0.48922122", "text": "func (c *EndpointsClient) GetEndpointByName(endpointName string) (*Endpoint, error) {\n\tlist, err := c.ListEndpoints()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, endpoint := range list {\n\t\tif endpoint.Title == endpointName {\n\t\t\treturn &endpoint, nil\n\t\t}\n\t}\n\n\treturn nil, err\n}", "title": "" }, { "docid": "72b79d2892f47f4b1a9d79cc23aea0a3", "score": "0.4891468", "text": "func (t *TargetStore) Read(id string) *models.Endpoint {\n\trawE, ok := t.Data.Load(id)\n\tif !ok {\n\t\treturn nil\n\t}\n\te, ok := rawE.(*models.Endpoint)\n\tif !ok {\n\t\treturn nil\n\t}\n\treturn e\n}", "title": "" }, { "docid": "ee3648119edf644562ed69a0b6ee74de", "score": "0.48831567", "text": "func (s *Service) FindInvitationByID(id uint) (*Invitation, error) {\n\t// Fetch from the database\n\tinvitation := new(Invitation)\n\tnotFound := s.db.\n\t\tPreload(\"InvitedUser.OauthUser\").\n\t\tFirst(invitation, id).\n\t\tRecordNotFound()\n\n\t// Not found\n\tif notFound {\n\t\treturn nil, ErrInvitationNotFound\n\t}\n\n\treturn invitation, nil\n}", "title": "" }, { "docid": "d2bc765ef4c37cebe7c1c81ce653354b", "score": "0.4879743", "text": "func (i InviteLinkRepo) FindByID(id string) (d.InviteLink, error) {\n\ttx, err := i.DB.Begin()\n\tif err != nil {\n\t\treturn d.InviteLink{}, err\n\t}\n\n\tinviteLink, err := i.FindByIDTx(tx, id)\n\tif err != nil {\n\t\treturn d.InviteLink{}, err\n\t}\n\n\terr = tx.Commit()\n\tif err != nil {\n\t\treturn d.InviteLink{}, err\n\t}\n\n\treturn inviteLink, nil\n}", "title": "" } ]
6962159259b1d82c481e0eb3d8683f8f
testing whether marshaler accepts anonymous struct
[ { "docid": "a6d9d3ba24d266285893381f71bca48b", "score": "0.0", "text": "func TestResponce(t *testing.T) {\n\tm, err := json.Marshal(struct {\n\t\tHello int\n\t\tSomething string\n\t}{10, \"Hello\"})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tt.Error(string(m))\n}", "title": "" } ]
[ { "docid": "0788bea6ff50e453a84ab6b07a250872", "score": "0.67347515", "text": "func isAnonymous(object types.Object) bool {\n\treturn strings.Contains(object.Type().String(), \"struct{\")\n}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.6406017", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.6406017", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.6406017", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "53bfef45a7a123535cf8597cd943ae2e", "score": "0.6406017", "text": "func (*Device) IsYANGGoStruct() {}", "title": "" }, { "docid": "ce91ec2fb867578ef4d937f89393c3dd", "score": "0.6370678", "text": "func (*OnfTest1_Cont1A_List4) IsYANGGoStruct() {}", "title": "" }, { "docid": "a8caa944e13a41a7cc3964398dff07b1", "score": "0.6356563", "text": "func (*OnfTest1_Cont1A) IsYANGGoStruct() {}", "title": "" }, { "docid": "2115bbe42d70678d7c83645e2e5f7f65", "score": "0.6353829", "text": "func (*OnfTest1_Cont1A_Cont2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "2c7513512ae7f3dc113c7eb426c6745c", "score": "0.6340437", "text": "func (*OnfTest1_Cont1A_List5) IsYANGGoStruct() {}", "title": "" }, { "docid": "b926f12c780a60142068b0938492acc3", "score": "0.63224685", "text": "func (*OnfTest1_Cont1A_List4_List4A) IsYANGGoStruct() {}", "title": "" }, { "docid": "e08d574409058ce430c22a087ae6a71d", "score": "0.62599283", "text": "func (*OnfTest1_Cont1A_List2A) IsYANGGoStruct() {}", "title": "" }, { "docid": "2732e1ce9658815d74796001d3b24b9f", "score": "0.60211104", "text": "func (*OnfTest1_Cont1BState) IsYANGGoStruct() {}", "title": "" }, { "docid": "03633b567d340ec556794af96be0020d", "score": "0.60015035", "text": "func (*TerminalDevice) IsYANGGoStruct() {}", "title": "" }, { "docid": "cc17d2f91a17a304b7eff451645f33dd", "score": "0.591995", "text": "func (*OnfTest1_Cont1BState_List2B) IsYANGGoStruct() {}", "title": "" }, { "docid": "c1ce529adfc3f1762bed629543abf427", "score": "0.59197736", "text": "func assertCanMarshal(t *testing.T, v reflect.Type, owner reflect.Type) {\n\t// If this type does its own marshaling\n\tvar marshal *json.Marshaler\n\tif v.Implements(reflect.TypeOf(marshal).Elem()) {\n\t\treturn\n\t}\n\n\tkind := v.Kind()\n\tswitch kind {\n\tcase reflect.Array, reflect.Slice, reflect.Ptr:\n\t\tassertCanMarshal(t, v.Elem(), owner)\n\tcase reflect.Map:\n\t\tassertCanMarshal(t, v.Elem(), owner)\n\t\tassertCanMarshal(t, v.Key(), owner)\n\tcase reflect.Interface:\n\t\t// We only allow certain interfaces with a well-defined set of values.\n\t\t// NOTE(nick): I honestly think we should forbid interfaces in any data model that\n\t\t// we need to send across a network, but that's a bigger change.\n\t\tswitch v.String() {\n\t\tcase \"error\":\n\t\t\t// ok\n\t\t\treturn\n\t\tcase \"webview.ResourceInfoView\":\n\t\t\tassertCanMarshal(t, reflect.TypeOf(K8SResourceInfo{}), v)\n\t\t\tassertCanMarshal(t, reflect.TypeOf(DCResourceInfo{}), v)\n\t\t\tassertCanMarshal(t, reflect.TypeOf(YAMLResourceInfo{}), v)\n\t\t\treturn\n\t\t}\n\t\tt.Errorf(\"View needs to be serializable. This type in the view don't make sense: %s in %s\", v, owner)\n\n\tcase reflect.Chan, reflect.Func:\n\t\tt.Errorf(\"View needs to be serializable. This type in the view don't make sense: %s in %s\", v, owner)\n\tcase reflect.Struct:\n\t\tfor i := 0; i < v.NumField(); i++ {\n\t\t\tfield := v.Field(i)\n\t\t\tif !isExported(field.Name) {\n\t\t\t\tt.Errorf(\"All fields in the WebView need to be serializable to web. Unexported fields are forbidden: %s in %s\",\n\t\t\t\t\tfield.Name, v)\n\t\t\t}\n\t\t\tassertCanMarshal(t, field.Type, v)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0d6773369e901535e79d7b1862d80ed1", "score": "0.58934677", "text": "func TestAnonymousFields(t *testing.T) {\n\ttestdata := []struct {\n\t\tlabel string\n\t\tinput func() []interface{}\n\t}{{\n\t\t// Both S1 and S2 have a field named X.\n\t\t// From the perspective of S, it is\n\t\t// ambiguous which one X refers to.\n\t\t// This should not encode either field.\n\t\tlabel: \"AmbiguousField\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tS1 struct{ x, X int }\n\t\t\t\tS2 struct{ x, X int }\n\t\t\t\tS struct {\n\t\t\t\t\tS1\n\t\t\t\t\tS2\n\t\t\t\t}\n\t\t\t)\n\t\t\treturn []interface{}{\n\t\t\t\tS{S1{1, 2}, S2{3, 4}},\n\t\t\t\t&S{S1{5, 6}, S2{7, 8}},\n\t\t\t}\n\t\t},\n\t}, {\n\t\t// Both S1 and S2 have a field named X, but\n\t\t// since S has an X field as well, it takes\n\t\t// precedence over S1.X and S2.X.\n\t\tlabel: \"DominantField\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tS1 struct{ x, X int }\n\t\t\t\tS2 struct{ x, X int }\n\t\t\t\tS struct {\n\t\t\t\t\tS1\n\t\t\t\t\tS2\n\t\t\t\t\tx, X int\n\t\t\t\t}\n\t\t\t)\n\t\t\treturn []interface{}{\n\t\t\t\tS{S1{1, 2}, S2{3, 4}, 5, 6},\n\t\t\t\t&S{S1{6, 5}, S2{4, 3}, 2, 1},\n\t\t\t}\n\t\t},\n\t}, {\n\t\t// Unexported embedded field of non-struct type\n\t\t// should not be serialized.\n\t\tlabel: \"UnexportedEmbeddedInt\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\ti int\n\t\t\t\tS struct{ i }\n\t\t\t)\n\t\t\treturn []interface{}{S{5}, &S{6}}\n\t\t},\n\t}, {\n\t\t// Exported embedded field of non-struct type\n\t\t// should be serialized.\n\t\tlabel: \"ExportedEmbeddedInt\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tI int\n\t\t\t\tS struct{ I }\n\t\t\t)\n\t\t\treturn []interface{}{S{5}, &S{6}}\n\t\t},\n\t}, {\n\t\t// Unexported embedded field of pointer to\n\t\t// non-struct type should not be serialized.\n\t\tlabel: \"UnexportedEmbeddedIntPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\ti int\n\t\t\t\tS struct{ *i }\n\t\t\t)\n\t\t\ts := S{new(i)}\n\t\t\t*s.i = 5\n\t\t\treturn []interface{}{s, &s}\n\t\t},\n\t}, {\n\t\t// Exported embedded field of pointer to\n\t\t// non-struct type should be serialized.\n\t\tlabel: \"ExportedEmbeddedIntPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tI int\n\t\t\t\tS struct{ *I }\n\t\t\t)\n\t\t\ts := S{new(I)}\n\t\t\t*s.I = 5\n\t\t\treturn []interface{}{s, &s}\n\t\t},\n\t}, {\n\t\t// Exported embedded field of nil pointer\n\t\t// to non-struct type should be serialized.\n\t\tlabel: \"ExportedEmbeddedNilIntPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tI int\n\t\t\t\tS struct{ *I }\n\t\t\t)\n\t\t\ts := S{new(I)}\n\t\t\ts.I = nil\n\t\t\treturn []interface{}{s, &s}\n\t\t},\n\t}, {\n\t\t// Exported embedded field of nil pointer to\n\t\t// non-struct type should not be serialized\n\t\t// if it has the omitempty option.\n\t\tlabel: \"ExportedEmbeddedNilIntPointerOmitempty\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tI int\n\t\t\t\tS struct {\n\t\t\t\t\t*I `json:\",omitempty\"`\n\t\t\t\t}\n\t\t\t)\n\t\t\ts := S{new(I)}\n\t\t\ts.I = nil\n\t\t\treturn []interface{}{s, &s}\n\t\t},\n\t}, {\n\t\t// Exported embedded field of pointer to\n\t\t// struct type should be serialized.\n\t\tlabel: \"ExportedEmbeddedStructPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tS struct{ X string }\n\t\t\t\tT struct{ *S }\n\t\t\t)\n\t\t\tt := T{S: &S{\n\t\t\t\tX: \"Loreum\",\n\t\t\t}}\n\t\t\treturn []interface{}{t, &t}\n\t\t},\n\t}, {\n\t\t// Exported fields of embedded structs should\n\t\t// have their exported fields be serialized\n\t\t// regardless of whether the struct types\n\t\t// themselves are exported.\n\t\tlabel: \"EmbeddedStructNonPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\ts1 struct{ x, X int }\n\t\t\t\tS2 struct{ y, Y int }\n\t\t\t\tS struct {\n\t\t\t\t\ts1\n\t\t\t\t\tS2\n\t\t\t\t}\n\t\t\t)\n\t\t\treturn []interface{}{\n\t\t\t\tS{s1{1, 2}, S2{3, 4}},\n\t\t\t\t&S{s1{5, 6}, S2{7, 8}},\n\t\t\t}\n\t\t},\n\t}, {\n\t\t// Exported fields of pointers to embedded\n\t\t// structs should have their exported fields\n\t\t// be serialized regardless of whether the\n\t\t// struct types themselves are exported.\n\t\tlabel: \"EmbeddedStructPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\ts1 struct{ x, X int }\n\t\t\t\tS2 struct{ y, Y int }\n\t\t\t\tS struct {\n\t\t\t\t\t*s1\n\t\t\t\t\t*S2\n\t\t\t\t}\n\t\t\t)\n\t\t\treturn []interface{}{\n\t\t\t\tS{&s1{1, 2}, &S2{3, 4}},\n\t\t\t\t&S{&s1{5, 6}, &S2{7, 8}},\n\t\t\t}\n\t\t},\n\t}, {\n\t\t// Exported fields on embedded unexported\n\t\t// structs at multiple levels of nesting\n\t\t// should still be serialized.\n\t\tlabel: \"NestedStructAndInts\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tI1 int\n\t\t\t\tI2 int\n\t\t\t\ti int\n\t\t\t\ts2 struct {\n\t\t\t\t\tI2\n\t\t\t\t\ti\n\t\t\t\t}\n\t\t\t\ts1 struct {\n\t\t\t\t\tI1\n\t\t\t\t\ti\n\t\t\t\t\ts2\n\t\t\t\t}\n\t\t\t\tS struct {\n\t\t\t\t\ts1\n\t\t\t\t\ti\n\t\t\t\t}\n\t\t\t)\n\t\t\treturn []interface{}{\n\t\t\t\tS{s1{1, 2, s2{3, 4}}, 5},\n\t\t\t\t&S{s1{5, 4, s2{3, 2}}, 1},\n\t\t\t}\n\t\t},\n\t}, {\n\t\t// If an anonymous struct pointer field is nil,\n\t\t// we should ignore the embedded fields behind it.\n\t\t// Not properly doing so may result in the wrong\n\t\t// output or a panic.\n\t\tlabel: \"EmbeddedFieldBehindNilPointer\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tS2 struct{ Field string }\n\t\t\t\tS struct{ *S2 }\n\t\t\t)\n\t\t\treturn []interface{}{S{}, &S{}}\n\t\t},\n\t}, {\n\t\t// A field behind a chain of pointer and\n\t\t// non-pointer embedded fields should be\n\t\t// accessible and serialized.\n\t\tlabel: \"BasicEmbeddedFieldChain\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tA struct {\n\t\t\t\t\tX1 string\n\t\t\t\t\tX2 *string\n\t\t\t\t}\n\t\t\t\tB struct{ *A }\n\t\t\t\tC struct{ B }\n\t\t\t\tD struct{ *C }\n\t\t\t\tE struct{ D }\n\t\t\t\tF struct{ *E }\n\t\t\t)\n\t\t\ts := \"Loreum\"\n\t\t\tf := F{E: &E{D: D{C: &C{B: B{A: &A{X1: s, X2: &s}}}}}}\n\t\t\treturn []interface{}{f, &f}\n\t\t},\n\t}, {\n\t\t// Variant of the test above, with embedded\n\t\t// fields of type struct that contain one or\n\t\t// more fields themselves.\n\t\tlabel: \"ComplexEmbeddedFieldChain\",\n\t\tinput: func() []interface{} {\n\t\t\ttype (\n\t\t\t\tA struct {\n\t\t\t\t\tX1 string `json:\",omitempty\"`\n\t\t\t\t\tX2 string\n\t\t\t\t}\n\t\t\t\tB struct {\n\t\t\t\t\tZ3 *bool\n\t\t\t\t\tA\n\t\t\t\t}\n\t\t\t\tC struct{ B }\n\t\t\t\tD struct {\n\t\t\t\t\t*C\n\t\t\t\t\tZ2 int\n\t\t\t\t}\n\t\t\t\tE struct{ *D }\n\t\t\t\tF struct {\n\t\t\t\t\tZ1 string `json:\",omitempty\"`\n\t\t\t\t\t*E\n\t\t\t\t}\n\t\t\t)\n\t\t\tf := F{Z1: \"Loreum\", E: &E{D: &D{C: &C{B: B{A: A{X2: \"Loreum\"}, Z3: new(bool)}}, Z2: 1}}}\n\t\t\treturn []interface{}{f, &f}\n\t\t},\n\t}}\n\tfor _, tt := range testdata {\n\t\ttt := tt\n\t\tt.Run(tt.label, func(t *testing.T) {\n\t\t\tinputs := tt.input()\n\t\t\tfor i, input := range inputs {\n\t\t\t\tinput := input\n\t\t\t\tvar label string\n\t\t\t\tif i == 0 {\n\t\t\t\t\tlabel = \"non-pointer\"\n\t\t\t\t} else {\n\t\t\t\t\tlabel = \"pointer\"\n\t\t\t\t}\n\t\t\t\tt.Run(label, func(t *testing.T) {\n\t\t\t\t\tenc, err := NewEncoder(reflect.TypeOf(input))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tt.Error(err)\n\t\t\t\t\t}\n\t\t\t\t\tvar buf bytes.Buffer\n\t\t\t\t\tif err := enc.Encode(input, &buf); err != nil {\n\t\t\t\t\t\tt.Error(err)\n\t\t\t\t\t}\n\t\t\t\t\tif !equalStdLib(t, input, buf.Bytes()) {\n\t\t\t\t\t\tt.Error(\"expected outputs to be equal\")\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "9e40704a2deb01cdb13b8189889920bc", "score": "0.5801144", "text": "func (*OpenconfigGasket_Gasket) IsYANGGoStruct() {}", "title": "" }, { "docid": "66c792cdba5fa91c5bef2583199878bf", "score": "0.5799521", "text": "func (*TerminalDevice_Channel_Ethernet) IsYANGGoStruct() {}", "title": "" }, { "docid": "257d3479f5ca6cbbd2a548d88f18ed2c", "score": "0.5780633", "text": "func (*OpenconfigMessages_Messages_DebugEntries) IsYANGGoStruct() {}", "title": "" }, { "docid": "d91740a3dcdfa137f7ecadf577476aa0", "score": "0.57657075", "text": "func (*TerminalDevice_Channel_Assignment) IsYANGGoStruct() {}", "title": "" }, { "docid": "6006f2fa0b39590b08dd329bc7e0c374", "score": "0.5764316", "text": "func (*TerminalDevice_Channel_Otn) IsYANGGoStruct() {}", "title": "" }, { "docid": "04cc9f78bbba48163bd9dbff29a1c4d8", "score": "0.57230884", "text": "func (*OpenconfigMessages_Messages) IsYANGGoStruct() {}", "title": "" }, { "docid": "ee2a2ab2ee2ec22a4c649184eb3e697d", "score": "0.5695307", "text": "func (*OpenconfigSystem_System_Openflow) IsYANGGoStruct() {}", "title": "" }, { "docid": "04e9647de941ea7a5e7d438612eda816", "score": "0.56932217", "text": "func (*OpenconfigPlatform_Components_Component_Fan) IsYANGGoStruct() {}", "title": "" }, { "docid": "72b5fc92210ce7bd12e0d54233799b45", "score": "0.566898", "text": "func (*TerminalDevice_Channel_Ingress) IsYANGGoStruct() {}", "title": "" }, { "docid": "2d3618485ddb1d487058454325262da8", "score": "0.5662825", "text": "func (*OpenconfigSystem_System_Openflow_Agent) IsYANGGoStruct() {}", "title": "" }, { "docid": "ec5e52b8c3bcbebdf773085a7706896b", "score": "0.56378025", "text": "func (*OpenconfigSystem_System_Aaa_Accounting_Events) IsYANGGoStruct() {}", "title": "" }, { "docid": "1e49e635d2fac33d3f99cc32b6559a53", "score": "0.5630064", "text": "func (*TerminalDevice_Channel_Otn_PostFecBer) IsYANGGoStruct() {}", "title": "" }, { "docid": "d4fea405f6a571361f5446ceed821883", "score": "0.5608386", "text": "func (*OpenconfigInterfaces_Interfaces_Interface) IsYANGGoStruct() {}", "title": "" }, { "docid": "99fd3780e65cff0f932b2d310017addb", "score": "0.55828494", "text": "func (*OpenconfigAccessPoints_AccessPoints) IsYANGGoStruct() {}", "title": "" }, { "docid": "fa804d4035914508cab5849ba409d44b", "score": "0.5572748", "text": "func (*OpenconfigInterfaces_Interfaces) IsYANGGoStruct() {}", "title": "" }, { "docid": "cbf5d79ec45e4e8680a8ed8e5ead4fa6", "score": "0.5563754", "text": "func marshalStruct(v reflect.Value, buff *bytes.Buffer, enc *json.Encoder) error {\n\tif v.Kind() == reflect.Ptr {\n\t\tv = v.Elem()\n\t}\n\t// We only care about custom Marshalling a struct.\n\tif v.Kind() != reflect.Struct {\n\t\treturn fmt.Errorf(\"bug: marshal() received a non *struct or struct, received type %T\", v.Interface())\n\t}\n\n\tif hasMarshalJSON(v) {\n\t\tb, err := callMarshalJSON(v)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbuff.Write(b)\n\t\treturn nil\n\t}\n\n\tt := v.Type()\n\n\t// If it has an AdditionalFields field make sure its the right type.\n\tf := v.FieldByName(addField)\n\tif f.Kind() != reflect.Invalid {\n\t\tif f.Kind() != reflect.Map {\n\t\t\treturn fmt.Errorf(\"type %T has field 'AdditionalFields' that is not a map[string]interface{}\", v.Interface())\n\t\t}\n\t\tif !f.Type().AssignableTo(mapStrInterType) {\n\t\t\treturn fmt.Errorf(\"type %T has field 'AdditionalFields' that is not a map[string]interface{}\", v.Interface())\n\t\t}\n\t}\n\n\ttranslator, err := findFields(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbuff.WriteByte(leftBrace)\n\tfor x := 0; x < v.NumField(); x++ {\n\t\tfield := v.Field(x)\n\n\t\t// We don't access private fields.\n\t\tif unicode.IsLower(rune(t.Field(x).Name[0])) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif t.Field(x).Name == addField {\n\t\t\tif v.Field(x).Len() > 0 {\n\t\t\t\tif err := writeAddFields(field.Interface(), buff, enc); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tbuff.WriteByte(comma)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// If they have omitempty set, we don't write out the field if\n\t\t// it is the zero value.\n\t\tif hasOmitEmpty(t.Field(x).Tag.Get(\"json\")) {\n\t\t\tif v.Field(x).IsZero() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\t// Write out the field name part.\n\t\tjsonName := translator.jsonName(t.Field(x).Name)\n\t\tbuff.WriteString(fmt.Sprintf(\"%q:\", jsonName))\n\n\t\tif field.Kind() == reflect.Ptr {\n\t\t\tfield = field.Elem()\n\t\t}\n\n\t\tif err := marshalStructField(field, buff, enc); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tbuff.Truncate(buff.Len() - 1) // Remove final comma\n\tbuff.WriteByte(rightBrace)\n\n\treturn nil\n}", "title": "" }, { "docid": "bd81440a25481c6032a0792d84929e81", "score": "0.55591446", "text": "func (*OpenconfigPlatform_Components_Component_Backplane) IsYANGGoStruct() {}", "title": "" }, { "docid": "86e3797c3a172d2346eb81ff95523e36", "score": "0.55510414", "text": "func (*OpenconfigSystem_System_Aaa_Accounting) IsYANGGoStruct() {}", "title": "" }, { "docid": "8819319d0b81adc39b4362c397e31f9a", "score": "0.5527667", "text": "func (*OpenconfigSystem_System_Messages_DebugEntries) IsYANGGoStruct() {}", "title": "" }, { "docid": "283d379df330acaec8f838d1616eba87", "score": "0.5526575", "text": "func (*OpenconfigInterfaces_Interfaces_Interface_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "dc9d779bcac2fa65852bc6633f8e0528", "score": "0.55222964", "text": "func (*OpenconfigSystem_System_Aaa_Authorization_Events) IsYANGGoStruct() {}", "title": "" }, { "docid": "db7096dc8fff1433b6cd5d751644e92f", "score": "0.5497778", "text": "func (*TerminalDevice_Channel) IsYANGGoStruct() {}", "title": "" }, { "docid": "268004b7c540067f5783914bca7116a6", "score": "0.5489993", "text": "func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface) IsYANGGoStruct() {}", "title": "" }, { "docid": "c96d2504b1090c92513fe7b599c469cc", "score": "0.5489599", "text": "func (*TerminalDevice_Channel_Otn_PreFecBer) IsYANGGoStruct() {}", "title": "" }, { "docid": "3d22591f098222b4e9a6215c2c078717", "score": "0.54881656", "text": "func (*OpenconfigMessages_Messages_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "2a5a3c2083418513b4a0d71561384576", "score": "0.54870033", "text": "func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces) IsYANGGoStruct() {}", "title": "" }, { "docid": "0b2ed1b65280226c876446cf26cdedeb", "score": "0.54857844", "text": "func (*TerminalDevice_Mode) IsYANGGoStruct() {}", "title": "" }, { "docid": "6eef145aa8455ac7e71240b2546ccadd", "score": "0.548397", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint) IsYANGGoStruct() {}", "title": "" }, { "docid": "093743d351a2ca8574e28032acd7867e", "score": "0.5482849", "text": "func (*TerminalDevice_Channel_Otn_Esnr) IsYANGGoStruct() {}", "title": "" }, { "docid": "985dbc312ee71310aafe9deb170611b0", "score": "0.54809284", "text": "func (*OpenconfigSystem_System_Aaa) IsYANGGoStruct() {}", "title": "" }, { "docid": "684cbbc9728a6177e8c6141db5f85da5", "score": "0.5478422", "text": "func (*OpenconfigSystem_System_Aaa_Accounting_Events_Event) IsYANGGoStruct() {}", "title": "" }, { "docid": "3fa269d5a199790fd46bac990a89e387", "score": "0.5449432", "text": "func (*OpenconfigMessages_Messages_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "a1fec23d274d56d9247f230813b9d834", "score": "0.5448199", "text": "func Struct(obj interface{}) bool {\n\treturn isType(obj, reflect.Struct)\n}", "title": "" }, { "docid": "72fc23e0daa9769628d257bd6815ed6a", "score": "0.54468924", "text": "func (*OpenconfigPlatform_Components_Component_Properties) IsYANGGoStruct() {}", "title": "" }, { "docid": "2313ee18aaf30d286b0f86d40f169287", "score": "0.5444036", "text": "func (*OpenconfigSystem_System_Aaa_Authorization) IsYANGGoStruct() {}", "title": "" }, { "docid": "b87ccc0792df6ab997b2e4a140ae942c", "score": "0.5443661", "text": "func (*OpenconfigPlatform_Components_Component_Fan_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "77126e88e964ec96e985fb2cfba29650", "score": "0.5436687", "text": "func (*OpenconfigInterfaces_Interfaces_Interface_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "f9afe85e879e4e63f049b9ee4c1922f0", "score": "0.5428087", "text": "func (*OpenconfigPlatform_Components_Component) IsYANGGoStruct() {}", "title": "" }, { "docid": "b3e813d98839456e9b0d2f112e7044df", "score": "0.5427491", "text": "func (*OpenconfigSystem_System_Aaa_Authorization_Events_Event) IsYANGGoStruct() {}", "title": "" }, { "docid": "6e2874a9ad10217849fa3a5d36a2d99f", "score": "0.54132575", "text": "func (*OpenconfigMessages_Messages_DebugEntries_DebugService) IsYANGGoStruct() {}", "title": "" }, { "docid": "33e94916289d8915d243522d64422a8a", "score": "0.53922105", "text": "func (*OpenconfigSystem_System_Alarms_Alarm_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "fa2d0b63e6e4fd39bca6d605b61be8cb", "score": "0.53896815", "text": "func (*OpenconfigMessages_Messages_State_Message) IsYANGGoStruct() {}", "title": "" }, { "docid": "71f33bd6f5a743c236d5b0c4ea41009f", "score": "0.5384826", "text": "func (*OpenconfigSystem_System_Openflow_Agent_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "1184a104acf1ef91e548f2555b354819", "score": "0.53801924", "text": "func (*OpenconfigSystem_System_Aaa_Accounting_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "377111325d184623d12483b59ae2831b", "score": "0.5379199", "text": "func (*OpenconfigPlatform_Components_Component_Fan_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "8bb3eff4398aa00838907fbb3d8b88a8", "score": "0.5377691", "text": "func (*OpenconfigSystem_System_Alarms_Alarm) IsYANGGoStruct() {}", "title": "" }, { "docid": "67bbe0252ad4cb40f59288d6a62e48bf", "score": "0.5370435", "text": "func (*OpenconfigSystem_System_Aaa_Accounting_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "8db67a7b52584e9bb48ee569892d7fa9", "score": "0.5366913", "text": "func (*OpenconfigSystem_System_Messages) IsYANGGoStruct() {}", "title": "" }, { "docid": "f1727b1d30a841a7def535c4797d413c", "score": "0.5363674", "text": "func (*OpenconfigPlatform_Components_Component_State_Memory) IsYANGGoStruct() {}", "title": "" }, { "docid": "a0d890c64aef733afabafe8fca8d4ede", "score": "0.5363293", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_System_Memory) IsYANGGoStruct() {}", "title": "" }, { "docid": "3f81051337930b67e91e1a8f1c65dcd0", "score": "0.5356698", "text": "func (*OpenconfigSystem_System_Memory) IsYANGGoStruct() {}", "title": "" }, { "docid": "fa590bd6e55fbd5353f8e6a72f3c1406", "score": "0.5343122", "text": "func (*OpenconfigSystem_System_Aaa_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "6bcadb51b01e4e299dd86526c25fcfaf", "score": "0.53393936", "text": "func TestStructFieldOmitempty(t *testing.T) {\n\ttype x struct {\n\t\tA string `json:\"a,omitempty\"`\n\t\tB string `json:\"b,omitempty\"`\n\t\tC *string `json:\"c,omitempty\"`\n\t\tCa *string `json:\"ca,omitempty\"`\n\t\tD *string `json:\"d,omitempty\"`\n\t\tE bool `json:\"e,omitempty\"`\n\t\tF int `json:\"f,omitempty\"`\n\t\tF1 int8 `json:\"f1,omitempty\"`\n\t\tF2 int16 `json:\"f2,omitempty\"`\n\t\tF3 int32 `json:\"f3,omitempty\"`\n\t\tF4 int64 `json:\"f4,omitempty\"`\n\t\tG uint `json:\"g,omitempty\"`\n\t\tG1 uint8 `json:\"g1,omitempty\"`\n\t\tG2 uint16 `json:\"g2,omitempty\"`\n\t\tG3 uint32 `json:\"g3,omitempty\"`\n\t\tG4 uint64 `json:\"g4,omitempty\"`\n\t\tG5 uintptr `json:\"g5,omitempty\"`\n\t\tH float32 `json:\"h,omitempty\"`\n\t\tI float64 `json:\"i,omitempty\"`\n\t\tJ1 map[int]int `json:\"j1,omitempty\"`\n\t\tJ2 map[int]int `json:\"j2,omitempty\"`\n\t\tJ3 map[int]int `json:\"j3,omitempty\"`\n\t\tK1 []string `json:\"k1,omitempty\"`\n\t\tK2 []string `json:\"k2,omitempty\"`\n\t}\n\tenc, err := NewEncoder(reflect.TypeOf(x{}))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\ts1 := \"Loreum Ipsum\"\n\ts2 := \"\"\n\txx := &x{\n\t\tA: \"Loreum\",\n\t\tB: \"\",\n\t\tC: &s1,\n\t\tCa: &s2,\n\t\tD: nil,\n\t\tJ2: map[int]int{},\n\t\tJ3: map[int]int{1: 42},\n\t\tK2: []string{\"Loreum\"},\n\t}\n\tvar buf bytes.Buffer\n\tif err := enc.Encode(xx, &buf); err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif !equalStdLib(t, xx, buf.Bytes()) {\n\t\tt.Error(\"expected outputs to be equal\")\n\t}\n}", "title": "" }, { "docid": "50aaa000329336027bf5676954810bcf", "score": "0.53346336", "text": "func TestWriteObject4(t *testing.T) {\n\tif !*crash {\n\t\texecCrasher(t, \"TestWriteObject4\")\n\t\treturn\n\t}\n\n\ttype foo struct {\n\t\tS string\n\t\tIP *int\n\t\tBS []*bool\n\t}\n\tf := &foo{\"foo\", new(int), []*bool{new(bool)}}\n\tf = Object(f).(*foo)\n\tf.S = \"bar\"\n}", "title": "" }, { "docid": "7cef1edc8362844db35fae589c96ae01", "score": "0.5333117", "text": "func (*OpenconfigPlatform_Components_Component_IntegratedCircuit) IsYANGGoStruct() {}", "title": "" }, { "docid": "a13064cc29c6ba64a7390d8cbfd32885", "score": "0.5330576", "text": "func (*OpenconfigSystem_System_Aaa_Authentication) IsYANGGoStruct() {}", "title": "" }, { "docid": "9793aeced36e4ddde8a1158cbafb299d", "score": "0.53264385", "text": "func (*OpenconfigSystem_System_Aaa_Authorization_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "589e85bed54d629cfcf8178c31af02a0", "score": "0.5324657", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_System_Aaa_Accounting_Events) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "2f4b951c5092096e4751ebf33cdac0be", "score": "0.5322456", "text": "func (*OpenconfigPlatform_Components_Component_Properties_Property) IsYANGGoStruct() {}", "title": "" }, { "docid": "8264623853c3b9339c49a0b2b8c3828b", "score": "0.5319166", "text": "func (*OpenconfigSystem_System_Openflow_Agent_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "5f5d40b029dad142da952732868a1bda", "score": "0.5315046", "text": "func (*OpenconfigSystem_System_Messages_DebugEntries_DebugService) IsYANGGoStruct() {}", "title": "" }, { "docid": "d933bc8ed596b74d81ce32ad762cd2dd", "score": "0.5313466", "text": "func (*OpenconfigSystem_System_Aaa_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "54bd46a1fc9a5d9fda29ad2d8c342b30", "score": "0.53132963", "text": "func (*OpenconfigSystem_System_Alarms_Alarm_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "08be2984750b3ba1eafa042048b49c78", "score": "0.53098285", "text": "func (*OpenconfigPlatform_Components_Component_Storage) IsYANGGoStruct() {}", "title": "" }, { "docid": "2d365bb1816a60cf79f96517963120cc", "score": "0.53054136", "text": "func (*TerminalDevice_Channel_Otn_QValue) IsYANGGoStruct() {}", "title": "" }, { "docid": "0a7bef110047e998e181a58293d0fa62", "score": "0.53008646", "text": "func (*OpenconfigSystem_System_Memory_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "70a1c661d8a6f7129b9a4b0fb47f9ab2", "score": "0.5294671", "text": "func (*OpenconfigSystem_System_Memory_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "105410b913ee096fcf9d78128ee17c3f", "score": "0.52928317", "text": "func (*OpenconfigPlatform_Components) IsYANGGoStruct() {}", "title": "" }, { "docid": "ad759091872d949e6e8fde0e5698d7b6", "score": "0.5291484", "text": "func TestMarshalUnmarshal(t *testing.T) {\n\tout := MarshalUnmarshal(hoge)\n\tif !reflect.DeepEqual(out, expect) {\n\t\tt.Errorf(\"%s != %s\", out, expect)\n\t}\n}", "title": "" }, { "docid": "b7b2a681ccaf0ec87d54262ff916ab6d", "score": "0.5286725", "text": "func (*OpenconfigInterfaces_Interfaces_Interface_HoldTime) IsYANGGoStruct() {}", "title": "" }, { "docid": "c7179fdd035ebf1ff2d3eabe37180f59", "score": "0.52761364", "text": "func (*OpenconfigSystem_System_Openflow_Controllers) IsYANGGoStruct() {}", "title": "" }, { "docid": "04659535cea61b53d006daad0fe188ea", "score": "0.5273656", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_Ssids_Ssid_Clients_Client_ClientConnection) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "6e3025ba3f6ff15fd8c79b8867b4bca1", "score": "0.5272343", "text": "func (*OpenconfigPlatform_Components_Component_Backplane_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "dd9d5aa0a3a1c249bd1213ffd2d527c6", "score": "0.5271667", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_Ssids_Ssid_Wmm) IsYANGGoStruct() {}", "title": "" }, { "docid": "7a774cb129e87dda0894b4e3c6b1f404", "score": "0.52683216", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_System_Aaa) IsYANGGoStruct() {}", "title": "" }, { "docid": "162070ba47121a85b9e6fdd18e721f80", "score": "0.5265068", "text": "func (*OpenconfigSystem_System_Aaa_Authorization_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "10771a572a5de176930620e07553a4b4", "score": "0.52639943", "text": "func (*OpenconfigSystem_System_Messages_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "04b5c94f2505528bfeba686574789a20", "score": "0.5252507", "text": "func (*OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config) IsYANGGoStruct() {}", "title": "" }, { "docid": "6605473694529251d31d2273559d1c7a", "score": "0.5249791", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_System_Aaa_Authorization_Events) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "e5618f69b30e48fbfbbdda516e8bba9e", "score": "0.5247248", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_System_Aaa_Accounting_Events_Event) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "fe536d99c987f464b6f09a7f26755c5f", "score": "0.5244084", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_System_Memory_State) IsYANGGoStruct() {}", "title": "" }, { "docid": "a99ffcc8f9c56a2a5a356433a827e4d0", "score": "0.52435005", "text": "func TestJSONMarshaler(t *testing.T) {\n\t// T = Non-pointer receiver of composite type.\n\t// S = Non-pointer receiver of primitive type.\n\t// I = Pointer receiver of composite type.\n\t// P = Pointer receiver of primitive type.\n\ttype x struct {\n\t\tT1 time.Time `json:\"t1\"`\n\t\tT2 time.Time `json:\"t2,omitempty\"`\n\t\tT3 *time.Time `json:\"t3\"`\n\t\tT4 *time.Time `json:\"t4\"` // nil\n\t\tT5 *time.Time `json:\"t5,omitempty\"` // nil\n\t\tS1 strJSONMarshaler `json:\"s1,omitempty\"`\n\t\tS2 strJSONMarshaler `json:\"s2,omitempty\"`\n\t\tS3 strJSONMarshaler `json:\"s3\"`\n\t\tS4 *strJSONMarshaler `json:\"s4\"`\n\t\tS5 *strJSONMarshaler `json:\"s5\"` // nil\n\t\tS6 *strJSONMarshaler `json:\"s6,omitempty\"` // nil\n\t\tI1 big.Int `json:\"i1\"`\n\t\tI2 big.Int `json:\"i2,omitempty\"`\n\t\tI3 *big.Int `json:\"i3\"`\n\t\tI4 *big.Int `json:\"i4\"` // nil\n\t\tI5 *big.Int `json:\"i5,omitempty\"` // nil\n\t\tP1 strPtrJSONMarshaler `json:\"p1,omitempty\"`\n\t\tP2 strPtrJSONMarshaler `json:\"p2,omitempty\"`\n\t\tP3 strPtrJSONMarshaler `json:\"p3\"`\n\t\tP4 *strPtrJSONMarshaler `json:\"p4\"`\n\t\tP5 *strPtrJSONMarshaler `json:\"p5\"` // nil\n\t\tP6 *strPtrJSONMarshaler `json:\"p6,omitempty\"` // nil\n\t}\n\tenc, err := NewEncoder(reflect.TypeOf(x{}))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tvar (\n\t\tnow = time.Now()\n\t\tsm = strJSONMarshaler(\"Loreum\")\n\t\tspm = strPtrJSONMarshaler(\"Loreum\")\n\t)\n\txx := x{\n\t\tT1: now,\n\t\tT3: &now,\n\t\tS1: \"Loreum\",\n\t\tS4: &sm,\n\t\tI1: *big.NewInt(math.MaxInt64),\n\t\tI3: big.NewInt(math.MaxInt64),\n\t\tP1: \"Loreum\",\n\t\tP4: &spm,\n\t}\n\ttestdata := []struct {\n\t\tname string\n\t\tval interface{}\n\t}{\n\t\t{\"non-pointer\", xx},\n\t\t{\"pointer\", &xx},\n\t}\n\tfor _, tt := range testdata {\n\t\ttt := tt\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tvar buf bytes.Buffer\n\t\t\tif err := enc.Encode(tt.val, &buf); err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\t\t\tif !equalStdLib(t, tt.val, buf.Bytes()) {\n\t\t\t\tt.Error(\"expected outputs to be equal\")\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "976ec8d6d8ef21d3b0c9c8d8bf189429", "score": "0.5238339", "text": "func (*OpenconfigSystem_System_Aaa_Authentication_Users) IsYANGGoStruct() {}", "title": "" }, { "docid": "5ae53d334755126471fcb031fad8e986", "score": "0.5223092", "text": "func (*OpenconfigAccessPoints_AccessPoints_AccessPoint_Ssids_Ssid_BandSteering_Config) IsYANGGoStruct() {\n}", "title": "" }, { "docid": "58dba5f069ebb3fb6f494df4b34508b9", "score": "0.5223058", "text": "func (b BlankNode) ValidAsObject() {}", "title": "" } ]
1a27b9e1a46b2f9d3e04d04d809459a9
SetDescription sets the Description field's value.
[ { "docid": "d8f598886282ca9e9b07063da993db7b", "score": "0.0", "text": "func (s *PutOutcomeInput) SetDescription(v string) *PutOutcomeInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" } ]
[ { "docid": "bfcdbc758f6ddeec0bec16f84bf5b0c5", "score": "0.8674098", "text": "func (c *Case) SetDescription(description string) error {\n\tif description == \"\" {\n\t\treturn fmt.Errorf(\"Description could not be empty\")\n\t}\n\tc.Description = description\n\treturn nil\n}", "title": "" }, { "docid": "841966061a260cd66a1bb4438d7a4cd3", "score": "0.86387485", "text": "func (s *Step) SetDescription(desc string) *Step {\n\ts.Description = desc\n\ts.parent.publishStep(s)\n\treturn s\n}", "title": "" }, { "docid": "72afac2f677e29061ca9c6418ed8ce86", "score": "0.8595924", "text": "func (b *Base) SetDescription(description string) {\n\tb.Description = description\n}", "title": "" }, { "docid": "216603c17f17f971e9fe3035e2248284", "score": "0.85639274", "text": "func (o *Automation) SetDescription(description string) {\n\n\to.Description = description\n}", "title": "" }, { "docid": "1352eb7354c1fa4769fafdf2e4b9a540", "score": "0.8510439", "text": "func (m *IncidentBasicRuleMutation) SetDescription(s string) {\n\tm._Description = &s\n}", "title": "" }, { "docid": "b27d761b4bc3e55c3323ce2e61df4f0d", "score": "0.847854", "text": "func (m *gerritListener) SetDescription(val *string) {\n\tm.descriptionField = val\n}", "title": "" }, { "docid": "c7b99299f4a1620076f8dab33300e08e", "score": "0.8467737", "text": "func (o *LDAPProvider) SetDescription(description string) {\n\n\to.Description = description\n}", "title": "" }, { "docid": "34b7038ecae520cac2c3d9a37ed19446", "score": "0.84301704", "text": "func (s *GetFlowTemplateOutput) SetDescription(v *FlowTemplateDescription) *GetFlowTemplateOutput {\n\ts.Description = v\n\treturn s\n}", "title": "" }, { "docid": "187a6bcc916ce66d211d87d339c5bc9a", "score": "0.8429755", "text": "func (o *OAuth2Client) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "3eb9f1b2836693f97525b1ef5fcc7077", "score": "0.8409862", "text": "func (o *SparseAutomation) SetDescription(description string) {\n\n\to.Description = &description\n}", "title": "" }, { "docid": "ae298d2f613ef4097d66da5f1a344354", "score": "0.8406318", "text": "func (m *pipelineSpec) SetDescription(val *string) {\n\tm.descriptionField = val\n}", "title": "" }, { "docid": "493ad4e379b5c3b94e686ec01da33ea1", "score": "0.8398954", "text": "func (o *GiveawaysPool) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "b4dae086bf2dddd1bc1d103a0f9a307b", "score": "0.83971107", "text": "func (o *TransactionSplitStore) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "01ab242be9c0b4ebe34ef636e940182f", "score": "0.83963984", "text": "func (o *SparseLDAPProvider) SetDescription(description string) {\n\n\to.Description = &description\n}", "title": "" }, { "docid": "4073697e29615a252edcfbab82d18cde", "score": "0.83927923", "text": "func (m *gerritListenerSpec) SetDescription(val *string) {\n\tm.descriptionField = val\n}", "title": "" }, { "docid": "5b05c23838746c2daf1911a55c315688", "score": "0.8378413", "text": "func (m *ResourceMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "cc234bbf0f1d9dda8fc0e71e15a83492", "score": "0.8378136", "text": "func (o *SearchLooksParams) SetDescription(description *string) {\n\to.Description = description\n}", "title": "" }, { "docid": "0f26754cf1418580ee85f8636242a60f", "score": "0.8368053", "text": "func (m *ComicMutation) SetDescription(s string) {\n\tm._Description = &s\n}", "title": "" }, { "docid": "61739e533c38e13668e79b92f484dfe3", "score": "0.8366723", "text": "func (m *AgentMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "fc673f158b9b1f31463c69818b870b57", "score": "0.836615", "text": "func (o *CreateVmTemplateRequest) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "3830c3eed3562fd15af9ff41f0212d0b", "score": "0.8350043", "text": "func (o *ViewTimer) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "b92af349a200b1c9c8fa943bb80bcfee", "score": "0.83490556", "text": "func (options *UpdateLockdownRuleOptions) SetDescription(description string) *UpdateLockdownRuleOptions {\n\toptions.Description = core.StringPtr(description)\n\treturn options\n}", "title": "" }, { "docid": "358b8858ce5edbed56ed8985f84e8951", "score": "0.83400357", "text": "func (m *ClusterMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "faccce69c8f3876c9b6e3004187de05a", "score": "0.8318431", "text": "func (s *SecurityGroupRuleRequest) SetDescription(v string) *SecurityGroupRuleRequest {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "633af0ddd2003f19ce67fa7de36b4f63", "score": "0.8312297", "text": "func (m *AccountMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "87f4380b2f0a57e46757047a53d3cbe3", "score": "0.8305818", "text": "func (trx *BaseTransaction) SetDescription(desc string) Transaction {\n\ttrx.Description = desc\n\treturn trx\n}", "title": "" }, { "docid": "f21817189814a267e15174f533c81985", "score": "0.8303283", "text": "func (m *NodeMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "e7280d13a04f99dd988dbca6539562f1", "score": "0.830068", "text": "func (s *GetNetworkAnalyzerConfigurationOutput) SetDescription(v string) *GetNetworkAnalyzerConfigurationOutput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "cd95f2a093a5cc42bc3f581a7a755bfe", "score": "0.8292785", "text": "func (o *UpdateVirtualInstanceRequest) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "335e81c4612ef7b8612b916c7dae81cd", "score": "0.82895356", "text": "func (m *TransactionMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "ebb3fa0b6511a3cab33a7a8872357f61", "score": "0.8280763", "text": "func (bu *BeerUpdate) SetDescription(s string) *BeerUpdate {\n\tbu.mutation.SetDescription(s)\n\treturn bu\n}", "title": "" }, { "docid": "b054f67cec09adabf7303701c67e7704", "score": "0.8274025", "text": "func (b *BotInlineResult) SetDescription(value string) {\n\tb.Flags.Set(2)\n\tb.Description = value\n}", "title": "" }, { "docid": "a4558b2fa67cf894eaa9e70090a57c3c", "score": "0.82721555", "text": "func (o *RegistryDTO) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "cabb8316f4bdebc487b549b2a716ab54", "score": "0.8261821", "text": "func (p *Product) SetDescription(description string) {\n\tp.Description = description\n}", "title": "" }, { "docid": "8dec346a3fa576740514339ba3f9cc8d", "score": "0.82569927", "text": "func (_options *UpdateEnrichmentOptions) SetDescription(description string) *UpdateEnrichmentOptions {\n\t_options.Description = core.StringPtr(description)\n\treturn _options\n}", "title": "" }, { "docid": "16c1ef3c23f894f83dfb001f64245678", "score": "0.8247957", "text": "func (r *Release) SetDescription(desc string) {\n\tr.description = desc\n}", "title": "" }, { "docid": "333008944a3f32b5266feaa547687bd2", "score": "0.8246901", "text": "func (o *EventCreation) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "714532886f04bba27cd026dded53b6ab", "score": "0.8242979", "text": "func (buo *BeerUpdateOne) SetDescription(s string) *BeerUpdateOne {\n\tbuo.mutation.SetDescription(s)\n\treturn buo\n}", "title": "" }, { "docid": "22079b3db4af2036d9d59ad4b63d0392", "score": "0.82391316", "text": "func (vcuo *VehicleClassUpdateOne) SetDescription(s string) *VehicleClassUpdateOne {\n\tvcuo.mutation.SetDescription(s)\n\treturn vcuo\n}", "title": "" }, { "docid": "23959df3410f74ad8031579f304a474e", "score": "0.8232074", "text": "func (o *PostBotRequest) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "b0e3045592b1c69e73756a9224ca3cdf", "score": "0.82299006", "text": "func (o *DescribeKeyPairsParams) SetDescription(description *string) {\n\to.Description = description\n}", "title": "" }, { "docid": "d3a373f0bbf5040c84aba7fa357c5c42", "score": "0.8228203", "text": "func (o *ScrapeTarget) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "a87f07dcbc4cd0b5184a102f87668ed8", "score": "0.82275164", "text": "func (vcu *VehicleClassUpdate) SetDescription(s string) *VehicleClassUpdate {\n\tvcu.mutation.SetDescription(s)\n\treturn vcu\n}", "title": "" }, { "docid": "8cd743d1b355d6d4fdaca4c03eb0cc46", "score": "0.82201", "text": "func (o *PostWebhookRequest) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "d603197f32110ee4a4156f5ed13c4e5c", "score": "0.8212276", "text": "func (s *RestApi) SetDescription(v string) *RestApi {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "1b732e91e7dc17252bb544d08c949d6f", "score": "0.8211065", "text": "func (o *AmazonAccountCreateSpec) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "a2054975ae95361ee92b7b6dae670c90", "score": "0.82109714", "text": "func (o *TemplateArgDef) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "7af8321688b50a44944b3d2e8d783438", "score": "0.82107073", "text": "func (s *ModifyNetworkInterfaceAttributeInput) SetDescription(v *AttributeValue) *ModifyNetworkInterfaceAttributeInput {\n\ts.Description = v\n\treturn s\n}", "title": "" }, { "docid": "aacc93af239e201d043590ef09d2b682", "score": "0.8207446", "text": "func (wc *WorkflowCreate) SetDescription(s string) *WorkflowCreate {\n\twc.mutation.SetDescription(s)\n\treturn wc\n}", "title": "" }, { "docid": "e112174ca72ae6f7ab6132da574b0b50", "score": "0.82028383", "text": "func (wou *WorkOrderUpdate) SetDescription(s string) *WorkOrderUpdate {\n\twou.mutation.SetDescription(s)\n\treturn wou\n}", "title": "" }, { "docid": "9d3a481b0b705542a1ec5f983663c312", "score": "0.8202567", "text": "func (wouo *WorkOrderUpdateOne) SetDescription(s string) *WorkOrderUpdateOne {\n\twouo.mutation.SetDescription(s)\n\treturn wouo\n}", "title": "" }, { "docid": "a72b2e72a9217d26d1cbeda9b21dcce7", "score": "0.8202398", "text": "func (s *CreateClientVpnRouteInput) SetDescription(v string) *CreateClientVpnRouteInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "16c5f4e0de350c799f018189ffc7fcaa", "score": "0.8202021", "text": "func (s *CreateRestApiInput) SetDescription(v string) *CreateRestApiInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "5fc0348e57af958bb89e6642c02d3693", "score": "0.8201238", "text": "func (s *UpdateSubnetGroupInput) SetDescription(v string) *UpdateSubnetGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "c426ff71349dc186224aefd904c18649", "score": "0.8193607", "text": "func (s *GetMulticastGroupOutput) SetDescription(v string) *GetMulticastGroupOutput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "8640946a796ee7970be31f94ff044287", "score": "0.8192294", "text": "func (s *CreateSecurityGroupInput) SetDescription(v string) *CreateSecurityGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "ac5c3766e4e7c9fc69bd4aa48e3fb5b9", "score": "0.81900877", "text": "func (o *Dashboard) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "1c501e1edfaf76ae52a772b8d5c6f08a", "score": "0.81894326", "text": "func (s *CreateIpamResourceDiscoveryInput) SetDescription(v string) *CreateIpamResourceDiscoveryInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "6a49230e1fe217c4a10cef0b148c7da5", "score": "0.8183408", "text": "func (o *ServiceDefinitionV1Info) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "b487cc1c240da455161ee869147b0e89", "score": "0.8181616", "text": "func (options *CreateZoneLockdownRuleOptions) SetDescription(description string) *CreateZoneLockdownRuleOptions {\n\toptions.Description = core.StringPtr(description)\n\treturn options\n}", "title": "" }, { "docid": "917660277d6f4f7256c56c3404f5b8b5", "score": "0.8181577", "text": "func (o *CalendareventsIdJsonEvent) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "8b25fb7c350e50ef7bb811cd0e68c77f", "score": "0.8178004", "text": "func (s *CreateNetworkAnalyzerConfigurationInput) SetDescription(v string) *CreateNetworkAnalyzerConfigurationInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "c461e39a1b66553050801919c23db271", "score": "0.8174406", "text": "func (o *HyperflexLun) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "76d1b6861745bba804afce12aa50d645", "score": "0.8172985", "text": "func (o *FullWebRequestRule) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "760cc401e901d4b682d49b752c52040a", "score": "0.81726176", "text": "func (m *GreeterMutation) SetDescription(s string) {\n\tm.description = &s\n}", "title": "" }, { "docid": "b8827bf686bbf881c2bd114291940142", "score": "0.8172179", "text": "func (o *AmazonAccount) SetDescription(v string) {\n\to.Description = v\n}", "title": "" }, { "docid": "e5c1e7505bd230f6ea6d43c7ebbf1859", "score": "0.8170331", "text": "func (s *UpdateNetworkAnalyzerConfigurationInput) SetDescription(v string) *UpdateNetworkAnalyzerConfigurationInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "12f4a42ebe38460be745aa5ba66c7232", "score": "0.8170047", "text": "func (s *DescribeNetworkInterfaceAttributeOutput) SetDescription(v *AttributeValue) *DescribeNetworkInterfaceAttributeOutput {\n\ts.Description = v\n\treturn s\n}", "title": "" }, { "docid": "7ce4919cfd68706a229c6e7ca6a2055e", "score": "0.81657416", "text": "func (o *PostServicesParams) SetDescription(description *string) {\n\to.Description = description\n}", "title": "" }, { "docid": "464856fa6da6d55038cb593d4b70a305", "score": "0.8165171", "text": "func (o *GuardianPolicyEditInput) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "e8a1859deb77a56216244263331b59cd", "score": "0.8161028", "text": "func (s *CreateApiKeyInput) SetDescription(v string) *CreateApiKeyInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "d1bba58550486491da20a924af85d817", "score": "0.81600684", "text": "func (rpc *ResourcePoolCreate) SetDescription(s string) *ResourcePoolCreate {\n\trpc.mutation.SetDescription(s)\n\treturn rpc\n}", "title": "" }, { "docid": "904827159cdeb92b4148643b1255297e", "score": "0.8155426", "text": "func (s *ModifyClientVpnEndpointInput) SetDescription(v string) *ModifyClientVpnEndpointInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "9bae76b9a5c4b753471f17faad5282ec", "score": "0.8154857", "text": "func (s *RepositoryCatalogDataInput) SetDescription(v string) *RepositoryCatalogDataInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "a932864340fba5509db554504b1f4d61", "score": "0.8151822", "text": "func (s *UpdateMulticastGroupInput) SetDescription(v string) *UpdateMulticastGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "c1879bdb6ad0afd9662d1bb78d0091ab", "score": "0.815151", "text": "func (s *GetSystemTemplateOutput) SetDescription(v *SystemTemplateDescription) *GetSystemTemplateOutput {\n\ts.Description = v\n\treturn s\n}", "title": "" }, { "docid": "ffffc2fc3b07d6714ff77c5698bb595d", "score": "0.81483793", "text": "func (s *CreateClientVpnEndpointInput) SetDescription(v string) *CreateClientVpnEndpointInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "84cddafc7b1a2f16c8b0fa652d4b69e8", "score": "0.8147341", "text": "func (s *ModifyIpamResourceDiscoveryInput) SetDescription(v string) *ModifyIpamResourceDiscoveryInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "eaef6159400b2ee1430d0c3521773022", "score": "0.81434876", "text": "func (b *BotInlineMediaResult) SetDescription(value string) {\n\tb.Flags.Set(3)\n\tb.Description = value\n}", "title": "" }, { "docid": "4987d047b5c30754944c2e03249a645c", "score": "0.8143411", "text": "func (u *VehicleModelUpsertOne) SetDescription(v string) *VehicleModelUpsertOne {\n\treturn u.Update(func(s *VehicleModelUpsert) {\n\t\ts.SetDescription(v)\n\t})\n}", "title": "" }, { "docid": "13cb478d9db2bd64b40f42abf94de245", "score": "0.81422794", "text": "func (s *CreateDBParameterGroupInput) SetDescription(v string) *CreateDBParameterGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "8d6a08ab3403da437d04f6f1427db080", "score": "0.8141426", "text": "func (s *UpdateClusterInput) SetDescription(v string) *UpdateClusterInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "55c5c2148673721b3b8c8b28b382c9a5", "score": "0.814089", "text": "func (o *InlineResponse20042Boards) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "b1e4cbce01c12e65426ce43989184650", "score": "0.8140125", "text": "func (mu *ModuleUpdate) SetDescription(s string) *ModuleUpdate {\n\tmu.description = &s\n\treturn mu\n}", "title": "" }, { "docid": "06a10eebe928edbc2bdab5161acf14da", "score": "0.814007", "text": "func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetDescription(v string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "a164c206fb54a49295f2467c67d32c40", "score": "0.8139008", "text": "func (mc *ModuleCreate) SetDescription(s string) *ModuleCreate {\n\tmc.description = &s\n\treturn mc\n}", "title": "" }, { "docid": "c9bb8756057ddc0eb2d7a515faf86630", "score": "0.8136967", "text": "func (journal *BaseJournal) SetDescription(newDesc string) Journal {\n\tjournal.Description = newDesc\n\treturn journal\n}", "title": "" }, { "docid": "c9c3f202d0f77a4cce2a4f0d2d63d66f", "score": "0.8136702", "text": "func (s *CreateVerifiedAccessGroupInput) SetDescription(v string) *CreateVerifiedAccessGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "c972f53e02f3d9260a272a07a4a8967c", "score": "0.81351143", "text": "func (s *CreateVerifiedAccessTrustProviderInput) SetDescription(v string) *CreateVerifiedAccessTrustProviderInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "1524e537917d66086b0e89f51e79bb54", "score": "0.81326497", "text": "func (s *CreateUsagePlanInput) SetDescription(v string) *CreateUsagePlanInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "d78b65dc12fcf1689e839b64d55cd986", "score": "0.813053", "text": "func (s *CreateSubnetCidrReservationInput) SetDescription(v string) *CreateSubnetCidrReservationInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "149f5f90fe457684dcefcf2e31d51722", "score": "0.81285423", "text": "func (o *VirtualInstance) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "ba4774d317bdb9af3f9a76048e0f5eeb", "score": "0.8126668", "text": "func (o *ResourceUpdateReqWeb) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "726d8ae2642a0fef12a3e9c590980d64", "score": "0.8120718", "text": "func (o *NetworkInterfaceList) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "80912fe2c153ffd23854627946805e93", "score": "0.81184435", "text": "func (o *CalculationDto) SetDescription(v string) {\n\to.Description = &v\n}", "title": "" }, { "docid": "ed60a5d1efeab36fc7ddd3534e9c5904", "score": "0.8116143", "text": "func (s *CreateIpamPoolInput) SetDescription(v string) *CreateIpamPoolInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "9df0cf9d55869108d40ce454d574a00c", "score": "0.8116126", "text": "func (s *GetModelVersionOutput) SetDescription(v string) *GetModelVersionOutput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "4835b2839ab007f21b67a7e0c957202a", "score": "0.81152815", "text": "func (s *ModifyVerifiedAccessGroupInput) SetDescription(v string) *ModifyVerifiedAccessGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" }, { "docid": "ba0523d7fbe0ef09262f3f654ff9822d", "score": "0.8114488", "text": "func (myOrganization *Organization) SetDescription(val string) {\n\tmyOrganization.Descriptionvar = &val\n}", "title": "" }, { "docid": "8c54929614bb5e55adcb9522a8c76786", "score": "0.81130177", "text": "func (p *Patch) SetDescription(desc string) error {\n\tp.Description = desc\n\treturn UpdateOne(\n\t\tbson.M{IdKey: p.Id},\n\t\tbson.M{\n\t\t\t\"$set\": bson.M{\n\t\t\t\tDescriptionKey: desc,\n\t\t\t},\n\t\t},\n\t)\n}", "title": "" }, { "docid": "b8f98a1cc9fd37d184b2f103c1a332b1", "score": "0.81116205", "text": "func (s *UpdateAttributeGroupInput) SetDescription(v string) *UpdateAttributeGroupInput {\n\ts.Description = &v\n\treturn s\n}", "title": "" } ]
f20b27d03ec18df6c37853d96f18aedf
GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received. Mutually exclusive with `trigger_template`.
[ { "docid": "da4a08d7a45c6fd5025590ba58babcf0", "score": "0.4359345", "text": "func (o LookupTriggerResultOutput) Github() GitHubEventsConfigResponseOutput {\n\treturn o.ApplyT(func(v LookupTriggerResult) GitHubEventsConfigResponse { return v.Github }).(GitHubEventsConfigResponseOutput)\n}", "title": "" } ]
[ { "docid": "46ea44145547af4c29d48b294a28030b", "score": "0.5434872", "text": "func (o LookupTriggerResultOutput) GitlabEnterpriseEventsConfig() GitLabEventsConfigResponseOutput {\n\treturn o.ApplyT(func(v LookupTriggerResult) GitLabEventsConfigResponse { return v.GitlabEnterpriseEventsConfig }).(GitLabEventsConfigResponseOutput)\n}", "title": "" }, { "docid": "98dfb5709e45dbfc51eeabdf0b287202", "score": "0.52285004", "text": "func TriggerPipelineConfig(client devopsclient.Interface, k8sclient kubernetes.Interface, spec *PipelineConfigTrigger) (response *PipelineTriggerResponse, err error) {\n\tvar (\n\t\tconfig *devopsv1alpha1.PipelineConfig\n\t)\n\tconfig, err = client.DevopsV1alpha1().PipelineConfigs(spec.Namespace).Get(spec.Name, api.GetOptionsInCache)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// read only copy to be writable\n\tconfig = config.DeepCopy()\n\tpipe := generatePipelineFromConfig(config)\n\tif spec.Commit != \"\" {\n\t\tann := pipe.ObjectMeta.GetAnnotations()\n\t\tif ann == nil {\n\t\t\tann = make(map[string]string)\n\t\t}\n\t\tann[common.AnnotationsCommit] = spec.Commit\n\t\tpipe.ObjectMeta.SetAnnotations(ann)\n\t}\n\n\t// only exists on mutliBranch case\n\tbranchName := strings.TrimSpace(spec.Branch)\n\tif config.Labels != nil && config.Labels[devopsv1alpha1.LabelPipelineKind] == devopsv1alpha1.LabelPipelineKindMultiBranch {\n\t\tif branchName == \"\" {\n\t\t\terr = fmt.Errorf(\"trigger a multiBranch [%s-%s] pipeline needs branch name\", spec.Namespace, spec.Name)\n\t\t\treturn\n\t\t}\n\n\t\tif pipe.Annotations == nil {\n\t\t\tpipe.Annotations = make(map[string]string, 0)\n\t\t}\n\n\t\tpipe.Annotations[common.AnnotationsKeyMultiBranchName] = branchName\n\t\tvar category string\n\n\t\tallBranches := make([]string, 0)\n\t\tallBranches = append(allBranches, collectBranches(common.AnnotationsKeyMultiBranchBranchList, config.Annotations, allBranches)...)\n\t\tallBranches = append(allBranches, collectBranches(common.AnnotationsKeyMultiBranchStaleBranchList, config.Annotations, allBranches)...)\n\t\tfor _, branch := range allBranches {\n\t\t\tif branch == branchName {\n\t\t\t\tcategory = \"branch\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif category == \"\" {\n\t\t\tallPRs := make([]string, 0)\n\t\t\tallPRs = append(allPRs, collectBranches(common.AnnotationsKeyMultiBranchPRList, config.Annotations, allPRs)...)\n\t\t\tallPRs = append(allPRs, collectBranches(common.AnnotationsKeyMultiBranchStalePRList, config.Annotations, allPRs)...)\n\t\t\tfor _, pr := range allPRs {\n\t\t\t\tif pr == branchName {\n\t\t\t\t\tcategory = \"pr\"\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif category == \"\" {\n\t\t\terr = fmt.Errorf(\"unknow branch [%s] category for this multi-branch [%s]\", branchName, spec.Name)\n\t\t\treturn\n\t\t}\n\n\t\tpipe.Annotations[common.AnnotationsKeyMultiBranchCategory] = category\n\t}\n\n\tlog.Println(\"Receive params: \", spec.Params)\n\n\tpipe.Spec.Parameters = append(pipe.Spec.Parameters, spec.Params...)\n\n\tpipe, err = client.DevopsV1alpha1().Pipelines(spec.Namespace).Create(pipe)\n\tif err != nil {\n\t\treturn\n\t}\n\tresponse = &PipelineTriggerResponse{\n\t\tPipeline: pipe,\n\t}\n\treturn\n}", "title": "" }, { "docid": "62fa49dbc948adff909b4180084fcdc4", "score": "0.5145593", "text": "func (o LookupTriggerResultOutput) RepositoryEventConfig() RepositoryEventConfigResponseOutput {\n\treturn o.ApplyT(func(v LookupTriggerResult) RepositoryEventConfigResponse { return v.RepositoryEventConfig }).(RepositoryEventConfigResponseOutput)\n}", "title": "" }, { "docid": "3b2d9d155c4ce9d618bb6dcb8665bd6a", "score": "0.512517", "text": "func NewConfig() Config {\n\t// Make sure to initialize lambda targets\n\tcfg := Config{\n\t\tWebhook: make(map[string]target.WebhookArgs),\n\t}\n\tcfg.Webhook[defaultTarget] = target.WebhookArgs{}\n\treturn cfg\n}", "title": "" }, { "docid": "f3401111cb652cf8dba54fd18b7e4ae1", "score": "0.5104644", "text": "func (m *GerritTriggerSpecGerritEventConfiguration) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateEventType(formats); err != nil {\n\t\tres = append(res, err)\n\t}\n\n\tif err := m.validatePipeline(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": "b1b374b14a32b082971dc88c3510571a", "score": "0.5088448", "text": "func FormatGithubEvent(eventType string, event *GHEvent, cfg *EventFormatterOptions) string {\n\tif cfg == nil {\n\t\tcfg = &EventFormatterOptions{\n\t\t\tLongURL: true,\n\t\t\tNoColors: false,\n\t\t}\n\t}\n\tvar msg = \"\"\n\tswitch eventType {\n\tcase \"push\":\n\t\tmsg = receive_push(event, cfg)\n\tcase \"commit_comment\":\n\t\tmsg = receive_commit_comment(event, cfg)\n\tcase \"pull_request\":\n\t\tmsg = receive_pull_request(event, cfg)\n\tcase \"pull_request_review_comment\":\n\t\tmsg = receive_pull_request_review_comment(event, cfg)\n\tcase \"issues\": // random plural\n\t\tmsg = receive_issues(event, cfg)\n\tcase \"issue_comment\":\n\t\tmsg = receive_issue_comment(event, cfg)\n\tcase \"gollum\":\n\t\tmsg = receive_gollum(event, cfg)\n\tdefault:\n\t\t//receive_unknown(eventType, event, cfg)\n\t}\n\n\tif cfg.NoColors {\n\t\tmsg = colorRE.ReplaceAllString(msg, \"\")\n\t}\n\n\treturn msg\n}", "title": "" }, { "docid": "c19a0eef8f8c9e820b75fef967f090fa", "score": "0.50365293", "text": "func ValidateBuildConfig(config *buildapi.BuildConfig) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\tallErrs = append(allErrs, validation.ValidateObjectMeta(&config.ObjectMeta, true, validation.NameIsDNSSubdomain, field.NewPath(\"metadata\"))...)\n\n\t// image change triggers that refer\n\tfromRefs := map[string]struct{}{}\n\tspecPath := field.NewPath(\"spec\")\n\ttriggersPath := specPath.Child(\"triggers\")\n\tbuildFrom := buildinternalhelpers.GetInputReference(config.Spec.Strategy)\n\tfor i, trg := range config.Spec.Triggers {\n\t\tallErrs = append(allErrs, validateTrigger(&trg, buildFrom, triggersPath.Index(i))...)\n\t\tif trg.Type != buildapi.ImageChangeBuildTriggerType || trg.ImageChange == nil {\n\t\t\tcontinue\n\t\t}\n\t\tfrom := trg.ImageChange.From\n\t\tif from == nil {\n\t\t\tfrom = buildFrom\n\t\t}\n\t\tfromKey := refKey(config.Namespace, from)\n\t\t_, exists := fromRefs[fromKey]\n\t\tif exists {\n\t\t\tallErrs = append(allErrs, field.Invalid(triggersPath, config.Spec.Triggers, \"multiple ImageChange triggers refer to the same image stream tag\"))\n\t\t}\n\t\tfromRefs[fromKey] = struct{}{}\n\t}\n\n\tswitch config.Spec.RunPolicy {\n\tcase buildapi.BuildRunPolicyParallel, buildapi.BuildRunPolicySerial, buildapi.BuildRunPolicySerialLatestOnly:\n\tdefault:\n\t\tallErrs = append(allErrs, field.Invalid(specPath.Child(\"runPolicy\"), config.Spec.RunPolicy,\n\t\t\t\"run policy must Parallel, Serial, or SerialLatestOnly\"))\n\t}\n\n\tif config.Spec.SuccessfulBuildsHistoryLimit != nil {\n\t\tallErrs = append(allErrs, validation.ValidateNonnegativeField(int64(*config.Spec.SuccessfulBuildsHistoryLimit), specPath.Child(\"successfulBuildsHistoryLimit\"))...)\n\t}\n\n\tif config.Spec.FailedBuildsHistoryLimit != nil {\n\t\tallErrs = append(allErrs, validation.ValidateNonnegativeField(int64(*config.Spec.FailedBuildsHistoryLimit), specPath.Child(\"failedBuildsHistoryLimit\"))...)\n\t}\n\n\tallErrs = append(allErrs, validateCommonSpec(&config.Spec.CommonSpec, specPath)...)\n\n\treturn allErrs\n}", "title": "" }, { "docid": "b809f99ef50ede79cf9c224ea77ce6b6", "score": "0.49315128", "text": "func NewConfig() Config {\n\treturn Config{\n\t\tFormat: null.StringFrom(\"json\"),\n\t\tPushInterval: types.NullDurationFrom(1 * time.Second),\n\t}\n}", "title": "" }, { "docid": "11e449fef3a142cba66bb31e60cf6a48", "score": "0.48914102", "text": "func GenerateGitHubOAuthConfig() (*oauth2.Config, error) {\n\tconfig := oauth2.Config{\n\t\tClientID: \"\", // Filled in from secrets\n\t\tClientSecret: \"\", // Filled in from secrets\n\t\tEndpoint: github.Endpoint,\n\t\tRedirectURL: callbackUrl(PART_URL_LOGIN_CALLBACK_GITHUB),\n\t\tScopes: []string{githubCredentialsScopeUser, githubCredentialsScopeEmail},\n\t}\n\n\treturn addSecretsToOAuthConfig(\"github\", config)\n}", "title": "" }, { "docid": "66ff27716cb28b5c80643602d81e5e78", "score": "0.478328", "text": "func FactoryGitHubConfigurationGenerator() gopter.Gen {\n\tif factoryGitHubConfigurationGenerator != nil {\n\t\treturn factoryGitHubConfigurationGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForFactoryGitHubConfiguration(generators)\n\tfactoryGitHubConfigurationGenerator = gen.Struct(reflect.TypeOf(FactoryGitHubConfiguration{}), 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\tAddIndependentPropertyGeneratorsForFactoryGitHubConfiguration(generators)\n\tAddRelatedPropertyGeneratorsForFactoryGitHubConfiguration(generators)\n\tfactoryGitHubConfigurationGenerator = gen.Struct(reflect.TypeOf(FactoryGitHubConfiguration{}), generators)\n\n\treturn factoryGitHubConfigurationGenerator\n}", "title": "" }, { "docid": "97a4e878cbb23a8421a0c0696c42b155", "score": "0.47757974", "text": "func AllEventsConfig(ctx context.Context, store rangedb.Store, broadcaster broadcast.Broadcaster, bufferLength int, consumeRecord ConsumeRecordFunc) Config {\n\treturn Config{\n\t\tBufferSize: bufferLength,\n\t\tCtx: ctx,\n\t\tSubscribe: func(subscriber broadcast.RecordSubscriber) {\n\t\t\tbroadcaster.SubscribeAllEvents(subscriber)\n\t\t},\n\t\tUnsubscribe: func(subscriber broadcast.RecordSubscriber) {\n\t\t\tbroadcaster.UnsubscribeAllEvents(subscriber)\n\t\t},\n\t\tGetRecords: func(globalSequenceNumber uint64) rangedb.RecordIterator {\n\t\t\treturn store.Events(ctx, globalSequenceNumber)\n\t\t},\n\t\tConsumeRecord: consumeRecord,\n\t}\n}", "title": "" }, { "docid": "8211d780450ea81f54250363b1e55405", "score": "0.46952245", "text": "func (provider GithubProvider) OAuthConfig(context *auth.Context) *oauth2.Config {\n\tvar (\n\t\tconfig = provider.Config\n\t\treq = context.Request\n\t\tscheme = req.URL.Scheme\n\t)\n\n\tif scheme == \"\" {\n\t\tscheme = \"http://\"\n\t}\n\n\treturn &oauth2.Config{\n\t\tClientID: config.ClientID,\n\t\tClientSecret: config.ClientSecret,\n\t\tEndpoint: oauth2.Endpoint{\n\t\t\tAuthURL: config.AuthorizeURL,\n\t\t\tTokenURL: config.TokenURL,\n\t\t},\n\t\tRedirectURL: scheme + req.Host + context.Auth.AuthURL(\"github/callback\"),\n\t\tScopes: config.Scopes,\n\t}\n}", "title": "" }, { "docid": "ee57c74a7e731c6229767742002e18d3", "score": "0.45857054", "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": "0d573c99a083c28720f7372d43998920", "score": "0.45551842", "text": "func (ch *ChampionshipsHandler) eventConfiguration(w http.ResponseWriter, r *http.Request) {\n\tchampionshipRaceOpts, err := ch.championshipManager.BuildChampionshipEventOpts(r)\n\n\tif err != nil {\n\t\tlogrus.WithError(err).Errorf(\"couldn't build championship race\")\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tch.viewRenderer.MustLoadTemplate(w, r, \"custom-race/new.html\", championshipRaceOpts)\n}", "title": "" }, { "docid": "693a614e7569101b43027cbe2e087d4c", "score": "0.45328882", "text": "func OnConfigChange(run func(in fsnotify.Event)) { v.OnConfigChange(run) }", "title": "" }, { "docid": "5142ec15040c2f89e0f436fbce8d27e9", "score": "0.45259416", "text": "func AddRelatedPropertyGeneratorsForFactoryGitHubConfiguration(gens map[string]gopter.Gen) {\n\tgens[\"ClientSecret\"] = gen.PtrOf(GitHubClientSecretGenerator())\n}", "title": "" }, { "docid": "1ddeee74246dee4cb71a86440e2d0a25", "score": "0.4515122", "text": "func (*EventHub) SampleConfig() string {\n\treturn `\n ## The default behavior is to create a new Event Hub client from environment variables.\n ## This requires one of the following sets of environment variables to be set:\n ##\n ## 1) Expected Environment Variables:\n ## - \"EVENTHUB_CONNECTION_STRING\"\n ##\n ## 2) Expected Environment Variables:\n ## - \"EVENTHUB_NAMESPACE\"\n ## - \"EVENTHUB_NAME\"\n ## - \"EVENTHUB_KEY_NAME\"\n ## - \"EVENTHUB_KEY_VALUE\"\n\n ## 3) Expected Environment Variables:\n ## - \"EVENTHUB_NAMESPACE\"\n ## - \"EVENTHUB_NAME\"\n ## - \"AZURE_TENANT_ID\"\n ## - \"AZURE_CLIENT_ID\"\n ## - \"AZURE_CLIENT_SECRET\"\n\n ## Uncommenting the option below will create an Event Hub client based solely on the connection string.\n ## This can either be the associated environment variable or hard coded directly.\n ## If this option is uncommented, environment variables will be ignored.\n ## Connection string should contain EventHubName (EntityPath)\n # connection_string = \"\"\n\n ## Set persistence directory to a valid folder to use a file persister instead of an in-memory persister\n # persistence_dir = \"\"\n\n ## Change the default consumer group\n # consumer_group = \"\"\n\n ## By default the event hub receives all messages present on the broker, alternative modes can be set below.\n ## The timestamp should be in https://github.com/toml-lang/toml#offset-date-time format (RFC 3339).\n ## The 3 options below only apply if no valid persister is read from memory or file (e.g. first run).\n # from_timestamp =\n # latest = true\n\n ## Set a custom prefetch count for the receiver(s)\n # prefetch_count = 1000\n\n ## Add an epoch to the receiver(s)\n # epoch = 0\n\n ## Change to set a custom user agent, \"telegraf\" is used by default\n # user_agent = \"telegraf\"\n\n ## To consume from a specific partition, set the partition_ids option.\n ## An empty array will result in receiving from all partitions.\n # partition_ids = [\"0\",\"1\"]\n\n ## Max undelivered messages\n # max_undelivered_messages = 1000\n\n ## Set either option below to true to use a system property as timestamp.\n ## You have the choice between EnqueuedTime and IoTHubEnqueuedTime.\n ## It is recommended to use this setting when the data itself has no timestamp.\n # enqueued_time_as_ts = true\n # iot_hub_enqueued_time_as_ts = true\n\n ## Tags or fields to create from keys present in the application property bag.\n ## These could for example be set by message enrichments in Azure IoT Hub.\n # application_property_tags = []\n # application_property_fields = []\n\n ## Tag or field name to use for metadata\n ## By default all metadata is disabled\n # sequence_number_field = \"SequenceNumber\"\n # enqueued_time_field = \"EnqueuedTime\"\n # offset_field = \"Offset\"\n # partition_id_tag = \"PartitionID\"\n # partition_key_tag = \"PartitionKey\"\n # iot_hub_device_connection_id_tag = \"IoTHubDeviceConnectionID\"\n # iot_hub_auth_generation_id_tag = \"IoTHubAuthGenerationID\"\n # iot_hub_connection_auth_method_tag = \"IoTHubConnectionAuthMethod\"\n # iot_hub_connection_module_id_tag = \"IoTHubConnectionModuleID\"\n # iot_hub_enqueued_time_field = \"IoTHubEnqueuedTime\"\n\n ## Data format to consume.\n ## Each data format has its own unique set of configuration options, read\n ## more about them here:\n ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md\n data_format = \"influx\"\n `\n}", "title": "" }, { "docid": "9d4f09fc45c0f65454e61be08a6d3031", "score": "0.4498691", "text": "func (o RegistryOutput) EventNotificationConfigs() EventNotificationConfigResponseArrayOutput {\n\treturn o.ApplyT(func(v *Registry) EventNotificationConfigResponseArrayOutput { return v.EventNotificationConfigs }).(EventNotificationConfigResponseArrayOutput)\n}", "title": "" }, { "docid": "bbc07a225946a99d94a25b98422060b3", "score": "0.44958147", "text": "func PushConfig(ctx context.Context, payload, repoTag string, opts RegistryOptions, labels map[string]string) (string, error) {\n\treturn PushConfigMulti(ctx, map[string]string{\n\t\t\"config\": payload,\n\t}, repoTag, opts, labels)\n}", "title": "" }, { "docid": "d075a520cb69831c403dc9df56fa2742", "score": "0.44933543", "text": "func (m *MockChangesetSource) GitserverPushConfig(v0 context.Context, v1 database.ExternalServiceStore, v2 *types.Repo) (*protocol.PushConfig, error) {\n\tr0, r1 := m.GitserverPushConfigFunc.nextHook()(v0, v1, v2)\n\tm.GitserverPushConfigFunc.appendCall(ChangesetSourceGitserverPushConfigFuncCall{v0, v1, v2, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "df4432cf5a65646435a1da6ab0ea491f", "score": "0.4489216", "text": "func (o RuleOutput) ConfigRuleTriggerTypes() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Rule) pulumi.StringOutput { return v.ConfigRuleTriggerTypes }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c83d759b35e087ec7d4764e3c845e5c1", "score": "0.44879517", "text": "func (m *MockForkableChangesetSource) GitserverPushConfig(v0 context.Context, v1 database.ExternalServiceStore, v2 *types.Repo) (*protocol.PushConfig, error) {\n\tr0, r1 := m.GitserverPushConfigFunc.nextHook()(v0, v1, v2)\n\tm.GitserverPushConfigFunc.appendCall(ForkableChangesetSourceGitserverPushConfigFuncCall{v0, v1, v2, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "4449f2f182ba5124a3100e8fdb759aaa", "score": "0.44538328", "text": "func (s *FlowDefinition) SetTriggerConfig(v *TriggerConfig) *FlowDefinition {\n\ts.TriggerConfig = v\n\treturn s\n}", "title": "" }, { "docid": "3c12f97e4d37fc68e8f7280aa42304a2", "score": "0.4451486", "text": "func ConfigMerge(cfg *config.Config, pluginsCfg *plugins.Configuration, repoConfig *triggerconfig.Config, repoOwner string, repoName string) error {\n\trepoKey := repoOwner + \"/\" + repoName\n\tif len(repoConfig.Spec.Presubmits) > 0 {\n\t\t// lets make a new map to avoid concurrent modifications\n\t\tm := map[string][]job.Presubmit{}\n\t\tif cfg.Presubmits != nil {\n\t\t\tfor k, v := range cfg.Presubmits {\n\t\t\t\tm[k] = append([]job.Presubmit{}, v...)\n\t\t\t}\n\t\t}\n\t\tcfg.Presubmits = m\n\n\t\tps := cfg.Presubmits[repoKey]\n\t\tfor _, p := range repoConfig.Spec.Presubmits {\n\t\t\tfound := false\n\t\t\tfor i := range ps {\n\t\t\t\tpt2 := &ps[i]\n\t\t\t\tif pt2.Name == p.Name {\n\t\t\t\t\t*pt2 = p\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\tps = append(ps, p)\n\t\t\t}\n\t\t}\n\t\tcfg.Presubmits[repoKey] = ps\n\t}\n\tif len(repoConfig.Spec.Postsubmits) > 0 {\n\t\t// lets make a new map to avoid concurrent modifications\n\t\tm := map[string][]job.Postsubmit{}\n\t\tif cfg.Postsubmits != nil {\n\t\t\tfor k, v := range cfg.Postsubmits {\n\t\t\t\tm[k] = append([]job.Postsubmit{}, v...)\n\t\t\t}\n\t\t}\n\t\tcfg.Postsubmits = m\n\n\t\tps := cfg.Postsubmits[repoKey]\n\t\tfor _, p := range repoConfig.Spec.Postsubmits {\n\t\t\tfound := false\n\t\t\tfor i := range ps {\n\t\t\t\tpt2 := &ps[i]\n\t\t\t\tif pt2.Name == p.Name {\n\t\t\t\t\tps[i] = p\n\t\t\t\t\tfound = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\tps = append(ps, p)\n\t\t\t}\n\t\t}\n\t\tcfg.Postsubmits[repoKey] = ps\n\t}\n\n\t// lets make sure we've got a trigger added\n\tidx := len(pluginsCfg.Triggers) - 1\n\tif idx < 0 {\n\t\tidx = 0\n\t\tpluginsCfg.Triggers = append(pluginsCfg.Triggers, plugins.Trigger{})\n\t}\n\tif StringArrayIndex(pluginsCfg.Triggers[idx].Repos, repoKey) < 0 {\n\t\tpluginsCfg.Triggers[idx].Repos = append(pluginsCfg.Triggers[idx].Repos, repoKey)\n\t}\n\n\t// lets validate the configuration is valid\n\terr := pluginsCfg.Validate()\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to validate plugins\")\n\t}\n\tmigrateOldConfig(&cfg.JobConfig)\n\terr = cfg.Init(cfg.ProwConfig)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to initialize config\")\n\t}\n\terr = cfg.Validate(cfg.ProwConfig)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"failed to validate config\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "619c14b174750928e90f9625b40b6f4b", "score": "0.44419158", "text": "func (m *jiraEventConfig) Validate(formats strfmt.Registry) error {\n\tvar res []error\n\n\tif err := m.validateEvent(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": "f88b0ef2860401265bd05e43fe1a99c3", "score": "0.4438759", "text": "func New(config Config) (*Eventer, error) {\n\t// Dependencies.\n\tif config.HTTPClient == nil {\n\t\treturn nil, microerror.Maskf(invalidConfigError, \"config.HTTPClient must not be empty\")\n\t}\n\tif config.Logger == nil {\n\t\treturn nil, microerror.Maskf(invalidConfigError, \"config.Logger must not be empty\")\n\t}\n\n\t// Settings.\n\tif config.OAuthToken == \"\" {\n\t\treturn nil, microerror.Maskf(invalidConfigError, \"config.OAuthToken token must not be empty\")\n\t}\n\tif config.Organisation == \"\" {\n\t\treturn nil, microerror.Maskf(invalidConfigError, \"config.Organisation must not be empty\")\n\t}\n\n\teventer := &Eventer{\n\t\t// Dependencies.\n\t\tclient: config.HTTPClient,\n\t\tlogger: config.Logger,\n\n\t\t// Settings.\n\t\toauthToken: config.OAuthToken,\n\t\torganisation: config.Organisation,\n\t}\n\n\treturn eventer, nil\n}", "title": "" }, { "docid": "5ad46ead9453cad025ba5e179dfb62ba", "score": "0.44287592", "text": "func NewConfig(mainchan chan *message.Container, onlinetable *onlinetable.Container) Config {\n\treturn Config{\n\t\tmainchan: mainchan,\n\t\tonlinetable: onlinetable,\n\t}\n}", "title": "" }, { "docid": "c34cba3a4dad13c15a9fed43f8c03080", "score": "0.4427385", "text": "func WithNotificationConfig(s *v1beta1.NotificationConfiguration) BucketModifier { //nolint\n\treturn func(r *v1beta1.Bucket) { r.Spec.ForProvider.NotificationConfiguration = s }\n}", "title": "" }, { "docid": "3a88ac3c9d1a3ba82214eb252f9c0793", "score": "0.44187874", "text": "func NewGithubEnterpriseConfig(ctx *pulumi.Context,\n\tname string, args *GithubEnterpriseConfigArgs, opts ...pulumi.ResourceOption) (*GithubEnterpriseConfig, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.AppId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'AppId'\")\n\t}\n\tvar resource GithubEnterpriseConfig\n\terr := ctx.RegisterResource(\"google-native:cloudbuild/v1:GithubEnterpriseConfig\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}", "title": "" }, { "docid": "703f5f80f9816c1cfc04a7b01f1f9a16", "score": "0.44180113", "text": "func TestBuildConfigDockerStrategyImageChangeTrigger(t *testing.T) {\n\tbuildConfig := &buildapi.BuildConfig{\n\t\tObjectMeta: metav1.ObjectMeta{Name: \"config-id\", Namespace: \"namespace\"},\n\t\tSpec: buildapi.BuildConfigSpec{\n\t\t\tRunPolicy: buildapi.BuildRunPolicySerial,\n\t\t\tCommonSpec: buildapi.CommonSpec{\n\t\t\t\tSource: buildapi.BuildSource{\n\t\t\t\t\tGit: &buildapi.GitBuildSource{\n\t\t\t\t\t\tURI: \"http://github.com/my/repository\",\n\t\t\t\t\t},\n\t\t\t\t\tContextDir: \"context\",\n\t\t\t\t},\n\t\t\t\tStrategy: buildapi.BuildStrategy{\n\t\t\t\t\tDockerStrategy: &buildapi.DockerBuildStrategy{},\n\t\t\t\t},\n\t\t\t\tOutput: buildapi.BuildOutput{\n\t\t\t\t\tTo: &kapi.ObjectReference{\n\t\t\t\t\t\tKind: \"DockerImage\",\n\t\t\t\t\t\tName: \"repository/data\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tTriggers: []buildapi.BuildTriggerPolicy{\n\t\t\t\t{\n\t\t\t\t\tType: buildapi.ImageChangeBuildTriggerType,\n\t\t\t\t\tImageChange: &buildapi.ImageChangeTrigger{},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\terrors := ValidateBuildConfig(buildConfig)\n\tswitch len(errors) {\n\tcase 0:\n\t\tt.Errorf(\"Expected validation error, got nothing\")\n\tcase 1:\n\t\terr := errors[0]\n\t\tif err.Type != field.ErrorTypeInvalid {\n\t\t\tt.Errorf(\"Expected error to be '%v', got '%v'\", field.ErrorTypeInvalid, err.Type)\n\t\t}\n\tdefault:\n\t\tt.Errorf(\"Expected a single validation error, got %v\", errors)\n\t}\n}", "title": "" }, { "docid": "caaeecd545c6070d7387f1428d19ee8e", "score": "0.4386061", "text": "func (h *handler) PullRequestEvent(w http.ResponseWriter, r *http.Request) {\n\tevent := &go_github.PullRequestEvent{}\n\tif err := json.NewDecoder(r.Body).Decode(event); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif !(event.GetAction() == \"opened\" || event.GetAction() == \"synchronize\") {\n\t\tw.WriteHeader(http.StatusOK)\n\t\tif _, err := w.Write([]byte(\"{\\\"message\\\":\\\"skip build\\\"}\")); err != nil {\n\t\t\tlogrus.Errorf(\"%+v\", err)\n\t\t}\n\t\treturn\n\t}\n\n\treqID, err := reqID(r)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tpr := event.GetPullRequest()\n\ttgt := &target.GitHub{\n\t\tRepo: pr.GetHead().GetRepo(),\n\n\t\tPoint: &github.SimpleTargetPoint{\n\t\t\tRef: fmt.Sprintf(\"refs/heads/%s\", pr.GetHead().GetRef()),\n\t\t\tSHA: pr.GetHead().GetSHA(),\n\t\t},\n\t}\n\n\ttargetURL := targetURL(r)\n\ttargetURL.Path = fmt.Sprintf(\"/logs/%s\", reqID.ToSlice())\n\tctx := application.ContextWithJob(context.Background(), &application.BuildJob{\n\t\tID: reqID,\n\t\tTargetSource: &github.TargetSource{\n\t\t\tRepository: event.GetRepo(),\n\t\t\tRef: tgt.Point.GetRef(),\n\t\t\tSHA: plumbing.NewHash(tgt.Point.GetHead()),\n\t\t},\n\t\tTaskName: fmt.Sprintf(\"%s/pr\", application.Name),\n\t\tTargetURL: targetURL,\n\t})\n\n\tgo func() {\n\t\tif err := h.executor.Execute(ctx, tgt); err != nil {\n\t\t\tlogrus.Errorf(\"%+v\", err)\n\t\t}\n\t}()\n\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "d5d92a97961cce03f6de4111e8b6b1f0", "score": "0.43832523", "text": "func AggregateTypesConfig(ctx context.Context, store rangedb.Store, broadcaster broadcast.Broadcaster, bufferLength int, aggregateTypes []string, consumeRecord ConsumeRecordFunc) Config {\n\treturn Config{\n\t\tBufferSize: bufferLength,\n\t\tCtx: ctx,\n\t\tSubscribe: func(subscriber broadcast.RecordSubscriber) {\n\t\t\tbroadcaster.SubscribeAggregateTypes(subscriber, aggregateTypes...)\n\t\t},\n\t\tUnsubscribe: func(subscriber broadcast.RecordSubscriber) {\n\t\t\tbroadcaster.UnsubscribeAggregateTypes(subscriber, aggregateTypes...)\n\t\t},\n\t\tGetRecords: func(globalSequenceNumber uint64) rangedb.RecordIterator {\n\t\t\treturn store.EventsByAggregateTypes(ctx, globalSequenceNumber, aggregateTypes...)\n\t\t},\n\t\tConsumeRecord: consumeRecord,\n\t}\n}", "title": "" }, { "docid": "cbaa24fed6a34545abb771d00b029a0b", "score": "0.43738872", "text": "func (ps *PushStatus) OnConfigChange() {\n\tLastPushStatus = ps\n\tps.UpdateMetrics()\n}", "title": "" }, { "docid": "4d7157ff5af59711d0436240d7289376", "score": "0.43469235", "text": "func HasChangeTrigger(config *appsapi.DeploymentConfig) bool {\n\tfor _, trigger := range config.Spec.Triggers {\n\t\tif trigger.Type == appsapi.DeploymentTriggerOnConfigChange {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "012880dd4dae20b0fde97ff982fe941d", "score": "0.4310093", "text": "func renderOVNFlowsConfig(bootstrapResult *bootstrap.BootstrapResult, data *render.RenderData) {\n\tflows := bootstrapResult.OVN.FlowsConfig\n\tif flows == nil {\n\t\treturn\n\t}\n\tif flows.Target == \"\" {\n\t\tklog.Warningf(\"ovs-flows-config configmap 'target' field can't be empty. Ignoring configuration: %+v\", flows)\n\t\treturn\n\t}\n\t// if IPFIX collectors are provided by means of both the operator configuration and the\n\t// ovs-flows-config ConfigMap, we will merge both targets\n\tif colls, ok := data.Data[\"IPFIXCollectors\"].(string); !ok || colls == \"\" {\n\t\tdata.Data[\"IPFIXCollectors\"] = flows.Target\n\t} else {\n\t\tdata.Data[\"IPFIXCollectors\"] = colls + \",\" + flows.Target\n\t}\n\tif flows.CacheMaxFlows != nil {\n\t\tdata.Data[\"IPFIXCacheMaxFlows\"] = *flows.CacheMaxFlows\n\t}\n\tif flows.Sampling != nil {\n\t\tdata.Data[\"IPFIXSampling\"] = *flows.Sampling\n\t}\n\tif flows.CacheActiveTimeout != nil {\n\t\tdata.Data[\"IPFIXCacheActiveTimeout\"] = *flows.CacheActiveTimeout\n\t}\n}", "title": "" }, { "docid": "2dec3527458d38167ae7a2a415d0f897", "score": "0.4308603", "text": "func (d *Driver) Config() map[string]string {\n\treturn map[string]string{\n\t\t\"PULL_ALWAYS\": \"Always pull image, even if locally available (0|1)\",\n\t\t\"DOCKER_DRIVER_QUIET\": \"Make the Docker driver quiet (only print container stdout/stderr)\",\n\t\t\"CLEANUP_CONTAINERS\": \"If true, the docker container will be destroyed when it finishes running. If false, it will not be destroyed. The supported values are true and false. Defaults to true.\",\n\t\tSettingNetwork: \"Attach the invocation image to the specified docker network\",\n\t}\n}", "title": "" }, { "docid": "1f7044576d4106c1393d39d2085692ea", "score": "0.4305935", "text": "func Build(config Config) Repository {\n\treturn &eventSourceRepository{\n\t\teventStore: config.eventStore,\n\t\tsnapshotStore: config.snapshotStore,\n\t\tnewAggregate: config.aggregateFactory,\n\t\tlisteners: config.listeners,\n\t}\n}", "title": "" }, { "docid": "b7fd2975cbdd992f92373b20db99798e", "score": "0.42968705", "text": "func webhookGetConfigFile(gh *github.Client, ev *github.PullRequestEvent) (*Config, error) {\n\tfile, _, _, err := gh.Repositories.GetContents(\n\t\tcontext.Background(),\n\t\t*ev.Repo.Owner.Login,\n\t\t*ev.Repo.Name,\n\t\t\"turbo-pr.yaml\",\n\t\t&github.RepositoryContentGetOptions{\n\t\t\tRef: *ev.PullRequest.Head.SHA,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif file.GetEncoding() != \"base64\" {\n\t\treturn nil, errors.New(\"Encoding was not base64: \" + file.GetEncoding())\n\t}\n\n\tfileContent, err := file.GetContent()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar conf Config\n\terr = yaml.Unmarshal([]byte(fileContent), &conf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &conf, nil\n}", "title": "" }, { "docid": "07cd40cd7dab53bbac5135f782941b46", "score": "0.42666736", "text": "func (g *Gerrit) pushConfig() error { // nolint: gocyclo\n\tlogger := g.log.WithFields(log.Fields{\n\t\t\"phase\": \"setup\",\n\t\t\"task\": \"push-config\",\n\t})\n\tlogger.Debug()\n\n\tlogger.WithField(\"action\", \"new-repo\").Debug()\n\trepo, err := NewRepository(g.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer repo.Destroy() // nolint: errcheck\n\n\tif err := repo.AddOriginFromContainer(g.Container, \"All-Projects\"); err != nil {\n\t\treturn err\n\t}\n\n\tif _, _, err := repo.Git([]string{\n\t\t\"fetch\", \"origin\", \"refs/meta/config:refs/remotes/origin/meta/config\"}); err != nil {\n\t\treturn err\n\t}\n\n\tlogger.WithField(\"action\", \"checkout\").Debug()\n\tif _, _, err := repo.Git([]string{\"checkout\", \"meta/config\"}); err != nil {\n\t\treturn err\n\t}\n\n\tpath := filepath.Join(repo.Root, \"project.config\")\n\tini, err := newProjectConfig(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := ini.write(path); err != nil {\n\t\treturn err\n\t}\n\n\tlogger.WithField(\"action\", \"add\").Debug()\n\tif _, _, err := repo.Git(append(DefaultGitCommands[\"add\"], path)); err != nil {\n\t\treturn err\n\t}\n\n\tlogger.WithField(\"action\", \"commit\").Debug()\n\tif _, _, err := repo.Git([]string{\"commit\", \"--message\", \"add verified label\"}); err != nil {\n\t\treturn err\n\t}\n\n\tlogger.WithField(\"action\", \"push\").Debug()\n\t_, _, err = repo.Git([]string{\"push\", \"origin\", \"meta/config:meta/config\"})\n\treturn err\n}", "title": "" }, { "docid": "332d72f527f48689c2385e7d5a7055bb", "score": "0.42628402", "text": "func (fs *FlagSet) BuildEventVar(v *string) {\n\tfs.droneFlag(\"build.event\", v, \"build event (push, pull_request, tag)\")\n}", "title": "" }, { "docid": "00b8e02182e5deea89cd1bc9a39a0d8e", "score": "0.42564592", "text": "func HandleConfigEvent(op protos.SdkMgrOperation, key *protos.ConfigKey, data *string, a *Agent) {\n\tlog.Infof(\"\\nkey %v\", *key)\n\n\tif key.GetJsPath() != \".commit.end\" {\n\t\ta.CfgTranxMap[key.GetJsPath()] = append(a.CfgTranxMap[key.GetJsPath()], CfgTranxEntry{Op: op, Key: key, Data: data})\n\t\treturn\n\t}\n\n\tfor _, item := range a.CfgTranxMap[\".kbutler.config-node\"] {\n\t\tlog.Infof(\"%s\", item)\n\t\t// HandleKButlerConfigEvent(item.Op, item.Key, item.Data)\n\t}\n\n\tfor _, item := range a.CfgTranxMap[a.YangRoot] {\n\t\tHandleKButlerConfigEvent(item.Op, item.Key, item.Data, a)\n\t}\n\n\t// Delete all current candidate list.\n\ta.CfgTranxMap = make(map[string][]CfgTranxEntry)\n}", "title": "" }, { "docid": "dd0b3b369b47560551da192ef63f513a", "score": "0.42549285", "text": "func TriggerWebhooks(configPath, repoName, event string) {\n\tcfg, err := config.Load(configPath)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not parse configuration: \", err.Error())\n\t}\n\n\tvar repository repositories.Repository\n\tvar exists bool\n\n\tif repository, exists = cfg.Repositories[repoName]; !exists {\n\t\tlog.Fatalf(`Unknown repository: \"%s\".`, repoName)\n\t}\n\n\tif !events.IsValidEvent(event) {\n\t\tlog.Fatalf(`Unknown event: \"%s\"`, event)\n\t}\n\n\tstore, err := hooks.LoadStore(cfg.WebhookStorePath, cfg.RepositorySet())\n\n\tif err != nil {\n\t\tlog.Fatal(\"Could not load webhook store: \", err.Error())\n\t}\n\n\tpayload, err := repository.ParseEventPayload(event, os.Stdin)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not parse event payload: \", err.Error())\n\t}\n\n\terr = repositories.InvokeAllHooks(http.DefaultClient, store, event, repository, payload)\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n}", "title": "" }, { "docid": "54e3c75f823a2d91a4654d86bdaa5e32", "score": "0.4243779", "text": "func CreateConfig() *Config {\n\treturn &Config{\n\t\tPollInterval: \"5s\",\n\t}\n}", "title": "" }, { "docid": "9930b3370eab590073e151077f0d8ffa", "score": "0.4225991", "text": "func (c *Config) InitGitHubOAuthConfig(cookie *sessions.CookieStore) {\n\t// The `oauth2.Token` needs to be stored in the CookieStore with a specific encoder.\n\t// Since we are using `gorilla/sessions` which uses `gorilla/securecookie`,\n\t// it has to be registered to `encoding/gob`.\n\t//\n\t// See https://github.com/gorilla/securecookie/blob/master/doc.go#L56-L59\n\tgob.Register(&oauth2.Token{})\n\tc.CookieStore = cookie\n}", "title": "" }, { "docid": "84ea3fdb4ad59a5603c6a836c09ac808", "score": "0.42250073", "text": "func (es *EventService) GetEventConfig(w rest.ResponseWriter, r *rest.Request) {\n\teventCode := getEventCodeFromRequest(r)\n\tevent := es.GetEvent(eventCode)\n\n\tif event == nil {\n\t\trest.Error(w, \"Invalid code\", http.StatusNotFound)\n\t\treturn\n\t}\n\n\tif !event.EmailConfirmed {\n\t\trest.Error(w, \"Event not confirmed yet\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif event.Config == nil {\n\t\tw.WriteJson(map[string]string{})\n\t\treturn\n\t}\n\n\td := &map[string]interface{}{}\n\terr := json.Unmarshal(event.Config, d)\n\tif err != nil {\n\t\tpanic(\"Invalid event config for \" + event.Code + \", not a valid JSON file\")\n\t}\n\n\tw.WriteJson(d)\n}", "title": "" }, { "docid": "f9cd94208110a40102deec427e932e0c", "score": "0.422321", "text": "func (v *Viper) OnConfigChange(run func(in fsnotify.Event)) {\n\tv.onConfigChange = run\n}", "title": "" }, { "docid": "5425417649b0d729cec160172c3bf10d", "score": "0.42178157", "text": "func (o GetTriggersTriggerOutput) Config() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetTriggersTrigger) string { return v.Config }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "6fa2021344f846bf7629e56a7be82111", "score": "0.42158177", "text": "func HandleGetEventingConfig(adminMan *admin.Manager, syncMan *syncman.Manager) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\n\t\t// Get the JWT token from header\n\t\ttoken := utils.GetTokenFromHeader(r)\n\n\t\t// Check if the request is authorised\n\t\tif err := adminMan.IsTokenValid(token); err != nil {\n\t\t\t_ = utils.SendErrorResponse(w, http.StatusUnauthorized, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\t// get project id from url\n\t\tvars := mux.Vars(r)\n\t\tprojectID := vars[\"project\"]\n\n\t\t// get project config\n\t\tproject, err := syncMan.GetConfig(projectID)\n\t\tif err != nil {\n\t\t\t_ = utils.SendErrorResponse(w, http.StatusInternalServerError, err.Error())\n\t\t\treturn\n\t\t}\n\n\t\t_ = utils.SendResponse(w, http.StatusOK, model.Response{Result: []interface{}{config.Eventing{DBAlias: project.Modules.Eventing.DBAlias, Enabled: project.Modules.Eventing.Enabled}}})\n\t}\n}", "title": "" }, { "docid": "2c10873d12ffd7659b848800145e8f69", "score": "0.4214554", "text": "func NewConfigureNotify(Event, Window, AboveSibling xproto.Window,\n\tX, Y, Width, Height int, BorderWidth uint16,\n\tOverrideRedirect bool) *ConfigureNotifyEvent {\n\n\treturn &ConfigureNotifyEvent{&xproto.ConfigureNotifyEvent{\n\t\tEvent: Event, Window: Window, AboveSibling: AboveSibling,\n\t\tX: int16(X), Y: int16(Y), Width: uint16(Width), Height: uint16(Height),\n\t\tBorderWidth: BorderWidth, OverrideRedirect: OverrideRedirect,\n\t}}\n}", "title": "" }, { "docid": "368ed7d1390dd504c35223ba54aad4ba", "score": "0.42126969", "text": "func (c *configHandler) OnConfig(request configuration.ConfigRequest) (configuration.AppConfig, error) {\n\tconfig := configuration.AppConfig{}\n\n\tif request.Username == \"busybox\" {\n\t\tconfig.DockerRun.Config.ContainerConfig = &container.Config{}\n\t\tconfig.DockerRun.Config.ContainerConfig.Image = \"busybox\"\n\n\t\tconfig.Docker.Execution.Launch.ContainerConfig = &container.Config{}\n\t\tconfig.Docker.Execution.Launch.ContainerConfig.Image = \"busybox\"\n\t\tconfig.Docker.Execution.DisableAgent = true\n\t\tconfig.Docker.Execution.Mode = docker.ExecutionModeSession\n\t\tconfig.Docker.Execution.ShellCommand = []string{\"/bin/sh\"}\n\t}\n\n\treturn config, nil\n}", "title": "" }, { "docid": "c54d6e678ee92f3f78cdb17eb1ef7fd3", "score": "0.42092478", "text": "func (t *Config) AddEvents(events ...EventType) {\n\tt.Events = append(t.Events, events...)\n}", "title": "" }, { "docid": "8903de5d71a0931bcce76d915c024c7b", "score": "0.42074153", "text": "func (o GitHubEventsConfigOutput) Push() PushFilterPtrOutput {\n\treturn o.ApplyT(func(v GitHubEventsConfig) *PushFilter { return v.Push }).(PushFilterPtrOutput)\n}", "title": "" }, { "docid": "fe06904680bf388804831f6d6722f583", "score": "0.4206138", "text": "func (h *handler) PushEvent(w http.ResponseWriter, r *http.Request) {\n\tevent := &go_github.PushEvent{}\n\tif err := json.NewDecoder(r.Body).Decode(event); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\treqID, err := reqID(r)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\ttargetURL := targetURL(r)\n\ttargetURL.Path = fmt.Sprintf(\"/logs/%s\", reqID.ToSlice())\n\tctx := application.ContextWithJob(context.Background(), &application.BuildJob{\n\t\tID: reqID,\n\t\tTargetSource: &github.TargetSource{\n\t\t\tRepository: event.GetRepo(),\n\t\t\tRef: event.GetRef(),\n\t\t\tSHA: plumbing.NewHash(event.GetHeadCommit().GetID()),\n\t\t},\n\t\tTaskName: fmt.Sprintf(\"%s/push\", application.Name),\n\t\tTargetURL: targetURL,\n\t})\n\n\ttgt := &target.GitHub{\n\t\tRepo: event.GetRepo(),\n\t\tPoint: event,\n\t}\n\n\tgo func() {\n\t\tif err := h.executor.Execute(ctx, tgt); err != nil {\n\t\t\tlogrus.Errorf(\"%+v\", err)\n\t\t}\n\t}()\n\n\tw.WriteHeader(http.StatusOK)\n}", "title": "" }, { "docid": "a02109e54e5dc95432707e4738003cd0", "score": "0.42030978", "text": "func (m *jiraEventConfig) Event() string {\n\treturn m.eventField\n}", "title": "" }, { "docid": "4417b57674979c0c9b1a0fb1fca224a9", "score": "0.42009363", "text": "func (o GitLabEventsConfigResponseOutput) GitlabConfig() GitLabConfigResponseOutput {\n\treturn o.ApplyT(func(v GitLabEventsConfigResponse) GitLabConfigResponse { return v.GitlabConfig }).(GitLabConfigResponseOutput)\n}", "title": "" }, { "docid": "f03ef4e71a606317c9e9564a31d6970f", "score": "0.4192669", "text": "func (o GitLabEventsConfigOutput) Push() PushFilterPtrOutput {\n\treturn o.ApplyT(func(v GitLabEventsConfig) *PushFilter { return v.Push }).(PushFilterPtrOutput)\n}", "title": "" }, { "docid": "d702ae0eaf1939834073f0eac2421acd", "score": "0.41737655", "text": "func TriggerRepotracker(ctx context.Context, q amboy.Queue, msgID string, event *github.PushEvent) error {\n\tbranch, err := validatePushEvent(event)\n\tif err != nil {\n\t\tgrip.Error(message.WrapError(err, message.Fields{\n\t\t\t\"source\": \"GitHub hook\",\n\t\t\t\"msg_id\": msgID,\n\t\t\t\"event\": \"push\",\n\t\t}))\n\t\treturn err\n\t}\n\tif len(branch) == 0 {\n\t\treturn nil\n\t}\n\n\tsettings, err := evergreen.GetConfig(ctx)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"retrieving admin settings\")\n\t}\n\tif settings.ServiceFlags.RepotrackerDisabled {\n\t\tgrip.InfoWhen(sometimes.Percent(evergreen.DegradedLoggingPercent), message.Fields{\n\t\t\t\"source\": \"GitHub hook\",\n\t\t\t\"msg_id\": msgID,\n\t\t\t\"event\": \"push\",\n\t\t\t\"owner\": *event.Repo.Owner.Name,\n\t\t\t\"repo\": *event.Repo.Name,\n\t\t\t\"ref\": *event.Ref,\n\t\t\t\"message\": \"repotracker is disabled\",\n\t\t})\n\t\treturn errors.New(\"repotracker is disabled\")\n\t}\n\tif len(settings.GithubOrgs) > 0 && !utility.StringSliceContains(settings.GithubOrgs, *event.Repo.Owner.Name) {\n\t\tgrip.Info(message.Fields{\n\t\t\t\"source\": \"GitHub hook\",\n\t\t\t\"msg_id\": msgID,\n\t\t\t\"event\": \"push\",\n\t\t\t\"owner\": *event.Repo.Owner.Name,\n\t\t\t\"repo\": *event.Repo.Name,\n\t\t\t\"ref\": *event.Ref,\n\t\t\t\"message\": \"owner from push event is invalid\",\n\t\t})\n\t\treturn errors.New(\"owner from push event is invalid\")\n\t}\n\n\trefs, err := model.FindMergedEnabledProjectRefsByRepoAndBranch(*event.Repo.Owner.Name, *event.Repo.Name, branch)\n\tif err != nil {\n\t\tgrip.Error(message.WrapError(err, message.Fields{\n\t\t\t\"source\": \"GitHub hook\",\n\t\t\t\"msg_id\": msgID,\n\t\t\t\"event\": \"push\",\n\t\t\t\"owner\": *event.Repo.Owner.Name,\n\t\t\t\"repo\": *event.Repo.Name,\n\t\t\t\"ref\": *event.Ref,\n\t\t\t\"branch\": branch,\n\t\t\t\"message\": \"error trying to get project refs\",\n\t\t}))\n\t\treturn err\n\t}\n\tif len(refs) == 0 {\n\t\tgrip.Info(message.Fields{\n\t\t\t\"source\": \"github hook\",\n\t\t\t\"msg_id\": msgID,\n\t\t\t\"event\": \"push\",\n\t\t\t\"owner\": *event.Repo.Owner.Name,\n\t\t\t\"repo\": *event.Repo.Name,\n\t\t\t\"ref\": *event.Ref,\n\t\t\t\"branch\": branch,\n\t\t\t\"message\": \"no matching project refs found\",\n\t\t})\n\t\treturn nil\n\t}\n\n\tsucceeded := []string{}\n\tunactionable := []string{}\n\tfailed := []string{}\n\tcatcher := grip.NewSimpleCatcher()\n\tfor i := range refs {\n\t\tif !refs[i].DoesTrackPushEvents() || !refs[i].Enabled || refs[i].IsRepotrackerDisabled() {\n\t\t\tunactionable = append(unactionable, refs[i].Id)\n\t\t\tcontinue\n\t\t}\n\n\t\tj := units.NewRepotrackerJob(fmt.Sprintf(\"github-push-%s\", msgID), refs[i].Id)\n\n\t\tif err := amboy.EnqueueUniqueJob(ctx, q, j); err != nil {\n\t\t\tcatcher.Wrap(err, \"enqueueing repotracker job for GitHub push events\")\n\t\t\tfailed = append(failed, refs[i].Id)\n\n\t\t} else {\n\t\t\tsucceeded = append(succeeded, refs[i].Id)\n\t\t}\n\t}\n\n\tgrip.Error(message.WrapError(catcher.Resolve(), message.Fields{\n\t\t\"source\": \"GitHub hook\",\n\t\t\"msg_id\": msgID,\n\t\t\"event\": \"push\",\n\t\t\"owner\": *event.Repo.Owner.Name,\n\t\t\"repo\": *event.Repo.Name,\n\t\t\"ref\": *event.Ref,\n\t\t\"message\": \"errors occurred while triggering repotracker\",\n\t\t\"project_refs\": message.Fields{\n\t\t\t\"failed\": failed,\n\t\t\t\"succeeded\": succeeded,\n\t\t\t\"unactionable\": unactionable,\n\t\t},\n\t}))\n\n\tgrip.Info(message.Fields{\n\t\t\"source\": \"GitHub hook\",\n\t\t\"msg_id\": msgID,\n\t\t\"event\": \"push\",\n\t\t\"owner\": *event.Repo.Owner.Name,\n\t\t\"repo\": *event.Repo.Name,\n\t\t\"ref\": *event.Ref,\n\t\t\"message\": \"done processing push event\",\n\t\t\"project_refs\": message.Fields{\n\t\t\t\"failed\": failed,\n\t\t\t\"succeeded\": succeeded,\n\t\t\t\"unactionable\": unactionable,\n\t\t},\n\t})\n\n\tif catcher.HasErrors() {\n\t\treturn gimlet.ErrorResponse{\n\t\t\tStatusCode: http.StatusInternalServerError,\n\t\t\tMessage: catcher.Resolve().Error(),\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6cc2392541f133d1091fa820860ece23", "score": "0.41720295", "text": "func Generate(fileBrowsers *filebrowser.FileBrowsers, fc filebrowser.FetchCache, cache *ResolverCache, sharedConfig *config.Config, sharedPlugins *plugins.Configuration, owner, repo, eventRef string) (*config.Config, *plugins.Configuration, error) {\n\tfullName := scm.Join(owner, repo)\n\tif !sharedConfig.InRepoConfigEnabled(fullName) {\n\t\treturn sharedConfig, sharedPlugins, nil\n\t}\n\n\t// in repository configuration configured for this repository so lets create the in repository specific config structs\n\tcfg := *sharedConfig\n\n\t// plugins are optional - e.g. keeper doesn't pass plugins in\n\tpluginCfg := plugins.Configuration{}\n\tif sharedPlugins != nil {\n\t\tpluginCfg = *sharedPlugins\n\n\t\t// lets avoid concurrent modification issues sharing the config updater\n\t\tpluginCfg.ConfigUpdater = plugins.ConfigUpdater{\n\t\t\tMaps: map[string]plugins.ConfigMapSpec{},\n\t\t\tGZIP: false,\n\t\t}\n\t}\n\n\t// lets load the main branch first then merge in any changes from this PR/branch\n\trefs, err := fileBrowsers.LighthouseGitFileBrowser().GetMainAndCurrentBranchRefs(owner, repo, eventRef)\n\tif err != nil {\n\t\treturn sharedConfig, sharedPlugins, errors.Wrapf(err, \"failed to find main branch %s\", fullName)\n\t}\n\n\tfor _, ref := range refs {\n\t\trepoConfig, err := LoadTriggerConfig(fileBrowsers, fc, cache, owner, repo, ref)\n\t\tif err != nil {\n\t\t\treturn sharedConfig, sharedPlugins, errors.Wrapf(err, \"failed to load trigger config for repository %s/%s for ref %s\", owner, repo, ref)\n\t\t}\n\t\tif repoConfig != nil {\n\t\t\terr = merge.ConfigMerge(&cfg, &pluginCfg, repoConfig, owner, repo)\n\t\t\tif err != nil {\n\t\t\t\treturn sharedConfig, sharedPlugins, errors.Wrapf(err, \"failed to merge repository config with repository %s/%s for ref %s\", owner, repo, ref)\n\t\t\t}\n\t\t}\n\t}\n\treturn &cfg, &pluginCfg, nil\n}", "title": "" }, { "docid": "f01e8bbd4c92d05bae4cb3abc41bb0e9", "score": "0.41703975", "text": "func NewDynamicConfigForEventsV2Test() *Config {\n\tdc := dynamicconfig.NewNopCollection()\n\tconfig := NewConfig(dc, 1, cconfig.StoreTypeCassandra, false)\n\tconfig.EnableEventsV2 = dc.GetBoolPropertyFnWithDomainFilter(dynamicconfig.EnableEventsV2, true)\n\treturn config\n}", "title": "" }, { "docid": "6a3ee78abe3aaff81309aa3927e7f2f3", "score": "0.41630453", "text": "func (o GitLabEventsConfigOutput) GitlabConfigResource() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v GitLabEventsConfig) *string { return v.GitlabConfigResource }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "4cc8978e107d4c14a34394e35343f298", "score": "0.41482073", "text": "func handleConfig(tvars *templateVars, w http.ResponseWriter) {\n\tt1 := `// Paste this into Site admin | External services | Add external service | Single Git repositories:\n{\n \"url\": \"http://{{.Addr}}\",\n \"repos\": [{{range .Repos}}\n \"{{.}}\",{{end}}\n ]\n}\n`\n\terr := func() error {\n\t\tt2, err := template.New(\"config\").Parse(t1)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"parsing config template\")\n\t\t}\n\t\tif err := t2.Execute(w, tvars); err != nil {\n\t\t\treturn errors.Wrap(err, \"executing config template\")\n\t\t}\n\t\treturn nil\n\t}()\n\tif err != nil {\n\t\tlog.Println(err)\n\t\t_, _ = w.Write([]byte(err.Error()))\n\t}\n}", "title": "" }, { "docid": "d7a47817fdd7f531ba3bd951ef8dbe0b", "score": "0.4145414", "text": "func (t *Config) Equal(events []EventType, prefix, suffix string) bool {\n\tif t == nil {\n\t\treturn false\n\t}\n\n\t// Compare events\n\tpassEvents := EqualEventTypeList(t.Events, events)\n\n\t// Compare filters\n\tvar newFilterRules []FilterRule\n\tif prefix != \"\" {\n\t\tnewFilterRules = append(newFilterRules, FilterRule{Name: \"prefix\", Value: prefix})\n\t}\n\tif suffix != \"\" {\n\t\tnewFilterRules = append(newFilterRules, FilterRule{Name: \"suffix\", Value: suffix})\n\t}\n\n\tvar currentFilterRules []FilterRule\n\tif t.Filter != nil {\n\t\tcurrentFilterRules = t.Filter.S3Key.FilterRules\n\t}\n\n\tpassFilters := EqualFilterRuleList(currentFilterRules, newFilterRules)\n\treturn passEvents && passFilters\n}", "title": "" }, { "docid": "baa62ed47450d141a8ce17d0b6e72653", "score": "0.41390225", "text": "func DockerJSONConfig(f *framework.Framework) (string, func(*framework.TestCase)) {\n\treturn \"[common] should sync docker configurated json secrets with template simple\", func(tc *framework.TestCase) {\n\t\tcloudSecretName := fmt.Sprintf(\"%s-%s\", f.Namespace.Name, dockerConfigExampleName)\n\t\tdockerconfig := `{\"auths\":{\"https://index.docker.io/v1/\": {\"auth\": \"c3R...zE2\"}}}`\n\t\tcloudSecretValue := fmt.Sprintf(`{\"dockerconfig\": %s}`, dockerconfig)\n\t\ttc.Secrets = map[string]string{\n\t\t\tcloudSecretName: cloudSecretValue,\n\t\t}\n\n\t\ttc.ExpectedSecret = &v1.Secret{\n\t\t\tType: v1.SecretTypeOpaque,\n\t\t\tData: map[string][]byte{\n\t\t\t\tdockerConfigJSONKey: []byte(dockerconfig),\n\t\t\t},\n\t\t}\n\n\t\ttc.ExternalSecret.Spec.Data = []esv1alpha1.ExternalSecretData{\n\t\t\t{\n\t\t\t\tSecretKey: \"mysecret\",\n\t\t\t\tRemoteRef: esv1alpha1.ExternalSecretDataRemoteRef{\n\t\t\t\t\tKey: cloudSecretName,\n\t\t\t\t\tProperty: \"dockerconfig\",\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\ttc.ExternalSecret.Spec.Target.Template = &esv1alpha1.ExternalSecretTemplate{\n\t\t\tData: map[string]string{\n\t\t\t\tdockerConfigJSONKey: mysecretToStringTemplating,\n\t\t\t},\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1e8f52309a7ca648d79b0c915dd15729", "score": "0.4136378", "text": "func (h *CustomResourceDefinitionSummary) BuildConfig() error {\n\tcrd := h.crd\n\tsections := component.SummarySections{}\n\n\tif crd.Spec.Conversion != nil {\n\t\tsections.AddText(\"Conversion Strategy\", string(crd.Spec.Conversion.Strategy))\n\t}\n\n\tsections.AddText(\"Group\", crd.Spec.Group)\n\tsections.AddText(\"Kind\", crd.Spec.Names.Kind)\n\tsections.AddText(\"List Kind\", crd.Spec.Names.ListKind)\n\tsections.AddText(\"Plural\", crd.Spec.Names.Plural)\n\tsections.AddText(\"Singular\", crd.Spec.Names.Singular)\n\tsections.AddText(\"Short Names\", strings.Join(crd.Spec.Names.ShortNames, \", \"))\n\n\tif crd.Spec.Names.Categories != nil {\n\t\tsections.AddText(\"Categories\", strings.Join(crd.Spec.Names.Categories, \", \"))\n\t}\n\n\tsummary := component.NewSummary(\"Configuration\", sections...)\n\n\th.object.RegisterConfig(summary)\n\n\treturn nil\n}", "title": "" }, { "docid": "a74d7247608b8aa2d8417a29ceafae3f", "score": "0.41343954", "text": "func (o GitHubEventsConfigPtrOutput) Push() PushFilterPtrOutput {\n\treturn o.ApplyT(func(v *GitHubEventsConfig) *PushFilter {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Push\n\t}).(PushFilterPtrOutput)\n}", "title": "" }, { "docid": "dcf354a3133923ff2dcf89dc0d2c1ac2", "score": "0.41303277", "text": "func (p *podpools) configNotify(event pkgcfg.Event, source pkgcfg.Source) error {\n\tlog.Info(\"configuration %s\", event)\n\tif err := p.setConfig(podpoolsOptions); err != nil {\n\t\tlog.Error(\"config update failed: %v\", err)\n\t\treturn err\n\t}\n\tlog.Info(\"config updated successfully\")\n\tp.Sync(p.cch.GetContainers(), nil)\n\treturn nil\n}", "title": "" }, { "docid": "722e353a67b5334f4c816eae5177e251", "score": "0.41296947", "text": "func (o GitLabEventsConfigPtrOutput) Push() PushFilterPtrOutput {\n\treturn o.ApplyT(func(v *GitLabEventsConfig) *PushFilter {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Push\n\t}).(PushFilterPtrOutput)\n}", "title": "" }, { "docid": "70ee8c839b24d63e458c528f6f827c15", "score": "0.41283673", "text": "func (b *Builder) Config() *docker.Config {\n\tconfig := b.RunConfig\n\tif config.OnBuild == nil {\n\t\tconfig.OnBuild = []string{}\n\t}\n\tif config.Entrypoint == nil {\n\t\tconfig.Entrypoint = []string{}\n\t}\n\tconfig.Image = \"\"\n\treturn &config\n}", "title": "" }, { "docid": "e3b7dce692091ea1bd585b253cde2563", "score": "0.412536", "text": "func HelloRemoteConfig(ctx context.Context, e RemoteConfigEvent) error {\n\tlog.Printf(\"Update type: %v\", e.UpdateType)\n\tlog.Printf(\"Origin: %v\", e.UpdateOrigin)\n\tlog.Printf(\"Version: %v\", e.VersionNumber)\n\treturn nil\n}", "title": "" }, { "docid": "e3b7dce692091ea1bd585b253cde2563", "score": "0.412536", "text": "func HelloRemoteConfig(ctx context.Context, e RemoteConfigEvent) error {\n\tlog.Printf(\"Update type: %v\", e.UpdateType)\n\tlog.Printf(\"Origin: %v\", e.UpdateOrigin)\n\tlog.Printf(\"Version: %v\", e.VersionNumber)\n\treturn nil\n}", "title": "" }, { "docid": "c359d5f9e61d1501cb5ca525a11f29d3", "score": "0.41027024", "text": "func (g *Github) Configure(cfg string) error {\n\t// TODO: Parse config and take what needed, fail on missing\n\tg.Token = os.Getenv(\"GITHUB_TOKEN\")\n\tif g.Token == \"\" {\n\t\treturn errors.New(\"no github token configured\")\n\t}\n\n\tg.SearchURL = \"https://api.github.com/search/repositories?q=language:go\"\n\treturn nil\n}", "title": "" }, { "docid": "8677549e582e8e6fe9d6d35329bf4ffc", "score": "0.41024125", "text": "func pullRequestEventHandler(_ *externalplugin.Plugin, event externalplugin.Event) {\n\tlogger, atom := consolelog.NewLoggerWithLevel()\n\tdefer logger.Sync()\n\tatom.SetLevel(pluginOptions.LogLevel)\n\tlogger = logger.With(externalplugin.EventTypeField, event.EventType, github.EventGUID, event.EventGUID)\n\n\tvar pr github.PullRequestEvent\n\tif err := json.Unmarshal(event.Payload, &pr); err != nil {\n\t\tlogger.Errorw(\"Failed unmarshal json payload.\", \"error\", err)\n\t}\n\tlogger = logger.With(\"pr-number\", pr.Number,\n\t\t\"pr-sender\", pr.Sender.Login)\n\n\tswitch pr.Action {\n\tcase github.PullRequestActionClosed:\n\t\tif checkIfEventSupported(pr) {\n\t\t\t// Set pubsub message payload values.\n\t\t\tmergeMsgPayload := AutoMergeMessagePayload{\n\t\t\t\tPullRequestOrg: gogithub.String(pr.Repo.Owner.Login),\n\t\t\t\tPullRequestRepo: gogithub.String(pr.Repo.Name),\n\t\t\t\tPullRequestTitle: gogithub.String(pr.PullRequest.Title),\n\t\t\t\tPullRequestAuthor: gogithub.String(pr.Sender.Login),\n\t\t\t\tPullRequestNumber: gogithub.Int(pr.Number),\n\t\t\t\tPullRequestURL: gogithub.String(pr.PullRequest.HTMLURL),\n\t\t\t}\n\t\t\tpr.GUID = event.EventGUID\n\t\t\t// Load repository owners.\n\t\t\towners, err := repoOwnersClient.LoadRepoOwners(pr.Repo.Owner.Login, pr.Repo.Name, \"main\")\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"Failed load RepoOwners\", \"error\", err)\n\t\t\t}\n\t\t\t// Get git client for repository.\n\t\t\t_, repoBase, err := gitClientFactory.GetGitRepoClient(pr.Repo.Owner.Login, pr.Repo.Name)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"Failed get repository base directory\", \"error\", err)\n\t\t\t}\n\t\t\t// Load repository owner aliases.\n\t\t\trepoAliases, err := repoOwnersClient.LoadRepoAliases(repoBase, \"OWNERS_ALIASES\")\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"failed load aliases file\", \"error\", err)\n\t\t\t}\n\t\t\t// Get changes from pull request.\n\t\t\tchanges, err := githubClient.GetPullRequestChanges(pr.Repo.Owner.Login, pr.Repo.Name, pr.Number)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"failed get pull request changes\", \"error\", err)\n\t\t\t}\n\t\t\t// Get owners for changes from pull request.\n\t\t\tallOwners, err := repoOwnersClient.GetOwnersForChanges(changes, repoBase, owners)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"filed get owners for changed files\", \"error\", err)\n\t\t\t}\n\t\t\tctx := context.Background()\n\t\t\t// Load aliases map file.\n\t\t\taliasesMap, err := sapToolsClient.GetAliasesMap(ctx)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"failed get aliases map file\", \"error\", err)\n\t\t\t}\n\t\t\t// Load users map file.\n\t\t\tusersMap, err := sapToolsClient.GetUsersMap(ctx)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"failed get users map file\", \"error\", err)\n\t\t\t}\n\t\t\t// Get slack names to send notifications too.\n\t\t\ttargets, err := repoOwnersClient.ResolveSlackNames(allOwners, aliasesMap, usersMap, repoAliases)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorw(\"failed resolve owners slack names\", \"error\", err)\n\t\t\t}\n\t\t\t// Add slack names to notify to pubsub message payload.\n\t\t\tmergeMsgPayload.OwnersSlackIDs = targets.UnsortedList()\n\t\t\tsort.Strings(mergeMsgPayload.OwnersSlackIDs)\n\t\t\tif len(mergeMsgPayload.OwnersSlackIDs) > 0 {\n\t\t\t\t// Set pubsub message attributes. This is used to filter messages in pubsub subscriptions.\n\t\t\t\tattributes := map[string]string{\"automerged\": \"true\"}\n\t\t\t\t// Publish pubsub message\n\t\t\t\tmsgID, err := pubsubClient.PublishMessageWithAttributes(ctx, mergeMsgPayload, automergeOptions.PubsubTopic, attributes)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Errorw(\"failed pubslihed pubsub message\", \"error\", err)\n\t\t\t\t}\n\t\t\t\tlogger.Infof(\"PubSub message published, message ID: %s\", *msgID)\n\t\t\t} else {\n\t\t\t\tlogger.Info(\"No users or channels for notification found.\")\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "787cf9a3b4738339261eb80f35f0cad7", "score": "0.41012627", "text": "func NewGitHubRepositoryEvent(repoEventType, branch, collectionID, collectionVersion, forkedFrom, data string) (*RepositoryEvent, error) {\n\treturn NewRepositoryEvent(\"github\", repoEventType, branch, collectionID, collectionVersion, forkedFrom, data)\n}", "title": "" }, { "docid": "c19d20dc730844f3797f6344da9b6751", "score": "0.408336", "text": "func OnConfigChange(run func(in fsnotify.Event)) {\n\tl.Lock()\n\tdefer l.Unlock()\n\tviper.OnConfigChange(run)\n}", "title": "" }, { "docid": "0327d24cc10851dcc1f558fa4b4b4c11", "score": "0.4081201", "text": "func NewConfig(validationType interface{}, pathFunction PathValidationFunction, bodyFunction BodyValidationFunction, ranges ...float64) *Config {\n\n\tcfg := &Config{\n\t\tModel: validationType,\n\t\tType: reflect.TypeOf(validationType).String(),\n\t\tPathFunction: pathFunction,\n\t\tBodyFunction: bodyFunction,\n\t}\n\n\tswitch len(ranges) {\n\n\t\tcase 2:\n\t\t\tcfg.Min = ranges[0]\n\t\t\tcfg.Max = ranges[1]\n\n\t}\n\n\treturn cfg\n}", "title": "" }, { "docid": "b2430a12698a4c2efbd9b5c40d6f5f12", "score": "0.40793747", "text": "func AddIndependentPropertyGeneratorsForFactoryGitHubConfiguration_STATUS(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": "126c13706eaf68fd960f390d56a46342", "score": "0.40749878", "text": "func (s *SeesawSync) Config(arg int, config *config.Notification) error {\n\treturn errors.New(\"unimplemented\")\n}", "title": "" }, { "docid": "5b1f37c1aa4c680ce0b3d65f7b55f16f", "score": "0.40673542", "text": "func AddGitHubEvent(db *sqlx.DB, event GitHubEvent) error {\n\t_, err := db.Exec(\n\t\t`\n\t\tINSERT INTO github_events (\n\t\t\tid,\n\t\t\tcreated_at,\n\t\t\tuser_id,\n\t\t\ttype,\n\t\t\trepo_name,\n\t\t\tpr_number,\n\t\t\tnum_commits,\n\t\t\thead\n\t\t)\n\t\tVALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n\t\tON CONFLICT DO NOTHING\n\t`,\n\t\tevent.ID,\n\t\tevent.CreatedAt,\n\t\tevent.UserID,\n\t\tevent.Type,\n\t\tevent.RepoName,\n\t\tevent.PRNumber,\n\t\tevent.NumCommits,\n\t\tevent.Head,\n\t)\n\treturn err\n}", "title": "" }, { "docid": "8e9223065923b50ad538e478bfedf3a7", "score": "0.40667212", "text": "func githubWebhook(r *http.Request) bool {\n\th := r.Header[http.CanonicalHeaderKey(\"X-GitHub-Event\")]\n\treturn len(h) > 0\n}", "title": "" }, { "docid": "5743edb93d1ce90f50f7ac65f1993a1c", "score": "0.40599608", "text": "func NewConfig() *Config {\n\tconfig := &Config{}\n\tconfig.Build.Binaries = []Binary{{Name: projInfo.Name, Path: \".\"}}\n\tconfig.Build.Prefix = \".\"\n\tconfig.Build.Static = true\n\tconfig.Crossbuild.Platforms = defaultPlatforms\n\tconfig.Tarball.Prefix = \".\"\n\tconfig.Go.Version = \"1.12\"\n\tconfig.Go.CGo = false\n\tconfig.Repository.Path = projInfo.Repo\n\n\treturn config\n}", "title": "" }, { "docid": "0829e3d812baa4ebffecad9a2a0dfc3f", "score": "0.40596655", "text": "func (t *OpenconfigSystem_System_Aaa_Authorization_Events_Event) GetOrCreateConfig() *OpenconfigSystem_System_Aaa_Authorization_Events_Event_Config {\n\tif t.Config != nil {\n\t\treturn t.Config\n\t}\n\tt.Config = &OpenconfigSystem_System_Aaa_Authorization_Events_Event_Config{}\n\treturn t.Config\n}", "title": "" }, { "docid": "0829e3d812baa4ebffecad9a2a0dfc3f", "score": "0.4057948", "text": "func (t *OpenconfigSystem_System_Aaa_Authorization_Events_Event) GetOrCreateConfig() *OpenconfigSystem_System_Aaa_Authorization_Events_Event_Config {\n\tif t.Config != nil {\n\t\treturn t.Config\n\t}\n\tt.Config = &OpenconfigSystem_System_Aaa_Authorization_Events_Event_Config{}\n\treturn t.Config\n}", "title": "" }, { "docid": "d2de25b2c19636465a3f089b135b234b", "score": "0.40515545", "text": "func (r *queryResolver) ProjectEvents(ctx context.Context, identifier string, limit *int, before *time.Time) (*ProjectEvents, error) {\n\ttimestamp := time.Now()\n\tif before != nil {\n\t\ttimestamp = *before\n\t}\n\tevents, err := data.GetProjectEventLog(identifier, timestamp, utility.FromIntPtr(limit))\n\tres := &ProjectEvents{\n\t\tEventLogEntries: getPointerEventList(events),\n\t\tCount: len(events),\n\t}\n\treturn res, err\n}", "title": "" }, { "docid": "c1ee2e1acceb429749f55739e454b97d", "score": "0.4050516", "text": "func DockerConfig(insecureRegistries, registryMirrors []string, logMaxFiles string, logMaxSize string) (string, error) {\n\tif len(logMaxSize) > 0 {\n\t\t// Parse log max size to ensure that it has the correct units\n\t\tlogMaxSize = strings.ToLower(logMaxSize)\n\t\tlogMaxSize = strings.ReplaceAll(logMaxSize, \"ki\", \"k\")\n\t\tlogMaxSize = strings.ReplaceAll(logMaxSize, \"mi\", \"m\")\n\t\tlogMaxSize = strings.ReplaceAll(logMaxSize, \"gi\", \"g\")\n\t} else {\n\t\tlogMaxSize = DefaultDockerContainerLogMaxSize\n\t}\n\n\t// Default if value is not provided\n\tif len(logMaxFiles) == 0 {\n\t\tlogMaxFiles = DefaultDockerContainerLogMaxFiles\n\t}\n\n\tcfg := dockerConfig{\n\t\tExecOpts: []string{\"native.cgroupdriver=systemd\"},\n\t\tStorageDriver: \"overlay2\",\n\t\tLogDriver: \"json-file\",\n\t\tLogOpts: map[string]string{\n\t\t\t\"max-size\": logMaxSize,\n\t\t\t\"max-file\": logMaxFiles,\n\t\t},\n\t\tInsecureRegistries: insecureRegistries,\n\t\tRegistryMirrors: registryMirrors,\n\t}\n\n\tb, err := json.Marshal(cfg)\n\treturn string(b), err\n}", "title": "" }, { "docid": "8285f2257c10e0f7fa0b8b233c85427f", "score": "0.40497535", "text": "func (t *OpenconfigSystem_System_Aaa_Authorization_Events_Event) GetConfig() *OpenconfigSystem_System_Aaa_Authorization_Events_Event_Config {\n\tif t != nil && t.Config != nil {\n\t\treturn t.Config\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8285f2257c10e0f7fa0b8b233c85427f", "score": "0.40497535", "text": "func (t *OpenconfigSystem_System_Aaa_Authorization_Events_Event) GetConfig() *OpenconfigSystem_System_Aaa_Authorization_Events_Event_Config {\n\tif t != nil && t.Config != nil {\n\t\treturn t.Config\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f6993d294cff244dbb17c582c14b8a00", "score": "0.40467805", "text": "func (o *options) configNotify(event config.Event, source config.Source) error {\n\tlog.Info(\"message dumper configuration %v\", event)\n\tlog.Info(\" * config: %s\", o.Config)\n\n\trules := ruleset{}\n\tif err := rules.parse(o.Config); err != nil {\n\t\treturn err\n\t}\n\n\to.rules = rules\n\n\tlog.Info(\" * parsed: %s\", o.rules.String())\n\tlog.Info(\" * dump file: %v\", opt.File)\n\tlog.Info(\" * log with debug: %v\", opt.Debug)\n\n\tdump.configure(o)\n\n\treturn nil\n}", "title": "" }, { "docid": "c1d28e4b0f2dcb77971b95da791531e3", "score": "0.40454754", "text": "func Github(w http.ResponseWriter, req *http.Request) (int, string) {\n\tevent := req.Header.Get(\"X-Github-Event\")\n\tif !githubSupportedEvents[event] {\n\t\tlogger.Errorf(\"Github event type %s is not supported.\", event)\n\t\treturn http.StatusBadRequest, fmt.Sprintf(\"%d bad request\", http.StatusBadRequest)\n\t}\n\tbody, err := ioutil.ReadAll(req.Body)\n\tdefer req.Body.Close()\n\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn http.StatusBadRequest, fmt.Sprintf(\"%d bad request\", http.StatusBadRequest)\n\t}\n\n\tdecoder := json.NewDecoder(bytes.NewReader(body))\n\tvar payload = &githubPushPayload{}\n\tif err := decoder.Decode(payload); err != nil {\n\t\tlogger.Error(err)\n\t\treturn http.StatusBadRequest, fmt.Sprintf(\"%d bad request\", http.StatusBadRequest)\n\t}\n\n\tspec := &job.Spec{\n\t\tRepoOwner: payload.Repository.Owner.Name,\n\t\tRepoName: payload.Repository.Name,\n\t\tGitRef: payload.CommitSHA,\n\t}\n\n\treturn processJobHelper(spec, w, req)\n}", "title": "" }, { "docid": "079640a9c496ce421d3ff2a496f5ac2c", "score": "0.4043795", "text": "func AddRelatedPropertyGeneratorsForFactoryGitHubConfiguration_STATUS(gens map[string]gopter.Gen) {\n\tgens[\"ClientSecret\"] = gen.PtrOf(GitHubClientSecret_STATUSGenerator())\n}", "title": "" }, { "docid": "d98615bec16047ede8fe57ae5f66a08e", "score": "0.40414473", "text": "func Config(r *git.Repository, o *ConfigOptions) (value string, err error) {\n\t// here we configure config operation\n\n\tswitch o.CommandMode {\n\tcase ModeLegacy:\n\t\treturn configWithGit(r, o)\n\tcase ModeNative:\n\t\treturn configWithGoGit(r, o)\n\t}\n\treturn value, fmt.Errorf(\"unhandled config operation\")\n}", "title": "" }, { "docid": "e68b7b6f4fdb956a673cfc63d8ce1368", "score": "0.40378493", "text": "func LoadConfigs() {\n\tconf.Load(&Configs)\n\n\tCurrentTrigger.PeriodSec = Configs.BitHandlerTriggerPeriod\n\tCurrentTrigger.BitType = Configs.BitHandlerTriggerType\n}", "title": "" }, { "docid": "1fe0327f3c99398d0deb4babd4485fe5", "score": "0.40361765", "text": "func GenerateTrigger(p *v1beta1.Pipeline, g *GitHub) (*trigger, error) {\n\t// check input validation\n\tif p == nil {\n\t\treturn nil, fmt.Errorf(\"invalid pipeline configuration\")\n\t}\n\tif g == nil {\n\t\treturn nil, fmt.Errorf(\"invalid github configuration\")\n\t}\n\tif p.Spec.Workspaces == nil {\n\t\treturn nil, fmt.Errorf(\"invalid workspaces\")\n\t}\n\n\tif p.Namespace == \"\" {\n\t\tp.Namespace = \"default\"\n\t}\n\tvalue, format := getVolumeInfo(g)\n\t// create pipelinerun in the triggertemplate\n\tpr := &v1beta1.PipelineRun{\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: v1beta1.SchemeGroupVersion.String(),\n\t\t\tKind: \"PipelineRun\",\n\t\t},\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: p.Namespace,\n\t\t\tGenerateName: p.Name + \"-run-\",\n\t\t\tLabels: p.Labels,\n\t\t},\n\t\tSpec: v1beta1.PipelineRunSpec{\n\t\t\tPipelineRef: &v1beta1.PipelineRef{\n\t\t\t\tName: p.Name,\n\t\t\t},\n\t\t\tParams: []v1beta1.Param{\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrepositoryurl\",\n\t\t\t\t\tValue: v1beta1.ArrayOrString{\n\t\t\t\t\t\tType: v1beta1.ParamTypeString,\n\t\t\t\t\t\tStringVal: \"$(tt.params.gitrepositoryurl)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrevision\",\n\t\t\t\t\tValue: v1beta1.ArrayOrString{\n\t\t\t\t\t\tType: v1beta1.ParamTypeString,\n\t\t\t\t\t\tStringVal: \"$(tt.params.gitrevision)\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tWorkspaces: []v1beta1.WorkspaceBinding{\n\t\t\t\t{\n\t\t\t\t\tName: p.Spec.Workspaces[0].Name,\n\t\t\t\t\tVolumeClaimTemplate: &corev1.PersistentVolumeClaim{\n\t\t\t\t\t\tSpec: corev1.PersistentVolumeClaimSpec{\n\t\t\t\t\t\t\tAccessModes: []corev1.PersistentVolumeAccessMode{\n\t\t\t\t\t\t\t\tcorev1.ReadWriteOnce,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tResources: corev1.ResourceRequirements{\n\t\t\t\t\t\t\t\tRequests: corev1.ResourceList{\n\t\t\t\t\t\t\t\t\t\"storage\": *resource.NewQuantity(value, format),\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\t// create the triggertemplate\n\ttt := &v1alpha1.TriggerTemplate{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: p.Namespace,\n\t\t\tName: p.Name + \"-triggertemplate\",\n\t\t\tLabels: p.Labels,\n\t\t},\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: v1alpha1.SchemeGroupVersion.String(),\n\t\t\tKind: \"TriggerTemplate\",\n\t\t},\n\t\tSpec: v1alpha1.TriggerTemplateSpec{\n\t\t\tParams: []v1alpha1.ParamSpec{\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrevision\",\n\t\t\t\t\tDescription: \"The git revision\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrepositoryurl\",\n\t\t\t\t\tDescription: \"The git repository url\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tResourceTemplates: []v1alpha1.TriggerResourceTemplate{\n\t\t\t\t{\n\t\t\t\t\truntime.RawExtension{Object: pr},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// create the triggerbinding for pull request events\n\ttbPr := &v1alpha1.TriggerBinding{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: p.Namespace,\n\t\t\tName: p.Name + \"-pr-triggerbinding\",\n\t\t\tLabels: p.Labels,\n\t\t},\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: v1alpha1.SchemeGroupVersion.String(),\n\t\t\tKind: \"TriggerBinding\",\n\t\t},\n\t\tSpec: v1alpha1.TriggerBindingSpec{\n\t\t\tParams: []v1alpha1.Param{\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrevision\",\n\t\t\t\t\tValue: \"$(body.head.sha)\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrepositoryurl\",\n\t\t\t\t\tValue: \"$(body.repository.url)\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// create the triggerbinding for pushes events\n\ttbPush := &v1alpha1.TriggerBinding{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: p.Namespace,\n\t\t\tName: p.Name + \"-push-triggerbinding\",\n\t\t\tLabels: p.Labels,\n\t\t},\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: v1alpha1.SchemeGroupVersion.String(),\n\t\t\tKind: \"TriggerBinding\",\n\t\t},\n\t\tSpec: v1alpha1.TriggerBindingSpec{\n\t\t\tParams: []v1alpha1.Param{\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrevision\",\n\t\t\t\t\tValue: \"$(body.after)\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"gitrepositoryurl\",\n\t\t\t\t\tValue: \"$(body.repository.url)\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\t// create the eventlistener\n\tel := &v1alpha1.EventListener{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tNamespace: p.Namespace,\n\t\t\tName: p.Name + \"-eventlistener\",\n\t\t\tLabels: p.Labels,\n\t\t},\n\t\tTypeMeta: metav1.TypeMeta{\n\t\t\tAPIVersion: v1alpha1.SchemeGroupVersion.String(),\n\t\t\tKind: \"EventListener\",\n\t\t},\n\t\tSpec: v1alpha1.EventListenerSpec{\n\t\t\tServiceAccountName: g.Spec.ServiceAccountName,\n\t\t\tTriggers: []v1alpha1.EventListenerTrigger{\n\t\t\t\t{\n\t\t\t\t\tName: \"github-push\",\n\t\t\t\t\tInterceptors: []*v1alpha1.EventInterceptor{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGitHub: &v1alpha1.GitHubInterceptor{\n\t\t\t\t\t\t\t\tEventTypes: []string{\"push\"},\n\t\t\t\t\t\t\t\tSecretRef: &v1alpha1.SecretRef{\n\t\t\t\t\t\t\t\t\tSecretKey: g.Spec.SecretKey,\n\t\t\t\t\t\t\t\t\tSecretName: g.Spec.SecretName,\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\t{\n\t\t\t\t\t\t\tCEL: &v1alpha1.CELInterceptor{\n\t\t\t\t\t\t\t\tFilter: \"body.ref.split('/')[2] == \" + g.Spec.Branch,\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\tBindings: []*v1alpha1.EventListenerBinding{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRef: tbPush.Name,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tTemplate: v1alpha1.EventListenerTemplate{\n\t\t\t\t\t\tName: tt.Name,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName: \"github-pull-request\",\n\t\t\t\t\tInterceptors: []*v1alpha1.EventInterceptor{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGitHub: &v1alpha1.GitHubInterceptor{\n\t\t\t\t\t\t\t\tEventTypes: []string{\"pull_request\"},\n\t\t\t\t\t\t\t\tSecretRef: &v1alpha1.SecretRef{\n\t\t\t\t\t\t\t\t\tSecretKey: g.Spec.SecretKey,\n\t\t\t\t\t\t\t\t\tSecretName: g.Spec.SecretName,\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\t{\n\t\t\t\t\t\t\tCEL: &v1alpha1.CELInterceptor{\n\t\t\t\t\t\t\t\tFilter: \"body.base.ref == \" + g.Spec.Branch,\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\tBindings: []*v1alpha1.EventListenerBinding{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRef: tbPr.Name,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tTemplate: v1alpha1.EventListenerTemplate{\n\t\t\t\t\t\tName: tt.Name,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\ttrigger := &trigger{\n\t\tTriggerBinding: []*v1alpha1.TriggerBinding{tbPush, tbPr},\n\t\tTriggerTemplate: tt,\n\t\tEventListener: el,\n\t}\n\treturn trigger, nil\n}", "title": "" }, { "docid": "540e974a8bd7e90baefdd7fbd84dc6b3", "score": "0.403503", "text": "func (s *PutEventsConfigurationOutput) SetEventsConfiguration(v *EventsConfiguration) *PutEventsConfigurationOutput {\n\ts.EventsConfiguration = v\n\treturn s\n}", "title": "" }, { "docid": "07a248e4d65f4bdbd8ade17841922d4e", "score": "0.4034679", "text": "func RecordConfigChangeCause(config *appsapi.DeploymentConfig) {\n\tconfig.Status.Details = &appsapi.DeploymentDetails{\n\t\tCauses: []appsapi.DeploymentCause{\n\t\t\t{\n\t\t\t\tType: appsapi.DeploymentTriggerOnConfigChange,\n\t\t\t},\n\t\t},\n\t\tMessage: \"config change\",\n\t}\n}", "title": "" }, { "docid": "390d6919d27d8d22c786007599f404dc", "score": "0.40320143", "text": "func NewGithubEventHandler(apiClient APIClient, pubsubAPIClient pubsub.APIClient, buildService estafette.BuildService, config config.GithubConfig, prometheusInboundEventTotals *prometheus.CounterVec) EventHandler {\n\treturn &eventHandlerImpl{\n\t\tapiClient: apiClient,\n\t\tpubsubAPIClient: pubsubAPIClient,\n\t\tbuildService: buildService,\n\t\tconfig: config,\n\t\tprometheusInboundEventTotals: prometheusInboundEventTotals,\n\t}\n}", "title": "" }, { "docid": "fbd1299ff020c90d5b89a2107bb66e2e", "score": "0.40299737", "text": "func PushConfigMulti(ctx context.Context, payload map[string]string, repoTag string, opts RegistryOptions, labels map[string]string) (string, error) {\n\tpr, err := parseRef(repoTag)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif opts.Username == \"\" {\n\t\topts.Username, opts.Password, err = getCredentials(pr.domain)\n\t\tif err != nil {\n\t\t\tlog.Debugf(\"failed to get credentials for %s: %s\", pr.domain, err)\n\t\t}\n\t}\n\trepo, err := NewRepository(ctx, pr.domain, pr.path, opts)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdigest, err := pushConfigMediaType(ctx, payload, pr, repo)\n\tif err == nil {\n\t\treturn digest, err\n\t}\n\tif _, ok := err.(unsupportedMediaType); ok {\n\t\treturn pushConfigLegacy(ctx, payload, pr, repo, labels)\n\t}\n\treturn digest, err\n}", "title": "" }, { "docid": "ad9051850cfca929ecafdc8a6d0d5999", "score": "0.40076908", "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": "ee4ebe756de3a3a1f5c6c36e5a0ba9b1", "score": "0.40071365", "text": "func WatchConfigChanges(cfg map[string]interface{}) error {\n\tif cfg == nil {\n\t\treturn errors.New(\"Empty configurations\")\n\t}\n\n\t// Currently only watch the scan all policy change.\n\tif v, ok := cfg[ScanAllPolicyTopic]; ok {\n\t\tpolicyCfg := &models.ScanAllPolicy{}\n\t\tif err := utils.ConvertMapToStruct(policyCfg, v); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpolicyNotification := ScanPolicyNotification{\n\t\t\tType: policyCfg.Type,\n\t\t\tDailyTime: 0,\n\t\t}\n\n\t\tif t, yes := policyCfg.Parm[\"daily_time\"]; yes {\n\t\t\tif dt, success := t.(float64); success {\n\t\t\t\tpolicyNotification.DailyTime = (int64)(dt)\n\t\t\t} else {\n\t\t\t\treturn errors.New(\"Invalid daily_time type\")\n\t\t\t}\n\t\t}\n\n\t\treturn Publish(ScanAllPolicyTopic, policyNotification)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e183eaaf9d0d172af297d1410ef4eccc", "score": "0.40048555", "text": "func FactoryGitHubConfiguration_STATUSGenerator() gopter.Gen {\n\tif factoryGitHubConfiguration_STATUSGenerator != nil {\n\t\treturn factoryGitHubConfiguration_STATUSGenerator\n\t}\n\n\tgenerators := make(map[string]gopter.Gen)\n\tAddIndependentPropertyGeneratorsForFactoryGitHubConfiguration_STATUS(generators)\n\tfactoryGitHubConfiguration_STATUSGenerator = gen.Struct(reflect.TypeOf(FactoryGitHubConfiguration_STATUS{}), 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\tAddIndependentPropertyGeneratorsForFactoryGitHubConfiguration_STATUS(generators)\n\tAddRelatedPropertyGeneratorsForFactoryGitHubConfiguration_STATUS(generators)\n\tfactoryGitHubConfiguration_STATUSGenerator = gen.Struct(reflect.TypeOf(FactoryGitHubConfiguration_STATUS{}), generators)\n\n\treturn factoryGitHubConfiguration_STATUSGenerator\n}", "title": "" }, { "docid": "649223563586d70c4ad56ce49032441b", "score": "0.39949268", "text": "func (o GitLabEventsConfigPtrOutput) GitlabConfigResource() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v *GitLabEventsConfig) *string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.GitlabConfigResource\n\t}).(pulumi.StringPtrOutput)\n}", "title": "" } ]
e6cdcf9bd51b34053b6a48e295b9f15a
WithDataExportName is job parameter.
[ { "docid": "61f07dfb02950172c100d6a59ed88d7e", "score": "0.7820906", "text": "func WithDataExportName(name string) JobOption {\n\treturn func(opts *JobOpts) error {\n\t\tif strings.TrimSpace(name) == \"\" {\n\t\t\treturn fmt.Errorf(\"dataexport namespace should be set\")\n\t\t}\n\t\topts.DataExportName = name\n\t\treturn nil\n\t}\n}", "title": "" } ]
[ { "docid": "7645f1c907a3cb8586cb1f08cc96477f", "score": "0.5685163", "text": "func (s *Composite) ExportName(name string) {\n\thref := strings.ReplaceAll(name, \" \", \"_\") + \".svg\"\n\tdot := strings.ReplaceAll(name, \" \", \"_\") + \".dot\"\n\ts.outerNode.Attr(\"href\", href)\n\ts.dotFilename = dot\n}", "title": "" }, { "docid": "3ebd79267aaa479a98fd2291a0c47aae", "score": "0.5349687", "text": "func (c *Client) ExportData(id int, modifyReq ...func(r *http.Request)) (ExportData, error) {\n\tv := make(url.Values)\n\tv.Add(\"id\", strconv.Itoa(id))\n\n\treq, err := http.NewRequest(\"GET\", c.BaseURL+\"/export/get\"+\"?\"+v.Encode(), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, mr := range modifyReq {\n\t\tmr(req)\n\t}\n\n\treturn c.doReq(req)\n}", "title": "" }, { "docid": "8a7a8ef176bc768d60bd10cfd33fba51", "score": "0.522463", "text": "func (sink *monascaSink) ExportData(dataBatch *core.DataBatch) {\n\tsink.Lock()\n\tdefer sink.Unlock()\n\n\tmetrics := sink.processMetrics(dataBatch)\n\tcode, response, err := sink.client.SendRequest(\"POST\", \"/metrics\", metrics)\n\tif err != nil {\n\t\tglog.Errorf(\"%s\", err)\n\t\tsink.numberOfFailures++\n\t\treturn\n\t}\n\tif code != http.StatusNoContent {\n\t\tglog.Error(response)\n\t\tsink.numberOfFailures++\n\t}\n}", "title": "" }, { "docid": "44d5ccabbcb2f26e038fbcc2fc320362", "score": "0.50269777", "text": "func BExportData(fset *token.FileSet, pkg *types.Package) (b []byte, err error) {\n\tif !debug {\n\t\tdefer func() {\n\t\t\tif e := recover(); e != nil {\n\t\t\t\tif ierr, ok := e.(internalError); ok {\n\t\t\t\t\terr = ierr\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// Not an internal error; panic again.\n\t\t\t\tpanic(e)\n\t\t\t}\n\t\t}()\n\t}\n\n\tp := exporter{\n\t\tfset: fset,\n\t\tstrIndex: map[string]int{\"\": 0}, // empty string is mapped to 0\n\t\tpkgIndex: make(map[*types.Package]int),\n\t\ttypIndex: make(map[types.Type]int),\n\t\tposInfoFormat: true, // TODO(gri) might become a flag, eventually\n\t}\n\n\t// write version info\n\t// The version string must start with \"version %d\" where %d is the version\n\t// number. Additional debugging information may follow after a blank; that\n\t// text is ignored by the importer.\n\tp.rawStringln(fmt.Sprintf(\"version %d\", exportVersion))\n\tvar debug string\n\tif debugFormat {\n\t\tdebug = \"debug\"\n\t}\n\tp.rawStringln(debug) // cannot use p.bool since it's affected by debugFormat; also want to see this clearly\n\tp.bool(trackAllTypes)\n\tp.bool(p.posInfoFormat)\n\n\t// --- generic export data ---\n\n\t// populate type map with predeclared \"known\" types\n\tfor index, typ := range predeclared() {\n\t\tp.typIndex[typ] = index\n\t}\n\tif len(p.typIndex) != len(predeclared()) {\n\t\treturn nil, internalError(\"duplicate entries in type map?\")\n\t}\n\n\t// write package data\n\tp.pkg(pkg, true)\n\tif trace {\n\t\tp.tracef(\"\\n\")\n\t}\n\n\t// write objects\n\tobjcount := 0\n\tscope := pkg.Scope()\n\tfor _, name := range scope.Names() {\n\t\tif !token.IsExported(name) {\n\t\t\tcontinue\n\t\t}\n\t\tif trace {\n\t\t\tp.tracef(\"\\n\")\n\t\t}\n\t\tp.obj(scope.Lookup(name))\n\t\tobjcount++\n\t}\n\n\t// indicate end of list\n\tif trace {\n\t\tp.tracef(\"\\n\")\n\t}\n\tp.tag(endTag)\n\n\t// for self-verification only (redundant)\n\tp.int(objcount)\n\n\tif trace {\n\t\tp.tracef(\"\\n\")\n\t}\n\n\t// --- end of export data ---\n\n\treturn p.out.Bytes(), nil\n}", "title": "" }, { "docid": "591a88fe4a6be5c1c5b476d1636f869a", "score": "0.49965668", "text": "func (e *ExcelExportTest) Name() string {\n\treturn \"ExcelExportTest\"\n}", "title": "" }, { "docid": "cdbf688d5aba78a6b1d981e13e82f147", "score": "0.4985782", "text": "func (ef *execFactory) ConstructExport(\n\tinput exec.Node, fileName tree.TypedExpr, fileFormat string, options []exec.KVOption,\n) (exec.Node, error) {\n\tif !featureExportEnabled.Get(&ef.planner.ExecCfg().Settings.SV) {\n\t\treturn nil, pgerror.Newf(\n\t\t\tpgcode.OperatorIntervention,\n\t\t\t\"feature EXPORT was disabled by the database administrator\",\n\t\t)\n\t}\n\n\tif err := featureflag.CheckEnabled(\n\t\tef.planner.EvalContext().Context,\n\t\tef.planner.execCfg,\n\t\tfeatureExportEnabled,\n\t\t\"EXPORT\",\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !ef.planner.ExtendedEvalContext().TxnImplicit {\n\t\treturn nil, errors.Errorf(\"EXPORT cannot be used inside a transaction\")\n\t}\n\n\tif fileFormat != \"CSV\" {\n\t\treturn nil, errors.Errorf(\"unsupported export format: %q\", fileFormat)\n\t}\n\n\tdestinationDatum, err := fileName.Eval(ef.planner.EvalContext())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdestination, ok := destinationDatum.(*tree.DString)\n\tif !ok {\n\t\treturn nil, errors.Errorf(\"expected string value for the file location\")\n\t}\n\tadmin, err := ef.planner.HasAdminRole(ef.planner.EvalContext().Context)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif !admin {\n\t\thasExplicitAuth, _, err := cloud.AccessIsWithExplicitAuth(string(*destination))\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tif !hasExplicitAuth {\n\t\t\tpanic(pgerror.Newf(\n\t\t\t\tpgcode.InsufficientPrivilege,\n\t\t\t\t\"only users with the admin role are allowed to EXPORT to the specified URI\"))\n\t\t}\n\t}\n\n\toptVals, err := evalStringOptions(ef.planner.EvalContext(), options, exportOptionExpectValues)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcsvOpts := roachpb.CSVOptions{}\n\n\tif override, ok := optVals[exportOptionDelimiter]; ok {\n\t\tcsvOpts.Comma, err = util.GetSingleRune(override)\n\t\tif err != nil {\n\t\t\treturn nil, pgerror.New(pgcode.InvalidParameterValue, \"invalid delimiter\")\n\t\t}\n\t}\n\n\tif override, ok := optVals[exportOptionNullAs]; ok {\n\t\tcsvOpts.NullEncoding = &override\n\t}\n\n\tchunkRows := exportChunkRowsDefault\n\tif override, ok := optVals[exportOptionChunkRows]; ok {\n\t\tchunkRows, err = strconv.Atoi(override)\n\t\tif err != nil {\n\t\t\treturn nil, pgerror.WithCandidateCode(err, pgcode.InvalidParameterValue)\n\t\t}\n\t\tif chunkRows < 1 {\n\t\t\treturn nil, pgerror.New(pgcode.InvalidParameterValue, \"invalid csv chunk size\")\n\t\t}\n\t}\n\n\t// Check whenever compression is expected and extract compression codec name in case\n\t// of positive result\n\tvar codec execinfrapb.FileCompression\n\tif name, ok := optVals[exportOptionCompression]; ok && len(name) != 0 {\n\t\tif strings.EqualFold(name, exportCompressionCodec) {\n\t\t\tcodec = execinfrapb.FileCompression_Gzip\n\t\t} else {\n\t\t\treturn nil, pgerror.Newf(pgcode.InvalidParameterValue,\n\t\t\t\t\"unsupported compression codec %s\", name)\n\t\t}\n\t}\n\n\texportID := ef.planner.stmt.QueryID.String()\n\tnamePattern := fmt.Sprintf(\"export%s-%s\", exportID, exportFilePatternDefault)\n\n\treturn &exportNode{\n\t\tsource: input.(planNode),\n\t\tdestination: string(*destination),\n\t\tfileNamePattern: namePattern,\n\t\tcsvOpts: csvOpts,\n\t\tchunkRows: chunkRows,\n\t\tfileCompression: codec,\n\t}, nil\n}", "title": "" }, { "docid": "9b0451b580b73d59bd200f82b5c8c9f9", "score": "0.49738583", "text": "func buildDataIntoFileName(fdata *schema.ProcessedFile, rowsCount int) string {\n\treturn fdata.FileName + rowsFileKeyDelimiter + strconv.Itoa(rowsCount) + tableFileKeyDelimiter + fdata.DataSchema.Name\n}", "title": "" }, { "docid": "24c456e0ea6f705b52405de080052fc0", "score": "0.49534205", "text": "func (a *API) TaskExport(r *gin.Context) {\n\tb := &bytes.Buffer{}\n\tw := csv.NewWriter(b)\n\n\tif err := w.Write([]string{\"Name\", \"Cron\"}); err != nil {\n\t\tlog.Fatalln(\"error writing record to csv:\", err)\n\t\tr.AbortWithStatusJSON(http.StatusBadRequest, gin.H{\n\t\t\t\"error\": \"error writing record to csv:\" + err.Error(),\n\t\t})\n\t\treturn\n\t}\n\n\tfor _, task := range a.Context.JobInfo {\n\t\tvar record []string\n\t\trecord = append(record, task.Name)\n\t\trecord = append(record, task.Cron)\n\t\tif err := w.Write(record); err != nil {\n\t\t\tlog.Fatalln(\"error writing record to csv:\", err)\n\t\t\tr.AbortWithStatusJSON(http.StatusBadRequest, gin.H{\n\t\t\t\t\"error\": \"error writing record to csv:\" + err.Error(),\n\t\t\t})\n\t\t\treturn\n\t\t}\n\t}\n\tw.Flush()\n\n\tif err := w.Error(); err != nil {\n\t\tlog.Fatal(err)\n\t\tr.AbortWithStatusJSON(http.StatusBadRequest, gin.H{\n\t\t\t\"error\": \"error writing record to csv:\" + err.Error(),\n\t\t})\n\t}\n\n\tr.Data(http.StatusOK, \"text/csv\", b.Bytes())\n}", "title": "" }, { "docid": "bbb2618b8f1defbbb178d5deb9e8045b", "score": "0.4920966", "text": "func (w *ServerInterfaceWrapper) ExportData1(ctx echo.Context) error {\n\tvar err error\n\n\t// Parameter object where we will unmarshal all parameters from the context\n\tvar params ExportData1Params\n\t// ------------- Optional query parameter \"download\" -------------\n\n\terr = runtime.BindQueryParameter(\"form\", true, false, \"download\", ctx.QueryParams(), &params.Download)\n\tif err != nil {\n\t\treturn echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf(\"Invalid format for parameter download: %s\", err))\n\t}\n\n\t// Invoke the callback with all the unmarshalled arguments\n\terr = w.Handler.ExportData1(ctx, params)\n\treturn err\n}", "title": "" }, { "docid": "b80b844c73311caacf24145c05a1460e", "score": "0.4885598", "text": "func ToDataName(id DataId) (name string) {\n\tname = dataIdMap[id]\n\tif name == \"\" {\n\t\tname = \"INVALID\"\n\t}\n\treturn\n}", "title": "" }, { "docid": "c350e891e0c818c9164f60e25407749d", "score": "0.48611844", "text": "func (s *Store) datName() string {\n\text := \"dat\"\n\tif s.Ext != \"\" {\n\t\text = s.Ext\n\t}\n\treturn s.makeName(ext, !s.Plain)\n}", "title": "" }, { "docid": "8fd64d563c9b2f2563b6276d2243a363", "score": "0.48410398", "text": "func ExportUserData(connInfo *pg.A1ConnInfo, timeout time.Duration) (string, error) {\n\tconn, err := pg.Connect(connInfo, \"delivery\")\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to connect to delivery database\")\n\t}\n\tdefer conn.Close()\n\treturn conn.StringQuery(UsersExportSQL)\n}", "title": "" }, { "docid": "cb48b58c857f79308f48f426045ccf7f", "score": "0.48346984", "text": "func (p *parser) parseDataName() *ast.PathExpression {\n\t// DATA\n\tp.shift()\n\n\t// pathSegments\n\treturn p.parsePath(true)\n}", "title": "" }, { "docid": "fc01eb31465b9444dedb335b5d3ad734", "score": "0.47985816", "text": "func (n *Name) Export() (b *Buffer, err error) {\n\tb, err = n.MakeBuffer(allocGSSAPI)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar min C.OM_uint32\n\tmaj := C.wrap_gss_export_name(n.Fp_gss_export_name, &min,\n\t\tn.C_gss_name_t, b.C_gss_buffer_t)\n\terr = n.stashLastStatus(maj, min)\n\tif err != nil {\n\t\tb.Release()\n\t\treturn nil, err\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "70a37ca0dfe3143bb28a55a64272bfa4", "score": "0.4785308", "text": "func (b *ScaleOutETJobBuilder) Name(name string) *ScaleOutETJobBuilder {\n\tif name != \"\" {\n\t\tb.args.Name = name\n\t}\n\treturn b\n}", "title": "" }, { "docid": "30ea2b7eac781424858f949d9001c8ef", "score": "0.47706875", "text": "func (self *ExportType) Name() string {\n\tbyteVec := C.wasm_exporttype_name(self.inner())\n\tname := C.GoStringN(byteVec.data, C.int(byteVec.size))\n\n\truntime.KeepAlive(self)\n\n\treturn name\n}", "title": "" }, { "docid": "deabcc4fa296886bfe9a2dffed98d347", "score": "0.46958598", "text": "func (f *File) ExportFile(file string) {\n f.exportFiles[file] = true\n}", "title": "" }, { "docid": "0849d88fabeb3ae5c697cb893182f017", "score": "0.4692544", "text": "func (o StorageLensConfigurationStorageLensConfigurationOutput) DataExport() StorageLensConfigurationStorageLensConfigurationDataExportPtrOutput {\n\treturn o.ApplyT(func(v StorageLensConfigurationStorageLensConfiguration) *StorageLensConfigurationStorageLensConfigurationDataExport {\n\t\treturn v.DataExport\n\t}).(StorageLensConfigurationStorageLensConfigurationDataExportPtrOutput)\n}", "title": "" }, { "docid": "8d4709cfaef136db5918b279e339857d", "score": "0.46875927", "text": "func Export(ctx context.Context, nameOrID string, w io.Writer) error {\n\tparams := url.Values{}\n\tconn, err := bindings.GetClient(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresponse, err := conn.DoRequest(nil, http.MethodGet, \"/containers/%s/export\", params, nameOrID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif response.StatusCode/100 == 2 {\n\t\t_, err = io.Copy(w, response.Body)\n\t\treturn err\n\t}\n\treturn response.Process(nil)\n}", "title": "" }, { "docid": "c3f70012299a8dfd39dbbfbd51490a1c", "score": "0.46833113", "text": "func (a *Job) ExecutorData(data string) *Job {\n\ta.jobConfig.TaskConfig.ExecutorConfig.Data = data\n\treturn a\n}", "title": "" }, { "docid": "d41d7ba22e4125d3111a7e3835467bcf", "score": "0.46730405", "text": "func (md *MigrationData) Export(ctx context.Context, params MDExportParams) (*PxgValStr, []byte, error) {\n\tpostData, err := json.Marshal(params)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\trequest, err := http.NewRequest(\"POST\", md.client.Server+\"/api/v1.0/MigrationData.Export\", bytes.NewBuffer(postData))\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tpxgValStr := new(PxgValStr)\n\traw, err := md.client.Do(ctx, request, &pxgValStr)\n\treturn pxgValStr, raw, err\n}", "title": "" }, { "docid": "79c2a1c7526c68290e0c36e9d7f5b360", "score": "0.46723896", "text": "func (b *SparkJobBuilder) Name(name string) *SparkJobBuilder {\n\tif name != \"\" {\n\t\tb.args.Name = name\n\t}\n\treturn b\n}", "title": "" }, { "docid": "7794f24271c5d58dd11a8bcf09ba9742", "score": "0.46564505", "text": "func (*Exporter) AppendName(rec export.Record, buf *bytes.Buffer) {\n\t_, _ = buf.WriteString(rec.Descriptor().Name())\n}", "title": "" }, { "docid": "47ea08acd4d8cc2f41b1f8d73dd69719", "score": "0.46546024", "text": "func (s *BasepowerbuilderListener) ExitData_type_name(ctx *Data_type_nameContext) {}", "title": "" }, { "docid": "acff83eb106739bd408d37a2a0232fed", "score": "0.4652603", "text": "func (w *Waypoint) ExportFilename() string {\n\treturn fmt.Sprintf(\"%s-%s.tcx\", w.TimeString(), w.RideId)\n}", "title": "" }, { "docid": "fa119c2c48f00fe93979f05bc44b675a", "score": "0.46410426", "text": "func (s *Composite) ExportFilename() string {\n\treturn s.dotFilename\n}", "title": "" }, { "docid": "71cd454c3e4008dcd9d55fb4d398ce10", "score": "0.46336684", "text": "func (o StorageLensConfigurationStorageLensConfigurationPtrOutput) DataExport() StorageLensConfigurationStorageLensConfigurationDataExportPtrOutput {\n\treturn o.ApplyT(func(v *StorageLensConfigurationStorageLensConfiguration) *StorageLensConfigurationStorageLensConfigurationDataExport {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.DataExport\n\t}).(StorageLensConfigurationStorageLensConfigurationDataExportPtrOutput)\n}", "title": "" }, { "docid": "5e9a43899491707a83a870b5606bc86d", "score": "0.46332204", "text": "func getResourceDataName(data *action.SyncData) string {\n\tif data == nil {\n\t\treturn \"\"\n\t}\n\tif len(data.Namespace) > 0 {\n\t\treturn data.Namespace + \"/\" + data.Name\n\t}\n\treturn data.Name\n}", "title": "" }, { "docid": "11ad31db8be19787efab3efe345126b3", "score": "0.4623641", "text": "func (r *PopRow) SetName(name string) { r.Data.Name = name }", "title": "" }, { "docid": "4ae853452be4aa391d9786e7a9091601", "score": "0.46225423", "text": "func (n *none) ExportResourceData(c cache.Container) map[string]string {\n\treturn nil\n}", "title": "" }, { "docid": "3726bb80c60a48324fbf6193c38b8147", "score": "0.46189934", "text": "func ExportFunc(arg string) string {\n\tfmt.Println(arg)\n\treturn arg\n}", "title": "" }, { "docid": "5ce9ddbe32541f240054186ea3c93bdc", "score": "0.4613048", "text": "func (m *mongoAccountStore) ExportData(ctx context.Context) ([]byte, error) {\n\t// prepare temporary archive file\n\tfs := afero.NewOsFs()\n\n\tzipFile, err := afero.TempFile(fs, viper.GetString(\"archive.tempdir\"), fmt.Sprintf(\"pds-data-export-%s-zip-\", m.accountNumber))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer fs.Remove(zipFile.Name())\n\tdefer zipFile.Close()\n\n\tarchive := zip.NewWriter(zipFile)\n\n\tfor _, resource := range ResourceToExport {\n\t\tcursor, err := m.Resource(resource).Find(ctx, bson.M{})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar ratingData []interface{}\n\t\tif err := cursor.All(ctx, &ratingData); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tw, err := archive.Create(fmt.Sprintf(\"pds/%s.json\", resource))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := json.NewEncoder(w).Encode(ratingData); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif err := archive.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err := zipFile.Seek(0, 0); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ioutil.ReadAll(zipFile)\n}", "title": "" }, { "docid": "66bb724d10ff3956d63d5e0ad9f8544f", "score": "0.45880076", "text": "func ToDataId(name string) DataId {\n\th := fnv.New32a()\n\th.Write([]byte(name))\n\treturn DataId(h.Sum32())\n}", "title": "" }, { "docid": "222941f30c5e2185472c181ad0a26316", "score": "0.45791563", "text": "func (m *mongoCommunityStore) ExportData(ctx context.Context, accountNumber string) ([]byte, error) {\n\tif accountNumber == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty account number error\")\n\t}\n\n\t// prepare temporary archive file\n\tfs := afero.NewOsFs()\n\n\tzipFile, err := afero.TempFile(fs, viper.GetString(\"archive.tempdir\"), fmt.Sprintf(\"cds-data-export-%s-zip-\", accountNumber))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer fs.Remove(zipFile.Name())\n\tdefer zipFile.Close()\n\n\tarchive := zip.NewWriter(zipFile)\n\n\tfor _, resource := range ResourceToExport {\n\t\tcursor, err := m.Resource(resource).Find(ctx, bson.M{\"account_number\": accountNumber})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar ratingData []interface{}\n\t\tif err := cursor.All(ctx, &ratingData); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tw, err := archive.Create(fmt.Sprintf(\"cds/%s.json\", resource))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := json.NewEncoder(w).Encode(ratingData); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif err := archive.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif _, err := zipFile.Seek(0, 0); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ioutil.ReadAll(zipFile)\n}", "title": "" }, { "docid": "cc43f6da88f3ffa2c96a31593c148783", "score": "0.45785323", "text": "func makeExportArgs(name string, howMany int) string {\n\treturn ExportAnnotationToJson(ExportAnnotation{\n\t\tArguments: []RequiredInfo{\n\t\t\t{\n\t\t\t\tHowMany: howMany,\n\t\t\t\tName: name,\n\t\t\t},\n\t\t},\n\t})\n}", "title": "" }, { "docid": "8efbd571f55b45ecd81bb6bd7db857b8", "score": "0.4572215", "text": "func mapDataName(name string) (id DataId, err error) {\n\tid = ToDataId(name)\n\t\n\tif collision, ok := dataIdMap[id]; ok {\n\t\terr = errors.New(fmt.Sprintf(\"Collision occurred adding data to map: '%v' (collided with '%v')\", name, collision))\n\t\treturn\n\t}\n\t\n\tdataIdMap[id] = name\n\treturn\n}", "title": "" }, { "docid": "c157b8912b4b2df1923576d4e6329469", "score": "0.45696068", "text": "func WriteData(txt, fn, gr, name *string, spec, info, date string) {\n\tWriteFN(txt, fn)\n\tWriteDate(txt, &date)\n\tWriteGr(txt, gr)\n\tWriteName(txt, name)\n\tWriteSpec(txt, &spec)\n\tWriteInfo(txt, &info)\n}", "title": "" }, { "docid": "c21aa43cee1beb98a767bbad93d1168d", "score": "0.4565485", "text": "func (o *AuditLogExportJobJob) HasExportedFileName() bool {\n\tif o != nil && o.ExportedFileName.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0bb0cd5ff0c181df1b20f6cfc3441533", "score": "0.45633864", "text": "func Data(name, val string) Modifier {\n\treturn Prop(\"data-\"+name, val)\n}", "title": "" }, { "docid": "4ff0be2cbf8a22b0d81770ec83c3dfc0", "score": "0.45608336", "text": "func (target *BuildTarget) AddNamedDatum(name string, datum BuildInput) {\n\tif target.NamedData == nil {\n\t\ttarget.NamedData = make(map[string][]BuildInput)\n\t}\n\ttarget.NamedData[name] = append(target.NamedData[name], datum)\n\tif label, ok := datum.Label(); ok {\n\t\ttarget.AddDependency(label)\n\t\ttarget.dependencyInfo(label).data = true\n\t}\n}", "title": "" }, { "docid": "f666acb3bc46471dd3709d89c6b8ad4a", "score": "0.45528793", "text": "func DataPath(names ...string) string {\n\t_, path, _ := gdebug.CallerWithFilter([]string{pathFilterKey})\n\tpath = filepath.Dir(path) + string(filepath.Separator) + \"testdata\"\n\tfor _, name := range names {\n\t\tpath += string(filepath.Separator) + name\n\t}\n\treturn path\n}", "title": "" }, { "docid": "4c038e53e045296437d106813046a837", "score": "0.45451838", "text": "func Export(n *ir.Name) {\n\tif n.Sym().OnExportList() {\n\t\treturn\n\t}\n\tn.Sym().SetOnExportList(true)\n\n\tif base.Flag.E != 0 {\n\t\tfmt.Printf(\"export symbol %v\\n\", n.Sym())\n\t}\n\n\tTarget.Exports = append(Target.Exports, n)\n}", "title": "" }, { "docid": "8d5301bf92704eabe5a0a15549b0e2f9", "score": "0.4535564", "text": "func buildExport(context *web.Context, project string) {\n requestId, writer := util.RequestIdAndResponseWriter(project, context)\n workspace.BuildExport(writer, requestId)\n}", "title": "" }, { "docid": "89f9e155cd38be8f7559bca62083559b", "score": "0.45278674", "text": "func DatasetPropertyToName(p Prop) (name string) {\n\tif p == DatasetNumProps {\n\t\treturn \"numofprops\"\n\t}\n\tprop := C.zfs_prop_t(p)\n\tname = C.GoString(C.zfs_prop_to_name(prop))\n\treturn\n}", "title": "" }, { "docid": "aa49bc19549fe5b32dc7e9eeee979e1d", "score": "0.4527542", "text": "func (o SelfHostedIntegrationRuntimeStatusResponseOutput) DataFactoryName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v SelfHostedIntegrationRuntimeStatusResponse) string { return v.DataFactoryName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "d8517f5036b660b91d97809cc69b00ad", "score": "0.45195478", "text": "func (o JobDetailsOutput) Export() ExportPtrOutput {\n\treturn o.ApplyT(func(v JobDetails) *Export { return v.Export }).(ExportPtrOutput)\n}", "title": "" }, { "docid": "cfd66369f069374d3e9b0daf263e0d3f", "score": "0.45110077", "text": "func MergeOutputName(jobName string) string {\n\treturn DataOutputDir + \"mr.result.\" + jobName\n}", "title": "" }, { "docid": "2298c5c6ee5d1080cee143dfcc45a69c", "score": "0.450149", "text": "func (s *Scheduler) GetData(name string) (interface{}, error) {\n\ts.jobsRWMutex.RLock()\n\tjob, ok := s.jobs[name]\n\ts.jobsRWMutex.RUnlock()\n\tif !ok {\n\t\treturn nil, ErrJobNotFound\n\t}\n\n\treturn job.data, nil\n}", "title": "" }, { "docid": "180bd62aa3833b09a7efcd2b7e3a9f79", "score": "0.4480435", "text": "func (*MetricExporterPlugin) Name() string {\n\treturn \"metric-export-plugin\"\n}", "title": "" }, { "docid": "51d6d7e996863cda3fbe00de6f487016", "score": "0.44769108", "text": "func (o ManagedIntegrationRuntimeStatusResponseOutput) DataFactoryName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v ManagedIntegrationRuntimeStatusResponse) string { return v.DataFactoryName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "23381c371403274cb4d9b57805e47388", "score": "0.44647676", "text": "func (*noneExporter) ExportView(*view.Data) {\n}", "title": "" }, { "docid": "65fc3b6d397f84ee218c694da221943e", "score": "0.44322035", "text": "func (j *AuroraJob) Name(name string) *AuroraJob {\n\tj.jobConfig.Key.Name = name\n\treturn j\n}", "title": "" }, { "docid": "9545b28e202f4e6ee0916730b0bf80ca", "score": "0.44286662", "text": "func (s *DS2BQServiceImple) Export(ctx context.Context, form *DatastoreExportForm) error {\n\tclient, err := google.DefaultClient(ctx, dsapi.DatastoreScope)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tservice, err := dsapi.New(client)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\teCall := service.Projects.Export(form.ProjectID, &dsapi.GoogleDatastoreAdminV1beta1ExportEntitiesRequest{\n\t\tEntityFilter: &dsapi.GoogleDatastoreAdminV1beta1EntityFilter{\n\t\t\tKinds: form.Kinds,\n\t\t\tNamespaceIds: []string{\"\"},\n\t\t\tForceSendFields: []string{},\n\t\t\tNullFields: []string{},\n\t\t},\n\t\tOutputUrlPrefix: fmt.Sprintf(\"gs://%s\", form.Bucket),\n\t})\n\top, err := eCall.Do()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed datastore export\")\n\t}\n\tlog.Infof(ctx, \"Datastore Export Reponse Status Code : %d, Name : %s\", op.HTTPStatusCode, op.Name)\n\n\tif op.HTTPStatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"Datastore Export Response Status Code = %d\", op.HTTPStatusCode)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0507be4f40d37d1bddb64edae895c509", "score": "0.44131294", "text": "func (o *Exchange) ExchangeNameDatahistoryjobs(mods ...qm.QueryMod) datahistoryjobQuery {\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(\"\\\"datahistoryjob\\\".\\\"exchange_name_id\\\"=?\", o.ID),\n\t)\n\n\tquery := Datahistoryjobs(queryMods...)\n\tqueries.SetFrom(query.Query, \"\\\"datahistoryjob\\\"\")\n\n\tif len(queries.GetSelect(query.Query)) == 0 {\n\t\tqueries.SetSelect(query.Query, []string{\"\\\"datahistoryjob\\\".*\"})\n\t}\n\n\treturn query\n}", "title": "" }, { "docid": "584dfccf7196ca95261669c67512be91", "score": "0.4399427", "text": "func (m *ReportsGetHistoricalReportPostRequestBody) SetName(value *string)() {\n err := m.GetBackingStore().Set(\"name\", value)\n if err != nil {\n panic(err)\n }\n}", "title": "" }, { "docid": "a8f5a9ef84b26cc3db79e0eb49ea9e54", "score": "0.43976963", "text": "func (p *prowJobBaseBuilder) TestName(name string) *prowJobBaseBuilder {\n\tp.testName = name\n\treturn p\n}", "title": "" }, { "docid": "fb6427fc35d8349e011f65a2a0f6fabc", "score": "0.43945783", "text": "func (a *Client) ExportAuditToCSVForDataExport(params *ExportAuditToCSVForDataExportParams, authInfo runtime.ClientAuthInfoWriter) (*ExportAuditToCSVForDataExportOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewExportAuditToCSVForDataExportParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"exportAuditToCSVForDataExport\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/dataExports/action/exportAuditToCsv\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\"},\n\t\tParams: params,\n\t\tReader: &ExportAuditToCSVForDataExportReader{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\tsuccess, ok := result.(*ExportAuditToCSVForDataExportOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for exportAuditToCSVForDataExport: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" }, { "docid": "8e60014425dc6c3ee26d951c8286aef1", "score": "0.43900615", "text": "func (s *WorkbenchesService) ExportRequest(ctx context.Context) (*WbExportRequest, *Response, error) {\n\texp := &WbExportRequest{}\n\tresponse, err := s.client.Get(ctx, \"workbenches/export\", nil, exp)\n\treturn exp, response, err\n}", "title": "" }, { "docid": "61cbd08c0b98778b5a4dba80785a4010", "score": "0.438786", "text": "func (c *Client) Export(name string) error {\n\tif exported, err := c.isExported(name); !exported {\n\t\treturn c.api.Export(c.Path(name))\n\t} else if err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "2dc6a4e247448e77283ae0446a30c668", "score": "0.4386469", "text": "func (p *dataProvisioner) fetchData(src dataSource) string {\n\t// Set source status on return\n\tvar s sourceStatus = failed\n\tdefer func() {\n\t\tp.sources[src.idx].status = s\n\t}()\n\n\t// Construct URL\n\thost := string(src.host)\n\tdataPath := \"data/\" + utils.GetIntermediateFilePrefix(p.file, src.idx) +\n\t\t\".\" + strconv.Itoa(p.idx)\n\tu := url.URL{Host: host, Scheme: \"http\", Path: dataPath}\n\n\t// Fetch file through HTTP\n\tresp, err := http.Get(u.String())\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\tdefer resp.Body.Close()\n\n\t// Create output file. File closure not deferred intentionally\n\tfilePath := reducerPath + utils.GetIntermediateFilePrefix(p.file, p.idx) +\n\t\t\".\" + strconv.Itoa(src.idx)\n\n\tf, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\n\t// Copy data to local file and return\n\t_, err = io.Copy(f, resp.Body)\n\tf.Close()\n\tif err != nil {\n\t\tos.Remove(filePath)\n\t\treturn \"\"\n\t}\n\ts = done\n\treturn filePath\n}", "title": "" }, { "docid": "ffd504b079576f11a92b9d14a970713b", "score": "0.43718174", "text": "func (op *ExportTestCasesOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "0b37efebe18ad69a1ae9c82fd4310d25", "score": "0.43666497", "text": "func (m *ReportsRequestBuilder) ExportJobs()(*i062d4a86380aad1b2a18fcdf2ae3039afe4fb3340e8c61cd8a0118f64e2961f4.ExportJobsRequestBuilder) {\n return i062d4a86380aad1b2a18fcdf2ae3039afe4fb3340e8c61cd8a0118f64e2961f4.NewExportJobsRequestBuilderInternal(m.pathParameters, m.requestAdapter);\n}", "title": "" }, { "docid": "c6665d25a89b0096c2b2cbb1da499a29", "score": "0.43634742", "text": "func (g Graph) ExportPersonalData(w http.ResponseWriter, r *http.Request) {\n\tctx := r.Context()\n\tu := revactx.ContextMustGetUser(ctx)\n\tif reqUserID := chi.URLParam(r, \"userID\"); reqUserID != u.GetId().GetOpaqueId() {\n\t\tg.logger.Info().Msg(\"uid mismatch\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t_, _ = w.Write([]byte(\"personal data export for other users are not permitted\"))\n\t\treturn\n\t}\n\t// Get location from request\n\tloc := getLocation(r)\n\n\t// prepare marshaller\n\tvar marsh Marshaller\n\tswitch filepath.Ext(loc) {\n\tdefault:\n\t\tg.logger.Info().Str(\"path\", loc).Msg(\"invalid location\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t_, _ = w.Write([]byte(\"only json format is supported for personal data export\"))\n\t\treturn\n\tcase \".json\":\n\t\tmarsh = json.Marshal\n\t}\n\n\tref := &provider.Reference{\n\t\tResourceId: &provider.ResourceId{SpaceId: u.GetId().GetOpaqueId(), OpaqueId: u.GetId().GetOpaqueId()},\n\t\tPath: loc,\n\t}\n\n\tgatewayClient, err := g.gatewaySelector.Next()\n\tif err != nil {\n\t\tg.logger.Error().Err(err).Msg(\"could not select next gateway client\")\n\t\terrorcode.ServiceNotAvailable.Render(w, r, http.StatusInternalServerError, \"could not select next gateway client, aborting\")\n\t\treturn\n\t}\n\n\t// touch file\n\tif err := mustTouchFile(ctx, ref, gatewayClient); err != nil {\n\t\tg.logger.Error().Err(err).Msg(\"error touching file\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// go start gathering\n\tgo g.GatherPersonalData(u, ref, r.Header.Get(revactx.TokenHeader), marsh)\n\n\tw.WriteHeader(http.StatusCreated)\n}", "title": "" }, { "docid": "54d8da3729467ec88a24a15073f3ab8a", "score": "0.4361694", "text": "func (o LinkedIntegrationRuntimeResponseOutput) DataFactoryName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v LinkedIntegrationRuntimeResponse) string { return v.DataFactoryName }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "5c98973acd6a93ae3c9d538d5fac5637", "score": "0.43369597", "text": "func export(w http.ResponseWriter, r *http.Request) {\n\tlog.Print(\"Export endpoint triggered\")\n\tres, err := scanFile(\"data.csv\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t} else {\n\t\tfor _ , record := range res {\n\t\t\tfmt.Fprintln(w,record)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c0b4fd29b47cab1ecfb386154f16f27e", "score": "0.43254787", "text": "func (s *StepAPIWithOptionalArgs) Export(names ...string) *StepAPIWithOptionalArgs {\n\tapi, ok := s.step.API.(*API)\n\tif ok {\n\t\ts.step.Export = append(api.Export, names...)\n\t}\n\treturn s\n}", "title": "" }, { "docid": "026742fff8383e2e452262c4a1e5566d", "score": "0.4321675", "text": "func (v *Venom) setTestStepName(ts *TestStepResult, e ExecutorRunner, step TestStep, ranged *Range, rangedData *RangeData, rangedIndex int, print bool) {\n\tname := e.Name()\n\tif value, ok := step[\"name\"]; ok {\n\t\tswitch value := value.(type) {\n\t\tcase string:\n\t\t\tname = value\n\t\t}\n\t}\n\tif ranged.Enabled {\n\t\tname = fmt.Sprintf(\"%s (range=%s)\", name, rangedData.Key)\n\t}\n\tts.Name = name\n\n\tif print {\n\t\tv.Print(\" \\t\\t• %s\", ts.Name)\n\t}\n}", "title": "" }, { "docid": "340a73119c33a2a1ed49474a540565ea", "score": "0.43216744", "text": "func (builder *Builder) exportsContainerName() string {\n\tmountID := builder.getIdentifier()\n\treturn fmt.Sprintf(\"rocker_exports_%.6x\", md5.Sum([]byte(mountID)))\n}", "title": "" }, { "docid": "28485c117b07ac159024640cc7b76869", "score": "0.43191394", "text": "func (o AiDatasetOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *AiDataset) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "1378271b6669079d5406ec3775d25bc9", "score": "0.4315881", "text": "func Export(names ...string) Instr {\n\n\treturn &iExport{names}\n}", "title": "" }, { "docid": "6d54f12bdf5c25b8bf96dbf3295f7427", "score": "0.4312726", "text": "func DateExport(v time.Time) predicate.Pointpendingkyctransaction {\n\treturn predicate.Pointpendingkyctransaction(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldDateExport), v))\n\t})\n}", "title": "" }, { "docid": "380569d2732a30b4c9484eaa9ee5009d", "score": "0.4306121", "text": "func (m *ReportsRequestBuilder) ExportJobsById(id string)(*i485f9fd192f0985070e6776ebbebebbeab22aaa9df64be7131a3e622b77e1c4e.DeviceManagementExportJobItemRequestBuilder) {\n urlTplParams := make(map[string]string)\n for idx, item := range m.pathParameters {\n urlTplParams[idx] = item\n }\n if id != \"\" {\n urlTplParams[\"deviceManagementExportJob%2Did\"] = id\n }\n return i485f9fd192f0985070e6776ebbebebbeab22aaa9df64be7131a3e622b77e1c4e.NewDeviceManagementExportJobItemRequestBuilderInternal(urlTplParams, m.requestAdapter);\n}", "title": "" }, { "docid": "1c3b43327a5e1b43c3d2c000e92d86b9", "score": "0.4305477", "text": "func (c Closure) Export() interface{} {\n\tif c.f.arg == \"-\" {\n\t\treturn func(_ Value, local Scope) (Value, error) {\n\t\t\treturn c.Call(None, local)\n\t\t}\n\t}\n\treturn func(e Value, local Scope) (Value, error) {\n\t\treturn c.f.body.Eval(local.With(c.f.arg, e))\n\t}\n}", "title": "" }, { "docid": "037a7cc4a74dd99746bacc4338ece274", "score": "0.43003008", "text": "func (i *Instance) GetExport(store Storelike, name string) *Extern {\n\tvar item C.wasmtime_extern_t\n\tok := C.wasmtime_instance_export_get(\n\t\tstore.Context(),\n\t\t&i.val,\n\t\tC._GoStringPtr(name),\n\t\tC._GoStringLen(name),\n\t\t&item,\n\t)\n\truntime.KeepAlive(store)\n\truntime.KeepAlive(name)\n\tif ok {\n\t\treturn mkExtern(&item)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "72f26a79fe9e84176bb4852a2ed3a18c", "score": "0.4296858", "text": "func (c *Firewall) Export(format, vsys, name, passphrase string, includeKey bool, timeout time.Duration) (string, []byte, error) {\n\tc.ns.Client.LogExport(\"(export) %s %s: %s\", format, singular, name)\n\n\tex := url.Values{}\n\tex.Set(\"certificate-name\", name)\n\tex.Set(\"format\", format)\n\tex.Set(\"include-key\", util.YesNo(includeKey))\n\tif passphrase != \"\" {\n\t\tex.Set(\"passphrase\", passphrase)\n\t}\n\tif vsys != \"\" && vsys != \"shared\" {\n\t\tex.Set(\"vsys\", vsys)\n\t}\n\n\treturn c.ns.Client.Export(\"certificate\", timeout, ex, nil)\n}", "title": "" }, { "docid": "051a15d2de40111cfbd70d88478dd990", "score": "0.42950836", "text": "func (op *ExportRegistrationOperation) Name() string {\n\treturn op.lro.Name()\n}", "title": "" }, { "docid": "b4008cefeaa090f42ec4df608a8624da", "score": "0.4292606", "text": "func (m *WorkbookChart) SetName(value *string)() {\n m.name = value\n}", "title": "" }, { "docid": "8d2125eb69ce52d1be5adb5f2a768905", "score": "0.42899764", "text": "func newDataProvider(ctx context.Context, logger zerolog.Logger, basename string, data []byte) (string, error) {\n\tfh, err := ioutil.TempFile(\"\", basename+\".\")\n\tif err != nil {\n\t\tlogger.Error().Err(err).Str(\"basename\", basename).Msg(\"creating temporary file\")\n\t\treturn \"\", fmt.Errorf(\"creating temporary file: %w\", err)\n\t}\n\tdefer fh.Close()\n\n\tfn := fh.Name()\n\n\tif n, err := fh.Write(data); err != nil {\n\t\tlogger.Error().Err(err).Str(\"filename\", fn).Int(\"bytes\", n).Int(\"data\", len(data)).Msg(\"writing temporary file\")\n\t\treturn \"\", fmt.Errorf(\"writing temporary file for %s: %w\", basename, err)\n\t}\n\n\t// play nice and make sure this file gets deleted once the\n\t// context is cancelled, which could be when the program is\n\t// shutting down or when the scraper stops.\n\tgo func() {\n\t\t<-ctx.Done()\n\t\tif err := os.Remove(fn); err != nil {\n\t\t\tlogger.Error().Err(err).Str(\"filename\", fn).Msg(\"removing temporary file\")\n\t\t}\n\t}()\n\n\treturn fn, nil\n}", "title": "" }, { "docid": "8bcd892aa139217003d8064af8ca99f2", "score": "0.42624083", "text": "func wsExportCommand(output chan wsMessage) {\n\n\toutput <- wsMessage{Code: 200, Action: \"log\", Data: \"start\"}\n\n\texporter := makeExporter()\n\n\texporter.Reporter = func(msg string) {\n\t\toutput <- wsMessage{Code: 200, Action: \"log\", Data: msg}\n\t}\n\n\tlibrary := exporter.Export()\n\tj, _ := json.MarshalIndent(library, \"\", \" \")\n\n\toutput <- wsMessage{Code: 200, Action: \"log\", Data: \"end\"}\n\n\tcwd, _ := os.Getwd()\n\tdir, _ := filepath.Abs(cwd)\n\tfile := dir + \"/data.json\"\n\n\tioutil.WriteFile(file, j, 0644)\n\n\toutput <- wsMessage{Code: 200, Action: \"log\", Data: file}\n\n}", "title": "" }, { "docid": "b7c1ed50a32f5855eb6d2d871943a4d7", "score": "0.42565095", "text": "func (st *Help_SupportName_Data) WriteTo(_os *codec.Buffer) error {\n\tvar err error\n\n\terr = _os.Write_string(st.Name, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_ = err\n\n\treturn nil\n}", "title": "" }, { "docid": "15fce02c61930a3cd44a601ad8a12c49", "score": "0.4255727", "text": "func (o *AuditLogExportJobJob) GetExportedFileName() string {\n\tif o == nil || IsNil(o.ExportedFileName.Get()) {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.ExportedFileName.Get()\n}", "title": "" }, { "docid": "2937de5591595ffcf0888f950a5eb9ba", "score": "0.4250453", "text": "func (pop *OutParamPort) Name() string {\n\treturn pop.Process().Name() + \".\" + pop.name\n}", "title": "" }, { "docid": "0b2ab67e44fbc53210fe121436d0f05c", "score": "0.42469898", "text": "func (l lazypath) dataPath(elem ...string) string {\n\treturn l.path(DataHomeEnvVar, xdg.DataHomeEnvVar, dataHome, filepath.Join(elem...))\n}", "title": "" }, { "docid": "f2a15f866ccb8d41457ffffc042000f4", "score": "0.4239863", "text": "func testExportAsFormat(t *testing.T, format_str string, format_desc string, wait_time time.Duration) {\n\texport_id, err := exporter.Export(&app_config, map_user_dao, user_id, table_id, format_str)\n\tif err != nil {\n\t\tt.Errorf(\"%s: Export failed. Error = %s\", format_desc, err)\n\t} else {\n\t\t// wait for a second for the go routine to execute\n\t\ttime.Sleep(wait_time * time.Second)\n\t\texport, err := map_user_dao.Find(db.MasterExport(), export_id)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%s: Could not fetch export details. Err = %v\", format_desc, err)\n\t\t} else {\n\t\t\tstatus, ok := strconv.Atoi(export[\"status\"])\n\t\t\tif ok != nil {\n\t\t\t\tt.Errorf(\"%s: Invalid value for status: %d\", format_desc, status)\n\t\t\t} else {\n\t\t\t\tswitch status {\n\t\t\t\tcase exporter.ST_ERROR:\n\t\t\t\t\tt.Errorf(\"%s: Export failed\", format_desc)\n\t\t\t\tcase exporter.ST_IN_QUEUE:\n\t\t\t\t\tt.Errorf(\"%s: Export is still in queue\", format_desc)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "01d7823f0a4ede24a3976bf05ffa09e6", "score": "0.42337295", "text": "func (self Plesk) ExportBackupFromLocalStorage(name, dstPath string, includeIncrements bool) (error) {\n args := []string{\n \"--export-dump-as-file\",\n \"--dump-specification=\" + name,\n \"--dump-file-specification=\" + dstPath,\n }\n if includeIncrements {\n args = append(args, \"--include-increments\")\n }\n \n _, _, exitCode, err := execute(\n self.Log,\n self.Config[\"pmm-ras\"],\n args...\n )\n \n if err != nil {\n return BackupErr{\n isError: true,\n code: self.GetBackupErrorCode(exitCode),\n message: fmt.Sprintf(\"Failed to export backup %s to %s: %s\\n\", name, dstPath, err),\n localeKey: PleskBackupReturnCode[exitCode],\n localeArgs: map[string]string {\n \"backupName\": name,\n \"dstPath\": dstPath,\n },\n }\n }\n\n self.Log.Println(\"Successfully export backup %s to %s\", name, dstPath)\n return nil\n}", "title": "" }, { "docid": "2a8ceacaae41b57716474df141683e05", "score": "0.4232939", "text": "func (a *Job) Name(name string) *Job {\n\ta.jobConfig.Key.Name = name\n\treturn a\n}", "title": "" }, { "docid": "0ad0895aa63e210061709cfa4743c79e", "score": "0.42298028", "text": "func (esSvc *ElasticSearchService) SaveData(typeName string, namespace string, sinkData []interface{}) error {\n\tindexName, err := esSvc.Index(typeName, namespace)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn err\n\t}\n\tfor _, data := range sinkData {\n\t\tesSvc.EsClient.AddBulkReq(indexName, typeName, data)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "101d75ba4a616c66a3e418918cca9be4", "score": "0.4226299", "text": "func (rc RealmClient) Export(groupID, appID string, req realm.ExportRequest) (string, *zip.Reader, error) {\n\tif rc.ExportFn != nil {\n\t\treturn rc.ExportFn(groupID, appID, req)\n\t}\n\treturn rc.Client.Export(groupID, appID, req)\n}", "title": "" }, { "docid": "621fc50887e176b19e09777a239f88dd", "score": "0.42255104", "text": "func (l *I18n) Export(lang string) string {\n\tif _, ok := l.languages[lang]; !ok {\n\t\treturn \"\"\n\t}\n\n\tvar buf bytes.Buffer\n\tl.data[lang].WriteTo(&buf)\n\n\treturn buf.String()\n}", "title": "" }, { "docid": "8b8db0e60962ff981baecfe52db8f0ff", "score": "0.42185438", "text": "func ExportUserRolesData(connInfo *pg.A1ConnInfo, timeout time.Duration) (string, error) {\n\tconn, err := pg.Connect(connInfo, \"delivery\")\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, \"failed to connect to delivery database\")\n\t}\n\tdefer conn.Close()\n\treturn conn.StringQuery(UserRolesExportSQL)\n}", "title": "" }, { "docid": "80caefdd50b0c8dbea2856ada235d604", "score": "0.42095765", "text": "func (c *restClient) ExportRegistrationOperation(name string) *ExportRegistrationOperation {\n\toverride := fmt.Sprintf(\"/v1beta1/%s\", name)\n\treturn &ExportRegistrationOperation{\n\t\tlro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),\n\t\tpollPath: override,\n\t}\n}", "title": "" }, { "docid": "25046d2c9249e43bf9a98ac2b83804c5", "score": "0.42052934", "text": "func WriteTestData(numRows int, fileName string) {\n\tstream(numRows, fileName)\n}", "title": "" }, { "docid": "6ecfa044ca0de134073fd107118a9437", "score": "0.41978532", "text": "func (c Context) ExportContext(contextname string, contextfile string) (map[string]interface{}, error) {\n\tm := map[string]string{\n\t\t\"contextName\": contextname,\n\t\t\"contextFile\": contextfile,\n\t}\n\treturn c.c.Request(\"context/action/exportContext/\", m)\n}", "title": "" }, { "docid": "75af43429e8f34123c394781b58a1857", "score": "0.41973183", "text": "func StockInExportToCSV(db inventory.InventStockIn) gin.HandlerFunc {\n\treturn func(gc *gin.Context) {\n\n\t\tallStockIn := db.GetAllStoredProducts()\n\n\t\tcsvdata := init2dArray(len(allStockIn), 10)\n\n\t\tfor i := 0; i < len(allStockIn); i++ {\n\t\t\tcsvdata[i][0] = strconv.Itoa(i + 1)\n\t\t\tcsvdata[i][1] = allStockIn[i].Timestamp\n\t\t\tcsvdata[i][2] = allStockIn[i].Sku\n\t\t\tcsvdata[i][3] = allStockIn[i].Name\n\t\t\tcsvdata[i][4] = strconv.Itoa(allStockIn[i].OrderAmount)\n\t\t\tcsvdata[i][5] = strconv.Itoa(allStockIn[i].ReceivedAmount)\n\t\t\tcsvdata[i][6] = strconv.Itoa(allStockIn[i].BuyingPrice)\n\t\t\tcsvdata[i][7] = strconv.Itoa(allStockIn[i].Total)\n\t\t\tcsvdata[i][8] = allStockIn[i].Receipt\n\t\t\tcsvdata[i][9] = allStockIn[i].Note\n\t\t}\n\n\t\tfileName := time.Now().Format(\"2006-01-02\") + \"-StockIn.csv\"\n\t\tfile, err := os.Create(\"./csv/\" + fileName)\n\t\tif err != nil {\n\t\t\tgc.JSON(http.StatusConflict, gin.H{\n\t\t\t\t\"status\": false,\n\t\t\t\t\"message\": \"Failed to export file!\",\n\t\t\t})\n\t\t\treturn\n\t\t}\n\t\tdefer file.Close()\n\n\t\twriter := csv.NewWriter(file)\n\t\tdefer writer.Flush()\n\n\t\tfor _, value := range csvdata {\n\t\t\terr := writer.Write(value)\n\t\t\tif err != nil {\n\t\t\t\tgc.JSON(http.StatusConflict, gin.H{\n\t\t\t\t\t\"status\": false,\n\t\t\t\t\t\"message\": \"Failed to export file!\",\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tgc.JSON(http.StatusOK, gin.H{\n\t\t\t\"status\": true,\n\t\t\t\"message\": \"StockIn data exported to csv successfully!\",\n\t\t\t\"filename\": fileName,\n\t\t})\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "26663f27f54cd958a2c0c8c93b4b1aba", "score": "0.41953564", "text": "func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, fi FileInfo, dstVolume, dstPath string) (err error) {\n\tdefer func() {\n\t\tif err == nil {\n\t\t\tif s.globalSync {\n\t\t\t\tglobalSync()\n\t\t\t}\n\t\t}\n\t}()\n\n\tsrcVolumeDir, err := s.getVolDir(srcVolume)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdstVolumeDir, err := s.getVolDir(dstVolume)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Stat a volume entry.\n\tif err = Access(srcVolumeDir); err != nil {\n\t\tif osIsNotExist(err) {\n\t\t\treturn errVolumeNotFound\n\t\t} else if isSysErrIO(err) {\n\t\t\treturn errFaultyDisk\n\t\t}\n\t\treturn err\n\t}\n\n\tif err = Access(dstVolumeDir); err != nil {\n\t\tif osIsNotExist(err) {\n\t\t\treturn errVolumeNotFound\n\t\t} else if isSysErrIO(err) {\n\t\t\treturn errFaultyDisk\n\t\t}\n\t\treturn err\n\t}\n\n\tsrcFilePath := pathutil.Join(srcVolumeDir, pathJoin(srcPath, xlStorageFormatFile))\n\tdstFilePath := pathutil.Join(dstVolumeDir, pathJoin(dstPath, xlStorageFormatFile))\n\n\tvar srcDataPath string\n\tvar dstDataPath string\n\tdataDir := retainSlash(fi.DataDir)\n\tif dataDir != \"\" {\n\t\tsrcDataPath = retainSlash(pathJoin(srcVolumeDir, srcPath, dataDir))\n\t\t// make sure to always use path.Join here, do not use pathJoin as\n\t\t// it would additionally add `/` at the end and it comes in the\n\t\t// way of renameAll(), parentDir creation.\n\t\tdstDataPath = pathutil.Join(dstVolumeDir, dstPath, dataDir)\n\t}\n\n\tif err = checkPathLength(srcFilePath); err != nil {\n\t\treturn err\n\t}\n\n\tif err = checkPathLength(dstFilePath); err != nil {\n\t\treturn err\n\t}\n\n\tdstBuf, err := xioutil.ReadFile(dstFilePath)\n\tif err != nil {\n\t\tif !osIsNotExist(err) {\n\t\t\treturn osErrToFileErr(err)\n\t\t}\n\t\t// errFileNotFound comes here.\n\t\terr = s.renameLegacyMetadata(dstVolumeDir, dstPath)\n\t\tif err != nil && err != errFileNotFound {\n\t\t\treturn err\n\t\t}\n\t\tif err == nil {\n\t\t\tdstBuf, err = xioutil.ReadFile(dstFilePath)\n\t\t\tif err != nil && !osIsNotExist(err) {\n\t\t\t\treturn osErrToFileErr(err)\n\t\t\t}\n\t\t}\n\t\tif err == errFileNotFound {\n\t\t\t// Verification to ensure that we\n\t\t\t// don't have objects already created\n\t\t\t// at this location, verify that resultant\n\t\t\t// directories don't have any unexpected\n\t\t\t// directories that we do not understand\n\t\t\t// or expect. If its already there we should\n\t\t\t// make sure to reject further renames\n\t\t\t// for such objects.\n\t\t\t//\n\t\t\t// This elaborate check is necessary to avoid\n\t\t\t// scenarios such as these.\n\t\t\t//\n\t\t\t// bucket1/name1/obj1/xl.meta\n\t\t\t// bucket1/name1/xl.meta --> this should never\n\t\t\t// be allowed.\n\t\t\t{\n\t\t\t\tentries, err := readDirN(pathutil.Dir(dstFilePath), 1)\n\t\t\t\tif err != nil && err != errFileNotFound {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif len(entries) > 0 {\n\t\t\t\t\tentry := pathutil.Clean(entries[0])\n\t\t\t\t\tif entry != legacyDataDir {\n\t\t\t\t\t\t_, uerr := uuid.Parse(entry)\n\t\t\t\t\t\tif uerr != nil {\n\t\t\t\t\t\t\treturn errFileParentIsFile\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\tvar xlMeta xlMetaV2\n\tvar legacyPreserved bool\n\tif len(dstBuf) > 0 {\n\t\tif isXL2V1Format(dstBuf) {\n\t\t\tif err = xlMeta.Load(dstBuf); err != nil {\n\t\t\t\tlogger.LogIf(s.ctx, err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\t// This code-path is to preserve the legacy data.\n\t\t\txlMetaLegacy := &xlMetaV1Object{}\n\t\t\tvar json = jsoniter.ConfigCompatibleWithStandardLibrary\n\t\t\tif err := json.Unmarshal(dstBuf, xlMetaLegacy); err != nil {\n\t\t\t\tlogger.LogIf(s.ctx, err)\n\t\t\t\treturn errFileCorrupt\n\t\t\t}\n\t\t\tif err = xlMeta.AddLegacy(xlMetaLegacy); err != nil {\n\t\t\t\tlogger.LogIf(s.ctx, err)\n\t\t\t\treturn errFileCorrupt\n\t\t\t}\n\t\t\tlegacyPreserved = true\n\t\t}\n\t} else {\n\t\ts.RLock()\n\t\tformatLegacy := s.formatLegacy\n\t\ts.RUnlock()\n\t\t// It is possible that some drives may not have `xl.meta` file\n\t\t// in such scenarios verify if atleast `part.1` files exist\n\t\t// to verify for legacy version.\n\t\tif formatLegacy {\n\t\t\t// We only need this code if we are moving\n\t\t\t// from `xl.json` to `xl.meta`, we can avoid\n\t\t\t// one extra readdir operation here for all\n\t\t\t// new deployments.\n\t\t\tcurrentDataPath := pathJoin(dstVolumeDir, dstPath)\n\t\t\tentries, err := readDirN(currentDataPath, 1)\n\t\t\tif err != nil && err != errFileNotFound {\n\t\t\t\treturn osErrToFileErr(err)\n\t\t\t}\n\t\t\tfor _, entry := range entries {\n\t\t\t\tif entry == xlStorageFormatFile || strings.HasSuffix(entry, slashSeparator) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif strings.HasPrefix(entry, \"part.\") {\n\t\t\t\t\tlegacyPreserved = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tlegacyDataPath := pathJoin(dstVolumeDir, dstPath, legacyDataDir)\n\tif legacyPreserved {\n\t\t// Preserve all the legacy data, could be slow, but at max there can be 10,000 parts.\n\t\tcurrentDataPath := pathJoin(dstVolumeDir, dstPath)\n\t\tentries, err := readDir(currentDataPath)\n\t\tif err != nil {\n\t\t\treturn osErrToFileErr(err)\n\t\t}\n\n\t\t// legacy data dir means its old content, honor system umask.\n\t\tif err = mkdirAll(legacyDataPath, 0777); err != nil {\n\t\t\t// any failed mkdir-calls delete them.\n\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t\treturn osErrToFileErr(err)\n\t\t}\n\n\t\tfor _, entry := range entries {\n\t\t\t// Skip xl.meta renames further, also ignore any directories such as `legacyDataDir`\n\t\t\tif entry == xlStorageFormatFile || strings.HasSuffix(entry, slashSeparator) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err = Rename(pathJoin(currentDataPath, entry), pathJoin(legacyDataPath, entry)); err != nil {\n\t\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\n\t\t\t\treturn osErrToFileErr(err)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar oldDstDataPath string\n\tif fi.VersionID == \"\" {\n\t\t// return the latest \"null\" versionId info\n\t\tofi, err := xlMeta.ToFileInfo(dstVolume, dstPath, nullVersionID)\n\t\tif err == nil && !ofi.Deleted {\n\t\t\tif xlMeta.SharedDataDirCountStr(nullVersionID, ofi.DataDir) == 0 {\n\t\t\t\t// Purge the destination path as we are not preserving anything\n\t\t\t\t// versioned object was not requested.\n\t\t\t\toldDstDataPath = pathJoin(dstVolumeDir, dstPath, ofi.DataDir)\n\t\t\t\txlMeta.data.remove(nullVersionID, ofi.DataDir)\n\t\t\t}\n\t\t}\n\t\t// Empty fi.VersionID indicates that versioning is either\n\t\t// suspended or disabled on this bucket. RenameData will replace\n\t\t// the 'null' version. We add a free-version to track its tiered\n\t\t// content for asynchronous deletion.\n\t\txlMeta.AddFreeVersion(fi)\n\t}\n\n\tif err = xlMeta.AddVersion(fi); err != nil {\n\t\tif legacyPreserved {\n\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t}\n\t\treturn err\n\t}\n\n\tdstBuf, err = xlMeta.AppendTo(nil)\n\tif err != nil {\n\t\tlogger.LogIf(ctx, err)\n\t\tif legacyPreserved {\n\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t}\n\t\treturn errFileCorrupt\n\t}\n\n\tif srcDataPath != \"\" {\n\t\tif err = s.WriteAll(ctx, srcVolume, pathJoin(srcPath, xlStorageFormatFile), dstBuf); err != nil {\n\t\t\tif legacyPreserved {\n\t\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\n\t\t// renameAll only for objects that have xl.meta not saved inline.\n\t\tif len(fi.Data) == 0 && fi.Size > 0 {\n\t\t\trenameAll(dstDataPath, pathutil.Join(s.diskPath, minioMetaTmpDeletedBucket, mustGetUUID()))\n\t\t\tif err = renameAll(srcDataPath, dstDataPath); err != nil {\n\t\t\t\tif legacyPreserved {\n\t\t\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t\t\t}\n\t\t\t\ts.deleteFile(dstVolumeDir, dstDataPath, false)\n\n\t\t\t\tlogger.LogIf(ctx, err)\n\t\t\t\treturn osErrToFileErr(err)\n\t\t\t}\n\t\t}\n\n\t\t// Commit meta-file\n\t\tif err = renameAll(srcFilePath, dstFilePath); err != nil {\n\t\t\tif legacyPreserved {\n\t\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t\t}\n\t\t\ts.deleteFile(dstVolumeDir, dstFilePath, false)\n\n\t\t\tlogger.LogIf(ctx, err)\n\t\t\treturn osErrToFileErr(err)\n\t\t}\n\n\t\t// additionally only purge older data at the end of the transaction of new data-dir\n\t\t// movement, this is to ensure that previous data references can co-exist for\n\t\t// any recoverability.\n\t\tif oldDstDataPath != \"\" {\n\t\t\trenameAll(oldDstDataPath, pathutil.Join(s.diskPath, minioMetaTmpDeletedBucket, mustGetUUID()))\n\t\t}\n\t} else {\n\t\t// Write meta-file directly, no data\n\t\tif err = s.WriteAll(ctx, dstVolume, pathJoin(dstPath, xlStorageFormatFile), dstBuf); err != nil {\n\t\t\tif legacyPreserved {\n\t\t\t\t// Any failed rename calls un-roll previous transaction.\n\t\t\t\ts.deleteFile(dstVolumeDir, legacyDataPath, true)\n\t\t\t}\n\t\t\ts.deleteFile(dstVolumeDir, dstFilePath, false)\n\n\t\t\tlogger.LogIf(ctx, err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// srcFilePath is always in minioMetaTmpBucket, an attempt to\n\t// remove the temporary folder is enough since at this point\n\t// ideally all transaction should be complete.\n\n\tRemove(pathutil.Dir(srcFilePath))\n\treturn nil\n}", "title": "" }, { "docid": "95bd2532a143e2cd9213da4288008e5e", "score": "0.41926548", "text": "func NewOnPremisesCurrentExportData()(*OnPremisesCurrentExportData) {\n m := &OnPremisesCurrentExportData{\n }\n m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance();\n m.SetAdditionalData(make(map[string]any))\n return m\n}", "title": "" }, { "docid": "47a30c09b21b32d028567d51effd5fed", "score": "0.41907957", "text": "func (e *exporter) ExportView(vd *view.Data) {}", "title": "" }, { "docid": "6bcad05a44d60811eb46067205793f3e", "score": "0.41869652", "text": "func (saver *DbSaver) Name() string {\n\treturn saver.database + \"_\" + saver.table\n}", "title": "" }, { "docid": "67d169ef5de8961324104c82cbc7140b", "score": "0.41813114", "text": "func (s Manager) Export(name, oldpass, transferpass string) ([]byte, error) {\n\tkey, _, err := s.es.Get(name, oldpass)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tres, err := s.es.coder.Encrypt(key, transferpass)\n\treturn res, err\n}", "title": "" }, { "docid": "702d8ea996685e36838454f43619a6c2", "score": "0.41794175", "text": "func getExporterDeploymentName(clusterName string) string {\n\treturn clusterName\n}", "title": "" } ]
4da27053218cc79ad740e06535c55136
OpenDatabase opens a new database connection
[ { "docid": "627efe032cbd854429dd5854e8381a1f", "score": "0.716264", "text": "func OpenDatabase() (*sql.DB, error) {\n\tdb, err := sql.Open(\"mysql\", config.Load().DBCon)\n\tif err != nil {\n\t\treturn &sql.DB{}, err\n\t}\n\n\treturn db, nil\n}", "title": "" } ]
[ { "docid": "6459d9fc241dfe98e7cee356614483d2", "score": "0.77457494", "text": "func OpenDatabase(dbtype, uri string) (*sqlx.DB, error) {\n\tlog.Debugf(\"Opening %s database at %s\", dbtype, uri)\n\tdb, err := sqlx.Open(dbtype, uri)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Now let's query the database version to make sure we can read it!\n\tvar version string\n\trow := db.QueryRowx(\"SELECT Value FROM connectordbmeta WHERE Key='DBVersion';\")\n\tif row.Err() != nil {\n\t\treturn nil, row.Err()\n\t}\n\terr = row.Scan(&version)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif version != \"20160820\" {\n\t\treturn nil, errors.New(\"The existing database is incompatible with this version of ConnectorDB\")\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "340c21ca81c0dfbbd4f591b705de2813", "score": "0.76005775", "text": "func OpenDatabase(name string)(*MySqlDB, error){\n\tdb, err := sql.Open(\"mysql\",\n\t\t\t\t\t\tfmt.Sprintf(\"root:Heb1Pet!@/%s\",name))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &MySqlDB{db}, nil\n}", "title": "" }, { "docid": "ef9a547d619781a2bbc1805006f9c823", "score": "0.75670063", "text": "func (dbC *DatabaseConnection) OpenDatabase() error {\n\t// Establish connection to postgresql....\n\tdb, err := sql.Open(\"postgres\", dbC.getConnectionString())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdbC.db = db\n\terr = dbC.db.Ping()\n\tif err != nil {\n\t\tdbC.db.Close()\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "36e8441fdedfd7ab3cb592b8f2c090aa", "score": "0.7541093", "text": "func OpenDB(args ...interface{}) (database.Db, error) {\n\tif err := parseArgs(\"OpenDB\", args...); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// A memory database is not persistent, so let CreateDB handle it.\n\treturn CreateDB()\n}", "title": "" }, { "docid": "e5954a20eded056e4b4350fb9e6c8d17", "score": "0.75306576", "text": "func OpenDB(ctx context.Context) (driver.Database, errstack.E) {\n\tclient, dbname, err := MkClient()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb, err2 := client.Database(ctx, dbname)\n\treturn db, errstack.WrapAsInf(err2,\n\t\t\"Can't open a connection to an existing arangoDB database\")\n}", "title": "" }, { "docid": "c231dba68ee94c25973ca0714ce03b45", "score": "0.75244296", "text": "func OpenDatabase(dsn, engine string) (*sqlx.DB, error) {\n\n\tdb, err := sqlx.Open(engine, dsn)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"database connection error\")\n\t}\n\n\tfor {\n\t\tif err = db.Ping(); err != nil {\n\t\t\tlog.Errorf(\"ping database error, will retry in 2s: %s\", err)\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "daf0ee997057515ca9081fac966ec176", "score": "0.7438382", "text": "func (s *Server) OpenDatabase() error {\n\tvar database db.Database\n\n\tdatabasePath := s.cfg.DbPath\n\t_, err := os.Stat(databasePath)\n\tif err != nil && !os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"%w - could not access db in path %s: %v\", ErrDbNoAccess, databasePath, err)\n\t}\n\n\tif err != nil && os.IsNotExist(err) {\n\t\treturn ErrDbNotExist\n\t}\n\n\tdatabase, err = db.OpenDatabase(s.dbConfig())\n\tif err != nil {\n\t\ts.outLog.Printf(\"could not open the database in path %s: %v\", s.cfg.DbPath, err)\n\t\treturn ErrDbNotOpen\n\t}\n\n\ts.db = &database\n\n\treturn nil\n}", "title": "" }, { "docid": "15fd92d0ef2733db1072218c3fee42db", "score": "0.7392839", "text": "func OpenDatabase(filename string) error {\n\tdb := &database{}\n\tif err := db.Open(filename); err != nil {\n\t\treturn err\n\t}\n\tDB = db\n\treturn nil\n}", "title": "" }, { "docid": "5a0569729fe1225c6e1e02b3118c40d8", "score": "0.73870385", "text": "func Open(dataSourceName string) (*Database, error) {\n\tvar d Database\n\tvar err error\n\tif d.db, err = sql.Open(\"postgres\", dataSourceName); err != nil {\n\t\treturn nil, err\n\t}\n\tif err = d.statements.prepare(d.db); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &d, nil\n}", "title": "" }, { "docid": "5a0569729fe1225c6e1e02b3118c40d8", "score": "0.73870385", "text": "func Open(dataSourceName string) (*Database, error) {\n\tvar d Database\n\tvar err error\n\tif d.db, err = sql.Open(\"postgres\", dataSourceName); err != nil {\n\t\treturn nil, err\n\t}\n\tif err = d.statements.prepare(d.db); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &d, nil\n}", "title": "" }, { "docid": "9eb77111526adae6f63461a7603ca254", "score": "0.73751926", "text": "func Open() (*DB, error) {\n\n\tvar err error\n\tvar now string\n\tif *dbdb == \"\" {\n\t\treturn nil, fmt.Errorf(\"Please specify -dbdb flag\")\n\t}\n\tdbinfo := fmt.Sprintf(\"host=%s user=%s password=%s dbname=%s sslmode=require\", *dbhost, *dbuser, *dbpw, *dbdb)\n\n\t// check if we already have an sql object that matches, if so return it\n\tfor _, db := range databases {\n\t\tif db.dbinfo == dbinfo {\n\t\t\treturn db, nil\n\t\t}\n\t}\n\topendblock.Lock()\n\tdefer opendblock.Unlock()\n\t// check again, with lock\n\tfor _, db := range databases {\n\t\tif db.dbinfo == dbinfo {\n\t\t\treturn db, nil\n\t\t}\n\t}\n\n\t/*if !metricsRegistered {\n\t\tmetricsRegisterLock.Lock()\n\t\tif !metricsRegistered {\n\t\t\tprometheus.MustRegister(sqlTotalQueries, sqlFailedQueries, NewPoolSizeCollector())\n\t\t\tmetricsRegistered = true\n\t\t}\n\t\tmetricsRegisterLock.Unlock()\n\t}*/\n\n\tdbcon, err := sql.Open(\"postgres\", dbinfo)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to connect to %s on host \\\"%s\\\" as \\\"%s\\\"\\n\", *dbdb, *dbhost, *dbuser)\n\t\treturn nil, err\n\t}\n\tdbcon.SetMaxIdleConns(maxIdle())\n\tdbcon.SetMaxOpenConns(maxConnections()) // max connections per instance by default\n\t// force at least one connection to initialize\n\terr = dbcon.QueryRow(\"SELECT NOW() as now\").Scan(&now)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to query db %s: %s\\n\", *dbdb, err)\n\t\treturn nil, err\n\t}\n\tc := &DB{dbcon: dbcon, dbname: *dbdb, dbinfo: dbinfo}\n\tdatabases = append(databases, c)\n\tif len(databases) > 2 {\n\t\tfmt.Printf(\"[go-framework] WARNING OPENED %d databases\\n\", len(databases))\n\t\tfor i, d := range databases {\n\t\t\tfmt.Printf(\"Opened database #%d: %s\\n\", i, d.dbinfo)\n\t\t}\n\t\tpanic(\"too many databases\")\n\t}\n\treturn c, nil\n}", "title": "" }, { "docid": "9c07bde4ed86bbd9eae30f8f67721fec", "score": "0.7363444", "text": "func OpenDatabase(path string) (*gorm.DB, error) {\n\tdatabase, err := gorm.Open(sqlite.Open(path), &gorm.Config{})\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not open database: %w\", err)\n\t}\n\n\tdatabase.Exec(\"PRAGMA synchronous = OFF\")\n\tdatabase.Exec(\"PRAGMA journal_mode = WAL\")\n\tdatabase.Exec(\"PRAGMA foreign_keys = ON\")\n\n\tdatabase.AutoMigrate(&User{})\n\tdatabase.AutoMigrate(&HighScore{})\n\n\treturn database, nil\n}", "title": "" }, { "docid": "be0c5d3e01aefe2901616e6ab8884cfe", "score": "0.734849", "text": "func (c *Client) Open(name string, dbType DatabaseType, user, pass string) (*Database, error) {\n\tdb := &Database{pool: newConnPool(0, func() (DBSession, error) {\n\t\tconn, err := c.dial()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tds, err := conn.Open(name, dbType, user, pass)\n\t\tif err != nil {\n\t\t\tconn.Close()\n\t\t\treturn nil, err\n\t\t}\n\t\treturn sessionAndConn{DBSession: ds, conn: conn}, nil\n\t}), cli: c}\n\tconn, err := db.pool.getConn()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.pool.putConn(conn)\n\treturn db, nil\n}", "title": "" }, { "docid": "ae2072f7b8438692f261eae1b7dd83cc", "score": "0.73299414", "text": "func OpenDatabase() error {\n\tvar err error\n\tdb, err = sql.Open(\"sqlite3\", \"./post-app.db\")\n\n\treturn err\n}", "title": "" }, { "docid": "afc73d7cf66aaddcf1e19e54045c2405", "score": "0.7244452", "text": "func Open(dbpath string) (*Database, error) {\n\tdb, err := Connect(dbpath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Database{\n\t\tsess: db,\n\t}, nil\n}", "title": "" }, { "docid": "17d28046140b68afc496cc743c497959", "score": "0.7241686", "text": "func Open() (*sql.DB, error) { return sql.Open(DriverName, \"\") }", "title": "" }, { "docid": "e7ff81b53088fc2602374aac445565dc", "score": "0.72144747", "text": "func OpenDB(proto string, host string, port int, username string, password string) (*sql.DB, error) {\n\treturn OpenDBWithSQLMode(proto, host, port, username, password, nil)\n}", "title": "" }, { "docid": "509169aaa0e4a2661b6fe21b4ff20971", "score": "0.72112036", "text": "func Open() {\n\tdb, err := sql.Open(\n\t\tviper.GetString(\"database.driver\"),\n\t\tviper.GetString(\"database.user\")+\":\"+viper.GetString(\"database.password\")+\n\t\t\t\"@tcp(\"+viper.GetString(\"database.host\")+\":\"+viper.GetString(\"database.port\")+\")\"+\n\t\t\t\"/\"+viper.GetString(\"database.name\")+\"?parseTime=true&loc=\"+\n\t\t\tviper.GetString(\"database.timezone\")+\n\t\t\t\"&charset=\"+viper.GetString(\"database.charset\"))\n\tlib.CheckError(err, 1)\n\n\tdb.SetMaxOpenConns(viper.GetInt(\"database.maxOpenConnections\"))\n\tdb.SetMaxIdleConns(viper.GetInt(\"database.maxIdleConnections\"))\n\tdb.SetConnMaxLifetime(time.Duration(viper.GetInt(\"database.maxLifetimeConnection\")) * time.Minute)\n\n\tDB = db\n}", "title": "" }, { "docid": "e08c0651a99a94dd514de6b0bf552c10", "score": "0.719498", "text": "func OpenDatabaseConnection(adapter, parameters string) (*gorm.DB, error) {\n\tdb, err := gorm.Open(adapter, parameters)\n\treturn db, err\n}", "title": "" }, { "docid": "9cbf7a63a5a5de0d21a55553c7e97be5", "score": "0.7186666", "text": "func openDB() *sql.DB {\n\n u := &url.URL{\n Scheme: \"sqlserver\",\n User: url.UserPassword(gateConfig.DbUserName, gateConfig.DbPassword),\n Host: fmt.Sprintf(\"%s:%d\", gateConfig.DbHost, gateConfig.DbPort),\n }\n\n db, err := sql.Open(\"sqlserver\", u.String()+\"?database=\"+gateConfig.DbName)\n\n if err != nil {\n log.Fatal(err)\n panic(err)\n }\n\n return db\n}", "title": "" }, { "docid": "d62c8e803efbcf66084f6d7ae3d81f0f", "score": "0.7184656", "text": "func OpenDatabase() (*cache.DataBase, error) {\n\tdbPath := filepath.Join(config.Folder(), \"cache\", DataBaseName)\n\treturn cache.GetDB(dbPath)\n}", "title": "" }, { "docid": "f1fd6c7960b850fb3a6b85a02fa65718", "score": "0.71500313", "text": "func openTestDB() *Database {\n\tclearDB()\n\tdb, err := OpenDatabase(testDBPath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "3dd78f0319ef8900b9fc319261543e9f", "score": "0.7140098", "text": "func Open(conf *viper.Viper) *gorm.DB {\n\tdbfile := conf.GetString(\"database.file_path\")\n\tlog.Printf(\"using database path `%s`\", dbfile)\n\tdb, err := gorm.Open(sqlite.Open(dbfile), &gorm.Config{})\n\tif err != nil {\n\t\tlog.Fatalf(\"opening database failed: %s\", err)\n\t}\n\n\tif err := initial(db); err != nil {\n\t\tlog.Fatalf(\"init database failed: %s\", err)\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "e952ca69200a21fa4e826a4cc80f42f7", "score": "0.7136265", "text": "func Open(driverName, dataSourceName string) (DB, error) {\n\tdb, err := sql.Open(driverName, dataSourceName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn WrapDB(db), nil\n}", "title": "" }, { "docid": "eb82e88f10e450ff2973d1dbab432ab4", "score": "0.71280324", "text": "func (args *SQL) Open(ctx context.Context, driverName string) *sql.DB {\n\tdb, err := sql.Open(driverName, args.DB)\n\tif err != nil {\n\t\tctxlog.Fatal(ctx, \"error opening connection to database\", zap.Error(err))\n\t}\n\n\tif err := db.PingContext(ctx); err != nil {\n\t\tvar perr error\n\t\tfor i := 0; i < 4; i++ {\n\t\t\ttime.Sleep(100 * time.Millisecond)\n\n\t\t\tif perr = db.PingContext(ctx); perr == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif perr != nil {\n\t\t\tctxlog.Fatal(ctx, \"error pinging database\", zap.Error(err))\n\t\t}\n\t}\n\n\tif args.MigrateUp {\n\t\tif err := migrations.Up(args.DB, nil); err != nil {\n\t\t\tctxlog.Fatal(ctx, \"error migrating database\", zap.Error(err))\n\t\t}\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "7572be10005d780173b6a9dfd3c6f4f0", "score": "0.71225613", "text": "func OpenDB(path string) error {\n\tvar ret error\n\tonce.Do(\n\t\tfunc() {\n\t\t\tgormDB, err := internal.OpenDB(path)\n\t\t\tsingle.w = gormDB\n\t\t\tret = err\n\t\t})\n\n\treturn ret\n}", "title": "" }, { "docid": "f5a4395682f2b88a567487e473d33f22", "score": "0.71204513", "text": "func OpenDatabase() *sql.DB {\n\n\t// Make sure the directory is there\n\tdir, _ := filepath.Split(database_loc)\n\tos.MkdirAll(dir, os.ModePerm)\n\n\t// Open the database\n\t//start := time.Now()\n\tdb, err := sql.Open(\"sqlite3\", database_loc)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t//defer db.Close()\n\n\t// Create the table if needed\n\tsqlStmt := `\n\tCREATE TABLE IF NOT EXISTS timing_1sec\n\t(\n\t id INTEGER PRIMARY KEY AUTOINCREMENT,\n\t apitype string,\n\t status INTEGER,\n\t rawstatus TEXT,\n\t ms_dns FLOAT,\n\t ms_tcp FLOAT,\n\t ms_tls FLOAT,\n\t ms_server FLOAT,\n\t ms_content FLOAT,\n\t ms_total FLOAT,\n\t unixtime DATE\n\t);`\n\t_, err = db.Exec(sqlStmt)\n\tif err != nil {\n\t\tfmt.Errorf(\"[database]: %v\", err)\n\t\tfmt.Errorf(\"[database]: %v\", sqlStmt)\n\t}\n\n\t// return this database\n\t//fmt.Printf(\"[database]: Opened database (took %s)\\n\", time.Since(start))\n\treturn db\n\n}", "title": "" }, { "docid": "b24673fef9cc626ba1c5ff6b67846768", "score": "0.7112073", "text": "func Open(cs string) *sql.DB {\n\tdb := open(cs)\n\n\treturn db\n}", "title": "" }, { "docid": "54095c2d2960dc801fdb79c359c6be28", "score": "0.7093809", "text": "func openDatabaseConnection(dbConfig model.DbConfig, database string) (*sql.DB, error) {\n\tvar db *sql.DB\n\t// Try all hosts in the Host array and save the connection that first succeeds\n\tfor i := range dbConfig.Host {\n\t\tdbUri := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8\", dbConfig.Username,\n\t\t\tdbConfig.Password, dbConfig.Host[i], dbConfig.Port, database)\n\n\t\tdb, err := sql.Open(\"mysql\", dbUri)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"%s: %s\", StrERROR, err)\n\t\t\tcontinue\n\t\t}\n\t\terr = db.Ping()\n\t\tif err != nil {\n\t\t\tlog.Printf(\"%s: %s\", StrERROR, err)\n\t\t\tcontinue\n\t\t}\n\t\treturn db, nil\n\t}\n\treturn db, error(fmt.Errorf(\"could not get a DB connection\"))\n}", "title": "" }, { "docid": "e56ebf7bee53980b416b35dc80185ebd", "score": "0.70876753", "text": "func Open(uri string, opts ...Opt) (*Database, error) {\n\tconfig := defaultConf()\n\tfor _, opt := range opts {\n\t\topt(config)\n\t}\n\tpool, err := sqlitex.Open(uri, config.flags, config.connections)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"open db %s: %w\", uri, err)\n\t}\n\tdb := &Database{pool: pool}\n\tif config.migrations != nil {\n\t\ttx, err := db.Tx(context.Background())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr = config.migrations(tx)\n\t\tif err == nil {\n\t\t\ttx.Commit()\n\t\t}\n\t\ttx.Release()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfor i := 0; i < config.connections; i++ {\n\t\tconn := pool.Get(context.Background())\n\t\tif err := registerFunctions(conn); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer pool.Put(conn)\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "0f06ee5de56950c7f5a7f98a85057746", "score": "0.7084883", "text": "func Open(credentials Credentials, options ...Option) (*Database, error) {\n\tdb := new(Database)\n\tfor _, option := range options {\n\t\toption(db)\n\t}\n\n\tif db.debug {\n\t\tlog.WithField(\"credentials\", credentials.String()).Debug(\"Open database connection\")\n\t}\n\n\tvar err error\n\tdb.sess, err = sql.Open(\"mysql\", credentials.String())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot connect to mysql: %v\", err)\n\t}\n\n\tdb.sess.SetMaxOpenConns(3)\n\tdb.sess.SetMaxIdleConns(0)\n\n\tif err := db.sess.Ping(); err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot ping mysql: %v\", err)\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "f821e27a76d4016823a9fa9841ee9411", "score": "0.70708793", "text": "func Open() (*sql.DB, error) {\n\treturn sql.Open(driver, dataSource)\n}", "title": "" }, { "docid": "276f146cf0665d9c5260f97bf8307138", "score": "0.7070624", "text": "func OpenDB(args ...interface{}) (*LevelDb, error) {\n\tdbpath, err := parseArgs(\"OpenDB\", args...)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn nil, err\n\t}\n\n\tfmt.Println(dbpath)\n\tdb, err := openDB(dbpath, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "7e51b79e92a08e77f27247f3f306aa81", "score": "0.707023", "text": "func Open(dataSourceName string) (*sql.DB, error) {\n\treturn sql.Open(\"postgres\", dataSourceName)\n}", "title": "" }, { "docid": "7e51b79e92a08e77f27247f3f306aa81", "score": "0.707023", "text": "func Open(dataSourceName string) (*sql.DB, error) {\n\treturn sql.Open(\"postgres\", dataSourceName)\n}", "title": "" }, { "docid": "b7a97f46a0bdc60bdd7b94679211e185", "score": "0.7064966", "text": "func Open(name string) (*sql.DB, error) {\n\treturn sql.Open(driverName, name)\n}", "title": "" }, { "docid": "7fbbd5946efc20829d4ad52cc3d2078a", "score": "0.70599127", "text": "func OpenDB(migrations fs.FS) (DB, error) {\n\tif dbDSN == nil {\n\t\tlog.Panicf(\"no default database name configured\")\n\t}\n\n\tsqlDB, err := sql.Open(\"postgres\", *dbDSN)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"opening database: %w\", err)\n\t}\n\tdb := otelsql.NewDBWithTracing(sqlDB,\n\t\totelsql.WithAttributes(\n\t\t\tsemconv.DBSystemPostgreSQL,\n\t\t\t// assuming this is safe to include since it was on the command-line.\n\t\t\t// passwords should come from a file or environment variable.\n\t\t\tsemconv.DBConnectionStringKey.String(*dbDSN)))\n\n\tif err := postgres.UpIfNeeded(sqlDB, migrations); err != nil {\n\t\treturn nil, fmt.Errorf(\"migrating database: %w\", err)\n\t}\n\n\treturn &wrappedDB{DB: db}, nil\n}", "title": "" }, { "docid": "6595064854f06efde41d4bdb664917fa", "score": "0.7058428", "text": "func Open(address, target string) (*sql.DB, error) {\n\tc := Configuration{\n\t\tAddress: address,\n\t\tTarget: target,\n\t}\n\treturn OpenWithConfiguration(c)\n}", "title": "" }, { "docid": "7358a1441349dd7338d7bd9d0bd6e540", "score": "0.7044998", "text": "func OpenDB(dbfilename string, ReadOnly bool) (dbhandle *bolt.DB, err error) {\n\n\tif ReadOnly {\n\t\tdbhandle, err = bolt.Open(dbfilename, 0666, &bolt.Options{ReadOnly: true})\n\t\tif err != nil {\n\t\t\tlogger.LogError(\"Unable to open database in read only mode: %v\", err)\n\t\t}\n\t\treturn dbhandle, err\n\t}\n\n\tdbhandle, err = bolt.Open(dbfilename, 0600, &bolt.Options{Timeout: 3 * time.Second})\n\tif err != nil {\n\t\tlogger.LogError(\"Unable to open database: %v\", err)\n\t}\n\treturn dbhandle, err\n\n}", "title": "" }, { "docid": "581d9eacc5d5f06d07987dff4f5b716f", "score": "0.7042995", "text": "func Open (dataSourceName string)(*DB, error) {\n\tdb, err := sql.Open(\"postgres\", 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\treturn New(db), nil \n}", "title": "" }, { "docid": "5f0eb45f60cc2c80e0cdcc52dcb34399", "score": "0.703159", "text": "func Open(driverName, dataSourceName string) (*DB, error) {\n\tdb := &DB{nil, make(chan req)}\n\tc := make(chan error)\n\tgo db.thread(driverName, dataSourceName, c)\n\tif err := <-c; err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "c7497694b2b3d4ded9f8345b1a035bf5", "score": "0.70184916", "text": "func OpenDBConnection(user, password, dbname, dbhost, dbport string) *sql.DB {\n\tconnectionString := fmt.Sprintf(\"%s:%s@/%s\", user, password, dbname)\n\tif dbhost != \"\" {\n\t\tconnectionString = fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s\", user, password, dbhost, dbport, dbname)\n\t}\n\tlog.Println(\"Connecting to DB...\")\n\tdb, err := sql.Open(\"mysql\", connectionString)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "c7c0511287e720adb06b8b0e8d121138", "score": "0.7017946", "text": "func openDb(dbFile string) (*sql.DB, error) {\n\tdb, err := sql.Open(\"sqlite3\", dbFile)\n\n\tif err != nil {\n\t\tfmt.Printf(\"error opening db: %s\\n\", err.Error())\n\t\treturn nil, err\n\t}\n\n\terr = db.Ping()\n\n\tif err != nil {\n\t\tfmt.Println(\"couldn't ping db\")\n\t\treturn nil, err\n\t} else {\n\t\tfmt.Println(\"pinged\")\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "ce3018b210bfe39bfd2e9035ca4388c0", "score": "0.7010264", "text": "func openSQLiteDatabase(driver, dataSource string) {\n\t// Open the database connection\n\tdb, err := sql.Open(driver, dataSource)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error opening the database: %v\\n\", err)\n\t}\n\n\t// Check that we have a valid database connection\n\terr = db.Ping()\n\tif err != nil {\n\t\tlog.Fatalf(\"Error accessing the database: %v\\n\", err)\n\t}\n\n\tEnviron.DB = &DB{db}\n\tOpenidNonceStore.DB = &DB{db}\n}", "title": "" }, { "docid": "6de9b8e06e333f4e67d8b1e15bb4a099", "score": "0.70081615", "text": "func openDB(ctx Context) (*sql.DB, error) {\n\treturn sql.Open(\"postgres\", ctx.DBUrl)\n}", "title": "" }, { "docid": "298558efea1a0bcf836439753cc019b7", "score": "0.6991812", "text": "func openDB() (*sql.DB, error) {\n\t// db, err := sql.Open(\"mysql\", dsn)\n\tdb, err := sql.Open(\"postgres\", dsn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "79730ea94ebc53580eaf2a1fc6fc4ea7", "score": "0.69842446", "text": "func Open(driverName, dataSourceName string) (*Db, error) {\n\tdb, err := sql.Open(driverName, dataSourceName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tj := &Db{\n\t\tColumnConverter: SnakeCaseConverter, // default\n\t\tdriver: driverName,\n\t\tsource: dataSourceName,\n\t\tlru: newLru(),\n\t}\n\tj.DB = db\n\n\treturn j, nil\n}", "title": "" }, { "docid": "c25b27093db48c551ea62a9c9f789af2", "score": "0.6982972", "text": "func open(driverName, masterDSN string) (*DB, error) {\n\tconn := masterDSN\n\tdb := &DB{}\n\terr := scatter(1, func(i int) (err error) {\n\t\tdb.pdb, err = gorm.Open(driverName, conn)\n\t\treturn err\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "8e6df6d23dc7b055d30c3e427a4c23f5", "score": "0.69668204", "text": "func (db *DB) Open(dataSourceName string, opt ...database.Option) error {\n\topts := &database.Options{}\n\tfor _, o := range opt {\n\t\tif err := o(opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tconfig, err := pgx.ParseConfig(dataSourceName)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error parsing PostgreSQL DSN\")\n\t}\n\t// An explicit database name overrides one parsed from the DSN.\n\tif opts.Database != \"\" {\n\t\tconfig.Database = opts.Database\n\t}\n\n\t// Attempt to open the database.\n\tdb.db = pgxstdlib.OpenDB(*config)\n\terr = db.db.Ping()\n\tif err != nil && strings.Contains(err.Error(), \"(SQLSTATE 3D000)\") {\n\t\t// The database does not exist. Create it.\n\t\terr = createDatabase(config)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Attempt to open the database again.\n\t\tdb.db = pgxstdlib.OpenDB(*config)\n\t\terr = db.db.Ping()\n\t}\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error connecting to PostgreSQL database\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f6b5c95109216ab3b4f6bd5a601d2bf9", "score": "0.6941981", "text": "func Open(dbPath string, dbName string) (*DB, error) {\n\tpath := filepath.Join(dbPath, dbName)\n\n\tif !fileExists(dbPath) {\n\t\tif err := os.MkdirAll(dbPath, 0700); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tgdb, err := gorm.Open(\"sqlite3\", path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = gdb.AutoMigrate(\n\t\t&Counters{},\n\t\t&Channel{},\n\t\t&Payment{},\n\t\t&User{},\n\t\t&State{},\n\t\t&ChannelIDShortChanIDIndex{},\n\t\t&UserIDShortChanIDIndex{}).Error\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdb := &DB{\n\t\tDB: gdb,\n\t\tdbPath: dbPath,\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "7790dc3ee20e5447675f99dbebc78e8b", "score": "0.69413805", "text": "func (p *Producer) OpenDB(name string) (kvdb.DropableStore, error) {\n\tpath := p.resolvePath(name)\n\n\terr := os.MkdirAll(path, 0700)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tonDrop := func() {\n\t\t_ = os.RemoveAll(path)\n\t}\n\n\tdb, err := New(path, p.getCache(name), 0, nil, onDrop)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "a99fb6ae1e638ee5265b10cfdc568bc7", "score": "0.6923436", "text": "func OpenDb(opts *Options, name string) (*DB, error) {\n\tvar (\n\t\tcErr *C.char\n\t\tcName = C.CString(name)\n\t)\n\tdefer C.free(unsafe.Pointer(cName))\n\tdb := C.rocksdb_open(opts.c, cName, &cErr)\n\tif cErr != nil {\n\t\tdefer C.free(unsafe.Pointer(cErr))\n\t\treturn nil, errors.New(C.GoString(cErr))\n\t}\n\treturn &DB{\n\t\tname: name,\n\t\tc: db,\n\t\topts: opts,\n\t\topened: int32(1),\n\t}, nil\n}", "title": "" }, { "docid": "c09f71b68bab76ae4a7801f6cdba221d", "score": "0.69225645", "text": "func Open(family string, readOnly ...bool) (d *Database, err error) {\n\td = new(Database)\n\td.family = strings.TrimSpace(family)\n\n\t// convert the name to base64 for file writing\n\t// override the name\n\tif len(readOnly) > 1 && readOnly[1] {\n\t\td.name = path.Join(DataFolder, d.family)\n\t} else {\n\t\td.name = path.Join(DataFolder, base58.FastBase58Encoding([]byte(d.family))+\".sqlite3.db\")\n\t}\n\n\t// if read-only, make sure the database exists\n\tif _, err = os.Stat(d.name); err != nil && len(readOnly) > 0 && readOnly[0] {\n\t\terr = errors.New(fmt.Sprintf(\"group '%s' does not exist\", d.family))\n\t\treturn\n\t}\n\n\t// // check if it is a new database\n\tnewDatabase := false\n\tif _, err := os.Stat(d.name); os.IsNotExist(err) {\n\t\tnewDatabase = true\n\t}\n\n\t// open sqlite3 database\n\td.db, err = sql.Open(\"sqlite3\", d.name+\"?cache=shared&mode=rwc&_busy_timeout=50000000\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// create new database tables if needed\n\tif newDatabase {\n\t\terr = d.MakeTables()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\td.StartRequestQueue()\n\n\treturn\n}", "title": "" }, { "docid": "34d74791d0d545f887793713eb2589a4", "score": "0.69124067", "text": "func Open(adapter adapters.Adapter, dataSourceName string) (*DB, error) {\n\tdbInst, err := sql.Open(adapter.DriverName(), dataSourceName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn initialize(adapter, dbInst), nil\n}", "title": "" }, { "docid": "ff2df1dc8484637fe8b49d78ec185bb6", "score": "0.691236", "text": "func (db *DB) Open(ctx context.Context) (err error) {\n\t// Ensure a DSN is set before attempting to open the database.\n\tif db.connStr == \"\" {\n\t\treturn fmt.Errorf(\"db connection string required\")\n\t}\n\n\t// Connect to the database.\n\tif db.db, err = pgx.Connect(ctx, db.connStr); err != nil {\n\t\treturn err\n\t}\n\n\tif err := db.migrate(ctx); err != nil {\n\t\treturn fmt.Errorf(\"error whilst migrating: %w\", err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4831f8557df8a3a618c5b9b5d53d363c", "score": "0.69094056", "text": "func OpenDBConnection() *sql.DB {\n\t// Create DB connection string\n\tusername, password := getDatabaseLoginDetails()\n\tconnectionDetails := fmt.Sprintf(\n\t\t\"host=%s port=%d user=%s dbname=%s password=%s\",\n\t\tdatabaseHost, databasePort, username, databaseName, password,\n\t)\n\n\t// Connect to DB\n\tdb, err := sql.Open(\"postgres\", connectionDetails)\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to open DB connection due to: %v\\n\", err)\n\t}\n\n\t// Set connection params\n\tdb.SetMaxIdleConns(10)\n\tdb.SetMaxOpenConns(10)\n\tdb.SetConnMaxLifetime(0)\n\n\tlog.Println(\"DB connection opened successfully!\")\n\n\treturn db\n}", "title": "" }, { "docid": "7af6ce1384358063c1a0910e0e08f4ee", "score": "0.68785924", "text": "func OpenDB() *sql.DB {\n\tdb, err := sql.Open(\"mysql\", makeConnStr())\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "772af4ccc59e99d6db8bfc2dd46e2fd4", "score": "0.6869496", "text": "func openDBConnection() {\n\tpsqlInfo := fmt.Sprintf(\"host=%s port=%s user=%s \"+\n\t\t\"password=%s dbname=%s sslmode=disable\",\n\t\tSECRET.DB_HOST, SECRET.DB_PORT, SECRET.DB_USER, SECRET.DB_PASSWORD, SECRET.DB_NAME)\n\tdb, err := sql.Open(\"postgres\", psqlInfo)\n\tlogErr(err)\n\terr = db.Ping()\n\tlogErr(err)\n\tDB = db\n}", "title": "" }, { "docid": "3ba71a36bcb66aa00aa06eb78961f6b6", "score": "0.6866202", "text": "func OpenDB(cfg DBConfig) (*sql.DB, error) {\n\tdbDSN := fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s?charset=utf8mb4\", cfg.User, cfg.Password, cfg.Host, cfg.Port, cfg.Schema)\n\tdbConn, err := sql.Open(\"mysql\", dbDSN)\n\tif err != nil {\n\t\treturn nil, errors.Trace(err)\n\t}\n\n\terr = dbConn.Ping()\n\treturn dbConn, errors.Trace(err)\n}", "title": "" }, { "docid": "e84844a9e0ce4a2b1855d1af4efbe3df", "score": "0.6846522", "text": "func (mgr *ConfigManager) OpenDB() (*gorm.DB, error) {\n\tdsn, err := mgr.GetPostgresDSN()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdb, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "2bb89551c48ecb6347582bc164ccc900", "score": "0.6823867", "text": "func (d *PostgresEngine) Open(address string, port int64, dbname string, username string, password string) error {\n\tconnectionString := d.connectionString(address, port, dbname, username, password)\n\td.logger.Debug(\"sql-open\", lager.Data{\"connection-string\": connectionString})\n\n\tdb, err := sql.Open(\"postgres\", connectionString)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\td.db = db\n\n\treturn nil\n}", "title": "" }, { "docid": "73793bef651fde239eaa446169144f58", "score": "0.67996895", "text": "func OpenDb(dbFilename string) (*SQLDb, error) {\n\tvar err error\n\tsdb := &SQLDb{}\n\tsdb.DB, err = sql.Open(\"sqlite3\", dbFilename)\n\tif err != nil {\n\t\treturn sdb, err\n\t}\n\tif nil != sdb.DB.Ping() {\n\t\treturn sdb, fmt.Errorf(\"could not communicate with database: %s\", dbFilename)\n\t}\n\treturn sdb, nil\n}", "title": "" }, { "docid": "0073794a7d365fb45076c01c4905b6ed", "score": "0.67941886", "text": "func Open(databaseType, databaseURL string) (serviceDB *ServiceDB, err error) {\n\tdb, err := sql.Open(databaseType, databaseURL)\n\tif err != nil {\n\t\treturn\n\t}\n\tif _, err = db.Exec(schemaSQL); err != nil {\n\t\treturn\n\t}\n\tif databaseType == \"sqlite3\" {\n\t\t// Fix for \"database is locked\" errors\n\t\t// https://github.com/mattn/go-sqlite3/issues/274\n\t\tdb.SetMaxOpenConns(1)\n\t}\n\tserviceDB = &ServiceDB{db: db, dialect: databaseType}\n\treturn\n}", "title": "" }, { "docid": "dff3f26e762f242a30f017daf9957e40", "score": "0.67935103", "text": "func Open(host, port, user, dbName, password string) (db *gorm.DB, err error) {\n\tdbArgs := fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s password=%s sslmode=disable\", host, port, user, dbName, password)\n\tdb, err = gorm.Open(\"postgres\", dbArgs)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to connect to database\")\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "141607f3909c4f5db13b593decbe1c37", "score": "0.6784637", "text": "func OpenDb(op *DbOptions, catalogDB DB, log logger.Logger) (DB, error) {\n\tvar err error\n\n\tdbi := &db{\n\t\tLogger: log,\n\t\toptions: op,\n\t\tname: op.dbName,\n\t}\n\n\tdbDir := filepath.Join(op.GetDbRootPath(), op.GetDbName())\n\n\t_, dbErr := os.Stat(dbDir)\n\tif os.IsNotExist(dbErr) {\n\t\treturn nil, fmt.Errorf(\"Missing database directories\")\n\t}\n\n\tdbi.st, err = store.Open(dbDir, op.GetStoreOptions().WithLog(log))\n\tif err != nil {\n\t\treturn nil, logErr(dbi.Logger, \"Unable to open store: %s\", err)\n\t}\n\n\tdbi.tx1 = dbi.st.NewTx()\n\tdbi.tx2 = dbi.st.NewTx()\n\n\tvar catalogStore *store.ImmuStore\n\n\tif catalogDB == nil {\n\t\tcatalogStore = dbi.st\n\t} else {\n\t\tcatalogStore = catalogDB.(*db).st\n\t}\n\n\tdbi.sqlEngine, err = sql.NewEngine(catalogStore, dbi.st, []byte{SQLPrefix})\n\tif err != nil {\n\t\treturn nil, logErr(dbi.Logger, \"Unable to open store: %s\", err)\n\t}\n\n\terr = dbi.sqlEngine.UseDatabase(dbi.options.dbName)\n\tif err == sql.ErrDatabaseDoesNotExist {\n\t\t// Database registration may be needed when opening a database created with an older version of immudb (older than v1.0.0)\n\n\t\tlog.Infof(\"Registering database '%s' in the catalog...\", dbDir)\n\t\t_, _, err = dbi.sqlEngine.ExecPreparedStmts([]sql.SQLStmt{&sql.CreateDatabaseStmt{DB: dbi.options.dbName}}, nil, true)\n\t\tif err != nil {\n\t\t\treturn nil, logErr(dbi.Logger, \"Unable to open store: %s\", err)\n\t\t}\n\t\tlog.Infof(\"Database '%s' successfully registered\", dbDir)\n\n\t\terr = dbi.sqlEngine.UseDatabase(dbi.options.dbName)\n\t}\n\tif err != nil {\n\t\treturn nil, logErr(dbi.Logger, \"Unable to open store: %s\", err)\n\t}\n\n\treturn dbi, nil\n}", "title": "" }, { "docid": "0c406bc01d2eb46bc62d6871b482751e", "score": "0.6780011", "text": "func (c *Client) Open() {\n\tdbinfo := fmt.Sprintf(\"user=%s password=%s dbname=%s sslmode=disable\",\n\t\tc.usr, c.psw, c.dbName)\n\n\tdb, err := sql.Open(\"postgres\", dbinfo)\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tc.db = db\n}", "title": "" }, { "docid": "fcf998f3d2326966e004fe8f8dd406e9", "score": "0.67765003", "text": "func openDatabaseConnection() *sql.DB {\n\tdb, err := sql.Open(\"mysql\", \"root:root@tcp(127.0.0.1:3306)/soq\")\n\tif err != nil {\n\t\tfmt.Println(\"Error opening database..\")\n\t\tfmt.Println(err.Error())\n\t\tpanic(err.Error())\n\t\treturn nil\n\t}\n\treturn db\n}", "title": "" }, { "docid": "4c2f44eb85b4870863f02692113c0835", "score": "0.6769948", "text": "func Open(driverName, dataSourceNames string) (*DB, error) {\n\tconns := strings.Split(dataSourceNames, \";\")\n\tdb := &DB{pdbs: make([]*sql.DB, len(conns))}\n\n\terr := scatter(len(db.pdbs), func(i int) (err error) {\n\t\tdb.pdbs[i], err = sql.Open(driverName, conns[i])\n\t\treturn err\n\t})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "2b2dff14fb1453a2070918e2353cd1ac", "score": "0.67690617", "text": "func (db *Postgres) Open() {}", "title": "" }, { "docid": "d47e52aca1e345b536d0528690486d19", "score": "0.6760291", "text": "func OpenTestDB() (*gorm.DB, error) {\n\n\t//Set default test db name\n\ttestDBName := TestDBName\n\tif testDBName == \"\" {\n\t\ttestDBName = \"test\"\n\t}\n\n\t//Create the Url used to Open the db\n\tdbURL := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/?parseTime=true\", \"root\", DbRootPassword, DbHostname, DbPort)\n\n\t//Attempt to open a new connect to the db\n\tglog.Info(\"Opening a connection to the db...\")\n\tdb, err := gorm.Open(DbDriver, dbURL)\n\tif err != nil {\n\t\tglog.Fatal(\"Couldn't open a connection to the db!\", err)\n\t\treturn nil, err\n\t}\n\n\t//Drop old test db\n\tdropDBStmt := fmt.Sprintf(`DROP DATABASE IF EXISTS %s`, TestDBName)\n\tdb.Exec(dropDBStmt)\n\n\t//Create Database\n\tcreateStmt := fmt.Sprintf(`CREATE DATABASE %s;`, TestDBName)\n\tresult := db.Exec(createStmt)\n\tif result.Error != nil {\n\t\tglog.Info(result.Error)\n\t\treturn nil, err\n\t}\n\n\t//Select new test database\n\tuseStmnt := fmt.Sprintf(`USE %s;`, TestDBName)\n\tresult = db.Exec(useStmnt)\n\tif result.Error != nil {\n\t\tglog.Info(result.Error)\n\t\treturn nil, err\n\t}\n\n\tdb.LogMode(true)\n\n\tTestDB = db\n\n\treturn db, nil\n}", "title": "" }, { "docid": "bcdbdaca52041bbae26fbc65809e0901", "score": "0.67583853", "text": "func Open(cfg Config) (*sqlx.DB, error) {\n\n\t// Define SSL mode.\n\tsslMode := \"require\"\n\tif cfg.DisableTLS {\n\t\tsslMode = \"disable\"\n\t}\n\n\t// Query parameters.\n\tq := make(url.Values)\n\tq.Set(\"sslmode\", sslMode)\n\tq.Set(\"timezone\", \"utc\")\n\n\t// Construct url.\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: cfg.Name,\n\t\tRawQuery: q.Encode(),\n\t}\n\n\treturn sqlx.Open(\"postgres\", u.String())\n}", "title": "" }, { "docid": "a1f6ecf59c682e8f51c35d3542dd09a6", "score": "0.6753844", "text": "func OpenDB(connStr string) (*sql.DB, error) {\n\tconn, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to connect to database\")\n\t}\n\treturn conn, nil\n}", "title": "" }, { "docid": "4d04bf9d5d18c40e829f723ee74ab3b8", "score": "0.6743684", "text": "func Open() *gorm.DB {\n\n\tdb, _ := openDBConfig(env.Get().DB[0])\n\treturn db\n}", "title": "" }, { "docid": "001c5476a3adda106fa1b9fc24ea5d79", "score": "0.67427075", "text": "func openDB(ctx *kudos.Context) {\n\terr := ctx.OpenDB()\n\tif err != nil {\n\t\tctx.Error.Printf(\"could not open database: %v\\n\", err)\n\t\tdev.Fail()\n\t}\n}", "title": "" }, { "docid": "9adf8b1ce25781d9216b0e1cc6e33019", "score": "0.6739136", "text": "func Open() (*sql.DB, error) {\n\tdbURI := pass()\n\treturn sql.Open(\"pgx\", dbURI)\n}", "title": "" }, { "docid": "756ac530b201e7c387c39fd88e10c6dd", "score": "0.67379445", "text": "func (cf *connectionFactory) Open() (db *gorm.DB, err error) {\n\treturn cf.connectionBuilder()\n}", "title": "" }, { "docid": "bc9d3dea65132aded89e287989fa7c4c", "score": "0.67215294", "text": "func Open(cfg Config) (*sqlx.DB, error) {\n\n\tsslMode := \"require\"\n\tif cfg.DisableTLS {\n\t\tsslMode = \"disable\"\n\t}\n\n\tquery := make(url.Values)\n\tquery.Set(\"sslmode\", sslMode)\n\tquery.Set(\"timezone\", \"utc\")\n\n\turl := url.URL{\n\t\tScheme: \"postgres\",\n\t\tUser: url.UserPassword(cfg.User, cfg.Password),\n\t\tHost: cfg.Host,\n\t\tPath: cfg.Name,\n\t\tRawQuery: query.Encode(),\n\t}\n\n\treturn sqlx.Open(\"postgres\", url.String())\n}", "title": "" }, { "docid": "c491fa72e640cdb2d65b936904955b64", "score": "0.6719625", "text": "func (s *SQLite) Open() *sql.DB {\n\tif s.db != nil {\n\t\treturn s.db\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "388f92e46e26797170598069057a61b1", "score": "0.67100036", "text": "func OpenDb() (*sql.DB, error) {\n\treturn sql.Open(\"mysql\", os.Getenv(\"DB_URL\")+\"?parseTime=true&clientFoundRows=true\")\n}", "title": "" }, { "docid": "799e5d08756d44265c391909745b77b9", "score": "0.6709712", "text": "func newDatabaseConnection() *sql.DB {\n\tvar err error\n\n\t// Datasource Name Format docs: http://localhost:6060/pkg/github.com/ziutek/mymysql/godrv/\n\tvar dataSourceName string = _DB_NAME + \"/\" + _DB_USER_NAME + \"/\" + _DB_USER_PASS\n\tvar db *sql.DB\n\tif db, err = sql.Open(\"mymysql\", dataSourceName); err != nil {\n\t\tlog.Panic(err)\n\t}\n\treturn db\n}", "title": "" }, { "docid": "9db5a06997026d224e753be6deeea779", "score": "0.6707443", "text": "func OpenConnection() *sql.DB {\n\tpsqlInfo := fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\", host, port, user, password, dbname)\n\n\tdb, err := sql.Open(\"postgres\", psqlInfo)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = db.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "dc0690dce72e233a64f5dd6fdd3587ff", "score": "0.6705067", "text": "func openDB(connStr string) (*sql.DB, error) {\n\tdb, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "4b6cea575c3e52b953a62b10a181bc63", "score": "0.6700367", "text": "func OpenDB() *DBHandlerMysql {\r\n\r\n\t// check environment for the database url\r\n\terr := godotenv.Load(\"go.env\")\r\n\tif err != nil {\r\n\t\tpanic(err.Error())\r\n\t}\r\n\r\n\tdatabaseURL := os.Getenv(\"DATABASE_URL_MYSQL\")\r\n\r\n\t//load database connection\r\n\tdb, err1 := sql.Open(\"mysql\", databaseURL)\r\n\r\n\tif err1 != nil {\r\n\t\tpanic(err.Error())\r\n\t} else {\r\n\t\tfmt.Println(\"no issue\")\r\n\t}\r\n\r\n\tdbHandler1 := DBHandlerMysql{db}\r\n\treturn &dbHandler1\r\n}", "title": "" }, { "docid": "416de6537b3e17c21be7e02ffc561a6f", "score": "0.66999114", "text": "func Open(url string) (db *sql.DB, cleanup func(), err error) {\n\tvar connector driver.Connector\n\tconnector, err = pq.NewConnector(url)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tconnector = ocsql.WrapConnector(connector, ocsql.WithAllTraceOptions())\n\tdb = sql.OpenDB(connector)\n\tcleanup = func() {\n\t\t_ = db.Close()\n\t}\n\treturn\n}", "title": "" }, { "docid": "aed6f54420ddea87b710cc8e19f74ec8", "score": "0.66977024", "text": "func ConnectDatabase(dbname string) {\n\t//connString := fmt.Sprintf(\"server=%s;user id=%s;password=%s;port=%d;database=ProfDev\", *dbaddr, *dbuser, *dbpass, *dbport)\n\t//connString := fmt.Sprintf(\"%v:%v@tcp(%v:%v)/%v?charset=utf8&parseTime=True&loc=Local\", dbuser, dbpass, dbaddr, dbport, dbname)\n\tconnString := dbname + \".sqlite3\"\n\tmakeTables := false\n\n\t//check to see if the database doesn't exist. If it doesn't, we need to make the tables\n\tif _, err := os.Stat(connString); os.IsNotExist(err) {\n\t\t//mark tables for creation\n\t\tmakeTables = true\n\n\t}\n\n\tdbConn, err := sql.Open(\"sqlite3\", connString)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not open sqlite3 database connection: \", err.Error())\n\t}\n\tdbGormConnection, err := gorm.Open(\"sqlite3\", dbConn)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not open GORM sqlite3 database connection: \", err.Error())\n\t}\n\tdbGormConnection.DB().SetMaxIdleConns(5)\n\tdbGormConnection.DB().SetMaxOpenConns(10)\n\n\tlog.Println(\"Database connection opened.\")\n\n\tdbGorm = dbGormConnection\n\t//dbGorm.LogMode(true)\n\n\tif makeTables == true {\n\t\tCreateDatabaseTables()\n\t} else {\n\t\tMigrateDatabaseTables()\n\t}\n\n\tDbStorage.dbGorm = dbGormConnection\n}", "title": "" }, { "docid": "381224065de67ac78287f1f966e280bd", "score": "0.6695658", "text": "func Open(hostname, applicationName string) *Database {\n\treturn &Database{\n\t\tapp: applicationName,\n\t\tsess: redis.NewClient(&redis.Options{Addr: hostname}),\n\t}\n}", "title": "" }, { "docid": "7dc53589184924d343bff0cf94d745bd", "score": "0.6691163", "text": "func newDB(databaseURL string) (*sql.DB, error) {\n\tdb, err := sql.Open(\"postgres\", databaseURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := db.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "74f1a5a1d056f5d2c061219e19c8ca04", "score": "0.6682849", "text": "func OpenDB() *bolt.DB {\n\tif _, err := os.Stat(DBName); err == nil {\n\t\tdb, err := bolt.Open(DBName, 0600, nil)\n\t\tif err != nil {\n\t\t\tlog.Fatal(\"Could not open \" + DBName + \"\\n\")\n\t\t}\n\t\treturn db\n\t}\n\tlog.Fatal(DBName + \" does not exist.\\n\")\n\treturn nil\n}", "title": "" }, { "docid": "0beeab4eb4784ebab5503b8cff720eb5", "score": "0.66783464", "text": "func Open(url string) (*DB, error) {\n\tdsn, err := pq.ParseURL(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb, err := sql.Open(\"postgres\", dsn)\n\treturn &DB{db}, err\n}", "title": "" }, { "docid": "75dd6189c41c52724ac5ee3fb6e2527d", "score": "0.6676448", "text": "func OpenConnection() *gorm.DB {\n\tvar cs = fmt.Sprintf(\"host=%v port=%v user=%v dbname=%v password=%v sslmode=disable\", config.Get(\"db.host\"), config.Get(\"db.port\"), config.Get(\"db.user\"), config.Get(\"db.dbname\"), config.Get(\"db.password\"))\n\n\tvar e error\n\n\tdb, e = gorm.Open(\"postgres\", cs)\n\n\tif e != nil {\n\t\tpanic(\"failed to connect database\")\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "bf1dd71826760d679f887136d8863035", "score": "0.66649246", "text": "func OpenPGDatabase(ctx context.Context, connString string) (pgDB *PGDatabase, err error) {\n\t// Open database and start transaction\n\tdb, err := sqlx.ConnectContext(ctx, \"postgres\", connString)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\n\tdb.SetMaxOpenConns(100)\n\tdb.SetConnMaxLifetime(time.Second)\n\n\tpgDB = &PGDatabase{dbbase: dbbase{*db}}\n\treturn pgDB, err\n}", "title": "" }, { "docid": "905ed862057f43336131506ab262e101", "score": "0.6653437", "text": "func Open() *bolt.DB {\n\tdb, err := bolt.Open(DB, 0600, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn db\n}", "title": "" }, { "docid": "966a757e501229f81ca2fd1f305d56b6", "score": "0.6652081", "text": "func (c *DBConf) Open(ping bool) (*gorm.DB, error) {\n\tdb, err := gorm.Open(c.Driver, c.EncodeDSN())\n\tif err != nil {\n\t\treturn db, err\n\t}\n\n\tif c.MaxOpenConns > 0 {\n\t\tdb.DB().SetMaxOpenConns(c.MaxOpenConns)\n\t}\n\tif c.MaxIdleConns > 0 {\n\t\tdb.DB().SetMaxIdleConns(c.MaxIdleConns)\n\t}\n\tif c.ConnMaxLifeTime > 0 {\n\t\tdb.DB().SetConnMaxLifetime(time.Duration(c.ConnMaxLifeTime) * time.Second)\n\t}\n\tif ping {\n\t\terr = db.DB().Ping()\n\t}\n\n\treturn db, err\n}", "title": "" }, { "docid": "3e8ddb965d15957f14a6dd33e5d40368", "score": "0.6650687", "text": "func OpenConnection(cfg *config.Config) (*DB, error) {\n\tvar dns string = fmt.Sprintf(\"host=%s port=%s dbname=%s user=%s password=%s sslmode=disable\", cfg.Database.Host, cfg.Database.Port, cfg.Database.Name, cfg.Database.Username, cfg.Database.Password)\n\n\tconnection, err := gorm.Open(postgres.Open(dns), &gorm.Config{})\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb := New(connection)\n\n\treturn db, nil\n}", "title": "" }, { "docid": "a454cf0de90f7f1ae52b15a493d98b05", "score": "0.66470236", "text": "func (e *EphemeralPostgres) Open() (*sql.DB, error) {\n\terr := e.initDB()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Open a connection to the database\n\tconnString := e.GetConnectionString()\n\tdb, err := sql.Open(\"postgres\", connString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Perform a ping here so that errors with this module show up here, rather than\n\t// when the tester tries to use it.\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\te.currentConn = db\n\treturn db, nil\n}", "title": "" }, { "docid": "d09f76e07fab040a1ef33b126fab1658", "score": "0.66436374", "text": "func OpenTest() *sql.DB {\n\tdb := open(os.Getenv(`TEST_DB_CONNECTION_STRING`))\n\n\tmigrate(db, `test`)\n\n\treturn db\n}", "title": "" }, { "docid": "63ed93dc941327863f3d6dca7220e657", "score": "0.66393805", "text": "func Open(ctx context.Context, urlstr string) (*sql.DB, error) {\n\treturn defaultURLMux.OpenPostgres(ctx, urlstr)\n}", "title": "" }, { "docid": "d892104a39d87efd6dbb1bbeef8c271f", "score": "0.6639229", "text": "func openDB(dsn string) (*sql.DB, error) {\n\tdb, err := sql.Open(\"mysql\", dsn)\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\treturn db, nil\n}", "title": "" }, { "docid": "d129f868a1f876880a70f2d0e827b366", "score": "0.66355413", "text": "func Open(ctx context.Context, adapterName, dataSourceName string) (DB, error) {\n\tadapter, present := adapters[adapterName]\n\tif !present {\n\t\treturn nil, status.InvalidArgument(nil, \"no adapter\", adapterName)\n\t}\n\treturn adapter.Open(ctx, dataSourceName)\n}", "title": "" }, { "docid": "bdee5a0886b23e357a57f1708f62465d", "score": "0.6631686", "text": "func openDB(dsn string) (*sql.DB, error) {\n\tdb, err := sql.Open(\"mysql\", dsn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err := db.Ping(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" } ]
4664a0b50c00ba21d17ae33528b1810a
HasVersion returns a boolean if a field has been set.
[ { "docid": "fd10a5af6116dd817a0e8ef4b07eb64e", "score": "0.7163355", "text": "func (o *Ga4ghProgram) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
[ { "docid": "15db15333a10a106e4bc989e02e88028", "score": "0.76448876", "text": "func (o *FormSubmission) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "5b66e4c74039875e4642e294883f4c86", "score": "0.7621629", "text": "func (o *ViewProjectFile) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b9b9218d01af2f9a2cad0786423beefe", "score": "0.7516158", "text": "func (o *BundleDTO) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "120ee6642deebd186083747d68a41bfb", "score": "0.74812704", "text": "func (o *SoftwarerepositoryReleaseAllOf) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4bc38cbd2e1aa49b1493191ea8ae7bfd", "score": "0.74019384", "text": "func (o *HyperflexSoftwareDistributionVersion) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "e84b3f5d160e6a98daacb36533ca99e2", "score": "0.738101", "text": "func (o *Issue) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "2c6c141cbd92cdd359c627912652456c", "score": "0.7297308", "text": "func (o *CreateMetricRulesetResponse) HasVersion() bool {\n\tif o != nil && !isNil(o.Version) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "e5e7f12d7a037bf2de6dd0d977ac3ed9", "score": "0.7292021", "text": "func (o *UpdateDeviceFirmwareReqWeb) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4576afda7d8383edfe54d909650efa5a", "score": "0.71668226", "text": "func (o *AllocationDetails) HasVersion() bool {\n\tif o != nil && !IsNil(o.Version) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0f1f841bff945541dbfe9535627a22db", "score": "0.71643037", "text": "func (o *DeviceModelUpdateRequest) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a968320a05e9801609cbee14d4bfcbfb", "score": "0.7046468", "text": "func (o *DeviceManagementExchangeConnector) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "88f638b0df946da8b184a21112c17c7b", "score": "0.7008232", "text": "func (o *MicrosoftGraphManagedAppRegistration) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "20dd4befc2e1e00ff85cd67e506bb470", "score": "0.69944227", "text": "func (o *CloudWorkloadSecurityAgentRuleAttributes) HasVersion() bool {\n\treturn o != nil && o.Version != nil\n}", "title": "" }, { "docid": "01629702917f05f207128b3ac3cd9c44", "score": "0.69636536", "text": "func (o *EquipmentTpmAllOf) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "89da4edd71ea8fecfe262a31d03bb132", "score": "0.6954381", "text": "func HasVersion(version string) bool {\n\t_, ok := availableVersions[version]\n\treturn ok\n}", "title": "" }, { "docid": "9c0d50f9decf6a91365f07e0affa58e3", "score": "0.69526225", "text": "func (o *AllocationSummary) HasVersion() bool {\n\tif o != nil && !IsNil(o.Version) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b60f81c7c4c57d538f70916a2ba3c592", "score": "0.690862", "text": "func (o *MoVersionContextAllOf) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1e812c000646ec11fbfe13ede1ddfe46", "score": "0.6886013", "text": "func (o *MicrosoftGraphWindowsInformationProtectionPolicy) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ebe042002e25f0a475e3ca64c4eca4d0", "score": "0.6876296", "text": "func (v *VersionHistoryItem) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "dc17be940e02b69d9e5bde3ffc410f72", "score": "0.6866977", "text": "func (v *HistoryEvent) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "b58f9ce775677e5cbecb4e25cb29a0bb", "score": "0.6847178", "text": "func (r *queryResolver) HasVersion(ctx context.Context, id string) (bool, error) {\n\tv, err := model.VersionFindOne(model.VersionById(id))\n\tif err != nil {\n\t\treturn false, InternalServerError.Send(ctx, fmt.Sprintf(\"Error finding version %s: %s\", id, err.Error()))\n\t}\n\tif v != nil {\n\t\treturn true, nil\n\t}\n\n\tif patch.IsValidId(id) {\n\t\tp, err := patch.FindOneId(id)\n\t\tif err != nil {\n\t\t\treturn false, InternalServerError.Send(ctx, fmt.Sprintf(\"Error finding patch %s: %s\", id, err.Error()))\n\t\t}\n\t\tif p != nil {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\treturn false, ResourceNotFound.Send(ctx, fmt.Sprintf(\"Unable to find patch or version %s\", id))\n}", "title": "" }, { "docid": "09ceae1da9022e8efc7dafb20ac88b62", "score": "0.68439096", "text": "func (o *MicrosoftGraphManagedAppStatusRaw) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "71b1d97176a2eeadfd6b9a949f659f16", "score": "0.67907876", "text": "func (o *MicrosoftGraphManagedIosLobApp) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0632cdc8b30c559a613b8c48b306675d", "score": "0.67446566", "text": "func (o *ViewProjectFile) HasVersionId() bool {\n\tif o != nil && o.VersionId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "733bffca28f6ef340ea774f5fce21341", "score": "0.6737256", "text": "func (o *ViewProjectFile) HasVersions() bool {\n\tif o != nil && o.Versions != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f55f0768f8463eef3f26249ee119b270", "score": "0.6731215", "text": "func HasVersion(remote string) bool {\n\treturn version.Match(remote)\n}", "title": "" }, { "docid": "32f0eac1c76c04999d2646b4f1fbe339", "score": "0.670636", "text": "func (o *WorkflowVersion) HasVersionNumber() bool {\n\tif o != nil && o.VersionNumber != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "68185a944e3079cf02a12858594dacc4", "score": "0.6685144", "text": "func (o *CapabilityEndpointDescriptor) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3261ba9d4c160f0247ebf3884ee31c2d", "score": "0.668284", "text": "func (o *MicrosoftGraphAppleDeviceFeaturesConfigurationBase) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "85fa30f4370a7a379a70f41601e61889", "score": "0.66707575", "text": "func (rs *ReleaseScope) HasPrimeVersion() bool {\n\tif rs.PrimeVersion == nil {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "2e6417477ff9c8589fc4ec4460d9e929", "score": "0.6665556", "text": "func (v *TimerInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "a30c80bb54258d1b779396b9c90062c5", "score": "0.6655967", "text": "func (o *MicrosoftGraphIosGeneralDeviceConfiguration) HasVersion() bool {\n\tif o != nil && o.Version != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "74bf38c0f0ca8e4f6fdd578922f6fc70", "score": "0.6638068", "text": "func (v *ActivityInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "0febd3cc2262bfdffb4cb46d792c6dd7", "score": "0.66060877", "text": "func (v *ReplicationInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "ad4a39df3a907438dc8738b19523ffbe", "score": "0.6577359", "text": "func (v *SignalInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "a929c9a3c6056851140d20e5a9a26888", "score": "0.6563836", "text": "func (v *TransferTaskInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "223e867fe13a0a8c16e1f8391bd5cb6b", "score": "0.65412813", "text": "func (o *FileProjectFile) HasVersionId() bool {\n\tif o != nil && o.VersionId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ce51b74fa66424c3a469b360b25d0ad2", "score": "0.6487466", "text": "func (v *ReplicationTaskInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "b8399e523a3f478c94f469183f1ee62b", "score": "0.64109194", "text": "func (v *ChildExecutionInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "d062f927dcf47984853d5d4dcc2f8ef0", "score": "0.63721305", "text": "func (o *MicrosoftGraphManagedIosLobApp) HasVersionNumber() bool {\n\tif o != nil && o.VersionNumber != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d2e259b990d2abe0eea1d9e2b7b14718", "score": "0.6356983", "text": "func (v *TimerTaskInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "6ddb6a035b62551f277f85163fbd24aa", "score": "0.6350332", "text": "func (o *DhcpServerDataData) HasServerVersion() bool {\n\tif o != nil && o.ServerVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "88389c38a7bb00b5d9c2801594915706", "score": "0.6348307", "text": "func (bv *BuildVersion) Exists() bool {\n\treturn bv._exists\n}", "title": "" }, { "docid": "0631ed00c2fd611603dee98a7c52ce73", "score": "0.6292598", "text": "func (o *ResourceUpdateWeb) HasRequestedVersion() bool {\n\tif o != nil && o.RequestedVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "35d0b5dbf01dc2b6a7447ef60489cb59", "score": "0.6282248", "text": "func (o *Ruleset) HasRbVersion() bool {\n\tif o != nil && o.RbVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ba1238793e6e8f3ac38b2f923f58a8e9", "score": "0.6275281", "text": "func (o *NiatelemetryEpgAllOf) HasRecordVersion() bool {\n\tif o != nil && o.RecordVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "26508d0678ddfdf63186a27dc221d774", "score": "0.6217501", "text": "func (o *ResultAllOfAnalysisMetadata) HasVersionInfo() bool {\n\tif o != nil && o.VersionInfo != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bc04d893acf2f58d85f0ae93a51700ce", "score": "0.61981046", "text": "func (d ModelMixinData) HasHexyaVersion() bool {\n\treturn d.ModelData.Has(models.NewFieldName(\"HexyaVersion\", \"hexya_version\"))\n}", "title": "" }, { "docid": "1c2411bb3cdcf1febba0acdb918ce384", "score": "0.61371297", "text": "func (w *Widget) HasSizeVersion() bool {\n\tif w != nil && w.SizeVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1a25b20a5bcaeb8bbfcc7d5edaf9e933", "score": "0.61342126", "text": "func (rs *ReleaseScope) HasPreviousVersion() bool {\n\tif rs.PreviousVersion == nil {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "2894e1616d679987cb7337ad2e37d72e", "score": "0.6111728", "text": "func (o *ComputePhysicalSummaryAllOf) HasRevision() bool {\n\tif o != nil && o.Revision != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "79db2172e49b18ef0caad88c485bf2ce", "score": "0.6110748", "text": "func (o *Log) HasQueryApiVersion() bool {\n\tif o != nil && o.QueryApiVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c3570118cda018299e4b0d7c5aa19a68", "score": "0.6101626", "text": "func (o *RestoreOperationRequest) HasSchemaVersion() bool {\n\tif o != nil && o.SchemaVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3d9c6d2860998f643cfcf3757c252f3a", "score": "0.61015505", "text": "func hasField(v any, name string) bool {\n\tvr := reflect.Indirect(reflect.ValueOf(v))\n\treturn vr.FieldByName(name).IsValid()\n}", "title": "" }, { "docid": "9fd642e3dbf68a54cecdc7eb92a7373e", "score": "0.6073819", "text": "func (w *Widget) HasLayoutVersion() bool {\n\tif w != nil && w.LayoutVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "2d23e265ae1afdf7bc3d62cd3d3cd129", "score": "0.6017098", "text": "func (col *Column) Version() bool {\n\treturn col.version\n}", "title": "" }, { "docid": "06018d5294fa038bc9f5cd37ad9654dd", "score": "0.60119027", "text": "func (s *PersistentState) HasValidVersion() (valid bool, err error) {\n\tvalid = s != nil && s.Kind == PersistentStateKind && s.APIVersion == PersistentStateAPIVersion\n\tif !valid {\n\t\terr = fmt.Errorf(\"unsupported APIVersion %s for kind %s\", s.APIVersion, s.Kind)\n\t}\n\treturn\n}", "title": "" }, { "docid": "23519e048f2f52a78788965d49d20c06", "score": "0.6004528", "text": "func (o *ViewProjectFile) HasLatestFileVersionNo() bool {\n\tif o != nil && o.LatestFileVersionNo != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d35b7684f6c3f4f28c1dd285daeb2721", "score": "0.5975812", "text": "func (o *WorkflowVersion) HasPublishDate() bool {\n\tif o != nil && o.PublishDate != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "61759ca02792fde2935e241581f65989", "score": "0.5943207", "text": "func (v *RequestCancelInfo) IsSetVersion() bool {\n\treturn v != nil && v.Version != nil\n}", "title": "" }, { "docid": "c795b2250e8b64d04815de51e3c7afd6", "score": "0.5934087", "text": "func (x *fastReflection_VotingParams) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.VotingParams.voting_period\":\n\t\treturn x.VotingPeriod != nil\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.VotingParams\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.VotingParams does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "6ce087a733ff8627a08e6548380ddc2c", "score": "0.59316254", "text": "func (o *NiaapiSoftwareRegex) HasSoftwareVersion() bool {\n\tif o != nil && o.SoftwareVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "22aeb0d064f938fb563aecb75d0b2009", "score": "0.5925092", "text": "func (x *fastReflection_MsgSoftwareUpgrade) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.upgrade.v1beta1.MsgSoftwareUpgrade.authority\":\n\t\treturn x.Authority != \"\"\n\tcase \"cosmos.upgrade.v1beta1.MsgSoftwareUpgrade.plan\":\n\t\treturn x.Plan != nil\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.upgrade.v1beta1.MsgSoftwareUpgrade\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.upgrade.v1beta1.MsgSoftwareUpgrade does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "518ee2046c90f182336f163ea6934b92", "score": "0.5909179", "text": "func (o *MicrosoftGraphManagedAppRegistration) HasApplicationVersion() bool {\n\tif o != nil && o.ApplicationVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c24f1ca875e97524718a2d18ac22f4c8", "score": "0.59059864", "text": "func (rs *ReleaseScope) HasPrimeVersionCommit() bool {\n\tif rs.PrimeVersionCommit == nil {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "5fed74b851b748a08952bacb21b23716", "score": "0.5845763", "text": "func (c *Config) HasField(name string) bool {\n\treturn c.access().HasField(name)\n}", "title": "" }, { "docid": "d6ef7d22afe8bdf0a2f39bec6142b5ae", "score": "0.57971406", "text": "func (x *fastReflection_Vote) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.gov.v1.Vote.proposal_id\":\n\t\treturn x.ProposalId != uint64(0)\n\tcase \"cosmos.gov.v1.Vote.voter\":\n\t\treturn x.Voter != \"\"\n\tcase \"cosmos.gov.v1.Vote.options\":\n\t\treturn len(x.Options) != 0\n\tcase \"cosmos.gov.v1.Vote.metadata\":\n\t\treturn x.Metadata != \"\"\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.gov.v1.Vote\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.gov.v1.Vote does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "1a205bb5cde024b792bd3b1ee53f4b6a", "score": "0.57802063", "text": "func (o *NiatelemetryPodTimeServerPoliciesAllOf) HasRecordVersion() bool {\n\tif o != nil && o.RecordVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "0399cbad07a3696b40bbde739c3671c3", "score": "0.5772169", "text": "func (o *ResultAllOfAnalysisMetadata) HasLinkerVersion() bool {\n\tif o != nil && o.LinkerVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "23c77a3d2ad3c347f60acf624cbf21f0", "score": "0.5769303", "text": "func (o *ProcessGroupDTO) HasVersionControlInformation() bool {\n\tif o != nil && o.VersionControlInformation != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8a304410fbf7d358fa361a8429629bb6", "score": "0.5738911", "text": "func HasField(s *types.Struct, f *types.Var) bool {\n\tif s == nil || f == nil {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < s.NumFields(); i++ {\n\t\tif s.Field(i) == f {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "87ddacedbbbebd6b7e023814f015f413", "score": "0.57371044", "text": "func (x *fastReflection_HistoricalInfo) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.staking.v1beta1.HistoricalInfo.header\":\n\t\treturn x.Header != nil\n\tcase \"cosmos.staking.v1beta1.HistoricalInfo.valset\":\n\t\treturn len(x.Valset) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.staking.v1beta1.HistoricalInfo\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.staking.v1beta1.HistoricalInfo does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "2d12bf13630f265e133e086fb19be9e1", "score": "0.5731966", "text": "func (o *SchemaStub) HasLatestSchemaVersion() bool {\n\tif o != nil && o.LatestSchemaVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ceea71f790ad50e309f6815753e8c78f", "score": "0.5727873", "text": "func (f Fields) HasField(key string) bool {\n\t_, ok := f[key]\n\treturn ok\n}", "title": "" }, { "docid": "36685f9ccd8a9b74d0e4f988d790e6d3", "score": "0.5724945", "text": "func installerVersion(f1 validator.FieldLevel) bool {\n\tversion := f1.Field().String()\n\n\treturn version == acceptedVersion\n}", "title": "" }, { "docid": "10f110d53672bb263f3275eb7c30dc31", "score": "0.57233745", "text": "func (o *V1GeneDatasetRequestSort) HasField() bool {\n\tif o != nil && o.Field != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "6892350262a3cd40014afc3cacb3154f", "score": "0.5688947", "text": "func (o *OpenapiTaskGenerationResultAllOf) HasTaskVersion() bool {\n\tif o != nil && o.TaskVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dbc742ccb32d9e99d8af49f76849757d", "score": "0.5677733", "text": "func (o *MoVersionContextAllOf) HasVersionType() bool {\n\tif o != nil && o.VersionType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "58e6d67c543b740088f07779e0480f78", "score": "0.56730115", "text": "func (v VersionSet) Has(apiVersion string) bool {\n\tfor _, x := range v {\n\t\tif x == apiVersion {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "58e6d67c543b740088f07779e0480f78", "score": "0.56730115", "text": "func (v VersionSet) Has(apiVersion string) bool {\n\tfor _, x := range v {\n\t\tif x == apiVersion {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d38557e515ae35ed313a259fc63b199d", "score": "0.56706136", "text": "func (c *CLI) IsVersion() bool {\n\tc.once.Do(c.init)\n\treturn c.isVersion\n}", "title": "" }, { "docid": "d38557e515ae35ed313a259fc63b199d", "score": "0.56706136", "text": "func (c *CLI) IsVersion() bool {\n\tc.once.Do(c.init)\n\treturn c.isVersion\n}", "title": "" }, { "docid": "d870e56a1ab2d8b3174719f65dacdefe", "score": "0.5669194", "text": "func (o *NiatelemetryApicSnmpTrapDetailsAllOf) HasVer() bool {\n\tif o != nil && o.Ver != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "afaa50c547ce4cb88e9ccbfaf3c2511b", "score": "0.56600153", "text": "func (a *GlobalArgs) Version() bool {\n\treturn a.isVersion\n}", "title": "" }, { "docid": "1bdf93c66297272bb937cc1f197aba77", "score": "0.5658232", "text": "func (x *fastReflection_MsgSoftwareUpgradeResponse) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "d2acfb9b3ae78de12a7d714d580af451", "score": "0.5628527", "text": "func (o *NiatelemetryApicSnmpTrapDetailsAllOf) HasRecordVersion() bool {\n\tif o != nil && o.RecordVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "03ea81b15ae57e2ac88241562b6ff434", "score": "0.5620663", "text": "func (o *SoftwarerepositoryReleaseAllOf) HasReleaseDate() bool {\n\tif o != nil && o.ReleaseDate != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "347d8a722bcb10b419df756726ea0551", "score": "0.56142706", "text": "func (o *HostAgentInfo) HasFaultyVersion() bool {\n\tif o != nil && o.FaultyVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b691dc01824142139882cf87e14e3338", "score": "0.56135654", "text": "func (o *ContentJAVAPackageResponseContentInner) HasMavenVersion() bool {\n\tif o != nil && o.MavenVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9b976b77031432e415e2be33b3f61092", "score": "0.55901796", "text": "func (r *RecordExport) HasFields() bool {\n\treturn r.hasFields\n}", "title": "" }, { "docid": "c54b3fcec0d2fe1c8238e126ec95eb46", "score": "0.557519", "text": "func (o *KubernetesObjectMetaAllOf) HasResourceVersion() bool {\n\tif o != nil && o.ResourceVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "465d6ed865a6985b207c0ef5e014c79c", "score": "0.55726916", "text": "func (p *peer) VersionKnown() bool {\n\tp.StatsMtx.Lock()\n\tdefer p.StatsMtx.Unlock()\n\n\treturn p.versionKnown\n}", "title": "" }, { "docid": "f8ad58168a51e586aca1d82746694230", "score": "0.5571479", "text": "func (rs *ReleaseScope) HasPreviousVersionCommit() bool {\n\tif rs.PreviousVersionCommit == nil {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "46eb7ef7e689688fd6c47aaf5a660c8a", "score": "0.5560716", "text": "func (t *Translator) HasField(field string) bool {\n\t_, ok := t.fieldMap[field]\n\treturn ok\n}", "title": "" }, { "docid": "1324e02b80f2b6ac75b76c7cd9033932", "score": "0.55566406", "text": "func (o *ViewProjectFile) HasUploadedDate() bool {\n\tif o != nil && o.UploadedDate != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "fc96190647fde5205e2e743c5485bbcd", "score": "0.5547826", "text": "func (o *V1GenomicLocation) HasGenomicAccessionVersion() bool {\n\tif o != nil && o.GenomicAccessionVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4a91634958ff714d69a7621a5c9e68da", "score": "0.5544481", "text": "func (o *RestoreOperationRequest) HasExactSchemaVersion() bool {\n\tif o != nil && o.ExactSchemaVersion != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f0060abab546f171a8b2bff2c6bf56ce", "score": "0.5523232", "text": "func (e *ElasticsearchDatastore) IsVersionSupported() (supported bool) {\n\tsupported = false\n\n\tinfo, err := e.Info()\n\tif err != nil {\n\t\tlog.V(0).Infof(\"Could not get version: %s\\n\", err)\n\t\treturn\n\t}\n\n\tversionStr := strings.Join(strings.Split(info.Version.Number, \".\")[:2], \".\")\n\tverNum, err := strconv.ParseFloat(versionStr, 64)\n\tif err != nil {\n\t\tlog.V(0).Infof(\"Could not get version: %s\\n\", err)\n\t\treturn\n\t}\n\n\tif verNum >= 1.4 {\n\t\tsupported = true\n\t}\n\treturn\n}", "title": "" }, { "docid": "f575a66929da4e0471cd41ea81a9cd9f", "score": "0.5518588", "text": "func (x *fastReflection_ValidatorUpdates) Has(fd protoreflect.FieldDescriptor) bool {\n\tswitch fd.FullName() {\n\tcase \"cosmos.staking.v1beta1.ValidatorUpdates.updates\":\n\t\treturn len(x.Updates) != 0\n\tdefault:\n\t\tif fd.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.staking.v1beta1.ValidatorUpdates\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.staking.v1beta1.ValidatorUpdates does not contain field %s\", fd.FullName()))\n\t}\n}", "title": "" }, { "docid": "18649d824c4dec58473544267fefffc2", "score": "0.55175555", "text": "func (o *ProcessGroupDTO) HasVersionedComponentId() bool {\n\tif o != nil && o.VersionedComponentId != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
f842f0117b496bef70fc8a5fe13a8049
Deprecated: Use TournamentTeam.ProtoReflect.Descriptor instead.
[ { "docid": "44bc3635abe96c1766d9b2dfbf039e75", "score": "0.74848443", "text": "func (*TournamentTeam) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{4}\n}", "title": "" } ]
[ { "docid": "d35a76fc06689522d6a46113145a1632", "score": "0.73299927", "text": "func (*CDataGCCStrike15V2_TournamentGroupTeam) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{78}\n}", "title": "" }, { "docid": "27378cf871657211a650915e35dad0b5", "score": "0.72823066", "text": "func (*CMsgDOTALeaveTeam) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "5b2278a5b10f86a14235ded699993aa5", "score": "0.7277297", "text": "func (*CMsgDOTACreateTeam) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "0f73baeacb24600289031416a94e7cfc", "score": "0.7268711", "text": "func (*CMsgDOTAKickTeamMember) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{21}\n}", "title": "" }, { "docid": "c67edc12d36a11f4198504f4ac8f030e", "score": "0.7163451", "text": "func (*GetTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "2881b199a468d7578af23902e7bfc862", "score": "0.71593374", "text": "func (*UpdateTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "95776456ca7d71f2c6bf37a7d14ca89e", "score": "0.71520686", "text": "func (*CMsgDOTAEditTeamDetails) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "4cc4ced1c10d8ac45e7be44e344bd900", "score": "0.71110386", "text": "func (*GetTeamMembershipReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "096a0c05aad589e82fc523fdba6fa684", "score": "0.7100892", "text": "func (*CMsgDOTAMyTeamInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "237d82c797d8282b9238bc940f14dfaa", "score": "0.7050173", "text": "func (*CreateTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "5c060ca46ab5e9da9d00b1f918b89fb5", "score": "0.7045227", "text": "func (*DeleteTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "a6ac83f36ee8b32498a7c00ecbc27df8", "score": "0.7032883", "text": "func (*CMsgDOTAProTeamListResponse_TeamEntry) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{14, 0}\n}", "title": "" }, { "docid": "158d5a8ed3830b4f5601a482445528d0", "score": "0.70045024", "text": "func (*AddTeamMembersReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "042836310cd5785b1ebfc018828d0a7c", "score": "0.69976014", "text": "func (*CMsgDOTATransferTeamAdmin) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "d5106c3338a478f922c9f6815c889b5f", "score": "0.6984521", "text": "func (*GetTeamsForMemberReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "a84933180a78f2281307c6ca61c1355f", "score": "0.6967538", "text": "func (*CLobbyTeamDetails) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "ec254538903b5117ac87f1bb59e779ab", "score": "0.6956055", "text": "func (*MuteTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_MuteTeam_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "78a5eb7af7c7687edc1add62d9d2dfdc", "score": "0.69365174", "text": "func (*CPreMatchInfoData_TeamStats) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{33, 0}\n}", "title": "" }, { "docid": "a121e179d5461a21958e2f36e185ac11", "score": "0.6918643", "text": "func (*CMsgDOTACreateTeamResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "1a2f3679407ff7fe6264897ec6b8b395", "score": "0.6896954", "text": "func (*RemoveTeamMembersReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "469c13115a7ec150d48dfe74a9a569cf", "score": "0.6889285", "text": "func (*MuteTeamRsp) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_MuteTeam_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "bef9cd713061451d604e6af2bcafefd0", "score": "0.6876252", "text": "func (CMsgDOTACreateTeamResponse_Result) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{9, 0}\n}", "title": "" }, { "docid": "ba38473ce4c25c233baeb2cb2dc74f04", "score": "0.6850211", "text": "func (*CMsgDOTAProTeamListRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "b16254374931753b76c3604575fa5bf6", "score": "0.68336284", "text": "func (*DismissTeamReq) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_DismissTeam_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "8bdc5f618f60375f274261c5404158fe", "score": "0.6831224", "text": "func (*CMsgDOTALeaveTeamResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "5fa64fe542f531f6656767b9aa937950", "score": "0.68184966", "text": "func (*CMsgDOTAKickTeamMemberResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "c30c9bf78de6ccf0eac98966ffe2ddd0", "score": "0.68180203", "text": "func (CMsgDOTAEditTeamDetailsResponse_Result) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{11, 0}\n}", "title": "" }, { "docid": "17d39b7f7800f56e1c39fa94e5aa891d", "score": "0.6787001", "text": "func (*ListTeamsReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "5245beeaa70e9ed5ed328659d55beb12", "score": "0.67679226", "text": "func (CMsgDOTALeaveTeamResponse_Result) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{26, 0}\n}", "title": "" }, { "docid": "055de37f72c18ddfb0fdb01680d3296e", "score": "0.6747905", "text": "func (*CMsgDOTAProTeamListResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "4369c0a203349e83177358c65e5f9f59", "score": "0.67415375", "text": "func (CMsgDOTAKickTeamMemberResponse_Result) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{22, 0}\n}", "title": "" }, { "docid": "e5ab4ce04fd8811f216a7d4a4b8844f0", "score": "0.67371225", "text": "func (*CDataGCCStrike15V2_TournamentInfo) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{81}\n}", "title": "" }, { "docid": "8c9d31c26802db0aa7190567709fd5a4", "score": "0.67119837", "text": "func (CMsgDOTATransferTeamAdminResponse_Result) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{24, 0}\n}", "title": "" }, { "docid": "6a6619aeb044181f52e4b3635a3f40e2", "score": "0.66877586", "text": "func (*CMsgDOTAEditTeamDetailsResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "5139466455850ce2426b5189425acfd5", "score": "0.66743755", "text": "func (*DismissTeamRsp) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_team_DismissTeam_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "35eaab55bdf81bea5a6ead827d4263dc", "score": "0.6672453", "text": "func (*CMsgDOTATransferTeamAdminResponse) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "2d3e7ea3eb758cd09a718f8a0122b519", "score": "0.66541785", "text": "func (*TeamDrive) Descriptor() ([]byte, []int) {\n\treturn file_google_apps_drive_activity_v2_target_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "86391d4443e0e89dbb1535bf8b0ecd7b", "score": "0.6651977", "text": "func (*ListTeamsRequest) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "33f625e2438e8e48c34f8474f1a1660b", "score": "0.66472393", "text": "func (*TournamentPlayer) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "42e06e68d6c9aa5c152c7de8a473d2cd", "score": "0.66406184", "text": "func (*Tournament) Descriptor() ([]byte, []int) {\n\treturn file_tournament_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "da06e3a2b3f578577e654ba90d0e68f7", "score": "0.6627328", "text": "func (*CMsgGCCStrike15V2_Fantasy_FantasyTeam) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{85, 1}\n}", "title": "" }, { "docid": "0a60d56cf57734568a5b9d86ddb68d6a", "score": "0.6605779", "text": "func (*CMsgDOTATeamMember) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "1fb833fc0b65cb171f74f1ca4f0864f6", "score": "0.65910476", "text": "func (*CMsgDOTATeamsInfo) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "1bb7201fbc1d139535e8a32bc8499ab1", "score": "0.6538895", "text": "func (*ListTeamsResponse) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "81e0f940b63e786e886fed2cae9718f1", "score": "0.6499045", "text": "func (*DropTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "db995f219254b0551e57e21016b89192", "score": "0.6460042", "text": "func (LobbyDotaTVDelay) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "79cb82d50d39933f2ef7253f0beb3f27", "score": "0.64497304", "text": "func (x *fastReflection_TallyParams) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_TallyParams\n}", "title": "" }, { "docid": "a37dda0413a2026e3debfd1f7bf2ce30", "score": "0.64477396", "text": "func (*CMsgDOTATeamInfo) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "5da27589c14bdb4a277bae7e6c346bc5", "score": "0.6431201", "text": "func (*TeamDriveReference) Descriptor() ([]byte, []int) {\n\treturn file_google_apps_drive_activity_v2_target_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "02278000fc92d4028c1bc41e797a0aab", "score": "0.6429743", "text": "func (*CMsgDOTATeamInfo_Member) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{4, 0}\n}", "title": "" }, { "docid": "4a9b320a1775a29faf9f23204845d6dd", "score": "0.6418731", "text": "func (*CMsgDOTATeam) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "09338eb2d140abd5040afda57ea774b2", "score": "0.64111984", "text": "func (x *fastReflection_DVVTriplet) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_DVVTriplet\n}", "title": "" }, { "docid": "2ee07faf7fd11d0f4043194566f5cffa", "score": "0.6410396", "text": "func (*CDataGCCStrike15V2_TournamentGroup) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{79}\n}", "title": "" }, { "docid": "8ed7cf53be4d62095a864dd81cf37f87", "score": "0.6404394", "text": "func (*ListTeamsRequest) Descriptor() ([]byte, []int) {\n\treturn file_packs_v1_packs_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "d29128bb211bfd497dcac599dc067b05", "score": "0.6403297", "text": "func (*DropTeamResponse) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "8debcdf184f30d8449a3f0cbd9b0ae66", "score": "0.64022183", "text": "func (*CMsgGCCStrike15V2_GC2ClientTournamentInfo) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{94}\n}", "title": "" }, { "docid": "b7b1f88c703b0c0d88debdbbfb3bac21", "score": "0.638544", "text": "func (*AttachTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "01ab8b23bc468981988d43c7177f5a5d", "score": "0.6361733", "text": "func (*ApplyV2DataMigrationsReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "c729a8d4bbb94daa5f69b731d6fb7eca", "score": "0.63600415", "text": "func (*AttachTeamResponse) Descriptor() ([]byte, []int) {\n\treturn file_users_v1_users_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "9c842ea72f40520905836b70f17c3aca", "score": "0.634829", "text": "func (*ResetAllTeamProjectsReq) Descriptor() ([]byte, []int) {\n\treturn file_external_iam_v2_request_teams_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "d955e0ce1fb7c0bc162f9f2203eb5a38", "score": "0.63286555", "text": "func (*TournamentRequest) Descriptor() ([]byte, []int) {\n\treturn file_tournament_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "54d70d1e87a132d9db89d3fddfb35872", "score": "0.6303766", "text": "func (ETeamInviteResult) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6a395e95c78308a0c4caf93cfa05745c", "score": "0.6299787", "text": "func (*TournamentMatchSetup) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "7a551bfa46455a0ed3211d0a4f98ec9a", "score": "0.6294069", "text": "func (x *fastReflection_TallyResult) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_TallyResult\n}", "title": "" }, { "docid": "83c5428e3b1b2188eca61dd5bcc97e3b", "score": "0.626605", "text": "func (*CreateTournamentRequest) Descriptor() ([]byte, []int) {\n\treturn file_tournament_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "ffd780ba48a72760e8f61c3ae9c03331", "score": "0.6263032", "text": "func (*CDataGCCStrike15V2_TournamentMatchDraft) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{32}\n}", "title": "" }, { "docid": "3b024425e5eec5930f509d91631f3a9e", "score": "0.6252246", "text": "func (x *fastReflection_DVVTriplets) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_DVVTriplets\n}", "title": "" }, { "docid": "9ef4ed855e5a38a589e600d23141b54f", "score": "0.6251495", "text": "func (*CMsgLobbyPlaytestDetails) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "1c198696e69de82458b9d3a2d1a8a0f1", "score": "0.62412316", "text": "func (*CMsgDOTATeamInvite_InviteeResponseToGC) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "3a3d5719eab5051c94de33c42b7a6ac3", "score": "0.62135434", "text": "func (Trickle_Target) EnumDescriptor() ([]byte, []int) {\n\treturn file_pkg_grpc_biz_biz_proto_rawDescGZIP(), []int{7, 0}\n}", "title": "" }, { "docid": "273c04f5cd89944235aac1a3abb83d37", "score": "0.620809", "text": "func (*ListTeamsResponse) Descriptor() ([]byte, []int) {\n\treturn file_packs_v1_packs_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "33e7d453669ceb219d0701dcd7be2710", "score": "0.6179796", "text": "func (FlowMatch_IPProto) EnumDescriptor() ([]byte, []int) {\n\treturn file_lte_protos_policydb_proto_rawDescGZIP(), []int{4, 0}\n}", "title": "" }, { "docid": "421094474e30d4255e3a1d29db0acbb4", "score": "0.6174553", "text": "func (*CMsgDOTATeamInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "1a7489507d211f0039c066c8c642c3f9", "score": "0.61533755", "text": "func (*CMsgDOTATeamInvite_GCResponseToInvitee) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "8ba4621aedf268e2030c01f138eeebe4", "score": "0.61502093", "text": "func (Likelihood) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_cloud_videointelligence_v1p3beta1_video_intelligence_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "e05de29b166bc479b5927efa90287ae6", "score": "0.6144363", "text": "func (*TimestampedObject) Descriptor() ([]byte, []int) {\n\treturn file_google_cloud_videointelligence_v1p3beta1_video_intelligence_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "4a07bba32d33ff57459fdfea1e95a19d", "score": "0.6138427", "text": "func (*CreateTournamentResponse) Descriptor() ([]byte, []int) {\n\treturn file_tournament_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "be802965a30d3bae9d6af8f034d98742", "score": "0.61321425", "text": "func (*GetPlayerRequest) Descriptor() ([]byte, []int) {\n\treturn file_api_v1_pubgolf_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "69bf7e6831380a61bdf5500d828a7cc8", "score": "0.6083501", "text": "func (*DropTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_packs_v1_packs_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "a88973da5bf859fca7569a6a3e64f406", "score": "0.6080626", "text": "func (*CMsgGCCStrike15V2_Predictions_GroupMatchTeamPick) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{84, 0}\n}", "title": "" }, { "docid": "42463f2be25326e406d35cd8099d741f", "score": "0.6049969", "text": "func (*TournamentEvent) Descriptor() ([]byte, []int) {\n\treturn file_cstrike15_gcmessages_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "b22fde99b7bda8255dc654accf63dfaa", "score": "0.6047062", "text": "func (x *fastReflection_Foo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Foo\n}", "title": "" }, { "docid": "b2922f8045ed69bfff2229459c6ae19c", "score": "0.6036433", "text": "func (*CMsgPlayerInfo) Descriptor() ([]byte, []int) {\n\treturn file_dota2_networkbasetypes_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "9133af590135a1ab8639604340d0c7bf", "score": "0.6035616", "text": "func (*AttachTeamRequest) Descriptor() ([]byte, []int) {\n\treturn file_packs_v1_packs_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "7948052d475338510b9c9cf4b84e525f", "score": "0.6035227", "text": "func (UpdateWhitelistResponse_WhitelistResult) EnumDescriptor() ([]byte, []int) {\n\treturn file_discord_mc_protobuf_proto_mc_management_proto_rawDescGZIP(), []int{6, 0}\n}", "title": "" }, { "docid": "44604892e534f43246c5b60fc9f2c394", "score": "0.6032466", "text": "func (LobbyDotaPauseSetting) EnumDescriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "8cf4012bf21104a57cc300f0b854b161", "score": "0.60292363", "text": "func (ProjectVisibility) EnumDescriptor() ([]byte, []int) {\n\treturn file_modeldb_ProjectService_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f73c9c258f35c971ec966db3cf9590b7", "score": "0.6027429", "text": "func (x *fastReflection_HistoricalInfo) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_HistoricalInfo\n}", "title": "" }, { "docid": "921be92275638860cc0cf84281cabf10", "score": "0.6026955", "text": "func (*CSODOTAServerLobbyMember) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "8c86740f5d16ab3b1918b0b1b1222b58", "score": "0.6023964", "text": "func (FailureDetails_Type) EnumDescriptor() ([]byte, []int) {\n\treturn file_go_chromium_org_luci_luciexe_legacy_annotee_proto_annotations_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "43b0419e6aaeb5a2be0b3796ce878210", "score": "0.60196376", "text": "func (*EnumOnlyProto3) Descriptor() ([]byte, []int) {\n\treturn file_google_protobuf_test_messages_proto3_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "0a9e610fcb5524c103e6e41ba4feb292", "score": "0.59901553", "text": "func (*CSODOTAStaticLobbyMember) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "35476673fb185e9730f63dd2d3cc79aa", "score": "0.5988407", "text": "func (DmlFieldModifier) EnumDescriptor() ([]byte, []int) {\n\treturn file_DmlAst_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "b3b954bfe45814a3f55781a48dee7f5f", "score": "0.59854853", "text": "func (*CMsgDOTATeamInvite_GCRequestToInvitee) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "d66a2e4fe89b05c4c6e1b5314336ded1", "score": "0.5984508", "text": "func (*PerFriendPreferences) Descriptor() ([]byte, []int) {\n\treturn file_underlords_steamworks_steammessages_player_steamworkssdk_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "46605e0838d7044e38f380196487d714", "score": "0.59834427", "text": "func (EnumOnlyProto3_Bool) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_protobuf_test_messages_proto3_proto_rawDescGZIP(), []int{3, 0}\n}", "title": "" }, { "docid": "2afa687e53c6f456c500d129cc287474", "score": "0.5980918", "text": "func (*CMsgDOTABetaParticipation) Descriptor() ([]byte, []int) {\n\treturn file_dota2_dota_gcmessages_client_team_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "7c5ce40560eecc087caf063656f8409d", "score": "0.59806484", "text": "func (FieldId_StandardField) EnumDescriptor() ([]byte, []int) {\n\treturn file_google_devtools_issuetracker_v1_issuetracker_proto_rawDescGZIP(), []int{3, 0}\n}", "title": "" }, { "docid": "daf045615e6dfeddfee4fdd25088593e", "score": "0.5978884", "text": "func (*CMsgLocalServerFakeLobbyData) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_lobby_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "1832653901b52b993235ad806179d29e", "score": "0.59680974", "text": "func (*AttachTeamResponse) Descriptor() ([]byte, []int) {\n\treturn file_packs_v1_packs_proto_rawDescGZIP(), []int{21}\n}", "title": "" } ]
fc969587370efa15da36686c1c0fa61a
NewRowWriter creates a RowWriter.
[ { "docid": "7dbf5cb9eff7540e36e0d6e62b22889f", "score": "0.7492763", "text": "func NewRowWriter(ctx context.Context, client stiface.Client, bucket string, path string) (*RowWriter, error) {\n\tw := ObjectWriter(ctx, client, bucket, path)\n\tencoding := make(chan struct{}, 1)\n\tencoding <- struct{}{}\n\twriting := make(chan struct{}, 1)\n\twriting <- struct{}{}\n\n\treturn &RowWriter{w: w, encoding: encoding, writing: writing}, nil\n}", "title": "" } ]
[ { "docid": "0a529795f88ab3a9b645d0fa1ff27561", "score": "0.62534916", "text": "func NewRow(values ...interface{}) Row {\n\treturn append(make(Row, 0, len(values)), values...)\n}", "title": "" }, { "docid": "c0046ff90750b416406ddf209bbb931c", "score": "0.6229501", "text": "func NewJSONWriter(wr io.WriteCloser, outSch schema.Schema) (*RowWriter, error) {\n\treturn NewJSONWriterWithHeader(wr, outSch, jsonHeader, jsonFooter, \",\")\n}", "title": "" }, { "docid": "09d63fe5a0beff3a5451f51c1a543bbe", "score": "0.5952441", "text": "func newWriterRowMapper(columns []string, recordType reflect.Type) (rowMapper, error) {\n\tmappedFieldIndex, err := mapFields(columns, recordType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcolumnCount := len(columns)\n\tmapper := func(value reflect.Value) ([]any, error) {\n\t\tvar record = make([]any, columnCount)\n\t\tif value.Kind() == reflect.Ptr {\n\t\t\tvalue = value.Elem() //T = *T\n\t\t}\n\t\tfor i, fieldIndex := range mappedFieldIndex {\n\t\t\trecord[i] = value.Field(fieldIndex).Interface()\n\t\t}\n\t\treturn record, nil\n\t}\n\treturn mapper, nil\n}", "title": "" }, { "docid": "46adbf88e3053b8a9a1841ae61a9cf69", "score": "0.5882813", "text": "func NewRow(items ...string) *Row {\n\tr := &Row{}\n\tr.Add(items...)\n\tr.tagger = NewTagger()\n\treturn r\n}", "title": "" }, { "docid": "ff368cae52b8dcccfb1c0a9dc3e4a2e3", "score": "0.58185804", "text": "func NewRow(values ...interface{}) Row {\n\trow := make([]interface{}, len(values))\n\tcopy(row, values)\n\treturn row\n}", "title": "" }, { "docid": "fccccac744974941d887dd8a2b11b72d", "score": "0.575468", "text": "func NewTableWriter(out io.Writer) *RowWriter {\n\ttw := tabwriter.NewWriter(out, 1, 1, 1, ' ', 0)\n\tresult := &RowWriter{\n\t\tw: tw,\n\t\tf: tw.Flush,\n\t\td: \"\\t\",\n\t\te: \" \",\n\t}\n\treturn result\n}", "title": "" }, { "docid": "f4cc971fb940c1e11463ab72435ff663", "score": "0.5565215", "text": "func NewRow(cols ...*Row) *Row {\n\trs := &Row{Span: 12, Cols: cols}\n\treturn rs\n}", "title": "" }, { "docid": "d9f3d86d249daa783df2e90954f90715", "score": "0.55426675", "text": "func NewWriter(w *csv.Writer, header ...string) (*Writer, error) {\n\t// Check for duplicates in header\n\tset := make(map[string]struct{})\n\tfor _, h := range header {\n\t\tif _, duplicate := set[h]; duplicate {\n\t\t\treturn nil, ErrDuplicateKey{key: h}\n\t\t}\n\t\tset[h] = struct{}{}\n\t}\n\n\treturn &Writer{\n\t\twriter: w,\n\t\theader: header,\n\t\tdefaults: make(map[string]field),\n\t\tformatters: make(map[string]Formatter),\n\t\tmutex: &sync.Mutex{},\n\t\tEmptyValue: defaultEmptyValue,\n\t}, nil\n}", "title": "" }, { "docid": "67a6cd49f6ed1aa0d0c7254a963d5172", "score": "0.55348015", "text": "func New(writer io.Writer, columns []string, format string, opts ...Option) *Writer {\n\ttable := tablewriter.NewWriter(writer)\n\ttable.SetHeader(columns)\n\tcsvw := csv.NewWriter(writer)\n\tcsvw.Write(columns)\n\tw := &Writer{\n\t\tbasew: writer,\n\t\tsize: defaultSize,\n\t\tcsvw: csvw,\n\t\ttable: table,\n\t\tformatters: map[string][]Formatter{},\n\t\tcolumns: columns,\n\t\tformat: format,\n\t}\n\tfor _, o := range opts {\n\t\to(w)\n\t}\n\tw.strw = bufio.NewWriterSize(writer, w.size)\n\treturn w\n}", "title": "" }, { "docid": "61154f941eb2c218db1bf61688d76587", "score": "0.5394952", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{\n\t\tcsv: csv.NewWriter(w),\n\t}\n}", "title": "" }, { "docid": "78a412af0400f51192cd92f3b1e375f2", "score": "0.538426", "text": "func NewWriter(w io.Writer) Writer { return &writer{w: w} }", "title": "" }, { "docid": "4cc94ae52d5e5cc59775c735fc9625fe", "score": "0.53720003", "text": "func NewCSVWriter(out io.Writer) *RowWriter {\n\tresult := &RowWriter{\n\t\tw: out,\n\t\td: \",\",\n\t\te: \";\",\n\t}\n\treturn result\n}", "title": "" }, { "docid": "c0e374f085102b878e8c05e53c4b18a9", "score": "0.53311884", "text": "func NewWriter(w io.Writer) *Writer {}", "title": "" }, { "docid": "01cc754bc2302ffdce1d390ec3ddd278", "score": "0.531995", "text": "func NewWriter(r io.Writer) *Writer {\n\treturn &Writer{Writer: csv.NewWriter(r)}\n}", "title": "" }, { "docid": "980df6b3ac1d54014bd33cb72f043184", "score": "0.53107333", "text": "func (*UserConversationHistory) NewRow() Row {\n\treturn &UserConversationHistory{}\n}", "title": "" }, { "docid": "4e1d6d8ac18dc63aee48295b29fdcff1", "score": "0.5306141", "text": "func (t *Table) AddRow(values ...interface{}) {\n\trow := make(table.Row, len(values))\n\tfor i, value := range values {\n\t\trow[i] = value\n\t}\n\tt.writer.AppendRow(row)\n}", "title": "" }, { "docid": "9840f29e42243b16e61c69adc6eec0dd", "score": "0.5285349", "text": "func (t *Table) WriteRow(values ...interface{}) {\n\tt.Rows = append(t.Rows,\n\t\tappend(make([]interface{}, 0, len(values)), values...),\n\t)\n}", "title": "" }, { "docid": "3b8fd0f0094845491392f95ef949af4a", "score": "0.52487755", "text": "func (t *Table) NewRow() Row {\n\tfor _, col := range t.cols {\n\t\tcol.data = append(col.data, nil)\n\t}\n\n\tr := Row{t.cols, t.rows}\n\tt.rows++\n\treturn r\n}", "title": "" }, { "docid": "21534475be709c35ee4f8791e2ec4f19", "score": "0.5221555", "text": "func (dt *DataTable) NewRow() Row {\n\tcolcnt := len(dt.Columns)\n\tr := Row{Cells: make([]Cell, colcnt), ColumnCount: colcnt}\n\tr.currentColumnNamesIndex = make(map[string]int)\n\n\tfor i, cl := range dt.Columns {\n\t\tr.Cells[i].ColumnIndex = i\n\t\tr.Cells[i].ColumnName = cl.Name\n\t\tr.Cells[i].DBColumnType = cl.DBType\n\t\tr.currentColumnNamesIndex[strings.ToLower(cl.Name)] = i\n\t}\n\treturn r\n}", "title": "" }, { "docid": "a856aad0531ea792efa815fce15ac348", "score": "0.5188637", "text": "func NewJSONSqlWriter(wr io.WriteCloser, sch sql.Schema) (*RowWriter, error) {\n\tw, err := NewJSONWriterWithHeader(wr, nil, jsonHeader, jsonFooter, \",\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tw.sqlSch = sch\n\treturn w, nil\n}", "title": "" }, { "docid": "788a2f4c1298a5cf7122c7f2fde4fa35", "score": "0.51617366", "text": "func (w *TWWriter) WriteRow(values []interface{}, columns []string) error {\n\tfor i, col := range values {\n\t\tstr := \"\"\n\t\tif col == nil && w.needNULL {\n\t\t\tstr = w.outNULL\n\t\t} else {\n\t\t\tstr = ValString(col)\n\t\t}\n\t\tw.results[i] = str\n\t}\n\tw.writer.Append(w.results)\n\treturn nil\n}", "title": "" }, { "docid": "ccbcc6f584b49f35a5f94d0e98522df1", "score": "0.5097828", "text": "func newJSONWriter(out *logrus.Logger, file *logrus.Entry) *JSONWriter {\n\treturn &JSONWriter{\n\t\tout: out,\n\t\tfile: file,\n\t}\n}", "title": "" }, { "docid": "88401a58c8f71bf8139cd66fc51f296b", "score": "0.5077215", "text": "func NewWriter(writer io.Writer) *Table {\n\tt := &Table{\n\t\tout: writer,\n\t\trows: [][]string{},\n\t\tlines: [][][]string{},\n\t\tcs: make(map[int]int),\n\t\trs: make(map[int]int),\n\t\theaders: [][]string{},\n\t\tfooters: [][]string{},\n\t\tcaption: false,\n\t\tcaptionText: \"Table caption.\",\n\t\tautoFmt: true,\n\t\tautoWrap: true,\n\t\treflowText: true,\n\t\tmW: MAX_ROW_WIDTH,\n\t\tpCenter: CENTER,\n\t\tpRow: ROW,\n\t\tpColumn: COLUMN,\n\t\ttColumn: -1,\n\t\ttRow: -1,\n\t\thAlign: ALIGN_DEFAULT,\n\t\tfAlign: ALIGN_DEFAULT,\n\t\talign: ALIGN_DEFAULT,\n\t\tnewLine: NEWLINE,\n\t\trowLine: false,\n\t\thdrLine: true,\n\t\tborders: Border{Left: true, Right: true, Bottom: true, Top: true},\n\t\tcolSize: -1,\n\t\theaderParams: []string{},\n\t\tcolumnsParams: []string{},\n\t\tfooterParams: []string{},\n\t\tcolumnsAlign: []int{}}\n\treturn t\n}", "title": "" }, { "docid": "04ce417315b2623a690cd9673b796ae5", "score": "0.5074315", "text": "func New(w io.Writer) *writer {\n\treturn &writer{w}\n}", "title": "" }, { "docid": "c98b1cd1e3c01f0c764b8ab97942e25a", "score": "0.5057586", "text": "func (w *tableWriter) Row(cols ...interface{}) {\n\tw.emitRow(false, cols...)\n}", "title": "" }, { "docid": "098c885ed856fb4e0fc741382e43b294", "score": "0.50521094", "text": "func NewRows() Rows {\n\treturn &rows{}\n}", "title": "" }, { "docid": "09e8aa7b760309835127b887cee171db", "score": "0.5042405", "text": "func NewRows(columns []string) Rows {\n\treturn &rows{cols: columns, nextErr: make(map[int]error)}\n}", "title": "" }, { "docid": "d5353d7c0a6fef68473778964f66949f", "score": "0.5042275", "text": "func NewLineWriter(w io.Writer) *LineWriter {\n\treturn &LineWriter{\n\t\tw: w,\n\t\tbuff: []byte{},\n\t}\n}", "title": "" }, { "docid": "c521013214e96304143020a5e54506da", "score": "0.5035422", "text": "func NewRows(columns []string) Rows {\n\treturn &rows{cols: columns}\n}", "title": "" }, { "docid": "e58cd5a39c878b473ea41353080a761a", "score": "0.5018674", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{-1, w}\n}", "title": "" }, { "docid": "17f7d2c6244159897aec73cf7740346a", "score": "0.5014802", "text": "func NewWriter(log, index io.WriteSeeker) (io.Writer, error) {\n\treturn &writer{\n\t\tlog: log,\n\t\tindex: index,\n\t}, nil\n}", "title": "" }, { "docid": "dc581fae0fc6db744f3539ddebe4b597", "score": "0.50134444", "text": "func NewTableWriterWithWriter(writer io.Writer, columnHeaders []string, columnWidths []int) (*TableWriter, error) {\n\ttw := TableWriter{\n\t\twriter,\n\t\tcolumnHeaders,\n\t\tcolumnWidths,\n\t}\n\n\terr := tw.validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &tw, nil\n}", "title": "" }, { "docid": "640754a28e9c5b4535808de3be4478b6", "score": "0.5008628", "text": "func NewTableWriter(w io.Writer) *tablewriter.Table {\n\ttable := tablewriter.NewWriter(w)\n\ttable.SetAlignment(tablewriter.ALIGN_LEFT)\n\ttable.SetAutoWrapText(false)\n\ttable.SetBorders(tablewriter.Border{Left: true, Right: true})\n\ttable.SetCenterSeparator(\"|\")\n\n\treturn table\n}", "title": "" }, { "docid": "6843f3a77e2a69744e8a5bf73ddc8182", "score": "0.49980932", "text": "func newJLWriter() Logger {\n\tres := &JLWriter{Level: LevelTrace}\n\tres.formatter = res\n\treturn res\n}", "title": "" }, { "docid": "b0e2913a672a21e56ec92c6544f50caa", "score": "0.4993535", "text": "func NewWriter(w io.Writer) Writer {\n\treturn Writer{encoder: json.NewEncoder(w)}\n}", "title": "" }, { "docid": "5d26f17fff949464477cdff510af2af8", "score": "0.49341002", "text": "func NewWriter(w RawWriter) Writer {\n\treturn &writer{\n\t\tw: w,\n\t}\n}", "title": "" }, { "docid": "3275aa9b2fe282ca1b0ebdcb279a976a", "score": "0.49312174", "text": "func (w *rediSQLWriter) WriteRow(row [][]byte) error {\n\t// cmd := [][]byte{[]byte(w.dbName), []byte(rediSQLInsertStmt)}\n\t// return w.c.Send(\"REDISQL.EXEC_STATEMENT\", append(cmd, row...)...)\n\treturn nil\n}", "title": "" }, { "docid": "20d1a060bf33797e027389b66dd1baea", "score": "0.49289677", "text": "func NewWriter(w io.Writer, opts *WriterOptions) *Writer { return NewWriterAt(w, 0, opts) }", "title": "" }, { "docid": "488d2f590a0798905a04b343bc60802c", "score": "0.49221066", "text": "func NewWriter(db *badger.DB) *Writer {\n\n\tw := Writer{\n\t\tdb: db,\n\t}\n\n\treturn &w\n}", "title": "" }, { "docid": "e4c08aff737e9cf37033c161d9a97cc1", "score": "0.49034947", "text": "func NewWriter(w io.Writer) io.WriteCloser {\n\treturn &writer{\n\t\tw: w,\n\t\twindow: NewWindow(),\n\n\t\tmask: 1,\n\n\t\tn: 1,\n\t}\n}", "title": "" }, { "docid": "d482cdbfa1588288d346d3ba175cf7ee", "score": "0.49017018", "text": "func NewTableWriter(columnHeaders []string, columnWidths []int) (*TableWriter, error) {\n\treturn NewTableWriterWithWriter(os.Stdout, columnHeaders, columnWidths)\n}", "title": "" }, { "docid": "1493ec59ca1734ba06338de22b235f33", "score": "0.48986056", "text": "func New() *Writer {\n\treturn new(Writer)\n}", "title": "" }, { "docid": "014daeb27a057ae546aac6e05ab28715", "score": "0.48948398", "text": "func NewWriter(w io.Writer, aead cipher.AEAD) io.Writer { return newWriter(w, aead) }", "title": "" }, { "docid": "b0c72a36bbec5402710677aef6b91d86", "score": "0.48884448", "text": "func addRow(nickname string, info string) {\n\tnewrow = newsheet.AddRow()\n\tnewrow.AddCell().SetString(nickname)\n\tnewrow.AddCell().SetString(info)\n}", "title": "" }, { "docid": "1cc22dcf75a7f79fe4a79ceb95cdf18e", "score": "0.4876048", "text": "func NewWriter(store StoreWriter) *Writer { return &Writer{store: store} }", "title": "" }, { "docid": "9f2e38218218b0e4db3675f58a89b47b", "score": "0.48719332", "text": "func newTable() *tablewriter.Table {\n\ttable := tablewriter.NewWriter(os.Stdout)\n\n\t// render options\n\ttable.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})\n\ttable.SetCenterSeparator(\"|\")\n\n\treturn table\n}", "title": "" }, { "docid": "43e527c2a782369e8dcce893c685ce8e", "score": "0.48700273", "text": "func NewWriter(w io.Writer, utf8bom bool) *Writer {\n\treturn &Writer{\n\t\twriter: w,\n\t\tcsvWriter: csv.NewWriter(w),\n\t\tutf8bom: utf8bom,\n\t}\n}", "title": "" }, { "docid": "8cbfdba8c44df1ad402e6a5b21916e94", "score": "0.4861904", "text": "func NewWriter(staging io.Writer) Writer {\n\t// TODO need to insert treeWriter here, before zlib.NewWriter, also not sure about hh ???\n\t// actually, maybe after WriteHeader is done.\n\tg := &writer{\n\t\tzw: zlib.NewWriter(staging),\n\t\thh: sha1.New(),\n\t}\n\tg.Writer = io.MultiWriter(g.zw, g.hh)\n\treturn g\n}", "title": "" }, { "docid": "1cb691812045241d9e06425a774ed169", "score": "0.48407185", "text": "func NewWriter(w io.Writer) *Writer {\n\tf, _ := w.(flusher)\n\n\tvar o int64\n\tif s, ok := w.(io.Seeker); ok {\n\t\tvar err error\n\t\tif o, err = s.Seek(0, io.SeekCurrent); err != nil {\n\t\t\to = 0\n\t\t}\n\t}\n\treturn &Writer{\n\t\tw: w,\n\t\tf: f,\n\t\tbaseOffset: o,\n\t\tlastRecordOffset: -1,\n\t}\n}", "title": "" }, { "docid": "2cdb7326284ad21fd25be12272d56371", "score": "0.48283473", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{writer: &w}\n}", "title": "" }, { "docid": "aad019debaa607566817d02f173eab88", "score": "0.4802319", "text": "func (*compress) NewWriter(w io.Writer) Writer {\n\treturn &writer{\n\t\tWriter: lz4.NewWriter(w),\n\t}\n}", "title": "" }, { "docid": "5d578c174f3d93fb123e5a0ce75c1f43", "score": "0.48000953", "text": "func NewWriter(w io.Writer, public *[32]byte) (cw io.WriteCloser, err error) {\n\n\t// write new header and derive key\n\tkey, head, err := writeNewHeader(w, public)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn chunkstream.NewWriter(w, key, head, Chunksize)\n\n}", "title": "" }, { "docid": "a5756fd0f7c05d89d1335bdc71fa18ed", "score": "0.4789639", "text": "func NewWriter(writeCloser io.WriteCloser, schemaElements []*parquet.SchemaElement, rowGroupCount int) (*Writer, error) {\n\tif _, err := writeCloser.Write([]byte(\"PAR1\")); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfooter := parquet.NewFileMetaData()\n\tfooter.Version = 1\n\tnumChildren := int32(len(schemaElements))\n\tfooter.Schema = append(footer.Schema, &parquet.SchemaElement{\n\t\tName: \"schema\",\n\t\tRepetitionType: parquet.FieldRepetitionTypePtr(parquet.FieldRepetitionType_REQUIRED),\n\t\tNumChildren: &numChildren,\n\t})\n\tfooter.Schema = append(footer.Schema, schemaElements...)\n\n\treturn &Writer{\n\t\tPageSize: defaultPageSize,\n\t\tRowGroupSize: defaultRowGroupSize,\n\t\tCompressionType: parquet.CompressionCodec_SNAPPY,\n\n\t\twriteCloser: writeCloser,\n\t\toffset: 4,\n\t\tpagesMapBuf: make(map[string][]*page),\n\t\tdictRecs: make(map[string]*dictRec),\n\t\tfooter: footer,\n\t\tschemaElements: schemaElements,\n\t\trowGroupCount: rowGroupCount,\n\t}, nil\n}", "title": "" }, { "docid": "1f6c9a624a9ec879d47603979b82047e", "score": "0.47886726", "text": "func NewRow(ratio float64, i ...interface{}) GridItem {\n\t_, ok := i[0].(Refreshable)\n\tentry := i[0]\n\tif !ok {\n\t\tentry = i\n\t}\n\treturn GridItem{\n\t\tType: row,\n\t\tEntry: entry,\n\t\tIsLeaf: ok,\n\t\tratio: ratio,\n\t}\n}", "title": "" }, { "docid": "ad1deb5b78dc63b843651bbb04a93c23", "score": "0.47741443", "text": "func wrapRow(row *sqlx.Row) Row {\n\treturn &rowWrapper{\n\t\trow: row,\n\t}\n}", "title": "" }, { "docid": "ed1d62b4726dfc82b37cc580752368ca", "score": "0.47682285", "text": "func (csvw *CSVWriter) WriteRow(ctx context.Context, r row.Row) error {\n\tallCols := csvw.sch.GetAllCols()\n\n\ti := 0\n\tcolValStrs := make([]string, allCols.Size())\n\terr := allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) {\n\t\tval, ok := r.GetColVal(tag)\n\t\tif ok && !types.IsNull(val) {\n\t\t\tif val.Kind() == types.StringKind {\n\t\t\t\tcolValStrs[i] = string(val.(types.String))\n\t\t\t} else {\n\t\t\t\tvar err error\n\t\t\t\tcolValStrs[i], err = types.EncodedValue(ctx, val)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ti++\n\t\treturn false, nil\n\t})\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trowStr := strings.Join(colValStrs, csvw.delimStr)\n\treturn iohelp.WriteLine(csvw.bWr, rowStr)\n}", "title": "" }, { "docid": "174afb420d928323c3d2ab5233d56d6e", "score": "0.47676125", "text": "func NewWriter(ctx context.Context, w io.Writer) io.Writer {\n\treturn &writer{\n\t\tctx: ctx,\n\t\tlast: time.Now(),\n\t\twriter: w,\n\t}\n}", "title": "" }, { "docid": "084e2b4bba34667b07572d330481f845", "score": "0.47619423", "text": "func (l *Language) IsNewRow() bool {\n\tif l == nil {\n\t\treturn true\n\t}\n\treturn l.ID == 0\n}", "title": "" }, { "docid": "a87f285417368d65ec1d48643705ace1", "score": "0.47618943", "text": "func NewWriter() api.Writer {\n\treturn writer{}\n}", "title": "" }, { "docid": "a40f6f6613338e927f4861b895b01b59", "score": "0.47595203", "text": "func (sr *shimRepository) NewWriter(ctx context.Context, option repo.WriteSessionOptions) (context.Context, repo.RepositoryWriter, error) {\n\treturn nil, nil, errors.New(\"NewWriter is not supported\")\n}", "title": "" }, { "docid": "9faf6903c2834d52dbc357ef9de6862e", "score": "0.47571817", "text": "func NewWriter() *Writer {\n\treturn &Writer{}\n}", "title": "" }, { "docid": "180ae8218edb8de0042367b72b8e4653", "score": "0.47557762", "text": "func (tx *JoinMeta) CreateRow() *Row {\n\treturn &Row{Data: &JoinData{}}\n}", "title": "" }, { "docid": "b9818210e4920ecfbddef4e25b1465a3", "score": "0.47492513", "text": "func NewTableWriter(cfg *config.Config) *tableWriter {\n\ttw := &tableWriter{Writer: uilive.New(), columnNames: cfg.Columns}\n\ttw.Writer.Out = colorable.NewColorableStdout() // For Windows\n\ttw.table = tablewriter.NewWriter(tw.Writer)\n\ttw.table.SetAutoFormatHeaders(false)\n\ttw.table.SetAutoWrapText(false)\n\tformattedHeaders := make([]string, len(cfg.Columns))\n\tfor i, column := range cfg.Columns {\n\t\tformattedHeaders[i] = color.YellowString(column)\n\t}\n\ttw.table.SetHeader(formattedHeaders)\n\ttw.table.SetRowLine(true)\n\ttw.table.SetCenterSeparator(faint(\"-\"))\n\ttw.table.SetColumnSeparator(faint(\"|\"))\n\ttw.table.SetRowSeparator(faint(\"-\"))\n\treturn tw\n}", "title": "" }, { "docid": "71c15bb5fe09ff3e623ec2b59ac1da9e", "score": "0.47454575", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{w: w}\n}", "title": "" }, { "docid": "66e1b7ea886382141f2ab4dee5c8f42e", "score": "0.4737205", "text": "func NewRowLayout(opts ...RowLayoutOpt) *RowLayout {\n\tr := &RowLayout{}\n\n\tfor _, o := range opts {\n\t\to(r)\n\t}\n\n\treturn r\n}", "title": "" }, { "docid": "4548eae5adf7f717e337b488677e82db", "score": "0.47151172", "text": "func NewRows(iter RowsIter) *Rows {\n\treturn &Rows{\n\t\titer: iter,\n\t}\n}", "title": "" }, { "docid": "94c38c8d132c65521435e95aab429036", "score": "0.47104573", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{\n\t\tw: w,\n\t}\n}", "title": "" }, { "docid": "39b3981b2c7c7741b086675bfa9f86c5", "score": "0.47060055", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{\n\t\tw: w,\n\t\tctx: context.Background(),\n\t}\n}", "title": "" }, { "docid": "964056af12f9f3c9671d911d336918f9", "score": "0.47022286", "text": "func NewWriter(w io.Writer) *Writer {\n\treturn &Writer{\n\t\twriter: w,\n\t}\n}", "title": "" }, { "docid": "797df42d4a430904990c8bd5bbec088d", "score": "0.46995395", "text": "func execNewWriter(_ int, p *gop.Context) {\n\targs := p.GetArgs(1)\n\tret := quotedprintable.NewWriter(args[0].(io.Writer))\n\tp.Ret(1, ret)\n}", "title": "" }, { "docid": "118e078b21698753bb83895398c906f0", "score": "0.46931767", "text": "func makeTableWriter(w io.Writer, header string) *tabwriter.Writer {\n\ttableWriter := tabwriter.NewWriter(w, 0, indentLength, indentLength, ' ', 0)\n\tfmt.Fprintln(tableWriter, header)\n\treturn tableWriter\n}", "title": "" }, { "docid": "cc6fd2b9613d6ea0fc5a329c4a6df22b", "score": "0.4678386", "text": "func newHtmlRow(row int32, includeLineNumbers bool) (htmlRow, htmlCode *html.Node) {\n\ttr := &html.Node{Type: html.ElementNode, DataAtom: atom.Tr, Data: atom.Tr.String()}\n\n\tif includeLineNumbers {\n\t\ttdLineNumber := &html.Node{Type: html.ElementNode, DataAtom: atom.Td, Data: atom.Td.String()}\n\t\ttdLineNumber.Attr = append(tdLineNumber.Attr, html.Attribute{Key: \"class\", Val: \"line\"})\n\t\ttdLineNumber.Attr = append(tdLineNumber.Attr, html.Attribute{Key: \"data-line\", Val: fmt.Sprint(row + 1)})\n\t\ttr.AppendChild(tdLineNumber)\n\t}\n\n\tcodeCell := &html.Node{Type: html.ElementNode, DataAtom: atom.Td, Data: atom.Td.String()}\n\tcodeCell.Attr = append(codeCell.Attr, html.Attribute{Key: \"class\", Val: \"code\"})\n\ttr.AppendChild(codeCell)\n\n\treturn tr, codeCell\n}", "title": "" }, { "docid": "d0603c9ef798a23745a28e580a7aaba3", "score": "0.46740043", "text": "func NewWriter(w io.Writer) *Writer {\n\tif wr, ok := w.(*Writer); ok {\n\t\treturn wr\n\t}\n\treturn popWriter(w)\n}", "title": "" }, { "docid": "5d57ae755978d03424e49e83b3ab8b9f", "score": "0.46709007", "text": "func NewPstnCallLogRow()(*PstnCallLogRow) {\n m := &PstnCallLogRow{\n }\n m.SetAdditionalData(make(map[string]interface{}));\n return m\n}", "title": "" }, { "docid": "9d7d819ee70a615f4a481dbdad119839", "score": "0.46617812", "text": "func NewWriter(w io.Writer, format byte, dataRecLen byte) (*Writer, error) {\n\tif format == FormatAuto || format > Format32Bit ||\n\t\tdataRecLen&(dataRecLen-1) != 0 {\n\t\treturn nil, ErrFormat\n\t}\n\tif dataRecLen == 0 {\n\t\tdataRecLen = defaultDataLen\n\t}\n\txw := Writer{w: w, format: format, dataRecLen: int(dataRecLen)}\n\treturn &xw, nil\n}", "title": "" }, { "docid": "3812d70287fcb3b9ca7d2ea55281273b", "score": "0.46614167", "text": "func NewResourceWriter() *ResourceWriter {\n\treturn &ResourceWriter{\n\t\theaders: make(http.Header),\n\t}\n}", "title": "" }, { "docid": "301f716020f96b30a0446ac67907c784", "score": "0.4655538", "text": "func New() *Writer {\n\treturn &Writer{b: []byte{}}\n}", "title": "" }, { "docid": "77d168254e40cad6886843ab400f597f", "score": "0.46374196", "text": "func newRowIterator(ctx context.Context, tbl *doltdb.Table, sqlSch sql.Schema, projCols []uint64, partition doltTablePartition) (sql.RowIter, error) {\n\tsch, err := tbl.GetSchema(ctx)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif types.IsFormat_DOLT(tbl.Format()) {\n\t\treturn ProllyRowIterFromPartition(ctx, sch, sqlSch, projCols, partition)\n\t}\n\n\tmapIter, err := iterForPartition(ctx, partition)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif schema.IsKeyless(sch) {\n\t\t// would be more optimal to project columns into keyless tables also\n\t\treturn newKeylessRowIterator(ctx, tbl, projCols, mapIter)\n\t} else {\n\t\treturn newKeyedRowIter(ctx, tbl, projCols, mapIter)\n\t}\n}", "title": "" }, { "docid": "fe5c29af56a79785025c6eb6a922ab3e", "score": "0.4628561", "text": "func NewWriterLevel(w io.Writer, level int) (*Writer, error) {}", "title": "" }, { "docid": "c9bf41926ea83610758a1eb3c75d5ee7", "score": "0.46274865", "text": "func newResultWriter(c JobQueue, sKey, sValue string) (s resultWriter) {\n\treturn resultWriter{Results: c,\n\t\tquitChan: make(chan bool),\n\t\tStageKey: sKey,\n\t\tStageValue: sValue,\n\t}\n}", "title": "" }, { "docid": "ee92b7e9dfcae2576d587823cfeb014a", "score": "0.46246016", "text": "func NewJSONWriter(writer io.Writer) Writer {\n\treturn &jsonWriter{\n\t\twriter: writer,\n\t}\n}", "title": "" }, { "docid": "5b8dc089a87171b55bd20026faa5589f", "score": "0.46193105", "text": "func (j *RowWriter) Close(ctx context.Context) error {\n\tif j.closer != nil {\n\t\tif j.rowsWritten > 0 {\n\t\t\terr := iohelp.WriteAll(j.bWr, []byte(j.footer))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\terrFl := j.bWr.Flush()\n\t\terrCl := j.closer.Close()\n\t\tj.closer = nil\n\n\t\tif errCl != nil {\n\t\t\treturn errCl\n\t\t}\n\n\t\treturn errFl\n\t}\n\n\treturn errors.New(\"already closed\")\n}", "title": "" }, { "docid": "2c0df3592260d236feb3822fc4808e10", "score": "0.46150658", "text": "func NewWrapWriter(w io.WriterAt, off int64, wrapAt int64) *WrapWriter {\n\treturn &WrapWriter{\n\t\t&wrapper{\n\t\t\tdoat: w.WriteAt,\n\t\t\toff: (off % wrapAt),\n\t\t\twrapAt: wrapAt,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "ae16f8a3bc9b0f4d6ec873535e528e1a", "score": "0.45948073", "text": "func NewRollFileWriter(logpath, name string, num, sizeMB int) *RollFileWriter {\n\tw := &RollFileWriter{\n\t\tlogpath: logpath,\n\t\tname: name,\n\t\tnum: num,\n\t\tsize: int64(sizeMB) * 1024 * 1024,\n\t}\n\tfullPath := filepath.Join(logpath, name+\".log\")\n\tst, _ := os.Stat(fullPath)\n\tif st != nil {\n\t\tw.currSize = st.Size()\n\t}\n\treturn w\n}", "title": "" }, { "docid": "66e6a93921a9936f063dd112a7749ab6", "score": "0.45843357", "text": "func newFileWriter() Logger {\n\tw := &fileLogWriter{\n\t\tDaily: true,\n\t\tMaxDays: 7,\n\t\tHourly: false,\n\t\tMaxHours: 168,\n\t\tRotate: true,\n\t\tRotatePerm: \"0440\",\n\t\tLevel: LevelTrace,\n\t\tPerm: \"0660\",\n\t\tDirPerm: \"0770\",\n\t\tMaxLines: 10000000,\n\t\tMaxFiles: 999,\n\t\tMaxSize: 1 << 28,\n\t}\n\tw.logFormatter = w\n\treturn w\n}", "title": "" }, { "docid": "48160d25be0a803bc2494bab62a82888", "score": "0.45769718", "text": "func (self *TableDynamic) WriteRow(row Row) (int64, error) {\n\ttableOff, err := self.searchLastTableOffset()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tindexNum, err := self.searchLastIndexNum()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\tindexOff := self.convertIndexNumToOffset(indexNum)\n\n\tvar b []byte\n\tb = make([]byte, 1)\n\tb[0] = ROW_NORMAL\n\tnum, err := self.tablefile.WriteAt(b, tableOff)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\tb = make([]byte, binary.MaxVarintLen64)\n\tbinary.PutVarint(b, tableOff)\n\tnum2, err := self.indexfile.WriteAt(b, indexOff)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\ttableOff = tableOff + int64(num)\n\tindexOff = indexOff + int64(num2)\n\tfor _, v := range self.columnTypes {\n\t\tif val, ok := row[v.Name]; ok {\n\t\t\tb, err = v.ConvertToBytes(val)\n\t\t\tif err != nil {\n\t\t\t\treturn -1, err\n\t\t\t}\n\t\t} else {\n\t\t\tb, err = v.GetNil()\n\t\t\tif err != nil {\n\t\t\t\treturn -1, err\n\t\t\t}\n\t\t}\n\t\tnum, err = self.tablefile.WriteAt(b, tableOff)\n\t\tif err != nil {\n\t\t\treturn -1, err\n\t\t}\n\t\tif v.Size == 0 {\n\t\t\tb = make([]byte, binary.MaxVarintLen64)\n\t\t\tbinary.PutVarint(b, int64(num))\n\t\t\tnum2, err := self.indexfile.WriteAt(b, indexOff)\n\t\t\tif err != nil {\n\t\t\t\treturn -1, err\n\t\t\t}\n\t\t\tindexOff = indexOff + int64(num2)\n\t\t}\n\t\ttableOff = tableOff + int64(num)\n\t}\n\tb = make([]byte, binary.MaxVarintLen64)\n\tbinary.PutVarint(b, tableOff)\n\t_, err = self.indexfile.WriteAt(b, int64(binary.MaxVarintLen64))\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\n\terr = self.tablefile.Sync()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\terr = self.indexfile.Sync()\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn indexNum, nil\n}", "title": "" }, { "docid": "84ccd583740acd4e572b2906056e5861", "score": "0.45764348", "text": "func newCipherWriter(w io.Writer, aead cipher.AEAD) *cipherWriter {\n\treturn &cipherWriter{\n\t\tw: w,\n\t\taead: aead,\n\t\tbuf: make([]byte, 2+aead.Overhead()+payloadSizeMask+aead.Overhead()),\n\t\tnonce: make([]byte, aead.NonceSize()),\n\t}\n}", "title": "" }, { "docid": "d69d7bb1d3c4ca4df29c129ff4631c3e", "score": "0.4574056", "text": "func New(out io.Writer) *Writer {\n\treturn &Writer{\n\t\tout: out,\n\t\tindentScheme: defaultIndentScheme,\n\t\tcurline: new(bytes.Buffer),\n\t}\n}", "title": "" }, { "docid": "54520ed6fbd0c75d531a6953c408bc00", "score": "0.45652494", "text": "func NewLogWriter(ctx context.Context, cfg *LogWriterConfig) (*LogWriter, error) {\n\tvar errInit error\n\t// currently, caller do not have the ability of self-healing, like try to fix if on some error,\n\t// so initOnce just literary init once, do not support re-init if fail on some condition\n\tinitOnce.Do(func() {\n\t\tif cfg == nil {\n\t\t\terrInit = cerror.WrapError(cerror.ErrRedoConfigInvalid, errors.New(\"LogWriterConfig can not be nil\"))\n\t\t\treturn\n\t\t}\n\n\t\trowCfg := &FileWriterConfig{\n\t\t\tDir: cfg.Dir,\n\t\t\tChangeFeedID: cfg.ChangeFeedID,\n\t\t\tCaptureID: cfg.CaptureID,\n\t\t\tFileType: common.DefaultRowLogFileType,\n\t\t\tCreateTime: cfg.CreateTime,\n\t\t\tMaxLogSize: cfg.MaxLogSize,\n\t\t\tFlushIntervalInMs: cfg.FlushIntervalInMs,\n\t\t\tS3Storage: cfg.S3Storage,\n\t\t\tS3URI: cfg.S3URI,\n\t\t}\n\t\tddlCfg := &FileWriterConfig{\n\t\t\tDir: cfg.Dir,\n\t\t\tChangeFeedID: cfg.ChangeFeedID,\n\t\t\tCaptureID: cfg.CaptureID,\n\t\t\tFileType: common.DefaultDDLLogFileType,\n\t\t\tCreateTime: cfg.CreateTime,\n\t\t\tMaxLogSize: cfg.MaxLogSize,\n\t\t\tFlushIntervalInMs: cfg.FlushIntervalInMs,\n\t\t\tS3Storage: cfg.S3Storage,\n\t\t\tS3URI: cfg.S3URI,\n\t\t}\n\t\tlogWriter = &LogWriter{\n\t\t\tcfg: cfg,\n\t\t}\n\t\tlogWriter.rowWriter, errInit = NewWriter(ctx, rowCfg)\n\t\tif errInit != nil {\n\t\t\treturn\n\t\t}\n\t\tlogWriter.ddlWriter, errInit = NewWriter(ctx, ddlCfg)\n\t\tif errInit != nil {\n\t\t\treturn\n\t\t}\n\n\t\t// since the error will not block write log, so keep go to the next init process\n\t\terr := logWriter.initMeta(ctx)\n\t\tif err != nil {\n\t\t\tlog.Warn(\"init redo meta fail\",\n\t\t\t\tzap.String(\"change feed\", cfg.ChangeFeedID),\n\t\t\t\tzap.Error(err))\n\t\t}\n\t\tif cfg.S3Storage {\n\t\t\tvar s3storage storage.ExternalStorage\n\t\t\ts3storage, errInit = common.InitS3storage(ctx, *cfg.S3URI)\n\t\t\tif errInit != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlogWriter.storage = s3storage\n\t\t}\n\n\t\tgo logWriter.runGC(ctx)\n\t})\n\tif errInit != nil {\n\t\treturn nil, errInit\n\t}\n\treturn logWriter, nil\n}", "title": "" }, { "docid": "8b0ac87c350445ba7a0abf8f0a6effcc", "score": "0.45599088", "text": "func (r *rows) AddRow(values ...interface{}) Rows {\n\tr.data = append(r.data, gocql.RowData{\n\t\tValues: values,\n\t})\n\treturn r\n}", "title": "" }, { "docid": "8b42d5d8f99bf9f69ab8125efe4c98f4", "score": "0.45510858", "text": "func NewRecordWriter(out io.Writer) output.RecordWriter {\n\treturn &recordWriter{out: out}\n}", "title": "" }, { "docid": "5e3c9adc894e509d01e2005654f8a176", "score": "0.45506653", "text": "func WriteRow (text []string,sheet *xlsx.Sheet ) (bool){\n var row *xlsx.Row\n var cell *xlsx.Cell\n\n for i := 0; i < len(text); i++ {\n// fmt.Println(\"inWrite->\",text[i])\n if i == 0 {\n row = sheet.AddRow()\n }\n cell = row.AddCell()\n cell.Value = text[i]\n }\n return true\n}", "title": "" }, { "docid": "837d47e019932d375cd46f6f219f60a6", "score": "0.4528756", "text": "func NewWriter(ctx context.Context, w io.Writer) io.Writer {\n\tif w, ok := w.(*copier); ok && ctx == w.ctx {\n\t\treturn w\n\t}\n\treturn &copier{writer{ctx: ctx, w: w}}\n}", "title": "" }, { "docid": "15e34748489e2cc96d9fe1069d355c93", "score": "0.45215213", "text": "func newChunkReader() *chunkReader {\n\treturn &chunkReader{state: newRow}\n}", "title": "" }, { "docid": "9e08a62abc9d7b1b5794ebfdcabcc0f2", "score": "0.4515793", "text": "func RowNumber() *WindowBuilder {\n\treturn Window(func(b *Builder) {\n\t\tb.WriteString(\"ROW_NUMBER()\")\n\t})\n}", "title": "" }, { "docid": "c9642d467e6dba596282a86f81567c03", "score": "0.4514087", "text": "func NewDeltaRow(o, n Row, h Header) DeltaRow {\n\tdeltas := make(DeltaRow, len(o.Fields))\n\tfor i, old := range o.Fields {\n\t\tif old != \"\" && old != n.Fields[i] && !h.IsTimeCol(i) {\n\t\t\tdeltas[i] = old\n\t\t}\n\t}\n\n\treturn deltas\n}", "title": "" }, { "docid": "9db2b087b3fa7e58e6b808a8fd6e3c89", "score": "0.45140865", "text": "func NewValueWriter(item map[string]*dynamodb.AttributeValue) ValueWriter {\n\treturn ValueWriter{item}\n}", "title": "" }, { "docid": "d03b2916e6f457a3505420eb519359db", "score": "0.450997", "text": "func NewWriter(w io.Writer) io.WriteCloser {\n\tz, _ := NewWriterLevel(w, defaultCompression)\n\treturn z\n}", "title": "" }, { "docid": "f2038c2dbc21a7178ddcad27f05bedea", "score": "0.45017523", "text": "func NewWriter(filepath string, h *Header) (*Writer, error) {\n\tf, err := os.OpenFile(filepath, os.O_CREATE, 0644)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tw := Writer{\n\t\tf: f,\n\t}\n\tif err := w.writeHead(h); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &w, nil\n}", "title": "" }, { "docid": "afd4226c7406d13ea63ec824d8d8c2cb", "score": "0.45011178", "text": "func New(w io.Writer, timeout time.Duration) *LineWriter {\n\tlw := &LineWriter{\n\t\tbuffer: make(chan byte),\n\t\tflushableStrings: make(chan string),\n\t\twriter: w,\n\t\ttimeout: timeout,\n\t\tflushChan: make(chan bool),\n\t\tflushedChan: make(chan bool),\n\t}\n\tlw.startReader()\n\tlw.startWriter()\n\treturn lw\n}", "title": "" } ]
bc6f67f99b90d72069f347045173919d
GetState returns the current state of the event worker.
[ { "docid": "ae6a6b8de171d6005fc9ac3bc7800742", "score": "0.726453", "text": "func (w *worker) GetState() WorkerState {\n\n\treturn w.State\n\n}", "title": "" } ]
[ { "docid": "82a98801fddbaa0fd0ebbc9f357b840e", "score": "0.7077423", "text": "func (w *watcher) GetState() (uint64, time.Time) {\n\tdefer w.RUnlock()\n\tw.RLock()\n\treturn w.getState()\n}", "title": "" }, { "docid": "c874f4b8c3622b947bd6dfd2b3efd96c", "score": "0.7073004", "text": "func (event *OutlookEvent) GetState() int {\n\treturn event.state\n}", "title": "" }, { "docid": "7e029a4e5cc2525c27e6d77fa57a36ce", "score": "0.6772223", "text": "func (a *wsfcAgent) getState() agentState {\n\tif a.listener != nil {\n\t\treturn running\n\t}\n\n\treturn stopped\n}", "title": "" }, { "docid": "8f62f1587f1508acf25263a3f8a659ca", "score": "0.6674959", "text": "func GetEventState(type_ EventType) uint8 {\n\treturn uint8(C.SDL_EventState(C.Uint32(type_), C.int(QUERY)))\n}", "title": "" }, { "docid": "920c21140203a14a82ee733589303a87", "score": "0.64507097", "text": "func (recv *Window) GetState() WindowState {\n\tretC := C.gdk_window_get_state((*C.GdkWindow)(recv.native))\n\tretGo := (WindowState)(retC)\n\n\treturn retGo\n}", "title": "" }, { "docid": "9116226e960b0d12393c6dac75007caa", "score": "0.63709366", "text": "func (g Game) getState() GameState {\n\treturn g.state\n}", "title": "" }, { "docid": "69a69224c7c11735662f792feecedb45", "score": "0.62931436", "text": "func (w *watcher) getState() (uint64, time.Time) {\n\treturn w.version, w.lastUpd\n}", "title": "" }, { "docid": "a2c026e98ec2600ccb50c68a76177748", "score": "0.6275839", "text": "func (c *QECombiner) GetState(namespace string, key string) ([]byte, error) {\n\tvar vv *statedb.VersionedValue\n\tvar val []byte\n\tvar err error\n\tfor _, qe := range c.QueryExecuters {\n\t\tif vv, err = qe.GetState(namespace, key); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif vv != nil {\n\t\t\tif !vv.IsDelete() {\n\t\t\t\tval = vv.Value\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn val, nil\n}", "title": "" }, { "docid": "fcafdf2fd863dc4bd451b110eb3b0b41", "score": "0.6236234", "text": "func (qe *UpdateBatchBackedQueryExecuter) GetState(ns, key string) (*statedb.VersionedValue, error) {\n\treturn qe.UpdateBatch.Get(ns, key), nil\n}", "title": "" }, { "docid": "34a0d3c943c8f574978246e50e87b655", "score": "0.6214759", "text": "func (h *Handler) GetState() (types.StateResponse, error) {\n\th.m.RLock()\n\tdefer h.m.RUnlock()\n\n\tswitch h.state {\n\tcase leader:\n\t\treturn h.dispatcher.getState()\n\tcase follower:\n\t\treturn types.StateResponse{NotRunning: \"currently follower\"}, nil\n\tdefault:\n\t\treturn types.StateResponse{NotRunning: notReadyReason}, nil\n\t}\n}", "title": "" }, { "docid": "bfbbfb857e7b959128399c20af821253", "score": "0.61755186", "text": "func GetState(ctx *fiber.Ctx) string {\n\treturn ctx.Query(\"state\")\n}", "title": "" }, { "docid": "1bffa5688248938f1d08620474a9cb5e", "score": "0.61506045", "text": "func (self *ServerView) GetState() string {\n\tself.lockState.Lock()\n\tdefer self.lockState.Unlock()\n\treturn self.state\n}", "title": "" }, { "docid": "4c9887323022083353bfed74b360bf43", "score": "0.6132226", "text": "func (d *Driver) GetState() (state.State, error) {\n\tpowerState, err := d.HpeConfig.Oneview.GetPowerState()\n\tif err != nil {\n\t\tlog.Error(Wrap(err))\n\t\treturn state.Error, err\n\t}\n\treturn powerState, nil\n}", "title": "" }, { "docid": "b9e18976482bbd65e31a7d70fbff34c2", "score": "0.60921925", "text": "func (cons *ConsumerBase) GetState() PluginState {\n\treturn cons.runState.GetState()\n}", "title": "" }, { "docid": "e97101d14d4088f5b0373eb865f247d3", "score": "0.609219", "text": "func (o *UpdateAccessKeyRequest) GetState() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.State\n}", "title": "" }, { "docid": "d8f1721adb39368a25d18df7c7b34c95", "score": "0.60642505", "text": "func (_this *ServiceWorker) State() ServiceWorkerState {\n\tvar ret ServiceWorkerState\n\tvalue := _this.Value_JS.Get(\"state\")\n\tret = ServiceWorkerStateFromJS(value)\n\treturn ret\n}", "title": "" }, { "docid": "58565b2410f22a4bef7627f9c318af3f", "score": "0.60562336", "text": "func (driver *Driver) GetState() (state.State, error) {\n\tserver, err := driver.getServer()\n\tif err != nil {\n\t\treturn state.None, err\n\t}\n\tif server == nil {\n\t\treturn state.None, nil // Server does not exist.\n\t}\n\n\tif !server.Deployed {\n\t\treturn state.Starting, nil // Server is being deployed\n\t}\n\n\tif server.Started {\n\t\treturn state.Running, nil // Server is running\n\t}\n\n\treturn state.Stopped, nil // Server is stopped.\n}", "title": "" }, { "docid": "94b362ff35f6f16f2f91bbca4e098881", "score": "0.60515153", "text": "func (h *Hive) GetState() (s State) {\n\th.refreshing.RLock()\n\ts = h.lastState\n\th.refreshing.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "932eb7c231778dbfd9377dfede58f3a4", "score": "0.5995245", "text": "func (d *Driver) GetState() (state.State, error) {\n\tsshconn, err := net.Dial(\"tcp\", \"127.0.0.1:\"+strconv.Itoa(d.SSHPort))\n\tif err == nil {\n\t\tsshconn.Close()\n\t\treturn state.Running, nil\n\t}\n\tmonconn, err := net.Dial(\"tcp\", \"127.0.0.1:\"+strconv.Itoa(d.MonitorPort))\n\tif err == nil {\n\t\tmonconn.Close()\n\t\treturn state.Starting, nil\n\t}\n\td.IPAddress = \"\"\n\treturn state.Stopped, nil\n}", "title": "" }, { "docid": "eb4e169ab7211d326639763d65baede3", "score": "0.59876144", "text": "func (d *Device) getState() deviceState {\n\td.RLock()\n\tdefer d.RUnlock()\n\n\treturn d.state\n}", "title": "" }, { "docid": "4c2162c13d80e7ee16cf3e0adc612339", "score": "0.59863174", "text": "func (c *Cluster) GetState() string {\n\treturn c.state\n}", "title": "" }, { "docid": "7406671ca2ca19d2e916a809a0bafd7a", "score": "0.59613097", "text": "func (r *Raft) GetState() (int, bool) {\n\t// 此处没有必要通过 chan 来读取\n\t// 为什么呢,因为即使你保证了两个状态是一致的,但是在返回给客户端的时候,可能已经变化了\n\t// 本来就保证不了数据是最新的\n\t//m := &Message{\n\t//\tType:MsgState,\n\t//\tdone:make(chan bool),\n\t//}\n\t//rf.commandc <- m\n\t//<- m.done\n\t// 2)Leader将请求的日志以并发的形式,发送AppendEntries RCPs给所有的服务器\n\t//go rf.bcastAppend() // 那在哪儿执行应用到状态机的操作呢?在stateMachine中\n\t//log.Println(\"broadcastAppendEntriesRPC\")\n\treturn r.currentTerm,r.state == StateLeader\n}", "title": "" }, { "docid": "030323f91b1c8017ec2a65fc6c2d7102", "score": "0.59553266", "text": "func (c *Cache) State() sd.Event {\n\tc.mtx.RLock()\n\tevent := c.state\n\tc.mtx.RUnlock()\n\teventCopy := copyEvent(event)\n\treturn eventCopy\n}", "title": "" }, { "docid": "c57c5d2b375475e6f54ffe11b7d7544e", "score": "0.5949663", "text": "func (d *Driver) GetState() (state.State, error) {\n\thostname, port, err := kubeconfig.Endpoint(d.BaseDriver.MachineName)\n\tif err != nil {\n\t\tklog.Warningf(\"unable to get port: %v\", err)\n\t\tport = constants.APIServerPort\n\t}\n\n\t// Confusing logic, as libmachine.Stop will loop until the state == Stopped\n\tast, err := kverify.APIServerStatus(d.exec, hostname, port)\n\tif err != nil {\n\t\treturn ast, err\n\t}\n\n\t// If the apiserver is up, we'll claim to be up.\n\tif ast == state.Paused || ast == state.Running {\n\t\treturn state.Running, nil\n\t}\n\n\treturn kverify.ServiceStatus(d.exec, \"kubelet\"), nil\n}", "title": "" }, { "docid": "ce3f46ce2de4b66f865c69342533ee51", "score": "0.59462297", "text": "func (s *Session) GetState() State {\n\treturn s.state\n}", "title": "" }, { "docid": "c98acb9d276de85bc75f26250b86018e", "score": "0.59429204", "text": "func (state *PluginRunState) GetState() PluginState {\n\treturn PluginState(atomic.LoadInt32(&state.state))\n}", "title": "" }, { "docid": "2ca974b4b12d3f7f7fd95a8bcee94256", "score": "0.59324986", "text": "func (scs *SyncConnState) getState() ConnState {\n\tvar res ConnState\n\tscs.RLock()\n\tres = scs.state\n\tscs.RUnlock()\n\treturn res\n}", "title": "" }, { "docid": "57c0f3228cd41964de0449c7fc44286e", "score": "0.5915459", "text": "func (s *Server) GetState() []*pbg.State {\n\treturn []*pbg.State{\n\t\t&pbg.State{Key: \"counts\", Value: s.counts},\n\t}\n}", "title": "" }, { "docid": "963859619858270b40d9786255d74e31", "score": "0.58814746", "text": "func (t *Simulator) State() int {\n\tt.lock.RLock()\n\tstate := t.state\n\tt.lock.RUnlock()\n\treturn state\n}", "title": "" }, { "docid": "173ac8b5c915df6c6d283de519f3be03", "score": "0.58758503", "text": "func (d *Driver) GetState() (state.State, error) {\n\tclient := &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tTLSClientConfig: &tls.Config{InsecureSkipVerify: true},\n\t\t},\n\t}\n\tu := d.GetHttpsURL()\n\n\tresp, err := client.Get(fmt.Sprintf(\"%s/_ping\", u))\n\tif err != nil {\n\t\treturn state.Error, nil\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\n\tif string(body[:]) == \"OK\" {\n\t\treturn state.Running, nil\n\t}\n\treturn state.None, nil\n}", "title": "" }, { "docid": "9d0d9d326ea6256c4dac1a620a7f56a3", "score": "0.58680236", "text": "func (s *Server) GetState() []*pbg.State {\n\treturn []*pbg.State{\n\t\t&pbg.State{Key: \"blah\", Value: int64(100)},\n\t}\n}", "title": "" }, { "docid": "14c964f8683f2142129919f407d28d1b", "score": "0.58646244", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\tterm = int(atomic.LoadInt64(&rf.currentTerm))\n\trf.mu.Lock()\n\tif rf.currentState == LEADER {\n\t\tisleader = true\n\t}\n\trf.mu.Unlock()\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "610f33951bd00bc5661ceab921651767", "score": "0.5859519", "text": "func (m *ExactMatchSessionBase) GetState()(*string) {\n val, err := m.GetBackingStore().Get(\"state\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "3e9940e0f4eb79e5666ee030d4eedbc0", "score": "0.58410937", "text": "func (r *Raft) GetState() (int, bool) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\treturn r.getStateLocked()\n}", "title": "" }, { "docid": "7603205556aac428865b90a5c9418f85", "score": "0.5836384", "text": "func (m *PolicyLink) GetState()(*Status) {\n val, err := m.GetBackingStore().Get(\"state\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*Status)\n }\n return nil\n}", "title": "" }, { "docid": "ddc9e82e371364b9e2b6c75e35175b4d", "score": "0.58359796", "text": "func (t *Task) State() State {\n\treturn t.state\n}", "title": "" }, { "docid": "16ef043194f1962320012ecc512b2449", "score": "0.58178616", "text": "func (node *raftNode) getState() nodeState {\n\treturn node.state\n}", "title": "" }, { "docid": "256bf6966f2a31a62807cbc651461b6a", "score": "0.5815598", "text": "func (o *VgwTelemetry) GetState() string {\n\tif o == nil || o.State == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.State\n}", "title": "" }, { "docid": "695ccae11cb142569d8c992a58b5774c", "score": "0.5804658", "text": "func (c *Client) GetState() (env Env, err error) {\n\tif Verbose {\n\t\tlog.Printf(\"Retrieving state for %s from consul %s\\n\", c.appName, c.consulUrl)\n\t}\n\tif err = c.GetData(&c.state, false); err != nil {\n\t\treturn\n\t}\n\tenv = make(Env)\n\tc.addEntriesToEnv(&c.state, env)\n\treturn\n}", "title": "" }, { "docid": "364912a876c9c27f2fc703a814f17e3c", "score": "0.58014816", "text": "func (s *BinarySensor) State() bool {\n\treturn s.currentState\n}", "title": "" }, { "docid": "f3bead754124e594009f7d78aeadcbfa", "score": "0.578952", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\t// Since other goroutines will modify the current term like when we send\n\t// a heartbeat to RPC and we change the CANDIDATE to FOLLOWER meanwhile\n\t// we are getting the state, it can be harmful in concurrency.\n\t// So we need to lock the whole process in the GetState function\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm = rf.currentTerm\n\tisleader = rf.state == LEADER\n\treturn term, isleader\n}", "title": "" }, { "docid": "54c0cf93cb7f62e99e0a835ec308fa14", "score": "0.57886493", "text": "func (s *Server) GetState() []*pbg.State {\n\treturn []*pbg.State{}\n}", "title": "" }, { "docid": "dc074cc03d43702eba3c85e8c823606a", "score": "0.5781117", "text": "func (xrf *XRaft) GetState() (int32, bool) {\n\treturn xrf.currentTerm, xrf.state == LEADER\n}", "title": "" }, { "docid": "4cf7d65ab01801055ac5e4369a20e53d", "score": "0.5776761", "text": "func (o *ExtensionState) GetState() string {\n\tif o == nil || o.State == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.State\n}", "title": "" }, { "docid": "1ecbadcedb82327419e3b9551c505d8a", "score": "0.57753116", "text": "func (o *ImageExportTask) GetState() string {\n\tif o == nil || o.State == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.State\n}", "title": "" }, { "docid": "0dc4c8fb876e74da6d19f061cb92e04a", "score": "0.57572263", "text": "func (m *NetworkNodeMock) GetState() (r insolar.NodeState) {\n\tcounter := atomic.AddUint64(&m.GetStatePreCounter, 1)\n\tdefer atomic.AddUint64(&m.GetStateCounter, 1)\n\n\tif len(m.GetStateMock.expectationSeries) > 0 {\n\t\tif counter > uint64(len(m.GetStateMock.expectationSeries)) {\n\t\t\tm.t.Fatalf(\"Unexpected call to NetworkNodeMock.GetState.\")\n\t\t\treturn\n\t\t}\n\n\t\tresult := m.GetStateMock.expectationSeries[counter-1].result\n\t\tif result == nil {\n\t\t\tm.t.Fatal(\"No results are set for the NetworkNodeMock.GetState\")\n\t\t\treturn\n\t\t}\n\n\t\tr = result.r\n\n\t\treturn\n\t}\n\n\tif m.GetStateMock.mainExpectation != nil {\n\n\t\tresult := m.GetStateMock.mainExpectation.result\n\t\tif result == nil {\n\t\t\tm.t.Fatal(\"No results are set for the NetworkNodeMock.GetState\")\n\t\t}\n\n\t\tr = result.r\n\n\t\treturn\n\t}\n\n\tif m.GetStateFunc == nil {\n\t\tm.t.Fatalf(\"Unexpected call to NetworkNodeMock.GetState.\")\n\t\treturn\n\t}\n\n\treturn m.GetStateFunc()\n}", "title": "" }, { "docid": "d73832c6b7baf77f21281486b0db7192", "score": "0.57554644", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\trf.mu.Lock()\n\tterm = rf.currentTerm\n\tisleader = (rf.state == LEADER)\n\trf.mu.Unlock()\n\treturn term, isleader\n}", "title": "" }, { "docid": "c1fe07e03ea482431817dd6b26fa6f90", "score": "0.57516515", "text": "func (m *Call) GetState()(*CallState) {\n return m.state\n}", "title": "" }, { "docid": "b5a05bdfb227ae742c58377b860d0799", "score": "0.5745039", "text": "func (a *Alert) GetState() string {\n\tif a == nil || a.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.State\n}", "title": "" }, { "docid": "f65fe38e57a0d91c8bb32c9aa3c9e407", "score": "0.5741608", "text": "func (o *TxInclusionStateMsg) GetState() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.State\n}", "title": "" }, { "docid": "4682528dd70c079f4e0378753b71f4aa", "score": "0.5740249", "text": "func (drv *Jtag) GetState() (*jtag.State, error) {\n\tpins, err := drv.dev.getPins()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &jtag.State{\n\t\tTargetVoltage: -1, // not supported\n\t\tTck: pins&pinTCK != 0,\n\t\tTdi: pins&pinTDI != 0,\n\t\tTdo: pins&pinTDO != 0,\n\t\tTms: pins&pinTMS != 0,\n\t\tTrst: pins&pinTRST != 0,\n\t\tSrst: pins&pinSRST != 0,\n\t}, nil\n}", "title": "" }, { "docid": "6da210b2b03d3edb8dd39f4d5f1f7171", "score": "0.573721", "text": "func (j *SJob) GetState() (string, error) {\n\n\terr := j.forceAPI.Get(j.BaseURI, nil, nil, j)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to get job (%s) state: %s\", j.ID, err)\n\t}\n\tif _, ok := j.forceAPI.openJobMap[j.ID]; ok {\n\t\tj.forceAPI.openJobMap[j.ID] = *j\n\t}\n\n\treturn j.State, nil\n}", "title": "" }, { "docid": "9f1502f5222184e7d010ee395bbd48e9", "score": "0.5734748", "text": "func (d *Driver) GetState() (state.State, error) {\n\tlinode, err := d.getClient().GetInstance(context.TODO(), d.InstanceID)\n\tif err != nil {\n\t\treturn state.Error, err\n\t}\n\n\tswitch linode.Status {\n\tcase linodego.InstanceRunning:\n\t\treturn state.Running, nil\n\tcase linodego.InstanceOffline,\n\t\tlinodego.InstanceRebuilding,\n\t\tlinodego.InstanceMigrating:\n\t\treturn state.Stopped, nil\n\tcase linodego.InstanceShuttingDown, linodego.InstanceDeleting:\n\t\treturn state.Stopping, nil\n\tcase linodego.InstanceProvisioning,\n\t\tlinodego.InstanceRebooting,\n\t\tlinodego.InstanceBooting,\n\t\tlinodego.InstanceCloning,\n\t\tlinodego.InstanceRestoring:\n\t\treturn state.Starting, nil\n\n\t}\n\n\t// deleting, migrating, rebuilding, cloning, restoring ...\n\treturn state.None, nil\n}", "title": "" }, { "docid": "ce4b9970d2e2023c06e1c20ac537b09e", "score": "0.5732126", "text": "func GetKeyState(vKey int) uint16 {\n\tret, _, _ := procGetKeyState.Call(uintptr(vKey))\n\treturn uint16(ret)\n}", "title": "" }, { "docid": "86ec26f733fbd593aebe27140ba74a84", "score": "0.572451", "text": "func (rf *Raft) GetState() (int, bool) {\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A)\n\trf.mu.Lock()\n\tterm = rf.currentTerm\n\tisleader = (rf.state == LEADER)\n\trf.mu.Unlock()\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "5af6d822e0de158c21f27dbfed4bfde6", "score": "0.5722348", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm, isleader = rf.CurrentTerm, rf.State == LEADER\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "5a9f57f5d3741b6b1a61104e3ce915a5", "score": "0.57207096", "text": "func (recv *Device) GetState(window *Window, axes []float64) ModifierType {\n\tc_window := (*C.GdkWindow)(C.NULL)\n\tif window != nil {\n\t\tc_window = (*C.GdkWindow)(window.ToC())\n\t}\n\n\tc_axes_array := make([]C.gdouble, len(axes)+1, len(axes)+1)\n\tfor i, item := range axes {\n\t\tc := (C.gdouble)(item)\n\t\tc_axes_array[i] = c\n\t}\n\tc_axes_array[len(axes)] = 0\n\tc_axes_arrayPtr := &c_axes_array[0]\n\tc_axes := (*C.gdouble)(unsafe.Pointer(c_axes_arrayPtr))\n\n\tvar c_mask C.GdkModifierType\n\n\tC.gdk_device_get_state((*C.GdkDevice)(recv.native), c_window, c_axes, &c_mask)\n\n\tmask := (ModifierType)(c_mask)\n\n\treturn mask\n}", "title": "" }, { "docid": "b34e7b0c514916102a5ee9887da55b53", "score": "0.57173014", "text": "func (m *LicenseAssignmentState) GetState()(*string) {\n return m.state\n}", "title": "" }, { "docid": "868b5a0e21316b72f18cacf1f3e07c0a", "score": "0.5704842", "text": "func (m *ConditionalAccessPolicy) GetState()(*ConditionalAccessPolicyState) {\n val, err := m.GetBackingStore().Get(\"state\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*ConditionalAccessPolicyState)\n }\n return nil\n}", "title": "" }, { "docid": "010daaa108d2c24f9ee797a72770f7ff", "score": "0.5703407", "text": "func (o *CollectOperation) GetState(ctx context.Context) (avpb.ApiGetVfsFileContentUpdateStateResult_State, error) {\n\tresult, err := o.conn.GetVFSFileContentUpdateState(ctx, &avpb.ApiGetVfsFileContentUpdateStateArgs{\n\t\tClientId: proto.String(o.ClientID),\n\t\tOperationId: proto.String(o.OperationID),\n\t})\n\n\tif err != nil {\n\t\treturn avpb.ApiGetVfsFileContentUpdateStateResult_RUNNING, err\n\t}\n\n\treturn result.GetState(), nil\n}", "title": "" }, { "docid": "e268f8a2edd7d6ce007e3add427ba6f2", "score": "0.5684651", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\trf.mu.Lock()\n\tterm = rf.currentTerm\n\tisleader = (rf.state == LEADER)\n\trf.mu.Unlock()\n\t// Your code here (2A).\n\treturn term, isleader\n}", "title": "" }, { "docid": "b7ba7bdc1c097d821f63ffd73dbb93cc", "score": "0.5679834", "text": "func (rf *Raft) GetState() (int, bool) {\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n rf.mu.Lock()\n defer rf.mu.Unlock()\n term = rf.CurrentTerm\n isleader = (rf.role == leader)\n DPrintf(\"GetState me:%d term:%d votedFor:%d isleader:%v\", rf.me, term, rf.VotedFor, isleader)\n\treturn term, isleader\n}", "title": "" }, { "docid": "e26b4a5fd10490d5819c47901a3f7649", "score": "0.5678559", "text": "func (vm *VM) GetState() (string, error) {\n\ts, err := vm.getService()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tinstance, err := s.getInstance()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tswitch instance.Status {\n\tcase \"PROVISIONING\", \"STAGING\":\n\t\treturn virtualmachine.VMStarting, nil\n\tcase \"RUNNING\":\n\t\treturn virtualmachine.VMRunning, nil\n\tcase \"STOPPING\", \"STOPPED\", \"TERMINATED\":\n\t\treturn virtualmachine.VMHalted, nil\n\tdefault:\n\t\treturn virtualmachine.VMUnknown, nil\n\t}\n}", "title": "" }, { "docid": "c486b5b2b8da6b6981efd21449f0ad24", "score": "0.5669213", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm, isleader = rf.currentTerm, rf.state == LEADER\n\treturn term, isleader\n}", "title": "" }, { "docid": "cf389727612285fac28fb1b40632da16", "score": "0.5663835", "text": "func (i *Instance) State() State {\n\treturn i.state\n}", "title": "" }, { "docid": "6db6608509df78239082555664c49a86", "score": "0.5660478", "text": "func (s *Syncer) GetState() []*pbgs.State {\n\treturn []*pbgs.State{&pbgs.State{Key: \"last_recache\", TimeValue: s.lastResync.Unix()}}\n}", "title": "" }, { "docid": "78c1b0c42feb18eee295d14e89772bfc", "score": "0.5659854", "text": "func (rf *Raft) GetState() (int, bool) {\n\tvar term int\n\tvar isleader bool\n\t// Your code here.\n\trf.mu.Lock()\n\tterm = rf.currentTerm\n\tisleader = false\n\tif (rf.role == LEADER){\n\t\tisleader = true\n\t}\n\trf.mu.Unlock()\n\treturn term, isleader\n}", "title": "" }, { "docid": "828687e92847c1fc24b1e17d5687b036", "score": "0.56594616", "text": "func (s *Server) State() string {\n\treturn s.state.Get()\n}", "title": "" }, { "docid": "0a46f8973822f0bee2b16de733b02214", "score": "0.5654669", "text": "func (m *Manager) GetCurrentState() (state State) {\n\tm.notify.L.Lock()\n\tstate = m.currentState\n\tm.notify.L.Unlock()\n\treturn\n}", "title": "" }, { "docid": "8dcf52cede06dd1ad441aed7cdcd0ac5", "score": "0.5648123", "text": "func (d *Driver) GetState() (state.State, error) {\n\tstdout, stderr, err := prlctlOutErr(\"list\", d.MachineName, \"--output\", \"status\", \"--no-header\")\n\tif err != nil {\n\t\tif reMachineNotFound.FindString(stderr) != \"\" {\n\t\t\treturn state.Error, errMachineNotExist\n\t\t}\n\t\treturn state.Error, err\n\t}\n\n\tswitch stdout {\n\tcase \"running\\n\":\n\t\treturn state.Running, nil\n\tcase \"paused\\n\":\n\t\treturn state.Paused, nil\n\tcase \"suspended\\n\":\n\t\treturn state.Saved, nil\n\tcase \"stopping\\n\":\n\t\treturn state.Stopping, nil\n\tcase \"stopped\\n\":\n\t\treturn state.Stopped, nil\n\t}\n\treturn state.None, nil\n}", "title": "" }, { "docid": "34407bd868665468bef9dfb41937ac9c", "score": "0.56426257", "text": "func (rf *Raft) GetState() (int, bool) { // 2A\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here.\n\n\trf.mu.Lock()\n\tterm = rf.currentTerm\n\tisleader = rf.current_state == \"LEADER\"\n\trf.mu.Unlock()\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "606359f28847251e4959c3274823f4ec", "score": "0.56399304", "text": "func (o *StorageNetAppIpInterface) GetState() string {\n\tif o == nil || o.State == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.State\n}", "title": "" }, { "docid": "0a906234dc4a19d789d46053c6c21b15", "score": "0.56374633", "text": "func (s *Session) State() int {\n\treturn s.GetData().State\n}", "title": "" }, { "docid": "0e99f468a3b57d01041bc7095f816432", "score": "0.56319207", "text": "func (m *Qna) GetState()(*AnswerState) {\n val, err := m.GetBackingStore().Get(\"state\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*AnswerState)\n }\n return nil\n}", "title": "" }, { "docid": "f7c6a43fb189f84e8f17b5d78d8c893a", "score": "0.56269675", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\n\t// Your code here (Lab1).\n\n rf.mu.Lock()\n defer rf.mu.Unlock()\n\n term = rf.currentTerm\n isleader = (rf.role == Leader)\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "51cbb1b6494613faa242c1dbd5ae5469", "score": "0.56226414", "text": "func (d *Driver) GetState() (state.State, error) {\n\tcmd := exec.Command(d.OciBinary, \"inspect\", \"-f\", \"{{.State.Status}}\", d.MachineName)\n\tout, err := cmd.CombinedOutput()\n\to := strings.Trim(string(out), \"\\n\")\n\tif err != nil {\n\t\treturn state.Error, errors.Wrapf(err, \"error stop node %s\", d.MachineName)\n\t}\n\tif o == \"running\" {\n\t\treturn state.Running, nil\n\t}\n\tif o == \"exited\" {\n\t\treturn state.Stopped, nil\n\t}\n\tif o == \"paused\" {\n\t\treturn state.Paused, nil\n\t}\n\tif o == \"restarting\" {\n\t\treturn state.Starting, nil\n\t}\n\tif o == \"dead\" {\n\t\treturn state.Error, nil\n\t}\n\treturn state.None, fmt.Errorf(\"unknown state\")\n\n}", "title": "" }, { "docid": "114d135d75a3c1743e43d7dd018cac40", "score": "0.56185764", "text": "func (db *Database) GetState() *DbState {\n\treturn db.state.get()\n}", "title": "" }, { "docid": "8a672561965ab43baaf84de987329c4e", "score": "0.5618512", "text": "func (rf *Raft) GetState() (int, bool) {\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm = rf.currentTerm\n\tisleader = rf.status == LEADER\n\treturn term, isleader\n}", "title": "" }, { "docid": "551685aed9501c79fcedc763f476a12c", "score": "0.5616905", "text": "func (rf *Raft) GetState() (int, bool) {\n\t// Your code here (2A).\n\trf.mu.Lock()\n\tterm := int(rf.currentTerm)\n\tisleader := rf.status == leader\n\trf.mu.Unlock()\n\treturn term, isleader\n}", "title": "" }, { "docid": "c66889b9d915b85011770eafe800aeff", "score": "0.5613927", "text": "func (rf *Raft) GetState() (int, bool) {\n\t\n\tvar term int\n\tvar isleader bool\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm = rf.currentTerm\n\tisleader = rf.leader\n\t// Your code here (2A).\n\treturn term, isleader\n}", "title": "" }, { "docid": "35366c9b120cf45010765b8acb6fce41", "score": "0.5612455", "text": "func (t *SignalTable) SignalStateGet() ([]byte, error) {\n\n\tbuff, err := json.Marshal(t.state.GetAll())\n\n\treturn buff, err\n}", "title": "" }, { "docid": "a66106e8f92fb69ddd11008234fb418f", "score": "0.5608543", "text": "func (o *Sa) GetState() string {\n\tif o == nil || o.State == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.State\n}", "title": "" }, { "docid": "9bab0b8b5340b15399a90e97af74ce23", "score": "0.560394", "text": "func (r *Service) GetState() State {\n\ts := atomic.LoadInt32(&r.state)\n\treturn State(s)\n}", "title": "" }, { "docid": "f752fc549af16c74f93f5ed4a51b14b1", "score": "0.55974764", "text": "func (s *Server) State() State {\n\treturn s.state\n}", "title": "" }, { "docid": "8422421db08b84222e9f0d755f3f51eb", "score": "0.5597202", "text": "func (v *AgentGetInstancesAppMachinesMachineConnectionNodesMachine) GetState() string { return v.State }", "title": "" }, { "docid": "2b8bc260fd2ca8b50d8dfd7a2d2f800f", "score": "0.5586531", "text": "func (c *UtopiaClient) GetWebSocketState() (int64, error) {\n\tresult, err := c.queryResultToInt(\"getWebSocketState\", nil)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "eb79a9bfec64379021642ee81b5567b1", "score": "0.5585995", "text": "func (rf *Raft) GetState() (int, bool) {\n\tvar term int\n\tvar isleader bool\n\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm = rf.currentTerm\n\tisleader = rf.status == LEADER\n\treturn term, isleader\n}", "title": "" }, { "docid": "57ab08daa02930069e487c600a200e96", "score": "0.5582763", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here.\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\n\tterm = rf.currentTerm\n\tisleader = rf.isLeader()\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "865eddd19b5242066b2715a729707377", "score": "0.5582437", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here.\n\trf.mu.Lock()\n\tterm = rf.currTerm\n\tisleader = rf.leaderID == rf.me\n\trf.mu.Unlock()\n\treturn term, isleader\n}", "title": "" }, { "docid": "3fc4f8d23e853cacc83bc4d7a096d460", "score": "0.5580013", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\tterm = rf.currentTerm\n\tisleader = rf.role == LEADER\n\treturn term, isleader\n}", "title": "" }, { "docid": "dd1fbea1f8a019ddfacc9a772a529ac4", "score": "0.5579898", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\trf.mu.Lock()\n\tdefer rf.mu.Unlock()\n\n\tterm = rf.currentTerm\n\tisleader = rf.state == LEADER\n\n\tDPrintf(\"%d GetState result.term:%d, state:%d, isLeader:%t\", rf.me, term, rf.state, isleader)\n\n\treturn term, isleader\n}", "title": "" }, { "docid": "d135f2457818994cbb8daec735d4bd8b", "score": "0.55789965", "text": "func (amqpBackend *AMQPBackend) GetState(taskUUID string) (*TaskState, error) {\n\ttaskState := TaskState{}\n\n\tconn, channel, queue, err := open(taskUUID, amqpBackend.config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer close(channel, conn)\n\n\td, ok, err := channel.Get(\n\t\tqueue.Name, // queue name\n\t\tfalse, // multiple\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !ok {\n\t\treturn nil, errors.New(\"No state ready\")\n\t}\n\n\td.Ack(false)\n\n\tif err := json.Unmarshal([]byte(d.Body), &taskState); err != nil {\n\t\tlog.Printf(\"Failed to unmarshal task state: %v\", string(d.Body))\n\t\tlog.Print(err)\n\t\treturn nil, err\n\t}\n\n\tif taskState.IsCompleted() {\n\t\tchannel.QueueDelete(\n\t\t\tqueue.Name, // name\n\t\t\tfalse, // ifUnused\n\t\t\tfalse, // ifEmpty\n\t\t\tfalse, // noWait\n\t\t)\n\t}\n\n\treturn &taskState, nil\n}", "title": "" }, { "docid": "6bdb5ebd6931e7a5ca93e57684e0e34f", "score": "0.5574517", "text": "func (vm *VM) GetState() (state string, err error) {\n\tif err := SetupSession(vm); err != nil {\n\t\treturn \"\", lvm.ErrVMInfoFailed\n\t}\n\tdefer vm.cancel()\n\n\tstate, err = getState(vm)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif state == \"running\" {\n\t\treturn lvm.VMRunning, nil\n\t} else if state == \"standby\" {\n\t\treturn lvm.VMSuspended, nil\n\t} else if state == \"shuttingDown\" || state == \"resetting\" || state == \"notRunning\" {\n\t\treturn lvm.VMHalted, nil\n\t}\n\t// VM state \"unknown\"\n\treturn \"\", lvm.ErrVMInfoFailed\n}", "title": "" }, { "docid": "de67feb7395ca937456e94df3c0bf441", "score": "0.55710405", "text": "func EngineState() uint64 {\n\treturn atomic.LoadUint64(&gState)\n}", "title": "" }, { "docid": "5eee94a4b7d3c4beebe847d7ec73a194", "score": "0.5569472", "text": "func (endpoint *Endpoint) GetClientState() exported.ClientState {\n\treturn endpoint.Chain.GetClientState(endpoint.ClientID)\n}", "title": "" }, { "docid": "b843a0773de10e63fe9cf76f1e818e6f", "score": "0.55674595", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\trf.mu.Lock()\n\tterm := rf.currentTerm\n\tleader := rf.isLeader\n\trf.mu.Unlock()\n\n\t// Your code here (2A).\n\treturn term, leader\n}", "title": "" }, { "docid": "220463be8941e6fe8311891f8434dbf3", "score": "0.55668056", "text": "func (rf *Raft) GetState() (int, bool) {\n\t// Your code here (2A).\n\treturn int(rf.currentTerm.AtomicGet()), rf.state.AtomicGet() == Leader\n}", "title": "" }, { "docid": "64027fd498191b316554f41ac6961b60", "score": "0.5566645", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\t// Your code here (2A).\n\treturn int(rf.getCurrentTerm()), rf.getRole() == leader\n}", "title": "" }, { "docid": "f595f522fe105b8e75d2829bd096a3dd", "score": "0.55659103", "text": "func (c *Client) getState(debugSource string) (link.State, error) {\n\tstatus, err := c.device.GetStatus(context.Background())\n\tif err != nil {\n\t\treturn link.StateUnknown, err\n\t}\n\t_ = syslog.InfoTf(tag, \"fuchsia.hardware.ethernet.Device.GetStatus() = %s (%s)\", status, debugSource)\n\tstate := link.StateStarted\n\tif status&ethernet.DeviceStatusOnline == 0 {\n\t\tstate = link.StateDown\n\t}\n\treturn state, nil\n}", "title": "" }, { "docid": "3d193930bf8dae11ded8571c06602167", "score": "0.556399", "text": "func (rf *Raft) GetState() (int, bool) {\n\n\tvar term int\n\tvar isleader bool\n\t// Your code here (2A).\n\tterm = rf.currentTerm\n\tisleader = (rf.status == LEADER)\n\treturn term, isleader\n}", "title": "" } ]
797f1e19452f7ea40a5f1246b8e98d31
ConeCastSinglePiercing repeatedly calls RayCastLabelsPiercing in a cone shape
[ { "docid": "b7c764e29b0b932432f5a0fa4997cc7c", "score": "0.6645676", "text": "func (t *Tree) ConeCastSinglePiercing(x, y, angle, angleWidth, rays, length float64, pierceCount int, labels ...Label) (points []Point) {\n\tda := angleWidth / rays\n\tfor a := angle; a < angle+angleWidth; a += da {\n\t\tcp := t.RayCastLabelsPiercing(x, y, a, length, pierceCount, labels...)\n\t\tif cp.Zone != nil {\n\t\t\tpoints = append(points, cp)\n\t\t}\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "d686e4d371de038d68aec638ce2309bf", "score": "0.62559915", "text": "func (t *Tree) ConeCastSingleLabels(x, y, angle, angleWidth, rays, length float64, labels ...Label) (points []Point) {\n\tda := angleWidth / rays\n\tfor a := angle; a < angle+angleWidth; a += da {\n\t\tcp := RayCastSingleLabels(x, y, a, length, labels...)\n\t\tif cp.Zone != nil {\n\t\t\tpoints = append(points, cp)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "8390017776a33dd5e07ad537cd4a0a9a", "score": "0.57792693", "text": "func (t *Tree) ConeCast(x, y, angle, angleWidth, rays, length float64) (points []Point) {\n\tda := angleWidth / rays\n\tfor a := angle; a < angle+angleWidth; a += da {\n\t\tcps := RayCast(x, y, a, length)\n\t\tif len(cps) > 0 {\n\t\t\tpoints = append(points, cps...)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "d562ad58c838d5fa93c1b14129c15579", "score": "0.55666536", "text": "func (t *Tree) ConeCastSingle(x, y, angle, angleWidth, rays, length float64, invalidIDS []event.CID) (points []Point) {\n\tda := angleWidth / rays\n\tfor a := angle; a < angle+angleWidth; a += da {\n\t\tcp := RayCastSingle(x, y, a, length, invalidIDS)\n\t\tif cp.Zone != nil {\n\t\t\tpoints = append(points, cp)\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "716698f3fe9a988f121527296ebfa054", "score": "0.51824623", "text": "func (t *Tree) RayCastSingleIgnorePiercing(x, y, degrees, length float64, pierceCount int, invalidIDS []event.CID, labels ...Label) Point {\n\tresultHash := make(map[*Space]bool)\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\t\tnext := t.SearchIntersect(loc)\n\toutput:\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tif _, ok := resultHash[nx]; !ok {\n\n\t\t\t\tfor _, label := range labels {\n\t\t\t\t\tif nx.Label == label {\n\t\t\t\t\t\tcontinue output\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor e := 0; e < len(invalidIDS); e++ {\n\t\t\t\t\tif nx.CID == invalidIDS[e] {\n\t\t\t\t\t\tcontinue output\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif pierceCount <= 0 {\n\t\t\t\t\treturn NewPoint(nx, x, y)\n\t\t\t\t}\n\t\t\t\tresultHash[nx] = true\n\t\t\t\tpierceCount--\n\t\t\t}\n\t\t}\n\t\tx += c\n\t\ty += s\n\n\t}\n\treturn NilPoint()\n}", "title": "" }, { "docid": "45b5ca077ccae22fecdc66018e23155d", "score": "0.5157768", "text": "func (t *Tree) RayCastSingleLabels(x, y, degrees, length float64, labels ...Label) Point {\n\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\t\tnext := t.SearchIntersect(loc)\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tfor _, label := range labels {\n\t\t\t\tif nx.Label == label {\n\t\t\t\t\treturn NewPoint(nx, x, y)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tx += c\n\t\ty += s\n\n\t}\n\treturn NilPoint()\n}", "title": "" }, { "docid": "3c055fb6fc83e925f0d545c7e229df30", "score": "0.5082193", "text": "func (t *Tree) RayCastLabelsPiercing(x, y, degrees, length float64, pierceCount int, labels ...Label) Point {\n\tresultHash := make(map[*Space]bool)\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\t\tnext := t.SearchIntersect(loc)\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tif _, ok := resultHash[nx]; !ok {\n\n\t\t\t\tfor _, label := range labels {\n\t\t\t\t\tif nx.Label == label {\n\t\t\t\t\t\tif pierceCount <= 0 {\n\t\t\t\t\t\t\treturn NewPoint(nx, x, y)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresultHash[nx] = true\n\t\t\t\t\t\tpierceCount--\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tx += c\n\t\ty += s\n\n\t}\n\treturn NilPoint()\n}", "title": "" }, { "docid": "85c6ef6f0d8b5b574e76910be54d557a", "score": "0.5044187", "text": "func (t *Tree) RayCastSingleIgnoreLabels(x, y, degrees, length float64, labels ...Label) Point {\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\t\tnext := t.SearchIntersect(loc)\n\toutput:\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tfor _, label := range labels {\n\t\t\t\tif nx.Label == label {\n\t\t\t\t\tcontinue output\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn NewPoint(nx, x, y)\n\t\t}\n\t\tx += c\n\t\ty += s\n\n\t}\n\treturn NilPoint()\n}", "title": "" }, { "docid": "dbe6c63bd33e7b1b03e60f2aa05fc1a3", "score": "0.47210452", "text": "func (s *Scatter) Run() {\n\tif !s.recentlyChangedDirection {\n\t\ts.ghost.turnTowards(s.ctx.GhostBases[s.ghost.kind], false, true)\n\t}\n\ts.recentlyChangedDirection = s.ghost.direction != s.prevDirection\n\tif !s.recentlyChangedDirection {\n\t\tshouldMove := true\n\t\ttargets := s.ghost.collisionDetector.DetectCollision()\n\t\tfor _, target := range targets {\n\t\t\tswitch obj := target.(type) {\n\t\t\tcase *Wall:\n\t\t\t\ts.ghost.direction = pickRandomDirection()\n\t\t\t\tshouldMove = false\n\t\t\tcase *Pacman:\n\t\t\t\ts.AttemptEatPacman(obj)\n\t\t\t}\n\t\t}\n\n\t\tif shouldMove {\n\t\t\ts.ctx.Maze.MoveElement(s.ghost)\n\t\t\ts.ghost.advanceSprites()\n\t\t}\n\t}\n\ts.prevDirection = s.ghost.direction\n\tif time.Now().Sub(s.createdAt).Seconds() > constants.ScatterModeDuration {\n\t\ts.ghost.ChangeState(constants.ChasePacman)\n\t}\n}", "title": "" }, { "docid": "71a128ac78621f4cb74e93bb66f65d3f", "score": "0.45653358", "text": "func (t *Tree) RayCastSingleIgnore(x, y, degrees, length float64, invalidIDS []event.CID, labels ...Label) Point {\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\t\tnext := t.SearchIntersect(loc)\n\toutput:\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tfor _, label := range labels {\n\t\t\t\tif nx.Label == label {\n\t\t\t\t\tcontinue output\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor e := 0; e < len(invalidIDS); e++ {\n\t\t\t\tif nx.CID == invalidIDS[e] {\n\t\t\t\t\tcontinue output\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn NewPoint(nx, x, y)\n\t\t}\n\t\tx += c\n\t\ty += s\n\n\t}\n\treturn NilPoint()\n}", "title": "" }, { "docid": "b2813dcb557b7074e92cf0951f8c3279", "score": "0.45357755", "text": "func (t *Tree) RayCastSingle(x, y, degrees, length float64, invalidIDS []event.CID) Point {\n\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\t\tnext := t.SearchIntersect(loc)\n\toutput:\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tfor e := 0; e < len(invalidIDS); e++ {\n\t\t\t\tif nx.CID == invalidIDS[e] {\n\t\t\t\t\tcontinue output\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn NewPoint(nx, x, y)\n\t\t}\n\t\tx += c\n\t\ty += s\n\n\t}\n\treturn NilPoint()\n}", "title": "" }, { "docid": "515a42edc65e4adf772fb25f9247db92", "score": "0.45238906", "text": "func (c *Chase) Run() {\n\tif !c.recentlyChangedDirection {\n\t\tc.ghost.switchDirection()\n\t}\n\tc.recentlyChangedDirection = c.ghost.direction != c.prevDirection\n\tif !c.recentlyChangedDirection {\n\t\tshouldMove := true\n\t\ttargets := c.ghost.collisionDetector.DetectCollision()\n\t\tfor _, target := range targets {\n\t\t\tswitch obj := target.(type) {\n\t\t\tcase *Wall:\n\t\t\t\tc.ghost.direction = pickRandomDirection()\n\t\t\t\tshouldMove = false\n\t\t\tcase *Pacman:\n\t\t\t\tc.AttemptEatPacman(obj)\n\t\t\t}\n\t\t}\n\n\t\tif shouldMove {\n\t\t\tc.ctx.Maze.MoveElement(c.ghost)\n\t\t\tc.ghost.advanceSprites()\n\t\t}\n\t}\n\tc.prevDirection = c.ghost.direction\n\ttimer := time.Now().Sub(c.createdAt).Seconds()\n\tif c.ghost.phase < constants.InfiniteChasePhase && timer > constants.ChaseModeDuration {\n\t\tc.ghost.phase++\n\t\tc.ctx.Msg.PhaseChange <- c.ghost.phase\n\t\tc.ghost.ChangeState(constants.Scatter)\n\t}\n}", "title": "" }, { "docid": "9753f3a5bc2d3bf7394e76c36f10d0b8", "score": "0.44562578", "text": "func (operation *RaytraceRowOperation) castRay(scene *Scene, ray geometry.Ray, depth int, refractionIndex float64,\n\tsampleIndex int, numSamples int) shading.Color {\n\tpixelColor := scene.BackgroundColor\n\n\t// Limit recursion caused by reflecting rays off multiple surfaces.\n\tif depth == maxReflectionDepth {\n\t\treturn pixelColor\n\t}\n\n\t// Find the closest surface in the scene that the ray intersects, if any.\n\tvar closestIntersection *geometry.Intersection\n\tvar closestSurface surface.Surface\n\tfor _, surface := range scene.Surfaces {\n\t\tif intersection := surface.Intersection(ray); intersection != nil {\n\t\t\tif closestIntersection == nil || intersection.Distance < closestIntersection.Distance {\n\t\t\t\tclosestIntersection = intersection\n\t\t\t\tclosestSurface = surface\n\t\t\t}\n\t\t}\n\t}\n\n\tif closestIntersection != nil {\n\t\tshadingProperties := closestSurface.ShadingProperties()\n\t\tkRefraction := 1 - shadingProperties.Opacity\n\t\tkReflection := shadingProperties.Reflectivity * shadingProperties.Opacity\n\t\tkDiffuse := 1 - kRefraction - kReflection\n\t\tkSpecular := shadingProperties.SpecularIntensity\n\t\tvar refractedColor, reflectedColor, diffuseColor, specularColor shading.Color\n\n\t\t// Determine the component of the ray from light passing through a transparent surface.\n\t\tif kRefraction > 0 {\n\t\t\tcosIn := -closestIntersection.Normal.Dot(ray.Direction)\n\t\t\tetaIn := refractionIndex\n\t\t\tetaOut := shadingProperties.RefractiveIndex\n\t\t\tif refractionIndex > 1 {\n\t\t\t\t// If the previous refraction index isn't 1, the ray is exiting the material instead of entering.\n\t\t\t\tetaIn, etaOut = etaOut, etaIn\n\t\t\t}\n\n\t\t\t// Determine reflection and refraction components of the refracted light.\n\t\t\tsinOut := etaIn / etaOut * math.Sqrt(math.Max(1-cosIn*cosIn, 0))\n\t\t\tif sinOut < 1 {\n\t\t\t\tcosOut := math.Abs(math.Sqrt(math.Max(1-sinOut*sinOut, 0)))\n\t\t\t\trParallel := ((etaOut * cosIn) - (etaIn * cosOut)) / ((etaOut * cosIn) + (etaIn * cosOut))\n\t\t\t\trPerpendicular := ((etaIn * cosIn) - (etaOut * cosOut)) / ((etaIn * cosIn) + (etaOut * cosOut))\n\t\t\t\treflectedComponent := (rParallel*rParallel + rPerpendicular*rPerpendicular) / 2\n\n\t\t\t\t// Adjust the coefficients for the reflected light coming from refraction.\n\t\t\t\tdelta := reflectedComponent * kRefraction\n\t\t\t\tkRefraction -= delta\n\t\t\t\tkReflection += delta\n\t\t\t}\n\n\t\t\teta := etaIn / etaOut\n\t\t\tk := 1 - eta*eta*(1-cosIn*cosIn)\n\t\t\trefractionDirection :=\n\t\t\t\tray.Direction.Multiply(eta).Add(closestIntersection.Normal.Multiply(eta*cosIn - math.Sqrt(k)))\n\n\t\t\t// Bias the intersection point off the surface slightly to avoid immediate self-intersection.\n\t\t\trefractionPoint :=\n\t\t\t\tclosestIntersection.Point.Translate(closestIntersection.Normal.Multiply(-reflectionBias))\n\n\t\t\trefractedRay := geometry.Ray{refractionPoint, refractionDirection.ToUnit()}\n\t\t\trefractedColor = operation.castRay(scene, refractedRay, depth+1, shadingProperties.RefractiveIndex,\n\t\t\t\tsampleIndex, numSamples)\n\t\t}\n\n\t\t// Determine the component of the ray from light reflected off a mirrored surface.\n\t\treflectedDirection := ray.Direction.Add(\n\t\t\tclosestIntersection.Normal.Multiply(-2 * closestIntersection.Normal.Dot(ray.Direction))).ToUnit()\n\t\tif kReflection > 0 {\n\t\t\t// Bias the intersection point off the surface slightly to avoid immediate self-intersection.\n\t\t\treflectedPoint := closestIntersection.Point.Translate(closestIntersection.Normal.Multiply(reflectionBias))\n\n\t\t\treflectedRay := geometry.Ray{reflectedPoint, reflectedDirection.ToUnit()}\n\t\t\treflectedColor = operation.castRay(scene, reflectedRay, depth+1, refractionIndex, sampleIndex, numSamples)\n\t\t}\n\n\t\t// Determine the component of the ray from the scene's lights directly illuminating the surface.\n\t\tif kDiffuse > 0 || kSpecular > 0 {\n\t\t\tfor _, light := range scene.Lights {\n\t\t\t\tlightDirection := light.Direction(closestIntersection.Point, sampleIndex, numSamples)\n\n\t\t\t\t// Check if there is an object between the intersection point and the light source, in which case\n\t\t\t\t// it should cast a shadow.\n\t\t\t\tlightRay := geometry.Ray{\n\t\t\t\t\tOrigin: closestIntersection.Point,\n\t\t\t\t\tDirection: lightDirection.Multiply(-1).ToUnit(),\n\t\t\t\t}\n\t\t\t\ttransparency := 1.0\n\t\t\t\tfor _, surface := range scene.Surfaces {\n\t\t\t\t\tif intersection := surface.Intersection(lightRay); intersection != nil {\n\t\t\t\t\t\t// Require a minimum distance to prevent floating-point imprecision causing a surface to\n\t\t\t\t\t\t// cast a shadow on itself.\n\t\t\t\t\t\tif intersection.Distance > shadowBias {\n\t\t\t\t\t\t\tif light.IsBlockedByIntersection(closestIntersection.Point, intersection) {\n\t\t\t\t\t\t\t\ttransparency *= 1 - surface.ShadingProperties().Opacity\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\tif transparency == 0 {\n\t\t\t\t\t// The light is not reaching the intersection point at all; skip calculating its component color\n\t\t\t\t\t// from this light source since it will just be black.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Calculate the diffuse component, influenced by the color of the surface itself.\n\t\t\t\tincidentDotProduct := lightDirection.Multiply(-1).Dot(closestIntersection.Normal)\n\t\t\t\tincidentLight := light.Intensity(closestIntersection.Point) * math.Max(incidentDotProduct, 0) *\n\t\t\t\t\ttransparency\n\t\t\t\tvar u, v float64\n\t\t\t\tif closestSurface.ShadingProperties().DiffuseTexture.NeedsTextureCoordinates() {\n\t\t\t\t\t// For optimization, don't bother translating coordinates if the albedo doesn't depend on them\n\t\t\t\t\t// (e.g. for solid color); just use (0, 0).\n\t\t\t\t\tu, v = closestSurface.ToTextureCoordinates(closestIntersection.Point)\n\t\t\t\t}\n\t\t\t\talbedo := closestSurface.ShadingProperties().DiffuseTexture.AlbedoAt(u, v, scene.DitherVariation)\n\t\t\t\tdiffuseColor.R += albedo.R / math.Pi * light.Color().R * incidentLight\n\t\t\t\tdiffuseColor.G += albedo.G / math.Pi * light.Color().G * incidentLight\n\t\t\t\tdiffuseColor.B += albedo.B / math.Pi * light.Color().B * incidentLight\n\n\t\t\t\t// Calculate specular reflection.\n\t\t\t\tspecularIntensity := math.Pow(math.Max(reflectedDirection.Dot(lightRay.Direction), 0),\n\t\t\t\t\tshadingProperties.SpecularExponent)\n\t\t\t\tspecularColor.R += light.Color().R * specularIntensity\n\t\t\t\tspecularColor.G += light.Color().G * specularIntensity\n\t\t\t\tspecularColor.B += light.Color().B * specularIntensity\n\t\t\t}\n\t\t}\n\n\t\t// Sum up the various components to obtain the final color for the ray.\n\t\tpixelColor.R = kRefraction*refractedColor.R + kReflection*reflectedColor.R + kDiffuse*diffuseColor.R +\n\t\t\tkSpecular*specularColor.R\n\t\tpixelColor.G = kRefraction*refractedColor.G + kReflection*reflectedColor.G + kDiffuse*diffuseColor.G +\n\t\t\tkSpecular*specularColor.G\n\t\tpixelColor.B = kRefraction*refractedColor.B + kReflection*reflectedColor.B + kDiffuse*diffuseColor.B +\n\t\t\tkSpecular*specularColor.B\n\t}\n\n\treturn pixelColor\n}", "title": "" }, { "docid": "3851b1ded915e4f91a8e812afe406678", "score": "0.44443446", "text": "func beginCollide(space *cp.Space, arb *cp.Arbiter, data interface{}) int {\n fmt.Println(\"BEGIN COLLISION\")\n \n // Uncomment the following to add a post step callback to remove the ball:\n //_, ball := arb.GetShapes()\n //space.AddPostStepCallback(ball, postStep)\n \n // Change return value to 0 to skip the collision chain\n return 1\n}", "title": "" }, { "docid": "c4ee665e8b2ef644e8ec628b2223fa2a", "score": "0.4427237", "text": "func (t *Raycast) Update(a *app.App, deltaTime time.Duration) {}", "title": "" }, { "docid": "8099b8b29296f9c7777b3137f8759355", "score": "0.4402637", "text": "func (ly *TDDaLayer) CyclePost(ltime *leabra.Time) {\n\tact := ly.Neurons[0].Act\n\tly.DA = act\n\tly.SendDA.SendDA(ly.Network, act)\n}", "title": "" }, { "docid": "b79a028b05da2de6326719a837dd6112", "score": "0.43945083", "text": "func (t *Raycast) Start(a *app.App) {\n\n\t// Create axes helper\n\taxes := helper.NewAxes(1)\n\ta.Scene().Add(axes)\n\n\tl1 := light.NewDirectional(&math32.Color{1, 1, 1}, 1.0)\n\tl1.SetPosition(0, 0, 5)\n\ta.Scene().Add(l1)\n\n\t// Plane\n\tgeom1 := geometry.NewPlane(1.5, 1)\n\tmat1 := material.NewStandard(&math32.Color{0, 1, 0})\n\tmat1.SetSide(material.SideFront)\n\tmesh1 := graphic.NewMesh(geom1, mat1)\n\tmesh1.SetPosition(-1.2, 0, 0)\n\ta.Scene().Add(mesh1)\n\n\t// Box\n\tgeom2 := geometry.NewCube(1)\n\tmat2 := material.NewStandard(&math32.Color{1, 0, 0})\n\tmat2.SetSide(material.SideFront)\n\tmesh2 := graphic.NewMesh(geom2, mat2)\n\tmesh2.SetPosition(1.2, 0, 0)\n\ta.Scene().Add(mesh2)\n\n\t// Sphere\n\tgeom3 := geometry.NewSphere(0.5, 16, 16)\n\tmat3 := material.NewStandard(&math32.Color{0, 1, 1})\n\tmesh3 := graphic.NewMesh(geom3, mat3)\n\tmesh3.SetPosition(0, 1, -1)\n\ta.Scene().Add(mesh3)\n\n\t// Open ended cylinder\n\tgeom4 := geometry.NewCylinder(0.5, 1, 16, 1, false, false)\n\tmat4 := material.NewStandard(&math32.Color{1, 1, 0})\n\tmat4.SetSide(material.SideDouble)\n\tmesh4 := graphic.NewMesh(geom4, mat4)\n\tmesh4.SetPosition(0, -1.2, -0.5)\n\ta.Scene().Add(mesh4)\n\n\t// Disk\n\tgeom5 := geometry.NewDisk(0.6, 5)\n\tmat5 := material.NewStandard(&math32.Color{0.5, 0.5, 0.9})\n\tmat5.SetSide(material.SideDouble)\n\tmesh5 := graphic.NewMesh(geom5, mat5)\n\tmesh5.SetPosition(-1.2, -1.2, -0.5)\n\tmesh5.SetRotation(math32.Pi/4, 0, 0)\n\ta.Scene().Add(mesh5)\n\n\t// Torus\n\tgeom6 := geometry.NewTorus(0.5, 0.2, 16, 16, math32.Pi)\n\tmat6 := material.NewStandard(&math32.Color{0, 0, 0.5})\n\tmat6.SetSide(material.SideDouble)\n\tmesh6 := graphic.NewMesh(geom6, mat6)\n\tmesh6.SetPosition(1.5, -1.2, -1)\n\ta.Scene().Add(mesh6)\n\n\t// Cone (ConeCylinder)\n\tgeom7 := geometry.NewCone(0.5, 1, 16, 1, true)\n\tmat7 := material.NewStandard(&math32.Color{0.8, 0.7, 0.3})\n\tmat7.SetSide(material.SideFront)\n\tmat7.SetOpacity(0.6)\n\tmat7.SetTransparent(true)\n\tmesh7 := graphic.NewMesh(geom7, mat7)\n\tmesh7.SetPosition(0, 0, 0)\n\ta.Scene().Add(mesh7)\n\n\t// Sprite\n\tmat8 := material.NewStandard(&math32.Color{0, 0.3, 1})\n\tmesh8 := graphic.NewSprite(1, 1, mat8)\n\tmesh8.SetPosition(2, -2, -2)\n\tmesh8.SetRotationZ(math32.Pi / 4)\n\tmesh8.SetScale(2, 1, 1)\n\ta.Scene().Add(mesh8)\n\n\t// Line strip\n\tgeom9 := geometry.NewGeometry()\n\tpositions := math32.NewArrayF32(0, 0)\n\tpositions.Append(\n\t\t-1, 0, -1, 1, 0, -1,\n\t\t-1, 1, -1, 1, 1, -1,\n\t\t-1, 2, -1, 1, 2, -1,\n\t)\n\tgeom9.AddVBO(gls.NewVBO(positions).AddAttrib(gls.VertexPosition))\n\tmat9 := material.NewStandard(&math32.Color{1, 0, 0})\n\tmesh9 := graphic.NewLineStrip(geom9, mat9)\n\tmesh9.SetPosition(-1.5, 0.5, -0.4)\n\ta.Scene().Add(mesh9)\n\n\t// Line segments\n\tgeom10 := geometry.NewGeometry()\n\tpositions = math32.NewArrayF32(0, 0)\n\tpositions.Append(\n\t\t0, 0, 0, 1, 0, 0,\n\t\t0, 0, 0, -1, 0, 0,\n\t\t0, 0, 0, 0, 1, 0,\n\t\t0, 0, 0, 0, -1, 0,\n\t\t0, 0, 0, 0, 0, -1,\n\t\t0, 0, 0, 0, 0, -1,\n\t\t0, 0, 0, 0, 0, 1,\n\t\t0.1, 0.1, 0.1, 0.5, 0.5, 0.5,\n\t)\n\tgeom10.AddVBO(gls.NewVBO(positions).AddAttrib(gls.VertexPosition))\n\tmat10 := material.NewStandard(&math32.Color{0, 0, 1})\n\tmesh10 := graphic.NewLines(geom10, mat10)\n\tmesh10.SetScale(0.8, 0.8, 0.8)\n\tmesh10.SetPosition(1, 1.5, 0)\n\ta.Scene().Add(mesh10)\n\n\t// Points\n\tgeom11 := geometry.NewGeometry()\n\tpositions = math32.NewArrayF32(0, 0)\n\tfor i := 0; i < 30; i++ {\n\t\tx := rand.Float32()\n\t\ty := rand.Float32()\n\t\tz := rand.Float32()\n\t\tpositions.Append(x, y, z)\n\t}\n\tgeom11.AddVBO(gls.NewVBO(positions).AddAttrib(gls.VertexPosition))\n\tmat11 := material.NewPoint(&math32.Color{0, 0, 0})\n\tmat11.SetSize(50)\n\tmesh11 := graphic.NewPoints(geom11, mat11)\n\tmesh11.SetPosition(-2, -1, 0)\n\ta.Scene().Add(mesh11)\n\n\t// Creates the raycaster\n\tt.rc = collision.NewRaycaster(&math32.Vector3{}, &math32.Vector3{})\n\tt.rc.LinePrecision = 0.05\n\tt.rc.PointPrecision = 0.05\n\n\t// Subscribe to mouse button down events\n\ta.SubscribeID(window.OnMouseDown, a, func(evname string, ev interface{}) {\n\t\tt.onMouse(a, ev)\n\t})\n}", "title": "" }, { "docid": "8e17c42df2908c20087f30dd9bb553ef", "score": "0.4367568", "text": "func (this *BroadPhase) RayCast(callback func(RayCastInput, int32) float64, input RayCastInput) {\n\tthis.tree.RayCast(callback, input)\n}", "title": "" }, { "docid": "b8baf99ccfc0ca4c3ef4024e206a2cae", "score": "0.43150318", "text": "func performDetection() {\n\tfor {\n\t\t// get next frame from channel\n\t\tframe := <-images\n\n\t\tblob := gocv.BlobFromImage(*frame, 1.0, image.Pt(256, 256), gocv.NewScalar(0, 0, 0, 0), false, false)\n\n\t\t// feed the blob into the detector\n\t\tnet.SetInput(blob, \"data\")\n\n\t\t// run a forward pass thru the network\n\t\tprob := net.Forward(\"Mconv7_stage2_L2\")\n\n\t\tvar midx int\n\n\t\ts := prob.Size()\n\t\tnparts, h, w := s[1], s[2], s[3]\n\n\t\t// find out, which model we have\n\t\tswitch nparts {\n\t\tcase 19:\n\t\t\t// COCO body\n\t\t\tmidx = 0\n\t\t\tnparts = 18 // skip background\n\t\tcase 16:\n\t\t\t// MPI body\n\t\t\tmidx = 1\n\t\t\tnparts = 15 // skip background\n\t\tcase 22:\n\t\t\t// hand\n\t\t\tmidx = 2\n\t\tdefault:\n\t\t\tfmt.Println(\"there should be 19 parts for the COCO model, 16 for MPI, or 22 for the hand model\")\n\t\t\treturn\n\t\t}\n\n\t\t// find the most likely match for each part\n\t\tpts := make([]image.Point, 22)\n\t\tfor i := 0; i < nparts; i++ {\n\t\t\tpts[i] = image.Pt(-1, -1)\n\t\t\theatmap, _ := prob.FromPtr(h, w, gocv.MatTypeCV32F, 0, i)\n\n\t\t\t_, maxVal, _, maxLoc := gocv.MinMaxLoc(heatmap)\n\n\t\t\tif maxVal > 0.1 {\n\t\t\t\tpts[i] = maxLoc\n\t\t\t}\n\t\t\theatmap.Close()\n\t\t}\n\n\t\t// determine scale factor\n\t\tsX := int(float32(frame.Cols()) / float32(w))\n\t\tsY := int(float32(frame.Rows()) / float32(h))\n\n\t\t// create the results array of pairs of points with the lines that best fit\n\t\t// each body part, e.g.\n\t\t// [[point A for body part 1, point B for body part 1],\n\t\t// [point A for body part 2, point B for body part 2], ...]\n\t\tresults := [][]image.Point{}\n\t\tfor _, p := range PosePairs[midx] {\n\t\t\ta := pts[p[0]]\n\t\t\tb := pts[p[1]]\n\n\t\t\t// high enough confidence in this pose?\n\t\t\tif a.X <= 0 || a.Y <= 0 || b.X <= 0 || b.Y <= 0 {\n\t\t\t\tresults = append(results, []image.Point{})\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// scale to image size\n\t\t\ta.X *= sX\n\t\t\ta.Y *= sY\n\t\t\tb.X *= sX\n\t\t\tb.Y *= sY\n\n\t\t\tresults = append(results, []image.Point{a, b})\n\t\t}\n\t\tprob.Close()\n\t\tblob.Close()\n\t\tframe.Close()\n\n\t\t// send pose results in channel\n\t\tposes <- results\n\t}\n}", "title": "" }, { "docid": "3bc4c8f5e445819809f2bdd4989ee401", "score": "0.4303916", "text": "func main() {\n\toak.AddScene(\"demo\", scene.Scene{Start: func(ctx *scene.Context) {\n\t\trender.Draw(render.NewDrawFPS(0.03, nil, 10, 10))\n\n\t\tchar := entities.NewMoving(200, 200, 50, 50, render.NewColorBox(50, 50, color.RGBA{125, 125, 0, 255}), nil, 0, 1)\n\t\tchar.Speed = physics.NewVector(3, 3)\n\n\t\toak.SetViewportBounds(intgeom.NewRect2(0, 0, xLimit, yLimit))\n\t\tmoveRect := floatgeom.NewRect2(0, 0, xLimit, yLimit)\n\n\t\tchar.Bind(event.Enter, func(event.CID, interface{}) int {\n\t\t\tmove.WASD(char)\n\t\t\tmove.Limit(char, moveRect)\n\t\t\tmove.CenterScreenOn(char)\n\t\t\treturn 0\n\t\t})\n\t\trender.Draw(char.R, 1, 2)\n\n\t\t// Create the Radar\n\t\tcenter := radar.Point{X: char.Xp(), Y: char.Yp()}\n\t\tpoints := make(map[radar.Point]color.Color)\n\t\tw := 100\n\t\th := 100\n\t\tr := radar.NewRadar(w, h, points, center, 10)\n\t\tr.SetPos(float64(ctx.Window.Width()-w), 0)\n\n\t\tfor i := 0; i < 5; i++ {\n\t\t\tx, y := rand.Float64()*400, rand.Float64()*400\n\t\t\tenemy := newEnemyOnRadar(x, y)\n\t\t\tenemy.CID.Bind(event.Enter, standardEnemyMove)\n\t\t\trender.Draw(enemy.R, 1, 1)\n\t\t\tr.AddPoint(radar.Point{X: enemy.Xp(), Y: enemy.Yp()}, color.RGBA{255, 255, 0, 255})\n\t\t}\n\n\t\trender.Draw(r, 2)\n\n\t\tfor x := 0; x < xLimit; x += 64 {\n\t\t\tfor y := 0; y < yLimit; y += 64 {\n\t\t\t\tr := uint8(rand.Intn(120))\n\t\t\t\tb := uint8(rand.Intn(120))\n\t\t\t\tcb := render.NewColorBox(64, 64, color.RGBA{r, 0, b, 255})\n\t\t\t\tcb.SetPos(float64(x), float64(y))\n\t\t\t\trender.Draw(cb, 0)\n\t\t\t}\n\t\t}\n\n\t}})\n\n\trender.SetDrawStack(\n\t\trender.NewCompositeR(),\n\t\trender.NewDynamicHeap(),\n\t\trender.NewStaticHeap(),\n\t)\n\toak.Init(\"demo\")\n}", "title": "" }, { "docid": "3bd4e7383e9367af9a6a50ec4d46affc", "score": "0.4303487", "text": "func (t *Tree) RayCast(x, y, degrees, length float64) []Point {\n\tresults := []Point{}\n\tresultHash := make(map[*Space]bool)\n\n\ts := math.Sin(degrees * math.Pi / 180)\n\tc := math.Cos(degrees * math.Pi / 180)\n\tfor i := 0.0; i < length; i++ {\n\t\tloc := NewRect(x, y, .1, .1)\n\n\t\tnext := t.SearchIntersect(loc)\n\n\t\tfor k := 0; k < len(next); k++ {\n\t\t\tnx := (next[k].(*Space))\n\t\t\tif _, ok := resultHash[nx]; !ok {\n\t\t\t\tresultHash[nx] = true\n\t\t\t\tresults = append(results, NewPoint(nx, x, y))\n\t\t\t}\n\t\t}\n\t\tx += c\n\t\ty += s\n\t}\n\treturn results\n}", "title": "" }, { "docid": "a7d2c1f28a12338045da1a3933a3b554", "score": "0.42606142", "text": "func (edge B2EdgeShape) RayCast(output *B2RayCastOutput, input B2RayCastInput, xf B2Transform, childIndex int) bool {\n\n\t// Put the ray into the edge's frame of reference.\n\tp1 := B2RotVec2MulT(xf.Q, B2Vec2Sub(input.P1, xf.P))\n\tp2 := B2RotVec2MulT(xf.Q, B2Vec2Sub(input.P2, xf.P))\n\td := B2Vec2Sub(p2, p1)\n\n\tv1 := edge.M_vertex1\n\tv2 := edge.M_vertex2\n\te := B2Vec2Sub(v2, v1)\n\tnormal := MakeB2Vec2(e.Y, -e.X)\n\tnormal.Normalize()\n\n\t// q = p1 + t * d\n\t// dot(normal, q - v1) = 0\n\t// dot(normal, p1 - v1) + t * dot(normal, d) = 0\n\tnumerator := B2Vec2Dot(normal, B2Vec2Sub(v1, p1))\n\tdenominator := B2Vec2Dot(normal, d)\n\n\tif denominator == 0.0 {\n\t\treturn false\n\t}\n\n\tt := numerator / denominator\n\tif t < 0.0 || input.MaxFraction < t {\n\t\treturn false\n\t}\n\n\tq := B2Vec2Add(p1, B2Vec2MulScalar(t, d))\n\n\t// q = v1 + s * r\n\t// s = dot(q - v1, r) / dot(r, r)\n\tr := B2Vec2Sub(v2, v1)\n\trr := B2Vec2Dot(r, r)\n\tif rr == 0.0 {\n\t\treturn false\n\t}\n\n\ts := B2Vec2Dot(B2Vec2Sub(q, v1), r) / rr\n\tif s < 0.0 || 1.0 < s {\n\t\treturn false\n\t}\n\n\toutput.Fraction = t\n\tif numerator > 0.0 {\n\t\toutput.Normal = B2RotVec2Mul(xf.Q, normal).OperatorNegate()\n\t} else {\n\t\toutput.Normal = B2RotVec2Mul(xf.Q, normal)\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "bec12499c8ca3175b82665eee4c45d85", "score": "0.42058674", "text": "func main() {\n\t// Create an array of channels for each worker to report it's coordinates. This is analogous to the RedPoint badges.\n\tvar walkChannels []chan jobsite.Coords\n\t// Create an array of workers. Each worker has a walkChannel to notify channel receivers about new position.\n\tvar workers []jobsite.Worker\n\t// Done channel is created so that program doesn't immediately exit starting last GoRoutine\n\tdone := make(chan bool)\n\n\tfor i := 0; i < jobsite.NUM_WORKERS; i++ {\n\t\t// Create a walk chan for each worker and append it to the walkChannels array\n\t\twalkChan := make(chan jobsite.Coords)\n\t\twalkChannels = append(walkChannels, walkChan)\n\n\t\t// Give each worker a random initial coordinate\n\t\trandX := rand.Intn(jobsite.GRID_WIDTH)\n\t\trandY := rand.Intn(jobsite.GRID_LENGTH)\n\n\t\t// Create a new worker. Interval defines how long the worker waits between each walk.\n\t\tworker:= jobsite.Worker{\n\t\t\tCurrentCoords: []int{randX,randY},\n\t\t\tWalkChannel:walkChan,\n\t\t\tInterval: time.Duration(rand.Intn(500) + 500) * time.Millisecond,\n\t\t}\n\n\t\t// Append worker to worker array\n\t\tworkers = append(workers, worker)\n\n\t\t// Start a goroutine for the worker to start walking. Loop will start NUM_WORKERS number of GoRoutines.\n\t\tgo worker.StartWalking()\n\t}\n\n\t// Create channel for Render to pass number of workers currently in cone.\n\talertChan := make(chan int)\n\t// Create channel for Render to pass true if there are 0 in the cone\n\tallGoodChan := make(chan bool)\n\n\t// Start Render goroutine\n\tgo render.Render(walkChannels, jobsite.Cone{4,8,4,8}, alertChan, allGoodChan)\n\n\t// Start anonymous routine to print numWorkers whenever a val is passed through alertChan\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\t\tcase numWorkers := <- alertChan:\n\t\t\t\t\tfmt.Printf(\"\\033[3;1H\")\n\t\t\t\t\tfmt.Printf(\" %d workers in the cone \\n\", numWorkers)\n\t\t\t\tcase <- allGoodChan:\n\t\t\t\t\tfmt.Printf(\"\\033[3;1H\")\n\t\t\t\t\tfmt.Printf(\" Alright, alright, alright\\n\")\n\t\t\t}\n\t\t}\n\n\t}()\n\t// GoRoutines continue execution until done (which is never)\n\t// Quit using ctrl-C\n\t<- done\n}", "title": "" }, { "docid": "42a9bd2abf96a4fdd34a03995369a5ee", "score": "0.41939676", "text": "func (c Perspective) Cast(random *rand.Rand, x, y float64) pathtracer.Ray {\n\t// Find origin vector (relative to 0,0,0) from the fieldOfView.\n\tfieldOfViewRadians := c.fieldOfView * math.Pi / 180\n\n\t// Find the direction for the x, y coordinate by using FOV as 100%.\n\tm := pathtracer.IdentityMatrix()\n\tm = m.Rotate(pathtracer.AxisX, y*fieldOfViewRadians)\n\tm = m.Rotate(pathtracer.AxisY, x*fieldOfViewRadians)\n\n\tdirection := pathtracer.AxisZ.Transform(m)\n\n\t// Find the final position for the ray's origin based on the circle\n\t// created by the camera's field of view.\n\tfocalLength := 1 / fieldOfViewRadians\n\tcenter := pathtracer.Vector{X: 0, Y: 0, Z: focalLength * -1}\n\n\t// Where the pixel rests in 3D space on the lens of the camera.\n\torigin := center.Add(direction.Scale(focalLength))\n\n\tray := pathtracer.Ray{\n\t\tOrigin: origin,\n\t\tDirection: direction,\n\t}\n\n\t// Includes translation, rotation, and scale of the camera.\n\tray = ray.Transform(c.transformationMatrix)\n\n\tif c.depthOfFieldRadius >= pathtracer.EPS {\n\t\t// Slide the origin up to the part of the environment we want to be\n\t\t// in complete focus. Do this now while we have the\n\t\tfocalOrigin := ray.Origin.Add(ray.Direction.Scale(c.depthOfFieldDistance))\n\n\t\t// Create a vector perpendicular to the ray direction.\n\t\tperpendicularAxis := arbitraryOrthogonal(ray.Direction).Normalize()\n\n\t\t// Rotate the perpendicular vector around the ray by some random\n\t\t// amount. This is important to ensure that samples are taken from\n\t\t// all directions surrounding the focal target.\n\t\tm = pathtracer.IdentityMatrix()\n\t\tm = m.Rotate(ray.Direction, 2*math.Pi*random.Float64())\n\t\tperpendicularAxis = perpendicularAxis.Transform(m)\n\n\t\t// Adjust the direction of the ray as if it were cast from a circle\n\t\t// around its original place on the lens.\n\t\tm = pathtracer.IdentityMatrix()\n\t\tm = m.Rotate(perpendicularAxis, math.Atan2(c.depthOfFieldRadius, c.depthOfFieldDistance))\n\t\tdirection = ray.Direction.Transform(m)\n\n\t\t// Slide the origin back down to the lens, using the new focal\n\t\t// direction.\n\t\torigin = focalOrigin.Subtract(direction.Scale(c.depthOfFieldDistance))\n\n\t\tray = pathtracer.Ray{\n\t\t\tOrigin: origin,\n\t\t\tDirection: direction,\n\t\t}\n\t}\n\n\treturn ray\n}", "title": "" }, { "docid": "2cd8ba77aafa0e4413a97ee5b53af855", "score": "0.41752642", "text": "func (me *XsdGoPkgHasElem_conechoicesequencesurface_typeschema_Cone_TconeType_) Walk() (err error) {\r\n\tif fn := WalkHandlers.XsdGoPkgHasElem_conechoicesequencesurface_typeschema_Cone_TconeType_; me != nil {\r\n\t\tif fn != nil {\r\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\tif err = me.Cone.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif fn != nil {\r\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "f27ba411da60c6641d535d5bf18008a0", "score": "0.41611296", "text": "func gfxLoop(w window.Window, r gfx.Renderer) {\n\t// Setup a camera to use a perspective projection.\n\tcamera := gfx.NewCamera()\n\tcamNear := 0.01\n\tcamFar := 1000.0\n\tcamera.SetOrtho(r.Bounds(), camNear, camFar)\n\n\t// Move the camera back two units away from the card.\n\tcamera.SetPos(lmath.Vec3{0, -2, 0})\n\n\t// Create a simple shader.\n\tshader := mustLoadShader(\n\t\t\"SimpleShader\",\n\t\tabsPath(\"azul3d_ttf/shader.vert\"),\n\t\tabsPath(\"azul3d_ttf/shader.frag\"),\n\t)\n\n\t// Create a card mesh.\n\tvar font text.Font\n\tvar err error\n\tfont, err = text.LoadFontFile(absPath(\"assets/fonts/vera/Vera.ttf\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ttxt, err := text.New(font, \"`Hello World!\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ttxt.Object.Shader = shader\n\n\t/*\n\t\tbuf := truetype.NewGlyphBuf()\n\t\terr = buf.Load(font, font.FUnitsPerEm(), font.Index('T'), truetype.NoHinting)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\ttextMesh := gfx.NewMesh()\n\t\ttess := text.NewTess()\n\t\ttess.AppendGlyph(textMesh, font, 'T')\n\n\t\t// Create a card object.\n\t\tcard := gfx.NewObject()\n\t\tcard.AlphaMode = gfx.AlphaToCoverage\n\t\tcard.FaceCulling = gfx.NoFaceCulling\n\t\tcard.Shader = shader\n\t\tcard.Meshes = []*gfx.Mesh{textMesh}\n\n\n\t\t\t\t\t\terr = buf.Load(font, font.FUnitsPerEm(), font.Index(ev.Rune), truetype.NoHinting)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tlog.Fatal(err)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttextMesh := gfx.NewMesh()\n\t\t\t\t\t\ttext.AppendMesh(buf, textMesh)\n\n\t\t\t\t\t\ttextMesh := gfx.NewMesh()\n\t\t\t\t\t\ttess := text.NewTess()\n\t\t\t\t\t\ttess.Append(textMesh, font, 'T')\n\n\t\t\t\t\t\tcard.Lock()\n\t\t\t\t\t\tcard.Meshes = []*gfx.Mesh{textMesh}\n\t\t\t\t\t\tcard.Unlock()\n\t*/\n\n\tgo func() {\n\t\tfor e := range w.Events() {\n\t\t\tswitch ev := e.(type) {\n\t\t\tcase chippy.ResizedEvent:\n\t\t\t\t// Update the camera's projection matrix for the new width and\n\t\t\t\t// height.\n\t\t\t\tcamera.Lock()\n\t\t\t\tcamera.SetOrtho(r.Bounds(), camNear, camFar)\n\t\t\t\tcamera.Unlock()\n\t\t\tcase keyboard.TypedEvent:\n\t\t\t\tif ev.Rune == 'r' {\n\t\t\t\t\ttxt.Lock()\n\t\t\t\t\ttxt.Shader.Lock()\n\t\t\t\t\ttxt.Shader.Reset()\n\t\t\t\t\tloadShaderSources(\n\t\t\t\t\t\ttxt.Shader,\n\t\t\t\t\t\tabsPath(\"azul3d_ttf/shader.vert\"),\n\t\t\t\t\t\tabsPath(\"azul3d_ttf/shader.frag\"),\n\t\t\t\t\t)\n\t\t\t\t\ttxt.Shader.Unlock()\n\t\t\t\t\ttxt.Unlock()\n\n\t\t\t\t} else if ev.Rune == 'b' {\n\t\t\t\t\ttxt.Shader.Lock()\n\n\t\t\t\t\tvar enabled bool\n\t\t\t\t\tv, ok := txt.Shader.Inputs[\"Enabled\"]\n\t\t\t\t\tif ok {\n\t\t\t\t\t\tenabled = v.(bool)\n\t\t\t\t\t}\n\t\t\t\t\ttxt.Shader.Inputs[\"Enabled\"] = !enabled\n\t\t\t\t\ttxt.Shader.Unlock()\n\t\t\t\t} else {\n\t\t\t\t\ttxt.Set(string(ev.Rune))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\tfor {\n\t\t// Center the card in the window.\n\t\tb := r.Bounds()\n\t\ttxt.SetPos(lmath.Vec3{float64(b.Dx()) / 2.0, 0, float64(b.Dy()) / 2.0})\n\n\t\t// Scale the card to fit the window.\n\t\ts := float64(b.Dy()) / 2.0 // Card is two units wide, so divide by two.\n\t\ttxt.SetScale(lmath.Vec3{s, s, s})\n\n\t\t// Clear the entire area (empty rectangle means \"the whole area\").\n\t\tr.Clear(image.Rect(0, 0, 0, 0), gfx.Color{.7, .7, .7, .7})\n\t\tr.ClearDepth(image.Rect(0, 0, 0, 0), 1.0)\n\n\t\t//h := b.Dy() / 2.0\n\t\t//r.Clear(image.Rect(b.Min.X, h-5, b.Max.X, h), gfx.Color{0, 0, 1, 1})\n\n\t\t// Draw the textured card.\n\t\tr.Draw(image.Rect(0, 0, 0, 0), txt.Object, camera)\n\n\t\t// Render the whole frame.\n\t\tr.Render()\n\t}\n}", "title": "" }, { "docid": "4f2b9194563b2010868e2e91b977339b", "score": "0.4074027", "text": "func (sw sidewinder) On(grid maze.Grid) {\n\tfor _, row := range grid.EachRow() {\n\t\trun := make([]*maze.Cell, 0, len(row))\n\n\t\tfor _, cell := range row {\n\t\t\trun = append(run, cell)\n\n\t\t\tatEasternBoundary := cell.East == nil\n\t\t\tatNorthanBoundary := cell.North == nil\n\n\t\t\tshouldCloseOut := atEasternBoundary ||\n\t\t\t\t(!atNorthanBoundary && sw.r.Intn(2) == 0)\n\n\t\t\tif shouldCloseOut {\n\t\t\t\tidx := sw.r.Intn(len(run))\n\t\t\t\tmember := run[idx]\n\t\t\t\tif member.North != nil {\n\t\t\t\t\tmember.Link(member.North)\n\t\t\t\t}\n\t\t\t\trun = run[:0]\n\t\t\t} else {\n\t\t\t\tcell.Link(cell.East)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "134a662eeb95489189f52359e6f938db", "score": "0.40489414", "text": "func RunSingleLaneSimulation(simulation *SingleLaneSimulation) {\n\tdefer simulation.close()\n\tlane := simulation.Lane\n\tmoveCarsInLane := simulation.moveCarsInLane\n\tmoveCarsEndLane := simulation.moveCarsEndLane\n\tcarClock := simulation.carClock\n\tdrawUpdateChan := simulation.drawUpdateChan\n\n\tgo moveCarsThroughBins(lane, moveCarsInLane, true)\n\tgo moveCarsThroughBins(lane, moveCarsEndLane, false)\n\t//go MoveCarInLane(Lane, moveCarsEndLane)\n\n\tfor {\n\t\tif len(lane.Locations[lane.sizeOfLane-1].Cars) == lane.sizeOfLane {\n\t\t\treturn\n\t\t}\n\n\t\tselect {\n\t\tcase inBin := <-moveCarsInLane:\n\t\t\tvar firstLoc = inBin.Locations[0]\n\t\t\tvar secondLoc = inBin.Locations[1]\n\t\t\tif len(firstLoc.Cars) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// next spot isn't free\n\t\t\tif len(secondLoc.Cars) != 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcurrCar := getCarFromLocation(&firstLoc, true)\n\t\t\tcurrCar.lanePos = 1\n\t\t\tsecondLoc.Cars[currCar.id] = currCar\n\t\t\tgo MoveCarInLane(currCar, carClock)\n\t\t\tdrawUpdateChan <- true\n\t\t\tbreak\n\t\tcase outBin := <-moveCarsEndLane:\n\t\t\tvar secondToLastLoc = outBin.Locations[len(outBin.Locations)-2]\n\t\t\tvar lastLoc = outBin.Locations[len(outBin.Locations)-1]\n\t\t\tif len(secondToLastLoc.Cars) == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcurrCar := getCarFromLocation(&secondToLastLoc, true)\n\t\t\tlastLoc.Cars[currCar.id] = currCar\n\t\t\tdrawUpdateChan <- true\n\t\t\tbreak\n\t\tcase car := <-carClock:\n\t\t\tif car.lanePos == car.lane.sizeOfLane-2 {\n\t\t\t\tbreak // last position do nothing\n\t\t\t}\n\t\t\tvar currLoc = car.lane.Locations[car.lanePos]\n\t\t\tvar nextLoc = car.lane.Locations[car.lanePos+1]\n\t\t\tif len(nextLoc.Cars) != 0 {\n\t\t\t\tgo MoveCarInLane(car, carClock) // If next position blocked, attempt to move again on a exponential clock\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tnextLoc.Cars[car.id] = car\n\t\t\tdelete(currLoc.Cars, car.id) // remove the car from the current Lane\n\t\t\tcar.lanePos++\n\t\t\tgo MoveCarInLane(car, carClock)\n\t\t\tdrawUpdateChan <- true\n\t\t\tbreak\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2d089a198794a629365ffeab2335f799", "score": "0.40322864", "text": "func B2CollideEdgeAndCircle(manifold *B2Manifold, edgeA *B2EdgeShape, xfA B2Transform, circleB *B2CircleShape, xfB B2Transform) {\n\tmanifold.PointCount = 0\n\n\t// Compute circle in frame of edge\n\tQ := B2TransformVec2MulT(xfA, B2TransformVec2Mul(xfB, circleB.M_p))\n\n\tA := edgeA.M_vertex1\n\tB := edgeA.M_vertex2\n\te := B2Vec2Sub(B, A)\n\n\t// Normal points to the right for a CCW winding\n\tn := MakeB2Vec2(e.Y, -e.X)\n\toffset := B2Vec2Dot(n, B2Vec2Sub(Q, A))\n\n\toneSided := edgeA.M_oneSided\n\tif oneSided && offset < 0.0 {\n\t\treturn\n\t}\n\n\t// Barycentric coordinates\n\tu := B2Vec2Dot(e, B2Vec2Sub(B, Q))\n\tv := B2Vec2Dot(e, B2Vec2Sub(Q, A))\n\n\tradius := edgeA.M_radius + circleB.M_radius\n\n\tcf := MakeB2ContactFeature()\n\tcf.IndexB = 0\n\tcf.TypeB = B2ContactFeature_Type.E_vertex\n\n\t// Region A\n\tif v <= 0.0 {\n\t\tP := A\n\t\td := B2Vec2Sub(Q, P)\n\t\tdd := B2Vec2Dot(d, d)\n\t\tif dd > radius*radius {\n\t\t\treturn\n\t\t}\n\n\t\t// Is there an edge connected to A?\n\t\tif edgeA.M_oneSided {\n\t\t\tA1 := edgeA.M_vertex0\n\t\t\tB1 := A\n\t\t\te1 := B2Vec2Sub(B1, A1)\n\t\t\tu1 := B2Vec2Dot(e1, B2Vec2Sub(B1, Q))\n\n\t\t\t// Is the circle in Region AB of the previous edge?\n\t\t\tif u1 > 0.0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tcf.IndexA = 0\n\t\tcf.TypeA = B2ContactFeature_Type.E_vertex\n\t\tmanifold.PointCount = 1\n\t\tmanifold.Type = B2Manifold_Type.E_circles\n\t\tmanifold.LocalNormal.SetZero()\n\t\tmanifold.LocalPoint = P\n\t\tmanifold.Points[0].Id.SetKey(0)\n\t\tmanifold.Points[0].Id.IndexA = cf.IndexA\n\t\tmanifold.Points[0].Id.IndexB = cf.IndexB\n\t\tmanifold.Points[0].Id.TypeA = cf.TypeA\n\t\tmanifold.Points[0].Id.TypeB = cf.TypeB\n\t\tmanifold.Points[0].LocalPoint = circleB.M_p\n\t\treturn\n\t}\n\n\t// Region B\n\tif u <= 0.0 {\n\t\tP := B\n\t\td := B2Vec2Sub(Q, P)\n\t\tdd := B2Vec2Dot(d, d)\n\t\tif dd > radius*radius {\n\t\t\treturn\n\t\t}\n\n\t\t// Is there an edge connected to B?\n\t\tif edgeA.M_oneSided {\n\t\t\tB2 := edgeA.M_vertex3\n\t\t\tA2 := B\n\t\t\te2 := B2Vec2Sub(B2, A2)\n\t\t\tv2 := B2Vec2Dot(e2, B2Vec2Sub(Q, A2))\n\n\t\t\t// Is the circle in Region AB of the next edge?\n\t\t\tif v2 > 0.0 {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tcf.IndexA = 1\n\t\tcf.TypeA = B2ContactFeature_Type.E_vertex\n\t\tmanifold.PointCount = 1\n\t\tmanifold.Type = B2Manifold_Type.E_circles\n\t\tmanifold.LocalNormal.SetZero()\n\t\tmanifold.LocalPoint = P\n\t\tmanifold.Points[0].Id.SetKey(0)\n\t\tmanifold.Points[0].Id.IndexA = cf.IndexA\n\t\tmanifold.Points[0].Id.IndexB = cf.IndexB\n\t\tmanifold.Points[0].Id.TypeA = cf.TypeA\n\t\tmanifold.Points[0].Id.TypeB = cf.TypeB\n\t\tmanifold.Points[0].LocalPoint = circleB.M_p\n\t\treturn\n\t}\n\n\t// Region AB\n\tden := B2Vec2Dot(e, e)\n\tB2Assert(den > 0.0)\n\tP := B2Vec2MulScalar(1.0/den, B2Vec2Add(B2Vec2MulScalar(u, A), B2Vec2MulScalar(v, B)))\n\td := B2Vec2Sub(Q, P)\n\tdd := B2Vec2Dot(d, d)\n\tif dd > radius*radius {\n\t\treturn\n\t}\n\n\tif offset < 0.0 {\n\t\tn.Set(-n.X, -n.Y)\n\t}\n\tn.Normalize()\n\n\tcf.IndexA = 0\n\tcf.TypeA = B2ContactFeature_Type.E_face\n\tmanifold.PointCount = 1\n\tmanifold.Type = B2Manifold_Type.E_faceA\n\tmanifold.LocalNormal = n\n\tmanifold.LocalPoint = A\n\tmanifold.Points[0].Id.SetKey(0)\n\tmanifold.Points[0].Id.IndexA = cf.IndexA\n\tmanifold.Points[0].Id.IndexB = cf.IndexB\n\tmanifold.Points[0].Id.TypeA = cf.TypeA\n\tmanifold.Points[0].Id.TypeB = cf.TypeB\n\tmanifold.Points[0].LocalPoint = circleB.M_p\n}", "title": "" }, { "docid": "bc5a904a79203432b52caf59739e6548", "score": "0.40135086", "text": "func (drv *DockerDriver) nanny(ctx context.Context, container string) {\n\tselect {\n\tcase <-ctx.Done():\n\t\tif *(ctx.Value(completeKey).(*bool)) {\n\t\t\treturn\n\t\t}\n\t\tdrv.cancel(container)\n\t}\n}", "title": "" }, { "docid": "d60e8fc6b882166849a0b31b31f764fe", "score": "0.3969837", "text": "func (m *manifold) solveCircleToCircle() {\n\tbodyA := m.BodyA\n\tbodyB := m.BodyB\n\n\t// Calculate translational vector, which is normal\n\tnormal := rl.Vector2Subtract(bodyB.Position, bodyA.Position)\n\n\tdistSqr := rl.Vector2LenSqr(normal)\n\tradius := bodyA.Shape.Radius + bodyB.Shape.Radius\n\n\t// Check if circles are not in contact\n\tif distSqr >= radius*radius {\n\t\tm.ContactsCount = 0\n\t\treturn\n\t}\n\n\tdistance := float32(math.Sqrt(float64(distSqr)))\n\tm.ContactsCount = 1\n\n\tif distance == 0 {\n\t\tm.Penetration = bodyA.Shape.Radius\n\t\tm.Normal = rl.NewVector2(1, 0)\n\t\tm.Contacts[0] = bodyA.Position\n\t} else {\n\t\tm.Penetration = radius - distance\n\t\tm.Normal = rl.NewVector2(normal.X/distance, normal.Y/distance) // Faster than using normalize() due to sqrt is already performed\n\t\tm.Contacts[0] = rl.NewVector2(m.Normal.X*bodyA.Shape.Radius+bodyA.Position.X, m.Normal.Y*bodyA.Shape.Radius+bodyA.Position.Y)\n\t}\n\n\t// Update physics body grounded state if normal direction is down\n\tif !bodyA.IsGrounded {\n\t\tbodyA.IsGrounded = (m.Normal.Y < 0)\n\t}\n}", "title": "" }, { "docid": "610f41701b5d3fc6c31d676a54d8a82b", "score": "0.39609298", "text": "func BenchmarkReflectCall(b *testing.B) {\n\tfor n := 0; n < b.N; n++ {\n\t\thandlerV.Call([]reflect.Value{argV})\n\t}\n}", "title": "" }, { "docid": "18bbeed0c3c15aaff0c4319ebd505bef", "score": "0.39303127", "text": "func (ed *Loop) Run() (buffer string, err error) {\n\tfor {\n\t\tvar redrawFlag RedrawFlag\n\t\tif ed.extractRedrawFull() {\n\t\t\tredrawFlag |= FullRedraw\n\t\t}\n\t\ted.redrawCb(redrawFlag)\n\t\tselect {\n\t\tcase event := <-ed.inputCh:\n\t\t\t// Consume all events in the channel to minimize redraws.\n\t\tconsumeAllEvents:\n\t\t\tfor {\n\t\t\t\tbuffer, quit := ed.handleCb(event)\n\t\t\t\tif quit {\n\t\t\t\t\ted.redrawCb(FinalRedraw)\n\t\t\t\t\treturn buffer, nil\n\t\t\t\t}\n\t\t\t\tselect {\n\t\t\t\tcase event = <-ed.inputCh:\n\t\t\t\t\t// Continue the loop of consuming all events.\n\t\t\t\tdefault:\n\t\t\t\t\tbreak consumeAllEvents\n\t\t\t\t}\n\t\t\t}\n\t\tcase <-ed.redrawCh:\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0a71a9e24c0f71f084acd0bf2456c9aa", "score": "0.3905961", "text": "func (o *CSGCylinder) IsCone() gdnative.Bool {\n\t//log.Println(\"Calling CSGCylinder.IsCone()\")\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(\"CSGCylinder\", \"is_cone\")\n\n\t// Call the parent method.\n\t// bool\n\tretPtr := gdnative.NewEmptyBool()\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.NewBoolFromPointer(retPtr)\n\treturn ret\n}", "title": "" }, { "docid": "e02c0fff1fe40ec07dfd1ebbd220d6f6", "score": "0.38824618", "text": "func (l *Labeler) Run(ctx context.Context) {\n\tbc := make(chan []byte)\n\tgo func() {\n\t\tdefer close(bc)\n\touter:\n\t\tfor {\n\t\t\tvar buf []byte\n\t\t\tmprctx, cancel := context.WithCancel(ctx)\n\t\t\tdefer cancel()\n\t\t\tmpr, err := readerFromURL(mprctx, l.src)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"failed to create reader from stream source: %v\\n\", err)\n\t\t\t\tlog.Println(\"trying again in 5 seconds\")\n\t\t\t\tselect {\n\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\treturn\n\t\t\t\tcase <-time.After(5 * time.Second):\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\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\tdefault:\n\t\t\t\t\tpart, err := mpr.NextPart()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"failed to decode next part: %v\\n\", err)\n\t\t\t\t\t\tcancel()\n\t\t\t\t\t\tcontinue outer\n\t\t\t\t\t}\n\t\t\t\t\tbuf, err = ioutil.ReadAll(part)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"failed to read part: %v\\n\", err)\n\t\t\t\t\t\tcancel()\n\t\t\t\t\t\tcontinue outer\n\t\t\t\t\t}\n\t\t\t\t\tselect {\n\t\t\t\t\tcase bc <- buf:\n\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tvar buf []byte\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase buf = <-bc:\n\t\t\t\tvar err error\n\t\t\t\tvar img []byte\n\t\t\t\tif l.label != \"\" {\n\t\t\t\t\t// A labeling endpoint was specified.\n\t\t\t\t\timg, err = labelImage(l.label, buf)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlog.Printf(\"failed to label image: %v\\n\", err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No labeling endpoint was specified.\n\t\t\t\t\timg = make([]byte, len(buf))\n\t\t\t\t\tcopy(img, buf)\n\t\t\t\t}\n\t\t\t\tl.stream.Update(img)\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "7b9650815ec96d23b711657910d14985", "score": "0.38791493", "text": "func (g *Game) generateObjectives(numCP int) {\n\tminX := math.MaxFloat64\n\tmaxX := -math.MaxFloat64\n\tminY := math.MaxFloat64\n\tmaxY := -math.MaxFloat64\n\tfor _, val := range g.Boundaries {\n\t\tif val.P.X < minX {\n\t\t\tminX = val.P.X\n\t\t}\n\t\tif val.P.X > maxX {\n\t\t\tmaxX = val.P.X\n\t\t}\n\t\tif val.P.Y < minY {\n\t\t\tminY = val.P.Y\n\t\t}\n\t\tif val.P.Y > maxY {\n\t\t\tmaxY = val.P.Y\n\t\t}\n\t}\n\txRange := maxX - minX\n\tyRange := maxY - minY\n\n\t// set up base locations for the two teams\n\tbaseRadius := BASERADIUS(xRange, yRange)\n\tg.RedTeam.BaseRadius = baseRadius\n\tg.BlueTeam.BaseRadius = baseRadius\n\txOffset := baseRadius + 2\n\tyOffset := baseRadius + 2\n\tif xRange < 36 {\n\t\txOffset = (xRange- baseRadius * 2) / 4 + baseRadius\n\t}\n\tif yRange < 36 {\n\t\tyOffset = (yRange- baseRadius * 2) / 4 + baseRadius\n\t}\n\tif xRange > yRange {\n\t\tmid := g.findCenter().Y\n\t\tg.RedTeam.Base = Location{maxX - xOffset, mid}\n\t\tg.BlueTeam.Base = Location{minX + xOffset, mid}\n\t\tfor !inGameBounds(g, g.RedTeam.Base) {\n\t\t\tg.RedTeam.Base.X -= 1\n\t\t}\n\t\tfor !inGameBounds(g, g.BlueTeam.Base) {\n\t\t\tg.BlueTeam.Base.X += 1\n\t\t}\n\t} else {\n\t\tmid := g.findCenter().X\n\t\tg.RedTeam.Base = Location{mid, maxY - yOffset}\n\t\tg.BlueTeam.Base = Location{mid, minY + yOffset}\n\t\tfor !inGameBounds(g, g.RedTeam.Base) {\n\t\t\tg.RedTeam.Base.Y -= 1\n\t\t}\n\t\tfor !inGameBounds(g, g.BlueTeam.Base) {\n\t\t\tg.BlueTeam.Base.Y += 1\n\t\t}\n\t}\n\n\t// make sure that control points and pickups don't intersect the bases\n\tminX += 2 * xOffset\n\tmaxX -= 2 * xOffset\n\tminY += 2 * yOffset\n\tmaxY -= 2 * yOffset\n\txRange = maxX - minX\n\tyRange = maxY - minY\n\n\t// set up control points\n\tcpRadius := CPRADIUS()\n\tg.ControlPoints = make(map[string]*ControlPoint)\n\tif g.Mode == MULTICAP {\n\t\t// make sure that control points don't intersect bases\n\t\txRangeM := xRange - 2 * cpRadius\n\t\tyRangeM := yRange - 2 * cpRadius\n\n\t\t// generate control points\n\t\trLock.Lock()\n\t\tgiveUp := numCP * 2\n\t\tfor i := 0; i < numCP; i++ {\n\t\t\tif giveUp < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tgiveUp--\n\t\t\tcpLoc := Location{minX + cpRadius + r.Float64() * xRangeM, minY + cpRadius + r.Float64() * yRangeM}\n\t\t\tif inGameBounds(g, cpLoc) && noIntersections(g, cpLoc, cpRadius) {\n\t\t\t\tid := \"CP\" + strconv.Itoa(i+1)\n\t\t\t\tcp := &ControlPoint{ID: id, Location: cpLoc, Radius: cpRadius}\n\t\t\t\tg.ControlPoints[id] = cp\n\t\t\t} else {\n\t\t\t\ti-- // if this location is invalid, decrement i so that it doesn't count towards numCP\n\t\t\t}\n\t\t}\n\t\trLock.Unlock()\n\t} else if g.Mode == SINGLECAP {\n\t\t// if there is only one control point, place it at the center of the arena\n\t\tg.ControlPoints[\"CP1\"] = &ControlPoint{ID: \"CP1\", Location: g.findCenter(), Radius: cpRadius}\n\t} else {\n\t\t// if there is a payload, place it on the midpoint of the line from the Red base to the Blue base\n\t\tcpLoc := Location{(g.RedTeam.Base.X + g.BlueTeam.Base.X) / 2, (g.RedTeam.Base.Y + g.BlueTeam.Base.Y) / 2}\n\t\tg.ControlPoints[\"Payload\"] = &ControlPoint{ID: \"Payload\", Location: cpLoc, Radius: cpRadius}\n\t\t// set PayloadSpeed and PayloadPath for the game\n\t\tg.PayloadSpeed = math.Min(xRange / 120, MAXSPEED())\n\t\tg.PayloadPath = Direction{X: g.BlueTeam.Base.X - g.RedTeam.Base.X, Y: g.BlueTeam.Base.Y - g.RedTeam.Base.Y}\n\t}\n\n\t// generate pickups\n\tdist := PICKUPDISTRIBUTION(xRange, yRange)\n\txSpread := (int)(math.Floor(xRange / dist))\n\tySpread := (int)(math.Floor(yRange / dist))\n\thalfRange := math.Min(xRange, yRange)/2\n\tfor i := 0; i < xSpread; i++ {\n\t\tfor j := 0; j < ySpread; j++ {\n\t\t\tgeneratePickup(g, minX+(float64)(i)*dist, minY+(float64)(j)*dist, halfRange, dist)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2e2f0662798cc69a1b15776f706d723c", "score": "0.38731143", "text": "func (c *Controller) Run() {\n\tpublishTimer := time.NewTicker(c.animationTime)\n\tfor {\n\t\tselect {\n\t\tcase <-publishTimer.C:\n\t\t\tc.cycleAnimation()\n\t\tcase start := <-c.calibrate.C:\n\t\t\tif start {\n\t\t\t\tc.cycling = false\n\t\t\t\tc.animation = c.calibrate\n\t\t\t\tfmt.Println(\"Started displaying calibration frames...\")\n\t\t\t} else {\n\t\t\t\tc.cycling = true\n\t\t\t\tc.cycleAnimation()\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d0648f0fd1696f1bfb6310801d341657", "score": "0.3870164", "text": "func (r *Reconciler) ReconcileKind(ctx context.Context, ing *v1alpha1.Ingress) reconciler.Event {\n\tif ann := ing.Annotations[networking.IngressClassAnnotationKey]; ann != ContourIngressClassName {\n\t\treturn nil\n\t}\n\ting.Status.InitializeConditions()\n\n\tif err := r.reconcileProxies(ctx, ing); err != nil {\n\t\treturn err\n\t}\n\n\ting.Status.ObservedGeneration = ing.Generation\n\treturn nil\n}", "title": "" }, { "docid": "06f7d0249c08cc394c6bdea665f33b9c", "score": "0.3850635", "text": "func gfxLoop(w window.Window, r gfx.Renderer) {\n\t// Setup a camera to use a perspective projection.\n\tcamera := gfx.NewCamera()\n\tcamNear := 0.01\n\tcamFar := 1000.0\n\tcamZoom := 1.0 // 1x zoom\n\tcamZoomSpeed := 0.01 // 0.01x zoom for each scroll wheel click.\n\tcamMinZoom := 0.1\n\n\t// updateCamera simply locks the camera, and calls setOrthoScale with the\n\t// values above, and then unlocks the camera.\n\tupdateCamera := func() {\n\t\tif camZoom < camMinZoom {\n\t\t\tcamZoom = camMinZoom\n\t\t}\n\t\tcamera.Lock()\n\t\tsetOrthoScale(camera, r.Bounds(), camZoom, camNear, camFar)\n\t\tcamera.Unlock()\n\t}\n\n\t// Update the camera now.\n\tupdateCamera()\n\n\t// Move the camera back two units away from the card.\n\tcamera.SetPos(lmath.Vec3{0, -2, 0})\n\n\t// Load TMX map file.\n\ttmxMap, layers, err := tmx.LoadFile(*mapFile, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Create an event mask for the events we are interested in.\n\tevMask := window.FramebufferResizedEvents\n\tevMask |= window.CursorMovedEvents\n\tevMask |= window.MouseEvents\n\tevMask |= window.KeyboardTypedEvents\n\n\t// Create a channel of events.\n\tevents := make(chan window.Event, 256)\n\n\t// Have the window notify our channel whenever events occur.\n\tw.Notify(events, evMask)\n\n\thandleEvents := func() {\n\t\tlimit := len(events)\n\t\tfor i := 0; i < limit; i++ {\n\t\t\te := <-events\n\t\t\tswitch ev := e.(type) {\n\t\t\tcase window.FramebufferResized:\n\t\t\t\t// Update the camera's to account for the new width and height.\n\t\t\t\tupdateCamera()\n\n\t\t\tcase mouse.Event:\n\t\t\t\tif ev.Button == mouse.Left && ev.State == mouse.Up {\n\t\t\t\t\t// Toggle mouse grab.\n\t\t\t\t\tprops := w.Props()\n\t\t\t\t\tprops.SetCursorGrabbed(!props.CursorGrabbed())\n\t\t\t\t\tw.Request(props)\n\t\t\t\t}\n\t\t\t\tif ev.Button == mouse.Wheel && ev.State == mouse.ScrollForward {\n\t\t\t\t\t// Zoom in, and update the camera.\n\t\t\t\t\tcamZoom -= camZoomSpeed\n\t\t\t\t\tupdateCamera()\n\t\t\t\t}\n\t\t\t\tif ev.Button == mouse.Wheel && ev.State == mouse.ScrollBack {\n\t\t\t\t\t// Zoom out, and update the camera.\n\t\t\t\t\tcamZoom += camZoomSpeed\n\t\t\t\t\tupdateCamera()\n\t\t\t\t}\n\n\t\t\tcase window.CursorMoved:\n\t\t\t\tif ev.Delta {\n\t\t\t\t\tp := lmath.Vec3{ev.X, 0, -ev.Y}\n\t\t\t\t\tcamera.Lock()\n\t\t\t\t\tcamera.SetPos(camera.Pos().Add(p))\n\t\t\t\t\tcamera.Unlock()\n\t\t\t\t}\n\n\t\t\tcase keyboard.TypedEvent:\n\t\t\t\tswitch ev.Rune {\n\t\t\t\tcase 'm':\n\t\t\t\t\t// Toggle MSAA now.\n\t\t\t\t\tmsaa := !r.MSAA()\n\t\t\t\t\tr.SetMSAA(msaa)\n\t\t\t\t\tfmt.Println(\"MSAA Enabled?\", msaa)\n\t\t\t\tcase 'r':\n\t\t\t\t\tcamera.Lock()\n\t\t\t\t\tcamera.SetPos(lmath.Vec3{0, -2, 0})\n\t\t\t\t\tcamera.Unlock()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor {\n\t\t// Handle events.\n\t\thandleEvents()\n\n\t\t// Clear the entire area (empty rectangle means \"the whole area\").\n\t\tr.Clear(image.Rect(0, 0, 0, 0), gfx.Color{1, 1, 1, 1})\n\t\tr.ClearDepth(image.Rect(0, 0, 0, 0), 1.0)\n\n\t\t// Draw the TMX map to the screen.\n\t\tfor _, layer := range tmxMap.Layers {\n\t\t\tobjects, ok := layers[layer.Name]\n\t\t\tif ok {\n\t\t\t\tfor _, obj := range objects {\n\t\t\t\t\tr.Draw(image.Rect(0, 0, 0, 0), obj, camera)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Render the whole frame.\n\t\tr.Render()\n\t}\n}", "title": "" }, { "docid": "926dccaa8a9d0963d16859ffac3652ea", "score": "0.38406906", "text": "func (m *manifold) solveCircleToPolygon() {\n\tm.ContactsCount = 0\n\n\t// Transform circle center to polygon transform space\n\tcenter := m.BodyA.Position\n\tcenter = rl.Mat2MultiplyVector2(rl.Mat2Transpose(m.BodyB.Shape.VertexData.Transform), rl.Vector2Subtract(center, m.BodyB.Position))\n\n\t// Find edge with minimum penetration\n\t// It is the same concept as using support points in solvePolygonToPolygon\n\tseparation := float32(-fltMax)\n\tfaceNormal := 0\n\tvertexData := m.BodyB.Shape.VertexData\n\n\tfor i := 0; i < vertexData.VertexCount; i++ {\n\t\tcurrentSeparation := rl.Vector2DotProduct(vertexData.Normals[i], rl.Vector2Subtract(center, vertexData.Vertices[i]))\n\n\t\tif currentSeparation > m.BodyA.Shape.Radius {\n\t\t\treturn\n\t\t}\n\n\t\tif currentSeparation > separation {\n\t\t\tseparation = currentSeparation\n\t\t\tfaceNormal = i\n\t\t}\n\t}\n\n\t// Grab face's vertices\n\tv1 := vertexData.Vertices[faceNormal]\n\tnextIndex := 0\n\tif faceNormal+1 < vertexData.VertexCount {\n\t\tnextIndex = faceNormal + 1\n\t}\n\tv2 := vertexData.Vertices[nextIndex]\n\n\t// Check to see if center is within polygon\n\tif separation < epsilon {\n\t\tm.ContactsCount = 1\n\t\tnormal := rl.Mat2MultiplyVector2(vertexData.Transform, vertexData.Normals[faceNormal])\n\t\tm.Normal = rl.NewVector2(-normal.X, -normal.Y)\n\t\tm.Contacts[0] = rl.NewVector2(m.Normal.X*m.BodyA.Shape.Radius+m.BodyA.Position.X, m.Normal.Y*m.BodyA.Shape.Radius+m.BodyA.Position.Y)\n\t\tm.Penetration = m.BodyA.Shape.Radius\n\t\treturn\n\t}\n\n\t// Determine which voronoi region of the edge center of circle lies within\n\tdot1 := rl.Vector2DotProduct(rl.Vector2Subtract(center, v1), rl.Vector2Subtract(v2, v1))\n\tdot2 := rl.Vector2DotProduct(rl.Vector2Subtract(center, v2), rl.Vector2Subtract(v1, v2))\n\tm.Penetration = m.BodyA.Shape.Radius - separation\n\n\tif dot1 <= 0 { // Closest to v1\n\t\tif rl.Vector2Distance(center, v1) > m.BodyA.Shape.Radius*m.BodyA.Shape.Radius {\n\t\t\treturn\n\t\t}\n\n\t\tm.ContactsCount = 1\n\t\tnormal := rl.Vector2Subtract(v1, center)\n\t\tnormal = rl.Mat2MultiplyVector2(vertexData.Transform, normal)\n\t\tnormalize(&normal)\n\t\tm.Normal = normal\n\t\tv1 = rl.Mat2MultiplyVector2(vertexData.Transform, v1)\n\t\tv1 = rl.Vector2Add(v1, m.BodyB.Position)\n\t\tm.Contacts[0] = v1\n\t} else if dot2 <= 0 { // Closest to v2\n\t\tif rl.Vector2Distance(center, v2) > m.BodyA.Shape.Radius*m.BodyA.Shape.Radius {\n\t\t\treturn\n\t\t}\n\n\t\tm.ContactsCount = 1\n\t\tnormal := rl.Vector2Subtract(v2, center)\n\t\tv2 = rl.Mat2MultiplyVector2(vertexData.Transform, v2)\n\t\tv2 = rl.Vector2Add(v2, m.BodyB.Position)\n\t\tm.Contacts[0] = v2\n\t\tnormal = rl.Mat2MultiplyVector2(vertexData.Transform, normal)\n\t\tnormalize(&normal)\n\t\tm.Normal = normal\n\t} else { // Closest to face\n\t\tnormal := vertexData.Normals[faceNormal]\n\n\t\tif rl.Vector2DotProduct(rl.Vector2Subtract(center, v1), normal) > m.BodyA.Shape.Radius {\n\t\t\treturn\n\t\t}\n\n\t\tnormal = rl.Mat2MultiplyVector2(vertexData.Transform, normal)\n\t\tm.Normal = rl.NewVector2(-normal.X, -normal.Y)\n\t\tm.Contacts[0] = rl.NewVector2(m.Normal.X*m.BodyA.Shape.Radius+m.BodyA.Position.X, m.Normal.Y*m.BodyA.Shape.Radius+m.BodyA.Position.Y)\n\t\tm.ContactsCount = 1\n\t}\n}", "title": "" }, { "docid": "430f2dd2a92dfee8ea6bd24acca5e6c4", "score": "0.382733", "text": "func (p *grpcProvisioner) translateLoop(ctx context.Context) {\n\tvar verInfo string\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase resp := <-p.recvCh:\n\t\t\tackReq := &discoveryv3.DiscoveryRequest{\n\t\t\t\tNode: p.node,\n\t\t\t\tTypeUrl: resp.TypeUrl,\n\t\t\t\tResponseNonce: resp.Nonce,\n\t\t\t}\n\t\t\t// RDS and EDS are not wildcard Url, so ResourceNames\n\t\t\t// field has to be set explicitly.\n\t\t\tif resp.TypeUrl == types.ClusterLoadAssignmentUrl {\n\t\t\t\tackReq.ResourceNames = p.edsRequiredClusters.Strings()\n\t\t\t} else if resp.TypeUrl == types.RouteConfigurationUrl {\n\t\t\t\tackReq.ResourceNames = make([]string, 0, len(p.routeOwnership))\n\t\t\t\tfor r := range p.routeOwnership {\n\t\t\t\t\tackReq.ResourceNames = append(ackReq.ResourceNames, r)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif err := p.translate(resp); err != nil {\n\t\t\t\tackReq.ErrorDetail = &status.Status{\n\t\t\t\t\tCode: int32(code.Code_INVALID_ARGUMENT),\n\t\t\t\t\tMessage: err.Error(),\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tverInfo = resp.VersionInfo\n\t\t\t}\n\t\t\tackReq.VersionInfo = verInfo\n\t\t\tp.sendCh <- ackReq\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a0e8ffd8da8e7e1acaedcc12cf5b1cb9", "score": "0.38262337", "text": "func (c *char) c1(delay int) {\n\tc.AddTask(func() {\n\t\tif (c.Base.Cons < 1) || ((c.c1LastProc + 180) >= c.Core.F) {\n\t\t} else {\n\t\t\tc.ReduceActionCooldown(core.ActionSkill, 60)\n\t\t\tc.c1LastProc = c.Core.F\n\t\t\tc.Core.Log.Debugw(\"sara c1 reducing E CD\", \"frame\", c.Core.F, \"event\", core.LogCharacterEvent, \"char\", c.Index, \"new_cooldown\", c.Cooldown(core.ActionSkill))\n\t\t}\n\t}, \"c1-proc\", delay)\n}", "title": "" }, { "docid": "57a017b0159665aa5a987a29a78fc107", "score": "0.38258645", "text": "func BenchmarkIterateRay(b *testing.B) {\n\tcellSize := 32\n\tgridSize := 100\n\tcoords := setupRaysData(b.N, gridSize)\n\n\tb.ResetTimer()\n\tfor i := 0; i < b.N; i++ {\n\t\tIterateRay(cellSize, gridSize, gridSize, coords[i][0], coords[i][1], coords[i][2], coords[i][3],\n\t\t\tfunc(tileX, tileY int, x, y float32) bool {\n\t\t\t\treturn true\n\t\t\t},\n\t\t)\n\t}\n}", "title": "" }, { "docid": "94ef5c93c59aac4936880f2d813b47d4", "score": "0.38222468", "text": "func run(file string) error {\n\tctx := context.Background()\n\n\t// Authenticate to generate a vision service\n\tclient, err := google.DefaultClient(ctx, vision.CloudPlatformScope)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice, err := vision.New(client)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Read the image\n\tb, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Construct a label request, encoding the image in base64\n\treq := &vision.AnnotateImageRequest{\n\t\tImage: &vision.Image{\n\t\t\tContent: base64.StdEncoding.EncodeToString(b),\n\t\t},\n\t\tFeatures: []*vision.Feature{\n\t\t\t{Type: \"TYPE_UNSPECIFIED\"},\n\t\t\t{Type: \"FACE_DETECTION\"},\n\t\t\t{Type: \"LANDMARK_DETECTION\"},\n\t\t\t{Type: \"LOGO_DETECTION\"},\n\t\t\t{Type: \"LABEL_DETECTION\"},\n\t\t\t{Type: \"TEXT_DETECTION\"},\n\t\t\t{Type: \"SAFE_SEARCH_DETECTION\"},\n\t\t\t{Type: \"IMAGE_PROPERTIES\"},\n\t\t},\n\t}\n\n\tbatch := &vision.BatchAnnotateImagesRequest{\n\t\tRequests: []*vision.AnnotateImageRequest{req},\n\t}\n\n\tres, err := service.Images.Annotate(batch).Do()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tp := func(j int, ann *vision.EntityAnnotation) {\n\t\tfmt.Printf(\"\\tFound: %d %s \\tscore: %v\\n\", j, ann.Description, ann.Score)\n\t\tjson, _ := ann.MarshalJSON()\n\t\tfmt.Printf(\"\\t\\t%s\\n\", json)\n\t}\n\tpf := func(j int, ann *vision.FaceAnnotation) {\n\t\tfmt.Printf(\"\\tFound: %d %s \\tscore: %v\\n\", j, ann.HeadwearLikelihood, ann.SurpriseLikelihood)\n\t\tjson, _ := ann.MarshalJSON()\n\t\tfmt.Printf(\"\\t\\t%s\\n\", json)\n\t}\n\tpi := func(ann *vision.ImageProperties) {\n\t\tfmt.Printf(\"\\tFound: %v\\n\", ann.DominantColors.Colors[0])\n\t\tjson, _ := ann.MarshalJSON()\n\t\tfmt.Printf(\"\\t\\t%s\\n\", json)\n\t}\n\n\tfor _, resp := range res.Responses {\n\t\tfmt.Printf(\"Labels for file: %s\\n\", file)\n\t\tfor j, ann := range resp.LabelAnnotations {\n\t\t\tp(j, ann)\n\t\t}\n\t\tfmt.Printf(\"Logo for file: %s\\n\", file)\n\t\tfor j, ann := range resp.LogoAnnotations {\n\t\t\tp(j, ann)\n\t\t}\n\t\tfmt.Printf(\"Text for file: %s\\n\", file)\n\t\tfor j, ann := range resp.TextAnnotations {\n\t\t\tp(j, ann)\n\t\t}\n\t\tfmt.Printf(\"Face for file: %s\\n\", file)\n\t\tfor j, ann := range resp.FaceAnnotations {\n\t\t\tpf(j, ann)\n\t\t}\n\t\tfmt.Printf(\"Landmark for file: %s\\n\", file)\n\t\tfor j, ann := range resp.LandmarkAnnotations {\n\t\t\tp(j, ann)\n\t\t}\n\t\tfmt.Printf(\"Image for file: %s\\n\", file)\n\t\tann := resp.ImagePropertiesAnnotation\n\t\tpi(ann)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "8deef1e92bcf9da2af2cae66040b9b45", "score": "0.3819632", "text": "func TestPingLoop(t *testing.T) {\n\tbus := eventbus.New()\n\tclient, srv := net.Pipe()\n\n\tresponseChan := make(chan *bytes.Buffer, 10)\n\twriter := peer.NewWriter(client, processing.NewGossip(protocol.TestNet), bus)\n\tgo writer.Serve(responseChan, make(chan struct{}, 1))\n\n\t// Set up the other end of the exchange\n\tresponseChan2 := make(chan *bytes.Buffer, 10)\n\twriter2 := peer.NewWriter(srv, processing.NewGossip(protocol.TestNet), bus)\n\tgo writer2.Serve(responseChan2, make(chan struct{}, 1))\n\t// Give the goroutine some time to start\n\ttime.Sleep(100 * time.Millisecond)\n\n\treader, err := peer.NewReader(client, processing.NewGossip(protocol.TestNet), dupemap.NewDupeMap(0), bus, rpcbus.New(), &chainsync.Counter{}, responseChan2, make(chan struct{}, 1))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tgo reader.ReadLoop()\n\n\t// We should eventually get a pong message out of responseChan2\n\tbuf := <-responseChan2\n\ttopic, err := topics.Extract(buf)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassert.Equal(t, topics.Pong.String(), topic.String())\n}", "title": "" }, { "docid": "5f2907df42173c33c2f66152622af0c2", "score": "0.38092008", "text": "func handleCringe(_ *discordgo.Member, msg *discordgo.Message, _ []string) error {\n\tvar rngCringe string\n\terr := DB.QueryRow(\"SELECT image FROM cringe ORDER BY RANDOM() LIMIT 1\").Scan(&rngCringe)\n\tif err != nil {\n\t\treturn err\n\t}\n\treply := discordgo.MessageEmbed{\n\t\tTitle: \":camera_with_flash:\",\n\t\tImage: &discordgo.MessageEmbedImage{\n\t\t\tURL: rngCringe,\n\t\t},\n\t\tColor: prettyembedcolor,\n\t}\n\t_, err = discord.ChannelMessageSendEmbed(msg.ChannelID, &reply)\n\tgo cringeReact(msg.ChannelID, msg.ID)\n\treturn err\n}", "title": "" }, { "docid": "78327d608363a17df379ababec88e82b", "score": "0.38050735", "text": "func PingClientCall(serverAddr string, n int, payload string, delay time.Duration, tlsOpts *fhttp.TLSOptions, md metadata.MD,\n) (float64, error) {\n\to := GRPCRunnerOptions{Destination: serverAddr, TLSOptions: *tlsOpts, Metadata: md}\n\to.dialOptions, o.filteredMetadata = extractDialOptionsAndFilter(md)\n\tconn, err := Dial(&o) // somehow this never seem to error out, error comes later\n\tif err != nil {\n\t\treturn -1, err // error already logged\n\t}\n\tmsg := &PingMessage{Payload: payload, DelayNanos: delay.Nanoseconds()}\n\tcli := NewPingServerClient(conn)\n\toutCtx := context.Background()\n\tif md.Len() != 0 {\n\t\toutCtx = metadata.NewOutgoingContext(outCtx, o.filteredMetadata)\n\t}\n\t// Warm up:\n\t_, err = cli.Ping(outCtx, msg)\n\tif err != nil {\n\t\tlog.Errf(\"grpc error from Ping0 %v\", err)\n\t\treturn -1, err\n\t}\n\tskewHistogram := stats.NewHistogram(-10, 2)\n\trttHistogram := stats.NewHistogram(0, 10)\n\tfor i := 1; i <= n; i++ {\n\t\tmsg.Seq = int64(i)\n\t\tt1a := time.Now().UnixNano()\n\t\tmsg.Ts = t1a\n\t\tres1, err := cli.Ping(outCtx, msg)\n\t\tt2a := time.Now().UnixNano()\n\t\tif err != nil {\n\t\t\tlog.Errf(\"grpc error from Ping1 iter %d: %v\", i, err)\n\t\t\treturn -1, err\n\t\t}\n\t\tt1b := res1.Ts\n\t\tres2, err := cli.Ping(outCtx, msg)\n\t\tt3a := time.Now().UnixNano()\n\t\tt2b := res2.Ts\n\t\tif err != nil {\n\t\t\tlog.Errf(\"grpc error from Ping2 iter %d: %v\", i, err)\n\t\t\treturn -1, err\n\t\t}\n\t\trt1 := t2a - t1a\n\t\trttHistogram.Record(float64(rt1) / 1000.)\n\t\trt2 := t3a - t2a\n\t\trttHistogram.Record(float64(rt2) / 1000.)\n\t\trtR := t2b - t1b\n\t\trttHistogram.Record(float64(rtR) / 1000.)\n\t\tmidR := t1b + (rtR / 2)\n\t\tavgRtt := (rt1 + rt2 + rtR) / 3\n\t\tx := (midR - t2a)\n\t\tlog.Infof(\"Ping RTT %d (avg of %d, %d, %d ns) clock skew %d\",\n\t\t\tavgRtt, rt1, rtR, rt2, x)\n\t\tskewHistogram.Record(float64(x) / 1000.)\n\t\tmsg = res2\n\t}\n\tskewHistogram.Print(os.Stdout, \"Clock skew histogram usec\", []float64{50})\n\trttHistogram.Print(os.Stdout, \"RTT histogram usec\", []float64{50})\n\treturn rttHistogram.Avg() / 1e6, nil\n}", "title": "" }, { "docid": "5503b28824a382930e8f86a88416e7a2", "score": "0.38028312", "text": "func (m *manifold) solvePolygonToCircle() {\n\tbodyA := m.BodyA\n\tbodyB := m.BodyB\n\n\tm.BodyA = bodyB\n\tm.BodyB = bodyA\n\n\tm.solveCircleToPolygon()\n\n\tm.Normal.X *= -1\n\tm.Normal.Y *= -1\n}", "title": "" }, { "docid": "8c789944576d6704aafea48a2b8b8815", "score": "0.37961593", "text": "func (sphere *Sphere) PostRender() error { return nil }", "title": "" }, { "docid": "ad26ccb4dc8f9d5235ba5b47a88c4df7", "score": "0.37927607", "text": "func (ws *WindowSurface) Run() {\n\tws.running = true\n\tvar frameStart time.Time\n\tvar elapsedTime float64\n\tvar loopTime float64\n\n\tsleepDelay := 0.0\n\n\t// sdl.GetKeyboardState()\n\n\tsdl.SetEventFilterFunc(ws.filterEvent, nil)\n\n\tfor ws.running {\n\t\tframeStart = time.Now()\n\n\t\tsdl.PumpEvents()\n\n\t\tws.clearDisplay()\n\n\t\tws.render()\n\n\t\t// This takes on average 5-7ms\n\t\t// ws.texture.Update(nil, ws.pixels.Pix, ws.pixels.Stride)\n\t\tws.texture.Update(nil, ws.rasterBuffer.Pixels().Pix, ws.rasterBuffer.Pixels().Stride)\n\t\tws.renderer.Copy(ws.texture, nil, nil)\n\n\t\tws.txtFPSLabel.DrawAt(10, 10)\n\t\tf := fmt.Sprintf(\"%2.2f\", 1.0/elapsedTime*1000.0)\n\t\tws.dynaTxt.DrawAt(ws.txtFPSLabel.Bounds.W+10, 10, f)\n\n\t\t// ws.mx, ws.my, _ = sdl.GetMouseState()\n\t\tws.txtMousePos.DrawAt(10, 25)\n\t\tf = fmt.Sprintf(\"<%d, %d>\", ws.mx, ws.my)\n\t\tws.dynaTxt.DrawAt(ws.txtMousePos.Bounds.W+10, 25, f)\n\n\t\tws.txtLoopLabel.DrawAt(10, 40)\n\t\tf = fmt.Sprintf(\"%2.2f\", loopTime)\n\t\tws.dynaTxt.DrawAt(ws.txtLoopLabel.Bounds.W+10, 40, f)\n\n\t\tws.renderer.Present()\n\n\t\t// time.Sleep(time.Millisecond * 5)\n\t\tloopTime = float64(time.Since(frameStart).Nanoseconds() / 1000000.0)\n\t\t// elapsedTime = float64(time.Since(frameStart).Seconds())\n\n\t\tsleepDelay = math.Floor(framePeriod - loopTime)\n\t\t// fmt.Printf(\"%3.5f ,%3.5f, %3.5f \\n\", framePeriod, elapsedTime, sleepDelay)\n\t\tif sleepDelay > 0 {\n\t\t\tsdl.Delay(uint32(sleepDelay))\n\t\t\telapsedTime = framePeriod\n\t\t} else {\n\t\t\telapsedTime = loopTime\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d2d29b29cf070668a0bd50a12458c736", "score": "0.37913838", "text": "func Run() {\n\tsp1 := makeSphere(vector3{0, 0, 0}, 2)\n\tsp2 := makeSphere(vector3{0, 0, 3}, 2)\n\t//fmt.Println(len(sp1.subtract(sp2).polygons))\n\tsp1.subtract(sp2).toObj(os.Stdout)\n\n}", "title": "" }, { "docid": "ddc038edd630f7d91b44aab16feb8bc5", "score": "0.3791195", "text": "func PolyCircleIntersects(p1 *Polygon, p2 *Circle) bool {\n\n\tdefer TimeCall(time.Now(), \"PolyCirleIntersect\")\n\n\tstart := len(p1.vertices) - 1\n\tend := 0\n\n\tseg := &LineSegment{p1.vertices[start], p1.vertices[end]}\n\t//seg := NewSegment(p1.vertices[start], p1.vertices[end])\n\t//seg := &Segment2{p1.vertices[start], p1.vertices[end]}\n\n\tif seg.distanceFrom(&(p2.Center)) < p2.Radius {\n\t\treturn true\n\t}\n\n\tfor i := 1; i < len(p1.vertices); i++ {\n\t\tseg = &LineSegment{p1.vertices[i-1], p1.vertices[i]}\n\t\tif seg.distanceFrom(&(p2.Center)) < p2.Radius {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tif p1.Contains(&p2.Center) {\n\t\treturn true\n\t}\n\n\treturn false\n\n\t//fmt.Println(\"PolyCircleIntersects\\n\")\n\n\t/*\n\t\tfor _, v := range p1.vertices {\n\t\t\tif v.Distance(&p2.Center) <= p2.Radius {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\tif p1.Contains(&p2.Center) {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t*/\n}", "title": "" }, { "docid": "fb2bce8809b7a7a1ab3f3ca7ca6c062b", "score": "0.3785484", "text": "func (o *Originator) Run(ctx context.Context) {\n\to.tick.now = time.Now()\n\to.originateBeacons(ctx, topology.Core)\n\to.originateBeacons(ctx, topology.Child)\n\tmetrics.Originator.Runtime().Add(time.Since(o.tick.now).Seconds())\n\to.tick.updateLast()\n}", "title": "" }, { "docid": "74390a6869bf74c038d4c3234e3ad4c9", "score": "0.37835994", "text": "func (pa *PodAnnotator) Run(interval time.Duration, stopCh <-chan struct{}) {\n\tlog.Infof(\"starting pod annotator controller\")\n\n\tfor {\n\t\tselect {\n\t\tcase <-stopCh:\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\n\t\ttime.Sleep(interval)\n\n\t\t// Get all the scan results from the Perceptor\n\t\tlog.Infof(\"attempting to GET %s for pod annotation\", pa.scanResultsURL)\n\t\tresp, err := http.Get(pa.scanResultsURL)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"unable to GET %s for pod annotation: %v\", pa.scanResultsURL, err)\n\t\t\tcontinue\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tbodyBytes, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"unable to read resp body from %s: %v\", pa.scanResultsURL, err)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Process the scan results and apply annotations/labels to pods\n\t\tvar scanResults perceptorapi.ScanResults\n\t\terr = json.Unmarshal(bodyBytes, &scanResults)\n\t\tif err == nil && resp.StatusCode == 200 {\n\t\t\tlog.Infof(\"GET to %s succeeded, about to update annotations on all pods\", pa.scanResultsURL)\n\t\t\tfor _, pod := range scanResults.Pods {\n\t\t\t\tpodAnnotations := bdannotations.NewBlackDuckPodAnnotation(pod.PolicyViolations, pod.Vulnerabilities, pod.OverallStatus)\n\t\t\t\tif err = pa.setAnnotationsOnPod(pod.Name, pod.Namespace, podAnnotations, scanResults.Images); err != nil {\n\t\t\t\t\tlog.Errorf(\"failed to annotate pod %s/%s: %v\", pod.Namespace, pod.Name, err)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tlog.Errorf(\"unable to Unmarshal ScanResults from url %s: %v\", pa.scanResultsURL, err)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6732b61799cd6a0c56700da2bd017d72", "score": "0.3782065", "text": "func (p *grpcProvisioner) sendLoop(ctx context.Context, client discoveryv3.AggregatedDiscoveryService_StreamAggregatedResourcesClient) {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase dr := <-p.sendCh:\n\t\t\tp.logger.Debugw(\"sending discovery request\",\n\t\t\t\tzap.Any(\"body\", dr),\n\t\t\t)\n\t\t\tgo func(dr *discoveryv3.DiscoveryRequest) {\n\t\t\t\tif err := client.Send(dr); err != nil {\n\t\t\t\t\tp.logger.Errorw(\"failed to send discovery request\",\n\t\t\t\t\t\tzap.Error(err),\n\t\t\t\t\t\tzap.String(\"config_source\", p.configSource),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}(dr)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2dab37a6632115471b3a868215522c80", "score": "0.37767383", "text": "func (reindeer *Reindeer) run() {\n\tfor {\n\t\tfmt.Printf(\"[Reindeer] %d went to Santa.\\n\", reindeer.id)\n\t\t// Reindeer sends message to Santa saying they arrived\n\t\treindeer.door.reindeerChan <- reindeer\n\t\t// Reindeer waits to recieve a message from Santa so they can leave\n\t\t<-reindeer.wait\n\t\tfmt.Printf(\"[Reindeer] %d returned from Santa.\\n\", reindeer.id)\n\t\ttime.Sleep(sleepTime)\n\t}\n}", "title": "" }, { "docid": "9da35fe93cf7fc6b651f75c32cdfe37d", "score": "0.37704107", "text": "func main(){\r\n\tc := circle{23.87}\r\n\tinfo(c)\r\n}", "title": "" }, { "docid": "ee2d00f2850a7734c00507c75e4c6365", "score": "0.37680057", "text": "func call(cpu *CPU, next uint16) {\n\tpushNN(cpu, cpu.PC)\n\tcpu.PC = next\n}", "title": "" }, { "docid": "c1acb3b1b38ec21d3cdac234a58cc8bf", "score": "0.37656492", "text": "func (h *Hare) outputCollectionLoop(ctx context.Context) {\n\tdefer h.wg.Done()\n\n\th.WithContext(ctx).With().Info(\"starting collection loop\")\n\tfor {\n\t\tselect {\n\t\tcase out := <-h.outputChan:\n\t\t\tlayerID := out.ID()\n\t\t\tcoin := out.Coinflip()\n\t\t\tctx := log.WithNewSessionID(ctx)\n\t\t\tlogger := h.WithContext(ctx).WithFields(layerID)\n\n\t\t\t// collect coinflip, regardless of success\n\t\t\tlogger.With().Info(\"recording weak coinflip result for layer\",\n\t\t\t\tlog.Bool(\"coinflip\", coin))\n\t\t\th.mesh.RecordCoinflip(ctx, layerID, coin)\n\n\t\t\tif err := h.collectOutput(ctx, out); err != nil {\n\t\t\t\tlogger.With().Warning(\"error collecting output from hare\", log.Err(err))\n\t\t\t}\n\t\t\th.broker.Unregister(ctx, out.ID())\n\t\t\tlogger.With().Info(\"number of consensus processes (after unregister)\",\n\t\t\t\tlog.Int32(\"count\", atomic.AddInt32(&h.totalCPs, -1)))\n\t\tcase <-h.CloseChannel():\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8480f3958b6aa63c5594124f955194ef", "score": "0.3765247", "text": "func (conv *Conversation) caricaPost() error {\n\n\tquery, err := db.Prepare(\"SELECT id,father,text,first_response,second_response FROM post WHERE conversation = $1\")\n\tif err != nil {\n\t\treturn err\n\t}\n\trows, err := query.Query(conv.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tparentPostMap := make(map[int]*Post)\n\tfirSonPostMap := make(map[int]*Post)\n\tsecSonPostMap := make(map[int]*Post)\n\tlogs.Log(\"caricamento post della conversazione \", strconv.Itoa(conv.ID))\n\tfor ; rows.Next(); conv.contatorePost++ {\n\t\tvar id, parent, first_response, second_response int\n\t\tvar text string\n\n\t\terr := rows.Scan(&id, &parent, &text, &first_response, &second_response)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tpost := new(Post)\n\t\tpost.idPost = id\n\t\tpost.testo = NewSuperString()\n\t\tpost.testo.InsStringElem(text, 0)\n\t\tconv.postMap[id] = post\n\t\tpost.writers = list.New()\n\n\t\tif id == 0 {\n\t\t\tconv.testaPost = post\n\t\t}\n\n\t\tparentPostMap[parent] = post\n\t\tfirSonPostMap[first_response] = post\n\t\tsecSonPostMap[second_response] = post\n\n\t\tfmt.Println(\"caricato vecchio post: \", strconv.Itoa(id), \"\\ntesto: \", text)\n\n\t}\n\tfor k, post := range parentPostMap {\n\t\tpost.padre = conv.postMap[k]\n\t}\n\tfor k, post := range firSonPostMap {\n\t\tpost.rispostaPrincipale = conv.postMap[k]\n\t}\n\tfor k, post := range secSonPostMap {\n\t\tpost.rispostaSecondaria = conv.postMap[k]\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "966a338db0a50a203c85a5133bded007", "score": "0.3760664", "text": "func run() {\n\t// Create a new world.\n\tworld := ecs.NewWorld()\n\n\t// Get component IDs.\n\tchildID := ecs.ComponentID[ChildOf](&world)\n\n\t// For creating entities with relations, a Builder with a relation is required.\n\tchildBuilder := ecs.NewBuilder(&world, childID).WithRelation(childID)\n\n\t// Create parent entities.\n\tparent1 := world.NewEntity()\n\tparent2 := world.NewEntity()\n\n\t// Create an entity with a ChildOf relation to a parent entity.\n\tchild := childBuilder.New(parent1)\n\t// Change the child's relation target.\n\tworld.Relations().Set(child, childID, parent2)\n\t// Get the child's relation target.\n\tfmt.Println(world.Relations().Get(child, childID))\n\n\t// Create entities with a relation in batches.\n\tchildBuilder.NewBatch(10, parent1)\n\tchildBuilder.NewBatch(10, parent2)\n\n\t// Create a filter for a relation target.\n\tfilter := ecs.NewRelationFilter(ecs.All(childID), parent1)\n\n\t// Create a query from it.\n\tquery := world.Query(&filter)\n\n\t// Iterate the query.\n\tfor query.Next() {\n\t\t// Get the relation target of the current entity.\n\t\ttarget := query.Relation(childID)\n\t\tfmt.Println(target)\n\t}\n}", "title": "" }, { "docid": "452ca9c89f14ddfd3686414bf1cb97cc", "score": "0.37604755", "text": "func (ec *executionContext) _Circle(ctx context.Context, sel []query.Selection, obj *Circle) graphql.Marshaler {\n\tfields := graphql.CollectFields(ec.Doc, sel, circleImplementors, ec.Variables)\n\tout := graphql.NewOrderedMap(len(fields))\n\tfor i, field := range fields {\n\t\tout.Keys[i] = field.Alias\n\n\t\tswitch field.Name {\n\t\tcase \"__typename\":\n\t\t\tout.Values[i] = graphql.MarshalString(\"Circle\")\n\t\tcase \"radius\":\n\t\t\tout.Values[i] = ec._Circle_radius(ctx, field, obj)\n\t\tcase \"area\":\n\t\t\tout.Values[i] = ec._Circle_area(ctx, field, obj)\n\t\tdefault:\n\t\t\tpanic(\"unknown field \" + strconv.Quote(field.Name))\n\t\t}\n\t}\n\n\treturn out\n}", "title": "" }, { "docid": "5391726b7aa6ad911df5a9ac23c171cf", "score": "0.375944", "text": "func (sched *Scheduler) bindingCycle(\n\tctx context.Context,\n\tstate *framework.CycleState,\n\tfwk framework.Framework,\n\tscheduleResult ScheduleResult,\n\tassumedPodInfo *framework.QueuedPodInfo,\n\tstart time.Time,\n\tpodsToActivate *framework.PodsToActivate) *framework.Status {\n\tlogger := klog.FromContext(ctx)\n\n\tassumedPod := assumedPodInfo.Pod\n\n\t// Run \"permit\" plugins.\n\tif status := fwk.WaitOnPermit(ctx, assumedPod); !status.IsSuccess() {\n\t\tif status.IsUnschedulable() {\n\t\t\tfitErr := &framework.FitError{\n\t\t\t\tNumAllNodes: 1,\n\t\t\t\tPod: assumedPodInfo.Pod,\n\t\t\t\tDiagnosis: framework.Diagnosis{\n\t\t\t\t\tNodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: status},\n\t\t\t\t\tUnschedulablePlugins: sets.New(status.FailedPlugin()),\n\t\t\t\t},\n\t\t\t}\n\t\t\treturn framework.NewStatus(status.Code()).WithError(fitErr)\n\t\t}\n\t\treturn status\n\t}\n\n\t// Run \"prebind\" plugins.\n\tif status := fwk.RunPreBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost); !status.IsSuccess() {\n\t\treturn status\n\t}\n\n\t// Run \"bind\" plugins.\n\tif status := sched.bind(ctx, fwk, assumedPod, scheduleResult.SuggestedHost, state); !status.IsSuccess() {\n\t\treturn status\n\t}\n\n\t// Calculating nodeResourceString can be heavy. Avoid it if klog verbosity is below 2.\n\tlogger.V(2).Info(\"Successfully bound pod to node\", \"pod\", klog.KObj(assumedPod), \"node\", scheduleResult.SuggestedHost, \"evaluatedNodes\", scheduleResult.EvaluatedNodes, \"feasibleNodes\", scheduleResult.FeasibleNodes)\n\tmetrics.PodScheduled(fwk.ProfileName(), metrics.SinceInSeconds(start))\n\tmetrics.PodSchedulingAttempts.Observe(float64(assumedPodInfo.Attempts))\n\tif assumedPodInfo.InitialAttemptTimestamp != nil {\n\t\tmetrics.PodSchedulingDuration.WithLabelValues(getAttemptsLabel(assumedPodInfo)).Observe(metrics.SinceInSeconds(*assumedPodInfo.InitialAttemptTimestamp))\n\t\tmetrics.PodSchedulingSLIDuration.WithLabelValues(getAttemptsLabel(assumedPodInfo)).Observe(metrics.SinceInSeconds(*assumedPodInfo.InitialAttemptTimestamp))\n\t}\n\t// Run \"postbind\" plugins.\n\tfwk.RunPostBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost)\n\n\t// At the end of a successful binding cycle, move up Pods if needed.\n\tif len(podsToActivate.Map) != 0 {\n\t\tsched.SchedulingQueue.Activate(logger, podsToActivate.Map)\n\t\t// Unlike the logic in schedulingCycle(), we don't bother deleting the entries\n\t\t// as `podsToActivate.Map` is no longer consumed.\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d53553fd7dc2318d5ed49bcace25066c", "score": "0.37589723", "text": "func (mgr *NetworkPodToNodeMapMgr) RunContivKSRNetworkPodToNodeMappingWatcher() {\n\n\tlog.Info(\"ContivKSRNetworkPodToNodeMappingWatcher: enter ...\")\n\tdefer log.Info(\"ContivKSRNetworkPodToNodeMappingWatcher: exit ...\")\n\n\tgo func() {\n\t\t// back up timer ... paranoid about missing events ...\n\t\t// check every minute just in case\n\t\tticker := time.NewTicker(1 * time.Minute)\n\t\tfor _ = range ticker.C {\n\t\t\ttempNetworkPodToNodeMapMap := make(map[string]*NetworkPodToNodeMap)\n\t\t\tmgr.loadAllFromDatastore(mgr.ContivKsrNetworkPodToNodePrefix(), tempNetworkPodToNodeMapMap)\n\t\t\trenderingRequired := false\n\t\t\tfor _, dbEntry := range tempNetworkPodToNodeMapMap {\n\t\t\t\tramEntry, exists := ctlrPlugin.ramCache.NetworkPodToNodeMap[dbEntry.Pod]\n\t\t\t\tif !exists || !ramEntry.ConfigEqual(dbEntry) {\n\t\t\t\t\tlog.Debugf(\"ContivKSRNetworkPodToNodeMappingWatcher: timer new config: %v\", dbEntry)\n\t\t\t\t\trenderingRequired = true\n\t\t\t\t\tmgr.HandleContivKSRStatusUpdate(dbEntry, false) // render at the end\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if any of the entities required rendering, do it now\n\t\t\tif renderingRequired {\n\t\t\t\tctlrPlugin.AddOperationMsgToQueue(\"\", OperationalMsgOpCodeRender, nil)\n\t\t\t}\n\t\t\ttempNetworkPodToNodeMapMap = nil\n\t\t}\n\t}()\n\n\trespChan := make(chan keyval.ProtoWatchResp, 0)\n\twatcher := ctlrPlugin.Etcd.NewWatcher(mgr.ContivKsrNetworkPodToNodePrefix())\n\terr := watcher.Watch(keyval.ToChanProto(respChan), make(chan string), \"\")\n\tif err != nil {\n\t\tlog.Errorf(\"ContivKSRNetworkPodToNodeMappingWatcher: cannot watch: %s\", err)\n\t\tos.Exit(1)\n\t}\n\tlog.Debugf(\"ContivKSRNetworkPodToNodeMappingWatcher: watching the key: %s\",\n\t\tmgr.ContivKsrNetworkPodToNodePrefix())\n\n\tfor {\n\t\tselect {\n\t\tcase resp := <-respChan:\n\t\t\tswitch resp.GetChangeType() {\n\t\t\tcase datasync.Put:\n\t\t\t\tp2n := &NetworkPodToNodeMap{}\n\t\t\t\tif err := resp.GetValue(p2n); err == nil {\n\t\t\t\t\tlog.Infof(\"ContivKSRNetworkPodToNodeMappingWatcher: key: %s, value:%v\", resp.GetKey(), p2n)\n\t\t\t\t\tmgr.HandleContivKSRStatusUpdate(p2n, true)\n\t\t\t\t}\n\n\t\t\tcase datasync.Delete:\n\t\t\t\tlog.Infof(\"ContivKSRNetworkPodToNodeMappingWatcher: deleting key: %s \", resp.GetKey())\n\t\t\t\tmgr.HandleContivKSRStatusDelete(resp.GetKey())\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "33b0e91249fbbaa04cdf29f792862a44", "score": "0.37578708", "text": "func (s *Scene) TraceRay(r *ray.Ray, depth int, contribution float64, rayCounts *ray.Counts) color64.Color64 {\n\tif depth > s.Options.Global.MaxRecursion || contribution < s.Options.Global.AdaptiveThreshold {\n\t\treturn color64.Color64{}\n\t}\n\n\tisect := bvh.IntersectResult{}\n\ts.bvh.Intersect(r, &isect)\n\tif isect.Object == nil {\n\t\treturn s.BackgroundColor(r)\n\t}\n\n\tmaterial, ok := s.Materials[isect.Object.(*object.Object).MaterialName]\n\tif !ok {\n\t\tlog.Fatalf(\"no material: %s\", isect.Object.(*object.Object).MaterialName)\n\t}\n\n\t// TODO: handle liquid and index of refraction\n\t// exiting := false\n\t// if res.Normal.Dot(r.Dir) > 0 {\n\t// exiting = true\n\t// res.Normal = res.Normal.Mul(-1)\n\t// }\n\n\t// Bump mapping\n\t// bump := material.Normal(res).Mul(2).Sub(mgl64.Vec3{1, 1, 1})\n\t// cos := res.Normal(mgl64.Vec3{0, 0, 1})\n\t// rotateVec := mgl64.Vec3{0, 0, 1}.Cross(res.Normal)\n\n\treturn material.IllumMap.ColorAt(isect.UV)\n\n\t// c := 0.0\n\t// if isect.T <= 2 {\n\t// \tc = 1.0\n\t// } else if isect.T >= 20 {\n\t// \tc = 0.9\n\t// } else {\n\t// \tc = 1 - (isect.T-2)/18.0\n\t// }\n\t// return color64.Color64{1 - c, 1 - c, 1 - c}\n\n\t// at := r.At(isect.T)\n\t// rd := (math.Sin(0.2*at.X()) + 1) / 2\n\t// g := (math.Sin(4.0*at.Y()) + 1) / 2\n\t// b := (math.Sin(0.2*at.Z()) + 1) / 2\n\t// return color64.Color64{rd, g, b}\n}", "title": "" }, { "docid": "c03a77b7ce0b370df30e91cf3380cfc0", "score": "0.37506443", "text": "func (mc *MeshCatalog) repeater() {\n\tlastUpdateAt := time.Now().Add(-1 * updateAtMostEvery)\n\tfor {\n\t\tcases, caseNames := mc.getCases()\n\t\tfor {\n\t\t\tif chosenIdx, message, ok := reflect.Select(cases); ok {\n\t\t\t\tann, ok := message.Interface().(announcements.Announcement)\n\t\t\t\tif !ok {\n\t\t\t\t\tlog.Error().Msgf(\"Repeater received a interface{} message, which is not an Announcement\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tlog.Trace().Msgf(\"Handling announcement from %s: %+v\", caseNames[chosenIdx], ann)\n\n\t\t\t\tmc.handleAnnouncement(ann)\n\n\t\t\t\tdelta := time.Since(lastUpdateAt)\n\t\t\t\tif !alreadyHandled.Contains(ann.Type) && delta >= updateAtMostEvery {\n\t\t\t\t\tmc.broadcastToAllProxies(ann)\n\t\t\t\t\tlastUpdateAt = time.Now()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1b998dd1d5d778737634c2ea97334822", "score": "0.37501246", "text": "func Send(arguments ...interface{}) *Ray {\n\treturn DefaultRay.Send(arguments...)\n}", "title": "" }, { "docid": "42e4c18d05d8d1b0dbecb4f2c61e3d3e", "score": "0.37415713", "text": "func (me *TconeType) Walk() (err error) {\r\n\tif fn := WalkHandlers.TconeType; me != nil {\r\n\t\tif fn != nil {\r\n\t\t\tif err = fn(me, true); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_anglesequencecone_typeschema_Angle_XsdtFloat_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElems_extrasequenceanimation_typeschema_Extra_TextraType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif err = me.XsdGoPkgHasElem_radiussequencesphere_typeschema_Radius_TfloatType_.Walk(); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\treturn\r\n\t\t}\r\n\t\tif fn != nil {\r\n\t\t\tif err = fn(me, false); xsdt.OnWalkError(&err, &WalkErrors, WalkContinueOnError, WalkOnError) {\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn\r\n}", "title": "" }, { "docid": "299daa52ce69e8acc4bc907b664c6e3b", "score": "0.3738483", "text": "func (c *Reconciler) ReconcileKind(ctx context.Context, customRun *tektonv1beta1.CustomRun) pkgreconciler.Event {\n\tvar merr error\n\tlogger := logging.FromContext(ctx)\n\tlogger.Infof(\"Reconciling CustomRun %s/%s at %v\", customRun.Namespace, customRun.Name, time.Now())\n\tif customRun.Spec.CustomRef != nil && customRun.Spec.CustomSpec != nil {\n\t\tlogger.Errorf(\"CustomRun %s/%s can provide one of CustomRun.Spec.CustomRef/CustomRun.Spec.CustomSpec\", customRun.Namespace, customRun.Name)\n\t\treturn nil\n\t}\n\tif customRun.Spec.CustomSpec == nil && customRun.Spec.CustomRef == nil {\n\t\tlogger.Errorf(\"CustomRun %s/%s does not provide a spec or ref.\", customRun.Namespace, customRun.Name)\n\t\treturn nil\n\t}\n\tif (customRun.Spec.CustomRef != nil && customRun.Spec.CustomRef.Kind == pipelineloop.BreakTaskName) ||\n\t\t(customRun.Spec.CustomSpec != nil && customRun.Spec.CustomSpec.Kind == pipelineloop.BreakTaskName) {\n\t\tif !customRun.IsDone() {\n\t\t\tcustomRun.Status.InitializeConditions()\n\t\t\tcustomRun.Status.MarkCustomRunSucceeded(pipelineloopv1alpha1.PipelineLoopRunReasonSucceeded.String(),\n\t\t\t\t\"Break task is a dummy task.\")\n\t\t}\n\t\tlogger.Infof(\"Break task encountered %s\", customRun.Name)\n\t\treturn nil\n\t}\n\t// Check that the CustomRun references a PipelineLoop CRD. The logic is controller.go should ensure that only this type of Run\n\t// is reconciled this controller but it never hurts to do some bullet-proofing.\n\tif customRun.Spec.CustomRef != nil &&\n\t\t(customRun.Spec.CustomRef.APIVersion != pipelineloopv1alpha1.SchemeGroupVersion.String() ||\n\t\t\tcustomRun.Spec.CustomRef.Kind != pipelineloop.PipelineLoopControllerName) {\n\t\tlogger.Errorf(\"Received control for a CustomRun %s/%s/%v that does not reference a PipelineLoop custom CRD ref\", customRun.Namespace, customRun.Name, customRun.Spec.CustomRef)\n\t\treturn nil\n\t}\n\n\tif customRun.Spec.CustomSpec != nil &&\n\t\t(customRun.Spec.CustomSpec.APIVersion != pipelineloopv1alpha1.SchemeGroupVersion.String() ||\n\t\t\tcustomRun.Spec.CustomSpec.Kind != pipelineloop.PipelineLoopControllerName) {\n\t\tlogger.Errorf(\"Received control for a CustomRun %s/%s that does not reference a PipelineLoop custom CRD spec\", customRun.Namespace, customRun.Name)\n\t\treturn nil\n\t}\n\tlogger.Infof(\"Received control for a CustomRun %s/%s %-v\", customRun.Namespace, customRun.Name, customRun.Spec.CustomSpec)\n\t// If the CustomRun has not started, initialize the Condition and set the start time.\n\tif !customRun.HasStarted() {\n\t\tlogger.Infof(\"Starting new CustomRun %s/%s\", customRun.Namespace, customRun.Name)\n\t\tcustomRun.Status.InitializeConditions()\n\t\t// In case node time was not synchronized, when controller has been scheduled to other nodes.\n\t\tif customRun.Status.StartTime.Sub(customRun.CreationTimestamp.Time) < 0 {\n\t\t\tlogger.Warnf(\"Run %s createTimestamp %s is after the CustomRun started %s\", customRun.Name, customRun.CreationTimestamp, customRun.Status.StartTime)\n\t\t\tcustomRun.Status.StartTime = &customRun.CreationTimestamp\n\t\t}\n\t\t// Emit events. During the first reconcile the status of the CustomRun may change twice\n\t\t// from not Started to Started and then to Running, so we need to sent the event here\n\t\t// and at the end of 'Reconcile' again.\n\t\t// We also want to send the \"Started\" event as soon as possible for anyone who may be waiting\n\t\t// on the event to perform user facing initialisations, such has reset a CI check status\n\t\tafterCondition := customRun.Status.GetCondition(apis.ConditionSucceeded)\n\t\tevents.Emit(ctx, nil, afterCondition, customRun)\n\t}\n\n\t// Store the condition before reconcile\n\tbeforeCondition := customRun.Status.GetCondition(apis.ConditionSucceeded)\n\n\tstatus := &pipelineloopv1alpha1.PipelineLoopRunStatus{}\n\tif err := customRun.Status.DecodeExtraFields(status); err != nil {\n\t\tcustomRun.Status.MarkCustomRunFailed(pipelineloopv1alpha1.PipelineLoopRunReasonInternalError.String(),\n\t\t\t\"Internal error calling DecodeExtraFields: %v\", err)\n\t\tlogger.Errorf(\"DecodeExtraFields error: %v\", err.Error())\n\t}\n\n\tif customRun.IsDone() {\n\t\tif customRun.IsSuccessful() && !c.cacheStore.Disabled && isCachingEnabled(customRun) {\n\t\t\tmarshal, err := json.Marshal(CacheKey{\n\t\t\t\tPipelineLoopSpec: status.PipelineLoopSpec,\n\t\t\t\tParams: v1ParamsConversion(ctx, customRun.Spec.Params),\n\t\t\t})\n\t\t\tif err == nil {\n\t\t\t\thashSum := fmt.Sprintf(\"%x\", md5.Sum(marshal))\n\t\t\t\tresultBytes, err1 := json.Marshal(customRun.Status.Results)\n\t\t\t\tif err1 != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error while marshalling result to cache for CustomRun: %s, %w\", customRun.Name, err)\n\t\t\t\t}\n\t\t\t\terr = c.cacheStore.Put(&model.TaskCache{\n\t\t\t\t\tTaskHashKey: hashSum,\n\t\t\t\t\tTaskOutput: string(resultBytes),\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error while adding result to cache for CustomRun: %s, %w\", customRun.Name, err)\n\t\t\t\t}\n\t\t\t\tlogger.Infof(\"cached the results of successful CustomRun %s, with key: %s\", customRun.Name, hashSum)\n\t\t\t}\n\t\t}\n\t\tlogger.Infof(\"CustomRun %s/%s is done\", customRun.Namespace, customRun.Name)\n\t\treturn nil\n\t}\n\t// Reconcile the Run\n\tif err := c.reconcile(ctx, customRun, status); err != nil {\n\t\tlogger.Errorf(\"Reconcile error: %v\", err.Error())\n\t\tmerr = multierror.Append(merr, err)\n\t}\n\n\tif err := c.updateLabelsAndAnnotations(ctx, customRun); err != nil {\n\t\tlogger.Warn(\"Failed to update CustomRun labels/annotations\", zap.Error(err))\n\t\tmerr = multierror.Append(merr, err)\n\t}\n\n\tif err := customRun.Status.EncodeExtraFields(status); err != nil {\n\t\tcustomRun.Status.MarkCustomRunFailed(pipelineloopv1alpha1.PipelineLoopRunReasonInternalError.String(),\n\t\t\t\"Internal error calling EncodeExtraFields: %v\", err)\n\t\tlogger.Errorf(\"EncodeExtraFields error: %v\", err.Error())\n\t}\n\n\tafterCondition := customRun.Status.GetCondition(apis.ConditionSucceeded)\n\tevents.Emit(ctx, beforeCondition, afterCondition, customRun)\n\treturn merr\n}", "title": "" }, { "docid": "61678df57183aa283f397e8a4f77273a", "score": "0.37372875", "text": "func CollectOne(ctx context.Context, c Collectable) MetricPoint {\n\tchildCtx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\tch := make(chan MetricPoint)\n\n\tgo c.Collect(childCtx, ch)\n\treturn <-ch\n}", "title": "" }, { "docid": "f3312ce633bb0449f14ddc44f310c9b3", "score": "0.3734557", "text": "func run(input string) (interface{}, interface{}) {\n\n\tc := intcode.New(input, 0)\n\tc.Output.C = make(chan int)\n\tc.Done = make(chan bool)\n\tc.Memory[0] = 2\n\tc.RunBackground()\n\n\tgameMap := make(twod.Map)\n\ttwod.RenderingMap = map[interface{}]color.Color{\n\t\twall: colornames.Brown,\n\t\tbrick: colornames.Purple,\n\t\tbar: colornames.Black,\n\t\tball: colornames.Red,\n\t}\n\n\tpart1, part2 := 0, 0\n\tfor {\n\t\tselect {\n\t\tcase x := <-c.Output.C:\n\t\t\tc.Output.C <- 0 // ack\n\n\t\t\ty := <-c.Output.C\n\t\t\tc.Output.C <- 0 // ack\n\n\t\t\tv := <-c.Output.C\n\t\t\tc.Output.C <- 0 // ack\n\n\t\t\tif x == -1 {\n\t\t\t\tif part1 == 0 {\n\t\t\t\t\tpart1 = len(gameMap.Filter(brick))\n\t\t\t\t}\n\t\t\t\tpart2 = v\n\t\t\t} else {\n\t\t\t\tgameMap[twod.NewVector(x, y)] = v\n\t\t\t}\n\n\t\tcase <-c.Input.C: // input request\n\t\t\tc.Input.C <- strat(gameMap.Find(bar)[0], gameMap.Find(ball)[0])\n\t\t\tgameMap.Render()\n\t\tcase <-c.Done:\n\t\t\treturn part1, part2\n\t\t}\n\t}\n}", "title": "" }, { "docid": "35b06a03c2d2dbdd228a7b8a6f92c2ed", "score": "0.3730345", "text": "func (elf *Elf) run() {\n\tfor {\n\t\tfmt.Printf(\"[Elf] %d went to Santa.\\n\", elf.id)\n\t\t// Elf sends message to Santa saying they arrived\n\t\telf.door.elfChan <- elf\n\t\t// Elf waits to recieve a message from Santa so they can leave\n\t\t<-elf.wait\n\t\tfmt.Printf(\"[Elf] %d returned from Santa.\\n\", elf.id)\n\t\ttime.Sleep(sleepTime)\n\t}\n}", "title": "" }, { "docid": "65100332a39a0d98c4f711a8a03c0e97", "score": "0.37269905", "text": "func Run(args []string, tappers ...CaptureTap) (code int) {\n\tvar bubbleTaps []BubbleTap\n\tvar err error\n\n\tdefer func() {\n\t\tpe := recover()\n\t\tif pe != nil {\n\t\t\tlog.Errorw(\"panic error captured in runner\", \"panic\", pe)\n\t\t\tcode = errors.GetErrorCode(pe.(error))\n\t\t}\n\t}()\n\n\tfor _, tapper := range tappers {\n\t\tif tapper == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tbubbleTap, tapErr := tapper(args)\n\t\tif tapErr != nil {\n\t\t\terr = tapErr\n\t\t\tbreak\n\t\t}\n\n\t\tif bubbleTap != nil {\n\t\t\tbubbleTaps = append(bubbleTaps, bubbleTap)\n\t\t}\n\t}\n\n\tfor i := len(bubbleTaps) - 1; i >= 0; i-- {\n\t\terr = bubbleTaps[i](err)\n\t}\n\n\tif err != nil {\n\t\treturn errors.GetErrorCode(err)\n\t}\n\n\treturn exitcode.Nil\n}", "title": "" }, { "docid": "2c35f681f84361ca3a4aaa88a7fb4d83", "score": "0.3717482", "text": "func main() {\n\tAxonLoop()\n}", "title": "" }, { "docid": "5cc157e9f4b3ebad2cb632615ac03a6a", "score": "0.37094563", "text": "func (o DiscoveredOutput) Cpe() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Discovered) *string { return v.Cpe }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "27bd1a61d98288935b89bff635cd3201", "score": "0.36952612", "text": "func projectcb(data []Point, x, y *Axis, bounds Rect, fn func(p Point)) {\n\tsize := bounds.Size()\n\tfor _, p := range data {\n\t\tp.X = x.ToCanvas(p.X, 0, size.X)\n\t\tp.Y = y.ToCanvas(p.Y, 0, size.Y)\n\t\tfn(p)\n\t}\n}", "title": "" }, { "docid": "887b0d48e723e7682864de4102ddb836", "score": "0.36903787", "text": "func CalBridge() {\n\tfmt.Println(\"一排纵向钢筋 h0\", h01)\n\tfmt.Println(\"两排纵向钢筋 h0\", h02)\n\tfmt.Printf(\"gBoard 板传来的永久荷载 %f, selfG 次梁自重 %f, 次梁粉刷 %f \\n\", gBoard, selfG, paintLayer)\n\tfmt.Printf(\"g 永久荷载设计值 %f, q 可变荷载设计值 %f, sumLoad 荷载总设计值 %f \\n\", g, q, sumLoad)\n\t// 主梁截面 250x650 mm^2\n\t// l01 边跨 l02 中间跨\n\tl01 := (pkg.L1*1000 - 130 - 250/2) / 1000.0\n\tl02 := (pkg.L1*1000 - 250) / 1000.0\n\tfmt.Printf(\"l01 %f, l02 %f \\n\", l01*math.Pow(10, 3), l02*math.Pow(10, 3))\n\n\tvar gq float64\n\tgq = sumLoad\n\n\tMA := -gq * math.Pow(l01, 2) / 24\n\tM1 := gq * math.Pow(l01, 2) / 14\n\tMB := -gq * math.Pow(l01, 2) / 11\n\t// M2 = M3\n\tM2 := gq * math.Pow(l02, 2) / 16\n\tMC := -gq * math.Pow(l02, 2) / 14\n\n\tVA := 0.5 * gq * l01\n\tVBl := 0.55 * gq * l01\n\t// VBr == Vc\n\tVC := 0.55 * (gq) * l02\n\n\tfmt.Println(\"MA\", MA)\n\tfmt.Println(\"M1\", M1)\n\tfmt.Println(\"MB\", MB)\n\tfmt.Println(\"M2\", M2)\n\tfmt.Println(\"MC\", MC)\n\tfmt.Println(\"VA\", VA)\n\tfmt.Println(\"VB1\", VBl)\n\tfmt.Println(\"VC\", VC)\n\n\tvar rbas []pkg.RealBridgeAs\n\tcounter := [][]pkg.RealBridgeAs{}\n\n\trbas = Calculator(pkg.A, MA)\n\tcounter = append(counter, rbas)\n\n\trbas = Calculator(pkg.FIRST, M1)\n\tcounter = append(counter, rbas)\n\n\trbas = Calculator(pkg.B, MB)\n\tcounter = append(counter, rbas)\n\n\trbas = Calculator(pkg.SECOND, M2)\n\tcounter = append(counter, rbas)\n\n\trbas = Calculator(pkg.C, MC)\n\tcounter = append(counter, rbas)\n\n\tpkg.BestBridgeReinforcementChoice(counter)\n}", "title": "" }, { "docid": "e7392457bbda6df031450bde85cf09d7", "score": "0.36883935", "text": "func (t *trackerAnnouncer) run() {\n\tfor {\n\t\tselect {\n\t\tcase te := <-t.trackerAnnouncerSubmitEventCh:\n\t\t\tresp, err := t.announce(te)\n\t\t\tte.t.trackerAnnouncerResponseC <- trackerAnnouncerResponse{\n\t\t\t\tresp: resp,\n\t\t\t\terr: err,\n\t\t\t}\n\t\tcase <-t.cl.close:\n\t\t\t//TODO:send stopped msgs to trackers?\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "790489cefa2fc94d7c4e5a333d9eb399", "score": "0.3679506", "text": "func (t *EnrichResoTransform) Run(killChan chan error) {\n\tfor item := range t.In {\n\t\tt.Out <- t.Transform(item)\n\t}\n\tclose(t.Out)\n}", "title": "" }, { "docid": "7dfa05208d9af8718179d8ffab435ca9", "score": "0.36780533", "text": "func ping(pings <-chan *Ping, waitGroup *sync.WaitGroup, progressTracker *progress.Tracker) {\n\tvar pong *Pong\n\tfor ping := range pings {\n\t\t// The response pool reset object\n\t\tpong = pongPool.Get().(*Pong)\n\t\tpong.Ping = *ping\n\t\tpong.Response = \"-\"\n\n\t\tmethodName := strings.ToUpper(ping.Method)\n\t\treq, err := http.NewRequest(methodName, ping.Url, nil)\n\t\tif err != nil {\n\t\t\tpong.Response = fmt.Sprintf(\"[aPing] The new HTTP request build failed with error: %s\", err)\n\t\t}\n\t\treq.Close = true\n\n\t\t// Set headers\n\t\tfor key, value := range ping.Headers {\n\t\t\treq.Header.Set(key, value)\n\t\t}\n\n\t\t// Fire & calculate elapsed ms\n\t\tstart := time.Now().UnixNano()\n\t\tresponse, err := client.Do(req)\n\t\telapsed := getElapsedTimeInMS(start)\n\t\tpong.Time = elapsed\n\n\t\t// Any error?\n\t\tif err != nil {\n\t\t\tpong.Response = fmt.Sprintf(\"[aPing] The HTTP request failed with error: %s\", err)\n\t\t} else {\n\t\t\tif *responseFlag {\n\t\t\t\tdata, _ := ioutil.ReadAll(response.Body)\n\t\t\t\t// Trim all line breaks from the response for better output\n\t\t\t\tre := regexp.MustCompile(`\\r?\\n`)\n\t\t\t\tbodyData := re.ReplaceAllString(string(data), \" \")\n\t\t\t\t// Store response\n\t\t\t\tpong.Response = bodyData\n\t\t\t\t_ = response.Body.Close()\n\t\t\t}\n\t\t}\n\n\t\t// Collect the pongs\n\t\tcollectPong(pong)\n\n\t\t// Clear & Count up\n\t\tprogressTracker.Increment(1)\n\t\twaitGroup.Done()\n\t\t// Return to the source Neo\n\t\tpingPool.Put(ping)\n\t}\n}", "title": "" }, { "docid": "9882440c64cea08b038392f441c65307", "score": "0.3675956", "text": "func (self *MultiplayerManager) EnableAircraftLabels() {\n\tself.renderAircraftLabels = true\n}", "title": "" }, { "docid": "31d71a8fcefcc0fa5d1a3559929ecd49", "score": "0.36634746", "text": "func (e *Endpoint) dispatchLoop() {\n\te.wg.Add(1)\n\tdefer e.wg.Done()\n\n\tfor {\n\t\tpacket := make([]byte, e.mtu)\n\t\tn, err := e.rwc.Read(packet)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\tif !e.IsAttached() {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar p tcpip.NetworkProtocolNumber\n\t\tswitch header.IPVersion(packet) {\n\t\tcase header.IPv4Version:\n\t\t\tp = header.IPv4ProtocolNumber\n\t\tcase header.IPv6Version:\n\t\t\tp = header.IPv6ProtocolNumber\n\t\t}\n\n\t\te.dispatcher.DeliverNetworkPacket(\"\", \"\", p, &stack.PacketBuffer{\n\t\t\tData: buffer.View(packet[:n]).ToVectorisedView(),\n\t\t})\n\t}\n}", "title": "" }, { "docid": "be6b10beaa2728090395479759cf4439", "score": "0.36629853", "text": "func main() {\n\tvar queue GameResources.Queue\n\tvar newMap [][]GameResources.GameTile\n\tvar blueRobot GameResources.Robot\n\tvar redRobot GameResources.Robot\n\tvar yellowRobot GameResources.Robot\n\tvar greenRobot GameResources.Robot\n\tvar GameDataInstance = GameUI.GetGameMapDataSingleton()\n\tnodesInstance := GameResources.GetNodesSingleton()\n\tInitMapTile(&newMap)\n\tSetWall(newMap)\n\tSetDestination(newMap)\n\tSetDefaultRobot(newMap, &blueRobot, &redRobot, &yellowRobot, &greenRobot)\n\n\tvar startNode = GameResources.Node{0, blueRobot, redRobot, yellowRobot, greenRobot, newMap, nil, \"\", \"\"}\n\t// nodesInstance.CurrNode = startNode\n\tnodesInstance.SetCurrNode(startNode)\n\t// GameResources.CURR_NODE = startNode\n\tMakeGameMap(startNode, newMap, &queue)\n\t// ShowNodeState(startNode)\n\t// startNode.ShowNodeState()\n\tGameUI.ShowNodeState(&startNode)\n\n\tGameDataInstance.GameWindow.ShowAndRun()\n\n\t// findNode := FindPath(startNode)\n\t// fmt.Println(findNode.Depth)\n\n\t// startTime := time.Now()\n\t// var node *GameResources.Node\n\t// var count = 0\n\t// // var wg sync.WaitGroup\n\t// // messages := make(chan *GameResources.Node)\n\t// for {\n\t// // wg.Add(1)\n\t//\n\t// // go func() {\n\t// // defer wg.Done()\n\t// // messages <- startNode.MoveRobots(&queue, count)\n\t// // }()\n\t//\n\t// findNode := startNode.MoveRobots(&queue, count)\n\t// if findNode != nil {\n\t// node = findNode\n\t// break\n\t// }\n\t// count++\n\t// }\n\t// // go func() {\n\t// // for i := range messages {\n\t// // fmt.Println(\"??????????????????????\")\n\t// // fmt.Println(i)\n\t// // fmt.Println(\"??????????????????????\")\n\t// // }\n\t// // }()\n\t// // wg.Wait()\n\t// nn := node\n\t// for {\n\t// fmt.Println(\"------------------HISTORY-----------------\")\n\t// nn.PrintCurrentPosition()\n\t// if nn.ParentNode == nil {\n\t// fmt.Println(\"PARENT NIL\")\n\t// break\n\t// }\n\t// nn = nn.ParentNode\n\t// }\n\t// endTime := time.Now()\n\t// fmt.Println(\"################################\")\n\t// fmt.Println(endTime.Sub(startTime))\n\t// fmt.Println(\"COUNT : \", count)\n\t// fmt.Println(\"DEPTH : \", node.Depth)\n\t// fmt.Println(\"################################\")\n}", "title": "" }, { "docid": "fa018d50d6417d327c5a9a8634aefb45", "score": "0.36613524", "text": "func (s *Swarm) tick() {\n\tpositions := map[vector][]int{}\n\tfor i, p := range s.p {\n\t\tif p.present {\n\t\t\tp.vel.x += p.acc.x\n\t\t\tp.vel.y += p.acc.y\n\t\t\tp.vel.z += p.acc.z\n\t\t\tp.pos.x += p.vel.x\n\t\t\tp.pos.y += p.vel.y\n\t\t\tp.pos.z += p.vel.z\n\t\t\tif s.collisions {\n\t\t\t\tpositions[p.pos] = append(positions[p.pos], i)\n\t\t\t}\n\t\t}\n\t}\n\tif s.collisions {\n\t\t// every hash value with more than 1 entry is a set of colliding particles\n\t\tfor _, v := range positions {\n\t\t\tif len(v) > 1 {\n\t\t\t\tfor _, i := range v {\n\t\t\t\t\ts.p[i].present = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "cceeecd746ff8336cdd80364b5226c68", "score": "0.36600563", "text": "func (la *Label) labelPass2() {\n\n\tr := la.rows\n\tc := la.cols\n\n\tfor i := 0; i < r; i++ {\n\t\tfor j := 0; j < c; j++ {\n\t\t\ty := la.mask[i*c+j]\n\t\t\tif y != 0 {\n\t\t\t\tla.labels[i*c+j] = la.uf.Find(la.labels[i*c+j])\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "441c133a97b435577bba83f37c7ad987", "score": "0.3659518", "text": "func (n *Patch) Fetch(t Target) {\n\tfor y := 0; y < NinePatchSide; y++ {\n\t\tfor x := 0; x < NinePatchSide; x++ {\n\t\t\tt.Accept(n.s[y][x].data[:], SpriteIndices)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a800463468d574ede170cbf4771abb9b", "score": "0.3656566", "text": "func (c *Canvas) ReplayOn(dst vg.Canvas) error {\n\tif c.fonts == nil {\n\t\tc.fonts = make(map[fontID]font.Face)\n\t}\n\tif c.cache == nil {\n\t\tc.cache = font.NewCache(liberation.Collection())\n\t}\n\tfor _, a := range c.Actions {\n\t\tfa, ok := a.(*FillString)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tf := fontID{name: fa.Font.Name(), size: fa.Size}\n\t\tif _, exists := c.fonts[f]; !exists {\n\t\t\tif !c.cache.Has(fa.Font) {\n\t\t\t\treturn fmt.Errorf(\"unknown font: %s\", fa.Font.Typeface)\n\t\t\t}\n\t\t\tface := c.cache.Lookup(\n\t\t\t\tfa.Font,\n\t\t\t\tfa.Size,\n\t\t\t)\n\t\t\tc.fonts[f] = face\n\t\t}\n\t\tfa.fonts = c.fonts\n\t}\n\tfor _, a := range c.Actions {\n\t\ta.ApplyTo(dst)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "acf86bcb735ea2db85ee169bc9393db6", "score": "0.36535826", "text": "func (ws *WhanauServer) ConstructFingers(layer int) []Finger {\n\t//start := time.Now()\n\t//defer fmt.Printf(\"CONSTRUCTFINGERS in server %v took %v\\n\",\n\t//ws.myaddr, time.Since(start))\n\n\tDPrintf(\"In ConstructFingers of %s, layer %d\", ws.myaddr, layer)\n\tfingers := make([]Finger, 0, ws.rf*2)\n\tfor i := 0; i < ws.rf; i++ {\n\t\targs := &RandomWalkArgs{ws.w}\n\t\treply := &RandomWalkReply{}\n\n\t\t// Keep trying until succeed or timeout\n\t\tcounter := 0\n\t\tfor reply.Err != OK && counter < TIMEOUT {\n\t\t\tws.RandomWalk(args, reply)\n\t\t\tcounter++\n\t\t}\n\n\t\tserver := reply.Server\n\n\t\t// get id of server using rpc call to that server\n\t\tgetIdArg := &GetIdArgs{layer}\n\t\tgetIdReply := &GetIdReply{}\n\t\tok := false\n\n\t\t// block until succeeds\n counter = 0\n\t\tfor (!ok || (getIdReply.Err != OK)) && counter < TIMEOUT {\n\t\t\tDPrintf(\"rpc to getid of %s from ConstructFingers %s layer %d\", server, ws.myaddr, layer)\n\t\t\tok = call(server, \"WhanauServer.GetId\", getIdArg, getIdReply)\n\t\t\tcounter++\n\t\t}\n\n\t\tif getIdReply.Err == OK {\n\t\t\tfinger := Finger{getIdReply.Key, server}\n\t\t\tfingers = append(fingers, finger)\n\t\t}\n\t}\n\n\treturn fingers\n}", "title": "" }, { "docid": "739c6e51bd8e29a8d979cdf56bb31e52", "score": "0.36516288", "text": "func (self *UtilsDebug) Text1O(text string, x int, y int, color string) {\n self.Object.Call(\"text\", text, x, y, color)\n}", "title": "" }, { "docid": "854a4356745aea5dbf55c4951fb91849", "score": "0.36512128", "text": "func (s *Scanner) ScanPeople(crowd *geo.Map) {\n\tvar lastPoint *sweep.ScanSample\n\n\tvar aggregate struct {\n\t\tstartAngle float64\n\t\tstartDist int\n\n\t\tcount int\n\t\tstrength int\n\t\tsumX float64\n\t\tsumY float64\n\t}\n\n\tscan := <-s.scan\n\tcrowd.Lock()\n\tdefer crowd.Unlock()\n\tcrowd.Clear()\n\n\tfor _, point := range scan {\n\t\tif point.Angle > s.maxAngle || point.Angle < s.minAngle {\n\t\t\tcontinue\n\t\t}\n\n\t\tif lastPoint == nil {\n\t\t\taggregate.count = 1\n\t\t\taggregate.strength = int(point.SignalStrength)\n\t\t\taggregate.sumX, aggregate.sumY = point.Cartesian()\n\t\t\taggregate.startDist = point.Distance\n\t\t\taggregate.startAngle = point.Rad()\n\t\t\tlastPoint = point\n\t\t\tcontinue\n\t\t}\n\n\t\tif abs(point.Distance-lastPoint.Distance) > maxDiff ||\n\t\t\tmath.Abs(lastPoint.Rad()-point.Rad())*float64(point.Distance) > maxArc ||\n\t\t\tabs(point.Distance-aggregate.startDist) > maxTotalDiff ||\n\t\t\tmath.Abs(point.Rad()-aggregate.startAngle)*float64(point.Distance) > maxTotalWidth {\n\t\t\t// fmt.Println(aggregate.count)\n\t\t\tif distComp-(lastPoint.Distance/100) < aggregate.count {\n\t\t\t\tcrowd.Add(geo.NewPoint(\n\t\t\t\t\tint(aggregate.sumX/float64(aggregate.count)),\n\t\t\t\t\tint(aggregate.sumY/float64(aggregate.count)),\n\t\t\t\t\t&PointMeta{\n\t\t\t\t\t\tStrength: aggregate.strength / aggregate.count,\n\t\t\t\t\t},\n\t\t\t\t))\n\t\t\t}\n\n\t\t\taggregate.count = 1\n\t\t\taggregate.strength = int(point.SignalStrength)\n\t\t\taggregate.sumX, aggregate.sumY = point.Cartesian()\n\t\t\taggregate.startDist = point.Distance\n\t\t\taggregate.startAngle = point.Rad()\n\t\t\tlastPoint = point\n\t\t\tcontinue\n\t\t}\n\n\t\t// fmt.Println(\"diff:\", math.Abs(lastPoint.Angle-point.Angle), float64(point.Distance))\n\n\t\taggregate.count++\n\t\tx, y := point.Cartesian()\n\t\taggregate.sumX += x\n\t\taggregate.sumY += y\n\t\taggregate.strength += int(point.SignalStrength)\n\t\tlastPoint = point\n\t}\n\n\tif lastPoint == nil {\n\t\treturn\n\t}\n\n\t// fmt.Println(\"strength:\", aggregate.strength)\n\n\tif distComp-(lastPoint.Distance/100) < aggregate.count {\n\t\tcrowd.Add(geo.NewPoint(\n\t\t\tint(aggregate.sumX/float64(aggregate.count)),\n\t\t\tint(aggregate.sumY/float64(aggregate.count)),\n\t\t\t&PointMeta{\n\t\t\t\tStrength: aggregate.strength / aggregate.count,\n\t\t\t},\n\t\t))\n\t}\n}", "title": "" }, { "docid": "5b3f2fd0e3aece624dd9870d0023dc18", "score": "0.36473364", "text": "func RunContainerAndCollectOutput(imageName string, entrypoint, command []string, gpuDevices []string) (io.ReadCloser, error) {\n\n\t// Go through all commands and see if any of them correspond to a file. If yes, mount it to\n\t// the container and remap the command argument.\n\tremappedCommand := make([]string, len(command))\n\tbindsMap := map[string]interface{}{}\n\ttargetDirsMap := map[string]interface{}{}\n\tbinds := []string{}\n\tfor i := range command {\n\n\t\tif strings.HasPrefix(command[i], MntPrefix) {\n\n\t\t\tcommand[i] = strings.TrimPrefix(command[i], MntPrefix)\n\n\t\t\tif stats, err := os.Stat(command[i]); err == nil {\n\n\t\t\t\t// Get absolute path.\n\t\t\t\tabsPath, err := filepath.Abs(command[i])\n\t\t\t\tif err != nil {\n\t\t\t\t\terr = errors.Wrap(err, \"absolute path inference failed\")\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\n\t\t\t\t// If it is a directory, we can immediately mount it. Otherwise we mount the parent.\n\t\t\t\tvar mapping string\n\t\t\t\tif stats.IsDir() {\n\t\t\t\t\tdirName := filepath.Base(absPath)\n\n\t\t\t\t\t// If this dirname was already mounted, we rename it by appending underscores.\n\t\t\t\t\tfor {\n\t\t\t\t\t\tif _, ok := targetDirsMap[dirName]; ok {\n\t\t\t\t\t\t\tdirName = dirName + \"_\"\n\t\t\t\t\t\t} else {\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\ttargetDirsMap[dirName] = nil\n\n\t\t\t\t\tmountedPath := filepath.Join(\"/mnt\", dirName)\n\n\t\t\t\t\tremappedCommand[i] = mountedPath\n\t\t\t\t\tmapping = fmt.Sprintf(\"%s:%s\", absPath, mountedPath)\n\n\t\t\t\t} else {\n\t\t\t\t\tfileName := filepath.Base(absPath)\n\t\t\t\t\tparentPath := filepath.Dir(absPath)\n\t\t\t\t\tdirName := filepath.Base(parentPath)\n\n\t\t\t\t\t// If this dirname was already mounted, we rename it by appending underscores.\n\t\t\t\t\tfor {\n\t\t\t\t\t\tif _, ok := targetDirsMap[dirName]; ok {\n\t\t\t\t\t\t\tdirName = dirName + \"_\"\n\t\t\t\t\t\t} else {\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\ttargetDirsMap[dirName] = nil\n\n\t\t\t\t\tmountedPath := filepath.Join(\"/mnt\", dirName)\n\n\t\t\t\t\tremappedCommand[i] = filepath.Join(mountedPath, fileName)\n\t\t\t\t\tmapping = fmt.Sprintf(\"%s:%s\", parentPath, mountedPath)\n\n\t\t\t\t}\n\n\t\t\t\t// Add to binds if it doesn't exist yet.\n\t\t\t\tif _, ok := bindsMap[mapping]; ok == false {\n\t\t\t\t\tbindsMap[mapping] = nil\n\t\t\t\t\tbinds = append(binds, mapping)\n\t\t\t\t}\n\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t// We consider it not to be a file path.\n\t\tremappedCommand[i] = command[i]\n\n\t}\n\n\t// Assemble the host config with appropriate binds.\n\thostConfig := container.HostConfig{\n\t\tBinds: binds,\n\t}\n\n\t// If GPU devices were specified, we need to add the appropriate device requests to the host config.\n\tif gpuDevices != nil && len(gpuDevices) > 0 {\n\n\t\t// We will convert the input slice to a map to prevent duplicates.\n\t\tgpuDevicesMap := make(map[string]struct{}, len(gpuDevices))\n\t\tfor _, s := range gpuDevices {\n\t\t\tgpuDevicesMap[s] = struct{}{}\n\t\t}\n\n\t\t// Check if -1 is in the list, which maps to all devices. Otherwise we list the specific device IDs.\n\t\t_, ok := gpuDevicesMap[\"-1\"]\n\t\tvar deviceRequest container.DeviceRequest\n\t\tif ok {\n\t\t\tdeviceRequest = container.DeviceRequest{\n\t\t\t\tCount: -1,\n\t\t\t\tCapabilities: [][]string{[]string{\"gpu\"}},\n\t\t\t}\n\t\t} else {\n\t\t\tdeviceIDs := make([]string, 0, len(gpuDevicesMap))\n\t\t\tfor id := range gpuDevicesMap {\n\t\t\t\tdeviceIDs = append(deviceIDs, id)\n\t\t\t}\n\t\t\tdeviceRequest = container.DeviceRequest{\n\t\t\t\tDeviceIDs: deviceIDs,\n\t\t\t\tCapabilities: [][]string{[]string{\"gpu\"}},\n\t\t\t}\n\t\t}\n\n\t\t// Add the device requests to the host config.\n\t\thostConfig.Resources = container.Resources{DeviceRequests: []container.DeviceRequest{deviceRequest}}\n\t}\n\n\t// TODO Find a proper place to store the username, we should create username string once\n\tcurrentUser, err := user.Current()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tusername:= currentUser.Uid+\":\"+ currentUser.Gid\n\n\tctx := context.Background()\n\tcli := GetDockerClient()\n\tresp, err := cli.ContainerCreate(ctx, &container.Config{\n\t\tImage: imageName,\n\t\tEntrypoint: entrypoint,\n\t\tCmd: remappedCommand,\n\t\tUser:\t\tusername,\n\t\tTty: true,\n\t}, &hostConfig, nil, \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer func() {\n\t\tcli.ContainerRemove(\n\t\t\tcontext.Background(),\n\t\t\tresp.ID,\n\t\t\ttypes.ContainerRemoveOptions{Force: true, RemoveVolumes: true})\n\t}()\n\n\tif err := cli.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{}); err != nil {\n\t\tpanic(err)\n\t}\n\n\tstatusCh, errCh := cli.ContainerWait(ctx, resp.ID, container.WaitConditionNotRunning)\n\tselect {\n\tcase err := <-errCh:\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\tcase <-statusCh:\n\t}\n\n\tout, err := cli.ContainerLogs(ctx, resp.ID, types.ContainerLogsOptions{ShowStdout: true})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn out, nil\n}", "title": "" }, { "docid": "2c25cbdc9f036d595835e230251f50a6", "score": "0.36397377", "text": "func labelPod(rayNodeType rayiov1alpha1.RayNodeType, rayClusterName string, groupName string, labels map[string]string) (ret map[string]string) {\n\tif labels == nil {\n\t\tlabels = make(map[string]string)\n\t}\n\n\tret = map[string]string{\n\t\tRayNodeLabelKey: \"yes\",\n\t\tRayClusterLabelKey: rayClusterName,\n\t\tRayNodeTypeLabelKey: string(rayNodeType),\n\t\tRayNodeGroupLabelKey: groupName,\n\t\tRayIDLabelKey: utils.CheckLabel(utils.GenerateIdentifier(rayClusterName, rayNodeType)),\n\t}\n\n\tfor k, v := range ret {\n\t\tif k == string(rayNodeType) {\n\t\t\t// overriding invalide values for this label\n\t\t\tif v != string(rayiov1alpha1.HeadNode) && v != string(rayiov1alpha1.WorkerNode) {\n\t\t\t\tlabels[k] = v\n\t\t\t}\n\t\t}\n\t\tif k == RayNodeGroupLabelKey {\n\t\t\t// overriding invalide values for this label\n\t\t\tif v != groupName {\n\t\t\t\tlabels[k] = v\n\t\t\t}\n\t\t}\n\t\tif _, ok := labels[k]; !ok {\n\t\t\tlabels[k] = v\n\t\t}\n\t}\n\treturn labels\n}", "title": "" }, { "docid": "cd50770affd94791465cd4ee5aa97f35", "score": "0.36357263", "text": "func (c *controller) runCatRound() {\n\tif time.Since(c.lastRound) < c.net.conf.RoundTime {\n\t\treturn\n\t}\n\tc.lastRound = time.Now()\n\tc.logger.Debug(\"Cat Round\")\n\tc.rounds++\n\tif c.net.prom != nil {\n\t\tc.net.prom.CatRounds.Inc()\n\t}\n\n\tif err := c.writePeerCache(); err != nil {\n\t\tc.logger.WithError(err).Errorf(\"unable to write peer cache to disk\")\n\t}\n\n\tpeers := c.peers.Slice()\n\n\ttoDrop := len(peers) - int(c.net.conf.DropTo) // current - target amount\n\n\tif toDrop > 0 {\n\t\tperm := c.net.rng.Perm(len(peers))\n\n\t\tdropped := 0\n\t\tfor _, i := range perm {\n\t\t\tif c.isSpecial(peers[i].Endpoint) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpeers[i].Stop()\n\t\t\tdropped++\n\t\t\tif dropped >= toDrop {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b1889d6df78bee84aa76f16876e880a0", "score": "0.36343133", "text": "func run(input string) (interface{}, interface{}) {\n\t// graphic rendering config\n\ttwod.RenderingMap = map[interface{}]color.Color{\n\t\t'#': colornames.Black,\n\t\t'.': colornames.Yellow,\n\t\t'L': colornames.Green,\n\t}\n\ttwod.SetFPS(15)\n\n\tm := twod.NewMapFromInput(input)\n\tpart1 := solve(m.Clone(), 4, occupied)\n\tpart2 := solve(m, 5, occupied2)\n\treturn part1, part2\n}", "title": "" }, { "docid": "ba5f24cea762aae65a0bcdffb0f7a86b", "score": "0.36342254", "text": "func (evol *PSO) Run() {\n\tfor !evol.IsTerminated() {\n\t\tevol.Evolve()\n\t}\n}", "title": "" }, { "docid": "bd5c0f30bf96c77bd45150ccd1df5092", "score": "0.36315358", "text": "func (d Dielectric) reflectance(cosine, refIdx float64) float64 {\n\tr0 := (1 - refIdx) / (1 + refIdx)\n\tr0 = r0 * r0\n\treturn r0 + (1-r0)*math.Pow(1-cosine, 5)\n}", "title": "" }, { "docid": "f5ef1e1768dfc0dafc630da5a4702dca", "score": "0.3628189", "text": "func (r *resolver) conntrackRunner() {\n\t// @TODO move this to a netlink-native implementation\n\tcmd := exec.Command(\"conntrack\", \"-E\")\n\tstdout, err := cmd.StdoutPipe()\n\n\tif err != nil {\n\t\tr.errChan <- err\n\t\treturn\n\t}\n\tdefer stdout.Close()\n\n\t// Create reader\n\trd := bufio.NewReader(stdout)\n\n\t// Start execution\n\tif err := cmd.Start(); err != nil {\n\t\tr.errChan <- err\n\t\treturn\n\t}\n\n\tfor {\n\t\t// Check for exit condition\n\t\tselect {\n\t\tcase <-r.exitChan:\n\t\t\tbreak\n\t\tdefault:\n\t\t}\n\n\t\t// Read a line from the conntrack output\n\t\tl, err := rd.ReadString('\\n')\n\t\tif err != nil {\n\t\t\tr.errChan <- err\n\t\t\tbreak\n\t\t}\n\n\t\t// Try to parse the readline\n\t\te, err := parser.ParseConntrackEvent(l)\n\t\t// If it could be parsed, pass it on to the conntrack event handler\n\t\tif err == nil {\n\t\t\tgo r.handleConntrackEvent(e)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a452ba5c5e342d573a7cd5518026cffc", "score": "0.36247092", "text": "func main() {\n\tvar v Velocity\n\tvar p Point\n\tvar loop = 1\n\tfor {\n\t\t// nextCheckpointX: x position of the next check point\n\t\t// nextCheckpointY: y position of the next check point\n\t\t// nextCheckpointDist: distance to the next checkpoint\n\t\t// nextCheckpointAngle: angle between your pod orientation and the direction of the next checkpoint\n\t\tvar x, y, nextCheckpointX, nextCheckpointY, nextCheckpointDist, nextCheckpointAngle float64\n\t\tfmt.Scan(&x, &y, &nextCheckpointX, &nextCheckpointY, &nextCheckpointDist, &nextCheckpointAngle)\n\t\tfmt.Fprintf(os.Stderr, \"### T O U R %d ###\\n\", loop*2)\n\t\tfmt.Fprintf(os.Stderr, \"x: %f; y: %f, d: %f, a: %f\\n\", x, y, nextCheckpointDist, nextCheckpointAngle)\n\n\t\tvar opponentX, opponentY int\n\t\tfmt.Scan(&opponentX, &opponentY)\n\n\t\tthrust, boost := getThrust(nextCheckpointAngle, nextCheckpointDist)\n\t\tvar angle = getAngle(Point{x, y}, Point{nextCheckpointX, nextCheckpointY})\n\t\tp = Point{x, y}\n\t\tfor i := loop + 1; i < loop+2; i++ {\n\t\t\tfmt.Fprintf(os.Stderr, \"- simulation loop %d ###\\n\", i*2)\n\t\t\tp, v = play(p, Point{nextCheckpointX, nextCheckpointY}, angle+nextCheckpointAngle, thrust, v)\n\t\t}\n\n\t\tloop++\n\t\t// You have to output the target position\n\t\t// followed by the power (0 <= thrust <= 100)\n\t\t// i.e.: \"x y thrust\"\n\t\tif boost == true && boostAvailable == true {\n\t\t\tfmt.Printf(\"%d %d BOOST BOOST\\n\", int(nextCheckpointX), int(nextCheckpointY))\n\t\t\tboostAvailable = false\n\t\t} else {\n\t\t\tfmt.Printf(\"%d %d %d (%d,%d°,%d)\\n\", int(nextCheckpointX), int(nextCheckpointY), int(thrust), int(thrust), int(nextCheckpointAngle), int(nextCheckpointDist))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "73500bd51ef2028e849110c89645c488", "score": "0.36230206", "text": "func (mc *MeshCatalog) repeater() {\n\tlastUpdateAt := time.Now().Add(-1 * updateAtMostEvery)\n\tfor {\n\t\tcases, caseNames := mc.getCases()\n\t\tfor {\n\t\t\tif chosenIdx, message, ok := reflect.Select(cases); ok {\n\t\t\t\tif ann, ok := message.Interface().(announcements.Announcement); ok {\n\t\t\t\t\tmc.handleAnnouncement(ann)\n\t\t\t\t}\n\n\t\t\t\tlog.Info().Msgf(\"[repeater] Received announcement from %s\", caseNames[chosenIdx])\n\t\t\t\tdelta := time.Since(lastUpdateAt)\n\t\t\t\tif delta >= updateAtMostEvery {\n\t\t\t\t\tmc.broadcast(message)\n\t\t\t\t\tlastUpdateAt = time.Now()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1f6990f438c7f815137c43210c373fc7", "score": "0.36222172", "text": "func handlePacket(\n\tconntable *connectionTable,\n\tpackets chan *packetData,\n\tlogC chan dnsLogEntry,\n\tsyslogPriority string,\n\tgcInterval time.Duration,\n\tgcAge time.Duration,\n\tthreadNum int,\n\tstats *statsd.StatsdBuffer) {\n\n\t//TCP reassembly init\n\tstreamFactory := &dnsStreamFactory{}\n\tstreamPool := tcpassembly.NewStreamPool(streamFactory)\n\tassembler := tcpassembly.NewAssembler(streamPool)\n\tticker := time.Tick(time.Minute)\n\n\tfor {\n\t\tselect {\n\t\tcase packet, more := <-packets:\n\n\t\t\t//used for clean shutdowns\n\t\t\tif !more {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\terr := packet.Parse()\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Debugf(\"Error parsing packet: %s\", err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsrcIP := packet.GetSrcIP()\n\t\t\tdstIP := packet.GetDstIP()\n\n\t\t\tvar packetTime time.Time\n\n\t\t\tif packet.GetTimestamp() != nil {\n\t\t\t\tpacketTime = *packet.GetTimestamp()\n\t\t\t} else {\n\t\t\t\tlog.Debug(\"Adding wall time not packet time to message.\")\n\t\t\t\tif stats != nil {\n\t\t\t\t\tstats.Incr(strconv.Itoa(threadNum)+\".packet_wall_time\", 1)\n\t\t\t\t}\n\t\t\t\tpacketTime = time.Now()\n\t\t\t}\n\n\t\t\t//All TCP goes to reassemble. This is first because a single packet DNS request will parse as DNS\n\t\t\t//But that will leave the connection hanging around in memory, because the inital handshake won't\n\t\t\t//parse as DNS, nor will the connection closing.\n\n\t\t\tif packet.IsTCPStream() {\n\t\t\t\t//TODO Make them real\n\t\t\t\tsrcPort := \"0\"\n\t\t\t\tdstPort := \"0\"\n\n\t\t\t\thandleDns(conntable,\n\t\t\t\t\tpacket.GetDNSLayer(),\n\t\t\t\t\tlogC,\n\t\t\t\t\tsyslogPriority,\n\t\t\t\t\tsrcIP,\n\t\t\t\t\tsrcPort,\n\t\t\t\t\tdstPort,\n\t\t\t\t\tdstIP,\n\t\t\t\t\tpacket.GetSize(),\n\t\t\t\t\tpacket.GetProto(),\n\t\t\t\t\tpacketTime,\n\t\t\t\t\tstats)\n\t\t\t} else if packet.HasTCPLayer() {\n\t\t\t\tassembler.AssembleWithTimestamp(\n\t\t\t\t\tpacket.GetIPLayer().NetworkFlow(),\n\t\t\t\t\tpacket.GetTCPLayer(), *packet.GetTimestamp())\n\t\t\t\tcontinue\n\t\t\t} else if packet.HasDNSLayer() {\n\t\t\t\t// these are reversed because they are over the wire.\n\t\t\t\tsrcPort := strconv.Itoa(int(packet.udpLayer.DstPort))\n\t\t\t\tdstPort := strconv.Itoa(int(packet.udpLayer.SrcPort))\n\t\t\t\thandleDns(conntable,\n\t\t\t\t\tpacket.GetDNSLayer(),\n\t\t\t\t\tlogC,\n\t\t\t\t\tsyslogPriority,\n\t\t\t\t\tsrcIP,\n\t\t\t\t\tsrcPort,\n\t\t\t\t\tdstPort,\n\t\t\t\t\tdstIP,\n\t\t\t\t\tpacket.GetSize(),\n\t\t\t\t\tpacket.GetProto(),\n\t\t\t\t\tpacketTime,\n\t\t\t\t\tstats)\n\t\t\t\tif stats != nil {\n\t\t\t\t\tstats.Incr(strconv.Itoa(threadNum)+\".dns_lookups\", 1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//UDP and doesn't parse as DNS?\n\t\t\t\tlog.Debug(\"Missing a DNS layer?\")\n\t\t\t}\n\t\tcase <-ticker:\n\t\t\t// Every minute, flush connections that haven't seen activity in the past 2 minutes.\n\t\t\tassembler.FlushOlderThan(time.Now().Add(time.Minute * -2))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a6252b511fac8a05e964959ccf3d3942", "score": "0.36194792", "text": "func (r *Reconciler) ReconcileKind(ctx context.Context, pac *v1alpha1.OpenShiftPipelinesAsCode) pkgreconciler.Event {\n\tlogger := logging.FromContext(ctx).With(\"name\", pac.GetName())\n\tpac.Status.InitializeConditions()\n\tpac.Status.SetVersion(r.pacVersion)\n\n\tif pac.GetName() != v1alpha1.OpenShiftPipelinesAsCodeName {\n\t\tmsg := fmt.Sprintf(\"Resource ignored, Expected Name: %s, Got Name: %s\",\n\t\t\tv1alpha1.OpenShiftPipelinesAsCodeName,\n\t\t\tpac.GetName(),\n\t\t)\n\t\tlogger.Error(msg)\n\t\tpac.Status.MarkNotReady(msg)\n\t\treturn nil\n\t}\n\n\t//Make sure TektonPipeline is installed before proceeding with OpenShiftPipelinesAsCode\n\tif _, err := common.PipelineReady(r.pipelineInformer); err != nil {\n\t\tif err.Error() == common.PipelineNotReady || err == v1alpha1.DEPENDENCY_UPGRADE_PENDING_ERR {\n\t\t\tpac.Status.MarkDependencyInstalling(\"tekton-pipelines is still installing\")\n\t\t\t// wait for pipeline status to change\n\t\t\treturn v1alpha1.REQUEUE_EVENT_AFTER\n\t\t}\n\t\t// (tektonpipeline.operator.tekton.dev instance not available yet)\n\t\tpac.Status.MarkDependencyMissing(\"tekton-pipelines does not exist\")\n\t\treturn err\n\t}\n\tpac.Status.MarkDependenciesInstalled()\n\n\tif err := r.extension.PreReconcile(ctx, pac); err != nil {\n\t\treturn err\n\t}\n\n\t//Mark PreReconcile Complete\n\tpac.Status.MarkPreReconcilerComplete()\n\n\tif err := r.installerSetClient.MainSet(ctx, pac, &r.manifest, filterAndTransform(r.extension)); err != nil {\n\t\tmsg := fmt.Sprintf(\"Main Reconcilation failed: %s\", err.Error())\n\t\tlogger.Error(msg)\n\t\tif err == v1alpha1.REQUEUE_EVENT_AFTER {\n\t\t\treturn err\n\t\t}\n\t\tpac.Status.MarkInstallerSetNotReady(msg)\n\t\treturn nil\n\t}\n\n\tif err := r.extension.PostReconcile(ctx, pac); err != nil {\n\t\tmsg := fmt.Sprintf(\"PostReconciliation failed: %s\", err.Error())\n\t\tlogger.Error(msg)\n\t\tif err == v1alpha1.REQUEUE_EVENT_AFTER {\n\t\t\treturn err\n\t\t}\n\t\tpac.Status.MarkPostReconcilerFailed(msg)\n\t\treturn nil\n\t}\n\n\t// Mark PostReconcile Complete\n\tpac.Status.MarkPostReconcilerComplete()\n\treturn nil\n}", "title": "" } ]
96cff125e270da33ff23b23fbd03b7f9
HasTrustType returns a boolean if a field has been set.
[ { "docid": "ee58563fbe00bbbaa2102e933f461308", "score": "0.80256146", "text": "func (o *MicrosoftGraphDeviceDetail) HasTrustType() bool {\n\tif o != nil && o.TrustType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" } ]
[ { "docid": "e28e4457fb9e2e7dfd6f028559cee62c", "score": "0.6290456", "text": "func (m TradeCaptureReportRequest) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "2a002747bc417715022f79c272762837", "score": "0.61372626", "text": "func (m Advertisement) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "853c9446203eeae5c9acf2337009c1bc", "score": "0.60538715", "text": "func (m NewOrderSingle) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "137be774a348966dedce91a4f93bb3d7", "score": "0.60331196", "text": "func (m NoSettlInst) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "6daeb1b12892829d7c8ac47f3406f9f1", "score": "0.6025957", "text": "func (m MarketDataRequestReject) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "2fb92e912afa296fa0c6177b243ea647", "score": "0.60074574", "text": "func (o *LinkTokenCreateRequestUserStatedIncomeSource) HasPayType() bool {\n\tif o != nil && o.PayType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "2dcc24f89048cfb62fcbf6a1c3286fa3", "score": "0.5992441", "text": "func (ctx *Context) IsTrusted() bool {\n\treturn ctx.AuthType == ATTrusted\n}", "title": "" }, { "docid": "b8a408c56113bbc92fc32939b43ed5b6", "score": "0.5915221", "text": "func (o *AccountStore) HasLiabilityType() bool {\n\tif o != nil && o.LiabilityType.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "972c6df17d3fd2b3a5316c0a762b007e", "score": "0.59055156", "text": "func (m NoOrders) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "8abdfb524ea33ce62843cbde150fb3b6", "score": "0.5877388", "text": "func (o *MicrosoftGraphDeviceDetail) GetTrustTypeOk() (string, bool) {\n\tif o == nil || o.TrustType == nil {\n\t\tvar ret string\n\t\treturn ret, false\n\t}\n\treturn *o.TrustType, true\n}", "title": "" }, { "docid": "0a3b02ea8c6ca773c9c172e2cd0ccefe", "score": "0.5855169", "text": "func (m NoRelatedSym) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "0a3b02ea8c6ca773c9c172e2cd0ccefe", "score": "0.5855169", "text": "func (m NoRelatedSym) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "0a3b02ea8c6ca773c9c172e2cd0ccefe", "score": "0.5855169", "text": "func (m NoRelatedSym) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "f7f26dce701be38d2a5bc775f08cd1c5", "score": "0.5785361", "text": "func (m TradeCaptureReportRequest) HasTradeRequestType() bool {\n\treturn m.Has(tag.TradeRequestType)\n}", "title": "" }, { "docid": "8fa3f739501aac13729cadd10456b83f", "score": "0.57525593", "text": "func (o *CheckoutRequest) HasType() bool {\n\tif o != nil && !IsNil(o.Type) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9d069053966ea78af711576084baa8ad", "score": "0.5748083", "text": "func (m NoQuoteEntries) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "1ded7c67c5ffd0077a27cda7944b6b10", "score": "0.5728639", "text": "func (o *ApplicationLoadBalancerHttpRuleCondition) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c7100e0a91dcc9765705e81ab8b33a2e", "score": "0.5673008", "text": "func (o *CdnDnsRecord) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f7394bab567ca5962ed6bb1c4ac54586", "score": "0.5645429", "text": "func (o *Credentials) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c6b79f27cc738f5e922134d065195616", "score": "0.5635818", "text": "func (o *LicenseInfo) HasLicenseType() bool {\n\tif o != nil && o.LicenseType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c04a694ac8ce5639f691f71307ea2bb0", "score": "0.5627109", "text": "func (m NoSettlInst) HasSettlInstTransType() bool {\n\treturn m.Has(tag.SettlInstTransType)\n}", "title": "" }, { "docid": "833f3ac08c06294d9455b8ed043c4450", "score": "0.56201047", "text": "func (o *Precondition) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7d7300ef7b7689b219732fbe5287b7b6", "score": "0.56161445", "text": "func (o *Account) HasLiabilityType() bool {\n\tif o != nil && o.LiabilityType.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "8c75b223605ed9a2b67979706c926623", "score": "0.56148183", "text": "func (s *SyntheticsTest) HasType() bool {\n\tif s != nil && s.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "80c1e549e9af23d89d0f5704eb1649b8", "score": "0.56050956", "text": "func (s *SyntheticsAssertion) HasType() bool {\n\tif s != nil && s.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bcbaed590be6b969e24b6f693f45159e", "score": "0.5593818", "text": "func (db *DB) IsTrustValid(id int64) (bool, error) {\n\trow := db.QueryRow(`SELECT trusted_ubuntu OR\n\t\t\t\t trusted_mozilla OR\n\t\t\t\t trusted_microsoft OR\n\t\t\t\t trusted_apple OR\n\t\t\t\t trusted_android\n\t\t\t FROM trust WHERE id=$1`, id)\n\tisValid := false\n\terr := row.Scan(&isValid)\n\treturn isValid, err\n}", "title": "" }, { "docid": "0f07c6c0727152c69a911f3d9682a07b", "score": "0.55737114", "text": "func (m AllocationReportAck) HasSecurityType() bool {\n\treturn m.Has(tag.SecurityType)\n}", "title": "" }, { "docid": "cc385d348a305c9f89949ecb0f48e876", "score": "0.55698776", "text": "func IsTrusted() bool {\n\treturn !untrusted\n}", "title": "" }, { "docid": "cc385d348a305c9f89949ecb0f48e876", "score": "0.55698776", "text": "func IsTrusted() bool {\n\treturn !untrusted\n}", "title": "" }, { "docid": "4467201570e3076c8d0ee79cc4c86d1b", "score": "0.55691487", "text": "func (o *MicrosoftGraphTargetResource) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9ddebc34283bec2e4968f6b1ac130fba", "score": "0.5563756", "text": "func (o *IosCompliancePolicy) HasPasscodeRequiredType() bool {\n\tif o != nil && o.PasscodeRequiredType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7b8e5011093fa3ad41b3e39c0319e23c", "score": "0.55493516", "text": "func (t *TileDefRequest) HasType() bool {\n\tif t != nil && t.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1130024af5fc8860e91f381365e951c8", "score": "0.5540039", "text": "func (m NoQuoteSets) HasUnderlyingSecurityType() bool {\n\treturn m.Has(tag.UnderlyingSecurityType)\n}", "title": "" }, { "docid": "a233cc852ec87e3456bd137296fee689", "score": "0.55353314", "text": "func (s *ServiceLevelObjective) HasType() bool {\n\tif s != nil && s.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "080942a2e0ae1da77f547248be498ad7", "score": "0.55176926", "text": "func (o *BillingResource) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ac4952556cd92567edb99b017221d7db", "score": "0.5514701", "text": "func checkTrust(lst []*AuthOptionItem) bool {\n\tfor _, item := range lst {\n\t\tif item.Auth == \"trust\" {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c4bd792699c29e9557dc6dba2e5877d9", "score": "0.5508", "text": "func (t *TraceServiceDefinition) HasType() bool {\n\tif t != nil && t.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "bd37fdac67356257d8989ff2b787b71a", "score": "0.54788184", "text": "func (o *Subscription) HasLicenseType() bool {\n\tif o != nil && o.LicenseType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f7474c84f5dd0718825f6e2cf07968d8", "score": "0.5472804", "text": "func (t *TileDefRequestStyle) HasType() bool {\n\tif t != nil && t.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "76fb2b8fbd41dd9d338a6353bd1592f5", "score": "0.54681724", "text": "func (o *ContractUser) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d7a47e31194a29345da8e826a6ab8a07", "score": "0.54616946", "text": "func (o *MicrosoftGraphDeviceDetail) SetTrustType(v string) {\n\to.TrustType = &v\n}", "title": "" }, { "docid": "5aca5193d2b84b42615bf985f944c5ec", "score": "0.5450398", "text": "func (i *IntegrationGCPCreateRequest) HasType() bool {\n\tif i != nil && i.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9dc6183e9fd2da1c1778c4475402ef09", "score": "0.54326123", "text": "func (n *Node) IsWithMetadataType() bool {\n\treturn n.nodeType&nodeTypeWithMetadata == nodeTypeWithMetadata\n}", "title": "" }, { "docid": "7a3b9c195f46fb7e462908607dd28c56", "score": "0.53951144", "text": "func (o *CustconfAuthUrlSign) HasPassPhraseField() bool {\n\tif o != nil && o.PassPhraseField != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c9f60ae554e94c5d6a2abecb81f1d961", "score": "0.5393353", "text": "func (o *StorageHitachiHostAllOf) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ff5cec0ae86a4c16d81953bfdfef1d0e", "score": "0.5387693", "text": "func (m NoSettlInst) HasSettlDeliveryType() bool {\n\treturn m.Has(tag.SettlDeliveryType)\n}", "title": "" }, { "docid": "03595c8e4ed53014a7c3d1801364a906", "score": "0.5384356", "text": "func (la Account) HasType(t Type) bool { return la.Type.Has(t) }", "title": "" }, { "docid": "befc0ed73c174d3b6bbf37b6ef31474c", "score": "0.5383922", "text": "func (m TradeCaptureReportRequest) HasRepoCollateralSecurityType() bool {\n\treturn m.Has(tag.RepoCollateralSecurityType)\n}", "title": "" }, { "docid": "63bc0347bbbb0c688d36dc7f5504c609", "score": "0.5379171", "text": "func (m Advertisement) HasAdvTransType() bool {\n\treturn m.Has(tag.AdvTransType)\n}", "title": "" }, { "docid": "f689454806d1036a585bd9d1a59227ad", "score": "0.53669065", "text": "func (o *ViewUser) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c2335d09d3101bf96ff971eb2e28df91", "score": "0.53642905", "text": "func (o *MicrosoftGraphDeviceDetail) GetTrustType() string {\n\tif o == nil || o.TrustType == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.TrustType\n}", "title": "" }, { "docid": "adbb9961d96110ac7458c358e83f56a7", "score": "0.536272", "text": "func (m NoRelatedSym) HasPriceType() bool {\n\treturn m.Has(tag.PriceType)\n}", "title": "" }, { "docid": "259ec7f14ef3aa10276cd69e02f005b6", "score": "0.5361538", "text": "func (o *Contract) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "c8e2422ba8b6a1d48dba87e914703061", "score": "0.5357822", "text": "func (o *MonitorRequestExecutionResult) HasTlsHandshakeTime() bool {\n\tif o != nil && o.TlsHandshakeTime != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dc2a294fa7ed5b9cbf3302e37762e929", "score": "0.5350825", "text": "func (t *TimeseriesRequest) HasDisplayType() bool {\n\tif t != nil && t.DisplayType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "73c14e1aed43c15ec1ed1c6b01ff6d2a", "score": "0.5342365", "text": "func (o *DhcpLeaseDataData) HasServerType() bool {\n\tif o != nil && o.ServerType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1887f213dda0af764caaa9499fab1528", "score": "0.53317684", "text": "func (o *Ga4ghTreatment) HasTreatmentPlanType() bool {\n\tif o != nil && o.TreatmentPlanType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "96debf002fc4abb71292d94640a34996", "score": "0.53307694", "text": "func (s *ScatterplotDefinition) HasType() bool {\n\tif s != nil && s.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9b1f5cddf2a9bce4c653983c00985ce0", "score": "0.5324225", "text": "func (r *Resp) HasType(t RespType) bool {\n\treturn r.typ&t > 0\n}", "title": "" }, { "docid": "96a7925f8f227f5c44885efb58489885", "score": "0.5323953", "text": "func (o *VirtualizationVmwareResourceAllocationSystemTrafficTypes) HasTrafficType() bool {\n\tif o != nil && o.TrafficType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a04fb2d2cc989ae946464984b8fe0b9a", "score": "0.53141165", "text": "func (m NoStipulations) HasStipulationType() bool {\n\treturn m.Has(tag.StipulationType)\n}", "title": "" }, { "docid": "e96c6dc84e6126339a0ff177d42364f3", "score": "0.5311484", "text": "func (c *CheckStatusDefinition) HasType() bool {\n\tif c != nil && c.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "19293d4f1857d9ecacaf3e228d59d10b", "score": "0.5305038", "text": "func (o *RequestTextFieldUpdateField) HasType() bool {\n\tif o != nil && !IsNil(o.Type) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "051ad11e1cfb55370d659055a3b477a3", "score": "0.53024715", "text": "func (o *LicenseLicenseInfoAllOf) HasLicenseType() bool {\n\tif o != nil && o.LicenseType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b6625d6559089e1e80e4efbafd8a9129", "score": "0.5292212", "text": "func (s *ServiceLevelObjectiveDefinition) HasType() bool {\n\tif s != nil && s.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "608b0cb2b2f0b19c5661dbb0bffec6c9", "score": "0.5290562", "text": "func (o *UpdateOrderDiscountLinesRequest) HasType() bool {\n\tif o != nil && !IsNil(o.Type) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "22a3b4ba1985e469584973d91206bcba", "score": "0.5287877", "text": "func (g *GraphDefinitionRequest) HasType() bool {\n\tif g != nil && g.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "4bba73925c643412cf35df06576f037d", "score": "0.5287176", "text": "func (o *CustomProfileField) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "50c3094ab3f1b0eec491daecdb748c6d", "score": "0.52643245", "text": "func (f *FreeTextDefinition) HasType() bool {\n\tif f != nil && f.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "922e55a60de67c127da1611370ecf38e", "score": "0.52494323", "text": "func (m NoQuoteSets) HasUnderlyingRepoCollateralSecurityType() bool {\n\treturn m.Has(tag.UnderlyingRepoCollateralSecurityType)\n}", "title": "" }, { "docid": "8453c8808297d731de17ae860e9b89c4", "score": "0.5248503", "text": "func (w *Widget) HasType() bool {\n\tif w != nil && w.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "acd4a5d1a15edf39066bb150028e09ca", "score": "0.5232991", "text": "func (o *Task) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "21df920cfebd13608ea1e65ddbb44b7a", "score": "0.52299875", "text": "func (u LedgerKey) GetTrust() (result LedgerKeyTrust, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"Trust\" {\n\t\tresult = *u.Trust\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "773c4e104840c7a7a276ca83362f6045", "score": "0.52240264", "text": "func (o *Share) HasTrustedNfsClients() bool {\n\tif o != nil && o.TrustedNfsClients != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b433ee8a3bfc8399bcd36a25e89a0832", "score": "0.5220924", "text": "func (d *Downtime) HasType() bool {\n\tif d != nil && d.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1b5596fcfdf059dc0f7147ace04dc8d4", "score": "0.5214488", "text": "func (g *GraphDefinitionRequestStyle) HasType() bool {\n\tif g != nil && g.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "49bde7aae8fe55d889bc1dae21cfcce5", "score": "0.521256", "text": "func (o *AccountStore) HasIncludeNetWorth() bool {\n\tif o != nil && o.IncludeNetWorth != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "ce328ff687cdc9365ba1361754120b95", "score": "0.52111924", "text": "func (o *Rule) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "312ca268add0412e3a3a81d66a724353", "score": "0.5209067", "text": "func (o *PackagesRequest) HasThirdParty() bool {\n\tif o != nil && o.ThirdParty != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a0e8a781884610f4ca51a28da0350b94", "score": "0.5199576", "text": "func (o *OrderResponseCheckout) HasType() bool {\n\tif o != nil && !IsNil(o.Type) {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "2d5b63d5ad9bf96a9b3c0a74d7fa67fd", "score": "0.51960975", "text": "func (o *GroupScalarColumn) HasType() bool {\n\treturn o != nil && o.Type != nil\n}", "title": "" }, { "docid": "63525544c8c3fadebd0b3cf97413171b", "score": "0.519589", "text": "func (o *LinkTokenCreateRequestUserStatedIncomeSource) HasPayFrequency() bool {\n\tif o != nil && o.PayFrequency != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f05a794160499d481ec0145379b30819", "score": "0.5193561", "text": "func (r *Request) IsTLS() bool {\n\treturn r.Request.TLS != nil\n}", "title": "" }, { "docid": "2aa8e9a3094fec9cb304d2e6e793e46d", "score": "0.5189144", "text": "func (o *StorageRemoteKeySetting) HasServerCertificate() bool {\n\tif o != nil && o.ServerCertificate != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "05a8a724d7597453c5f29feaab639b66", "score": "0.5179144", "text": "func (o *CreditRelayCreateRequest) HasWebhook() bool {\n\tif o != nil && o.Webhook.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "dbea12c13e6e8f41fca3174816366dda", "score": "0.51762456", "text": "func (o *RegistrationFlow) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "07919db30ef9eea7c60d98352d281b00", "score": "0.517508", "text": "func (d *DistributionDefinition) HasType() bool {\n\tif d != nil && d.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3d58251bbb6ba180338998e050f39d9a", "score": "0.51750773", "text": "func (o *CreateDatasetParams) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "a615adce6632589c633878fb7f6cdb62", "score": "0.5173772", "text": "func (m UserRequest) HasUserRequestType() bool {\n\treturn m.Has(tag.UserRequestType)\n}", "title": "" }, { "docid": "bfdcbb64894eb5174725adc360c38d81", "score": "0.51728505", "text": "func (o *OsGlobalConfig) HasInstallTargetType() bool {\n\tif o != nil && o.InstallTargetType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "f6d87c4e4dd7d2fd33d2f65fdf0f79fe", "score": "0.5170874", "text": "func (o *DhcpScopeDataData) HasServerType() bool {\n\tif o != nil && o.ServerType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9dc92062d00e67df20e1ef9e15e50a62", "score": "0.5166023", "text": "func (u LedgerEntryData) GetTrust() (result TrustEntry, ok bool) {\n\tarmName, _ := u.ArmForSwitch(int32(u.Type))\n\n\tif armName == \"Trust\" {\n\t\tresult = *u.Trust\n\t\tok = true\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "4ed24eced418678177d162939a2d31ca", "score": "0.51608795", "text": "func (o *Domain) HasTtlSec() bool {\n\tif o != nil && o.TtlSec != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "2439819d343ed1a44f3327dc260c6bfc", "score": "0.5153312", "text": "func (o *Domain) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "786d01c4b05cefd86bb1d1a60e9a3011", "score": "0.5145473", "text": "func (o *Email) HasIsVerified() bool {\n\tif o != nil && o.IsVerified != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "7db0c9ec6fb56d2ece763400ac8af47a", "score": "0.5141782", "text": "func (o *NotificationConfigStub) HasType() bool {\n\tif o != nil && o.Type != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9e85372ce1a8bd7db8c993f674b7ce2f", "score": "0.51407224", "text": "func (o *CustconfAuthUrlSign) HasPassPhrase() bool {\n\tif o != nil && o.PassPhrase != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "6d89d4d4fa8d7f913e39fb622774ca35", "score": "0.51305366", "text": "func (s *ServiceLevelObjective) HasTypeID() bool {\n\tif s != nil && s.TypeID != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1c2bc872b6fd4f986045ef4ec1e22435", "score": "0.5125232", "text": "func (o *IppoolBlockLease) HasIpType() bool {\n\tif o != nil && o.IpType != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "3497789d7042981c41aaf6838a47544a", "score": "0.5121797", "text": "func (c *CheckType) IsTTL() bool {\n\treturn c.TTL > 0\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": "10599562e11ac69096e6cfbd00bb3808", "score": "0.0", "text": "func (s DeleteSlackChannelConfigurationInput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
[ { "docid": "01aa6964793db8db3a8d2bb1e94f5a82", "score": "0.63567525", "text": "func (p InvParam) String() string {\n\tswitch p {\n\tcase BytesSize:\n\t\treturn \"BytesSize\"\n\tcase KeysCount:\n\t\treturn \"KeysCount\"\n\t}\n\n\tpanic(\"Unknown InvParam: \" + strconv.Itoa(int(p)))\n}", "title": "" }, { "docid": "4ef987fe3192563c6dca972fb1a50812", "score": "0.63238806", "text": "func (v *ParamsStruct) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [1]string\n\ti := 0\n\tfields[i] = fmt.Sprintf(\"UserUUID: %v\", v.UserUUID)\n\ti++\n\n\treturn fmt.Sprintf(\"ParamsStruct{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "8a5a12466c6811f56a7bcda917f55a4a", "score": "0.6293667", "text": "func (s *Systemmember) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteString(\"Systemmember(\")\n\tbuilder.WriteString(fmt.Sprintf(\"id=%v\", s.ID))\n\tbuilder.WriteString(\", Systemmember_Name=\")\n\tbuilder.WriteString(s.SystemmemberName)\n\tbuilder.WriteString(\", Password=\")\n\tbuilder.WriteString(s.Password)\n\tbuilder.WriteByte(')')\n\treturn builder.String()\n}", "title": "" }, { "docid": "7422e92ddcee98e4ae227fd7e12e513f", "score": "0.6221339", "text": "func (s GroupMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "ea98e45b6b5627266bea3540df3580ff", "score": "0.6084633", "text": "func (api *API) String() string {\n\treturn fmt.Sprintf(\"API(ID=%v, URL=%v, APIVerb=%v)\", api.ID, api.URL, api.APIVerb)\n}", "title": "" }, { "docid": "a98344e2ba45867a1c7a2aba22eb9436", "score": "0.60707104", "text": "func (i invocation) String() string {\n\treturn fmt.Sprintf(\"%s %s\", i.name, strings.Join(i.allArgs(), \" \"))\n}", "title": "" }, { "docid": "242e82a0a19dcbc9b6c9d9c9435dd219", "score": "0.6047004", "text": "func (p Param) String() string {\n\treturn p.name\n}", "title": "" }, { "docid": "a38e5940fa335dd8c89de4e6f6fe0c13", "score": "0.6028086", "text": "func (p *param) string() string {\n\tres := []byte(p.name + \" \")\n\n\tres = append(res, p.typ()...)\n\n\treturn string(res)\n}", "title": "" }, { "docid": "d4b2d1752651c430f389fb8fdb8d0625", "score": "0.60148937", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n Unbonding Time: %s\n Max Validators: %d\n Max Entries: %d\n Bonded Coin Denom: %s`, p.UnbondingTime,\n\t\tp.MaxValidators, p.MaxEntries, p.BondDenom)\n}", "title": "" }, { "docid": "620a6c171cfa90973b9d5890650785a1", "score": "0.59910476", "text": "func (p Provider) String() string {\n\tres := fmt.Sprintf(`Deployment\n\tOwner: %s\n\tHostURI: %s\n\tAttributes: %v\n\t`, p.Owner, p.HostURI, p.Attributes)\n\n\tif !p.Info.IsEmpty() {\n\t\tres += fmt.Sprintf(\"Info: %v\\n\", p.Info)\n\t}\n\treturn res\n}", "title": "" }, { "docid": "3818edbf94c07e4b9093a385052a9d8e", "score": "0.59865767", "text": "func (s KeyUsagePropertyFlags) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "540636a34adb1a7967a6f8d5aa0c8445", "score": "0.5986012", "text": "func (s UpdateParam) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "2719e5463c4a14b720950dc7b5311de5", "score": "0.5983185", "text": "func (c SandstormApi) String() string {\n\treturn fmt.Sprintf(\"%T(%v)\", c, capnp.Client(c))\n}", "title": "" }, { "docid": "da6270b609c9eb834149433d1f7b9d17", "score": "0.59133035", "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 SessionBlockFrequency %d\n Proposer Allocation %d\n DAO allocation %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}", "title": "" }, { "docid": "3622035dd78be1c999194c94b8e448bc", "score": "0.59027386", "text": "func (o VserverPeerGetIterRequestDesiredAttributes) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "7176b5fbd92b92fb6d7692b988128610", "score": "0.58933705", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Params:\n UnbondingTime: %s\n MaxValidators: %d\n MaxKeyNodes: %d\n MaxEntries: %d\n MaxCandidateKeyNodeHeartbeatInterval: %d\n BondDenom: %s\n MinValidatorDelegation: %s\n MinKeyNodeDelegation: %s`,\n\t\tp.UnbondingTime, p.MaxValidators, p.MaxKeyNodes, p.MaxEntries, p.MaxCandidateKeyNodeHeartbeatInterval,\n\t\tp.BondDenom, p.MinValidatorDelegation.String(), p.MinKeyNodeDelegation.String())\n}", "title": "" }, { "docid": "9bb275c943c0beef4334eec2d071bab3", "score": "0.58865494", "text": "func (s ServiceMemberAffiliation) String() string {\n\treturn string(s)\n}", "title": "" }, { "docid": "3ffc25a4edc5ca7652c4750de89130eb", "score": "0.58799726", "text": "func (s Parameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "9fabcb7f46be5a3190d0f03070d02857", "score": "0.58560115", "text": "func (s TeradataParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "cca945207fb00f0f36c707031770f15c", "score": "0.5826237", "text": "func (s FindMatchesParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "612662a0b4743ca8d4d9be2102cb5d6b", "score": "0.5824958", "text": "func (o SnapmirrorInfoType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "107d9ae25b5bb5f0efc1b21eb657e2e8", "score": "0.5804414", "text": "func (s ServiceNowParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4dbcf4e917e2636916cf8b979f3d6134", "score": "0.5803528", "text": "func (s AuthInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "773ad15412af46740aafdd1afa28c4c8", "score": "0.5801982", "text": "func (s SigningProfileParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e53d73a1f0b48ee97950cf87755a5aa4", "score": "0.5793051", "text": "func (p MemberPhase) String() string {\n\treturn string(p)\n}", "title": "" }, { "docid": "2f7820e821041f9829c4fdd36133b3ae", "score": "0.5788738", "text": "func (s SnowflakeParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "688c90c02e605d9d4d7bd3536d8860ce", "score": "0.578853", "text": "func (p Params) String() string {\n\treturn fmt.Sprintf(`Auction Params:\n\tMax Auction Duration: %s\n\tBid Duration: %s\n\tIncrement Surplus: %s\n\tIncrement Debt: %s\n\tIncrement Collateral: %s`,\n\t\tp.MaxAuctionDuration, p.BidDuration, p.IncrementSurplus, p.IncrementDebt, p.IncrementCollateral)\n}", "title": "" }, { "docid": "e988010bbe0a9e1db934209b8b5bcc6f", "score": "0.5769033", "text": "func (v *QueryParamsOptsStruct) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [4]string\n\ti := 0\n\tfields[i] = fmt.Sprintf(\"Name: %v\", v.Name)\n\ti++\n\tif v.UserUUID != nil {\n\t\tfields[i] = fmt.Sprintf(\"UserUUID: %v\", *(v.UserUUID))\n\t\ti++\n\t}\n\tif v.AuthUUID != nil {\n\t\tfields[i] = fmt.Sprintf(\"AuthUUID: %v\", *(v.AuthUUID))\n\t\ti++\n\t}\n\tif v.AuthUUID2 != nil {\n\t\tfields[i] = fmt.Sprintf(\"AuthUUID2: %v\", *(v.AuthUUID2))\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"QueryParamsOptsStruct{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "b0831d56d78eb25a6bd124b5253a8818", "score": "0.5768724", "text": "func (s AthenaParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f1b758e5865c8ab1a46d5df02c34efbf", "score": "0.57639194", "text": "func (af additionalField) String() string {\n\tkey := strings.TrimPrefix(af.key, \"_\")\n\treturn fmt.Sprintf(\"%s=%v\", color.MagentaString(key), af.value)\n}", "title": "" }, { "docid": "2bf29bb7788b0325d56f79f403b0399c", "score": "0.5739865", "text": "func (s GroupConfigurationParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7636368760d495cf80bff6d187b32e57", "score": "0.5728495", "text": "func (s KeyUsageFlags) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1050fda86d17f688f12ea9cf1ca474f4", "score": "0.5724843", "text": "func (s StringParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "fdcb7c512f5a3219c5207b118956b76b", "score": "0.57183194", "text": "func (s AccessLevelFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6889ace6d51031a4769b7becf1b14236", "score": "0.5710919", "text": "func (p *Properties) String() string {\n\ts := p.Wire\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 != \"\" {\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": "f51931e441557ea0755a24c5d17f8d8a", "score": "0.5694934", "text": "func (s FolderMember) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b82daa42075d9552a51df39c0b827bc3", "score": "0.56864625", "text": "func (s ActionParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a102628683574cfd3b9b626c5ef060f3", "score": "0.56790185", "text": "func (v *QueryParamsStruct) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [5]string\n\ti := 0\n\tfields[i] = fmt.Sprintf(\"Name: %v\", v.Name)\n\ti++\n\tif v.UserUUID != nil {\n\t\tfields[i] = fmt.Sprintf(\"UserUUID: %v\", *(v.UserUUID))\n\t\ti++\n\t}\n\tif v.AuthUUID != nil {\n\t\tfields[i] = fmt.Sprintf(\"AuthUUID: %v\", *(v.AuthUUID))\n\t\ti++\n\t}\n\tif v.AuthUUID2 != nil {\n\t\tfields[i] = fmt.Sprintf(\"AuthUUID2: %v\", *(v.AuthUUID2))\n\t\ti++\n\t}\n\tfields[i] = fmt.Sprintf(\"Foo: %v\", v.Foo)\n\ti++\n\n\treturn fmt.Sprintf(\"QueryParamsStruct{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "cf2556e7d19d4db94ba897ec78eb8ce8", "score": "0.5676727", "text": "func (s BackendAPIAuthType) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "f22d9114d24746c8de07c97a5a480a3f", "score": "0.56754375", "text": "func (s MariaDbParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "b0e9eb03ac1acff7d77526fa4a7c9763", "score": "0.56709707", "text": "func (s *SecurityGroup) String() string {\n\treturn fmt.Sprintf(\"id=%s/name=%s\", s.ID, s.Name)\n}", "title": "" }, { "docid": "b94dc708cf884aaff1358adbf52dc726", "score": "0.5665333", "text": "func String() string {\n\treturn fmt.Sprintf(\"%s %v Protocol %s %s\", Name, Version,\n\t\tprotocol.ProtocolCompat, Additional)\n}", "title": "" }, { "docid": "4e772796cd7453f647e1840c6cc8255e", "score": "0.56639576", "text": "func (s ExasolParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "14bb225a5bc3c710e0542334cfbc5d8b", "score": "0.5654516", "text": "func (msg MsgUpdateAttributeRequest) String() string {\n\tout, _ := yaml.Marshal(msg)\n\treturn string(out)\n}", "title": "" }, { "docid": "2537643a4d071d1910ad417707ce36dd", "score": "0.5647746", "text": "func (s DecimalParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "6c28c8aaca1d6e615b02ba1a0fe23fa4", "score": "0.564607", "text": "func (ba SettingsAttributes) String(name string) string {\n\tif val, ok := ba[name]; ok {\n\t\treturn fmt.Sprintf(\"%v\", val)\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "c516a84d056f26c8399e10d8c425f8d5", "score": "0.5634324", "text": "func (m *memberlist) String() string {\n\tm.members.RLock()\n\tstr, _ := json.Marshal(m.members.list) // will never return error (presumably)\n\tm.members.RUnlock()\n\treturn string(str)\n}", "title": "" }, { "docid": "ddaa7f3ca980afdb1a3b765eed303f19", "score": "0.56321603", "text": "func (this *AuthenticationInfo) String() string {\n\treturn this.headerName + core.SIPSeparatorNames_COLON +\n\t\tcore.SIPSeparatorNames_SP + this.EncodeBody() + core.SIPSeparatorNames_NEWLINE\n}", "title": "" }, { "docid": "6e4534d097926bf78e30faa03a4dbfa2", "score": "0.56263417", "text": "func (s EncryptionInfo) 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": "6e4534d097926bf78e30faa03a4dbfa2", "score": "0.56263417", "text": "func (s EncryptionInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "769287ffe8292f890bc58a173ae91995", "score": "0.5624165", "text": "func (d Definition) String() string {\n\treturn fmt.Sprintf(\"%s contains %v\", d.Name, d.PropertyMap)\n}", "title": "" }, { "docid": "da7fc379fb913b44067ba8bb174f7762", "score": "0.5622283", "text": "func (p *MigProfileInfo) String() string {\n\tvar suffix string\n\tif len(p.Attributes) > 0 {\n\t\tsuffix = \"+\" + strings.Join(p.Attributes, \",\")\n\t}\n\tif p.C == p.G {\n\t\treturn fmt.Sprintf(\"%dg.%dgb%s\", p.G, p.GB, suffix)\n\t}\n\treturn fmt.Sprintf(\"%dc.%dg.%dgb%s\", p.C, p.G, p.GB, suffix)\n}", "title": "" }, { "docid": "a2809403ae1c50b54893bb2151e19ccb", "score": "0.56193554", "text": "func (s UserInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "a2809403ae1c50b54893bb2151e19ccb", "score": "0.56193554", "text": "func (s UserInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "27cdd9d7c54d5bf70d65a87059a69fe5", "score": "0.5619133", "text": "func (p Purpose) String() string {\n\tif value, ok := purposeMarshal[p]; ok {\n\t\treturn value\n\t}\n\n\treturn purposeMarshal[PurposeVerify]\n}", "title": "" }, { "docid": "b560884a756c48de74c88e5daae702b6", "score": "0.5615306", "text": "func (s Parameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "43654c6e33398016c8cddf8e27e2eee5", "score": "0.56121606", "text": "func (v *AddSearchAttributeRequest) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [2]string\n\ti := 0\n\tif v.SearchAttribute != nil {\n\t\tfields[i] = fmt.Sprintf(\"SearchAttribute: %v\", v.SearchAttribute)\n\t\ti++\n\t}\n\tif v.SecurityToken != nil {\n\t\tfields[i] = fmt.Sprintf(\"SecurityToken: %v\", *(v.SecurityToken))\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"AddSearchAttributeRequest{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "37f061fd711936c7a11d7a95bdf4fbde", "score": "0.56052613", "text": "func (s UpdateProvisioningParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c4e6f78ab9efc3d2adc595555cbc1742", "score": "0.5602502", "text": "func (s TwitterParameters) 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": "5370a3268852f6091878ea71d78f9260", "score": "0.5597703", "text": "func (o LunUnmapRequest) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "34f1f867fecec19b72af28de6ea47689", "score": "0.55881387", "text": "func (*cmdParams) String() string { return \"\\\"key=value\\\"\" }", "title": "" }, { "docid": "1cccefeaaf2eb268fb451df170f924c4", "score": "0.55873686", "text": "func (a activation) String() string {\n\tvar buf bytes.Buffer\n\tbuf.WriteString(a.Name)\n\tif a.version != nil {\n\t\tbuf.WriteRune(space)\n\t\tbuf.WriteString(a.version.String())\n\t}\n\treturn buf.String()\n}", "title": "" }, { "docid": "f03e58b3a35627fc881a91f47d0bca1c", "score": "0.5575929", "text": "func (s NiftyModifyCustomerGatewayAttributeOutput) String() string {\n\treturn nifcloudutil.Prettify(s)\n}", "title": "" }, { "docid": "e70264b5141f287728d8cca08f161d9f", "score": "0.5575621", "text": "func (o NvmeInterfaceInfoType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "7ce1504713b7bab365ea146e3b0f29dd", "score": "0.5574169", "text": "func (s PermissionInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "7ce1504713b7bab365ea146e3b0f29dd", "score": "0.5574169", "text": "func (s PermissionInfo) 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": "70654039945d2320f4eee3aa3a793d94", "score": "0.5569108", "text": "func (s KeyValuePair) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c99526bf724daf27e2198e49fd1436a9", "score": "0.5563729", "text": "func (s AuroraParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1d4e7d34766971f14676e1ed1bb0333d", "score": "0.5563642", "text": "func (s DocumentParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1d4e7d34766971f14676e1ed1bb0333d", "score": "0.5563642", "text": "func (s DocumentParameter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "4de885385fadb3f25df3d3b83ac9c3ef", "score": "0.5563287", "text": "func (v Value) String() string {\n\treturn v.Format(OutFormatDebug)\n}", "title": "" }, { "docid": "f82b31feba9aa1633ba7aad26b9e0814", "score": "0.5560824", "text": "func (s TransformParameters) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "53cc1b0266be65c6a21d9942a3735ea5", "score": "0.55606776", "text": "func (s PublicAccess) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "1883279ec3e9d93f5fea5336ba153769", "score": "0.5559258", "text": "func (s CreateGroupMembershipOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "369dc076ba7b7d7cd192a56ffcf1333e", "score": "0.55590093", "text": "func (a *Attribute) String() string {\n\treturn fmt.Sprintf(\"%s:%v\", a.Name, a.Values)\n}", "title": "" }, { "docid": "82a715c0bf7bed9a15de98a6d323a0ab", "score": "0.55551475", "text": "func (s UpdateSAMLProviderOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "c3bbd5dae6f605d5554fa7ae6f1b15bc", "score": "0.5552714", "text": "func (v *Field) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [2]string\n\ti := 0\n\tif v.Name != nil {\n\t\tfields[i] = fmt.Sprintf(\"Name: %v\", *(v.Name))\n\t\ti++\n\t}\n\tif v.Value != nil {\n\t\tfields[i] = fmt.Sprintf(\"Value: %v\", v.Value)\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"Field{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "9a2a32846e9d15057aac9e2f35e87213", "score": "0.55521065", "text": "func String(name, val string) Field {\n\treturn Field(zap.String(name, val))\n}", "title": "" }, { "docid": "76891d2ef105ca81babcca9ea7376bca", "score": "0.5552103", "text": "func (v ParamType) String() string {\n\tswitch v {\n\tcase ParamBody:\n\t\treturn \"body\"\n\tcase ParamParam:\n\t\treturn \"param\"\n\tcase ParamQuery:\n\t\treturn \"query\"\n\tcase ParamHeader:\n\t\treturn \"header\"\n\tcase ParamCookie:\n\t\treturn \"cookie\"\n\t}\n\treturn \"unknown\"\n}", "title": "" }, { "docid": "d51664023c49fb40ffedd877f58adc82", "score": "0.5551557", "text": "func (cp *ChanPrivs) String() string {\n\tif cp == nil {\n\t\treturn \"No modes set\"\n\t}\n\tstr := \"+\"\n\tv := reflect.Indirect(reflect.ValueOf(cp))\n\tt := v.Type()\n\tfor i := 0; i < v.NumField(); i++ {\n\t\tswitch f := v.Field(i); f.Kind() {\n\t\t// only bools here at the mo too!\n\t\tcase reflect.Bool:\n\t\t\tif f.Bool() {\n\t\t\t\tstr += ChanPrivToString[t.Field(i).Name]\n\t\t\t}\n\t\t}\n\t}\n\tif str == \"+\" {\n\t\tstr = \"No modes set\"\n\t}\n\treturn str\n}", "title": "" }, { "docid": "fc75b70ad02a634b15de40bd08893745", "score": "0.5549914", "text": "func (s SkewedInfo) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "d9a42dd995b640336b501f132bc80850", "score": "0.5544352", "text": "func (s IdentityUsage) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e727fa0658f75ea852d6b58e960ddaa3", "score": "0.5541647", "text": "func (o AggrCheckAttributesType) String() string {\n\treturn ToString(reflect.ValueOf(o))\n}", "title": "" }, { "docid": "00c1163767d3abb1b5bb0ff4add08f28", "score": "0.55393827", "text": "func (s InstanceInformationFilter) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "bee1fb6bd8a93238c04f815d04cc864e", "score": "0.55374914", "text": "func (f *Field) String() string {\n\treturn `{\"name\":\"` + f.name + `\",\"type\":` + f.typ.String() + `}`\n}", "title": "" }, { "docid": "f1562905de983ed2b0459de7a2f88a77", "score": "0.5534029", "text": "func (v value) String() string {\n\tif v.ptr {\n\t\treturn \"*\" + v.name\n\t} else {\n\t\treturn v.name\n\t}\n}", "title": "" }, { "docid": "6e642bb0d7426f5c3dbbe95b6314e9a5", "score": "0.55329007", "text": "func (params Params) String() string {\n\treturn fmt.Sprintf(`Oracle Params:\n VotePeriod: %d\n VoteThreshold: %s\n\tRewardBand: %s\n\tRewardDistributionWindow: %d\n\tWhitelist %s\n\tSlashFraction %s\n\tSlashWindow %d\n\tMinValidPerWindow %s\n\t`, params.VotePeriod, params.VoteThreshold, params.RewardBand,\n\t\tparams.RewardDistributionWindow, params.Whitelist,\n\t\tparams.SlashFraction, params.SlashWindow, params.MinValidPerWindow)\n}", "title": "" }, { "docid": "50f66dd3c5ee3d58d139540cb5aeebf8", "score": "0.5529792", "text": "func (v *AdminService_AddSearchAttribute_Args) String() string {\n\tif v == nil {\n\t\treturn \"<nil>\"\n\t}\n\n\tvar fields [1]string\n\ti := 0\n\tif v.Request != nil {\n\t\tfields[i] = fmt.Sprintf(\"Request: %v\", v.Request)\n\t\ti++\n\t}\n\n\treturn fmt.Sprintf(\"AdminService_AddSearchAttribute_Args{%v}\", strings.Join(fields[:i], \", \"))\n}", "title": "" }, { "docid": "760628dc9ce8e728fea11124a7582dc6", "score": "0.55286723", "text": "func (params Params) String() string {\n\treturn fmt.Sprintf(`Treasury Params:\n\tBasePool:\t\t %d\n\tPoolRecoveryPeriod: %d\n\tMinSpread: \t\t\t%s\n\tTobinTax: %s\n\t`, params.BasePool, params.PoolRecoveryPeriod, params.MinSpread, params.TobinTax)\n}", "title": "" }, { "docid": "84f5ec75482b37ba0bf144c02525a129", "score": "0.5521048", "text": "func (sk *PrivKey) String(name string) string {\n\treturn name + \"{-}\"\n}", "title": "" }, { "docid": "1faad40b091e6e266beeec4c155da274", "score": "0.55183554", "text": "func (msg MsgAddAttributeRequest) String() string {\n\tout, _ := yaml.Marshal(msg)\n\treturn string(out)\n}", "title": "" }, { "docid": "96e11bbfa1fd1ea8d6633d02461c51f3", "score": "0.5515657", "text": "func (o *Trustmembercreate) String() string {\n \n o.RoleIds = []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": "9ef5e2dda42ffa38cd7f17febde080e3", "score": "0.5513011", "text": "func (s ModifyCacheParameterGroupOutput) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "5114245045380264003690e12b8813f9", "score": "0.5509433", "text": "func (wfn WellFormedName) String() string {\n\ts := \"wfn:[\"\n\tfor _, attr := range attributes {\n\t\ts += fmt.Sprintf(\"%s=\", attr)\n\t\to := wfn.Get(attr)\n\t\tif lv, ok := o.(LogicalValue); ok {\n\t\t\ts += fmt.Sprintf(\"%s, \", lv)\n\t\t} else {\n\t\t\ts += fmt.Sprintf(\"\\\"%s\\\", \", o)\n\t\t}\n\t}\n\ts = strings.TrimSpace(s)\n\ts = strings.TrimRight(s, \",\")\n\ts += \"]\"\n\treturn s\n}", "title": "" }, { "docid": "6c2079aa9a43306556dcdb122c5d7a36", "score": "0.5499092", "text": "func (p Params) String() string {\n\tvar sb strings.Builder\n\tsb.WriteString(\"Params: \\n\")\n\tsb.WriteString(fmt.Sprintf(\"PeggyID: %d\\n\", p.PeggyID))\n\tsb.WriteString(fmt.Sprintf(\"ContractHash: %d\\n\", p.ContractHash))\n\tsb.WriteString(fmt.Sprintf(\"StartThreshold: %d\\n\", p.StartThreshold))\n\tsb.WriteString(fmt.Sprintf(\"BridgeContractAddress: %s\\n\", p.BridgeContractAddress.String()))\n\tsb.WriteString(fmt.Sprintf(\"BridgeChainID: %d\\n\", p.BridgeChainID))\n\treturn sb.String()\n}", "title": "" }, { "docid": "cb53a1c9095f78a429dfd14395096199", "score": "0.5498949", "text": "func (s KeyUsageProperty) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e8f533f723673421e9235d139ac42475", "score": "0.54965204", "text": "func (s VpcSecurityGroupMembership) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" }, { "docid": "e8f533f723673421e9235d139ac42475", "score": "0.54965204", "text": "func (s VpcSecurityGroupMembership) String() string {\n\treturn awsutil.Prettify(s)\n}", "title": "" } ]
6ef217f9497f035290d98273b850cd98
/ return array of all Entries
[ { "docid": "582d75ea98ab67ea316e8370a763c8f3", "score": "0.6750644", "text": "func All(dbMap *gorp.DbMap) []*Entry {\n var entries []*Entry\n _, err := dbMap.Select(&entries, \"SELECT * FROM entries\")\n\n if err != nil {\n panic(err)\n }\n\n return entries\n}", "title": "" } ]
[ { "docid": "2609347bd04f1874583eaa4db8dfe76b", "score": "0.7334211", "text": "func (s *kvStore)GetAllEntries() *[]*Entry {\n entries := make([]*Entry, len(s.store))\n i := 0\n s.lock()\n defer s.unlock()\n for key, value := range s.store {\n \t entry := Entry{key, value.Value}\n \t entries[i] = &entry\n\t i += 1\n }\n\n return &entries\n}", "title": "" }, { "docid": "bf717c3196e86f7096772a1781fbefc1", "score": "0.70041203", "text": "func (w *Wantlist) Entries() []Entry {\n\tes := make([]Entry, 0, len(w.set))\n\tfor _, e := range w.set {\n\t\tes = append(es, e)\n\t}\n\treturn es\n}", "title": "" }, { "docid": "1e4558b2494397a2f9378cc1f5b530eb", "score": "0.6960746", "text": "func (q entryQuery) All(exec boil.Executor) (EntrySlice, error) {\n\tvar o []*Entry\n\n\terr := q.Bind(nil, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"models: failed to assign all query results to Entry slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "21112befdcfd4435bf35c42000d93c4c", "score": "0.68633085", "text": "func (p *PSQLService) AllEntries() ([]*Entry, error) {\n\tall := []*Entry{}\n\trows, err := p.DB.Query(allEntries)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tnewEntry := &Entry{}\n\t\terr = rows.Scan(&newEntry.ID, &newEntry.FirstName, &newEntry.LastName, &newEntry.Email, &newEntry.Phone)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tall = append(all, newEntry)\n\t}\n\treturn all, err\n}", "title": "" }, { "docid": "4322a2542724d8c7252853ad31efb431", "score": "0.68625665", "text": "func (page *page) AllEntries() []*KVPair {\n\tif page.entries == nil {\n\t\tkvCount := page.KVPairsCount()\n\t\tslice := make([]*KVPair, kvCount)\n\t\tfor i := 0; i < kvCount; i++ {\n\t\t\tslice[i] = &KVPair{Key: page.Key(i), Value: page.Value(i)}\n\t\t}\n\t\tpage.entries = slice\n\t}\n\treturn page.entries\n}", "title": "" }, { "docid": "b69169f336f46f2b265edc4bf3c97c74", "score": "0.6805738", "text": "func (idx *Index) Entries() []Entry {\n\treturn idx.sub\n}", "title": "" }, { "docid": "39a4cfd9e99987fa151bf58f09fec1b1", "score": "0.6746667", "text": "func (l *OCLogger) AllEntries() []*logrus.Entry {\n\tl.mu.RLock()\n\tdefer l.mu.RUnlock()\n\n\t// Make a copy so the returned value won't race with future log requests\n\tlogCount := int(math.Min(float64(len(l.Entries)), maxLogEntries))\n\tentries := make([]*logrus.Entry, logCount)\n\tfor i := 0; i < len(entries); i++ {\n\t\t// Make a copy, for safety\n\t\tentries[len(entries)-logCount:][i] = &l.Entries[i]\n\t}\n\n\treturn entries\n}", "title": "" }, { "docid": "39f5dffd647cdb5a3c7d5b06385e7add", "score": "0.6693954", "text": "func (l *RaftLog) allEntries() []pb.Entry {\n\t// Your Code Here 2A\n\t// TODO: Delete Start\n\treturn l.entries\n\t// TODO: Delete End\n}", "title": "" }, { "docid": "7777cd53b876044e2cc23d26c8304ee6", "score": "0.6691289", "text": "func (m *Catalog) GetEntries()([]CatalogEntryable) {\n val, err := m.GetBackingStore().Get(\"entries\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]CatalogEntryable)\n }\n return nil\n}", "title": "" }, { "docid": "f79d23253f0ac1ef3344c706b975d573", "score": "0.6675831", "text": "func (b *bucket) Entries() []node.NodeInfo {\n\trw := make([]node.NodeInfo, b.Len())\n\ti := 0\n\tfor el := b.entries.Front(); el != nil; el = el.Next() {\n\t\trw[i] = el.Value.(*bucketEntry).Node\n\t\ti++\n\t}\n\treturn rw\n}", "title": "" }, { "docid": "b817ee66268291c0b9541a7502eb3117", "score": "0.66633713", "text": "func (log *Log) AllEntries() ([]*Entry, error) {\n\t// entries are cached within the Log, and only parsed once.\n\tif len(log.entries) > 0 {\n\t\treturn log.entries, nil\n\t}\n\n\tscanner := bufio.NewScanner(*log.in)\n\n\tfor scanner.Scan() {\n\t\tline := strings.TrimSpace(scanner.Text())\n\t\tif 0 == len(line) {\n\t\t\tcontinue // ignore empty lines\n\t\t}\n\t\tentry, err := parseLogLine(line)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tlog.entries = append(log.entries, &entry)\n\t}\n\n\treturn log.entries, nil\n}", "title": "" }, { "docid": "e0f3b00726bd776fdfa23451a02b4eb3", "score": "0.6661879", "text": "func (h *HashMap) All() ([]string, error) {\n\trows, err := h.host.db.Query(\"SELECT \" + ownerCol + \" FROM \" + h.table)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tdefer rows.Close()\n\tvar (\n\t\tvalues []string\n\t\tvalue string\n\t)\n\tfor rows.Next() {\n\t\terr = rows.Scan(&value)\n\t\tvalues = append(values, value)\n\t\tif err != nil {\n\t\t\t// Unusual, worthy of panic\n\t\t\tpanic(err.Error())\n\t\t}\n\t}\n\tif err := rows.Err(); err != nil {\n\t\t// Unusual, worthy of panic\n\t\tpanic(err.Error())\n\t}\n\treturn values, nil\n}", "title": "" }, { "docid": "1c12ad7083b92acea7a8bc1d3ea6d53d", "score": "0.6523205", "text": "func (s *Server) fetchAllEntries(ctx context.Context, query *Query) ([]*logging.Entry, error) {\n\tfilter := query.ToFilter()\n\titer := s.adminClient.Entries(ctx, logadmin.Filter(filter))\n\tvar entries []*logging.Entry\n\tvar err error\n\tvar count int\n\tfor err != iterator.Done && count < MaxFetchedLogEntries {\n\t\tvar entry *logging.Entry\n\t\tif entry, err = iter.Next(); entry != nil {\n\t\t\tentries = append(entries, entry)\n\t\t}\n\t\tcount++\n\t}\n\tif err != nil && err != iterator.Done {\n\t\treturn nil, xerrors.Errorf(\"error iterating log entries: %w\", err)\n\t}\n\treturn entries, nil\n}", "title": "" }, { "docid": "cb793005953704ce39050b26a2a52d43", "score": "0.64130276", "text": "func (r *ReportBlock) Entries() []ReportEntry {\n\treturn r.entries\n}", "title": "" }, { "docid": "e9685e7417268057959e4fdfe1e48fbe", "score": "0.6399982", "text": "func (s *inMemoryEntriesStore) GetEntries() []logger.Entry {\n\treturn s.entries\n}", "title": "" }, { "docid": "7413ac3994ed9a066e0d0f2985262f3e", "score": "0.63391894", "text": "func (dl *deltaList) AllEntries() hashTableEntries {\n\tentries := make(hashTableEntries, dl.count)\n\ti := dl.count - 1\n\tfor node := dl.head; node != nil; node = node.next {\n\t\tfor _, entry := range node.entries {\n\t\t\tentries[i] = entry\n\t\t\ti--\n\t\t}\n\t}\n\treturn entries\n}", "title": "" }, { "docid": "583d0dd75b21b0c60ed1cc7960bc82e0", "score": "0.6304276", "text": "func (registry *Registry) All() []string {\n\tif registry.client == nil {\n\t\tlog.Printf(\"Service Not Available: %s\", \"redis\")\n\t\treturn []string{}\n\t}\n\n\tentries, err := registry.client.Cmd(\"KEYS\", \"*\").List()\n\n\tif err != nil {\n\t\tlog.Printf(\"RedisCMDFailed: (%s) - %s\", \"KEYS\", err)\n\t}\n\n\treturn entries\n}", "title": "" }, { "docid": "a50e133dff2305e69d44e72a15936338", "score": "0.6291105", "text": "func (c *PanoPbf) GetAll(dg, base string) ([]Entry, error) {\n\tresult, _ := c.versioning()\n\tif err := c.ns.Objects(util.Get, c.xpath(dg, base, nil), result); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result.Normalize(), nil\n}", "title": "" }, { "docid": "95e542b410efe5ceb68639f4b6e5fceb", "score": "0.6275566", "text": "func (dst *Set) All() []digest.Digest {\n\tdst.mutex.RLock()\n\tdefer dst.mutex.RUnlock()\n\tretValues := make([]digest.Digest, len(dst.entries))\n\tfor i := range dst.entries {\n\t\tretValues[i] = dst.entries[i].digest\n\t}\n\n\treturn retValues\n}", "title": "" }, { "docid": "99bc2fff14308e5da314b5ebb36a4d41", "score": "0.6249325", "text": "func (iatBatch *IATBatch) GetEntries() []*IATEntryDetail {\n\treturn iatBatch.Entries\n}", "title": "" }, { "docid": "aba5e5476afc9128f7335f3727f1e0cc", "score": "0.6240005", "text": "func (rd *RegistryDumper) Entries() (de []DumperEntry, err error) {\n\tss, err := rd.Registry.ListSourceIDs()\n\tLog.Vomit.Printf(\"%#v\", ss)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tfor _, s := range ss {\n\t\ta, err := rd.Registry.GetArtifact(s)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tLog.Vomit.Printf(\"%#v\", s)\n\t\tLog.Vomit.Printf(\"%#v\", a)\n\n\t\tde = append(de, DumperEntry{SourceID: s, BuildArtifact: a})\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "dbd1481876a459a506c5a88bce5b4359", "score": "0.62174946", "text": "func (em *EntityManager) All() []*Entity {\n\tvar keys IDList\n\tvar entities []*Entity\n\n\tfor key := range em.Entities {\n\t\tkeys = append(keys, key)\n\t}\n\n\tsort.Sort(keys)\n\tfor _, key := range keys {\n\t\tentities = append(entities, em.Entities[key])\n\t}\n\n\treturn entities\n}", "title": "" }, { "docid": "aa4501616c968c578308849669494ede", "score": "0.6207262", "text": "func (h *HashMap) GetAll() ([]string, error) {\n\treturn h.All()\n}", "title": "" }, { "docid": "ca4222cce54cf3c2220e7a6bc5a34a5f", "score": "0.6205271", "text": "func (o IpAllowlistOutput) Entries() IpAllowlistEntryArrayOutput {\n\treturn o.ApplyT(func(v *IpAllowlist) IpAllowlistEntryArrayOutput { return v.Entries }).(IpAllowlistEntryArrayOutput)\n}", "title": "" }, { "docid": "5e8da2e7f5968b596bccea92dc6c2f21", "score": "0.6174412", "text": "func (m *Meta) GetAll() (map[string]string, error) {\n\tentries, err := m.DS.GetAllEntries()\n\tnewEntries := make(map[string]string)\n\tif err != nil {\n\t\treturn newEntries, err\n\t}\n\tfor k, v := range entries {\n\t\tnewEntries[k] = string(v)\n\t}\n\treturn newEntries, nil\n}", "title": "" }, { "docid": "1a9bd58b3130c567b65436b0d4669899", "score": "0.6174291", "text": "func (q *Queue) Entries() ([]*image.Paletted, error) {\n\tq.lock.Lock()\n\tdefer q.lock.Unlock()\n\n\treturn q.entries, nil\n}", "title": "" }, { "docid": "6cdc955e81ed3a335b81f4931f81024b", "score": "0.6170756", "text": "func List() map[string]*Entry {\n\treturn entries\n}", "title": "" }, { "docid": "94562c11efddb8c984c8094b29bb4f1d", "score": "0.6169506", "text": "func (ml *MergeLog) Entries() []MergeLogEntry {\n\treturn ml.entries\n}", "title": "" }, { "docid": "17979504f9bc0e737bfd844de43b65d7", "score": "0.6147532", "text": "func (c *Cron) Entries() []*Entry {\n\tif c.running {\n\t\tc.snapshot <- nil\n\t\tx := <-c.snapshot\n\t\treturn x\n\t}\n\treturn c.entrySnapshot()\n}", "title": "" }, { "docid": "7dcb4a63d03685f70dfd0bf3631e9922", "score": "0.61338645", "text": "func (m *Decoder) Entries() []metaEntry {\n\treturn m.ml.Index\n}", "title": "" }, { "docid": "a4398029f8aed99935c9cadae7321627", "score": "0.61178994", "text": "func mirEntries() []interface{} {\n\tctx := models.NewContext()\n\n\treturn []interface{}{\n\t\t&mina.Address{Context: ctx},\n\t\t&mina.Brand{Context: ctx},\n\t\t&mina.Cart{Context: ctx},\n\t\t&mina.Catalog{Context: ctx},\n\t\t&mina.Collect{Context: ctx},\n\t\t&mina.Comment{Context: ctx},\n\t\t&mina.Footprint{Context: ctx},\n\t\t&mina.Goods{Context: ctx},\n\t\t&mina.Index{Context: ctx},\n\t\t&mina.Order{Context: ctx},\n\t\t&mina.Search{Context: ctx},\n\t\t&mina.Topic{Context: ctx},\n\t\t&mina.Wx{Context: ctx},\n\t}\n}", "title": "" }, { "docid": "8ff65778c27193f2dbf3d21ef4ae6cf6", "score": "0.61173344", "text": "func (s *Set) GetAll() (bsrs []BSR) {\n for b := range s.slotEntries {\n bsrs = append(bsrs, b)\n }\n return\n}", "title": "" }, { "docid": "13ce572a0c77266236b9fa0edc74343f", "score": "0.6108239", "text": "func (entries hashTableEntries) getData() []string {\n\tresult := make([]string, len(entries))\n\tfor i, entry := range entries {\n\t\tresult[i] = entry.data\n\t}\n\treturn result\n}", "title": "" }, { "docid": "ce66bf82fc11e1432128ec20306fe0b5", "score": "0.61025167", "text": "func (n *Names) GetAll() []string {\n\tn.Lock()\n\tdefer n.Unlock()\n\tfinal := make([]string, len(n.Data))\n\ti := 0\n\tfor _, v := range n.Data {\n\t\tfinal[i] = v\n\t\ti++\n\t}\n\treturn final\n}", "title": "" }, { "docid": "509a76910f79e16fc5a0a07a0cc35b8c", "score": "0.6098604", "text": "func (c *Cache) GetAll(n int) []Event {\n\treturn c.all.GetN(n)\n}", "title": "" }, { "docid": "b3b3e4105f8b18a4b172f279dee3f063", "score": "0.607198", "text": "func (rw rw) GetAll() ([]string, error) {\n\tvar toReturn []string\n\n\trw.store.Range(func(key, value interface{}) bool {\n\t\ttag, ok := key.(string)\n\t\tif !ok {\n\t\t\treturn true\n\t\t}\n\t\ttoReturn = append(toReturn, tag)\n\t\treturn true\n\t})\n\n\treturn toReturn, nil\n}", "title": "" }, { "docid": "3ec09a87f74ed249b005fab0e8b795f5", "score": "0.60691977", "text": "func (ae *AppEngine) Entries(ctx context.Context, team string) ([]*Entry, error) {\n\tteamKey := ae.teamKey(ctx, team)\n\n\tquery := datastore.NewQuery(kindEntry).Ancestor(teamKey)\n\tresults := query.Run(ctx)\n\n\tvar entries []*Entry\n\tfor {\n\t\tentry := new(Entry)\n\n\t\tif _, err := results.Next(entry); err != nil {\n\t\t\tif err == datastore.Done {\n\t\t\t\treturn entries, nil\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\n\t\tentries = append(entries, entry)\n\t}\n}", "title": "" }, { "docid": "1414e9c0691c79d05fbfb3f0eeaa3568", "score": "0.60677844", "text": "func (view *UtxoViewpoint) Entries() map[Hash]*UtxoEntry {\n\treturn view.entries\n}", "title": "" }, { "docid": "6208cd9bb0c0d9dff777e606e114620c", "score": "0.59912795", "text": "func (s *SearchResult) All() (Elements, error) {\n\treturn s.Get(0, s.ResultCount)\n}", "title": "" }, { "docid": "5bbdf4e1045f04a053f6778c3e4f4f69", "score": "0.5990878", "text": "func (idx *PackIndexV2) Entries() []PackIndexEntry {\n\tentries := make([]PackIndexEntry, len(idx.objectNames))\n\tfor i := 0; i < len(entries); i++ {\n\t\tentries[i] = packIndexV2Entry{idx: idx, pos: i}\n\t}\n\n\treturn entries\n}", "title": "" }, { "docid": "43b9a4e7310839d42b9ba5c07bbffa4d", "score": "0.5964671", "text": "func (m *MemStore) GetAll() ([]string, error) {\n\tvar s []string\n\tfor i := range m.Data {\n\t\tfor j := range m.Data[i] {\n\t\t\ts = append(s, m.Data[i][j])\n\t\t}\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "51e9fb4af32a9a2434524f00000c2c9e", "score": "0.5939243", "text": "func (db *DB) GetEntries(pattern string) (map[string]*Entry, error) {\n\tkeys, err := db.client.Keys(pattern).Result()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tentries := make(map[string]*Entry)\n\tfor _, id := range keys {\n\t\tif strings.HasSuffix(id, \"-log\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tdata, err := db.client.Get(id).Result()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tvar e Entry\n\t\terr = json.Unmarshal([]byte(data), &e)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tentries[id] = &e\n\t}\n\n\treturn entries, nil\n}", "title": "" }, { "docid": "130225da87195548c1f65e8a4f8c88c4", "score": "0.58894575", "text": "func All() []Customer {\n\tdb.lock.Lock()\n\tdefer db.lock.Unlock()\n\n\t// Allocate enough elements for the customers.\n\tall := make([]Customer, len(db.customers))\n\n\t// Range over the map storing each customer\n\t// in their ordered position.\n\tfor _, c := range db.customers {\n\t\tall[c.ID-1] = c\n\t}\n\n\t// Return the slice exlcusing index 0.\n\treturn all\n}", "title": "" }, { "docid": "836c1d1830c37ac163a241422421deff", "score": "0.58874995", "text": "func (a *oasis) GetAll() *Map {\n\treturn a.values\n}", "title": "" }, { "docid": "7c1d8959a76abf84ad2cd25afa2f34c4", "score": "0.58778834", "text": "func (l *lines) All() []string {\n\treturn l.lines\n}", "title": "" }, { "docid": "ddb42d6fdc0350d95bc4c3d0026f62e6", "score": "0.58639956", "text": "func (o GetPbrRouteEntriesResultOutput) Entries() GetPbrRouteEntriesEntryArrayOutput {\n\treturn o.ApplyT(func(v GetPbrRouteEntriesResult) []GetPbrRouteEntriesEntry { return v.Entries }).(GetPbrRouteEntriesEntryArrayOutput)\n}", "title": "" }, { "docid": "b96e6d394b77e17723d8e5ce99464482", "score": "0.58556813", "text": "func (rs *MapResultSet) All() ([]*Map, error) {\n\tvar result []*Map\n\tfor rs.Next() {\n\t\trecord, err := rs.Get()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresult = append(result, record)\n\t}\n\treturn result, nil\n}", "title": "" }, { "docid": "d4cb14fe72a2dcca0c9777bc379b0583", "score": "0.58520806", "text": "func (c *Cluster) All() []string {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\n\tkeys := make([]string, 0, len(c.c))\n\tfor k, _ := range c.c {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\treturn keys\n}", "title": "" }, { "docid": "447cde84406bb189a1ac3ce3bd6d1649", "score": "0.584336", "text": "func (s *LevelDbStorage) GetAll() []string {\n\tvar result []string\n\n\titer := s.Db.NewIterator(nil, nil)\n\tfor iter.Next() {\n\t\tkey := string(iter.Key())\n\t\tresult = append(result, key)\n\t}\n\titer.Release()\n\terr := iter.Error()\n\tif err != nil {\n\t\tlogger.Error(\"db get all data error\", zap.Error(err))\n\t}\n\treturn result\n}", "title": "" }, { "docid": "6b9dfc80b2a1fed022e636d5f7720cf0", "score": "0.5835787", "text": "func (s *Multiset) GetAll() []MLesser {\n\treturn s.data\n}", "title": "" }, { "docid": "de272a383594c3f8c7acbad23c3cf516", "score": "0.5829638", "text": "func (c *Cache) GetAll(n int) []Fact {\n\treturn c.all.GetN(n)\n}", "title": "" }, { "docid": "f73f1ab7044ee3289dae5072bb41cecb", "score": "0.5826963", "text": "func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error) {\n\tq := r.q.Select(\"entries\")\n\tfor i := len(opts) - 1; i >= 0; i-- {\n\t\t// `path` optional argument\n\t\tif !querybuilder.IsZeroValue(opts[i].Path) {\n\t\t\tq = q.Arg(\"path\", opts[i].Path)\n\t\t}\n\t}\n\n\tvar response []string\n\n\tq = q.Bind(&response)\n\treturn response, q.Execute(ctx, r.c)\n}", "title": "" }, { "docid": "8253ad7687b13db0e2de73d3373d0db7", "score": "0.5822047", "text": "func (t *Trust) GetAll(id *mcrypt.Identity) ([]*TrustRecord, error) {\n\tt.mtx.RLock()\n\tdefer t.mtx.RUnlock()\n\n\tarray := make([]*TrustRecord, 0, 100)\n\n\titer := t.db.NewIterator(nil, nil)\n\tfor iter.Next() {\n\t\t//pubKey := iter.Key()\n\t\tdbPayload := iter.Value()\n\t\ttr, err := t.decrypt(id, dbPayload)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tarray = append(array, tr)\n\t}\n\titer.Release()\n\terr := iter.Error()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn array, nil\n}", "title": "" }, { "docid": "bff4fb291abee2d778bc51e395ba46d0", "score": "0.58177733", "text": "func (s Service) GetAll(ctx context.Context) ([]Era, error) {\n\treturn s.table.GetAll(ctx)\n}", "title": "" }, { "docid": "0511257485336808c5359c2a8c0d0ebe", "score": "0.5814654", "text": "func List(order Order) EntrySlice {\n\tmtx.Lock()\n\n\tres := make([]Entry, len(entries))\n\n\ti := 0\n\tfor _, v := range entries {\n\t\tres[i] = v\n\t\ti++\n\t}\n\n\tmtx.Unlock()\n\n\tif order == nil {\n\t\torder = ById\n\t}\n\n\tsort.Slice(res, order(res))\n\n\treturn res\n}", "title": "" }, { "docid": "13be181e2ffee18ff22f3404103d8e6a", "score": "0.580898", "text": "func (r *Registrar) GetAll() map[string][]string {\n\tout := make(map[string][]string)\n\n\tr.mu.Lock()\n\t// copy index into out\n\tfor id, names := range r.idx {\n\t\tout[id] = names\n\t}\n\tr.mu.Unlock()\n\treturn out\n}", "title": "" }, { "docid": "417c50d932bc326d022f3a127edf12e9", "score": "0.5794703", "text": "func (fdb *Feed) GetAll() ([]*entity.Feed, error) {\n\tfs := make([]*entity.Feed, 0, defaultCapSlice)\n\terr := db.View(func(tx *bolt.Tx) error {\n\t\tb := tx.Bucket(bucketNameregisteredFeedURL)\n\n\t\terr := b.ForEach(func(k, v []byte) error {\n\t\t\tf := new(entity.Feed)\n\t\t\terr := json.Unmarshal(v, f)\n\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"feed unmarshal error\")\n\t\t\t}\n\t\t\tfs = append(fs, f)\n\t\t\treturn nil\n\t\t})\n\t\treturn err\n\t})\n\treturn fs, err\n}", "title": "" }, { "docid": "1a8e21a006a0ea7a4991e19dae9289d6", "score": "0.57912797", "text": "func (c *Championship) AllEntrants() EntryList {\n\te := make(EntryList)\n\n\tfor _, class := range c.Classes {\n\t\tfor _, entrant := range class.Entrants {\n\t\t\te.Add(entrant)\n\t\t}\n\t}\n\n\treturn e\n}", "title": "" }, { "docid": "366100fa386486b4b6ebfbe3cc465541", "score": "0.578558", "text": "func (lb *LogBuffer) Entries(startID int, endID int, limit int) []*Entry {\n\tlb.lock.RLock()\n\tdefer lb.lock.RUnlock()\n\n\tstartIndex, entryCount := computeSlice(startID, endID, limit, lb.totalEntries, len(lb.buffer))\n\tif entryCount <= 0 {\n\t\treturn nil\n\t}\n\n\t// Copy the pointers to entries from the underlying lb.buffer into a new slice to return.\n\t// We can avoid copying the contents of the entries since they are not modified by this\n\t// object.\n\tentries := make([]*Entry, entryCount)\n\tcopiedCount := copy(entries, lb.buffer[startIndex:])\n\t// Fill in the rest of entries beginning from the start of lb.buffer.\n\tcopy(entries[copiedCount:], lb.buffer)\n\n\treturn entries\n}", "title": "" }, { "docid": "6334f1afddca3ecf173a8af4e806516c", "score": "0.577888", "text": "func (r *RecipeService) All() ([]domain.Recipe, error) {\n\trecipes := make([]domain.Recipe, 0)\n\trows, err := r.DB.Query(\"SELECT Id, Name, Description, DurationMinutes, Source, Serves FROM Recipes;\")\n\tif err != nil {\n\t\treturn []domain.Recipe{}, nil\n\t}\n\tdefer rows.Close()\n\n\tfor rows.Next() {\n\t\trecipe := domain.Recipe{}\n\t\tif err := rows.Scan(&recipe.ID, &recipe.Name, &recipe.Description, &recipe.DurationMinutes, &recipe.Source, &recipe.Serves); err != nil {\n\t\t\treturn []domain.Recipe{}, nil\n\t\t}\n\t\trecipes = append(recipes, recipe)\n\t}\n\n\treturn recipes, nil\n}", "title": "" }, { "docid": "5a99de1357a5637453a4594eeb018cd0", "score": "0.57679355", "text": "func (sh *memoryStorage) GetAll() (ids []string) { return }", "title": "" }, { "docid": "751e5bab47f93f42f0d83fd653de0763", "score": "0.57477033", "text": "func (z Entries) Unique() Entries {\n\n\tuniques := make(map[string]*Entry)\n\tfor _, entry := range z {\n\t\tuniques[entry.GetID()] = entry\n\t}\n\n\tentries := Entries{}\n\tfor _, entry := range uniques {\n\t\tentries = append(entries, entry)\n\t}\n\n\treturn entries\n\n}", "title": "" }, { "docid": "12b9e68055c4dfd58efb2cc485f2a85e", "score": "0.57473636", "text": "func (this *Devices) All() []Item {\n var items []Item\n\n for _, v := range this.items {\n items = append(items, v)\n }\n\n return items\n}", "title": "" }, { "docid": "0a2efd6f295b83948036110a8f535a93", "score": "0.5740215", "text": "func All() *[]models.Article {\n\tqs := db.GetDb().QueryTable(\"articles\")\n\tarticles := new([]models.Article)\n\tqs.All(articles)\n\treturn articles\n}", "title": "" }, { "docid": "5c34c2ff745d9ffa664191b0ab651849", "score": "0.57387525", "text": "func (l *Librus) GetTimetableEntries() ([]*TimetableEntry, error) {\n\tres, err := l.GetData(\"TimetableEntries\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer res.Body.Close()\n\n\ttimetableEntriesResponse := new(TimetableEntriesResponse)\n\tif err := json.NewDecoder(res.Body).Decode(timetableEntriesResponse); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar wg sync.WaitGroup\n\tvar entries []*TimetableEntry\n\tfor _, te := range timetableEntriesResponse.Entries {\n\t\t// get lesson\n\t\twg.Add(1)\n\t\tentry := &TimetableEntry{}\n\t\tentry.TimetableEntryDefault = te.TimetableEntryDefault\n\t\tgo func(lessonID int) {\n\t\t\tdefer wg.Done()\n\t\t\tlesson, err := l.GetLesson(lessonID)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// get subject\n\t\t\tsubject, err := l.GetSubject(lesson.Subject.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tentry.Subject = subject\n\n\t\t\t// get teacher\n\t\t\tteacher, err := l.GetUser(lesson.Teacher.ID)\n\t\t\tentry.Teacher = teacher\n\t\t\tentries = append(entries, entry)\n\n\t\t}(te.Lesson.ID)\n\t}\n\twg.Wait()\n\n\treturn entries, nil\n}", "title": "" }, { "docid": "ce9386f7aeb2e3145ada6bdec0383031", "score": "0.5729094", "text": "func (w *Wallet) GetEntries(_ ...wallet.Option) (wallet.Entries, error) {\n\treturn w.entries.Clone(), nil\n}", "title": "" }, { "docid": "ce9386f7aeb2e3145ada6bdec0383031", "score": "0.5729094", "text": "func (w *Wallet) GetEntries(_ ...wallet.Option) (wallet.Entries, error) {\n\treturn w.entries.Clone(), nil\n}", "title": "" }, { "docid": "cfea753130aea778173a74b39fb4024d", "score": "0.5715886", "text": "func (itm *impl) GetAll(k string) (ret []string) {\n\tvar value []*item\n\tvar ok bool\n\tvar i int\n\n\titm.RLock()\n\tvalue, ok = itm.items[key(k)]\n\titm.RUnlock()\n\tif !ok {\n\t\treturn\n\t}\n\tfor i = range value {\n\t\tret = append(ret, value[i].Value)\n\t}\n\treturn\n}", "title": "" }, { "docid": "de7fad2e2e1c2b8018a3acdc47bc5186", "score": "0.56995463", "text": "func (store *ForensicStore) All() (elements []JSONElement, err error) {\n\treturn store.Select(nil)\n}", "title": "" }, { "docid": "6eb29bfe9d2dc0bc2881c0a8c6bbbf01", "score": "0.5691283", "text": "func (entry *SliceEntry) AllMsg() []*models.FilscanMsg {\n\tentry.Lock()\n\tdefer entry.Unlock()\n\tlen := entry.Size()\n\tvar res []*models.FilscanMsg\n\tfor key, _ := range entry.element {\n\t\toneTipset := entry.element[len-1-key]\n\t\tfor _, b := range oneTipset.Blocks {\n\t\t\tfor _, m := range b.Msg {\n\t\t\t\tres = append(res, m)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}", "title": "" }, { "docid": "711c2c477e1794ff2f5aaaa5df8de89c", "score": "0.5677705", "text": "func (s *Set) GetAll() ([]string, error) {\n\treturn s.All()\n}", "title": "" }, { "docid": "d7d43a04b4736d758cab4f13cbe96f43", "score": "0.5651335", "text": "func (r repo) getTreeEntries() ([]*gl.TreeNode, error) {\n\t// Reset tree entries\n\ttreeEntries := make([]*gl.TreeNode, 0)\n\tpid := r.owner + \"/\" + r.name\n\trecursive := true\n\n\tlistTreeOptions := &gl.ListTreeOptions{\n\t\tRecursive: &recursive,\n\t\tRef: &r.branch,\n\t\tListOptions: gl.ListOptions{\n\t\t\tPage: 1,\n\t\t\tPerPage: 100,\n\t\t},\n\t}\n\n\tfor {\n\t\ttreeNodes, resp, err := r.client.Repositories.ListTree(pid, listTreeOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttreeEntries = append(treeEntries, treeNodes...)\n\n\t\t// Break if no next page\n\t\tif resp.NextPage == 0 {\n\t\t\tbreak\n\t\t}\n\t\tlistTreeOptions.ListOptions.Page = resp.NextPage\n\t}\n\treturn treeEntries, nil\n}", "title": "" }, { "docid": "d9312b89f55f36d4937b6ff0b5c92cc2", "score": "0.5649282", "text": "func (o *Avi) FetchAll() (r []Data, err error) {\n\t////////////////////////////////////////////////////////////////////////////\n\tavi := new(tmavi.Avi)\n\tavi.Client = o.Client\n\t////////////////////////////////////////////////////////////////////////////\n\tall, err := avi.GetAllHealthmonitors()\n\tif err != nil {\n\t\treturn\n\t}\n\t////////////////////////////////////////////////////////////////////////////\n\tfor _, val := range all {\n\t\td, err := o.etlFetch(val)\n\t\tif err != nil {\n\t\t\t//\to.Log.Warn(err)\n\t\t\tcontinue\n\t\t}\n\t\tr = append(r, *d)\n\t}\n\treturn\n}", "title": "" }, { "docid": "34f90e10e189be768a7619ec88f6d05d", "score": "0.56429493", "text": "func (s *Set) All() ([]string, error) {\n\trows, err := s.host.db.Query(\"SELECT \" + setCol + \" FROM \" + s.table)\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tdefer rows.Close()\n\tvar (\n\t\tvalues []string\n\t\tvalue string\n\t)\n\tfor rows.Next() {\n\t\terr = rows.Scan(&value)\n\t\tif !s.host.rawUTF8 {\n\t\t\tDecode(&value)\n\t\t}\n\t\tvalues = append(values, value)\n\t\tif err != nil {\n\t\t\t// Unusual, worthy of panic\n\t\t\tpanic(err.Error())\n\t\t}\n\t}\n\tif err := rows.Err(); err != nil {\n\t\t// Unusual, worthy of panic\n\t\tpanic(err.Error())\n\t}\n\treturn values, nil\n}", "title": "" }, { "docid": "fa7e3821b06c5540bf6dee71a830949d", "score": "0.56403977", "text": "func (c *Configs) GetAll() *ident.TableMap[*Config] {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\tdata := c.mu.data\n\n\tret := &ident.TableMap[*Config]{}\n\tdata.CopyInto(ret)\n\treturn ret\n}", "title": "" }, { "docid": "1097c51b6dae4ee6950617ec9a8de578", "score": "0.5634222", "text": "func (a *ThingAPI) GetAll() interface{} {\r\n\tvar t []Thing\r\n\tfor _, e := range thingMap {\r\n\t\tt = append(t, e)\r\n\t}\r\n\treturn t\r\n}", "title": "" }, { "docid": "9115543b35f7575dcfad69a8019f2fce", "score": "0.56290156", "text": "func (s *Store) Values() []interface{} {\n\tvals := []interface{}{}\n\tfor _, v := range s.entries {\n\t\tvals = append(vals, v.Value)\n\t}\n\treturn vals\n}", "title": "" }, { "docid": "e037e0917b97d86ee0221f683fc6271c", "score": "0.5610167", "text": "func (w *FeatureStoreWrapper) All(kind ld.VersionedDataKind) (map[string]ld.VersionedData, error) {\n\tif w.cache == nil {\n\t\treturn w.core.GetAllInternal(kind)\n\t}\n\t// Check whether we have a cache item for the entire data set\n\tcacheKey := featureStoreAllItemsCacheKey(kind)\n\tif data, present := w.cache.Get(cacheKey); present {\n\t\tif items, ok := data.(map[string]ld.VersionedData); ok {\n\t\t\treturn items, nil\n\t\t}\n\t}\n\t// Data set was not cached or cached value was not valid\n\titems, err := w.core.GetAllInternal(kind)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn w.filterAndCacheItems(kind, items), nil\n}", "title": "" }, { "docid": "40d0e824845b1ceb08c0e6c1e3cb0c52", "score": "0.55934006", "text": "func (amsetl *AMSETL) GetEntries() (*ldap.SearchResult,error) {\n\tl, err := ldap.Dial(\"tcp\", amsetl.LdapConfig.Server)\n\tif err != nil {\n\t\treturn nil,err\n\t}\n\tdefer l.Close()\n\terr = l.Bind(amsetl.LdapConfig.Username, amsetl.LdapConfig.Password)\n\tif err != nil {\n\t\treturn nil,err\n\t}\n\tsearchRequest := ldap.NewSearchRequest(\n\t\tamsetl.LdapOptions.BaseDN, // The base dn to search\n\t\tldap.ScopeWholeSubtree,\n\t\tldap.NeverDerefAliases,\n\t\tmath.MaxInt32,\n\t\t0,\n\t\tfalse,\n\t\tamsetl.LdapOptions.ObjectFilter, // The filter to apply\n\t\tamsetl.LdapOptions.AttributesRetrieval, // A list attributes to retrieve\n\t\tnil,\n\t)\n\tsearchResult, err := l.SearchWithPaging(searchRequest, math.MaxInt32)\n\tif err != nil {\n\t\treturn nil,err\n\t}\n\tl.Close()\n\treturn searchResult,nil\n}", "title": "" }, { "docid": "6aa4c24bab9f784cb090017d968d8db8", "score": "0.5582511", "text": "func (r *Registry) FetchAll() map[string][]*Instance {\n\tapps := r.getAllApplications()\n\trs := make(map[string][]*Instance)\n\tfor _, app := range apps {\n\t\trs[app.appid] = append(rs[app.appid], app.GetAllInstances()...)\n\t}\n\treturn rs\n}", "title": "" }, { "docid": "4e81cc428324ea1859bc8b3cd1df1b51", "score": "0.55821466", "text": "func(es *ExpirableSet) GetAll() []interface{} {\n\tes.mutex.Lock()\n\tvar tempSlice []interface{}\n\tfor elem, base := range es.elems {\n\t\tif base.isExpired() {\n\t\t\tdelete(es.elems, elem)\n\t\t} else {\n\t\t\ttempSlice = append(tempSlice, elem)\n\t\t}\n\t}\n\n\tes.mutex.Unlock()\n\treturn tempSlice\n}", "title": "" }, { "docid": "78b783c3359ccff2b48822dbe85acf8c", "score": "0.55758774", "text": "func (r Record) GetAll(key string) []string {\n\tvar l []string\n\n\tfor _, p := range r {\n\t\tif p[0] == key {\n\t\t\tl = append(l, p[1])\n\t\t}\n\t}\n\n\treturn l\n}", "title": "" }, { "docid": "aa7f9109a23b27b347806a32d2c4bd71", "score": "0.55557126", "text": "func (a *StuffAPI) GetAll() interface{} {\r\n\tvar s []Stuff\r\n\tfor _, e := range stuffMap {\r\n\t\ts = append(s, e)\r\n\t}\r\n\treturn s\r\n}", "title": "" }, { "docid": "bad175ee2c14ffa9e847f84684e3c426", "score": "0.5554537", "text": "func GetAllEventsList() *sql.Rows {\n\t//rows, err := GetDB().Query(\"SELECT e.id, t.name as tariff, e.entry, e.exit, e.sum, e.carplate, e.isshown, e.isaccepted, e.isdenied \" +\n\t//\"FROM parking_event e \" +\n\t//\"LEFT JOIN parking_lot l ON e.lot = l.id \" +\n\t//\"LEFT JOIN parking_tariff t ON e.tariff = t.id \" +\n\t//\"WHERE e.isdenied = false \" +\n\t//\"GROUP BY e.id, t.name \" +\n\t//\"ORDER BY entry DESC\"\n\t//)\n\n\trows, err := GetDB().Query(\"SELECT id, tariff, entry, exit, sum, carplate, isshown, isaccepted, isdenied, cartype, nationalitytype, parkingid, isclosed \" +\n\t\t\"FROM parking_event WHERE islocalevent = false;\")\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn rows\n}", "title": "" }, { "docid": "050c5bd0ff0bb0a8af004ae227640fb9", "score": "0.55502164", "text": "func getEntries(limit int, user string) ([]entry, int, int, error) {\n\n\tvar count int\n\tvar length int\n\tvar answer []entry\n\tvar err error\n\tvar rows *sql.Rows\n\n\t// Prepare the queries\n\tqueryCount := dbCount\n\tqueryLength := dbLength\n\tquerySelect := dbSelect\n\n\tif user != \"\" {\n\t\tqueryCount = queryCount + dbUser\n\t\tqueryLength = queryLength + dbUser\n\t\tquerySelect = querySelect + dbUser\n\t}\n\n\tqueryCount = queryCount + dbEnd + \");\"\n\tqueryLength = queryLength + dbEnd + \");\"\n\tquerySelect = querySelect + dbEnd + \";\"\n\n\t// Start by getting a count\n\tif user != \"\" {\n\t\terr = db.QueryRow(queryCount, user, limit).Scan(&count)\n\t} else {\n\t\terr = db.QueryRow(queryCount, limit).Scan(&count)\n\t}\n\n\t// Check the result\n\tif count == 0 {\n\t\treturn answer, 0, 0, nil\n\t} else if err != nil {\n\t\treturn answer, 0, 0, err\n\t}\n\n\t// Get the length\n\tif user != \"\" {\n\t\terr = db.QueryRow(queryLength, user, limit).Scan(&length)\n\t} else {\n\t\terr = db.QueryRow(queryLength, limit).Scan(&length)\n\t}\n\n\t// Check the result\n\tif err != nil {\n\t\treturn answer, 0, 0, err\n\t}\n\n\t// Get the entries\n\tif user != \"\" {\n\t\trows, err = db.Query(querySelect, user, limit)\n\t} else {\n\t\trows, err = db.Query(querySelect, limit)\n\t}\n\n\t// Check the result\n\tif err != nil {\n\t\treturn answer, 0, 0, err\n\t}\n\n\t// Fetch the results into answer\n\tfor rows.Next() {\n\t\titem := entry{}\n\t\terr2 := rows.Scan(&item.timestamp, &item.user, &item.message)\n\t\tif err2 != nil {\n\t\t\treturn answer, 0, 0, err\n\t\t}\n\t\tanswer = append(answer, item)\n\t}\n\n\t// Close the query when finished.\n\trows.Close()\n\n\treturn answer, count, length, nil\n}", "title": "" }, { "docid": "67d2712da615e38508aa24c3f2626776", "score": "0.55444443", "text": "func (repo *xormRepository) GetAll() ([]*entity.Recipe, error) {\n\trecipes := []*entity.Recipe{}\n\n\terr := repo.db.Find(&recipes)\n\n\treturn recipes, err\n}", "title": "" }, { "docid": "86198387a2ba2cebfb71f7ba977ab5a5", "score": "0.5534795", "text": "func (o *DebugModeLogs) All() []string {\n\to.mu.Lock()\n\tret := make([]string, len(o.logs))\n\tfor i := range o.logs {\n\t\tret[i] = o.logs[i]\n\t}\n\to.mu.Unlock()\n\treturn ret\n}", "title": "" }, { "docid": "2eb12849d1c18dec1187636b6087cc18", "score": "0.5518648", "text": "func (d *DB) GetAll(bucket string) (objects [][]byte, err error) {\n\terr = d.db.View(func(tx *bolt.Tx) (err error) {\n\t\tb, err := d.bucket(tx, bucket)\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\terr = b.ForEach(func(k []byte, v []byte) (err error) {\n\t\t\tobjects = append(objects, v)\n\t\t\treturn\n\t\t})\n\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "65b8b7c593f0fca967ba1c8b8c21b5af", "score": "0.5518209", "text": "func (q kvQuery) All(ctx context.Context, exec boil.ContextExecutor) (KVSlice, error) {\n\tvar o []*KV\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"boiler: failed to assign all query results to KV slice\")\n\t}\n\n\treturn o, nil\n}", "title": "" }, { "docid": "2e39784050a08c458c3fa1db63f46059", "score": "0.55178034", "text": "func (e Entry) AllKeys() []KeyVal {\n\tif e.Set != nil {\n\t\treturn MergeKeyValSet(e.Set.Keywords, e.Keywords)\n\t}\n\treturn e.Keywords\n}", "title": "" }, { "docid": "6e3d7f4eb5468bc97a4f2a56fe2300b1", "score": "0.55123985", "text": "func (m *MemoryStore) GetAll() []models.Item {\n\treturn m.items\n}", "title": "" }, { "docid": "3769e9679a944a719a945382169e9399", "score": "0.5507407", "text": "func (w *RRWI) All() []interface{} {\n\tallItems := make([]interface{}, 0)\n\tfor _, i := range w.items {\n\t\tallItems = append(allItems, i.Item())\n\t}\n\treturn allItems\n}", "title": "" }, { "docid": "7e3902638440374c24d65864a214f8c5", "score": "0.55039036", "text": "func (m *Map) GetItems() []MapEntry {\n\tm.RLock()\n\tdefer m.RUnlock()\n\n\tkeys := m.GetKeys()\n\tret := make([]MapEntry, len(keys))\n\ti := 0\n\tfor _, k := range keys {\n\t\tret[i] = MapEntry{\n\t\t\tKey: k,\n\t\t\tValue: m.data[k],\n\t\t}\n\t\ti++\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "6439cc891cbcc635442222ec8ac55e02", "score": "0.550235", "text": "func all() (z []map[string]interface{}, err error) {\n\tdb, err := sql.Open(\n\t\t\"postgres\",\n\t\tcommons.BuildDSN(),\n\t)\n\tif err != nil {\n\t\tlog.Error().Err(err).Msg(\"Failed to connect to DB\")\n\t\treturn z, err\n\t}\n\tdefer db.Close()\n\n\tstmt, err := db.Prepare(\"SELECT *, (SELECT count(team_id) FROM teams) total FROM teams ORDER BY date\")\n\tif err != nil && err != sql.ErrNoRows {\n\t\treturn z, err\n\t}\n\tdefer stmt.Close()\n\n\trows, err := stmt.Query()\n\tif err != nil && err != sql.ErrNoRows {\n\t\treturn z, err\n\t}\n\n\tcolumns, err := rows.Columns()\n\tif err != nil {\n\t\treturn z, err\n\t}\n\n\tvalues := make([]sql.RawBytes, len(columns))\n\tscanArgs := make([]interface{}, len(values))\n\tfor i := range values {\n\t\tscanArgs[i] = &values[i]\n\t}\n\n\tm := make([]map[string]interface{}, 0)\n\tfor rows.Next() {\n\t\terr = rows.Scan(scanArgs...)\n\t\tif err != nil {\n\t\t\treturn z, err\n\t\t}\n\t\tvar value string\n\t\tsub := make(map[string]interface{})\n\t\tfor i, col := range values {\n\t\t\tif col == nil {\n\t\t\t\tvalue = \"\"\n\t\t\t} else {\n\t\t\t\tvalue = php2go.Stripslashes(string(col))\n\t\t\t}\n\t\t\tsub[columns[i]] = value\n\t\t}\n\t\tm = append(m, sub)\n\t}\n\tif err = rows.Err(); err != nil {\n\t\treturn z, err\n\t}\n\treturn m, nil\n}", "title": "" }, { "docid": "9419d2a03b74e651ae7e2cf04c8020d0", "score": "0.55000347", "text": "func GetLedgerEntryArray(rows *sql.Rows) ([]LedgerEntry, error) {\n\tvar m []LedgerEntry\n\tfor rows.Next() {\n\t\tvar le LedgerEntry\n\t\tReadLedgerEntries(rows, &le)\n\t\tm = append(m, le)\n\t}\n\treturn m, rows.Err()\n}", "title": "" }, { "docid": "52e9d6bfaad6f7080caccaee70b4cd7d", "score": "0.5485541", "text": "func (s *TradeService) All(symbol string) ([]TradeSnapshot, error) {\n\treq, err := s.requestFactory.NewAuthenticatedRequestWithData(path.Join(\"trades\", symbol, \"hist\"), map[string]interface{}{\"limit\": BitfnexTradeRecordLimit})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\traw, err := s.Request(req)\n\n\tlog.Printf(\"%+v\\n\", raw)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdat := make([]TradeSnapshot, 0)\n\tfor _, r := range raw {\n\t\tt := r.([]interface{})\n\t\tdat = append(dat, TradeSnapshot{\n\t\t\tID: (int64)(t[0].(float64)),\n\t\t\tPair: t[1].(string),\n\t\t\tMTSCreated: (int64)(t[2].(float64)),\n\t\t\tOrderID: (int64)(t[3].(float64)),\n\t\t\tExecAmount: t[4].(float64),\n\t\t\tExecPrice: t[5].(float64),\n\t\t\t//OrderType: t[6].(*string),\n\t\t\t//OrderPrice: t[7].(*float64),\n\t\t\t//Maker: t[8].(*float64),\n\t\t\tFee: t[9].(float64),\n\t\t\tFeeCurrency: t[10].(string),\n\t\t})\n\n\t\tif f, ok := r.(TradeSnapshot); ok {\n\t\t\tdat = append(dat, f)\n\t\t}\n\t}\n\treturn dat, nil\n}", "title": "" }, { "docid": "103b1a7c9e1a6c802928d103b1b5a3b8", "score": "0.54836", "text": "func (b *BlockTable) Entries() []BlockTableEntry {\n\tif b.entries != nil {\n\t\treturn b.entries\n\t}\n\toffset := 0\n\n\tentries := make([]BlockTableEntry, b.EntryCount)\n\tfor i := 0; i < b.EntryCount; i++ {\n\t\tentry := &entries[i]\n\n\t\tentry.FilePosition = binary.LittleEndian.Uint32(b.Table[offset : offset+4])\n\t\toffset += 4\n\t\tentry.CompressedSize = binary.LittleEndian.Uint32(b.Table[offset : offset+4])\n\t\toffset += 4\n\t\tentry.FileSize = binary.LittleEndian.Uint32(b.Table[offset : offset+4])\n\t\toffset += 4\n\t\tentry.Flags = binary.LittleEndian.Uint32(b.Table[offset : offset+4])\n\t\toffset += 4\n\t}\n\n\tb.entries = entries\n\treturn entries\n}", "title": "" }, { "docid": "2a944652d07e310be8071d7c5303de33", "score": "0.5480842", "text": "func (q *stack) all() interface{} {\n\treturn q.Content.All()\n}", "title": "" }, { "docid": "837ed57afe39a97440668b70bcc48d13", "score": "0.5478944", "text": "func (s *inMemoryEntriesStore) GetAndCleanEntries() []logger.Entry {\n\tentries := s.GetEntries()\n\ts.CleanEntries()\n\treturn entries\n}", "title": "" }, { "docid": "41b3700018ab0aa7fd5db525f92934f6", "score": "0.54506403", "text": "func (hq *HexQuery) All(ctx context.Context) ([]*Hex, error) {\n\tif err := hq.prepareQuery(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn hq.sqlAll(ctx)\n}", "title": "" } ]
93fd19fa5c2f0b10e67afe9cc83f8cad
GetGameInfoFromName returns game info from a gameName
[ { "docid": "fd3c9532603a00c58b24f6fbbd0c8a99", "score": "0.8230596", "text": "func GetGameInfoFromName(name string) GameInfo {\n\tfor _, game := range GameList {\n\t\tif game.Name == name {\n\t\t\treturn game\n\t\t}\n\t}\n\n\treturn GameInfo{}\n}", "title": "" } ]
[ { "docid": "77196cd3bfe1805c36f873d4f5a007b1", "score": "0.62164176", "text": "func getGameInfo(path string) GameInfo {\n\t// Remove prefix to obtain file names\n\tfileName := filepath.Base(path)\n\text := filepath.Ext(fileName)\n\treturn GameInfo{\n\t\tName: strings.TrimSuffix(fileName, ext),\n\t\tType: ext[1:],\n\t\tPath: path,\n\t}\n}", "title": "" }, { "docid": "788117dc4684d8f1b5202ebaf7028820", "score": "0.57086897", "text": "func (self *XoState) GetGame(name string) (*Game, error) {\n\tgames, err := self.loadGames(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgame, ok := games[name]\n\tif ok {\n\t\treturn game, nil\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "f97962b508263a9f564607fea7794775", "score": "0.5611493", "text": "func (a *GamesApiService) GamesByGameName(ctx context.Context) ApiGamesByGameNameRequest {\n\treturn ApiGamesByGameNameRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "9f475edb0c97fb9d31ddcb673e9ce242", "score": "0.5481935", "text": "func getPlayerGameDetail(w http.ResponseWriter, r *http.Request) (found *PlayerGame, ok bool) {\n\t_, id, _ := util.GetRouteParams(r.URL.Path)\n\tfound, ok = PlayerGameMap[id]\n\tif !ok {\n\t\tutil.WriteErrorResponse(w, http.StatusNotFound, \"PlayerGame not found\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "039f2f24495f8df88cc325497e4f35cc", "score": "0.54055655", "text": "func GetGameNameByUrl(url string) string {\n\tif ok, err := regexp.MatchString(\"^/.*/.*/.*$\", url); ok == false || err != nil {\n\t\tlogging.Error(\"url string err:%s\", url)\n\t\treturn \"\"\n\t}\n\treturn strings.Split(url, \"/\")[1]\n}", "title": "" }, { "docid": "77be8f85da8969247b7c0162b617ed31", "score": "0.53727674", "text": "func (g *Game) Name() string {\n\treturn g.name\n}", "title": "" }, { "docid": "8a460a9f3bcd31999fc1a53dd1f95e6b", "score": "0.5268504", "text": "func (_NXlottery *NXlotteryCaller) GetPlayerInfoByAddress(opts *bind.CallOpts, addr common.Address) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, 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(*big.Int)\n\t\tret4 = new(*big.Int)\n\t\tret5 = new(*big.Int)\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}\n\terr := _NXlottery.contract.Call(opts, out, \"getPlayerInfoByAddress\", addr)\n\treturn *ret0, *ret1, *ret2, *ret3, *ret4, *ret5, err\n}", "title": "" }, { "docid": "42d22f92ece2867d3d350c35a3da4ad2", "score": "0.52649796", "text": "func GetTeamByName(w http.ResponseWriter, r *http.Request) {\n\trender := render.New()\n\n\tteamName := r.URL.Query().Get(\"teamName\")\n\n\texpenseObject, err := participant.GetParticipant(teamName)\n\tif err != nil {\n\t\tfmt.Println(\"Cannot get Team Name \", err.Error())\n\t\trender.JSON(w, http.StatusBadGateway, \"Team Details\")\n\t\treturn\n\t}\n\trender.JSON(w, http.StatusOK, expenseObject)\n\treturn\n}", "title": "" }, { "docid": "dfb100d08f7aee3e15ddb0f3f019db0d", "score": "0.525273", "text": "func GetInfo(gameID string, conn redis.Conn) (*Info, error) {\n\tplayers, err := GetPlayersIn(gameID, conn)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting players in game %v: %w\", gameID, err)\n\t}\n\tinfo := make(map[string]player.Info, len(players))\n\tfor _, player := range players {\n\t\tinfo[string(player.ID)] = player.Info()\n\t}\n\treturn &Info{ID: gameID, Players: info}, nil\n}", "title": "" }, { "docid": "ba5e7fc696c9ccd3785f73a7615a1a87", "score": "0.5206204", "text": "func PlayerName() string {\n\t// <<-- Creer-Merge: getName -->>\n\treturn \"Anarchy Go Player\"\n\t// <<-- /Creer-Merge: getName -->>\n}", "title": "" }, { "docid": "a20cc38b14f3b1b73ef27d6d0cfc9923", "score": "0.5194427", "text": "func NewGameFromRepoWithName(repo db.Repository, name string) (Game, error) {\n\tgame := Game{}\n\tok, err := repo.Fetch(gamesBucketName, Slug(name), &game)\n\tif err == nil {\n\t\tif ok {\n\t\t\treturn game, nil\n\t\t}\n\t\treturn game, db.EntryNotFound(fmt.Sprintf(\"game with name %v doesn't exists\", name))\n\t}\n\treturn game, err\n}", "title": "" }, { "docid": "0c9ccd92621137d93be775783c4af937", "score": "0.51743793", "text": "func GetMatchmakerGameInfo(settings *playfab.Settings, postData *GetMatchmakerGameInfoRequestModel, developerSecretKey string) (*GetMatchmakerGameInfoResultModel, error) {\r\n if developerSecretKey == \"\" {\n return nil, playfab.NewCustomError(\"developerSecretKey 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, \"/Admin/GetMatchmakerGameInfo\", \"X-SecretKey\", developerSecretKey)\r\n if err != nil {\r\n return nil, err\r\n }\r\n \r\n result := &GetMatchmakerGameInfoResultModel{}\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": "98a967930e66a0c74ee942d724e244ff", "score": "0.5172067", "text": "func (s *SummonerService) GetByName(ctx context.Context, name string) (*Summoner, *Response, error) {\n\tif name == \"\" {\n\n\t\treturn nil, nil ,errors.New(\"Need to set a Summoner Name\")\n\n\t}else{\n\n\t\tc := fmt.Sprintf(\"%v/by-name/%v\", s.client.SummonerURL,name)\n\n\t\treturn getSummoner(s, ctx, c)\n\n\t}\n}", "title": "" }, { "docid": "d3e5a093a81f5d383695aac483be3346", "score": "0.51674247", "text": "func TeamRecentGameInfo(\n c appengine.Context,\n userAcls *RequestorAclCache,\n n int,\n playerCache *PlayerCache,\n league *League,\n leagueKey *datastore.Key,\n teamKey *datastore.Key) ([]*GameInfo, []error) {\n infos := make([]*GameInfo, 0, n)\n errors := make([]error, 0)\n\n players, _, err := TeamAllPlayers(c, userAcls, league, leagueKey, teamKey, KeysAndEntities)\n if err != nil {\n errors = append(errors, errwrap.Wrap(err))\n return nil, errors\n }\n\n var gameKeys []*datastore.Key\n {\n var gamesByTeam []*GameByTeam\n q := datastore.NewQuery(\"GameByTeam\").Ancestor(leagueKey).\n Project(\"GameKey\").\n Filter(\"TeamKey =\", teamKey).\n Order(\"-DateTime\").\n Limit(n)\n if _, err := q.GetAll(c, &gamesByTeam); err != nil {\n errors = append(errors, errwrap.Wrap(err))\n return infos, errors\n }\n for _, g := range gamesByTeam {\n gameKeys = append(gameKeys, g.GameKey)\n }\n }\n\n games := make([]*Game, len(gameKeys))\n for i := range games {\n games[i] = new(Game)\n }\n if err := datastore.GetMulti(c, gameKeys, games); err != nil {\n errors = append(errors, errwrap.Wrap(err))\n if me, ok := err.(appengine.MultiError); ok {\n for i, merr := range me {\n if merr == datastore.ErrNoSuchEntity {\n games[i] = nil\n errors = append(errors, errwrap.Wrap(err))\n }\n }\n }\n }\n\n for _, game := range games {\n if game == nil {\n continue\n }\n info := NewGameInfo()\n infos = append(infos, info)\n info.Game = game\n\n for _, p := range players {\n info.AddAppTeamPlayer(p)\n }\n\n for _, playerDto := range game.Players {\n summonerId := playerDto.SummonerId\n statKey := KeyForPlayerGameStatsId(c, game.Id(), MakePlayerId(game.Region, summonerId))\n player, err := playerCache.ById(summonerId)\n if err != nil {\n errors = append(errors, errwrap.Wrap(err))\n }\n pstats := new(PlayerGameStats)\n err = datastore.Get(c, statKey, pstats)\n if err != nil {\n if err == datastore.ErrNoSuchEntity {\n pstats = nil\n } else {\n errors = append(errors, errwrap.Wrap(err))\n }\n }\n info.AddGamePlayer(playerDto.TeamId, player, playerDto.ChampionId, pstats)\n }\n info.computeDerivedData()\n }\n\n return infos, errors\n}", "title": "" }, { "docid": "a18f09eb266803d943519c91324f30ea", "score": "0.5123107", "text": "func (c *Client) GetServerByName(ctx context.Context, name string) (*Server, error) {\n\n\tserver := &Server{}\n\n\tresponse, err := c.HTTPClient.Get(\n\t\tctx,\n\t\tfmt.Sprintf(\"%s/server/%s\", c.APIURL, name),\n\t\tmap[string]string{},\n\t\tmap[string]string{\"X-AUTH-TOKEN\": c.APIKey, \"Content-Type\": \"application/json\"},\n\t)\n\n\tstatusCode := c.HTTPClient.GetStatusCode(response)\n\n\tif statusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Invalid status code %d\", statusCode)\n\t}\n\n\tresponseBody, err := c.HTTPClient.ToString(response)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tserver.LoadFromJSON([]byte(responseBody))\n\n\treturn server, nil\n}", "title": "" }, { "docid": "62cec4506925837e0ec5335a844f9969", "score": "0.5117813", "text": "func (rp *RPCPlayer)Name() string {\n return rp.name\n}", "title": "" }, { "docid": "c99b61dd06ef395558ab8c80b15f7de7", "score": "0.5109595", "text": "func (db *DataBase) GetPlayerIDbyName(username string) (id int, err error) {\n\tsqlStatement := `SELECT id FROM Player WHERE name = $1`\n\trow := db.Db.QueryRow(sqlStatement, username)\n\n\terr = row.Scan(&id)\n\tif err != nil {\n\t\tutils.Debug(false, \"cant get player's ID by his name\")\n\t}\n\treturn\n}", "title": "" }, { "docid": "22f5ce5918727e0c2c8aed455f52966e", "score": "0.50883627", "text": "func (g *Game) GameStateName() string {\n\treturn g.stateMachine.CurrentStateName()\n}", "title": "" }, { "docid": "ed437e6a8a0223adcdfa6668ea932c1f", "score": "0.50608134", "text": "func GetAccountInfoFromName(account string, t *testing.T) authtypes.AccountI {\n\taddr := GetAccountAddr(account, t)\n\treturn GetAccountInfoFromAddr(addr, t)\n}", "title": "" }, { "docid": "f4b692917b538283dbf717bd45aa0d5e", "score": "0.50598925", "text": "func (a *GamesApiService) GamesByGameNameV1(ctx context.Context) ApiGamesByGameNameV1Request {\n\treturn ApiGamesByGameNameV1Request{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}", "title": "" }, { "docid": "fb843da38079b2b80de9b12f254b1913", "score": "0.50299114", "text": "func (m *MockPhabricatorStore) GetByName(v0 context.Context, v1 api.RepoName) (*types.PhabricatorRepo, error) {\n\tr0, r1 := m.GetByNameFunc.nextHook()(v0, v1)\n\tm.GetByNameFunc.appendCall(PhabricatorStoreGetByNameFuncCall{v0, v1, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "7995500c8847f1bb18613d09f2e3d05d", "score": "0.501391", "text": "func (s Server)extractInfos(c *gin.Context)(*NetworkGame,string){\n\tif name,err := c.Cookie(\"player\"); err == nil {\n\t\tif game := s.gameManager.Get(c.Param(\"game_code\")) ; game != nil {\n\t\t\treturn game,name\n\t\t}\n\t}\n\treturn nil,\"\"\n}", "title": "" }, { "docid": "9d0c76b49a31f93577584e4f5f8bc380", "score": "0.499045", "text": "func (appinfo AppInfo) GetName() string {\n\tret0 := C.g_app_info_get_name(appinfo.native())\n\tret := C.GoString(ret0)\n\treturn ret\n}", "title": "" }, { "docid": "112b0eac7b9b8add047316d01c5bbb57", "score": "0.49675173", "text": "func (t *Tiger) _betInfo(k types.Address) *PlayerInfo {\n\n\treturn t.sdk.Helper().StateHelper().GetEx(fmt.Sprintf(\"/betInfo/%v\", k), new(PlayerInfo)).(*PlayerInfo)\n}", "title": "" }, { "docid": "3c5c8546d604bcad85d806bb2df81ff5", "score": "0.49481168", "text": "func (gg GetGame) ToGameinfo(inputDirectory string, outputDirectory string, gameFilename string, resizeWidth uint) model.Gameinfo {\n\tg := gg.Game\n\n\t// misc fields\n\n\tgenre := \"\"\n\tgenres := g.Genres.Genres\n\tif len(genres) > 0 {\n\t\tgenre = strings.Join(genres, \", \")\n\t}\n\n\trating := 0.0\n\trating, _ = strconv.ParseFloat(g.Rating, 32)\n\n\tvar wg sync.WaitGroup\n\n\t// fanarts\n\n\tfanarts := make([]string, 0)\n\tfor i, v := range gg.Game.Images.Fanarts {\n\t\twg.Add(1)\n\n\t\tgo func(wg *sync.WaitGroup, path string, i int) {\n\t\t\tdefer wg.Done()\n\n\t\t\text := filepath.Ext(path)\n\t\t\tfilename, err := scraper.Download(gg.BaseImageURL+path, gameFilename, \"-fanart-\"+strconv.Itoa(i)+ext, outputDirectory, resizeWidth)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[err] While downloading \", gg.BaseImageURL+path, \":\", err.Error())\n\t\t\t} else {\n\t\t\t\tfanarts = append(fanarts, outputDirectory+filename)\n\t\t\t}\n\t\t}(&wg, v.Original, i)\n\t}\n\n\t// screenshots\n\n\tscreenshots := make([]string, 0)\n\tfor i, v := range gg.Game.Images.Screenshots {\n\t\twg.Add(1)\n\n\t\tgo func(wg *sync.WaitGroup, path string, i int) {\n\t\t\tdefer wg.Done()\n\n\t\t\text := filepath.Ext(path)\n\t\t\tfilename, err := scraper.Download(gg.BaseImageURL+path, gameFilename, \"-screenshot-\"+strconv.Itoa(i)+ext, outputDirectory, resizeWidth)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[err] While downloading \", gg.BaseImageURL+path, \":\", err.Error())\n\t\t\t} else {\n\t\t\t\tscreenshots = append(screenshots, outputDirectory+filename)\n\t\t\t}\n\t\t}(&wg, v.Original, i)\n\t}\n\n\t// logos\n\n\tlogos := make([]string, 0)\n\tfor i, v := range gg.Game.Images.Logos {\n\t\twg.Add(1)\n\n\t\tgo func(wg *sync.WaitGroup, path string, i int) {\n\t\t\tdefer wg.Done()\n\n\t\t\text := filepath.Ext(path)\n\t\t\tfilename, err := scraper.Download(gg.BaseImageURL+path, gameFilename, \"-logo-\"+strconv.Itoa(i)+ext, outputDirectory, resizeWidth)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[err] While downloading \", gg.BaseImageURL+path, \":\", err.Error())\n\t\t\t} else {\n\t\t\t\tlogos = append(logos, outputDirectory+filename)\n\t\t\t}\n\t\t}(&wg, v.Logo, i)\n\t}\n\n\t// look for a front cover\n\tfront := gg.havingFront(gg.Game.Images.Boxarts)\n\tvar coverURL string\n\tvar cover string\n\tif front > -1 {\n\t\tcoverURL = gg.Game.Images.Boxarts[front].Boxart\n\t} else if len(gg.Game.Images.Boxarts) > 0 {\n\t\t// No front, take something\n\t\tcoverURL = gg.Game.Images.Boxarts[0].Boxart\n\t}\n\n\t// something to download for the cover\n\tif coverURL != \"\" {\n\t\twg.Add(1)\n\n\t\tgo func(wg *sync.WaitGroup) {\n\t\t\tdefer wg.Done()\n\n\t\t\text := filepath.Ext(coverURL)\n\t\t\tfilename, err := scraper.Download(gg.BaseImageURL+coverURL, gameFilename, \"-cover\"+ext, outputDirectory, resizeWidth)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[err] While downloading \", gg.BaseImageURL+coverURL, \":\", err.Error())\n\t\t\t} else {\n\t\t\t\tcover = outputDirectory + filename\n\t\t\t}\n\t\t}(&wg)\n\t}\n\n\twg.Wait()\n\n\treturn model.Gameinfo{\n\t\tFilepath: inputDirectory + gameFilename,\n\t\tTitle: g.GameTitle,\n\t\tPlatform: g.Platform,\n\t\tPublisher: g.Publisher,\n\t\tDeveloper: g.Developer,\n\t\tReleaseDate: g.ReleaseDate,\n\t\tScreenshotPaths: screenshots,\n\t\tLogoPaths: logos,\n\t\tFanartPaths: fanarts,\n\t\tCoverPath: cover,\n\t\tDescription: g.Overview,\n\t\tGenres: genre,\n\t\tRating: float32(rating),\n\t}\n}", "title": "" }, { "docid": "4a52327bd555389587c8e8ceb5c403de", "score": "0.4923187", "text": "func (g *Game) Name() string {\n\treturn g.manager.Delegate().Name()\n}", "title": "" }, { "docid": "b20fd3fb6c6be271a19b72c134b79c2e", "score": "0.4898724", "text": "func GetByName(name ModuleName) (module interface{}, exist bool) {\n\treturn _mc.GetByName(name)\n}", "title": "" }, { "docid": "8554fb0a5f0795c549de1380b0441a62", "score": "0.48911083", "text": "func GetProfileByName(name string) (r.GetProfile, error) {\n\tvar response r.GetProfile\n\n\tresp, err := http.Get(basePath + \"/rest/user?names=\" + url.QueryEscape(name))\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\tvar errorResponse r.ErrorResponse\n\t\terr = json.Unmarshal(body, &errorResponse)\n\t\tfmt.Println(\"Error on API response: \" + errorResponse.Message)\n\t\treturn response, errors.New(\"Error on API response: \" + errorResponse.Message)\n\t}\n\n\terr = json.Unmarshal(body, &response)\n\tif err != nil {\n\t\treturn response, errors.New(\"Error on json.Unmarshall: \" + err.Error())\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "cb6c56e67d3a9b22521c9a51cd1ad9e5", "score": "0.48821002", "text": "func (client *SCPoolServerStateInfoClient) GetByName(name string) (*models.SCPoolServerStateInfo, error) {\n\tvar obj *models.SCPoolServerStateInfo\n\terr := client.aviSession.GetObjectByName(\"scpoolserverstateinfo\", name, &obj)\n\treturn obj, err\n}", "title": "" }, { "docid": "2c9bf42e88250e6f83a0ac8391a9afa4", "score": "0.48743713", "text": "func GetCardByName(c *gin.Context) {\n\n\tname := c.Params.ByName(\"name\")\n\n\tvar ctx, cancel = context.WithTimeout(context.Background(), 100*time.Second)\n\tdefer cancel()\n\n\tvar card bson.M\n\n\tif err := cardCollection.FindOne(ctx, bson.M{\"name\": name}).Decode(&card); err != nil {\n\t\tc.JSON(http.StatusInternalServerError, gin.H{\"error\": err.Error()})\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tdefer cancel()\n\n\tfmt.Println(card)\n\n\tc.JSON(http.StatusOK, card)\n}", "title": "" }, { "docid": "3bcb1c676f70883ab960578e0d1e695f", "score": "0.4870009", "text": "func GetParamFromName(name string) (coinType *coinparam.Params, err error) {\n\t// create map for that O(1) access\n\tcoinMap := map[string]*coinparam.Params{\n\t\tcoinparam.BitcoinParams.Name: &coinparam.BitcoinParams,\n\t\tcoinparam.VertcoinParams.Name: &coinparam.VertcoinParams,\n\t\t// coinparam.LitecoinParams.Name: &coinparam.LitecoinParams,\n\t\tcoinparam.TestNet3Params.Name: &coinparam.TestNet3Params,\n\t\tcoinparam.VertcoinTestNetParams.Name: &coinparam.VertcoinTestNetParams,\n\t\tcoinparam.LiteCoinTestNet4Params.Name: &coinparam.LiteCoinTestNet4Params,\n\t\tcoinparam.RegressionNetParams.Name: &coinparam.RegressionNetParams,\n\t\tcoinparam.VertcoinRegTestParams.Name: &coinparam.VertcoinRegTestParams,\n\t\tcoinparam.LiteRegNetParams.Name: &coinparam.LiteRegNetParams,\n\t}\n\n\t// grab from map\n\tvar found bool\n\tif coinType, found = coinMap[name]; !found {\n\t\terr = fmt.Errorf(\"Coin not found when trying to get from name, maybe it's not supported yet\")\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "399c3b10fcc0087e811268dbc4767a7b", "score": "0.48573434", "text": "func (p *profileCache) ForName(name string) (models.DeviceProfile, bool) {\n\tp.mutex.Lock()\n\tdefer p.mutex.Unlock()\n\n\tprofile, ok := p.deviceProfileMap[name]\n\tif !ok {\n\t\treturn models.DeviceProfile{}, ok\n\t}\n\treturn *profile, ok\n}", "title": "" }, { "docid": "bb84a344f2bbcfee5ec3b00f08e82187", "score": "0.48472834", "text": "func (m *MockOrgStore) GetByName(v0 context.Context, v1 string) (*types.Org, error) {\n\tr0, r1 := m.GetByNameFunc.nextHook()(v0, v1)\n\tm.GetByNameFunc.appendCall(OrgStoreGetByNameFuncCall{v0, v1, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "fd3034c2b596f0a7f78696e76b28ab32", "score": "0.4838935", "text": "func (_Gold *GoldCaller) Name(opts *bind.CallOpts) (string, error) {\n\tvar out []interface{}\n\terr := _Gold.contract.Call(opts, &out, \"name\")\n\n\tif err != nil {\n\t\treturn *new(string), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(string)).(*string)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "ea97e90bb3a8d8079d5ea402f33df3a7", "score": "0.48225227", "text": "func (m *MockGitserverRepoStore) GetByName(v0 context.Context, v1 api.RepoName) (*types.GitserverRepo, error) {\n\tr0, r1 := m.GetByNameFunc.nextHook()(v0, v1)\n\tm.GetByNameFunc.appendCall(GitserverRepoStoreGetByNameFuncCall{v0, v1, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "3845ab8f7cc5b73aa60b09294d563bdd", "score": "0.4814862", "text": "func (self *Group) GetByName(name string) interface{}{\n return self.Object.Call(\"getByName\", name)\n}", "title": "" }, { "docid": "3d3e2ac0d77a2267f54b0557a8ec7649", "score": "0.48143908", "text": "func (s Systems) GetByName(name string) System {\n\tif ret, ok := s.main[name]; ok {\n\t\treturn ret\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "27f665fe9dc96abd7749fa3e37a34662", "score": "0.4807643", "text": "func NewGame(name string) (*Game, error) {\n\tu4, err := uuid.NewV4()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Printf(\"create game [%s:%s]\", name, u4.String())\n\treturn &Game{\n\t\tID: u4.String(),\n\t\tPlayers: make(map[string]Client),\n\t\tMaps: make(map[string]Map),\n\t\tName: name,\n\t}, nil\n}", "title": "" }, { "docid": "dab7b1f65e1ec86819093219a93601f5", "score": "0.48006272", "text": "func (A *Agent) GetByName(Substring string) (Module, error) {\n\n\tName := A.canonicalizeName(Substring)\n\tif Name == \"\" {\n\t\treturn nil, ErrNoModule\n\t}\n\n\tfor _, M := range A.Modules() {\n\t\tif M != nil && M.Name() == Name {\n\t\t\treturn M, nil\n\t\t}\n\t}\n\n\treturn nil, ErrNoModule\n}", "title": "" }, { "docid": "ce84b79e72c635b2a9fb8f5033c56067", "score": "0.4796008", "text": "func (c *Chat) GetUserByName(name string) (*User, error) {\n\tc.Lock()\n\tdefer c.Unlock()\n\tuser, ok := c.users[name]\n\tif !ok {\n\t\treturn nil, ErrNotFound\n\t}\n\treturn user, nil\n}", "title": "" }, { "docid": "7325aa861e1d652909cd46196b3e7023", "score": "0.47924525", "text": "func (gos *Gossiper) GetName() string {\n\treturn gos.name\n}", "title": "" }, { "docid": "e68fb0268b85a40c51ec8855ec9bd50c", "score": "0.47899163", "text": "func (v *Relayered) GetInstanceByName(ctx *lepton.Context, name string) (*lepton.CloudInstance, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "73a48584ff22c56efe75a9e7f52da9c2", "score": "0.47889808", "text": "func (p *Player) GetName() string {\n\treturn p.name\n}", "title": "" }, { "docid": "59550afe9fbd4397ed67da4eec3e6913", "score": "0.4788099", "text": "func GetInfo(name string) Info {\n\treturn Rules[name]\n}", "title": "" }, { "docid": "0e4ebb0b60b7919ca58bd277102b0b57", "score": "0.4786299", "text": "func GetShikigami(name string) (Shikigami, error) {\n\tname = strings.ToLower(name)\n\tif nick, ok := nicknames[name]; ok {\n\t\tname = nick\n\t}\n\n\tif shiki, ok := shikigamis[name]; ok {\n\t\treturn shiki, nil\n\t}\n\treturn Shikigami{}, fmt.Errorf(\"unknown shikigami %v\", name)\n}", "title": "" }, { "docid": "0421d5ba48e67aedc7f84b7543958dd1", "score": "0.47702664", "text": "func SaveGameName(port, save string) string {\n\tswitch Family(port) {\n\tcase Chocolate, Boom:\n\t\tif save != \"\" {\n\t\t\t//tmp := []rune(save)\n\t\t\t//save = string(tmp[len(tmp)-5 : len(tmp)-4])\n\t\t\tsave = strings.TrimSuffix(strings.TrimPrefix(save, \"doomsav\"), \".dsg\")\n\t\t\treturn save\n\t\t}\n\t\treturn save\n\tdefault:\n\t\treturn save\n\t}\n}", "title": "" }, { "docid": "8d6e70ab62d600a9df335ff299f139d8", "score": "0.47695836", "text": "func (r TeamResolver) Name(ctx context.Context) *string {\n\treturn &r.TeamName\n}", "title": "" }, { "docid": "7088b22f5dea034e3bffeb66a2fa632f", "score": "0.47685048", "text": "func (m *MockRepoStore) GetByName(v0 context.Context, v1 api.RepoName) (*types.Repo, error) {\n\tr0, r1 := m.GetByNameFunc.nextHook()(v0, v1)\n\tm.GetByNameFunc.appendCall(RepoStoreGetByNameFuncCall{v0, v1, r0, r1})\n\treturn r0, r1\n}", "title": "" }, { "docid": "8abd5691a7ecc5507c96371e6ec911e1", "score": "0.47646165", "text": "func (_TokenRegistry *TokenRegistryCaller) GetTokenByName(opts *bind.CallOpts, _name string) (common.Address, string, string, uint8, []byte, []byte, error) {\n\tvar (\n\t\tret0 = new(common.Address)\n\t\tret1 = new(string)\n\t\tret2 = new(string)\n\t\tret3 = new(uint8)\n\t\tret4 = new([]byte)\n\t\tret5 = new([]byte)\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}\n\terr := _TokenRegistry.contract.Call(opts, out, \"getTokenByName\", _name)\n\treturn *ret0, *ret1, *ret2, *ret3, *ret4, *ret5, err\n}", "title": "" }, { "docid": "275da3db6a059508f941995c5eac4b96", "score": "0.47631", "text": "func (f *fields) GetByName(name string) *fieldInfo {\n\treturn f.fields[name]\n}", "title": "" }, { "docid": "4a41be1f8b16e6ed1de274eed6f73d25", "score": "0.4746168", "text": "func GetDataForGameLink(Link string) (AllTeamData, string, string) {\n\tvar HomeTeam, VisitingTeam string\n\tvar StartingPercent, ThisPercent, GuessedSpread, ThisPercentAdjustment float64\n\tvar err error\n\tvar TeamData AllTeamData = NewAllTeamData()\n\tHaveTeamNames := false\n\turl := \"http://www.pro-football-reference.com\" + Link\n\tbody := CheckFileExists(\"NFL\"+strings.Replace(Link, \"/\", \"-\", -1), url)\n\tVisitingTeam, HomeTeam = GetTeamNames(string(body))\n\tData := FindAllBetween(body, \"var chartData = \", \"\\n\")\n\tif Data == nil {\n\t\tfmt.Println(\"We didn't find the data we need on the provided page so we can't return anything\")\n\t\treturn nil, \"\", \"\"\n\t}\n\tData[0] = strings.Replace(Data[0], \"var chartData = \", \"\", -1)\n\tData = strings.Split(Data[0][2:len(Data[0])-2], \"],[\")\n\tfor _, val := range Data {\n\t\tThisPlay := strings.Split(val, \",\")\n\t\tif !HaveTeamNames {\n\t\t\tStartingPercent, err = strconv.ParseFloat(ThisPlay[1], 64)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Println(\"Error: \", err)\n\t\t\t\treturn nil, \"\", \"\"\n\t\t\t}\n\t\t\tGuessedSpread = GetSpreadFromProFootballPage(body, VisitingTeam, HomeTeam)\n\t\t\tTeamData[HomeTeam] = NewTeamData()\n\t\t\tTeamData[HomeTeam][GAMESPLAYED] = 1.0\n\t\t\tTeamData[VisitingTeam] = NewTeamData()\n\t\t\tTeamData[VisitingTeam][GAMESPLAYED] = 1.0\n\t\t\tHaveTeamNames = true\n\t\t}\n\t\tThisPercent, err = strconv.ParseFloat(ThisPlay[1], 64)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"Error: \", err)\n\t\t\treturn nil, \"\", \"\"\n\t\t}\n\t\tThisPercentAdjustment = FindAdjustedStartingProbability(GuessedSpread, ThisPlay[2], ThisPercentAdjustment)\n\t\tTeamData[HomeTeam][WPADJUST] += ThisPercent - ThisPercentAdjustment\n\t\tTeamData[VisitingTeam][WPADJUST] += ThisPercentAdjustment - ThisPercent\n\t\tTeamData[HomeTeam][STRAIGHTWPADJUST] += ThisPercent - StartingPercent + 0.5\n\t\tTeamData[VisitingTeam][STRAIGHTWPADJUST] += StartingPercent - ThisPercent + 0.5\n\t}\n\tTeamData[HomeTeam][WPADJUST] /= float64(len(Data))\n\tTeamData[VisitingTeam][WPADJUST] /= float64(len(Data))\n\tTeamData[HomeTeam][STRAIGHTWPADJUST] /= float64(len(Data))\n\tTeamData[VisitingTeam][STRAIGHTWPADJUST] /= float64(len(Data))\n\tif ThisPercent == 1.0 {\n\t\tTeamData[HomeTeam][GAMESWON] += 1\n\t} else {\n\t\tTeamData[VisitingTeam][GAMESWON] += 1\n\t}\n\treturn TeamData, VisitingTeam, HomeTeam\n}", "title": "" }, { "docid": "5cdd6182c98d2a0d706844df94d6835f", "score": "0.47450665", "text": "func _cgoexp_ebd397278953_proxyholochain_AppPackageScenario_Name_Get(a unsafe.Pointer, n int32, ctxt uintptr) {\n\tfn := _cgoexpwrap_ebd397278953_proxyholochain_AppPackageScenario_Name_Get\n\t_cgo_runtime_cgocallback(**(**unsafe.Pointer)(unsafe.Pointer(&fn)), a, uintptr(n), ctxt);\n}", "title": "" }, { "docid": "2acca45fc1cb2980816f31a47379b15c", "score": "0.47374883", "text": "func (_TellorPlayground *TellorPlaygroundCaller) Name(opts *bind.CallOpts) (string, error) {\n\tvar out []interface{}\n\terr := _TellorPlayground.contract.Call(opts, &out, \"name\")\n\n\tif err != nil {\n\t\treturn *new(string), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(string)).(*string)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "57012b7387ea6128833223cde9b3fefc", "score": "0.47323823", "text": "func (prof *Profiles) ByName(name string) (*User, error) {\n\tbody, err := prof.inst.sendSimpleRequest(urlUserByName, name)\n\tif err == nil {\n\t\tresp := userResp{}\n\t\terr = json.Unmarshal(body, &resp)\n\t\tif err == nil {\n\t\t\tuser := &resp.User\n\t\t\tuser.inst = prof.inst\n\t\t\treturn user, err\n\t\t}\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "8083e4edde3d60c291ecb2adbe93b427", "score": "0.4729404", "text": "func (inst Instance) GetPortalFromName(name string) (Portal, error) {\n\tfor _, p := range inst.portals {\n\t\tif p.name == name {\n\t\t\treturn p, nil\n\t\t}\n\t}\n\n\treturn Portal{}, fmt.Errorf(\"No portal with that name\")\n}", "title": "" }, { "docid": "bfe14f9203ae8ee52bf39b36d0bf67fe", "score": "0.4728971", "text": "func (self *TraitAboutDialog) GetProgramName() (return__ string) {\n\tvar __cgo__return__ *C.gchar\n\t__cgo__return__ = C.gtk_about_dialog_get_program_name(self.CPointer)\n\treturn__ = C.GoString((*C.char)(unsafe.Pointer(__cgo__return__)))\n\treturn\n}", "title": "" }, { "docid": "1fce8e8cdf795d1125e21f1dbded0813", "score": "0.47253355", "text": "func (a *GamesApiService) GamesByGameNameExecute(r ApiGamesByGameNameRequest) (*GamesByGameID, *http.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = http.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tformFiles []formFile\n\t\tlocalVarReturnValue *GamesByGameID\n\t)\n\n\tlocalBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, \"GamesApiService.GamesByGameName\")\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}\n\t}\n\n\tlocalVarPath := localBasePath + \"/v1.1/Games/ByGameName\"\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\tif r.apikey == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"apikey is required and must be specified\")\n\t}\n\tif r.name == nil {\n\t\treturn localVarReturnValue, nil, reportError(\"name is required and must be specified\")\n\t}\n\n\tlocalVarQueryParams.Add(\"apikey\", parameterToString(*r.apikey, \"\"))\n\tlocalVarQueryParams.Add(\"name\", parameterToString(*r.name, \"\"))\n\tif r.fields != nil {\n\t\tlocalVarQueryParams.Add(\"fields\", parameterToString(*r.fields, \"\"))\n\t}\n\tif r.filterPlatform != nil {\n\t\tlocalVarQueryParams.Add(\"filter[platform]\", parameterToString(*r.filterPlatform, \"\"))\n\t}\n\tif r.include != nil {\n\t\tlocalVarQueryParams.Add(\"include\", parameterToString(*r.include, \"\"))\n\t}\n\tif r.page != nil {\n\t\tlocalVarQueryParams.Add(\"page\", parameterToString(*r.page, \"\"))\n\t}\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\treq, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)\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 := ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tlocalVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\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\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 := &GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}", "title": "" }, { "docid": "70459b7129717baafa8257a2afe21a9e", "score": "0.47167093", "text": "func (p *Player) genName() {\n\tswitch randItemFromSlice(map[int]float64{\n\t\tnormalName: countries[p.Nationality].normalName,\n\t\tdoubleBarrelName: countries[p.Nationality].doubleBarrel,\n\t\tmiddleName: countries[p.Nationality].middleName,\n\t\toneName: countries[p.Nationality].oneName,\n\t}) {\n\tcase normalName:\n\t\tp.FirstName, p.SecondName = countries[p.Nationality].firstNames[rand.Intn(len(countries[p.Nationality].firstNames))], countries[p.Nationality].secondNames[rand.Intn(len(countries[p.Nationality].secondNames))]\n\tcase doubleBarrelName:\n\t\tp.FirstName, p.SecondName = countries[p.Nationality].firstNames[rand.Intn(len(countries[p.Nationality].firstNames))], countries[p.Nationality].secondNames[rand.Intn(len(countries[p.Nationality].secondNames))]+\"-\"+countries[p.Nationality].secondNames[rand.Intn(len(countries[p.Nationality].secondNames))]\n\tcase middleName:\n\t\tp.FirstName, p.SecondName = countries[p.Nationality].firstNames[rand.Intn(len(countries[p.Nationality].firstNames))]+\" \"+countries[p.Nationality].firstNames[rand.Intn(len(countries[p.Nationality].firstNames))], countries[p.Nationality].secondNames[rand.Intn(len(countries[p.Nationality].secondNames))]\n\tcase oneName:\n\t\tp.FirstName, p.SecondName = \"\", countries[p.Nationality].firstNames[rand.Intn(len(countries[p.Nationality].firstNames))]\n\t}\n}", "title": "" }, { "docid": "705094d48be7950f4130db47e74a2276", "score": "0.46928543", "text": "func (s *SpriteSheet) GetFrameByName(name string) Rect {\n\treturn s.frames[name]\n}", "title": "" }, { "docid": "dcdc632807ea29f47e208a9575c3eef9", "score": "0.4691492", "text": "func (o GameServerConfigOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *GameServerConfig) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "4ce4f867360eb537ede0f26724cff502", "score": "0.4690347", "text": "func (o LookupMissionProfileResultOutput) Name() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v LookupMissionProfileResult) *string { return v.Name }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "6e8e7701db1975e643dd98aa50b6736f", "score": "0.46812546", "text": "func (r *registry) getByName(name string) (c Communicator, exists bool) {\n\tr.mtx.RLock()\n\tc, exists = r.byName[name]\n\tr.mtx.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "45592aba1aca9eec7d2537f8a5250d07", "score": "0.4677436", "text": "func (s *Storage) GetChampionByName(name string, forceUpdate bool) (riotclient.Champion, error) {\n\tchampions := s.GetChampions(forceUpdate)\n\n\tchampion := riotclient.Champion{}\n\tfound := false\n\tfor _, champion = range champions {\n\t\tif name == champion.Name {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif found {\n\t\treturn champion, nil\n\t}\n\n\treturn champion, fmt.Errorf(\"Champion with Name %s not found\", name)\n}", "title": "" }, { "docid": "0c61d252cad978e37210614945c68f52", "score": "0.46745268", "text": "func (meta *ApiResponse) GetUserByName(name string) *User {\n\tfor _, user := range meta.Users {\n\t\tif user.Name == name {\n\t\t\treturn &user\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c780bda0dfcb701d42d93810c024ac36", "score": "0.4673576", "text": "func (m *Manager) GetByName(ctx context.Context, name string) (*hub.Repository, error) {\n\t// Validate input\n\tif name == \"\" {\n\t\treturn nil, fmt.Errorf(\"%w: %s\", hub.ErrInvalidInput, \"name not provided\")\n\t}\n\n\t// Get repository from database\n\tvar r *hub.Repository\n\terr := m.dbQueryUnmarshal(ctx, &r, \"select get_repository_by_name($1::text)\", name)\n\treturn r, err\n}", "title": "" }, { "docid": "5ff2a91c6e84afe520bb16d6f8b21c02", "score": "0.46541318", "text": "func getMatchDetails(user MatchDetailsRequest) (MatchDetailsData, error) {\n\tapiKey := os.Getenv(\"apiKey\")\n\tvar response MatchDetailsData\n\terr := getJSON(\"https://na1.api.riotgames.com/lol/match/v4/matches/\"+user.MatchID+\"?api_key=\"+apiKey, &response)\n\tif err != nil {\n\t\tlog.Print(\"Error writing JSON to struct\")\n\t\tlog.Fatal(err)\n\t}\n\treturn response, err\n}", "title": "" }, { "docid": "13b58f40a2b1b3d3f276728517a63ed8", "score": "0.46369627", "text": "func getInfo(driverName string) (*CloudDriverInfo, error) {\n // ex) /cloud-info-spaces/drivers/AWS_driver01-V0.5/AWS [aws-test-driver-v0.5.so]\n\n\t\n\tkey := \"/cloud-info-spaces/drivers/\" + driverName\n\n\t// key is not the key of cb-store, so we have to use GetList()\n keyValueList, err := store.GetList(key, true)\n if err != nil {\n return nil, err\n }\n\n\tif len(keyValueList) < 1 {\n\t\treturn nil, fmt.Errorf(driverName + \": does not exist!\")\n\t}\n\n for _, kv := range keyValueList {\n\t\t// keyValueList should have ~/driverName/... or ~/driverName-01/..., \n\t\t// so we have to check the sameness of driverName.\n if utils.GetNodeValue(kv.Key, 3) == driverName {\n\t\t\tproviderName := utils.GetNodeValue(kv.Key, 4)\n\t\t\tdriverLibFileName := kv.Value\n\t\t\tdrvInfo := &CloudDriverInfo{driverName, providerName, driverLibFileName}\n\t\t\treturn drvInfo, nil\n }\n }\n\n return nil, fmt.Errorf(driverName + \": does not exist!\")\n}", "title": "" }, { "docid": "835711facd038be4cfac36d409a717f5", "score": "0.46362686", "text": "func (b *Backend) GetSummonerByName(name string) (*storage.Summoner, error) {\n\tquery := &bson.D{{Key: \"summonername\", Value: strings.ToLower(name)}}\n\treturn b.summonerQuery(query)\n}", "title": "" }, { "docid": "37a082709ea6038cc31de3e39fe5dc53", "score": "0.46314654", "text": "func NameFor(pid string, vid string) (string, error) {\n\tif len(boards) == 0 {\n\t\treturn \"\", errors.New(\"There are no cached board details, call LoadBoardInfoFrom first\")\n\t}\n\tfor k, v := range boards {\n\t\tif contains(v.pids, pid) && contains(v.vids, vid) {\n\t\t\treturn k, nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"There is no name that matches that pid/vid combination\")\n}", "title": "" }, { "docid": "3082243bb1684bb12fc4cb8a4ac768e7", "score": "0.463047", "text": "func (cgi CurrentGameInfo) GameIDStr() string {\n\treturn fmt.Sprintf(\"%d\", cgi.GameID)\n}", "title": "" }, { "docid": "b954366848f3c88af3196b35b9cbd13d", "score": "0.46299243", "text": "func (m *MockWrapLVM) GetVGNameByPVName(pvName string) (string, error) {\n\targs := m.Mock.Called(pvName)\n\n\treturn args.String(0), args.Error(1)\n}", "title": "" }, { "docid": "8a3f195faf7c5f7014755a3fb1121a88", "score": "0.46235004", "text": "func (r *RunnerConfig) getServerByName(ctx context.Context, client *scw.Client, name string) (*instance.Server, error) {\n\tlog.DebugF(\"looking up server object with name %q\", name)\n\n\tapi := instance.NewAPI(client)\n\n\tproject := r.Access.ProjectID\n\tif project != nil {\n\t\tproject = r.Access.OrgID\n\t}\n\tvar perPage uint32 = 100\n\trequest := instance.ListServersRequest{\n\t\tZone: scw.Zone(*r.Zone),\n\t\tPerPage: &perPage,\n\t\t// TODO: enable pagination\n\t\t//Page: nil,\n\t\tProject: project,\n\t\tName: &name,\n\t}\n\tif r.Tags != nil {\n\t\trequest.Tags = *r.Tags\n\t}\n\n\tresp, err := api.ListServers(&request, scw.WithContext(ctx))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.TotalCount == 0 {\n\t\tlog.WarningF(\"found 0 servers containing %q\", name)\n\t\treturn nil, nil\n\t}\n\n\tif resp.TotalCount == 1 {\n\t\tif resp.Servers[0].Name == name {\n\t\t\treturn resp.Servers[0], nil\n\t\t}\n\t\treturn nil, errors.New(fmt.Sprintf(\"failed exact matching server with name %q\", name))\n\t}\n\n\t// here we check for the exact name match as per Scaleway API:\n\t// \"server1\" will return \"server100\" and \"server1\"\n\tlog.Warning(\"matched multiple servers, attempting to find the right one\")\n\tfound := 0\n\tvar server *instance.Server\n\tfor _, s := range resp.Servers {\n\t\tif s.Name == name {\n\t\t\tif found > 1 {\n\t\t\t\treturn nil, errors.New(fmt.Sprintf(\"matched multiple servers with the name %q\", name))\n\t\t\t}\n\t\t\tserver = s\n\t\t}\n\t}\n\n\tlog.Debug(\"successfully matched one server by name\")\n\treturn server, nil\n}", "title": "" }, { "docid": "af1f5fab5f8a2a973b76a37696764606", "score": "0.46182764", "text": "func (_NXlottery *NXlotteryCallerSession) GetPlayerInfoByAddress(addr common.Address) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error) {\n\treturn _NXlottery.Contract.GetPlayerInfoByAddress(&_NXlottery.CallOpts, addr)\n}", "title": "" }, { "docid": "4dd8a3a11ff42567dd3ff234b331ade2", "score": "0.46135688", "text": "func (o *Hotspot) 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": "15bfd30d4d0c124c0b6049187d181311", "score": "0.4611577", "text": "func (i localInfo) GetName() string {\n\treturn i.Name\n}", "title": "" }, { "docid": "6dbc23b09927fa2ea2c7db4fcca3d543", "score": "0.461119", "text": "func getGoogleImage(gameName string, artStyleExtensions []string) (string, error) {\n\tif gameName == \"\" {\n\t\treturn \"\", nil\n\t}\n\n\t// Format is hardcoded to old banner format here, we're using google only for banners anyway.\n\turl := fmt.Sprintf(googleSearchFormat, 460, 215) + url.QueryEscape(gameName)\n\n\tclient := &http.Client{}\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// If we don't set an user agent, Google will block us because we are a\n\t// bot. If we set something like \"SteamGrid Image Search\" it'll work, but\n\t// Google will serve a simple HTML page without direct image links.\n\t// So we have to lie.\n\treq.Header.Set(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36\")\n\tresponse, err := client.Do(req)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tresponseBytes, err := ioutil.ReadAll(response.Body)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tresponse.Body.Close()\n\n\tfor _, googleSearchResultPattern := range googleSearchResultPatterns {\n\t\tpattern := regexp.MustCompile(googleSearchResultPattern)\n\t\tmatches := pattern.FindStringSubmatch(string(responseBytes))\n\n\t\tif len(matches) >= 1 {\n\t\t\treturn matches[1], nil\n\t\t}\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "460fcaaeaf2412385d4b2e1fb0bf75dd", "score": "0.46098855", "text": "func GetGameID() uint16 {\n\treturn gameid\n}", "title": "" }, { "docid": "2d0468720c2b97b2ae7d9e4a84cb5cee", "score": "0.46082726", "text": "func GetInfo(name string) adapter.Info {\n\tfor _, info := range Infos {\n\t\tif info.Name == name {\n\t\t\treturn info\n\t\t}\n\t}\n\tpanic(fmt.Errorf(\"requesting a missing descriptor %q\", name))\n}", "title": "" }, { "docid": "63dba41af11854efd5193bc197d7e67f", "score": "0.4605162", "text": "func (db *GameDB) GetGameByID(id int) (*Game, error) {\n\t// get the board, and current tiles\n\tquery := `\n\tSELECT id, board, tiles FROM games WHERE id = ?`\n\tstatement, err := db.db.Prepare(query)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trows, err := statement.Query(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar boardBytes []byte\n\tvar tileBytes []byte\n\n\tvar game Game\n\tfor rows.Next() {\n\t\trows.Scan(&game.id, &boardBytes, &tileBytes)\n\t}\n\terr = json.Unmarshal(boardBytes, &game.board)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgame.board.setCoordinates()\n\terr = json.Unmarshal(tileBytes, &game.Tiles)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Retrieves all relevent player information\n\t// name, score, tiles, next player\n\t// join tables linking user_id to player_states.player_id\n\tplayersQuery := `\n\t\tSELECT users.id, player_states.id, users.name, users.use_plaintext, player_states.score, player_states.tiles, player_states.next\n\t\tFROM users JOIN player_states ON users.id = player_states.player_id\n\t\tWHERE player_states.game_id = ?`\n\tstatement, err = db.db.Prepare(playersQuery)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trows, err = statement.Query(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar players []Player\n\tfor rows.Next() {\n\t\tvar player Player\n\t\tvar tileBytes []byte\n\n\t\trows.Scan(&player.id, &player.pStateID, &player.Name, &player.UsePlainText, &player.score, &tileBytes, &player.nextID)\n\t\terr = json.Unmarshal(tileBytes, &player.tiles)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tplayers = append(players, player)\n\t}\n\n\tgame.players = players\n\n\t// Load in dictionary from disk\n\tdict, err := LoadDictionary(dictPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgame.Dictionary = dict\n\n\t// Load turn data\n\tturnsQuery := `\n\tSELECT number, input, turns.score, next_player\n\tFROM turns JOIN player_states ON turns.gp_id = player_states.id\n\tWHERE player_states.game_id = ?`\n\tstatement, err = db.db.Prepare(turnsQuery)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trows, err = statement.Query(id)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar turns []Turn\n\tvar maxNum int\n\tvar nextID int64\n\tfor rows.Next() {\n\t\tvar turn Turn\n\t\tvar next int64\n\t\trows.Scan(&turn.number, &turn.input, &turn.score, &next)\n\t\tturns = append(turns, turn)\n\t\tif maxNum < turn.number {\n\t\t\tmaxNum = turn.number\n\t\t\tnextID = next\n\t\t}\n\t}\n\n\t// find current player and create a fill in turn for game state\n\tvar current Turn\n\t// if game was started but no moves made, set initial player\n\tif len(turns) == 0 {\n\t\tcurrent = Turn{\n\t\t\tnumber: maxNum + 1,\n\t\t\tplayer: players[0],\n\t\t}\n\t} else {\n\t\t// find and set desired player\n\t\tplayer := findPlayer(players, nextID)\n\t\tcurrent = Turn{\n\t\t\tnumber: maxNum + 1,\n\t\t\tplayer: *player,\n\t\t}\n\t}\n\n\tgame.Turns = turns\n\tgame.Turn = current\n\n\treturn &game, nil\n}", "title": "" }, { "docid": "d18f287e45da53035e375b10b1dbc6ea", "score": "0.46048486", "text": "func GetName() string {\n\tvar name string\n\tname = \"Dchuss\"\n\tfmt.Print(\"Write your name: \")\n\tfmt.Scanf(\"%s\", &name)\n\treturn name\n}", "title": "" }, { "docid": "fb09fc3477e8afb604022c83ee6a1581", "score": "0.45967662", "text": "func (m *ModuleContainer) GetByName(name ModuleName) (module interface{}, exist bool) {\n\tif name == \"\" || name == \"~\" || name == \"-\" {\n\t\tpanic(panicInvalidModuleName)\n\t}\n\n\tm.muByName.RLock()\n\tmodule, exist = m.provByName[name]\n\tm.muByName.RUnlock()\n\treturn\n}", "title": "" }, { "docid": "f023a17afa6758c812d8804fec1a2be3", "score": "0.45857105", "text": "func GetGameID() uint16 {\n\treturn game.GetGameID()\n}", "title": "" }, { "docid": "1511ae605238a65553415b6843081086", "score": "0.45844594", "text": "func getConformanceProfileForName(name ConformanceProfileName) (ConformanceProfile, error) {\n\tprofile, ok := conformanceProfileMap[name]\n\tif !ok {\n\t\treturn profile, fmt.Errorf(\"%s is not a valid conformance profile\", name)\n\t}\n\n\treturn profile, nil\n}", "title": "" }, { "docid": "f79129b763ad162ecad587685800f52b", "score": "0.45836818", "text": "func getServerIdByName(name string) (serverID int) {\n\tswitch name { // Source -> https://cadernis.fr/index.php?threads/aide-trouver-les-id-serveur-retro-dofus.2351/\n\tcase \"Eratz\":\n\t\tserverID = 601\n\tcase \"Henual\":\n\t\tserverID = 602\n\tcase \"Nabur\":\n\t\tserverID = 603\n\tcase \"Arty\":\n\t\tserverID = 604\n\tcase \"Algathe\":\n\t\tserverID = 605\n\tcase \"Hogmeiser\":\n\t\tserverID = 606\n\tcase \"Droupik\":\n\t\tserverID = 607\n\tcase \"Ayuto\":\n\t\tserverID = 608\n\tcase \"Bilby\":\n\t\tserverID = 609\n\tcase \"Clustus\":\n\t\tserverID = 610\n\tcase \"Issering\":\n\t\tserverID = 611\n\tcase \"Boune\":\n\t\tserverID = 612\n\tcase \"Debug\":\n\t\tserverID = 39\n\tdefault:\n\t\tserverID = 0\n\t}\n\treturn\n}", "title": "" }, { "docid": "de97944f4b4da0cc785feeb1f444deeb", "score": "0.4582707", "text": "func (_NXlottery *NXlotterySession) GetPlayerInfoByAddress(addr common.Address) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error) {\n\treturn _NXlottery.Contract.GetPlayerInfoByAddress(&_NXlottery.CallOpts, addr)\n}", "title": "" }, { "docid": "2f9171a3d7eeacc4fde2b1616f033b26", "score": "0.4580302", "text": "func GetByName(name string, driver drivers.Driver) *Machine {\n\treturn &Machine{\n\t\tname: name,\n\t\tdriver: driver,\n\t}\n}", "title": "" }, { "docid": "2f4f4e909c69fc7cc9c2eff479745abb", "score": "0.45796752", "text": "func (_Uniswapv2erc20 *Uniswapv2erc20Caller) Name(opts *bind.CallOpts) (string, error) {\n\tvar out []interface{}\n\terr := _Uniswapv2erc20.contract.Call(opts, &out, \"name\")\n\n\tif err != nil {\n\t\treturn *new(string), err\n\t}\n\n\tout0 := *abi.ConvertType(out[0], new(string)).(*string)\n\n\treturn out0, err\n\n}", "title": "" }, { "docid": "b10693b7fb9659994f1c2c355a005253", "score": "0.45730752", "text": "func (ctx CLIContext) GetFromName() string {\n\treturn ctx.FromName\n}", "title": "" }, { "docid": "dbc7495360b677e88777dcac1787543b", "score": "0.4571922", "text": "func GetName() string {\n\tvar name string\n\tname = \"sin nombre\"\n\n\tfmt.Println(\"Ingresa tu nombre\")\n\tfmt.Scanf(\"%s\", &name)\n\n\treturn name\n}", "title": "" }, { "docid": "56f7e7b09a9ac5d3af12183165bdff6c", "score": "0.4570332", "text": "func (_Main *MainCaller) GetInfoVoter(opts *bind.CallOpts, voter common.Address) (struct {\n\tName string\n\tLastname string\n\tEmail string\n}, error) {\n\tvar out []interface{}\n\terr := _Main.contract.Call(opts, &out, \"getInfoVoter\", voter)\n\n\toutstruct := new(struct {\n\t\tName string\n\t\tLastname string\n\t\tEmail string\n\t})\n\tif err != nil {\n\t\treturn *outstruct, err\n\t}\n\n\toutstruct.Name = *abi.ConvertType(out[0], new(string)).(*string)\n\toutstruct.Lastname = *abi.ConvertType(out[1], new(string)).(*string)\n\toutstruct.Email = *abi.ConvertType(out[2], new(string)).(*string)\n\n\treturn *outstruct, err\n\n}", "title": "" }, { "docid": "6bec749be72206c80608ad86cd6bba65", "score": "0.45702845", "text": "func (s *Server) GetResultsFromNames(ctx context.Context, names []string, in *GetResultsArgs) (NameResults, error) {\n\tsmnrs, err := s.API.GetSummoners(ctx, names)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to retrieve summoner PUUIDs\")\n\t}\n\n\tvar (\n\t\tnameResults NameResults = make(map[string][]Result)\n\t\tids []string\n\t)\n\n\tfor _, smnr := range smnrs {\n\t\tnameResults[smnr.Name] = nil\n\n\t\tids = append(ids, smnr.PUUID)\n\t}\n\n\tout, err := s.GetResults(ctx, ids, in)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, smnr := range smnrs {\n\t\tnameResults[smnr.Name] = out[smnr.PUUID]\n\t}\n\n\treturn nameResults, nil\n}", "title": "" }, { "docid": "a0e7afacd12f51ff64b3f9551c4275d3", "score": "0.45598504", "text": "func (ms *MySQLStore) GetByName(name string) (*Activity, error) {\r\n\treturn ms.getByProvidedType(Name, name)\r\n}", "title": "" }, { "docid": "111cd09bb9f0195ec60e95f33e3e7769", "score": "0.455614", "text": "func (o *EditorSpatialGizmoPlugin) GetName() gdnative.String {\n\t//log.Println(\"Calling EditorSpatialGizmoPlugin.GetName()\")\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(\"EditorSpatialGizmoPlugin\", \"get_name\")\n\n\t// Call the parent method.\n\t// String\n\tretPtr := gdnative.NewEmptyString()\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.NewStringFromPointer(retPtr)\n\treturn ret\n}", "title": "" }, { "docid": "0b96bb1f7e393764522c551987243c9a", "score": "0.45506364", "text": "func SplitMapName(name string) (int, int, error) {\n\tif len(name) == 4 && name[0] == 'E' && name[2] == 'M' {\n\t\t// ExMy\n\t\tepisode, err := strconv.Atoi(name[1:2])\n\t\tif err != nil {\n\t\t\treturn 0, 0, errors.Wrapf(ErrInvalidMapName, \"invalid episode index %s\", name[1:2])\n\t\t}\n\t\tmission, err := strconv.Atoi(name[3:4])\n\t\tif err != nil {\n\t\t\treturn 0, 0, errors.Wrapf(ErrInvalidMapName, \"invalid mission index %s\", name[3:4])\n\t\t}\n\t\treturn episode, mission, nil\n\t} else if len(name) == 5 && name[0:3] == \"MAP\" {\n\t\t// MAPzz\n\t\tmission, err := strconv.Atoi(name[3:5])\n\t\tif err != nil {\n\t\t\treturn 0, 0, errors.Wrapf(ErrInvalidMapName, \"invalid map index %s\", name[3:])\n\t\t}\n\t\treturn 0, mission, nil\n\t} else {\n\t\treturn 0, 0, errors.Wrapf(ErrInvalidMapName, \"unknown map name %s\", name)\n\t}\n}", "title": "" }, { "docid": "8823f81c3396a1dcabe746c660e2acf8", "score": "0.45485002", "text": "func GetTeamInfo(c *gin.Context) (int, interface{}) {\n\tteamID, ok := c.Get(\"teamID\")\n\tif !ok {\n\t\treturn utils.MakeErrJSON(500, 50001,\n\t\t\tlocales.I18n.T(c.GetString(\"lang\"), \"general.server_error\"),\n\t\t)\n\t}\n\n\tvar teamInfo db.Team\n\trank := 0\n\tvar teams []db.Team\n\n\tdb.MySQL.Model(&db.Team{}).Order(\"`score` DESC\").Find(&teams)\n\t// Get the team rank by its index.\n\tfor index, t := range teams {\n\t\tif teamID.(uint) == t.ID {\n\t\t\trank = index + 1\n\t\t\tteamInfo = t\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn utils.MakeSuccessJSON(gin.H{\n\t\t\"Name\": teamInfo.Name,\n\t\t\"Logo\": teamInfo.Logo,\n\t\t\"Score\": teamInfo.Score,\n\t\t\"Rank\": rank,\n\t\t\"Token\": teamInfo.SecretKey,\n\t})\n}", "title": "" }, { "docid": "b53760bba70c784056cfea4b4c7ac1cb", "score": "0.45455837", "text": "func (gi *GeoIP) GetNameV6(ip string) (name string, netmask int) {\n\tif gi.db == nil {\n\t\treturn\n\t}\n\n\tgi.mu.Lock()\n\tdefer gi.mu.Unlock()\n\n\tcip := C.CString(ip)\n\tdefer C.free(unsafe.Pointer(cip))\n\tcname := C.GeoIP_name_by_addr_v6(gi.db, cip)\n\n\tnetmask = int(C.GeoIP_last_netmask(gi.db))\n\n\tif cname != nil {\n\t\tname = C.GoString(cname)\n\t\tdefer C.free(unsafe.Pointer(cname))\n\t\treturn\n\t}\n\treturn\n}", "title": "" }, { "docid": "195493d60ed1542589ea286ae92922d3", "score": "0.45359227", "text": "func (_BasicProjectWallet *BasicProjectWalletCaller) Name(opts *bind.CallOpts) ([32]byte, error) {\n\tvar (\n\t\tret0 = new([32]byte)\n\t)\n\tout := ret0\n\terr := _BasicProjectWallet.contract.Call(opts, out, \"name\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "f079457216b177d99bfa5ac538e4890b", "score": "0.4525925", "text": "func (d *Database) GetGameByID(id string) (gameData *GameData, err error) {\n\tvar game []byte\n\terr = d.db.View(func(tx *bolt.Tx) error {\n\t\t// guaranteed to exist\n\t\ttwitchBucket := tx.Bucket(bt(\"twitch-channels\"))\n\t\t// not guaranteed\n\t\tif gameBucket := twitchBucket.Bucket(bt(\"game-data\")); gameBucket != nil {\n\t\t\tcopy(game, gameBucket.Get(bt(id)))\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif game == nil {\n\t\tgameData, err = API.GetGameByID(id)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tvar raw []byte\n\t\traw, err = json.Marshal(gameData)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\n\t\terr = d.db.Update(func(tx *bolt.Tx) error {\n\t\t\tb := tx.Bucket(bt(\"twitch-channels\"))\n\t\t\tu, err := b.CreateBucketIfNotExists(bt(\"game-data\"))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn u.Put(bt(id), raw)\n\t\t})\n\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(game, gameData)\n\treturn\n}", "title": "" }, { "docid": "45d1edd529ee9aa69ba1b2268f29bd52", "score": "0.45220408", "text": "func (rb *ResultBuilder) AddGameInfo(g *game.Game) *ResultBuilder {\n\tres := &tb.StickerResult{\n\t\tResultBase: tb.ResultBase{ID: \"gameinfo\"},\n\t}\n\n\tres.SetContent(&tb.InputTextMessageContent{\n\t\tText: g.GameInfo(),\n\t\tParseMode: tb.ModeMarkdown,\n\t})\n\n\trb.results = append(rb.results, res)\n\n\treturn rb\n}", "title": "" }, { "docid": "f62ac36e389d96b5fc2d9112ec3dab0a", "score": "0.45206615", "text": "func GetGameServerInfo(apiKey string) ([]GameServerKeyInfo, error) {\n\tgetServerInfo := NewSteamMethod(\"IGameServersService\", \"GetAccountList\", 1)\n\n\tdata := url.Values{}\n\tdata.Add(\"key\", apiKey)\n\n\tvar resp gameServerInfoResponse\n\terr := getServerInfo.Request(data, &resp)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn resp.Response.Servers, nil\n}", "title": "" } ]
25f4491656e14f59db37f6394c42c1da
EnterParam is called when production param is entered.
[ { "docid": "7c5f418d3ba3110b027dfed0ef6b22b9", "score": "0.81681013", "text": "func (s *BasePeopleCodeListener) EnterParam(ctx *ParamContext) {}", "title": "" } ]
[ { "docid": "e0430a5536bb0acd837e64125a2668f4", "score": "0.7758236", "text": "func (s *BaseScalaListener) EnterParam(ctx *ParamContext) {}", "title": "" }, { "docid": "e5dc4aa61a7dc4dcb86804a93ffcd874", "score": "0.7647229", "text": "func (s *BaseSqlBase4GoListener) EnterParameter(ctx *ParameterContext) {}", "title": "" }, { "docid": "946427d5a98aa7e3cc69af31ee442796", "score": "0.731352", "text": "func (s *BaseDiceListener) EnterParameter(ctx *ParameterContext) {}", "title": "" }, { "docid": "7245831646b00cad35ebbc9492e1f092", "score": "0.71538454", "text": "func (s *BaseScalaListener) EnterParamClause(ctx *ParamClauseContext) {}", "title": "" }, { "docid": "f7661707a27869bd8c07494de5d67f3d", "score": "0.699739", "text": "func (s *BaseScalaListener) EnterParams(ctx *ParamsContext) {}", "title": "" }, { "docid": "b9c89c41a16134c7ea7d98ffc03ddffc", "score": "0.67745304", "text": "func (s *BaseScalaListener) EnterParamType(ctx *ParamTypeContext) {}", "title": "" }, { "docid": "59e996d07ef036a8fccfaf838af0079d", "score": "0.6715369", "text": "func (s *BaseScalaListener) EnterParamClauses(ctx *ParamClausesContext) {}", "title": "" }, { "docid": "5f947c586aa9815020290f999802281c", "score": "0.66935766", "text": "func (s *BaseJavaParserListener) EnterFormalParameter(ctx *FormalParameterContext) {}", "title": "" }, { "docid": "40c7ef3cc6758e052ebd04a2bafe8f8e", "score": "0.6572687", "text": "func (s *BasePeopleCodeListener) EnterFormalParamList(ctx *FormalParamListContext) {}", "title": "" }, { "docid": "70533539d83e11873182d92a03f1fbac", "score": "0.65527713", "text": "func (s *BaseLarkParserListener) EnterRule_params(ctx *Rule_paramsContext) {}", "title": "" }, { "docid": "be35a49aec5b321663e6b015ac2499c0", "score": "0.65425444", "text": "func (s *BasetnsnamesParserListener) EnterAl_parameter(ctx *Al_parameterContext) {}", "title": "" }, { "docid": "14e6a611fc11e2a4341b6c61eabeb969", "score": "0.64445215", "text": "func (s *BaseJavaParserListener) EnterReceiverParameter(ctx *ReceiverParameterContext) {}", "title": "" }, { "docid": "db7e0c35a06ee0f67ff9b942508d5e98", "score": "0.64141405", "text": "func (s *BasetnsnamesParserListener) EnterSpx_parameter(ctx *Spx_parameterContext) {}", "title": "" }, { "docid": "933ea4e8c3e246805e763ca024db82e1", "score": "0.6382366", "text": "func (s *BaseCPP14ParserListener) EnterParameterDeclaration(ctx *ParameterDeclarationContext) {}", "title": "" }, { "docid": "c570b2821f8b6d824042e34a1df6345d", "score": "0.6377691", "text": "func (s *BasetnsnamesParserListener) EnterBa_parameter(ctx *Ba_parameterContext) {}", "title": "" }, { "docid": "1272d834674e2aab5b583f610b973614", "score": "0.634525", "text": "func (s *BasetnsnamesParserListener) EnterCd_parameter(ctx *Cd_parameterContext) {}", "title": "" }, { "docid": "53b8578c241b6faa4062ee4d53b17805", "score": "0.6329354", "text": "func (s *BasetnsnamesParserListener) EnterFo_parameter(ctx *Fo_parameterContext) {}", "title": "" }, { "docid": "7aff1980dadd956cba4b419122fc2468", "score": "0.62795264", "text": "func (s *BaseSqlBase4GoListener) EnterSqlParameterDeclaration(ctx *SqlParameterDeclarationContext) {}", "title": "" }, { "docid": "1c7b8a4bc706103a83da9671facde2f7", "score": "0.6273082", "text": "func (s *BasetnsnamesParserListener) EnterBeq_parameter(ctx *Beq_parameterContext) {}", "title": "" }, { "docid": "62844a76e6dacce9dc9e0b54a575744e", "score": "0.6154535", "text": "func (s *BasetnsnamesParserListener) EnterA_parameter(ctx *A_parameterContext) {}", "title": "" }, { "docid": "f6440b87268e9f748c6f26d14250fd1e", "score": "0.6146782", "text": "func (s *BasetnsnamesParserListener) EnterAl_params(ctx *Al_paramsContext) {}", "title": "" }, { "docid": "dcf14efa12968f84048780fc34e1ccb2", "score": "0.61426014", "text": "func (s *BaseDiceListener) EnterParameters(ctx *ParametersContext) {}", "title": "" }, { "docid": "d920db653c3cc31f5d845773ad031dc1", "score": "0.6138102", "text": "func (s *BaseCPP14ParserListener) EnterTemplateParameter(ctx *TemplateParameterContext) {}", "title": "" }, { "docid": "f60823a07a00db5d1f1f2f0db6710946", "score": "0.6084039", "text": "func (s *BaseLarkParserListener) EnterToken_params(ctx *Token_paramsContext) {}", "title": "" }, { "docid": "1dc788b3ce8a195932ca6a7962ae211f", "score": "0.60711217", "text": "func (s *Baseoncrpcv2Listener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "ddc55a27843f5e397db36d350330b40c", "score": "0.60615766", "text": "func (s *BaseScalaListener) EnterTypeParam(ctx *TypeParamContext) {}", "title": "" }, { "docid": "7d002f079b4c96c90320b72ef87369a5", "score": "0.6049", "text": "func (s *BasetnsnamesParserListener) EnterFo_params(ctx *Fo_paramsContext) {}", "title": "" }, { "docid": "e9840a34ad329ba5d665d634b0619f2e", "score": "0.60083437", "text": "func (s *BasePeopleCodeListener) ExitParam(ctx *ParamContext) {}", "title": "" }, { "docid": "113e16894246f9be10e472580da0615b", "score": "0.5969039", "text": "func (s *BaseScalaListener) EnterClassParam(ctx *ClassParamContext) {}", "title": "" }, { "docid": "8760ab74b7827365bd4d0d68577d7103", "score": "0.59550136", "text": "func (s *BaseAbacusListener) EnterVariable(ctx *VariableContext) {}", "title": "" }, { "docid": "b3bbeb4bd7fe1a6db787931e613109c7", "score": "0.5948577", "text": "func (s *BaseJavaParserListener) EnterFormalParameters(ctx *FormalParametersContext) {}", "title": "" }, { "docid": "9bddb9daaeab1f65400189dbc84c20fc", "score": "0.5935488", "text": "func (s *BaseSqlBase4GoListener) EnterPositionalArgument(ctx *PositionalArgumentContext) {}", "title": "" }, { "docid": "5da9a55b34ecbf6a660891364cbe61e4", "score": "0.5931338", "text": "func (s *BasemetamathListener) EnterProvablestmt(ctx *ProvablestmtContext) {}", "title": "" }, { "docid": "326d8be9f50604d7d0ffa6410a1a4ab2", "score": "0.5913401", "text": "func (s *BaseScalaListener) ExitParam(ctx *ParamContext) {}", "title": "" }, { "docid": "5133f644950cab3939e4a580b57a668a", "score": "0.5901354", "text": "func (s *BasetnsnamesParserListener) EnterIpc_parameter(ctx *Ipc_parameterContext) {}", "title": "" }, { "docid": "b11c6e01feacce4ff0eb914e3c394495", "score": "0.5895126", "text": "func (s *BasetnsnamesParserListener) EnterCd_params(ctx *Cd_paramsContext) {}", "title": "" }, { "docid": "d2a2d4af3bd198c579416a9c4a965ba2", "score": "0.58874255", "text": "func (s *BasemetamathListener) EnterVariable(ctx *VariableContext) {}", "title": "" }, { "docid": "0187388566ffe5f3139564b2d1aec1f3", "score": "0.58823234", "text": "func (s *BaseSqlBase4GoListener) EnterTypeParameter(ctx *TypeParameterContext) {}", "title": "" }, { "docid": "2dae7a7b1a260ec870d162b5dac9cd96", "score": "0.5881363", "text": "func (s *BasetnsnamesParserListener) EnterD_parameter(ctx *D_parameterContext) {}", "title": "" }, { "docid": "6de5343461fbe68f237d3ea52e99be90", "score": "0.5842184", "text": "func (s *BaseMsonListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "d0f9317aa7abd6200f37765c8de2b6f5", "score": "0.5837499", "text": "func (s *BasetnsnamesParserListener) EnterSpx_params(ctx *Spx_paramsContext) {}", "title": "" }, { "docid": "1f2d2e4246f362d67f78ffc5f081d8b0", "score": "0.5815777", "text": "func (s *BaseECLListener) EnterMinvalue(ctx *MinvalueContext) {}", "title": "" }, { "docid": "fbe9922687ac6f4c4166bbb7296394d2", "score": "0.57537913", "text": "func (s *BasetnsnamesParserListener) EnterA_params(ctx *A_paramsContext) {}", "title": "" }, { "docid": "2c0d2d0201bedc6d9c6cc04853fd3b7b", "score": "0.5747149", "text": "func (s *BaseScalaListener) EnterVariantTypeParam(ctx *VariantTypeParamContext) {}", "title": "" }, { "docid": "8feb3714942d4ded0d31d192a81d64f2", "score": "0.5745543", "text": "func (s *BaseScalaListener) EnterTypeParamClause(ctx *TypeParamClauseContext) {}", "title": "" }, { "docid": "925791cc105db36c7d5827acc8d1a5f1", "score": "0.57453793", "text": "func (s *BasetnsnamesParserListener) EnterDs_parameter(ctx *Ds_parameterContext) {}", "title": "" }, { "docid": "abefb2597e9e02c85729cb7e718c44a2", "score": "0.5731256", "text": "func (s *BasetnsnamesParserListener) EnterDl_parameter(ctx *Dl_parameterContext) {}", "title": "" }, { "docid": "6bd3e08b7cec582d1b50bf7c3e6dfc9b", "score": "0.570812", "text": "func (s *BaseCPP14ParserListener) EnterTypeParameter(ctx *TypeParameterContext) {}", "title": "" }, { "docid": "4aa8e9d68914b99f560e4dba84b6ed60", "score": "0.5703275", "text": "func (s *BasetnsnamesParserListener) EnterNmp_parameter(ctx *Nmp_parameterContext) {}", "title": "" }, { "docid": "1bf0cf67cb46aa290e6add0ae5b0550b", "score": "0.56956613", "text": "func (s *BasetnsnamesParserListener) EnterBeq_params(ctx *Beq_paramsContext) {}", "title": "" }, { "docid": "da1b2f2a9a6d6e257b2acf272b6dae58", "score": "0.5690691", "text": "func (s *BaseJavaParserListener) EnterFormalParameterList(ctx *FormalParameterListContext) {}", "title": "" }, { "docid": "c46b897daaf0574b69b2c5ccb93b942f", "score": "0.5688088", "text": "func (s *BaseSqlBase4GoListener) EnterProperty(ctx *PropertyContext) {}", "title": "" }, { "docid": "7df770897544b104179cec3018599cec", "score": "0.56872123", "text": "func (s *BasePeopleCodeListener) EnterProperty_(ctx *Property_Context) {}", "title": "" }, { "docid": "3a50b628958e58eeabfcd956e7f6ac6b", "score": "0.56853694", "text": "func (s *Baseoncrpcv2Listener) EnterProcedureDef(ctx *ProcedureDefContext) {}", "title": "" }, { "docid": "3fdfbe19c87449137a5ef4edbeb669d9", "score": "0.567915", "text": "func (s *BasemetamathListener) EnterVariablestmt(ctx *VariablestmtContext) {}", "title": "" }, { "docid": "f5b2c25a6fb5111d59162459984f66ae", "score": "0.56740415", "text": "func (s *BaseCPP14ParserListener) EnterParameterDeclarationClause(ctx *ParameterDeclarationClauseContext) {\n}", "title": "" }, { "docid": "a79128ae50c39b998d0b01b70d51b64d", "score": "0.56702423", "text": "func (s *BaseCPP14ParserListener) EnterParametersAndQualifiers(ctx *ParametersAndQualifiersContext) {}", "title": "" }, { "docid": "9c69b27429a7de6d2957dda6caf92ef8", "score": "0.56520915", "text": "func (s *BaseCQLParserListener) EnterPoint(ctx *PointContext) {}", "title": "" }, { "docid": "2e3a34a0c46eaa7fba2f05c63f4d9669", "score": "0.56439555", "text": "func (s *Baseoncrpcv2Listener) EnterProcFirstArg(ctx *ProcFirstArgContext) {}", "title": "" }, { "docid": "b832f190f867eae90f23e2ef8b5b8c01", "score": "0.5643051", "text": "func (s *BasetnsnamesParserListener) EnterBad_parameter(ctx *Bad_parameterContext) {}", "title": "" }, { "docid": "879d494805e2aa3681b680ad3224f697", "score": "0.5633833", "text": "func (s *BasetnsnamesParserListener) EnterD_params(ctx *D_paramsContext) {}", "title": "" }, { "docid": "99856a0474beb42838759c5e49c4fe86", "score": "0.56183743", "text": "func (s *BaseSqlBase4GoListener) EnterNamedArgument(ctx *NamedArgumentContext) {}", "title": "" }, { "docid": "1510673d204306afdf98fb9aa0549b34", "score": "0.5598443", "text": "func (s *BaseJavaParserListener) EnterParExpression(ctx *ParExpressionContext) {}", "title": "" }, { "docid": "1912ea28ee822f74f6beff7c75dbd416", "score": "0.5595388", "text": "func (s *BaseJavaParserListener) EnterLambdaParameters(ctx *LambdaParametersContext) {}", "title": "" }, { "docid": "85f2d1a10efe106d9e7a9be8c1489458", "score": "0.556073", "text": "func (s *BaseflowmaticListener) EnterOp(ctx *OpContext) {}", "title": "" }, { "docid": "3c6967a21e9286e951c58c45df993603", "score": "0.55370075", "text": "func (s *BaseExprListener) EnterArguments(ctx *ArgumentsContext) {}", "title": "" }, { "docid": "0fd07874eeaffd38d2d974a025fb1b53", "score": "0.5521179", "text": "func (s *BasetnsnamesParserListener) EnterBad_params(ctx *Bad_paramsContext) {}", "title": "" }, { "docid": "8a91c9a1cba09fe4251086920e2e5a87", "score": "0.5516016", "text": "func (pc *ParamMarkerInPrepareChecker) Enter(in ast.Node) (out ast.Node, skipChildren bool) {\n\tswitch v := in.(type) {\n\tcase *driver.ParamMarkerExpr:\n\t\tpc.InPrepareStmt = !v.InExecute\n\t\treturn v, true\n\t}\n\treturn in, false\n}", "title": "" }, { "docid": "a40bc5716e44c4d36f31c09773b1e91a", "score": "0.54995495", "text": "func (s *BaseScalaListener) EnterFunTypeParamClause(ctx *FunTypeParamClauseContext) {}", "title": "" }, { "docid": "bd3c1f91d3f7b9b19cca321e61252d94", "score": "0.54941654", "text": "func (s *BaseLarkParserListener) EnterPriority(ctx *PriorityContext) {}", "title": "" }, { "docid": "c67e36ca22ae58ef93d33a9125d1fa4d", "score": "0.5493525", "text": "func (s *BaseJavaParserListener) EnterTypeParameter(ctx *TypeParameterContext) {}", "title": "" }, { "docid": "3fca11f8f7014efdd603bfa111e90b40", "score": "0.5492364", "text": "func (s *BaseSparqlListener) EnterVarOrTerm(ctx *VarOrTermContext) {}", "title": "" }, { "docid": "8abd7e73c7620268e607313d8f86ae5e", "score": "0.54766095", "text": "func (s *BaseSqlBase4GoListener) ExitParameter(ctx *ParameterContext) {}", "title": "" }, { "docid": "7076abfe98da5312a60abc6464b81672", "score": "0.5473977", "text": "func (s *BaseLarkParserListener) EnterValue(ctx *ValueContext) {}", "title": "" }, { "docid": "3acbe3176cf7023ad42d4dd4d5883591", "score": "0.5456024", "text": "func (s *BasetnsnamesParserListener) EnterNmp_params(ctx *Nmp_paramsContext) {}", "title": "" }, { "docid": "013fc5300a4f52b5216ea8ab31f1e677", "score": "0.5451024", "text": "func (s *BasePddlListener) EnterProblem(ctx *ProblemContext) {}", "title": "" }, { "docid": "82b8d96e3e3786ba2301e2261bd9acda", "score": "0.544217", "text": "func (s *BaseECLListener) EnterSp(ctx *SpContext) {}", "title": "" }, { "docid": "d4ef25791f23cd52996c0c535c862c75", "score": "0.54396784", "text": "func (c *Context) ValidParam(defRule *zvalid.Engine, key string, name ...string) *zvalid.Engine {\n\treturn valid(defRule, c.GetParam(key), key, name...)\n}", "title": "" }, { "docid": "bd72d0a415637f996863bfc1a74f95d3", "score": "0.5426133", "text": "func (s *BaseSparqlListener) EnterArgList(ctx *ArgListContext) {}", "title": "" }, { "docid": "4d774ecc5e396f78eb5a12326bae6230", "score": "0.5417484", "text": "func (s *Baseoncrpcv2Listener) EnterProcReturn(ctx *ProcReturnContext) {}", "title": "" }, { "docid": "06eba69b8f1a1241a7a0bde1fcd7a2d9", "score": "0.54115117", "text": "func (s *BaseSparqlListener) EnterConstraint(ctx *ConstraintContext) {}", "title": "" }, { "docid": "65b8aefadba053e34d6893483b67d58f", "score": "0.54080236", "text": "func (s *BasetnsnamesParserListener) EnterTcp_parameter(ctx *Tcp_parameterContext) {}", "title": "" }, { "docid": "a975fcb6fe8d383110c9f10c05d6e2d4", "score": "0.53993833", "text": "func (s *BaseSparqlListener) EnterFunctionCall(ctx *FunctionCallContext) {}", "title": "" }, { "docid": "5b9968cefc9cbd457cf78ce36d2b3261", "score": "0.5393159", "text": "func (s *BasetnsnamesParserListener) EnterIpc_params(ctx *Ipc_paramsContext) {}", "title": "" }, { "docid": "d85ee880f103d8c12046c19b63699328", "score": "0.53628206", "text": "func (s *BaseJavaParserListener) EnterLastFormalParameter(ctx *LastFormalParameterContext) {}", "title": "" }, { "docid": "f92faa415941c626372ce76d30a7103f", "score": "0.53526866", "text": "func (s *BaseECLListener) EnterNumericvalue(ctx *NumericvalueContext) {}", "title": "" }, { "docid": "f01687f149625c01345d3f3c0600a066", "score": "0.5350744", "text": "func (s *BaseCPP14ParserListener) EnterParameterDeclarationList(ctx *ParameterDeclarationListContext) {\n}", "title": "" }, { "docid": "f1bdf37c1dad22898ab640c01182b8d3", "score": "0.53479654", "text": "func (s *BasePddlListener) EnterInit_(ctx *Init_Context) {}", "title": "" }, { "docid": "3cf65dd0b479a184acc27d73a3cfcf89", "score": "0.5346833", "text": "func (s *BaseScalaListener) EnterArgs(ctx *ArgsContext) {}", "title": "" }, { "docid": "306fe21883e7f0be0edf8ff2657743f7", "score": "0.53284305", "text": "func (s *BaseSqlBase4GoListener) EnterPrepare(ctx *PrepareContext) {}", "title": "" }, { "docid": "f7f29489ba2ae26dddb5f3e714aba100", "score": "0.5320358", "text": "func (s *BaseScalaListener) EnterClassParamClause(ctx *ClassParamClauseContext) {}", "title": "" }, { "docid": "59ed7d205746c513ff2aa5dae43ea6d9", "score": "0.53150153", "text": "func (s *BaseDiceListener) ExitParameter(ctx *ParameterContext) {}", "title": "" }, { "docid": "663eaaf23ef0ae7d0342512086ea764e", "score": "0.531461", "text": "func (s *BasePddlListener) EnterMetricSpec(ctx *MetricSpecContext) {}", "title": "" }, { "docid": "6aac9dbe5cd07edcc4755e544fe58581", "score": "0.53086084", "text": "func (s *BasePeopleCodeListener) EnterConstant(ctx *ConstantContext) {}", "title": "" }, { "docid": "b6060e95f02e67c131916cc21afc4737", "score": "0.52972734", "text": "func (s *Baseoncrpcv2Listener) EnterConstant(ctx *ConstantContext) {}", "title": "" }, { "docid": "462af44ae38f22276d7ca1db978ce6b5", "score": "0.5296188", "text": "func (s *BaseScalaListener) ExitParamClause(ctx *ParamClauseContext) {}", "title": "" }, { "docid": "bf2bf104f65dce5536127c7dd9de1872", "score": "0.5287944", "text": "func (s *BaseExprListener) EnterStart(ctx *StartContext) {}", "title": "" }, { "docid": "dcbda7c4c32fde918ae881878bd9cc5f", "score": "0.527847", "text": "func (b *PipelineBuilder) Param(name string, description string) {\n\tb.Pipeline.Spec.Params = append(b.Pipeline.Spec.Params, v1beta1.ParamSpec{\n\t\tName: name,\n\t\tDescription: description,\n\t})\n}", "title": "" }, { "docid": "e615788c990523a4f2a8a9592cf46b23", "score": "0.52746683", "text": "func (s *BaseECLListener) EnterDecimalvalue(ctx *DecimalvalueContext) {}", "title": "" }, { "docid": "17718d64384041c899e84b23a5ccd563", "score": "0.5267286", "text": "func (s *BaseJavaParserListener) EnterResource(ctx *ResourceContext) {}", "title": "" } ]
7b654bac839780f2901b6b5555c903b3
Start method starts the run loop for the worker, listening for a quit channel in case we need to stop it
[ { "docid": "9e6e14a58c9f256bbaffda9f37e1696d", "score": "0.68376094", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// register the current worker into the worker queue.\n\t\t\tw.WorkerPool <- w.JobChannel\n\t\t\t//fmt.Printf(\"[%s]get a work ,process task~~![%s] \\n\",w.Name, len(w.JobChannel))\n\n\t\t\tselect {\n\n\t\t\tcase job := <- w.JobChannel:\n\t\t\t\t// we have received a work request. need process work task!\n\t\t\t\t//fmt.Printf(\"[%s]->we have received a work request. need process work task! task lenght! [%d] !\\n\",w.Name, len(w.WorkerPool))\n\n\t\t\t\tjob.Payload.Process()\n\n\t\t\t\t//time.Sleep(time.Duration(rand.Int31n(1000)) * time.Millisecond)\n\n\n\t\t\tcase <-w.quit:\n\t\t\t\t// we have received a signal to stop\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" } ]
[ { "docid": "4b9515ecea17a741f1fb9513628f760d", "score": "0.72781914", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\tw.workerPool <- w.jobChannel\n\n\t\t\tselect {\n\t\t\tcase job := <-w.jobChannel:\n\t\t\t\tjob.Run()\n\t\t\tcase <-w.quit:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "2e5351772c29e157c07c3407300a8d16", "score": "0.72082394", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// Add ourselves into the worker queue.\n\t\t\tw.WorkerQueue <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\t// Receive a work request.\n\t\t\t\tfmt.Printf(\"worker%d: Filename: %s\\n\", w.ID, work.FileName)\n\t\t\t\tprocessFilename(work.FileName)\n\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// We have been asked to stop.\n\t\t\t\tfmt.Printf(\"worker%d stopping\\n\", w.ID)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "8fd5b998bcd31382d5d9180bddab042e", "score": "0.72057176", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\tWorkerPool.workerChan <- w\n\t\t\tselect {\n\t\t\tcase jobID := <-w.RepJobs:\n\t\t\t\tlog.Debugf(\"worker: %d, will handle job: %d\", w.ID, jobID)\n\t\t\t\tw.handleRepJob(jobID)\n\t\t\tcase q := <-w.quit:\n\t\t\t\tif q {\n\t\t\t\t\tlog.Debugf(\"worker: %d, will stop.\", w.ID)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "d9edf0c5ac93840eb35d84b5c9e42c5a", "score": "0.71798587", "text": "func (w *Worker) Start(d *Dispatcher) {\n\tvar wg sync.WaitGroup\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase work := <-w.WorkChannel:\n\t\t\t\tif work != nil {\n\t\t\t\t\tlog.Printf(\"Worker: Received Work %v\\n\", work)\n\t\t\t\t\twg.Add(1)\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\tdefer wg.Done()\n\t\t\t\t\t\td.WorkHandler.Handle(work)\n\t\t\t\t\t}()\n\t\t\t\t\twg.Wait()\n\t\t\t\t}\n\t\t\tcase <-w.QuitChan:\n\t\t\t\tlog.Println(\"Worker: Received Quit Signal\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "f3e3ea64992d88f13ec15f80e3821cca", "score": "0.71422756", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// Add ourselves into the worker queue.\n\t\t\tw.WorkerQueue <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\tPublishLog(&work.LogToSave)\n\t\t\t\t// Receive a work request.\n\t\t\t\t//work.LogToSave.Save()\n\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// We have been asked to stop.\n\t\t\t\tutils.LogMessage(\"worker \"+strconv.Itoa(w.ID)+\" stopping\\n\", utils.DebugLogType)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "d52dd99729ee80efa0586003a96fbd1a", "score": "0.7077506", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// register the current worker into the worker queue.\n\t\t\tw.WorkerPool <- w.JobChannel\n\n\t\t\tselect {\n\t\t\tcase job := <-w.JobChannel:\n\n\t\t\t\t// we have received a work request.\n\t\t\t\tlog.Println(job.payload.HealthCheck())\n\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// we have received a signal to stop\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "b9077d7b48c9c2501eda51e862424d2d", "score": "0.70340025", "text": "func (w *Worker) Start() {\n\truntime.SetFinalizer(w, finalizer)\n\treceivedQuitSignal := false\n\n\tgo func() {\n\t\tfor {\n\t\t\tif receivedQuitSignal == false {\n\t\t\t\t// Add ourselves into the worker queue if not going to stop\n\t\t\t\tw.WorkerQueue <- w.Work\n\t\t\t}\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\t// Receive a work request\n\t\t\t\tlog.SetPrefix(\"[Worker \" + strconv.Itoa(w.ID) + \"] \")\n\t\t\t\tlog.Printf(\"Received work request\")\n\n\t\t\t\tw.Handler(w, work)\n\n\t\t\t\tif receivedQuitSignal != false {\n\t\t\t\t\tlog.SetPrefix(\"[Worker \" + strconv.Itoa(w.ID) + \"] \")\n\t\t\t\t\tlog.Printf(\"Terminating\\n\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// Flag the worker to stop after next request\n\t\t\t\t// This is in order to remove the worker itself from WorkerQueue\n\t\t\t\tlog.SetPrefix(\"[Worker \" + strconv.Itoa(w.ID) + \"] \")\n\t\t\t\tlog.Printf(\"Going to stop after processing another work request\\n\")\n\t\t\t\treceivedQuitSignal = true\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "35161bf64df4142f36fb3dd2e683447a", "score": "0.7018499", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// register the current worker into the worker queue.\n\t\t\tw.WorkerPool <- w.JobChannel\n\n\t\t\tselect {\n\t\t\tcase job := <-w.JobChannel:\n\t\t\t\t// we have received a work request.\n\t\t\t\tif err := job.Do(); err != nil {\n\t\t\t\t\tlog.Printf(\"Error job.Do() : %v\\n\", err.Error())\n\t\t\t\t}\n\n\t\t\tcase <-w.quit:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "48981d2097919b4ec7ac0a52eda5cf20", "score": "0.7008509", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// Add ourselves into the worker queue.\n\t\t\tw.WorkerQueue <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\t// Receive a work request.\n\t\t\t\tvar ris Response\n\t\t\t\tris.RequestId = work.RequestId\n\t\t\t\tris.Result, ris.Correct, ris.NSV = generateTrainset(work.TsToAnalyze, w.TsData, w.Output)\n\t\t\t\twork.Response <- ris\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// We have been asked to stop.\n\t\t\t\tlog.Printf(\"worker%d stopping\\n\", w.ID)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "7149eb7ce52d7989bc1c3d3218358ba1", "score": "0.6940069", "text": "func (w *worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// consume done ,then worker reenter workerPool\n\t\t\tw.workerPool <- w.taskChannel\n\t\t\tselect {\n\t\t\tcase task := <-w.taskChannel:\n\t\t\t\t// received a work request and consume it\n\t\t\t\tif err := task.Consume(); err != nil {\n\t\t\t\t\tlog.Printf(\"Task Consume fail: %v\", err.Error())\n\t\t\t\t}\n\t\t\tcase <-w.quit:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "3c1544384c0bb082abfedac9e8b084d8", "score": "0.69333583", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// register the current worker into the worker queue.\n\t\t\tw.WorkerPool <- w.JobChannel\n\n\t\t\tselect {\n\t\t\tcase job := <-w.JobChannel:\n\t\t\t\tjob.Process()\n\t\t\t\t// signal to the wait group that a queued job has been processed\n\t\t\t\t// so the main thread can continue\n\t\t\t\tw.wg.Done()\n\t\t\tcase <-w.quit:\n\t\t\t\t// we have received a signal to stop\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "6ca7cff533b68f7d1bd026cdb77d88c8", "score": "0.68687093", "text": "func (w *worker) start() {\n\tatomic.StoreInt32(&w.running, 1)\n\tw.startCh <- struct{}{}\n}", "title": "" }, { "docid": "b0d10409962be039ac714f7b87815d33", "score": "0.6853965", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// Add ourselves into the worker queue.\n\t\t\tw.Worker <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\tswitch work.(type) {\n\t\t\t\tcase *Install:\n\t\t\t\t\t// TODO: error handling\n\t\t\t\t\terr := install(work.(*Install))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t}\n\t\t\t\tcase *Uninstall:\n\t\t\t\t\t// TODO: error handling\n\t\t\t\t\terr := uninstall(work.(*Uninstall))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tfmt.Println(err)\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\tcase <-w.QuitChan:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "b4beaa118f43e6676033250fd8a85a12", "score": "0.6835944", "text": "func (w *Worker) Start() {\n\tif !atomic.CompareAndSwapInt32(&w.mode, workerModeIdle, workerModeStarting) {\n\t\tlog.Printf(\"[ERROR] failed to Worker.Start: invalid state\")\n\t\treturn\n\t}\n\tctx, cancel := context.WithCancel(context.Background())\n\tfor i := 0; i < w.n; i++ {\n\t\tw.wg.Add(1)\n\t\tgo w.run(ctx)\n\t}\n\tw.cancel = cancel\n\tatomic.StoreInt32(&w.mode, workerModeRunning)\n}", "title": "" }, { "docid": "d11822e3c4ab4e462366e5f03f8ea62a", "score": "0.6810372", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\tw.WorkerQueue <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\tw.Handler(work, w.ID)\n\t\t\t\tdeleteTask(work.Id)\n\n\t\t\tcase <-w.QuitChan:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "a00b8266c50d181ab8dbce0fd7067c3c", "score": "0.678182", "text": "func (el *ChanLoop) Start() error {\n\tgo el.once.Do(func() {\n\t\t// allocate whole OS thread, so nothing can get scheduled over eventloop\n\t\truntime.LockOSThread()\n\t\tfor ev := range el.events {\n\t\t\tev.Handle()\n\t\t}\n\t})\n\treturn nil\n}", "title": "" }, { "docid": "0f28f6fb972fa51be2ca6d2bf612810f", "score": "0.6719604", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\tw.WorkerChannel <- w.JobChannel\n\t\t\tselect {\n\t\t\tcase job := <-w.JobChannel:\n\t\t\t\t// do work\n\t\t\t\tc, err := comic.GetComic(job.ComicID, w.ID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"Error trying to get comic: [%d] due to: %v\", job.ComicID, err)\n\t\t\t\t}\n\t\t\t\tfmt.Println(\"Comic:\", c)\n\t\t\tcase <-w.End:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "98dd4ca5c8bf25f02a964a6d431e06c0", "score": "0.66739166", "text": "func (w *worker) start() {\n\tgo func() {\n\t\tfor {\n\t\t\tw.workerPool <- w.JobChannel\n\n\t\t\tjob := <-w.JobChannel\n\t\t\thandler, err := w.CommandHandler.GetHandler(job)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif !job.IsValid() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif err = handler.Handle(job); err != nil {\n\t\t\t\tglog.Error(err)\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "99bd9e1ca3e08714eee46c927a1d2f64", "score": "0.66694254", "text": "func (e *Executor) Start() { go e.loop() }", "title": "" }, { "docid": "0f7b8a50d0a15531f7e3b988a5949d52", "score": "0.66428906", "text": "func (w *Worker) Start() {\n\tfor i := 1; i < w.config.WorkersCount; i++ {\n\t\tw.waitGroup.Add(1)\n\t\tgo w.startSender()\n\t}\n\tw.waitGroup.Add(1)\n\tgo w.startConsumer()\n\tw.waitGroup.Add(1)\n\tgo w.startCleanuper()\n}", "title": "" }, { "docid": "d40852465e3a1ece295dfe322bdec3f4", "score": "0.66202545", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tw.wIsDone.Add(1)\n\t\tfor {\n\t\t\tw.wReadyChan <- w.wAssignedTask // check the Task queue in\n\t\t\tselect {\n\t\t\tcase Task := <-w.wAssignedTask: // see if anything has been assigned to the queue\n\t\t\t\tTask.Run()\n\t\t\tcase <-w.wQuit:\n\t\t\t\tw.wIsDone.Done()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "f30196e213e48d8ba9868e89f8dec32c", "score": "0.658349", "text": "func (w Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// 将当前JobChannel注册到全局队列池WorkerPool\n\t\t\tw.WorkerPool <- w.JobChannel\n\n\t\t\tselect {\n\t\t\tcase job := <-w.JobChannel:\n\t\t\t\t// we have received a work request.\n\t\t\t\tif err := job.Payload.UploadToS3(); err != nil {\n\t\t\t\t\tlog.Errorf(\"Error uploading to S3: %s\", err.Error())\n\t\t\t\t}\n\n\t\t\tcase <-w.quit:\n\t\t\t\t// we have received a signal to stop\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "606d6415492718d4fa920abacdaba1a7", "score": "0.65743464", "text": "func (w *Worker) Start(lg *logrus.Logger) {\n\tlg.Infof(\"starting worker %v \\n\", w.ID)\n\tgo func() {\n\t\tappFS := afero.NewOsFs()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase jid := <-w.WorkQueue:\n\t\t\t\t// Receive a work request.\n\t\t\t\tlg.WithFields(logrus.Fields{\n\t\t\t\t\t\"WID\": w.ID,\n\t\t\t\t\t\"JID\": jid.JobID,\n\t\t\t\t}).Debug(\"received work request\")\n\t\t\t\twork, err := w.js.GetJobByID(jid.JobID)\n\t\t\t\tlg.WithFields(logrus.Fields{\n\t\t\t\t\t\"WID\": w.ID,\n\t\t\t\t\t\"JID\": jid.JobID,\n\t\t\t\t\t\"job\": work,\n\t\t\t\t}).Debug(\"got job\")\n\t\t\t\tif err != nil {\n\t\t\t\t\tlg.WithFields(logrus.Fields{\n\t\t\t\t\t\t\"error\": err,\n\t\t\t\t\t\t\"JID\": jid.JobID,\n\t\t\t\t\t\t\"job\": work,\n\t\t\t\t\t}).Error(\"error getting job, aborting...\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif work.Status == \"CANCELLED\" {\n\t\t\t\t\tlg.WithFields(logrus.Fields{\n\t\t\t\t\t\t\"WID\": w.ID,\n\t\t\t\t\t\t\"JID\": jid.JobID,\n\t\t\t\t\t}).Debug(\"job detected as cancelled\")\n\t\t\t\t\tw.UpdateQueue <- &JobUpdate{\n\t\t\t\t\t\tJob: work,\n\t\t\t\t\t\tmsg: \"cancelled job\",\n\t\t\t\t\t\terr: err,\n\t\t\t\t\t\tShouldUpdate: false,\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\trs := runner.RSettings{\n\t\t\t\t\tRpath: work.Rscript.RPath,\n\t\t\t\t\tEnvVars: work.Rscript.Renv,\n\t\t\t\t}\n\t\t\t\tes := runner.ExecSettings{\n\t\t\t\t\tWorkDir: work.Rscript.WorkDir,\n\t\t\t\t\tRfile: work.Rscript.RscriptPath,\n\t\t\t\t}\n\t\t\t\twork.Status = \"RUNNING\"\n\t\t\t\twork.RunDetails.StartTime = time.Now().UTC()\n\t\t\t\tlg.WithFields(logrus.Fields{\n\t\t\t\t\t\"WID\": w.ID,\n\t\t\t\t\t\"JID\": jid.JobID,\n\t\t\t\t\t\"job\": work,\n\t\t\t\t}).Debug(\"starting Rscript\")\n\t\t\t\tw.UpdateQueue <- &JobUpdate{\n\t\t\t\t\tJob: work,\n\t\t\t\t\tmsg: \"starting job\",\n\t\t\t\t\tShouldUpdate: true,\n\t\t\t\t}\n\t\t\t\tresult, err, exitCode := runner.RunRscript(appFS, rs, es, lg)\n\t\t\t\twork.RunDetails.EndTime = time.Now().UTC()\n\t\t\t\tif err != nil {\n\t\t\t\t\twork.RunDetails.Error = err.Error()\n\t\t\t\t}\n\t\t\t\tlg.WithFields(logrus.Fields{\n\t\t\t\t\t\"WID\": w.ID,\n\t\t\t\t\t\"JID\": work.ID,\n\t\t\t\t\t\"Duration\": work.RunDetails.EndTime.Sub(work.RunDetails.StartTime),\n\t\t\t\t}).Debug(\"completed job\")\n\t\t\t\twork.Result.Output = result\n\t\t\t\twork.Result.ExitCode = int32(exitCode)\n\t\t\t\tif exitCode == 0 {\n\t\t\t\t\twork.Status = \"COMPLETED\"\n\t\t\t\t} else {\n\t\t\t\t\twork.Status = \"ERROR\"\n\t\t\t\t}\n\t\t\t\tw.UpdateQueue <- &JobUpdate{\n\t\t\t\t\tJob: work,\n\t\t\t\t\tmsg: \"completed job\",\n\t\t\t\t\terr: err,\n\t\t\t\t\tShouldUpdate: true,\n\t\t\t\t}\n\n\t\t\tcase <-w.Quit:\n\t\t\t\t// We have been asked to stop.\n\t\t\t\tlg.Printf(\"worker%d stopping\\n\", w.ID)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "593f154216b1b1b7dc19b3bceca9f66d", "score": "0.6492757", "text": "func (w Worker) Start() {\n\tfor w.JobChannel != nil {\n\t\t// register the current worker into the worker queue.\n\t\tw.Ready()\n\n\t\tselect {\n\t\tcase job, ok := <-w.JobChannel:\n\t\t\t// we have received a work request.\n\t\t\tif ok {\n\t\t\t\tstart := time.Now()\n\n\t\t\t\tw.Processor.Handle(job)\n\n\t\t\t\tduration := time.Since(start)\n\t\t\t\tjobsDurationHistogram.WithLabelValues(reflect.TypeOf(job).String()).Observe(duration.Seconds())\n\t\t\t}\n\n\t\tcase <-w.quit:\n\t\t\t// we have received a signal to stop\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "dad3d9983e1508e25e41faf269dadf85", "score": "0.6473649", "text": "func (qw *QueueWorker) Start() {\n\tqw.latch.Starting()\n\tif qw.maxWork > 0 {\n\t\tqw.work = make(chan interface{}, qw.maxWork)\n\t} else {\n\t\tqw.work = make(chan interface{})\n\t}\n\n\tgo func() {\n\t\tqw.latch.Started()\n\t\tvar err error\n\t\tvar workItem interface{}\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase workItem = <-qw.work:\n\t\t\t\terr = qw.action(workItem)\n\t\t\t\tif err != nil && qw.errors != nil {\n\t\t\t\t\tqw.errors <- err\n\t\t\t\t}\n\t\t\tcase <-qw.latch.NotifyStopping():\n\t\t\t\tqw.latch.Stopped()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\t<-qw.latch.NotifyStarted()\n}", "title": "" }, { "docid": "69d93986a5e978ee1c17c570fe9d31b5", "score": "0.6471681", "text": "func (s *Server) Run() (chan *Message, error) {\n\ts.logger.Notice(\"Starting %v server...\", s.name)\n\ts.commsChan = make(chan *Message)\n\ts.killChan = make(chan bool)\n\tgo s.listenAndServe()\n\treturn s.commsChan, nil\n}", "title": "" }, { "docid": "07c4aed716f72f11a191d13bfc149c19", "score": "0.64170504", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// Add ourselves into the worker queue.\n\t\t\tw.WorkerQueue <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\t\t\t\t// Receive a work request.\n\t\t\t\tfmt.Printf(\"worker%d: Received work request %s\\n\", w.ID, work.URL)\n\n\t\t\t\tstatus, err := MakeRequest(work)\n\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"%s: %s\\n\", work.URL, err.Error())\n\t\t\t\t}\n\n\t\t\t\tfmt.Printf(\"worker%d: %s: %s\\n\", w.ID, status, work.URL)\n\n\t\t\t\t//fmt.Printf(\"Queue Len, Cap = %d, %d\\n\", len(w.WorkerQueue), cap(w.WorkerQueue))\n\t\t\t\tfmt.Println(\"removing from wait group\")\n\t\t\t\tBatchWaitGroup.Done()\n\t\t\t\ttime.Sleep(time.Duration(*PostRequestPause) * time.Second)\n\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// We have been asked to stop.\n\t\t\t\tfmt.Printf(\"worker%d stopping\\n\", w.ID)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "f742323b4b3d2630025d20c5732c89d5", "score": "0.63930506", "text": "func (w InvokehWorker) Start() {\n\tgo func() {\n\t\tfor {\n\t\t\t// Add ourselves into the worker queue.\n\t\t\tw.WorkerQueue <- w.Work\n\n\t\t\tselect {\n\t\t\tcase work := <-w.Work:\n\n\t\t\t\twhite := color.New(color.FgWhite)\n\t\t\t\tredBackground := white.Add(color.BgRed)\n\t\t\t\tredBackground.Println(\"********************************************************************************\")\n\n\t\t\t\tlogger.Log_PE(\"Worker ID: \"+strconv.Itoa(w.ID), logger.Debug, work.SessionID)\n\t\t\t\tlogger.Log_PE(\"Method: Invoke workflow\", logger.Debug, work.SessionID)\n\t\t\t\tlogger.Log_PE(\"AppCode : \"+work.AppCode, logger.Debug, work.SessionID)\n\t\t\t\tlogger.Log_PE(\"ProcessCode: \"+work.ProcessCode, logger.Debug, work.SessionID)\n\t\t\t\tlogger.Log_PE(\"SessionID: \"+work.SessionID, logger.Debug, work.SessionID)\n\t\t\t\t//logger.Log_PE(\"JSON string recieved : \"+work, work.SessionID)\n\t\t\t\tmakeExecutable := false\n\t\t\t\tresult := Components.InvokeWorkflow(work, makeExecutable)\n\t\t\t\twork.ResponseMessage <- result\n\n\t\t\tcase <-w.QuitChan:\n\t\t\t\t// We have been asked to stop.\n\t\t\t\tfmt.Printf(\"worker%d stopping\\n\", w.ID)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "13f70516531ecf317bd8349ca1de1fcc", "score": "0.6380085", "text": "func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {\n\tdefer runtime.HandleCrash()\n\tdefer c.workqueue.ShutDown()\n\n\tglog.Info(\"start network control loop\")\n\tglog.Info(\"waiting for informer caches to sync\")\n\tif ok := cache.WaitForCacheSync(stopCh, c.networksSynced); !ok {\n\t\treturn fmt.Errorf(\"failed to wait for caches to sync\")\n\t}\n\tglog.Info(\"start workers\")\n\tfor i := 0; i < threadiness; i++ {\n\t\tgo wait.Until(c.runWorker, time.Second, stopCh)\n\t}\n\tglog.Info(\"started workers\")\n\t<-stopCh\n\tglog.Info(\"shutting down workers\")\n\treturn nil\n}", "title": "" }, { "docid": "f43c651f40c5acee05d05dcb1b0d7a8d", "score": "0.63656884", "text": "func Start() {\n\tfor {\n\t\tselect {\n\t\tcase <-quit:\n\t\t\treturn\n\t\tdefault:\n\t\t\tsockets, _ := poller.Poll(-1)\n\t\t\tfor _, socket := range sockets {\n\t\t\t\tif bytes, err := socket.Socket.RecvMessageBytes(0); err != nil {\n\t\t\t\t\tfmt.Printf(\"Error receiving message from %s: %s\\n\", socket, err)\n\t\t\t\t} else {\n\t\t\t\t\tgo handle(connection.NewMessage(bytes))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b10317f469abc55dfdc94daa751482a4", "score": "0.6351958", "text": "func (c *Controller) RunWorker(stopCh <-chan struct{}) {\n\n\tgo c.waitForShutdown(stopCh)\n\n\tfor c.processNextWorkItem() {\n\t}\n}", "title": "" }, { "docid": "0c30e96bd8c7f76dd27c371a330e964d", "score": "0.6345436", "text": "func (s *serv) Start() {\n\ts.running = true\n\n\tsem := make(chan byte)\n\n\tgo func() {\n\t\t// Start listening\n\t\ts.listen()\n\t\tsem <- 0\n\t}()\n\n\tgo func() {\n\t\tfor {\n\t\t\tp := <-s.pks\n\t\t\t// Dispatch work\n\t\t\tswitch p.(type) {\n\t\t\tcase *network.MessagePacket:\n\t\t\t\t_ = p.(*network.MessagePacket)\n\t\t\tcase *network.ConnectionPacket:\n\t\t\t\t_ = p.(*network.ConnectionPacket)\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}()\n\n\t<-sem\n}", "title": "" }, { "docid": "9d0c9270d10fcc91ae93a59b21e7f268", "score": "0.63126254", "text": "func (d *DetectorController) Start() {\n\td.wg.Add(1)\n\tgo func() {\n\t\tdefer d.wg.Done()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-d.stopChan:\n\t\t\t\treturn\n\t\t\tcase <-d.clock.After(d.runInterval):\n\t\t\t}\n\n\t\t\tlogrus.Debugf(\"DetectorController: starting run loop\")\n\t\t\tif err := d.run(); err != nil {\n\t\t\t\tlogrus.WithError(err).Errorf(\"error running DetectorController\")\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "5ae518b5ab4f402311ab3e91fbbe2c0c", "score": "0.6304882", "text": "func (s *Sender) Start() {\n\tif s.running {\n\t\treturn\n\t}\n\n\tgo s.startSubmitLoop()\n\n\ts.running = true\n}", "title": "" }, { "docid": "736c675b852c3237f56357b6e5251607", "score": "0.6290286", "text": "func (w *Worker) Start() {\n\tgo func() {\n\t\tw.done.Add(1)\n\t\tfor {\n\t\t\tw.readyPool <- w.assignedJobQueue // check the job queue in\n\t\t\tselect {\n\t\t\tcase job := <-w.assignedJobQueue: // see if anything has been assigned to the queue\n\t\t\t\tjob.Process()\n\t\t\tcase <-w.quit:\n\t\t\t\tw.done.Done()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "ab0747a1ef4d6f0658aa106984da15c6", "score": "0.62271875", "text": "func (s *Sender) Start() {\n\tgo s.run()\n}", "title": "" }, { "docid": "27afcc24908ae473b1fe0991deef3179", "score": "0.62020385", "text": "func (a *Looper) Start(ctx context.Context, work func(ctx context.Context) error, period time.Duration, errHandler func(error) error) {\n\t// a.Env.Logger().Debugf(\"Looper starting\")\n\trun := time.After(0 * time.Millisecond) // start first run immediately\n\t// log := a.Env.Logger()\n\n\ta.Env.ScheduleDaemon(func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\t// log.Debugf(\"Looper exiting\")\n\t\t\t\treturn\n\t\t\tcase <-run:\n\t\t\t\t// log.Debugf(\"Looper work running\")\n\t\t\t\terr := work(ctx)\n\t\t\t\tif ctx.Err() != nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tvar nextRunIn time.Duration\n\t\t\t\tif err == nil {\n\t\t\t\t\ta.Backoff.Reset()\n\t\t\t\t\tnextRunIn = period\n\t\t\t\t} else {\n\t\t\t\t\tif errHandler(err) != nil {\n\t\t\t\t\t\t// log.Debugf(\"Looper quit on error\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tnextRunIn = a.Backoff.Duration()\n\t\t\t\t}\n\t\t\t\trun = time.After(nextRunIn)\n\t\t\t\t// log.Debugf(\"Looper work scheduled to run in %s\", nextRunIn)\n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "9a49b3b72fe46584efc5dad303416f34", "score": "0.62008756", "text": "func (runner *McRunner) Start() error {\n\tif runner.State != NotRunning {\n\t\treturn nil\n\t}\n\n\tif !runner.Installed() {\n\t\tfmt.Println(\"Installing server\")\n\t\terr := runner.Install()\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn err\n\t\t}\n\t}\n\tfmt.Println(\"Server installed\")\n\n\trunner.applySettings()\n\trunner.cmd = exec.Command(\"java\", \"-jar\", \"forge-universal.jar\", \"-Xms512M\", fmt.Sprintf(\"-Xmx%dM\", runner.Settings.MaxRAM), \"-XX:+UseG1GC\", \"-XX:+UseCompressedOops\", \"-XX:MaxGCPauseMillis=50\", \"-XX:UseSSE=4\", \"-XX:+UseNUMA\", \"nogui\")\n\trunner.cmd.Dir = McServerPath()\n\trunner.inPipe, _ = runner.cmd.StdinPipe()\n\trunner.outPipe, _ = runner.cmd.StdoutPipe()\n\tif runner.Settings.PassthroughStdErr {\n\t\trunner.cmd.Stderr = os.Stderr\n\t}\n\terr := runner.cmd.Start()\n\tif err != nil {\n\t\tfmt.Print(err)\n\t\treturn err\n\t}\n\trunner.State = Starting\n\trunner.startTime = time.Now()\n\n\tif runner.FirstStart {\n\t\trunner.FirstStart = false\n\n\t\t// Initialize McRunner members that aren't initialized yet.\n\t\trunner.killChannel = make(chan bool, 3)\n\t\trunner.tpsChannel = make(chan map[int]float32, 8)\n\t\trunner.playerChannel = make(chan int, 1)\n\n\t\tgo runner.keepAlive()\n\t\tgo runner.updateStatus()\n\t\tgo runner.processCommands()\n\t\tgo runner.processOutput()\n\t}\n\n\treturn err\n}", "title": "" }, { "docid": "d19cfebb5d3d21ccafc44131e1f02ba1", "score": "0.6198171", "text": "func (wp *WorkerPool) Start(){\n\tDebug(fmt.Sprintf(\"[%s] Starting pool with %d workers & que = %d\", wp.Name, len(wp.workerList), wp.buffSize))\n\n\t// start the worker channels\n\tfor i := 0; i < len(wp.workerList); i++ {\n\t\tgo wp.startWorker(wp.workerChan)\n\t}\n\n\t// send work to the channels\n\tgo func() {\n\t\tfor _, w := range wp.workerList {\n\t\t\twp.workerChan <- w\n\t\t}\n\t}()\n\n\tfor _, w := range wp.workerList {\n\t\t<- w.doneChan\n\t}\n\n\tDebug(fmt.Sprintf(\"[%s] workers working: %d\", wp.Name, len(wp.workerChan)))\n\tDebug(fmt.Sprintf(\"[%s] workers requested: %d\", wp.Name, len(wp.workerList)))\n}", "title": "" }, { "docid": "3eb0866b53803295f43aefb1e321d499", "score": "0.6187566", "text": "func (r *reaper) start() {\n\tgo r.runLoop()\n}", "title": "" }, { "docid": "732b68fda60ad57f4d7c15666a3cafc8", "score": "0.6180402", "text": "func (w *worker) start() {\n\tgo func() {\n\t\tfor {\n\t\t\tw.WorkerQueue <- w.Job\n\n\t\t\tselect {\n\t\t\tcase job := <-w.Job:\n\t\t\t\tlog.Printf(\"worker %d: %s\", w.ID, job.User.Login)\n\t\t\t\tjob.User.run()\n\t\t\tcase <-done:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "e0a1c0509ee8e2afe540598d176eed3f", "score": "0.6179131", "text": "func (n *Nozzle) Start() {\n\trx := n.s.Stream(context.Background(), n.buildBatchReq())\n\n\tgo n.timerProcessor()\n\tgo n.timerEmitter()\n\tgo n.envelopeReader(rx)\n\n\tn.log.Info(\"starting workers\", logger.Count(2*runtime.NumCPU()))\n\tfor i := 0; i < 2*runtime.NumCPU(); i++ {\n\t\tgo n.pointWriter()\n\t}\n\n\tgo n.pointBatcher()\n}", "title": "" }, { "docid": "52f14a4c5a3e3369a69bcf65f6c0e7d1", "score": "0.6144995", "text": "func (c *HBComp) Start() {\n\tc.runCount = 0\n\tc.worker.Start()\n}", "title": "" }, { "docid": "dab290e82dcb6d3827deb234a7dc01fb", "score": "0.61417836", "text": "func (sh *SignalHandler) Start() error {\n\tsh.lock.Lock()\n\tdefer sh.lock.Unlock()\n\n\tif sh.isRunning == false {\n\t\tsh.wg.Add(1)\n\t\tgo sh.signalHandlerLoop()\n\t\tsh.isRunning = true\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "fab5522a700e9a1bc4f8b0e8f945704d", "score": "0.6133832", "text": "func (m *Master) Start() int {\n\tgo m.input.run()\n\tfor _, workers := range m.workers {\n\t\tfor _, worker := range workers {\n\t\t\tgo worker.run()\n\t\t}\n\t}\n\tgo m.output.run()\n\treturn <-m.output.endChannel\n}", "title": "" }, { "docid": "443c43d44a489041eea5a07f4044ed66", "score": "0.6133508", "text": "func (self *app) Start() {\n\t// ctrl-c: listen removes binary package when application stopped.\n\tchannel := make(chan os.Signal, 2)\n\tsignal.Notify(channel, os.Interrupt, syscall.SIGTERM)\n\tgo func() {\n\t\t<-channel\n\t\t// remove the binary package on stop.\n\t\tos.Remove(self.binary)\n\t\tos.Exit(1)\n\t}()\n\n\t// start waiting the signal to start running.\n\tvar gorun = self.run()\n\tself.build()\n\tgorun <- true\n\n\twatcher := fs.NewWatcher(self.dir)\n\tlog.Infof(\"Start watching: %s\", self.dir)\n\twatcher.Add(watchList, func(filename string) {\n\t\trelpath, _ := filepath.Rel(self.dir, filename)\n\t\tlog.Infof(\"Changes on %s detected\", relpath)\n\t\tself.rerun(gorun)\n\t})\n\twatcher.Start()\n}", "title": "" }, { "docid": "ffd477c1cba7fec98c9c81a46d9c23f6", "score": "0.61313695", "text": "func (a *App) Start() {\n\tdone := make(chan struct{})\n\n\twg.Add(len(a.workers))\n\tfor _, w := range a.workers {\n\t\tgo a.startWorker(w, done)\n\t}\n\n\ta.wait(done)\n}", "title": "" }, { "docid": "e529c1205a2399b1e7da32a0f46278b5", "score": "0.61257386", "text": "func (dispatcher *Dispatcher) Start(stopChannel <-chan struct{}) error {\n\tctx, cancelContext := context.WithCancel(context.Background())\n\tdefer cancelContext()\n\n\tgo dispatcher.dispatch(ctx)\n\n\tfor {\n\t\t<-stopChannel // blocking wait until getting stop event on the stop channel\n\t\tcancelContext()\n\t\tdispatcher.log.Info(\"stopped dispatcher\")\n\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "a74cb9df6cd4b706472ed5d5eb446f33", "score": "0.61236626", "text": "func (c *controller) Run(threadiness int, stopCh <-chan struct{}) error {\n\tdefer runtime.HandleCrash()\n\n\tklog.Infoln(\"Starting Topology Controller.\")\n\tklog.Infoln(\"Waiting for informer caches to sync\")\n\n\tklog.Infof(\"Starting %v workers.\", threadiness)\n\n\tklog.Infoln(\"Started workers\")\n\t<-stopCh\n\tklog.Infoln(\"Shutting down workers\")\n\n\treturn nil\n}", "title": "" }, { "docid": "4b2b405470b11c0e9d31243bc393dd2c", "score": "0.6121523", "text": "func (w *Processor) start() {\n\tfor {\n\t\tselect {\n\t\tcase job, ok := <-w.jobQueue:\n\t\t\tif !ok {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tw.limiter <- empty{}\n\n\t\t\t// Spawn a worker goroutine.\n\t\t\tgo func() {\n\t\t\t\tif err := job.Run(); err != nil {\n\t\t\t\t\tw.jobErrorHandler(err)\n\t\t\t\t}\n\t\t\t\t<-w.limiter\n\t\t\t}()\n\t\tcase <-w.stop:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0dbc064d8de2015a955d87989c81a51b", "score": "0.6119319", "text": "func (m *Manager) Run(ctx context.Context) error {\n\t// start log broadcaster\n\t_ = utils.Pool.Submit(func() { m.logBroadcaster.run(ctx) })\n\n\t// initWorkloadStatus container\n\tif err := m.initWorkloadStatus(ctx); err != nil {\n\t\treturn err\n\t}\n\n\t// start status watcher\n\t_ = utils.Pool.Submit(func() { m.monitor(ctx) })\n\n\t// start health check\n\t_ = utils.Pool.Submit(func() { m.healthCheck(ctx) })\n\n\t// wait for signal\n\t<-ctx.Done()\n\tlog.WithFunc(\"Run\").Info(ctx, \"exiting\")\n\treturn nil\n}", "title": "" }, { "docid": "0053ce4f6c2c0872f580cebe577bbb83", "score": "0.610875", "text": "func (s *subscriber) Start() error {\n\n\t// Here we set the logger to our NoopNSQLogger to quiet down the default logs.\n\t// At Reverb we use a custom structured logging format so we'll take the\n\t// logging from here.\n\ts.cons.SetLogger(&NoopNSQLogger{}, gonsq.LogLevelError)\n\n\t// Injects our handler into the consumer. You'll define one handler\n\t// per consumer, but you can have as many concurrently running handlers\n\t// as specified by the second argument. If your MaxInFlight is less\n\t// than your number of concurrent handlers you'll starve your workers\n\t// as there will never be enough in flight messages for your worker pool\n\ts.cons.AddConcurrentHandlers(s.handler, s.concurrency)\n\n\t// Our consumer will discover where topics are located by our three\n\t// nsqlookupd instances The application will periodically poll\n\t// these nqslookupd instances to discover new nodes or drop unhealthy\n\t// producers.\n\tif err := s.cons.ConnectToNSQLookupds(s.nsqlookupds); err != nil {\n\t\treturn err\n\t}\n\n\t// Let's allow our queues to drain properly during shutdown.\n\t// We'll create a channel to listen for SIGINT (Ctrl+C) to signal\n\t// to our application to gracefully shutdown.\n\tshutdown := make(chan os.Signal, 2)\n\n\tfor {\n\t\tselect {\n\t\tcase <-s.cons.StopChan:\n\t\t\t// consumer disconnected. Time to quit.\n\t\tcase <-shutdown:\n\t\t\t// Synchronously drain the queue before falling out of main\n\t\t\ts.Stop()\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d4895812436674daac3eedfeca997c55", "score": "0.6108421", "text": "func (s *Server) Run() <-chan error {\n\tvar chErr chan error\n\tlog.Infoln(fmt.Sprintf(\"gRPC server has started at port %d\", s.port))\n\tgo func() {\n\t\tif err := s.server.Serve(s.listener); err != nil {\n\t\t\tchErr <- err\n\t\t}\n\t}()\n\treturn chErr\n}", "title": "" }, { "docid": "8ef7ee28a1ef73102c3e692eae13169f", "score": "0.60992056", "text": "func (w Worker) Start() {\n go func() {\n for {\n // register the current worker into the worker queue.\n w.WorkerPool <- w.JobChannel\n select {\n case job := <-w.JobChannel:\n // we have received a work request.\n if err, payLoad := job.JobProcessor(job.JobPayload); err == nil {\n if job.NextParallelJobs != nil {\n for _, nextJob := range job.NextParallelJobs {\n nextJob.JobPayload = payLoad // set the payload since it might have been modified\n JobQueue <- *nextJob\n }\n }\n } else {\n log.Println(\"err not nil: \", err.Error())\n SendFailureEmail(\"custom-sender@email.com\", job, err)\n }\n case <-w.quitChannel:\n // we have received a signal to stop\n return\n }\n }\n }()\n}", "title": "" }, { "docid": "cffc64a11fe5aeaa9cb77ccc2910d1cd", "score": "0.6098491", "text": "func (m *Mainloop) Start() {\n\tsigs := make([]os.Signal, len(m.Bindings))\n\tfor s, _ := range m.Bindings {\n\t\tsigs = append(sigs, s)\n\t}\n\tsignal.Notify(m.sigchan, sigs...)\n\tfor {\n\t\tselect {\n\t\tcase sig := <-m.sigchan:\n\t\t\tm.Bindings[sig]()\n\t\tcase _ = <-m.termchan:\n\t\t\tbreak\n\t\t}\n\t}\n\treturn\n}", "title": "" }, { "docid": "2c89c947c34ab0a5b8ef60428ebe0cd8", "score": "0.6096262", "text": "func (twrkr *twerk) startWorker() {\n\n\tgo func() {\n\t\ttwrkr.waitOnWorld()\n\t\ttwrkr.liveWorkersNum.Incr()\n\t\tdefer func() {\n\t\t\ttwrkr.waitOnWorld()\n\t\t\ttwrkr.liveWorkersNum.Decr()\n\t\t}()\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase job, _ := <-twrkr.jobListener:\n\t\t\t\ttwrkr.waitOnWorld()\n\t\t\t\ttwrkr.currentlyWorkingNum.Incr()\n\t\t\t\treturnValues := twrkr.callable.CallFunction(job.arguments)\n\t\t\t\tif len(returnValues) > 0 {\n\t\t\t\t\tgo func() {\n\t\t\t\t\t\tjob.returnTo <- returnValues\n\t\t\t\t\t\tclose(job.returnTo)\n\t\t\t\t\t}()\n\t\t\t\t}\n\t\t\t\ttwrkr.waitOnWorld()\n\t\t\t\ttwrkr.currentlyWorkingNum.Decr()\n\t\t\tcase <-twrkr.broadcastDie:\n\t\t\t\t// somebody requested that we die\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\n}", "title": "" }, { "docid": "122e9480a884cf194c838f1db71d3345", "score": "0.6094275", "text": "func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {\n\tdefer runtime.HandleCrash()\n\tdefer c.WorkQueue.ShutDown()\n\n\t// Start the informer factories to begin populating the informer caches\n\tlog.Info(\"Starting MXJob controller\")\n\n\t// Wait for the caches to be synced before starting workers\n\tlog.Info(\"Waiting for informer caches to sync\")\n\tif ok := cache.WaitForCacheSync(stopCh, c.MXJobSynced); !ok {\n\t\treturn fmt.Errorf(\"failed to wait for caches to sync\")\n\t}\n\n\tlog.Infof(\"Starting %v workers\", threadiness)\n\t// Launch workers to process MXJob resources\n\tfor i := 0; i < threadiness; i++ {\n\t\tgo wait.Until(c.runWorker, time.Second, stopCh)\n\t}\n\n\tlog.Info(\"Started workers\")\n\t<-stopCh\n\tlog.Info(\"Shutting down workers\")\n\n\treturn nil\n}", "title": "" }, { "docid": "3f6869d5ac200d1316014713bb3f8f80", "score": "0.60913616", "text": "func (loop *mainLoop) Run() {\n\tloop.running = true\n\n\tfor loop.running {\n\t\tselect {\n\t\t// Send a value over the channel in order to\n\t\t// signal that the loop started.\n\t\tcase loop.initialized <- 1:\n\n\t\t\t// A request to pause the loop is received.\n\t\tcase <-loop.PauseCh:\n\t\t\t// do something or simply send-back a value to\n\t\t\t// the pause channel.\n\t\t\tloop.PauseCh <- 0\n\n\t\t\t// A request to terminate the loop is received.\n\t\tcase <-loop.TerminateCh:\n\t\t\tloop.running = false\n\t\t\tloop.TerminateCh <- 0\n\n\t\t\t// Receive a tick from the ticker.\n\t\tcase <-loop.ticker.C:\n\t\t\t// Initiate the exit procedure.\n\t\t\tapplication.Exit()\n\n\t\t\t// Receive a duration string and create a proper\n\t\t\t// ticker from it.\n\t\tcase durationStr := <-loop.durationCh:\n\t\t\tduration, err := time.ParseDuration(durationStr)\n\t\t\tif err != nil {\n\t\t\t\tpanic(\"Error parsing a duration string.\")\n\t\t\t}\n\t\t\tloop.ticker = time.NewTicker(duration)\n\t\t\tapplication.Logf(\"A new duration received. Running for %s...\", durationStr)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c6eb86aaa3ba2f21673cd48275b0f45e", "score": "0.60898584", "text": "func (w *Worker) Start() {\n\n\tfor _, job := range w.Jobs {\n\t\tgo w.Run(job)\n\t}\n}", "title": "" }, { "docid": "2f728f1577eef3ee089ad144d2438bc7", "score": "0.6084225", "text": "func (hmr *receiver) Start(ctx context.Context, host component.Host) error {\n\thmr.done = make(chan struct{})\n\n\tgo func() {\n\t\thmr.initializeScrapers(ctx, host)\n\t\thmr.startScrapers()\n\t}()\n\n\treturn nil\n}", "title": "" }, { "docid": "4da8378f3ffe0f0adae1a80dbafcb280", "score": "0.60827136", "text": "func (c *Crawler) Start() {\n\tch := make(chan bool)\n\tc.startChan <- ch\n\n\t// Wait until it has started\n\t<- ch\n}", "title": "" }, { "docid": "742ca52dd773a8fa4a94073f75b3e46f", "score": "0.60794413", "text": "func (w Worker) Start() {\n go func() {\n for {\n // register the current worker into the worker queue.\n w.WorkerPool <- w.JobChannel\n \n select {\n case job := <-w.JobChannel:\n // we have received a work request.\n if err := job.Payload.UploadToS3(); err != nil {\n log.Errorf(\"Error uploading to S3: %s\", err.Error())\n }\n \n case <-w.quit:\n // we have received a signal to stop\n return\n }\n }\n }()\n}", "title": "" }, { "docid": "b698f23d3952510f9f9efc0a0699fb56", "score": "0.60712785", "text": "func (serv *Server) Start() {\n\tfmt.Printf(\"Starting to listen for events...\\n\")\n\t//Listen in the background\n\tgo serv.listen()\n}", "title": "" }, { "docid": "26dfedf619c9663f7218c4a9bf46f395", "score": "0.60677034", "text": "func (srv *Server) Start() {\n\tvar config *rest.Config\n\tvar err error\n\n\tif strings.ToUpper(srv.RunMode) == \"KUBE\" {\n\t\t// Create the Kubernetes in-cluster config\n\t\tconfig, err = rest.InClusterConfig()\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t} else {\n\t\t// use the current context in kubeconfig\n\t\tconfig, err = clientcmd.BuildConfigFromFlags(\"\", filepath.Join(util.HomeDir(), \".kube\", \"config\"))\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t}\n\n\t// Create the clientset\n\tclientset, err := kubernetes.NewForConfig(config)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\t// Create a watcher\n\twatcher, err := clientset.CoreV1().Services(\"\").Watch(metav1.ListOptions{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\t// Create a channel for the events to come in from the watcher\n\teventChannel := watcher.ResultChan()\n\n\t// Start an indefinite loop\n\tfor {\n\t\tevt := <-eventChannel\n\t\tsrv.handleEvent(evt)\n\t}\n}", "title": "" }, { "docid": "8cbbe0cf707324f3d059c2f13687f295", "score": "0.60675776", "text": "func (d *Dispatcher) Start() {\n\td.running = true\n\t// Start all workers\n\td.workerWG.Add(d.maxWorkers)\n\tfor i := 0; i < d.maxWorkers; i++ {\n\t\td.workers[i] = newWorker(d.workerPool, &d.jobWG, &d.workerWG)\n\t\td.workers[i].start()\n\t}\n\n\tgo d.dispatch()\n}", "title": "" }, { "docid": "ccf1105c0dded8a0b96678d8eefc6695", "score": "0.6062436", "text": "func (c *Client) Run() {\n\tlog.Printf(\"Starting client [%v]\\n\", c.network.NodeID())\n\n\tsig := make(chan os.Signal)\n\tsignal.Notify(sig, os.Interrupt)\n\n\tgo c.scanInputLoop()\n\tgo c.eventLoop()\n\n\t<-sig\n\tfmt.Fprintf(os.Stderr, \"\\n\")\n\tlog.Printf(\"Received interrupt, shutting down client [%v]\\n\", c.network.NodeID())\n}", "title": "" }, { "docid": "f27ab638072fb6df5a8440dfae34b013", "score": "0.6059086", "text": "func (h *Haminer) Start() (err error) {\n\tudpAddr := &net.UDPAddr{\n\t\tIP: net.ParseIP(h.cfg.ListenAddr),\n\t\tPort: h.cfg.ListenPort,\n\t}\n\n\th.udpConn, err = net.ListenUDP(\"udp\", udpAddr)\n\tif err != nil {\n\t\treturn\n\t}\n\n\th.isRunning = true\n\n\tgo h.consume()\n\tgo h.produce()\n\n\t<-h.chSignal\n\n\th.Stop()\n\n\treturn\n}", "title": "" }, { "docid": "b47527d50b7982699df89f5134b139c1", "score": "0.6048489", "text": "func (d *Dispatcher) Start() {\n\tfor _, w := range d.workers {\n\t\tw.start()\n\t}\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase v := <-d.queue:\n\t\t\t\t(<-d.pool).data <- v\n\n\t\t\tcase <-d.quit:\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "508f73442eb30e74b9eded5a90cd918b", "score": "0.60322994", "text": "func (w *Worker) Start() {\n\tfor i := 1; i <= w.workerCount; i++ {\n\t\tlog.Println(\"starting worker:\", i)\n\t\tgo w.startWorker()\n\t}\n\n\tgo w.startWriter()\n\tw.startReader()\n\n\t// Let the workers finish, then exit\n\tw.wg.Wait()\n\tclose(w.OutText)\n}", "title": "" }, { "docid": "57c4a2df02791a85551a2313204ef77c", "score": "0.6031161", "text": "func (w *worker) startWorker() {\n\tzap.L().Info(\"Starting InfluxDBworker\")\n\tfor {\n\t\tselect {\n\t\tcase event := <-w.events:\n\t\t\tw.processEvent(event)\n\t\tcase <-w.stop:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3ad6314c961b3b6f84fc7c449fe8720a", "score": "0.60295117", "text": "func (wp *WorkerPool) startWorker(jchan <- chan Worker) {\n\tfor {\n\t\tselect {\n\t\tcase w := <- jchan:\n\t\t\tw.work()\n\t\tcase <- wp.stopChan:\n\t\t\treturn\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3745096e39752f282109ac13b7dc78f1", "score": "0.6029464", "text": "func (p *Processor) Start() {\n\tp.setDefaults()\n\tdispatcher := p.dispatcher\n\tdispatcher.Run()\n\tstopChan := p.stopChan\n\nLOOP:\n\tfor {\n\t\tbuffer := p.byteArrayPool.Get()\n\t\trlen, remote, err := p.Conn.ReadFrom(buffer)\n\t\tif err != nil {\n\t\t\tif p.isCloseError(err) {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tpanic(err)\n\t\t}\n\t\t_, _ = rlen, remote\n\t\tdispatcher.SubmitJob(buffer)\n\t\tselect {\n\t\tcase <-stopChan:\n\t\t\tbreak LOOP\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tdispatcher.Stop()\n}", "title": "" }, { "docid": "ef10a96f965dcbd610876cf8c8eb4df4", "score": "0.60273784", "text": "func Run(stopCh <-chan os.Signal) error {\n\tglog.Info(\"Started controller\")\n\n\t<-stopCh\n\n\tglog.Info(\"Shutting down controller\")\n\n\treturn nil\n}", "title": "" }, { "docid": "95d2104dc77b454186ead3591191215c", "score": "0.6014189", "text": "func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {\n\tdefer runtime.HandleCrash()\n\tdefer c.workqueue.ShutDown()\n\n\t// Start the informer factories to begin populating the informer caches\n\tglog.Info(\"Starting virtualservices control loop\")\n\n\t// Wait for the caches to be synced before starting workers\n\tglog.Info(\"Waiting for informer caches to sync\")\n\tif ok := cache.WaitForCacheSync(stopCh, c.virtualservicesSynced); !ok {\n\t\treturn fmt.Errorf(\"failed to wait for caches to sync\")\n\t}\n\n\tglog.Info(\"Starting workers\")\n\t// Launch workers to process virtualservices resources\n\tfor i := 0; i < threadiness; i++ {\n\t\tgo wait.Until(c.runWorker, time.Second, stopCh)\n\t}\n\n\tglog.Info(\"Started workers\")\n\t<-stopCh\n\tglog.Info(\"Shutting down workers\")\n\n\treturn nil\n}", "title": "" }, { "docid": "107e025ad86fbacdf2876f2c8c1941db", "score": "0.600372", "text": "func (p Process) Start() {\n\n\tvar wg sync.WaitGroup\n\tgo func() {\n\t\tp.pollKEBForRuntimes()\n\t}()\n\n\tfor i := 0; i < p.WorkersPoolSize; i++ {\n\t\tj := i\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tp.execute(j)\n\t\t\tp.namedLogger().Debugf(\"######## Worker exits ########\")\n\t\t}()\n\t}\n\twg.Wait()\n}", "title": "" }, { "docid": "f85d6472d11e96df6a077d939cfb3c6c", "score": "0.59929967", "text": "func (r *serverOneDotOne) Run() {\n\tr.state = RstateRunning\n\n\t// event handling is a NOP in this model\n\trxcallback := func(ev EventInterface) int {\n\t\tassert(r == ev.GetTarget())\n\t\tlog(LogVV, \"proc-ed\", ev.String())\n\t\treturn 0\n\t}\n\n\tgo func() {\n\t\tfor r.state == RstateRunning {\n\t\t\tr.receiveEnqueue()\n\t\t\ttime.Sleep(time.Microsecond)\n\t\t\tr.processPendingEvents(rxcallback)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "0979b10e1cd06ad9f0b328c2a1e1e0b2", "score": "0.5984967", "text": "func (b *Broadcaster) Start() {\n\tfor {\n\t\tselect {\n\t\tcase msg := <-b.sendQueue:\n\t\t\tb.broadcast(msg)\n\t\tcase <-b.ctx.Done():\n\t\t\tbreak\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "7f9d4f1017549a3b503e7a369063bc72", "score": "0.5983921", "text": "func Run(wg *sync.WaitGroup, ctl chan bool) {\n\tbroker.ctl = ctl\n\tbroker.wg = wg\n\tbroker.listen()\n}", "title": "" }, { "docid": "c46b2323c749d48965d6ea097d814ab6", "score": "0.59825325", "text": "func (b *Broadcaster) Start() {\n\tb.running = true\n\tfor b.running {\n\t\tb.cond.L.Lock()\n\t\tb.cond.Wait()\n\t\tgo func() {\n\t\t\tfor _, f := range b.subscribers {\n\t\t\t\tgo f(b.message) // publishes the message\n\t\t\t}\n\t\t}()\n\t\tb.cond.L.Unlock()\n\t}\n}", "title": "" }, { "docid": "661a3c024e95f063e308f25ba94b42c5", "score": "0.5980349", "text": "func (m *Manager) Run() error {\n\tif m.running == false {\n\t\tif err := m.Start(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tgo func() {\n\t\t// Wait until we get shutdown signal\n\t\t<-m.signals\n\n\t\t// Stop the waiter\n\t\tm.wait.Done()\n\t}()\n\n\t// Make sure we wait until we get signals\n\tm.wait.Add(1)\n\tm.wait.Wait()\n\n\t// Stop all bots and return\n\tm.Stop()\n\treturn nil\n}", "title": "" }, { "docid": "682f0f03845d914485a0a71c31c85c9a", "score": "0.5977158", "text": "func (w Watcher) Run(stopCh <-chan struct{}) {\n\tfmt.Println(\"client/run:Running\")\n\tgo w.controller.Run(stopCh)\n}", "title": "" }, { "docid": "166a2b1242dee21677e6a4d1b846037f", "score": "0.59771186", "text": "func (m *Manager) Run() {\n\tgo func() {\n\t\tif err := m.Start(context.Background()); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n}", "title": "" }, { "docid": "7eb158ef178232de82bb2f0a1e67c889", "score": "0.5970953", "text": "func Run() {\n\tgo listen()\n}", "title": "" }, { "docid": "ecc7b5d7f32199f26466cd07cbf5f7d8", "score": "0.5959995", "text": "func (sc *SchedulerController) Run(workers int, stopCh <-chan struct{}) error {\n\tdefer runtime.HandleCrash()\n\tdefer sc.workqueue.ShutDown()\n\n\t// Start the informer factories to begin populating the informer caches\n\tklog.Info(\"Starting Scheduler control loop\")\n\n\t// Wait for the caches to be synced before starting workers\n\tklog.Info(\"Waiting for informer caches to sync\")\n\tif ok := cache.WaitForCacheSync(stopCh, sc.schedulerSynced); !ok {\n\t\treturn fmt.Errorf(\"failed to wait for caches to sync\")\n\t}\n\n\tklog.Infof(\"Starting %d workers\", workers)\n\tfor i := 0; i < workers; i++ {\n\t\tgo wait.Until(sc.runWorker, time.Second, stopCh)\n\t}\n\n\tklog.Info(\"Started workers\")\n\t<-stopCh\n\tklog.Info(\"Shutting down workers\")\n\n\treturn nil\n}", "title": "" }, { "docid": "758c29ff868def648a1c0ad2c2d71caa", "score": "0.595387", "text": "func (c *Controller) Run(stopCh <-chan struct{}) {\n\t// log and exit during crash\n\tdefer utilruntime.HandleCrash()\n\tdefer c.queue.ShutDown()\n\n\tc.logger.Info(\"Initiating controller\")\n\t// run the informer in the background to start watching pod resources\n\tgo c.informer.Run(stopCh)\n\n\t// perform initial synchronization to populate resources\n\t// wait for the cache to be synced before starting workers\n\tif !cache.WaitForCacheSync(stopCh, c.HasSynced) {\n\t\tutilruntime.HandleError(fmt.Errorf(\"Error syncing cache\"))\n\t\treturn\n\t}\n\tc.logger.Info(\"Cache sync completed successfully\")\n\n\t// run the runWorker method every second with a stop channel\n\twait.Until(c.runWorker, time.Second, stopCh)\n}", "title": "" }, { "docid": "4cb91b80fb8ebbc0d9eee3a0fb2fec62", "score": "0.59455085", "text": "func (kgw kgWorker) start(args ...interface{}) error {\n\tgo kgw.work()\n\treturn nil\n}", "title": "" }, { "docid": "e0acb2f9d51b8d77dce778cdb49939a4", "score": "0.5944278", "text": "func (pm *PipelineManager) Run(threadiness int, stopCh <-chan struct{}) error {\n\t// Start the informer factories to begin populating the informer caches\n\tlog.Info(\"[PipelineManager.Run] Starting...\")\n\n\t// Wait for the caches to be synced before starting workers\n\tlog.Info(\"[PipelineManager.Run] Waiting for informer caches to sync\")\n\n\tif ok := cache.WaitForCacheSync(stopCh, pm.deploymentSynced, pm.podSynced); !ok {\n\t\treturn fmt.Errorf(\"[PipelineManager.Run] failed to wait for caches to sync\")\n\t}\n\n\tlog.Info(\"[PipelineManager.Run] Starting workers\")\n\tgo func() {\n\t\t<-stopCh\n\t\tlog.Info(\"[PipelineManager] shutdown work queue\")\n\t\tpm.workqueue.ShutDown()\n\t}()\n\n\t// Launch two workers to process Pipeline resources\n\tfor i := 0; i < threadiness; i++ {\n\t\tgo wait.Until(pm.runWorker, time.Second, stopCh)\n\t}\n\n\tlog.Info(\"[PipelineManager.Run] Started workers\")\n\treturn nil\n}", "title": "" }, { "docid": "cd004d35f487671001ce49cb997e1e66", "score": "0.59410834", "text": "func (d *OrderedDaemon) Start() {\n\t// do not allow restarts\n\tif d.IsStopped() {\n\t\treturn\n\t}\n\n\td.lock.Lock()\n\tdefer d.lock.Unlock()\n\n\tif !d.IsRunning() {\n\t\td.running.Set()\n\t\tfor name, worker := range d.workers {\n\t\t\td.runBackgroundWorker(name, worker.handler)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "863f17a6dbee8dcd9551f88c0fc0d56b", "score": "0.59285426", "text": "func (c *controller) Run(stopCh <-chan struct{}) {\n\tglog.Info(\"Starting broker controller\")\n\tc.informer.Run(stopCh)\n}", "title": "" }, { "docid": "9f176ef33986eb376ab3234b9a750a2a", "score": "0.5927224", "text": "func Start(workerPoolSize int) {\n\tconsumer := Consumer{\n\t\tinputChan: make(chan int, workerPoolSize*10),\n\t\tjobsChan: make(chan int, workerPoolSize),\n\t}\n\n\t//generator := Generator{callbackFunc: consumer.callbackFunc}\n\tgenerator := FiniteGenerator{consumer}\n\tctx, cancelFunc := context.WithCancel(context.Background())\n\twg := &sync.WaitGroup{}\n\n\tgenerator.start()\n\t//go generator.start(ctx)\n\tgo consumer.startConsumer(ctx, cancelFunc)\n\n\twg.Add(workerPoolSize)\n\tfor i := 0; i < workerPoolSize; i++ {\n\t\tgo consumer.workerFunc(wg, i)\n\t}\n\n\t// chan for terminated signals\n\ttermChan := make(chan os.Signal, 1)\n\tsignal.Notify(termChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGTSTP)\n\n\tselect {\n\tcase <-termChan:\n\t\t// if terminated\n\t\tfmt.Println(\"=========Shutdown Signal=========\")\n\t\tcancelFunc()\n\tcase <-ctx.Done():\n\t\t// if normally exited\n\t\tfmt.Println(\"=========Normally exited==========\")\n\t}\n\t// Wait until all workers gracefully interupted\n\twg.Wait()\n\n\tfmt.Println(\"==============All workers done!========\")\n}", "title": "" }, { "docid": "65d48f9f0f7923ebb7d4a3ca79cc22b9", "score": "0.5923091", "text": "func (s *Server) Run() {\n\tsignals := make(chan os.Signal, 1)\n\tsignal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)\n\n\tfor {\n\t\tif len(s.CellBuckets.AllCells()) == 0 {\n\t\t\tfmt.Println(\"no cells remaining, stopping...\")\n\t\t\ts.closeConnections()\n\t\t\treturn\n\t\t}\n\n\t\tif len(signals) != 0 {\n\t\t\tfmt.Println(\"Received Signal:\", <-signals)\n\t\t\tbreak\n\t\t}\n\t\ts.step()\n\t}\n\ts.shutdown()\n}", "title": "" }, { "docid": "c4b8b8b0843c7dce1007efc4cd0f4685", "score": "0.5921629", "text": "func (e *Engine) Start() {\n e.cmdStack = &Queue{onReceiveEmptyChan: make(chan bool)}\n e.onFinishChan = make(chan bool)\n go func() {\n for {\n cmd := e.cmdStack.Pull(&e.stopRequest)\n if cmd == nil {\n break\n }\n cmd.Execute(e)\n }\n e.onFinishChan <- true\n }()\n}", "title": "" }, { "docid": "b1eaaa819510d0e58d292fc04a99df52", "score": "0.5921023", "text": "func Run() error {\n\tif err := Start(); err != nil {\n\t\treturn err\n\t}\n\n\tch := make(chan os.Signal, 1)\n\tsignal.Notify(ch, signalutil.Shutdown()...)\n\tDefaultServer.Options().Logger.Logf(log.InfoLevel, \"Received signal %s\", <-ch)\n\n\treturn Stop()\n}", "title": "" }, { "docid": "c1189a8bd4c272605f7f40e2580461ef", "score": "0.5918194", "text": "func (c *Chief) Start() {\n\tfor x := 0; x < c.MaxWorkers; x++ {\n\t\tw := newWorker(c.Pool, c.HandleFunc)\n\t\tc.Workers = append(c.Workers, w)\n\t\tw.Start()\n\t}\n\n\tgo c.ctrl()\n}", "title": "" }, { "docid": "dc89400953ede012d87e4a44f1dad37f", "score": "0.5917394", "text": "func (tr *taskReader) Start() {\n\tif !atomic.CompareAndSwapInt32(\n\t\t&tr.status,\n\t\tcommon.DaemonStatusInitialized,\n\t\tcommon.DaemonStatusStarted,\n\t) {\n\t\treturn\n\t}\n\n\ttr.gorogrp.Go(tr.dispatchBufferedTasks)\n\ttr.gorogrp.Go(tr.getTasksPump)\n}", "title": "" }, { "docid": "4c53ec8eba74268db14d3c3e3ce08944", "score": "0.59105825", "text": "func (c *Controller) Run(stopCh <-chan struct{}) {\n\tdefer utilruntime.HandleCrash()\n\tdefer c.queue.ShutDown()\n\n\tlogrus.Info(\"Starting pod-watcher controller\")\n\n\tgo c.informer.Run(stopCh)\n\n\tif !cache.WaitForCacheSync(stopCh, c.HasSynced) {\n\t\tutilruntime.HandleError(fmt.Errorf(\"Timed out waiting for caches to sync\"))\n\t\treturn\n\t}\n\n\tlogrus.Info(\"pod-watcher controller synced and ready\")\n\n\twait.Until(c.runWorker, time.Second, stopCh)\n}", "title": "" }, { "docid": "f926e769f98069d888dd0a2597b2a4e7", "score": "0.5896593", "text": "func (i *IRC) Run() {\n\ti.wg.Add(1)\n\tgo func() {\n\t\tdefer i.wg.Done()\n\t\ti.conn.Loop()\n\t}()\n}", "title": "" }, { "docid": "7254bf667640d9cf28027dd7d4d882d8", "score": "0.5895399", "text": "func (k *KeKahu) Run() (err error) {\n\t// Initialize the listener channels\n\tk.echan = make(chan error)\n\tk.done = make(chan bool, 1)\n\n\t// Run the OS signal handlers\n\tgo signalHandler(k.Shutdown)\n\n\t// Start the local echo server\n\tif err = k.server.Run(k.echan); err != nil {\n\t\treturn err\n\t}\n\n\t// Start the heartbeat\n\tk.delay, err = k.config.GetInterval()\n\tif err != nil {\n\t\treturn err\n\t}\n\tk.jitter, err = k.config.GetJitter()\n\tif err != nil {\n\t\treturn err\n\t}\n\tgo k.Heartbeat()\n\n\t// Wait for any errors and log them\nouter:\n\tfor {\n\t\tselect {\n\t\tcase err := <-k.echan:\n\t\t\twarne(err)\n\t\tcase done := <-k.done:\n\t\t\tif done {\n\t\t\t\tbreak outer\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "17930b74ecd7b334f14164d62e179137", "score": "0.58871883", "text": "func (s *Server) Run() error {\n\tdefer s.logger.Sync()\n\tdefer s.redis.Close()\n\n\t// Create TCP listener\n\tl, err := net.Listen(\"tcp\", s.address)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"Failed creating listener on %s\", s.address)\n\t}\n\n\t// Create HTTP Server\n\ts.server = &http.Server{\n\t\tHandler: s.router,\n\t\tReadTimeout: 10 * time.Second,\n\t\tWriteTimeout: 10 * time.Second,\n\t\tMaxHeaderBytes: 1 << 20,\n\t}\n\n\t// Creating tracer\n\tvar tracer ot.Tracer\n\tvar closer io.Closer\n\ttracer, closer, err = util.InitTracer(\"order\", s.logger)\n\tif err != nil {\n\t\ts.logger.Warnw(\"unable to initialize tracer\",\n\t\t\t\"error\", err,\n\t\t)\n\t} else {\n\t\tdefer closer.Close()\n\t\tot.SetGlobalTracer(tracer)\n\t}\n\n\t// Listening\n\tgo func() {\n\t\ts.logger.Infow(\"Server listening\",\n\t\t\t\"address\", s.address,\n\t\t\t\"endpoint\", s.endpoint,\n\t\t)\n\t\ts.logger.Fatal(s.server.Serve(l))\n\t}()\n\n\t// Buffered channel to receive a single os.Signal\n\tstop := make(chan os.Signal, 1)\n\tsignal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)\n\n\t// Blocking channel until interrupt occurs\n\t<-stop\n\ts.Stop()\n\n\treturn nil\n}", "title": "" }, { "docid": "3635297bbece4a31baeb3af6ffdf9fc4", "score": "0.5883197", "text": "func RunService() {\n\tforever := make(chan bool)\n\tworkers := 10\n\tlog.Printf(\"Create %d Workers \\n\", workers)\n\tcreateWorker(workers)\n\t<-forever\n}", "title": "" } ]
31c0906b3413f0edab93baba083d635f
Retrieve returns the orderbook base a copy of the underlying linked list spread
[ { "docid": "60cacff1d54bab08122f0d9d3ad37722", "score": "0.4990657", "text": "func (d *Depth) Retrieve() *Base {\n\td.m.Lock()\n\tdefer d.m.Unlock()\n\treturn &Base{\n\t\tBids: d.bids.retrieve(),\n\t\tAsks: d.asks.retrieve(),\n\t\tExchange: d.exchange,\n\t\tAsset: d.asset,\n\t\tPair: d.pair,\n\t\tLastUpdated: d.lastUpdated,\n\t\tLastUpdateID: d.lastUpdateID,\n\t\tPriceDuplication: d.priceDuplication,\n\t\tIsFundingRate: d.isFundingRate,\n\t\tVerifyOrderbook: d.VerifyOrderbook,\n\t}\n}", "title": "" } ]
[ { "docid": "871533504d394f01ebe938bea95e2a58", "score": "0.6529609", "text": "func GetBook() *Book {\n\treturn &Book{make([]*Order, 0), &sync.Mutex{}}\n}", "title": "" }, { "docid": "84f77e655cab4e080a753c10cf2fc752", "score": "0.6504415", "text": "func (srv *Service) GetOrderBook() error { panic(\"not implemented\") }", "title": "" }, { "docid": "ab5f0da89e67fe71b61f611a339318d0", "score": "0.6101927", "text": "func GetOrderBook(cpair string, ch chan<- *ResOrder) {\n\n\t// Bittrex client\n\tlimt <- struct{}{}\n\tdefer func() {\n\t\t<-limt\n\t}()\n\n\tbittrex := bittrex.New(config.ApiKey, config.ApiSecret)\n\tdata, err := bittrex.GetOrderBookBuySell(cpair, \"buy\")\n\n\t/* \t//b, _ := json.MarshalIndent(data, \"\", \" \")\n\t \tioutil.WriteFile(\"./data/buyoder1.json\", b, 0644) */\n\trel, _ := decimal.NewFromString(\"0.0\")\n\tfor i := range data {\n\n\t\tq := data[i].Quantity\n\t\tr := data[i].Rate\n\t\trel = rel.Add(q.Mul(r))\n\t}\n\n\tvar rt *ResOrder\n\n\tif err != nil {\n\t\trt = &ResOrder{\n\t\t\tErr: err,\n\t\t\tName: cpair,\n\t\t}\n\t} else {\n\t\trt = &ResOrder{\n\t\t\tErr: err,\n\t\t\tName: cpair,\n\t\t\tV: rel,\n\t\t\tPrice: data[0].Rate,\n\t\t}\n\t}\n\n\tch <- rt\n\twg.Done()\n\n\treturn\n\t//fmt.Printf(\"try first size = %d\\n, toal V = %s\", len(data), rel.String())\n}", "title": "" }, { "docid": "cef17598c484b1a6c8bc30cd6be6e4bb", "score": "0.59293395", "text": "func (k Keeper) getOrderBook(ctx sdk.Context, kind OrderKind, amountDenom string, priceDenom string) OrderBook {\n\tkey := MakeKeyOrderBook(kind, amountDenom, priceDenom)\n\n\tstore := ctx.KVStore(k.storeKey)\n\tvalueBytes := store.Get(key)\n\n\tif valueBytes == nil {\n\t\treturn NewOrderBook(kind, amountDenom, priceDenom)\n\t}\n\n\torderBook := new(OrderBook)\n\tk.cdc.UnmarshalBinary(valueBytes, &orderBook)\n\n\treturn *orderBook\n}", "title": "" }, { "docid": "d04753e1db1ae5230352acfa43274850", "score": "0.58307487", "text": "func (s *store) get() map[string][]*order.Detail {\n\torders := make(map[string][]*order.Detail)\n\ts.m.Lock()\n\tfor k, val := range s.Orders {\n\t\torders[k] = order.CopyPointerOrderSlice(val)\n\t}\n\ts.m.Unlock()\n\treturn orders\n}", "title": "" }, { "docid": "c8554422bc8d7f2572bd84678bbfe2e3", "score": "0.5809523", "text": "func (p *orderBookProxy) real() (*OrderBook, error) {\n\tconvert := func(in [][]interface{}, out []OrderBookPoint) error {\n\t\tfor i, b := range in {\n\t\t\tif len(b) == 3 {\n\t\t\t\tp, ok := b[0].(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn errors.New(\"unknown format\")\n\t\t\t\t}\n\n\t\t\t\tq, ok := b[1].(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn errors.New(\"unknown format\")\n\t\t\t\t}\n\n\t\t\t\tout[i].Price = Value(p)\n\t\t\t\tout[i].Quantity = Value(q)\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t}\n\n\torderbook := &OrderBook{\n\t\tLastUpdateID: p.LastUpdateID,\n\t\tBids: make([]OrderBookPoint, len(p.Bids)),\n\t\tAsks: make([]OrderBookPoint, len(p.Asks)),\n\t}\n\n\terr := convert(p.Bids, orderbook.Bids)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terr = convert(p.Asks, orderbook.Asks)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn orderbook, nil\n}", "title": "" }, { "docid": "34c31c978162eae0379269016251b74a", "score": "0.5786845", "text": "func (b *bookie) book() *OrderBook {\n\tbuys, sells, epoch := b.Orders()\n\treturn &OrderBook{\n\t\tBuys: translateBookSide(buys),\n\t\tSells: translateBookSide(sells),\n\t\tEpoch: translateBookSide(epoch),\n\t}\n}", "title": "" }, { "docid": "702852ed17b6ac056f7bff90b1f053bc", "score": "0.5744394", "text": "func (w *Orderbook) GetOrderbook(p currency.Pair, a asset.Item) (*orderbook.Base, error) {\n\tw.m.Lock()\n\tdefer w.m.Unlock()\n\tbook, ok := w.ob[p.Base][p.Quote][a]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s %s %s %w\",\n\t\t\tw.exchangeName,\n\t\t\tp,\n\t\t\ta,\n\t\t\terrDepthNotFound)\n\t}\n\treturn book.ob.Retrieve(), nil\n}", "title": "" }, { "docid": "ee290c186f9e53ca4e96c6e38c0fc908", "score": "0.5609625", "text": "func (ok *Okx) FetchOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tob, err := orderbook.Get(ok.Name, pair, assetType)\n\tif err != nil {\n\t\treturn ok.UpdateOrderbook(ctx, pair, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "8173d05f91dcdc56c6ccb17641859a09", "score": "0.56018054", "text": "func (c *CustomEx) FetchOrderbook(_ context.Context, _ currency.Pair, _ asset.Item) (*orderbook.Base, error) {\n\treturn nil, nil\n}", "title": "" }, { "docid": "3c09b65d9ba0373fccca03f54405a0d1", "score": "0.55990994", "text": "func (c *Core) Book(dex string, base, quote uint32) (*OrderBook, error) {\n\tc.connMtx.RLock()\n\tdc, found := c.conns[dex]\n\tc.connMtx.RUnlock()\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"no DEX %s\", dex)\n\t}\n\n\tmkt := marketName(base, quote)\n\tdc.booksMtx.RLock()\n\tbook, found := dc.books[mkt]\n\tdc.booksMtx.RUnlock()\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"no market %s\", mkt)\n\t}\n\n\tbuys, sells, epoch := book.Orders()\n\n\treturn &OrderBook{\n\t\tBuys: translateBookSide(buys),\n\t\tSells: translateBookSide(sells),\n\t\tEpoch: translateBookSide(epoch),\n\t}, nil\n}", "title": "" }, { "docid": "6d85f687f007196d463dde4285c4f1ae", "score": "0.5568673", "text": "func (w *Orderbook) LoadSnapshot(book *orderbook.Base) error {\n\tw.m.Lock()\n\tdefer w.m.Unlock()\n\tm1, ok := w.ob[book.Pair.Base]\n\tif !ok {\n\t\tm1 = make(map[currency.Code]map[asset.Item]*orderbookHolder)\n\t\tw.ob[book.Pair.Base] = m1\n\t}\n\tm2, ok := m1[book.Pair.Quote]\n\tif !ok {\n\t\tm2 = make(map[asset.Item]*orderbookHolder)\n\t\tm1[book.Pair.Quote] = m2\n\t}\n\tholder, ok := m2[book.Asset]\n\tif !ok {\n\t\t// Associate orderbook pointer with local exchange depth map\n\t\tdepth, err := orderbook.DeployDepth(book.Exchange, book.Pair, book.Asset)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdepth.AssignOptions(book)\n\t\tbuffer := make([]Update, w.obBufferLimit)\n\n\t\tvar ticker *time.Ticker\n\t\tif w.publishPeriod != 0 {\n\t\t\tticker = time.NewTicker(w.publishPeriod)\n\t\t}\n\t\tholder = &orderbookHolder{\n\t\t\tob: depth,\n\t\t\tbuffer: &buffer,\n\t\t\tticker: ticker,\n\t\t}\n\t\tm2[book.Asset] = holder\n\t}\n\n\t// Checks if book can deploy to linked list\n\terr := book.Verify()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tholder.ob.LoadSnapshot(\n\t\tbook.Bids,\n\t\tbook.Asks,\n\t\tbook.LastUpdateID,\n\t\tbook.LastUpdated,\n\t\tfalse,\n\t)\n\n\tif holder.ob.VerifyOrderbook { // This is used here so as to not retrieve\n\t\t// book if verification is off.\n\t\t// Checks to see if orderbook snapshot that was deployed has not been\n\t\t// altered in any way\n\t\terr = holder.ob.Retrieve().Verify()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tw.dataHandler <- holder.ob.Retrieve()\n\tholder.ob.Publish()\n\treturn nil\n}", "title": "" }, { "docid": "357ee632d41748799e459cdcb743519d", "score": "0.5533591", "text": "func (b *Bitstamp) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tfPair, err := b.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tob, err := orderbook.Get(b.Name, fPair, assetType)\n\tif err != nil {\n\t\treturn b.UpdateOrderbook(ctx, fPair, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "cd255f89786b57099b40dc30c258e4a1", "score": "0.55272216", "text": "func (b *Binance) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tob, err := orderbook.Get(b.Name, p, assetType)\n\tif err != nil {\n\t\t// TODO: Disconnect update orderbook functionality from fetch orderbook\n\t\t// functionality across all wrappers as this mutes potential errors.\n\t\treturn b.UpdateOrderbook(ctx, p, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "76dc4594fb670f7dfe5c8c65413e2b09", "score": "0.5518758", "text": "func (e *Lbank) OrderBook(pair *pair.Pair) (*exchange.Maker, error) {\n\torderBook := OrderBook{}\n\tsymbol := e.GetSymbolByPair(pair)\n\n\tstrRequestUrl := \"/v1/depth.do\"\n\tstrUrl := API_URL + strRequestUrl\n\n\tmapParams := make(map[string]string)\n\tmapParams[\"symbol\"] = symbol\n\tmapParams[\"size\"] = \"60\"\n\tmapParams[\"merge\"] = \"0\"\n\n\tmaker := &exchange.Maker{}\n\tmaker.WorkerIP = exchange.GetExternalIP()\n\n\tmaker.BeforeTimestamp = float64(time.Now().UnixNano() / 1e6)\n\n\tjsonOrderbook := exchange.HttpGetRequest(strUrl, mapParams)\n\tif err := json.Unmarshal([]byte(jsonOrderbook), &orderBook); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Json Unmarshal Err: %v %v\", e.GetName(), err, jsonOrderbook)\n\t}\n\n\tmaker.AfterTimestamp = float64(time.Now().UnixNano() / 1e6)\n\tfor _, bid := range orderBook.Bids {\n\t\tvar buydata exchange.Order\n\n\t\t//Modify according to type and structure\n\t\tbuydata.Rate = bid[0]\n\t\tbuydata.Quantity = bid[1]\n\t\tmaker.Bids = append(maker.Bids, buydata)\n\t}\n\tfor _, ask := range orderBook.Asks {\n\t\tvar selldata exchange.Order\n\n\t\t//Modify according to type and structure\n\t\tselldata.Rate = ask[0]\n\t\tselldata.Quantity = ask[1]\n\t\tmaker.Asks = append(maker.Asks, selldata)\n\t}\n\treturn maker, nil\n}", "title": "" }, { "docid": "53df7443d7de6497018ebda94a4af876", "score": "0.5516291", "text": "func (ob *OrderBook) book(note *msgjson.BookOrderNote, cached bool) error {\n\tif ob.marketID != note.MarketID {\n\t\treturn fmt.Errorf(\"invalid note market id %s\", note.MarketID)\n\t}\n\n\tif !cached {\n\t\t// Cache the note if the order book is not synced.\n\t\tif !ob.isSynced() {\n\t\t\treturn ob.cacheOrderNote(msgjson.BookOrderRoute, note)\n\t\t}\n\t}\n\n\tob.setSeq(note.Seq)\n\n\tif len(note.OrderID) != order.OrderIDSize {\n\t\treturn fmt.Errorf(\"expected order id length of %d, got %d\",\n\t\t\torder.OrderIDSize, len(note.OrderID))\n\t}\n\n\tvar oid order.OrderID\n\tcopy(oid[:], note.OrderID)\n\n\torder := &Order{\n\t\tOrderID: oid,\n\t\tSide: note.Side,\n\t\tQuantity: note.Quantity,\n\t\tRate: note.Rate,\n\t}\n\n\tob.ordersMtx.Lock()\n\tob.orders[order.OrderID] = order\n\tob.ordersMtx.Unlock()\n\n\t// Add the order to its associated books side.\n\tswitch order.Side {\n\tcase msgjson.BuyOrderNum:\n\t\tob.buys.Add(order)\n\n\tcase msgjson.SellOrderNum:\n\t\tob.sells.Add(order)\n\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown order side provided: %d\", order.Side)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2bbd3351840d9723b6d178d2a309d13f", "score": "0.55088425", "text": "func (p *Poloniex) FetchOrderbook(ctx context.Context, currencyPair currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tob, err := orderbook.Get(p.Name, currencyPair, assetType)\n\tif err != nil {\n\t\treturn p.UpdateOrderbook(ctx, currencyPair, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "8923cc3acee775831974c88238aa27db", "score": "0.5430857", "text": "func (obts OrderBookTS) GetOrderBook(t time.Time) OrderBook {\n\tvar ob OrderBook\n\tfor _, obt := range obts {\n\t\tif t.After(obt.Time) {\n\t\t\tob = obt.OB\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn ob\n}", "title": "" }, { "docid": "934620f258c11673a67f0f8ecdc8af60", "score": "0.5394677", "text": "func (o *Order) GetOrder(id int) {}", "title": "" }, { "docid": "4002e7d0409cd70ad111bd657122e415", "score": "0.5387007", "text": "func (l binaryFreeList) Borrow() []byte {\n var buf []byte\n select {\n case buf = <-l:\n default:\n\tbuf = make([]byte, 8)\n }\n return buf[:8]\n}", "title": "" }, { "docid": "e4bcf5db1807b548fee8d34045c51c99", "score": "0.53698355", "text": "func (b *Bithumb) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.GetOrderbook(b.GetName(), currency, assetType)\n\tif err != nil {\n\t\treturn b.UpdateOrderbook(currency, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "8ea53794eff738cfe6179b201ad4c59f", "score": "0.53603303", "text": "func (e *Bigone) OrderBook(pair *pair.Pair) (*exchange.Maker, error) {\n\tjsonResponse := &JsonResponse{}\n\torderBook := OrderBook{}\n\tsymbol := e.GetSymbolByPair(pair)\n\n\tstrRequestUrl := fmt.Sprintf(\"/asset_pairs/%v/depth\", symbol)\n\tstrUrl := API_URL + strRequestUrl\n\n\tmaker := &exchange.Maker{\n\t\tWorkerIP: exchange.GetExternalIP(),\n\t\tSource: exchange.EXCHANGE_API,\n\t\tBeforeTimestamp: float64(time.Now().UnixNano() / 1e6),\n\t}\n\n\tjsonOrderbook := exchange.HttpGetRequest(strUrl, nil)\n\tif err := json.Unmarshal([]byte(jsonOrderbook), &jsonResponse); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Json Unmarshal Err: %v %v\", e.GetName(), err, jsonOrderbook)\n\t} else if jsonResponse.Code != 0 {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Failed: %v\", e.GetName(), jsonResponse)\n\t}\n\tif err := json.Unmarshal(jsonResponse.Data, &orderBook); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Data Unmarshal Err: %v %s\", e.GetName(), err, jsonResponse.Data)\n\t}\n\n\tmaker.AfterTimestamp = float64(time.Now().UnixNano() / 1e6)\n\tvar err error\n\tfor _, bid := range orderBook.Bids {\n\t\tvar buydata exchange.Order\n\n\t\t//Modify according to type and structure\n\t\tbuydata.Rate, err = strconv.ParseFloat(bid.Price, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbuydata.Quantity, err = strconv.ParseFloat(bid.Quantity, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tmaker.Bids = append(maker.Bids, buydata)\n\t}\n\tfor _, ask := range orderBook.Asks {\n\t\tvar selldata exchange.Order\n\n\t\t//Modify according to type and structure\n\t\tselldata.Rate, err = strconv.ParseFloat(ask.Price, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tselldata.Quantity, err = strconv.ParseFloat(ask.Quantity, 64)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tmaker.Asks = append(maker.Asks, selldata)\n\t}\n\treturn maker, nil\n}", "title": "" }, { "docid": "aecd9f354ae2e1303a785c217f2a3f30", "score": "0.5354177", "text": "func GetRecentOrder(coin string) *RecentOrderBook {\n\tlogger := logger.GetLogger(\"[Get \" + coin + \" OrderBook]\")\n\turl := account.BaseURL + \"/orderbook/?currency=\" + coin\n\n\tres, err := http.Get(url)\n\torderBook := new(OrderBook)\n\tif err != nil {\n\t\tlogger.Warning.Println(err)\n\t\treturn nil\n\t}\n\terr2 := json.NewDecoder(res.Body).Decode(orderBook)\n\tif err2 != nil {\n\t\tlogger.Warning.Println(err2)\n\t\treturn nil\n\t}\n\n\tif orderBook.Result == \"success\" {\n\t\trecentOrder := new(RecentOrderBook)\n\t\trecentOrder.Ask = orderBook.Ask[0]\n\t\trecentOrder.Bid = orderBook.Bid[0]\n\t\trecentOrder.Currency = orderBook.Currency\n\t\trecentOrder.Timestamp = orderBook.Timestamp\n\t\trecentOrder.ErrorCode = orderBook.ErrorCode\n\n\t\treturn recentOrder\n\t} else if orderBook.ErrorCode == \"133\" {\n\t\ttime.Sleep(time.Duration(1) * time.Second)\n\t\treturn GetRecentOrder(coin)\n\t} else {\n\t\tlogger.Warning.Println(orderBook.ErrorCode)\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "b5e42199bb2653b4ec7045823381aa48", "score": "0.53357416", "text": "func (ob *OrderBook) GetOrders() {\n\n}", "title": "" }, { "docid": "a99627028bdcae14cbbafe67e860fa13", "score": "0.5323407", "text": "func (h *HitBTC) GetOrderbookEx(currencyPair currency.Pair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.Get(h.GetName(), currencyPair, assetType)\n\tif err != nil {\n\t\treturn h.UpdateOrderbook(currencyPair, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "a86a0c095d6bba7765c5d6c7b7d78d72", "score": "0.5317636", "text": "func (l binaryFreeList) Borrow() []byte {\n\tvar buf []byte\n\tselect {\n\tcase buf = <-l:\n\tdefault:\n\t\tbuf = make([]byte, 8)\n\t}\n\treturn buf[:8]\n}", "title": "" }, { "docid": "a0556eadb475f77c505e3c973e573cd6", "score": "0.53106517", "text": "func (e *EXMO) GetOrderbook(ctx context.Context, symbol string) (map[string]Orderbook, error) {\n\tv := url.Values{}\n\tv.Set(\"pair\", symbol)\n\tresult := make(map[string]Orderbook)\n\turlPath := fmt.Sprintf(\"/v%s/%s\", exmoAPIVersion, exmoOrderbook)\n\treturn result, e.SendHTTPRequest(ctx, exchange.RestSpot, common.EncodeURLValues(urlPath, v), &result)\n}", "title": "" }, { "docid": "66d1356ab48c320f6a832a8ea6ff9eae", "score": "0.53055805", "text": "func (l *LakeBTC) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tfPair, err := l.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tob, err := orderbook.Get(l.Name, fPair, assetType)\n\tif err != nil {\n\t\treturn l.UpdateOrderbook(fPair, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "234b5ddcdfd26cb68a2140c12dbcae80", "score": "0.5305239", "text": "func (cl *Client) GetOrderBookFull(ctx context.Context, req *GetOrderBookFullRequest) (*GetOrderBookFullResponse, error) {\n\tvar res GetOrderBookFullResponse\n\terr := cl.do(ctx, \"GET\", \"/api/1/orderbook\", req, &res, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &res, nil\n}", "title": "" }, { "docid": "d7e651c7d766422b353b02dca52ebddc", "score": "0.52995664", "text": "func NewOrderbook(name string, db *BatchDatabase) *Orderbook {\n\n\t// we can implement using only one DB to faciliate cache engine\n\t// so that we use a big.Int number to seperate domain of the keys\n\t// like this keccak(\"orderBook\") + key\n\t// orderBookPath := path.Join(datadir, \"orderbook\")\n\t// db := NewBatchDatabase(orderBookPath, 0, 0)\n\n\titem := &OrderbookItem{\n\t\tNextOrderID: 0,\n\t\tName: strings.ToLower(name),\n\t}\n\n\t// do slot with hash to prevent collision\n\n\t// we convert to lower case, so even with name as contract address, it is still correct\n\t// without converting back from hex to bytes\n\tkey := crypto.Keccak256([]byte(item.Name))\n\tslot := new(big.Int).SetBytes(key)\n\n\t// hash ( orderBookKey . orderTreeKey )\n\t// bidsKey := crypto.Keccak256(key, bidSlotKey)\n\t// asksKey := crypto.Keccak256(key, askSlotKey)\n\n\t// we just increase the segment at the most byte at address length level to avoid conflict\n\t// somehow it is like 2 hashes has the same common prefix and it is very difficult to resolve\n\t// the order id start at orderbook slot\n\t// the price of order tree start at order tree slot\n\tbidsKey := GetSegmentHash(key, 1, SlotSegment)\n\tasksKey := GetSegmentHash(key, 2, SlotSegment)\n\n\torderBook := &Orderbook{\n\t\tdb: db,\n\t\tItem: item,\n\t\tslot: slot,\n\t\tKey: key,\n\t}\n\n\tbids := NewOrderTree(db, bidsKey, orderBook)\n\tasks := NewOrderTree(db, asksKey, orderBook)\n\n\t// set asks and bids\n\torderBook.Bids = bids\n\torderBook.Asks = asks\n\t// orderBook.Restore()\n\n\t// no need to update when there is no operation yet\n\torderBook.UpdateTime()\n\n\treturn orderBook\n}", "title": "" }, { "docid": "bdc85b19b8361541fca1c0e9b710c4e3", "score": "0.5249287", "text": "func (b *Bitmex) GetOrderbookEx(currency currency.Pair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.Get(b.GetName(), currency, assetType)\n\tif err != nil {\n\t\treturn b.UpdateOrderbook(currency, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "28a5dc05ad76116dea60c4a3aeeeea0d", "score": "0.5248811", "text": "func getBook(params map[string]string, client *Client) bool {\n isbnS, isbnOk := params[\"isbn\"]\n if !isbnOk {\n SendErr(client, \"Need more info\", \"06002\")\n return false\n }\n isbn, err := strconv.Atoi(isbnS)\n if err != nil {\n SendErr(client, \"ISBN not number\", \"06003\")\n return false\n }\n var book Book\n db.Where(\"isbn = ?\", isbn).First(&book)\n if book.Id == 0 {\n SendErr(client, \"Book not found\", \"06004\")\n return false\n }\n var copies []BookCopy\n db.Model(&book).Related(&copies)\n toReturn := make(map[string]string)\n for index, curCopy := range copies {\n toReturn[\"condition_\"+strconv.Itoa(index)] = strconv.Itoa(int(curCopy.Condition))\n toReturn[\"checked_out_\"+strconv.Itoa(index)] = strconv.Itoa(int(curCopy.CustomerId))\n }\n var reserves []Reservation\n db.Model(&book).Related(&reserves)\n for index, curReserve := range reserves {\n toReturn[\"reserve_\"+strconv.Itoa(index)] = strconv.Itoa(int(curReserve.CustomerId))\n }\n toReturn[\"title\"] = book.Title\n toReturn[\"genre\"] = book.Genre\n toReturn[\"author\"] = book.Author\n toReturn[\"book_id\"] = strconv.Itoa(int(book.Id))\n SendMessage(client, \"success\", toReturn)\n return true\n}", "title": "" }, { "docid": "f8bced17934bc3a74a4666661993fc3f", "score": "0.5245081", "text": "func (l *Liqui) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.GetOrderbook(l.Name, p, assetType)\n\tif err != nil {\n\t\treturn l.UpdateOrderbook(p, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "14869076bf25b404dc2e2af02546a31c", "score": "0.52432626", "text": "func (a *Alphapoint) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.GetOrderbook(a.GetName(), p, assetType)\n\tif err != nil {\n\t\treturn a.UpdateOrderbook(p, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "8e5574b04632600ec806a8f883c320a2", "score": "0.5217395", "text": "func (o *OKGroup) FetchOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tfPair, err := o.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tob, err := orderbook.Get(o.Name, fPair, assetType)\n\tif err != nil {\n\t\treturn o.UpdateOrderbook(ctx, fPair, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "402ec86c70b75b2122a76f6d72d0ad3a", "score": "0.52166754", "text": "func (s *Service) Return(b *book.Book) error {\n\tb, err := s.bService.Get(b.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tall, err := s.uService.List()\n\tif err != nil {\n\t\treturn err\n\t}\n\tborrowed := false\n\tvar borrowedBy entity.ID\n\tfor _, u := range all {\n\t\tfor _, bookID := range u.Books {\n\t\t\tif bookID == b.ID {\n\t\t\t\tborrowed = true\n\t\t\t\tborrowedBy = u.ID\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif !borrowed {\n\t\treturn domain.ErrBookNotBorrowed\n\t}\n\tu, err := s.uService.Get(borrowedBy)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor i, j := range u.Books {\n\t\tif j == b.ID {\n\t\t\tu.Books = append(u.Books[:i], u.Books[i+1:]...)\n\t\t\terr = s.uService.Update(u)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tb.Quantity++\n\terr = s.bService.Update(b)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "37d8e9581dc343987edfa3e52cb67478", "score": "0.5207268", "text": "func (api *Kraken) GetOrderBook(pair string, depth int64) (map[string]OrderBook, error) {\n\tdata := url.Values{\n\t\t\"pair\": {pair},\n\t\t\"count\": {strconv.FormatInt(depth, 10)},\n\t}\n\tresponse := make(map[string]OrderBook)\n\tif err := api.request(\"Depth\", false, data, &response); err != nil {\n\t\treturn nil, err\n\t}\n\treturn response, nil\n}", "title": "" }, { "docid": "3805ba7ef60b66d4793d6a8564f60ff0", "score": "0.5203514", "text": "func (b *Bufpool) Get() interface{} {\n\to := <-b.q\n\treturn o\n}", "title": "" }, { "docid": "f4ad0d25604bcd0a8b72ebf2c4105561", "score": "0.51953596", "text": "func (e *Ibankdigital) OrderBook(pair *pair.Pair) (*exchange.Maker, error) {\n\torderBook := OrderBook{}\n\tsymbol := e.GetSymbolByPair(pair)\n\n\tstrRequestUrl := \"/market/depth\"\n\tstrUrl := API_URL + strRequestUrl\n\n\tmapParams := make(map[string]string)\n\tmapParams[\"symbol\"] = symbol\n\tmapParams[\"type\"] = \"step0\"\n\n\tmaker := &exchange.Maker{\n\t\tWorkerIP: exchange.GetExternalIP(),\n\t\tSource: exchange.EXCHANGE_API,\n\t\tBeforeTimestamp: float64(time.Now().UnixNano() / 1e6),\n\t}\n\n\tjsonOrderbook := exchange.HttpGetRequest(strUrl, mapParams)\n\tif err := json.Unmarshal([]byte(jsonOrderbook), &orderBook); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Json Unmarshal Err: %v %v\", e.GetName(), err, jsonOrderbook)\n\t} else if orderBook.Status != \"ok\" {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Failed: %v\", e.GetName(), jsonOrderbook)\n\t}\n\n\tmaker.AfterTimestamp = float64(time.Now().UnixNano() / 1e6)\n\tfor _, bid := range orderBook.Tick.Bids {\n\t\tvar buydata exchange.Order\n\n\t\t//Modify according to type and structure\n\t\tbuydata.Rate = bid[0]\n\t\tbuydata.Quantity = bid[1]\n\t\tmaker.Bids = append(maker.Bids, buydata)\n\t}\n\tfor _, ask := range orderBook.Tick.Asks {\n\t\tvar selldata exchange.Order\n\n\t\t//Modify according to type and structure\n\t\tselldata.Rate = ask[0]\n\t\tselldata.Quantity = ask[1]\n\t\tmaker.Asks = append(maker.Asks, selldata)\n\t}\n\treturn maker, nil\n}", "title": "" }, { "docid": "8a6ac63fc7101b41b6496e0315432de6", "score": "0.51730186", "text": "func (obm *OrderBookMessage) Snapshot() ws.OrderBookSnapshot {\n\tvar (\n\t\tbids []*ws.Entry\n\t\tasks []*ws.Entry\n\t)\n\n\tfor _, entry := range obm.Data.Bids {\n\t\tbids = append(bids, entry.Standard())\n\t}\n\n\tfor _, entry := range obm.Data.Bids {\n\t\tbids = append(bids, entry.Standard())\n\t}\n\n\treturn ws.OrderBookSnapshot{\n\t\tBids: bids,\n\t\tAsks: asks,\n\t}\n}", "title": "" }, { "docid": "dcc4399b77a82f374c1b6d12bb55743e", "score": "0.5165943", "text": "func (ga *GeminiAPI) GetOrderbook(pair string, bidLimit, askLimit int) (Orderbook, error) {\n\ttickerUrl := fmt.Sprintf(\"/v1/book/%s?limit_bids=%d&limit_asks=%d\", pair, bidLimit, askLimit)\n\tresp, err := http.Get(fmt.Sprintf(\"%s%s\", ga.BaseURL, tickerUrl))\n\tif err != nil {\n\t\tga.logger.Printf(\"ERROR: Failed to get ticker for pair %s\\n\", pair)\n\t\treturn Orderbook{}, err\n\t}\n\tdefer resp.Body.Close()\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tga.logger.Printf(\"ERROR: Failed to read ticker from response\\n\")\n\t\treturn Orderbook{}, err\n\t}\n\torders := Orderbook{}\n\terr = json.Unmarshal(body, &orders)\n\tif err != nil {\n\t\tga.logger.Printf(\"ERROR: Failed to decode Orderbook from response: %s\\n\", body)\n\t\treturn Orderbook{}, err\n\t}\n\treturn orders, nil\n}", "title": "" }, { "docid": "0cc0d119eb21d7a27ba660635259e631", "score": "0.5162335", "text": "func (g *Gemini) GetOrderbook(currencyPair string, params url.Values) (Orderbook, error) {\n\tpath := common.EncodeURLValues(fmt.Sprintf(\"%s/v%s/%s/%s\", g.APIUrl, geminiAPIVersion, geminiOrderbook, currencyPair), params)\n\torderbook := Orderbook{}\n\treturn orderbook, common.SendHTTPGetRequest(path, true, g.Verbose, &orderbook)\n}", "title": "" }, { "docid": "87c7a81924079084896ed2883204bc69", "score": "0.5155157", "text": "func (m *SalesQuoteLine) GetItem()(Itemable) {\n val, err := m.GetBackingStore().Get(\"item\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(Itemable)\n }\n return nil\n}", "title": "" }, { "docid": "3de4e52bc72985681916064540e2c36a", "score": "0.5126973", "text": "func (s *Store) Get(dest Serializable, h hash.Hash) error {\n\tvar buff []byte\n\terr := s.db.View(func(tx *bolt.Tx) error {\n\t\tbuff = tx.Bucket(bucketname).Get(h.Slice())\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn dest.Deserialize(buff)\n}", "title": "" }, { "docid": "870ac3a79e3be6f3a3807a8ae8590421", "score": "0.51174694", "text": "func (a *ANX) GetOrderbookEx(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.GetOrderbook(a.GetName(), p, assetType)\n\tif err != nil {\n\t\treturn a.UpdateOrderbook(p, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "e2df4d046b0d49cf10e6895e556e9417", "score": "0.5114252", "text": "func GetOrderbook(symbol string) (Orderbook, error) {\n\tbook, err := getOrderbook(symbol)\n\tif err != nil {\n\t\treturn Orderbook{}, err\n\t}\n\treturn *book, nil\n}", "title": "" }, { "docid": "1e83eda96903493311de83a8870cc3f8", "score": "0.50992906", "text": "func (db *DB) retrieveOrder(id string) (*Order, error){\n\tkey := \"bitregister:order:\" + id\n\tres, err := db.sendCommand(\"HGETALL\", key)\n\tif err != nil {\n\t\tlog.Println(\"Error sending HGETALL operation: \", err)\n\t}\n\t\n\tv, err := redis.Values(res, err)\n if err != nil {\n panic(err)\n }\n\n order := new(Order)\n if err := redis.ScanStruct(v, order); err != nil {\n panic(err)\n }\n\n return order, err\n}", "title": "" }, { "docid": "343e4f80c18cbb7f83bf89b99a02f8d6", "score": "0.50982183", "text": "func (t TxsFromAddressAsc) get() []*MemPoolTx {\n\treturn t\n}", "title": "" }, { "docid": "e049a266b83ad752f8896a4422b164cc", "score": "0.50907654", "text": "func (ob *orderbookState) GetSnapshot() (\n\tint64, []luno.OrderBookEntry, []luno.OrderBookEntry) {\n\n\tob.mu.Lock()\n\tdefer ob.mu.Unlock()\n\n\tbids := flatten(ob.bids, true)\n\tasks := flatten(ob.asks, false)\n\treturn ob.seq, bids, asks\n}", "title": "" }, { "docid": "0aa65104ffd50eba65823c2a84d3a2d6", "score": "0.5083576", "text": "func (cl *MasterCoinLocker) Book() CoinLocker {\n\treturn &bookLocker{cl}\n}", "title": "" }, { "docid": "6180a92b0dd128458fcee9d6fc145772", "score": "0.5081728", "text": "func (b *byteBuffer) Get() []byte {\n\tb.Mutex.Lock()\n\tdefer b.Mutex.Unlock()\n\treturn b.List.Front().Value.([]byte)\n}", "title": "" }, { "docid": "12c282a462f82987287a5fabf09034e9", "score": "0.5069192", "text": "func (ob *OrderBookGroup) Get() (books []schemas.OrderBook, err error) {\n\tvar b []byte\n\tvar resp interface{}\n\n\tif len(ob.symbols) == 0 {\n\t\terr = errors.New(\"[BITFINEX] Symbol is empty\")\n\t\treturn\n\t}\n\n\tfor _, smb := range ob.symbols {\n\t\turl := apiOrderBook + \"/\" + \"t\" + unparseSymbol(smb.Name) + \"/P0\"\n\n\t\tif b, err = ob.httpClient.Get(url, httpclient.Params(), false); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif err = json.Unmarshal(b, &resp); err != nil {\n\t\t\treturn\n\t\t}\n\t\tif bks, ok := resp.([]interface{}); ok {\n\t\t\tbooks = append(books, ob.mapOrderBook(\"t\"+unparseSymbol(smb.Name), bks))\n\t\t}\n\n\t\ttime.Sleep(2 * time.Second)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "a0b070524020fbd91868c3f68268df6e", "score": "0.5063168", "text": "func (e *Okex) OrderBook(pair *pair.Pair) (*exchange.Maker, error) {\n\torderBook := OrderBook{}\n\tsymbol := e.GetSymbolByPair(pair)\n\n\tstrRequestUrl := fmt.Sprintf(\"/api/spot/v3/instruments/%s/book\", symbol)\n\tstrUrl := API_URL + strRequestUrl\n\n\tmaker := &exchange.Maker{\n\t\tWorkerIP: exchange.GetExternalIP(),\n\t\tSource: exchange.EXCHANGE_API,\n\t\tBeforeTimestamp: float64(time.Now().UnixNano() / 1e6),\n\t}\n\n\tjsonOrderbook := exchange.HttpGetRequest(strUrl, nil)\n\tif err := json.Unmarshal([]byte(jsonOrderbook), &orderBook); err != nil {\n\t\treturn nil, fmt.Errorf(\"%s Get Orderbook Json Unmarshal Err: %v %v\", e.GetName(), err, jsonOrderbook)\n\t}\n\n\tmaker.AfterTimestamp = float64(time.Now().UnixNano() / 1e6)\n\tfor _, bid := range orderBook.Bids {\n\t\tvar buydata exchange.Order\n\t\tbuydata.Rate, _ = strconv.ParseFloat(bid[0], 64)\n\t\tbuydata.Quantity, _ = strconv.ParseFloat(bid[1], 64)\n\n\t\tmaker.Bids = append(maker.Bids, buydata)\n\t}\n\tfor _, ask := range orderBook.Asks {\n\t\tvar selldata exchange.Order\n\t\tselldata.Rate, _ = strconv.ParseFloat(ask[0], 64)\n\t\tselldata.Quantity, _ = strconv.ParseFloat(ask[1], 64)\n\n\t\tmaker.Asks = append(maker.Asks, selldata)\n\t}\n\treturn maker, nil\n}", "title": "" }, { "docid": "5edb63f416926037e86ca4915e699664", "score": "0.50543004", "text": "func (b *BTSE) FetchOrderBook(ctx context.Context, symbol string, group, limitBids, limitAsks int, spot bool) (*Orderbook, error) {\n\tvar o Orderbook\n\turlValues := url.Values{}\n\turlValues.Add(\"symbol\", symbol)\n\tif limitBids > 0 {\n\t\turlValues.Add(\"limit_bids\", strconv.Itoa(limitBids))\n\t}\n\tif limitAsks > 0 {\n\t\turlValues.Add(\"limit_asks\", strconv.Itoa(limitAsks))\n\t}\n\tif group > 0 {\n\t\turlValues.Add(\"group\", strconv.Itoa(group))\n\t}\n\treturn &o, b.SendHTTPRequest(ctx, exchange.RestSpot, http.MethodGet,\n\t\tcommon.EncodeURLValues(btseOrderbook, urlValues), &o, spot, queryFunc)\n}", "title": "" }, { "docid": "921c3db5b364527db718c4ee14653e89", "score": "0.505122", "text": "func (c *Core) Sync(host string, base, quote uint32) (*OrderBook, *BookFeed, error) {\n\t// Need to send the 'orderbook' message and parse the results.\n\tc.connMtx.RLock()\n\tdc, found := c.conns[host]\n\tc.connMtx.RUnlock()\n\tif !found {\n\t\treturn nil, nil, fmt.Errorf(\"unknown DEX '%s'\", host)\n\t}\n\n\tmkt := marketName(base, quote)\n\tdc.booksMtx.Lock()\n\tdefer dc.booksMtx.Unlock()\n\tbooky, found := dc.books[mkt]\n\tif found {\n\t\treturn booky.book(), booky.feed(), nil\n\t}\n\n\t// Make sure the market exists.\n\tdc.marketMtx.RLock()\n\t_, found = dc.marketMap[mkt]\n\tdc.marketMtx.RUnlock()\n\tif !found {\n\t\treturn nil, nil, fmt.Errorf(\"unknown market %s\", mkt)\n\t}\n\n\t// Subscribe\n\treq, err := msgjson.NewRequest(dc.NextID(), msgjson.OrderBookRoute, &msgjson.OrderBookSubscription{\n\t\tBase: base,\n\t\tQuote: quote,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"error encoding 'orderbook' request: %v\", err)\n\t}\n\terrChan := make(chan error, 1)\n\tresult := new(msgjson.OrderBook)\n\terr = dc.Request(req, func(msg *msgjson.Message) {\n\t\terrChan <- msg.UnmarshalResult(result)\n\t})\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"error subscribing to %s orderbook: %v\", mkt, err)\n\t}\n\terr = extractError(errChan, requestTimeout, msgjson.OrderBookRoute)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tbooky = newBookie(func() { c.unsub(dc, mkt) })\n\terr = booky.Sync(result)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdc.books[mkt] = booky\n\n\treturn booky.book(), booky.feed(), nil\n}", "title": "" }, { "docid": "0721c6469691f9bf692ebb036aee49f0", "score": "0.5047624", "text": "func (z *ZB) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (orderbook.Base, error) {\n\tob, err := orderbook.GetOrderbook(z.GetName(), currency, assetType)\n\tif err != nil {\n\t\treturn z.UpdateOrderbook(currency, assetType)\n\t}\n\treturn ob, nil\n}", "title": "" }, { "docid": "36a9c2553dba65888def7c3898191415", "score": "0.50460726", "text": "func (client *Client) OrderBook() (orders OrderBook, err error) {\n\tendpoint := \"/order_books\"\n\n\tbody, err := client.DoRequest(\"GET\", endpoint, nil)\n\tif err != nil {\n\t\treturn\n\t}\n\n\torders.Raw, err = ioutil.ReadAll(body)\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = json.Unmarshal(orders.Raw, &orders)\n\tif err != nil {\n\t\treturn\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "81e86d08ddb7431278e06514d034e7ea", "score": "0.5035721", "text": "func (c *CachedItem) Copy() db.Product {\n\treturn *c.item\n}", "title": "" }, { "docid": "34e6ecac1c167e6106803c1d40ce49e4", "score": "0.5034229", "text": "func (t *Txn) Get(key []byte) []byte {\n\tentry := &Entry{\n\t\tkey: key,\n\t}\n\tt.reads = append(t.reads, entry)\n\treturn t.store.Get(key)\n}", "title": "" }, { "docid": "4bb290e7d4669703a8489fabb35eeb86", "score": "0.5011848", "text": "func (bk *Book) copyOrders(tp Type, start, end int64) []Order {\n\tswitch tp {\n\tcase Bid:\n\t\tbk.bidMtx.Lock()\n\t\tdefer bk.bidMtx.Unlock()\n\t\tbidLen := int64(len(bk.bidOrders))\n\t\tif end > bidLen {\n\t\t\tend = bidLen\n\t\t}\n\n\t\tvar l int64 = 0\n\t\tif start < end {\n\t\t\tl = end - start\n\t\t}\n\t\torders := make([]Order, 0, l)\n\t\tfor i := start; i < end; i++ {\n\t\t\torders = append(orders, bk.bidOrders[i])\n\t\t}\n\t\treturn orders\n\tcase Ask:\n\t\tbk.askMtx.Lock()\n\t\tdefer bk.askMtx.Unlock()\n\t\tbidLen := int64(len(bk.askOrders))\n\t\tif end > bidLen {\n\t\t\tend = bidLen\n\t\t}\n\n\t\tvar l int64 = 0\n\t\tif start < end {\n\t\t\tl = end - start\n\t\t}\n\t\torders := make([]Order, 0, l)\n\t\tfor i := start; i < end; i++ {\n\t\t\torders = append(orders, bk.askOrders[i])\n\t\t}\n\t\treturn orders\n\tdefault:\n\t\treturn []Order{}\n\t}\n}", "title": "" }, { "docid": "0478c59120c3772d4bdf5ac8aac0e535", "score": "0.5008912", "text": "func (s service) Get(ctx context.Context, id string) (Book, error) {\n\tbook, err := s.repo.Get(ctx, id)\n\tif err != nil {\n\t\treturn Book{}, err\n\t}\n\treturn Book{book}, nil\n}", "title": "" }, { "docid": "b0834df8dabee402cc4740e0bee33b47", "score": "0.5004822", "text": "func (c *Chunk) GetOrderBook(time time.Time) (bid, ask Board, err error) {\n\tbid = nil\n\task = nil\n\n\ttrans_len := len(c.trans)\n\tt := time.UnixNano()\n\n\t// if chunk does not have data\n\tif trans_len == 0 {\n\t\treturn nil, nil, fmt.Errorf(\"chunk have not data %s\", time)\n\t}\n\n\t// check out of chunk time frame(with 100ms allowance)\n\tif t < c.trans[0].Time_stamp-SEC_IN_NS/10 ||\n\t\tc.trans[trans_len-1].Time_stamp+SEC_IN_NS/10 < t {\n\t\treturn nil, nil, fmt.Errorf(\"select outside of chunk timeframe, %s\", time)\n\t}\n\n\t// first setup initial\n\tbid = c.bid_board.copy()\n\task = c.ask_board.copy()\n\n\t// apply transactions until time\n\tfor i := 0; i < trans_len; i++ {\n\t\ttime_stamp := c.trans[i].Time_stamp\n\t\t// TODO: Consider action (execute and board update)\n\t\t// action := c.trans[i].Action\n\n\t\t// exceed time\n\t\tif t < time_stamp {\n\t\t\tbreak\n\t\t}\n\n\t\taction := int(c.trans[i].Action)\n\n\t\tif action == UPDATE_BUY {\n\t\t\tprice := int(c.trans[i].Price)\n\t\t\tvolume := int(c.trans[i].Volume)\n\t\t\tbid.set(price, volume)\n\t\t} else if action == UPDATE_SELL {\n\t\t\tprice := int(c.trans[i].Price)\n\t\t\tvolume := int(c.trans[i].Volume)\n\t\t\task.set(price, volume)\n\t\t}\n\t}\n\n\treturn bid, ask, nil\n}", "title": "" }, { "docid": "0dcb1b000f0e6d8c0b70b7168f1feae8", "score": "0.50019205", "text": "func (stock Storage) get(owner *Player, com *Commodity, quantity int64) (*Crate, error) {\n /* Check if player has any goods stored */\n if crates, ok := stock.Crates[owner]; ok {\n /* Check if player has the desired commodity... */\n if crate, ok := crates[com]; ok {\n /* We have the exact amount! Just return that crate and remove it */\n if crate.Qty == quantity {\n delete(crates, com)\n return crate, nil\n }\n\n /* We have more than required. Split the crate */\n return crate.Take(quantity)\n }\n return nil, CommodityNotFoundError\n }\n return nil, NoPlayerItemsError\n}", "title": "" }, { "docid": "d328439ab72bb9088851e875a335a50b", "score": "0.50003135", "text": "func (d *DB) Get(author string) (*Quote, error) {\n\tq := &Quote{}\n\terr := d.db.View(func(tx *bolt.Tx) error {\n\t\tbucket := tx.Bucket([]byte(quoteBucket))\n\n\t\tif bucket == nil {\n\t\t\treturn errors.Errorf(\"Cannot get %s - bucket %s not found\", author, quoteBucket)\n\t\t}\n\t\tv := bucket.Get([]byte(author))\n\t\tif v == nil {\n\t\t\treturn errors.New(\"can`t fin record\")\n\t\t}\n\t\terr := q.Deserialize(v)\n\t\tif err != nil {\n\t\t\treturn errors.Wrapf(err, \"Get: cannot deserialize %s\", v)\n\t\t}\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Get: DB.View() failed\")\n\t}\n\n\treturn q, nil\n}", "title": "" }, { "docid": "0999fb283c986bcc3048bde3819f9f69", "score": "0.49939033", "text": "func (s *sequence) getCopy() *sequence {\n\tn := &sequence{block: s.block, count: s.count}\n\tpn := n\n\tps := s.next\n\tfor ps != nil {\n\t\tpn.next = &sequence{block: ps.block, count: ps.count}\n\t\tpn = pn.next\n\t\tps = ps.next\n\t}\n\treturn n\n}", "title": "" }, { "docid": "9be10e6bda9bf563be344de7713c4aa4", "score": "0.49934787", "text": "func (o *OKCoin) GetOrderBook(symbol string, size int64, merge bool) (Orderbook, error) {\n\tresp := Orderbook{}\n\tvals := url.Values{}\n\tvals.Set(\"symbol\", symbol)\n\tif size != 0 {\n\t\tvals.Set(\"size\", strconv.FormatInt(size, 10))\n\t}\n\tif merge {\n\t\tvals.Set(\"merge\", \"1\")\n\t}\n\n\tpath := common.EncodeURLValues(o.APIUrl+okcoinDepth, vals)\n\treturn resp, o.SendHTTPRequest(path, &resp)\n}", "title": "" }, { "docid": "8a34c0949911acdf9b8c88a020feddf6", "score": "0.497781", "text": "func (b *ballot) copy() *ballot {\n\treturn &ballot{b.id, b.n}\n}", "title": "" }, { "docid": "b3c3e5bb6add22eb551b9f4e6e3445fb", "score": "0.4971471", "text": "func (ok *Okx) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tif pair.IsEmpty() {\n\t\treturn nil, currency.ErrCurrencyPairEmpty\n\t}\n\tif err := ok.CurrencyPairs.IsAssetEnabled(assetType); err != nil {\n\t\treturn nil, err\n\t}\n\tbook := &orderbook.Base{\n\t\tExchange: ok.Name,\n\t\tPair: pair,\n\t\tAsset: assetType,\n\t\tVerifyOrderbook: ok.CanVerifyOrderbook,\n\t}\n\tvar orderbookNew *OrderBookResponse\n\tvar err error\n\terr = ok.CurrencyPairs.IsAssetEnabled(assetType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar instrumentID string\n\tformat, err := ok.GetPairFormat(assetType, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !pair.IsPopulated() {\n\t\treturn nil, errIncompleteCurrencyPair\n\t}\n\tinstrumentID = format.Format(pair)\n\torderbookNew, err = ok.GetOrderBookDepth(ctx, instrumentID, 400)\n\tif err != nil {\n\t\treturn book, err\n\t}\n\n\torderBookD, err := orderbookNew.GetOrderBookResponseDetail()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbook.Bids = make(orderbook.Items, len(orderBookD.Bids))\n\tfor x := range orderBookD.Bids {\n\t\tbook.Bids[x] = orderbook.Item{\n\t\t\tAmount: orderBookD.Bids[x].BaseCurrencies,\n\t\t\tPrice: orderBookD.Bids[x].DepthPrice,\n\t\t}\n\t}\n\tbook.Asks = make(orderbook.Items, len(orderBookD.Asks))\n\tfor x := range orderBookD.Asks {\n\t\tbook.Asks[x] = orderbook.Item{\n\t\t\tAmount: orderBookD.Asks[x].NumberOfContracts,\n\t\t\tPrice: orderBookD.Asks[x].DepthPrice,\n\t\t}\n\t}\n\terr = book.Process()\n\tif err != nil {\n\t\treturn book, err\n\t}\n\treturn orderbook.Get(ok.Name, pair, assetType)\n}", "title": "" }, { "docid": "da90d837f172c363dac7b06f33e25865", "score": "0.4968632", "text": "func (ob *OrderBook) Book(note *msgjson.BookOrderNote) error {\n\treturn ob.book(note, false)\n}", "title": "" }, { "docid": "df7a977b27d1b5b9566ad2ca33ac89a5", "score": "0.49530554", "text": "func (bp *bytesPooler) get(size int) (payload *bytesPoolItem) {\n\tpayload = bp.sp.Get().(*bytesPoolItem)\n\t// Reset slice length or grow it to requested size for use with copy\n\tif cap(payload.s) >= size {\n\t\tpayload.s = payload.s[:size]\n\t} else {\n\t\tn := size - cap(payload.s)\n\t\tpayload.s = append(payload.s[:cap(payload.s)], make([]byte, n)...)[:size]\n\t}\n\treturn\n}", "title": "" }, { "docid": "ed48a1d740b119e579dd76515dbf2b15", "score": "0.49474168", "text": "func (m *objectMap) retrieveObj(num int) Object {\n\tm.RLock()\n\n\tdefer m.RUnlock()\n\treturn m.store[num]\n}", "title": "" }, { "docid": "c18242055cc9d767bc3323e163ae6ee2", "score": "0.49355838", "text": "func (orderBook *Orderbook) processOrderList(side string, orderList *OrderList, quantityStillToTrade *big.Int, quote map[string]string, verbose bool) (*big.Int, []map[string]string) {\n\tquantityToTrade := CloneBigInt(quantityStillToTrade)\n\t// quantityToTrade := quantityStillToTrade\n\tvar trades []map[string]string\n\t// speedup the comparison, do not assign because it is pointer\n\tzero := Zero()\n\t// var watchDog = 0\n\t// fmt.Printf(\"CMP problem :%t - %t\\n\", quantityToTrade.Cmp(Zero()) > 0, IsGreaterThan(quantityToTrade, Zero()))\n\tfor orderList.Item.Length > 0 && quantityToTrade.Cmp(zero) > 0 {\n\n\t\theadOrder := orderList.GetOrder(orderList.Item.HeadOrder)\n\t\t// fmt.Printf(\"Head :%s ,%s\\n\", new(big.Int).SetBytes(orderList.Item.HeadOrder), orderBook.Asks.MinPriceList().String(0))\n\t\tif headOrder == nil {\n\t\t\tpanic(\"headOrder is null\")\n\t\t\t// return Zero(), trades\n\t\t}\n\n\t\ttradedPrice := CloneBigInt(headOrder.Item.Price)\n\n\t\tvar newBookQuantity *big.Int\n\t\tvar tradedQuantity *big.Int\n\n\t\tif IsStrictlySmallerThan(quantityToTrade, headOrder.Item.Quantity) {\n\t\t\ttradedQuantity = CloneBigInt(quantityToTrade)\n\t\t\t// Do the transaction\n\t\t\tnewBookQuantity = Sub(headOrder.Item.Quantity, quantityToTrade)\n\t\t\theadOrder.UpdateQuantity(orderList, newBookQuantity, headOrder.Item.Timestamp)\n\t\t\tquantityToTrade = Zero()\n\n\t\t} else if IsEqual(quantityToTrade, headOrder.Item.Quantity) {\n\t\t\ttradedQuantity = CloneBigInt(quantityToTrade)\n\t\t\tif side == Bid {\n\t\t\t\t// orderBook.Bids.RemoveOrderByID(headOrder.Key)\n\t\t\t\torderBook.Bids.RemoveOrder(headOrder)\n\t\t\t} else {\n\t\t\t\t// orderBook.Asks.RemoveOrderByID(headOrder.Key)\n\t\t\t\torderBook.Asks.RemoveOrder(headOrder)\n\t\t\t}\n\t\t\tquantityToTrade = Zero()\n\n\t\t} else {\n\t\t\ttradedQuantity = CloneBigInt(headOrder.Item.Quantity)\n\t\t\tif side == Bid {\n\t\t\t\t// orderBook.Bids.RemoveOrderByID(headOrder.Key)\n\t\t\t\torderBook.Bids.RemoveOrder(headOrder)\n\t\t\t} else {\n\t\t\t\t// orderBook.Asks.RemoveOrderByID(headOrder.Key)\n\t\t\t\t// fmt.Printf(\"\\nBEFORE : %s\\n\\n\", orderList.String(0))\n\t\t\t\t// orderList, _ = orderBook.Asks.RemoveOrder(headOrder)\n\t\t\t\torderBook.Asks.RemoveOrderFromOrderList(headOrder, orderList)\n\t\t\t\t// fmt.Println(\"AFTER DELETE\", orderList.String(0))\n\t\t\t\t// fmt.Printf(\"\\nAFTER : %x, %s\\n\\n\", orderList.Item.HeadOrder, orderList.String(0))\n\t\t\t}\n\t\t}\n\n\t\tif verbose {\n\t\t\tfmt.Printf(\"TRADE: Timestamp - %d, Price - %s, Quantity - %s, TradeID - %s, Matching TradeID - %s\\n\",\n\t\t\t\torderBook.Item.Timestamp, tradedPrice, tradedQuantity, headOrder.Item.TradeID, quote[\"trade_id\"])\n\t\t\t// fmt.Println(headOrder)\n\t\t\t// watchDog++\n\t\t\t// if watchDog > 10 {\n\t\t\t// panic(\"stop\")\n\t\t\t// }\n\n\t\t}\n\n\t\ttransactionRecord := make(map[string]string)\n\t\ttransactionRecord[\"timestamp\"] = strconv.FormatUint(orderBook.Item.Timestamp, 10)\n\t\ttransactionRecord[\"price\"] = tradedPrice.String()\n\t\ttransactionRecord[\"quantity\"] = tradedQuantity.String()\n\n\t\ttrades = append(trades, transactionRecord)\n\t}\n\treturn quantityToTrade, trades\n}", "title": "" }, { "docid": "25ab7bdfb7ddded3fdc6572057e509d8", "score": "0.4933881", "text": "func get(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {\n\t// Here is the algorithm. The first parameter is the has of the document for which we're searching\n\t// provenance. Once we get that, we check if it is an ODD, or not. If it is an ODD, we keep\n\t// searching until finding the top\n\thasfOfObj := args[0]\n\tlog.Printf(\"Searching %v\", hasfOfObj)\n\tlog.Print(\"Getting the state\")\n\tvalue, err := stub.GetState(hasfOfObj)\n\n\tif err != nil {\n\t\tlog.Printf(\"Failed to get the document %s with error: %s\", args[0], err)\n\t\treturn []byte(\"\"), fmt.Errorf(\"Failed to get document: %s with error: %s\", args[0], err)\n\t}\n\tif value == nil {\n\t\tlog.Printf(\"I don't find the hash... returning an error\")\n\t\treturn []byte(\"\"), fmt.Errorf(\"Hash not found: %v\", args[0])\n\t}\n\tlog.Printf(\"Found it, now adding history (if any)\")\n\tbase64encodedValue := base64.StdEncoding.EncodeToString([]byte(value))\n\n\tlog.Printf(\"Obtained state %v %v\", value, base64encodedValue)\n\n\thist, erra := getHistoricalState(hasfOfObj, stub)\n\tif erra != nil {\n\t\tlog.Println(\"No history found, got an error (but going anyway). Arg is: %s error is %s\", args[0], erra)\n\t\t//return []byte(\"\"), fmt.Errorf(\"Failed to get history: %s error is %s\", args[0], erra)\n\t}\n\n\tlog.Printf(\"Before Returning\")\n\n\tvar buffer bytes.Buffer\n\tbuffer.WriteString(\"{ \\\"Original\\\" : \")\n\tbuffer.WriteString(\"\\\"\")\n\tbuffer.WriteString(base64encodedValue)\n\tbuffer.WriteString(\"\\\"\")\n\t\n\tbuffer.WriteString(\",\")\n\tbuffer.WriteString(\" \\\"History\\\" : \")\n\tbuffer.WriteString(hist)\n\t\n\tbuffer.WriteString(\"}\")\n\n\treturnedString := buffer.String()\n\tlog.Printf(\"Returned values to be marshalled as string are: %s\", returnedString)\n\n\t\n\n\tdstByte := make([]byte, base64.StdEncoding.EncodedLen(buffer.Len()))\n\tlog.Printf(\"dstByte is: %v and %v\", len(dstByte), buffer.Len())\n\tbase64.StdEncoding.Encode(dstByte, buffer.Bytes())\n\treturn dstByte, nil\n}", "title": "" }, { "docid": "ffa6d8d73119170b5f3021255fdefb8d", "score": "0.49240983", "text": "func (s *LendingOrderBookService) GetLendingOrderBook(term uint64, lendingToken common.Address) (*types.LendingOrderBook, error) {\n\tborrow, lend, err := s.lendingOrderDao.GetLendingOrderBook(term, lendingToken)\n\tif err != nil {\n\t\tlogger.Error(err)\n\t\treturn nil, err\n\t}\n\n\tob := &types.LendingOrderBook{\n\t\tName: utils.GetLendingOrderBookChannelID(term, lendingToken),\n\t\tLend: lend,\n\t\tBorrow: borrow,\n\t}\n\n\treturn ob, nil\n}", "title": "" }, { "docid": "58a3b4d8f85fcefbdca1ff4935898f9f", "score": "0.49224588", "text": "func (c *myClient) Get(ctx context.Context, key client.ObjectKey, out runtime.Object) error {\n\tobj, ok := c.db[key.String()]\n\tif !ok {\n\t\treturn errors.New(\"object not found\")\n\t}\n\tobj = obj.(runtime.Object).DeepCopyObject()\n\toutVal := reflect.ValueOf(out)\n\tobjVal := reflect.ValueOf(obj)\n\treflect.Indirect(outVal).Set(reflect.Indirect(objVal))\n\treturn nil\n}", "title": "" }, { "docid": "0a0818792e163e37c603e2bd3ae37317", "score": "0.49131775", "text": "func (l *list) getRecord(key string) types.Record {\n\t// create new item\n\tcurrentI, loaded := l.items.Load(key)\n\tif !loaded {\n\t\treturn nil\n\t}\n\n\tcurrent := currentI.(*listItem)\n\tcurrent.lock.Lock()\n\tdefer current.lock.Unlock()\n\treturn current.r\n}", "title": "" }, { "docid": "7e0dcfbd373e8635612588579a7de654", "score": "0.49081534", "text": "func (depthBook *DepthBook) Copy() *DepthBook {\n\titemList := make([]DepthBookItem, 0, len(depthBook.Items))\n\titemList = append(itemList, depthBook.Items...)\n\treturn &DepthBook{Items: itemList}\n}", "title": "" }, { "docid": "1ca6ef27a9b5c328e3a9db9e633fa6d9", "score": "0.4887301", "text": "func (m MemPoolTxsDesc) get() []*MemPoolTx {\n\treturn m\n}", "title": "" }, { "docid": "9b152475788ee18dac0d323bd13e9fd5", "score": "0.48807606", "text": "func OrderBookList(base, rel, maxentries, sortby string) []OrderData {\n\tvar orderList []OrderData\n\n\tappName := kmdgo.AppType(DexP2pChain)\n\n\tvar obook kmdgo.DEXOrderbook\n\n\targs := make(kmdgo.APIParams, 4)\n\t// maxentries eg. \"10\"\n\targs[0] = maxentries\n\t// minpriority\n\targs[1] = \"0\"\n\t// tagA/Base eg. \"KMD\"\n\targs[2] = base\n\t// tagB/Rel eg. \"DEX\"\n\targs[3] = rel\n\t// fmt.Println(args)\n\n\t// Debug outputs\n\tfmt.Println(\"compiled command is:\")\n\tfmt.Println(\"dex-cli DEX_orderbook\", maxentries, args[1], base, rel, \" | jq .asks\")\n\tfmt.Println(`\n\tfrom Asks :-\n\tbuying = ` + base + `\n\tselling = ` + rel + `\n\n\tfrom Bids :-\n\tbuying = ` + rel + `\n\tselling = ` + base + `\n\t`)\n\n\tobook, err := appName.DEXOrderbook(args)\n\tif err != nil {\n\t\tfmt.Printf(\"Code: %v\\n\", obook.Error.Code)\n\t\tfmt.Printf(\"Message: %v\\n\\n\", obook.Error.Message)\n\t\t// log.Fatalln(\"Err happened\", err)\n\t}\n\n\tfor _, v := range obook.Result.Asks {\n\t\thandle, pubkey, auth := GetHandle(v.Pubkey)\n\t\t// fmt.Println(handle)\n\t\t// fmt.Println(pubkey)\n\t\t// fmt.Println(auth)\n\n\t\tvar unixTime int64 = int64(v.Timestamp)\n\t\tt := time.Unix(unixTime, 0)\n\t\t// fmt.Println(\"t\", t)\n\t\tstrDate := t.Format(time.UnixDate)\n\t\t// fmt.Println(strDate)\n\n\t\torderList = append(orderList, OrderData{\n\t\t\tPrice: v.Price,\n\t\t\t// MaxVolume: v.Relamount,\n\t\t\tMaxVolume: v.Baseamount,\n\t\t\tDexPubkey: v.Pubkey,\n\t\t\tBase: obook.Result.Rel,\n\t\t\tRel: obook.Result.Base,\n\t\t\tOrderID: v.ID,\n\t\t\tTimestampStr: strDate,\n\t\t\tTimestamp: IntToString(int32(v.Timestamp)),\n\t\t\tHandle: handle,\n\t\t\tPubkey: pubkey,\n\t\t\tAuthorized: auth,\n\t\t})\n\t}\n\n\tsort.Slice(orderList, func(i, j int) bool {\n\t\treturn orderList[i].Authorized\n\t})\n\n\t// Sort by the soon to expire orders\n\tif sortby == \"soon\" {\n\t\tsort.Slice(orderList, func(i, j int) bool {\n\t\t\treturn orderList[i].Timestamp < orderList[j].Timestamp\n\t\t})\n\t}\n\t// Sort by the late to expire orders\n\tif sortby == \"late\" {\n\t\tsort.Slice(orderList, func(i, j int) bool {\n\t\t\treturn orderList[i].Timestamp > orderList[j].Timestamp\n\t\t})\n\t}\n\n\t// TODO\n\t// Sort by low/high price\n\t// Sort by Maxvolume\n\t// Sort by authorised pubkeys first\n\t// Sort by autorhised pubkeys first + other sorted formats\n\n\t// fmt.Println(orderList)\n\treturn orderList\n}", "title": "" }, { "docid": "e3f7f650256f2267c8d99cc2370f24e8", "score": "0.4864463", "text": "func (c *Controller) ListOrderBook() ([]byte, error) {\n\tc.mutex.Lock()\n\tgroups := c.db.GetOrdersByType()\n\torderBook := OrderBook{}\n\tif sellorders, ok := (*groups)[types.SellOrder]; ok {\n\t\tsort.Slice(sellorders, func(i, j int) bool {\n\n\t\t\tif sellorders[i].Order.Price < sellorders[j].Order.Price {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t})\n\n\t\tsellorders = sellorders[:min(10, len(sellorders))]\n\t\torderBook.LowestSellOrders = sellorders\n\t}\n\tif buyOrders, ok := (*groups)[types.BuyOrder]; ok {\n\n\t\tsort.Slice(buyOrders, func(i, j int) bool {\n\n\t\t\tif buyOrders[i].Order.Price > buyOrders[j].Order.Price {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t})\n\t\tbuyOrders = buyOrders[:min(10, len(buyOrders))]\n\t\torderBook.HighestBuyOrders = buyOrders\n\t}\n\tc.mutex.Unlock()\n\tresponse, err := json.Marshal(orderBook)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response, nil\n\n}", "title": "" }, { "docid": "0ea0556fcf57601e5b5128e96eebeed6", "score": "0.48635396", "text": "func get() AnObject {\n\tpq, err := goque.OpenQueue(dirName)\n\tif err != nil {\n\t\tlog.Panicln(\"Error opening queue\", err)\n\t}\n\tdefer pq.Close()\n\n\titem, err := pq.Peek()\n\tif err != nil {\n\t\tlog.Panicln(\"Error peeking in queue\", err)\n\t}\n\n\titem, err = pq.Dequeue()\n\tif err != nil {\n\t\tlog.Panicln(\"Error peeking in queue\", err)\n\t}\n\n\tvar obj MyObject\n\terr = item.ToObject(&obj)\n\treturn &obj\n}", "title": "" }, { "docid": "4532767a20d9345e4eb28a589cdf0d49", "score": "0.48606053", "text": "func (b Get) Clone() Get {\n\tclone := make(Get, len(b), len(b))\n\tcopy(clone, b)\n\treturn clone\n}", "title": "" }, { "docid": "ac563164ffa8862125c53a2986e55cfb", "score": "0.48581892", "text": "func (b *BTSE) FetchOrderBookL2(ctx context.Context, symbol string, depth int) (*Orderbook, error) {\n\tvar o Orderbook\n\turlValues := url.Values{}\n\turlValues.Add(\"symbol\", symbol)\n\turlValues.Add(\"depth\", strconv.FormatInt(int64(depth), 10))\n\tendpoint := common.EncodeURLValues(btseOrderbook+\"/L2\", urlValues)\n\treturn &o, b.SendHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, endpoint, &o, true, queryFunc)\n}", "title": "" }, { "docid": "423b873bb2e24a041f9ca05a9e865bb9", "score": "0.48456654", "text": "func (e *Gdax) OrderBook(from, to string) (*cryptomarkets.OrderBook, error) {\n\treturn nil, errors.New(\"unimplemented\")\n}", "title": "" }, { "docid": "edc39c406f32951a617202add3f35b42", "score": "0.48452115", "text": "func (book *Book) GetByClientID(id uuid.UUID) *Order {\n\tbook.Mutex.Lock()\n\tfor _, o := range book.List {\n\t\tif o.ClientID == id {\n\t\t\tbook.Mutex.Unlock()\n\t\t\treturn o\n\t\t}\n\t}\n\tbook.Mutex.Unlock()\n\treturn nil\n}", "title": "" }, { "docid": "7063768b203c0309d0b38adfdabee12a", "score": "0.48342317", "text": "func (k *Kraken) GetDepth(symbol string) (Orderbook, error) {\n\tvalues := url.Values{}\n\tvalues.Set(\"pair\", symbol)\n\n\tvar result interface{}\n\tvar ob Orderbook\n\tpath := fmt.Sprintf(\"%s/%s/public/%s?%s\", KRAKEN_API_URL, KRAKEN_API_VERSION, KRAKEN_DEPTH, values.Encode())\n\terr := common.SendHTTPGetRequest(path, true, k.Verbose, &result)\n\n\tif err != nil {\n\t\treturn ob, err\n\t}\n\n\tdata := result.(map[string]interface{})\n\torderbookData := data[\"result\"].(map[string]interface{})\n\n\tvar bidsData []interface{}\n\tvar asksData []interface{}\n\tfor _, y := range orderbookData {\n\t\tyData := y.(map[string]interface{})\n\t\tbidsData = yData[\"bids\"].([]interface{})\n\t\tasksData = yData[\"asks\"].([]interface{})\n\t}\n\n\tprocessOrderbook := func(data []interface{}) ([]OrderbookBase, error) {\n\t\tvar result []OrderbookBase\n\t\tfor x := range data {\n\t\t\tentry := data[x].([]interface{})\n\n\t\t\tprice, err := strconv.ParseFloat(entry[0].(string), 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tamount, err := strconv.ParseFloat(entry[1].(string), 64)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tresult = append(result, OrderbookBase{Price: price, Amount: amount})\n\t\t}\n\t\treturn result, nil\n\t}\n\n\tob.Bids, err = processOrderbook(bidsData)\n\tif err != nil {\n\t\treturn ob, err\n\t}\n\n\tob.Asks, err = processOrderbook(asksData)\n\tif err != nil {\n\t\treturn ob, err\n\t}\n\n\treturn ob, nil\n}", "title": "" }, { "docid": "aa32e6d441ed213808c6f93ed6ce45b3", "score": "0.4831537", "text": "func (ob *OrderBook) unbook(note *msgjson.UnbookOrderNote, cached bool) error {\n\tif ob.marketID != note.MarketID {\n\t\treturn fmt.Errorf(\"invalid note market id %s\", note.MarketID)\n\t}\n\n\tif !cached {\n\t\t// Cache the note if the order book is not synced.\n\t\tif !ob.isSynced() {\n\t\t\treturn ob.cacheOrderNote(msgjson.UnbookOrderRoute, note)\n\t\t}\n\t}\n\n\tob.setSeq(note.Seq)\n\n\tif len(note.OrderID) != order.OrderIDSize {\n\t\treturn fmt.Errorf(\"expected order id length of %d, got %d\",\n\t\t\torder.OrderIDSize, len(note.OrderID))\n\t}\n\n\tvar oid order.OrderID\n\tcopy(oid[:], note.OrderID)\n\n\torder, ok := ob.orders[oid]\n\tif !ok {\n\t\treturn fmt.Errorf(\"no order found with id %s\", oid.String())\n\t}\n\n\t// Remove the order from its associated book side.\n\tswitch order.Side {\n\tcase msgjson.BuyOrderNum:\n\t\terr := ob.buys.Remove(order)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase msgjson.SellOrderNum:\n\t\terr := ob.sells.Remove(order)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown order side provided: %d\", order.Side)\n\t}\n\n\tob.ordersMtx.Lock()\n\tdelete(ob.orders, oid)\n\tob.ordersMtx.Unlock()\n\n\treturn nil\n}", "title": "" }, { "docid": "8a53995526193fc7a70ff8bcb8dc95bf", "score": "0.48281568", "text": "func (c *BookClient) Get(ctx context.Context, id int) (*Book, error) {\n\treturn c.Query().Where(book.ID(id)).Only(ctx)\n}", "title": "" }, { "docid": "0ed52178a404101f293a57e6bf561fdd", "score": "0.48200127", "text": "func (o *Order) GetItem(orderID string) (*models.Order, error) {\n\treturn o.OrderRepository.Get(orderID)\n}", "title": "" }, { "docid": "873964a13db34c6b731061401e8b900f", "score": "0.48192635", "text": "func (c *Client) OrderBook(symbol Symbol, limit int) (*OrderBook, error) {\n\tproxy := &orderBookProxy{}\n\n\terr := c.publicGet(proxy, \"/api/v1/depth\",\n\t\tparam(\"symbol\", symbol.UpperCase()),\n\t\tparam(\"limit\", limit),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn proxy.real()\n}", "title": "" }, { "docid": "6328f540f68090ee2a83e9fb36a72797", "score": "0.48153225", "text": "func GetBook(c *fiber.Ctx) {\n\tc.Send(\"All Books\")\n}", "title": "" }, { "docid": "b614c7e2b945abb90060f6aa4073291e", "score": "0.48112458", "text": "func NewBook() Book {\n var people []Person\n people = append(people, Person {\n ID: \"1\",\n FirstName: \"Ed\",\n LastName: \"Yablonsky\",\n Address: &Address {\n City: \"Odesa\",\n },\n })\n people = append(people, Person { ID: \"2\" })\n people = append(people, Person { ID: \"3\" })\n return Book { People: people }\n}", "title": "" }, { "docid": "2313f1330bdd23230ede9fcf51908ec6", "score": "0.48054102", "text": "func (e *Exchange) Books() (*Books, error) {\n\tvar books Books\n\tif err := e.get(\"/api/order_books\", &books); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &books, nil\n}", "title": "" }, { "docid": "4e0b80b529c8451d6d70e36c65db02c7", "score": "0.4798309", "text": "func (book *Book) GetByPrice(price Price) *Order {\n\tbook.Mutex.Lock()\n\tfor _, o := range book.List {\n\t\tsame, err := o.Price.Equals(price)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif same {\n\t\t\tbook.Mutex.Unlock()\n\t\t\treturn o\n\t\t}\n\t}\n\tbook.Mutex.Unlock()\n\treturn nil\n}", "title": "" }, { "docid": "23f600ab03d0b0da8844a06d8aab10e3", "score": "0.4785925", "text": "func getHistory(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\ttype Oship struct{\n\t\tId string \t`json:\"id\"`\n\t\tOwnerId string `json:\"ownerid\"`\n\t}\n\ttype AuditHistory struct {\n\t\tTxId string `json:\"txId\"`\n\t\tValue Oship `json:\"value\"`\n\t}\n\tvar history []AuditHistory\n\tvar marble Oship\n\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 1\")\n\t}\n\n\tmarbleId := args[0]\n\tfmt.Printf(\"- start getHistoryForMarble: %s\\n\", marbleId)\n\n\t// Get History\n\tresultsIterator, err := stub.GetHistoryForKey(marbleId)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdefer resultsIterator.Close()\n\n\tfor resultsIterator.HasNext() {\n\t\thistoryData, err := resultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn shim.Error(err.Error())\n\t\t}\n\n\t\tvar tx AuditHistory\n\t\ttx.TxId = historyData.TxId //copy transaction id over\n\t\tjson.Unmarshal(historyData.Value, &marble) //un stringify it aka JSON.parse()\n\t\tif historyData.Value == nil { //marble has been deleted\n\t\t\tvar emptyMarble Oship\n\t\t\ttx.Value = emptyMarble //copy nil marble\n\t\t} else {\n\t\t\tjson.Unmarshal(historyData.Value, &marble) //un stringify it aka JSON.parse()\n\t\t\ttx.Value = marble //copy marble over\n\t\t}\n\t\thistory = append(history, tx) //add this tx to the list\n\t}\n\tfmt.Printf(\"- getHistoryForMarble returning:\\n%s\", history)\n\n\t//change to array of bytes\n\thistoryAsBytes, _ := json.Marshal(history) //convert to array of bytes\n\treturn shim.Success(historyAsBytes)\n}", "title": "" }, { "docid": "dd63c5c8167aac2b76330e5915c14d25", "score": "0.47724098", "text": "func (i Invoice) Clone() channel.Data {\n\treturn &i\n}", "title": "" }, { "docid": "b0de55c152f961e84ba63a7aa79f4d33", "score": "0.47709197", "text": "func (cl *Client) GetOrderBook(ctx context.Context, req *GetOrderBookRequest) (*GetOrderBookResponse, error) {\n\tvar res GetOrderBookResponse\n\terr := cl.do(ctx, \"GET\", \"/api/1/orderbook_top\", req, &res, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &res, nil\n}", "title": "" }, { "docid": "c65585335ec4b458dac8815e5d8ca6ee", "score": "0.47691286", "text": "func (clnt *Client) getObjectDirect(policy *BasePolicy, key *Key, rval *reflect.Value) error {\n\tpolicy = clnt.getUsablePolicy(policy)\n\n\tbinNames := objectMappings.getFields(rval.Type())\n\tcommand, err := newReadCommand(clnt.cluster, policy, key, binNames, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcommand.object = rval\n\treturn command.Execute()\n}", "title": "" }, { "docid": "9f7abb4ff9aaeef931d537679f9fd389", "score": "0.47663254", "text": "func getBooks() {\n\tbooks = db.Books()\n}", "title": "" }, { "docid": "407005fe2b8ecce052d35765038e7a50", "score": "0.47653592", "text": "func (b *Bitstamp) UpdateOrderbook(ctx context.Context, p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {\n\tif p.IsEmpty() {\n\t\treturn nil, currency.ErrCurrencyPairEmpty\n\t}\n\tif err := b.CurrencyPairs.IsAssetEnabled(assetType); err != nil {\n\t\treturn nil, err\n\t}\n\tbook := &orderbook.Base{\n\t\tExchange: b.Name,\n\t\tPair: p,\n\t\tAsset: assetType,\n\t\tVerifyOrderbook: b.CanVerifyOrderbook,\n\t}\n\tfPair, err := b.FormatExchangeCurrency(p, assetType)\n\tif err != nil {\n\t\treturn book, err\n\t}\n\n\torderbookNew, err := b.GetOrderbook(ctx, fPair.String())\n\tif err != nil {\n\t\treturn book, err\n\t}\n\n\tbook.Bids = make(orderbook.Items, len(orderbookNew.Bids))\n\tfor x := range orderbookNew.Bids {\n\t\tbook.Bids[x] = orderbook.Item{\n\t\t\tAmount: orderbookNew.Bids[x].Amount,\n\t\t\tPrice: orderbookNew.Bids[x].Price,\n\t\t}\n\t}\n\n\tfilterOrderbookZeroBidPrice(book)\n\n\tbook.Asks = make(orderbook.Items, len(orderbookNew.Asks))\n\tfor x := range orderbookNew.Asks {\n\t\tbook.Asks[x] = orderbook.Item{\n\t\t\tAmount: orderbookNew.Asks[x].Amount,\n\t\t\tPrice: orderbookNew.Asks[x].Price,\n\t\t}\n\t}\n\n\terr = book.Process()\n\tif err != nil {\n\t\treturn book, err\n\t}\n\treturn orderbook.Get(b.Name, fPair, assetType)\n}", "title": "" } ]
e2e756bd16dac2b709b2cf0b11f3f44b
GetVersion is doing ...
[ { "docid": "321c2500df54caa9b3a54d25aba7660d", "score": "0.0", "text": "func (r HandlerVersion) GetVersion(w http.ResponseWriter, req *http.Request) {\n\n\trequest := \"some random request from http\"\n\tresultFromLogic := r.LogicVersion.GetVersion(request)\n\tresult, err := json.Marshal(resultFromLogic)\n\tif err != nil {\n\t\tio.WriteString(w, \"error-ed7869c4: some error\")\n\t\treturn\n\t}\n\n\tio.WriteString(w, string(result))\n}", "title": "" } ]
[ { "docid": "bcf36bc79b31a6343227abc30d64a858", "score": "0.6801295", "text": "func Version() {}", "title": "" }, { "docid": "33dd70df8b0a9fdaae30199a28255596", "score": "0.6758502", "text": "func (wrapper Wrapper) GetVersion() (uint32, uint32, uint32, error) {\n\tvar major C.uint32_t\n\tvar minor C.uint32_t\n\tvar micro C.uint32_t\n\treturnValue := C.CCall_libmc_getversion(wrapper.LibraryHandle, &major, &minor, &micro)\n\tif returnValue != 0 {\n\t\treturn 0, 0, 0, makeError(uint32(returnValue))\n\t}\n\treturn uint32(major), uint32(minor), uint32(micro), nil\n}", "title": "" }, { "docid": "77af3db77bd63f2b91e8baa2d459d194", "score": "0.67243373", "text": "func (l *Libvirt) Version() (string, error) {\n\tresp, err := l.send(libvirt.RemoteProcConnectGetLibVersion, 0, libvirt.MessageTypeCall, libvirt.RemoteProgram, libvirt.MessageStatusOK, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tr := <-resp\n\tif r.Header.Status != libvirt.MessageStatusOK {\n\t\treturn \"\", decodeError(r.Payload)\n\t}\n\n\tresult := struct {\n\t\tVersion uint64\n\t}{}\n\n\tdec := xdr.NewDecoder(bytes.NewReader(r.Payload))\n\t_, err = dec.Decode(&result)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// The version is provided as an int following this formula:\n\t// version * 1,000,000 + minor * 1000 + micro\n\t// See src/libvirt-host.c # virConnectGetLibVersion\n\tmajor := result.Version / 1000000\n\tresult.Version %= 1000000\n\tminor := result.Version / 1000\n\tresult.Version %= 1000\n\tmicro := result.Version\n\n\tversionString := fmt.Sprintf(\"%d.%d.%d\", major, minor, micro)\n\treturn versionString, nil\n}", "title": "" }, { "docid": "b8e8b4f7f01995ed9fb6d0203f61306c", "score": "0.6717921", "text": "func (m *msg) getVersion() int {\n\treturn int((m.LiVnMode >> 3) & 0x07)\n}", "title": "" }, { "docid": "797a9916fbac88bf64645d1d25e1eed2", "score": "0.6668944", "text": "func (s *ScribeHandler) GetVersion(ctx context.Context) (r string, err error) {\n return \"0.0.1\", nil\n}", "title": "" }, { "docid": "3f44f1711c13975337731f0116a5a669", "score": "0.6650968", "text": "func (d *Clock) Version() (ver uint16) {\n return 0\n}", "title": "" }, { "docid": "c94bb5b08d4f6d60768232d78f596d8d", "score": "0.66218495", "text": "func Version() string", "title": "" }, { "docid": "741b1e9e80bcba48ce8a6e9191f1936b", "score": "0.6619727", "text": "func (u *Device) GetVersion() (int, int, error) {\n\tiver, irls, err := u.sepgGetVersion()\n\treturn iver, irls, err\n}", "title": "" }, { "docid": "ceba87e397a26808f6698e063dcf83e4", "score": "0.660153", "text": "func GetVersion(response []byte) (int, error) {\n\tif len(response) < C.crypto_box_MACBYTES {\n\t\treturn -1, ErrResponseMACLength\n\t}\n\n\theader := response[0:4]\n\thex := strings.ToUpper(hex.EncodeToString(header))\n\n\tif hex == \"DE259002\" {\n\t\treturn 2, nil\n\t}\n\n\treturn 1, nil\n}", "title": "" }, { "docid": "a20c96bd8b26d3b56b42f32837b9c702", "score": "0.65685296", "text": "func Version() (major int, minor int, rev int) {\n\tv := C.MikMod_GetVersion()\n\trev = int(v & 0xFF)\n\tminor = int((v >> 8) & 0xFF)\n\tmajor = int((v >> 16) & 0xFF)\n\treturn\n}", "title": "" }, { "docid": "70eef13cb74b1fe04d958ab1cd9f689b", "score": "0.6539285", "text": "func (m *DeviceConfigurationState) GetVersion()(*int32) {\n return m.version\n}", "title": "" }, { "docid": "ab8d5c273ecc886f846ab9181099e62e", "score": "0.6508291", "text": "func getVersion(agentInstall DotNetAgentInstall) (result tasks.Result) {\n\n\tagentVersion, err := tasks.GetFileVersion(agentInstall.AgentPath)\n\n\tif err != nil {\n\t\tlog.Info(\"Error finding .Net Agent version. The error is \", err)\n\t\treturn tasks.Result{\n\t\t\tStatus: tasks.Error,\n\t\t\tSummary: \"Error finding .Net Agent version\",\n\t\t}\n\t}\n\treturn tasks.Result{\n\t\tStatus: tasks.Info,\n\t\tSummary: agentVersion,\n\t\tPayload: agentVersion,\n\t}\n}", "title": "" }, { "docid": "7cc8ae49dccd82a65cfd99b708bfc6f1", "score": "0.6457246", "text": "func getVersion(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\tfuncName := getFunctionName()\n\tlogger.Info(\"-------- \" + funcName + \" --------\")\n\t// Get the cc version from the ledger\n\tversion, err := stub.GetState(VERSION)\n\tif err != nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"\" + funcName + \" - Failed to get state for \" + VERSION + \"\\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\tif version == nil {\n\t\tjsonResp := \"{\\\"Error\\\":\\\"\" + funcName + \" : \" + VERSION + \" is nil \\\"}\"\n\t\treturn shim.Error(jsonResp)\n\t}\n\n\tjsonResp := \"{\\\"Version\\\":\\\"\" + string(version) + \"\\\"}\"\n\tlogger.Infof(\"Query Response:%s\\n\", jsonResp)\n\treturn shim.Success(version)\n}", "title": "" }, { "docid": "f1167494b851355b6957492c8a5f11f4", "score": "0.64373714", "text": "func GetVersion() Version {\n\tvar cMajor C.uint16_t\n\tvar cMinor C.uint16_t\n\tC.manager_getVersion(&cMajor, &cMinor)\n\treturn Version{\n\t\tMajor: int(cMajor),\n\t\tMinor: int(cMinor),\n\t}\n}", "title": "" }, { "docid": "9b293d126dfbe79906b55f922525782b", "score": "0.64180756", "text": "func getVer() (int, error) {\n\tcmd := exec.Command(\"cmd\", \"ver\")\n\tvar out bytes.Buffer\n\tvar stderr bytes.Buffer\n\tcmd.Stdout = &out\n\tcmd.Stderr = &stderr\n\terr := cmd.Run()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tosStr := strings.Replace(out.String(), \"\\n\", \"\", -1)\n\tosStr = strings.Replace(osStr, \"\\r\\n\", \"\", -1)\n\ttmp1 := strings.Index(osStr, \"[Version\")\n\ttmp2 := strings.Index(osStr, \"]\")\n\tif tmp1 == -1 || tmp2 == -1 {\n\t\treturn 0, errors.New(\"version string has wrong format\")\n\t}\n\tlongVer := osStr[tmp1+9 : tmp2]\n\tmajorVerStr := strings.SplitN(longVer, \".\", 2)[0]\n\tmajorVerInt, err := strconv.Atoi(majorVerStr)\n\tif err != nil {\n\t\treturn 0, errors.New(\"version could not be converted to int\")\n\t}\n\treturn majorVerInt, nil\n}", "title": "" }, { "docid": "d880a88a21ffa93bb40561ecb0b50245", "score": "0.6398471", "text": "func (m *ManagedDeviceMobileAppConfiguration) GetVersion()(*int32) {\n return m.version\n}", "title": "" }, { "docid": "871100c07020a1327dc2162b83fb1004", "score": "0.6361545", "text": "func (ts *ServerTestSuite) TestGetVersion() {\n\tts.server.cfg.GitHash = \"5af68a50e445db0d8283beda71a5d279f04aa0c4\"\n\tts.server.cfg.BuildTime = \"2019-04-12T19:47:05Z\"\n\tts.server.cfg.Version = \"0.0.1\"\n\n\t// missing URL\n\tobj := ts.expect.GET(\"/versionMissing\").\n\t\tExpect().Status(http.StatusNotFound).JSON().Object()\n\tobj.Schema(&ErrorResponse{})\n\tobj.Path(`$.error`).String().\n\t\tContains(\"not found\")\n\n\t// not GET\n\tobj = ts.expect.POST(\"/version\").\n\t\tExpect().Status(http.StatusMethodNotAllowed).JSON().Object()\n\tobj.Schema(&ErrorResponse{})\n\tobj.Path(`$.error`).String().\n\t\tContains(\"method not allowed\")\n\n\t// positive case\n\tobj = ts.expect.\n\t\tGET(\"/version\").\n\t\tExpect().\n\t\tStatus(http.StatusOK).\n\t\tJSON().Object()\n\n\tobj.Path(`$.gitHash`).String().Equal(ts.server.cfg.GitHash)\n\tobj.Path(`$.buildTime`).String().Equal(ts.server.cfg.BuildTime)\n\tobj.Path(`$.version`).String().Equal(ts.server.cfg.Version)\n}", "title": "" }, { "docid": "a896d6edabf90090a3205bd9a7c78d64", "score": "0.6348259", "text": "func (conn *Conn) Version() (string, error) {\n\tvar version string\n\trespFunc := func(respType, data string) error {\n\t\tif respType == \"D\" {\n\t\t\tversion = data\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tconn.mu.Lock()\n\tdefer conn.mu.Unlock()\n\n\tif err := conn.Raw(respFunc, \"GETINFO version\"); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn version, nil\n}", "title": "" }, { "docid": "999ce354e90984adac11bb6096e261ae", "score": "0.63353497", "text": "func (u *Device) sepgGetVersion() (int, int, error) {\n\tvar mobuf []byte\n\tmobuf = make([]byte, maxBufSize)\n\tmicnt, mibuf, err := u.sepgCmd(4, 0x93, 0, mobuf)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tif micnt != 2 {\n\t\treturn 0, 0, errors.New(\"Bad Response\")\n\t}\n\tiver := int(mibuf[0])\n\tirls := int(mibuf[1])\n\treturn iver, irls, nil\n}", "title": "" }, { "docid": "1ccc8e707f36bb47e720c2d47c69f0b6", "score": "0.63005877", "text": "func GetLibVersion() string {\n\n\t// Note: The string must not be freed\n\treturn C.GoString((*C.char)(C.SoapySDR_getAPIVersion()))\n}", "title": "" }, { "docid": "f8b0bd0ae3df9a7675f7f49a26193af7", "score": "0.6282778", "text": "func ZBRPRNGetSDKVer() (major, minor, engLevel int) {\n _, _, _ = zBRPRNGetSDKVer.Call(\n uintptr(unsafe.Pointer(&major)),\n uintptr(unsafe.Pointer(&minor)),\n uintptr(unsafe.Pointer(&engLevel)),\n )\n return\n}", "title": "" }, { "docid": "a2d267e6ad4839330f685d0e6f4f8b1a", "score": "0.62685895", "text": "func returnVersion() {\n\tfmt.Println(VERSION)\n}", "title": "" }, { "docid": "400fc8876378f47d6f4bc06999a8757c", "score": "0.62638956", "text": "func (h *Handler) GetVersion(rootAddr storage.Address) (uint32, error) {\n\trsrc := h.get(rootAddr)\n\tif rsrc == nil {\n\t\treturn 0, NewError(ErrNotFound, \" does not exist\")\n\t} else if !rsrc.isSynced() {\n\t\treturn 0, NewError(ErrNotSynced, \" is not synced\")\n\t}\n\treturn rsrc.version, nil\n}", "title": "" }, { "docid": "ff5d8edd700539de4c95b04aaed46d56", "score": "0.62623316", "text": "func (m *DeviceHealthScript) GetVersion()(*string) {\n val, err := m.GetBackingStore().Get(\"version\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "4be8f4d9825b1cefc3d19cf2665a741c", "score": "0.6257452", "text": "func (rig *Rig) getVersion() {\n\tcVersion := C.CString(\" \")\n\n\tC.get_version(rig.handle, cVersion)\n\trig.Caps.Version = strings.TrimSpace(C.GoString(cVersion))\n\tC.free(unsafe.Pointer(cVersion))\n}", "title": "" }, { "docid": "4f9e06e2536fab35849f7a31f46077ad", "score": "0.6247671", "text": "func (header FrameHeader) GetVersion() int {\n\tswitch (header & 0x00180000) >> 19 {\n\tcase 0:\n\t\treturn MPEGVersion2_5\n\tcase 1:\n\t\treturn MPEGVersionReserved\n\tcase 2:\n\t\treturn MPEGVersion2\n\tcase 3:\n\t\treturn MPEGVersion1\n\t}\n\tpanic(\"shouldn't be here\")\n}", "title": "" }, { "docid": "b8adaeb2ed644abc5fb41b36b4145c1a", "score": "0.62462753", "text": "func Version(conn net.Conn) (version string) {\n\tresp, err := command(conn, \"HI\")\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"err\": err,\n\t\t\t\"package\": GetPackagePath(PathObjHolder{}),\n\t\t\t\"function\": \"Version\",\n\t\t}).Debug()\n\t}\n\tverLine := strings.Split(resp, \" \")\n\tversion = verLine[1]\n\treturn version\n}", "title": "" }, { "docid": "f2841d56d05a78da5554634585a3d320", "score": "0.62247324", "text": "func GetVersion() (uint, uint, uint, error) {\n\tvar major, minor, release C.uint\n\tif err := Status(int(\n\t\tC.H5get_libversion(&major, &minor, &release)),\n\t\t\"getting library version\"); err != nil {\n\t\treturn 0, 0, 0, err\n\t}\n\treturn uint(major), uint(minor), uint(release), nil\n}", "title": "" }, { "docid": "62ec578418503649fc42eef382d3c185", "score": "0.62214184", "text": "func (p *FacebookServiceClient) GetVersion() (retval18 string, err error) {\n\terr = p.SendGetVersion()\n\tif err != nil {\n\t\treturn\n\t}\n\treturn p.RecvGetVersion()\n}", "title": "" }, { "docid": "241de6832f5f1adfaf37a68b31bdb02e", "score": "0.6220395", "text": "func checkVersion() {\n\n}", "title": "" }, { "docid": "540631c016c6123371ca8fcdc3e703a6", "score": "0.6211348", "text": "func MemkindGetVersion() int32 {\n\t__ret := C.memkind_get_version()\n\t__v := (int32)(__ret)\n\treturn __v\n}", "title": "" }, { "docid": "4721ea5a3d171019aa60a0931dc12b36", "score": "0.619679", "text": "func (sss StorageServiceStats) Version() string {\n\treturn sss.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "3bfad0d1767ecaa9118276fd872dc969", "score": "0.6191545", "text": "func (d *Driver) Version() (string, error) {\n\tout, err := d.Run(\"virsh version|grep \\\"Using library\\\"\")\n\tif err != nil {\n\t\treturn \"\", utils.FormatError(err)\n\t}\n\treturn strings.Split(out, \" \")[3], nil\n\n}", "title": "" }, { "docid": "28422c1ccab2576c9036fffc506477e2", "score": "0.61788046", "text": "func GetVersion() string {\r\n\treturn \"1.1.0\"\r\n}", "title": "" }, { "docid": "c3844d788bf6ab1ae16ee48ae01dcebf", "score": "0.6171826", "text": "func (l *Library) Version() (int, error) {\n\tif l.metadata != nil {\n\t\treturn l.metadata.version()\n\t}\n\n\treturn -1, nil\n}", "title": "" }, { "docid": "461544df94ab150ae09c4b4088ed67f6", "score": "0.61567056", "text": "func (*Common) Version() string {\n\treturn VERSION\n}", "title": "" }, { "docid": "b9f68a43e6fa990ac33d48201890adee", "score": "0.6140759", "text": "func (l SignedListing) GetVersion() uint32 { return l.GetListing().GetVersion() }", "title": "" }, { "docid": "385bf1b640d6c56588f4665c9a433288", "score": "0.6133662", "text": "func (dgpr DirectoryGetPropertiesResponse) Version() string {\n\treturn dgpr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "f56fe7beaef3d4dcbcc8004862bcb899", "score": "0.61335254", "text": "func DriverGetVersion() (int, CUresult) {\n\tvar driverVersion C.int\n\tstatus := C.cuDriverGetVersion(&driverVersion)\n\treturn int(driverVersion), CUresult(status)\n}", "title": "" }, { "docid": "f26f45663c91b22cd3733fb81e3a3944", "score": "0.6129051", "text": "func (fgpr FileGetPropertiesResponse) Version() string {\n\treturn fgpr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "3788e42676d39361bcb66178db1903db", "score": "0.61232305", "text": "func GetVersionEx(osversion *OSVERSIONINFO) bool {\r\n\tosversion.DwOSVersionInfoSize = int32(unsafe.Sizeof(*osversion))\r\n\tlibkernel32, _ := syscall.LoadLibrary(\"kernel32.dll\")\r\n\tgetVersionExA, _ := syscall.GetProcAddress(libkernel32, \"GetVersionExA\")\r\n\trt, _, _ := syscall.Syscall(getVersionExA, 1, uintptr(unsafe.Pointer(osversion)), 0, 0)\r\n\treturn rt == 1\r\n}", "title": "" }, { "docid": "559254598a536ebd9ae124d17171be45", "score": "0.61132", "text": "func ZBRPRNGetSDKProductVer() (success SuccessReturn) {\n panic(\"ZBRPRNGetSDKProductVer not implemented\")\n ret, _, _ := zBRPRNGetSDKProductVer.Call(\n )\n return SuccessReturn(ret)\n}", "title": "" }, { "docid": "fb94576a611f8f725e4107b491fcd6a6", "score": "0.61099", "text": "func testGetVersion(t *testing.T, s MetaStore) {\n\t_, _, err := s.GetVersion(\"gun\", \"role\", 2)\n\trequire.IsType(t, ErrNotFound{}, err, \"Expected error to be ErrNotFound\")\n\n\ts.UpdateCurrent(\"gun\", MetaUpdate{\"role\", 2, []byte(\"version2\")})\n\t_, d, err := s.GetVersion(\"gun\", \"role\", 2)\n\trequire.Nil(t, err, \"Expected error to be nil\")\n\trequire.Equal(t, []byte(\"version2\"), d, \"Data was incorrect\")\n\n\t// Getting newer version fails\n\t_, _, err = s.GetVersion(\"gun\", \"role\", 3)\n\trequire.IsType(t, ErrNotFound{}, err, \"Expected error to be ErrNotFound\")\n\n\t// Getting another gun/role fails\n\t_, _, err = s.GetVersion(\"badgun\", \"badrole\", 2)\n\trequire.IsType(t, ErrNotFound{}, err, \"Expected error to be ErrNotFound\")\n}", "title": "" }, { "docid": "f6816144d467ffb9cd56a4fff149055b", "score": "0.6108556", "text": "func (rest *Conn) Version() (string, error) {\n\tvar data commandsReply\n\tvar err error\n\turi, err := rest.MakeCallURL(\"\", Path{}, true)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err = rest.Call(uri, nil, &data); err != nil {\n\t\treturn \"\", err\n\t}\n\tif data.Error.String() != \"\" {\n\t\treturn \"\", fmt.Errorf(data.Error.String())\n\t}\n\n\treturn data.Version.String(), nil\n}", "title": "" }, { "docid": "2e025cd3d0d1d649b3a9cc60b9b54bca", "score": "0.60914886", "text": "func (ssp StorageServiceProperties) Version() string {\n\treturn ssp.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "2e025cd3d0d1d649b3a9cc60b9b54bca", "score": "0.60914886", "text": "func (ssp StorageServiceProperties) Version() string {\n\treturn ssp.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "3945fe60781dd46f30b20997cefb3e52", "score": "0.6089016", "text": "func (ss ShareStats) Version() string {\n\treturn ss.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "aa7f3b2d29ea55a382b465b9625d6e24", "score": "0.6088907", "text": "func Version() (int, int, int) {\n\tvar major, minor, revision C.int\n\tC.mosquitto_lib_version(&major, &minor, &revision)\n\treturn int(major), int(minor), int(revision)\n}", "title": "" }, { "docid": "e33430242978450ca78813df0466c144", "score": "0.608336", "text": "func getVersion(lastSeenBinaryVersion *string) error {\n\t// Create the get request for the etcd version endpoint.\n\treq, err := http.NewRequest(\"GET\", etcdVersionScrapeURI, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to create GET request for etcd version: %v\", err)\n\t}\n\n\t// Send the get request and receive a response.\n\tclient := &http.Client{}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed to receive GET response for etcd version: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\t// Obtain EtcdVersion from the JSON response.\n\tvar version EtcdVersion\n\tif err := json.NewDecoder(resp.Body).Decode(&version); err != nil {\n\t\treturn fmt.Errorf(\"Failed to decode etcd version JSON: %v\", err)\n\t}\n\n\t// Return without updating the version if it stayed the same since last time.\n\tif *lastSeenBinaryVersion == version.BinaryVersion {\n\t\treturn nil\n\t}\n\n\t// Delete the metric for the previous version.\n\tif *lastSeenBinaryVersion != \"\" {\n\t\tdeleted := etcdVersion.Delete(prometheus.Labels{\"binary_version\": *lastSeenBinaryVersion})\n\t\tif !deleted {\n\t\t\treturn fmt.Errorf(\"Failed to delete previous version's metric\")\n\t\t}\n\t}\n\n\t// Record the new version in a metric.\n\tetcdVersion.With(prometheus.Labels{\n\t\t\"binary_version\": version.BinaryVersion,\n\t}).Set(0)\n\t*lastSeenBinaryVersion = version.BinaryVersion\n\treturn nil\n}", "title": "" }, { "docid": "9bc13b6223c85d98376cb2b18d1a6082", "score": "0.60740584", "text": "func (n *NanoS) GetVersion() error {\n\tresp, err := n.Exchange(cmdGetVersion, 0, 0, 0, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tn.AppVersion = string(resp)\n\treturn nil\n}", "title": "" }, { "docid": "e689635461f4e648edd52584e4b036bf", "score": "0.6065284", "text": "func (f *PuzFile) Version() (int, int) {\n\tvar major, minor int\n\tif _, err := fmt.Sscanf(string(f.Header.Version[:]), \"%d.%d\", &major, &minor); err != nil {\n\t\treturn 0, 0\n\t}\n\n\treturn major, minor\n}", "title": "" }, { "docid": "d04646568d0db4268e540ff619643314", "score": "0.6062259", "text": "func GetVersion() string {\n\treturn version\n}", "title": "" }, { "docid": "d04646568d0db4268e540ff619643314", "score": "0.6062259", "text": "func GetVersion() string {\n\treturn version\n}", "title": "" }, { "docid": "d04646568d0db4268e540ff619643314", "score": "0.6062259", "text": "func GetVersion() string {\n\treturn version\n}", "title": "" }, { "docid": "3f952ebde4eb3ec44206ed51f8e96a97", "score": "0.6060461", "text": "func (pl PageList) Version() string {\n\treturn pl.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "eee87a6a40bc3b84c85e155cf88a5b9d", "score": "0.60574317", "text": "func (_DoubleSigningSlasher *DoubleSigningSlasherCaller) GetVersionNumber(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, 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(*big.Int)\n\t)\n\tout := &[]interface{}{\n\t\tret0,\n\t\tret1,\n\t\tret2,\n\t\tret3,\n\t}\n\terr := _DoubleSigningSlasher.contract.Call(opts, out, \"getVersionNumber\")\n\treturn *ret0, *ret1, *ret2, *ret3, err\n}", "title": "" }, { "docid": "28b37dc6266ad0259caf33ddaf525a9d", "score": "0.6052107", "text": "func (key *ExtendedPrivateKey) GetVersion() uint32 {\n\tversion := uint32(C.CExtendedPrivateKeyGetVersion(key.key))\n\truntime.KeepAlive(key)\n\treturn version\n}", "title": "" }, { "docid": "f36fdb1a55aa7e1ccd97f6f71023b401", "score": "0.6051679", "text": "func (dcr DirectoryCreateResponse) Version() string {\n\treturn dcr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "7ab161eb6c8e220082cc3cdd9fbb39ee", "score": "0.6046493", "text": "func Version() string {\n\treturn _version\n}", "title": "" }, { "docid": "f47fd3f149ae1059b0f37fc2131cdda2", "score": "0.60441506", "text": "func (t *Terminal) GetVersion() string {\n\tvar response Packet\n\tif err := t.SendAndReceive(CmdGetVersion, nil, &response); err != nil {\n\t\tPrintln(err)\n\t\treturn \"\"\n\t}\n\n\treturn string(response.data)\n}", "title": "" }, { "docid": "4389de8c3444977aa942eaf829697c9a", "score": "0.6043627", "text": "func (d *driverBase) Version() uint32 {\n\treturn d.version\n}", "title": "" }, { "docid": "492a0201a336c518c065ef4c43ae609e", "score": "0.6040354", "text": "func Version(major *int32, minor *int32, patch *int32) []byte {\n\tcmajor, _ := (*C.int)(unsafe.Pointer(major)), cgoAllocsUnknown\n\tcminor, _ := (*C.int)(unsafe.Pointer(minor)), cgoAllocsUnknown\n\tcpatch, _ := (*C.int)(unsafe.Pointer(patch)), cgoAllocsUnknown\n\t__ret := C.mdb_version(cmajor, cminor, cpatch)\n\t__v := (*(*[0x7fffffff]byte)(unsafe.Pointer(__ret)))[:0]\n\treturn __v\n}", "title": "" }, { "docid": "c6cb89531f27944617da4dfde0841153", "score": "0.60301787", "text": "func (client *memClient) Version() string {\n\tresult := client.executer.execute(\"version \\r\\n\", []string{})\n\tif len(result) == 1 {\n\t\treturn result[0]\n\t}\n\treturn \"UNKNOWN\"\n}", "title": "" }, { "docid": "15146aff771a092ebd1d1fa4edcc16a5", "score": "0.60289043", "text": "func (a Augeas) Version() string {\n\tval, _ := a.Get(\"/augeas/version\")\n\treturn val\n}", "title": "" }, { "docid": "ebbcdd2752ca0a73ac927c318f63de3f", "score": "0.6015781", "text": "func (fshhr FileSetHTTPHeadersResponse) Version() string {\n\treturn fshhr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "d7e27a8892e3952bb9bebdac70098ee2", "score": "0.6006248", "text": "func getVersion(w http.ResponseWriter, r *http.Request) {\n\tversion, e := version.Agent()\n\tif e != nil {\n\t\tlog.Errorf(\"Error getting version: \" + e.Error())\n\t\tw.Write([]byte(\"Error: \" + e.Error()))\n\t\treturn\n\t}\n\n\tres, _ := json.Marshal(version)\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(res)\n}", "title": "" }, { "docid": "1b804210abdae6a5b29151d8f0e8e4f6", "score": "0.60060364", "text": "func Version() string {\r\n\treturn getString(paramVersion)\r\n}", "title": "" }, { "docid": "6bc5ab0244d5de009ce91b6ca5c656f2", "score": "0.5999279", "text": "func (osx OSX) Version() (result string) {\n\tdata := Execute(\"system_profiler\", \"SPSoftwareDataType\")\n\n\trVersion := regexp.MustCompile(versionPattern)\n\n\tsubs := rVersion.FindAllStringSubmatch(data, 1)\n\tif len(subs) == 0 {\n\t\treturn\n\t}\n\n\tfind := subs[0]\n\tif len(find) < 1 {\n\t\treturn\n\t}\n\n\treturn find[1]\n}", "title": "" }, { "docid": "1d1ab1adc8b07935ae7d9a02830960a3", "score": "0.5994405", "text": "func (m *AslctrlData) GetVersion() int {\n\tif m.HasExtensionFieldValues {\n\t\treturn 2\n\t}\n\n\treturn 1\n}", "title": "" }, { "docid": "921bf8796d01f6bcb9a1af23b37eb52b", "score": "0.5994238", "text": "func (a *Agent) Version() (string, error) {\n\treturn a.VersionTimeout(DefaultTimeout)\n}", "title": "" }, { "docid": "97788ff479a89e3df6efd3b5cfc00bc5", "score": "0.59873414", "text": "func Version(request *g2z.AgentRequest) (string, error) {\n\treturn runtime.Version(), nil\n}", "title": "" }, { "docid": "f2b7326700e04fd6c0717b5072ed25f9", "score": "0.5986482", "text": "func (bgpr BlobGetPropertiesResponse) Version() string {\n\treturn bgpr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "b033068777a0341905b2f1fd0c1c81d2", "score": "0.597637", "text": "func getPreloadVersion() (int, error) {\n\tblob, err := os.ReadFile(filepath.Join(update.FSRoot, preloadFile))\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t// Match PreloadVersion.\n\tre := regexp.MustCompile(fmt.Sprintf(`PreloadVersion = \"%s\"`, preloadVersionRE))\n\tversion := re.FindSubmatch(blob)\n\tif version == nil {\n\t\treturn 0, nil\n\t}\n\t// Match version within PreloadVersion.\n\tre = regexp.MustCompile(preloadVersionRE)\n\tversion = re.FindSubmatch(version[0])\n\tif version == nil {\n\t\treturn 0, nil\n\t}\n\t// Convert to integer, drop 'v'.\n\tcurrent, err := strconv.Atoi(string(version[0])[1:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\treturn current, nil\n}", "title": "" }, { "docid": "0822c192982c1e758dc7ad35b6f35c2a", "score": "0.59675556", "text": "func (sgpr ShareGetPropertiesResponse) Version() string {\n\treturn sgpr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "2b7ccb2a81fdeeea5854e57f39db8e4b", "score": "0.59655523", "text": "func (p *RPCClientV4) Version() (string, error) {\n\tvar version string\n\terr := p.client.Call(\"RPCServer.Version\", struct{}{}, &version)\n\tif _, ok := err.(rpc.ServerError); !ok && err != nil {\n\t\treturn \"\", platform.FatalError{err}\n\t} else if err != nil && err.Error() == \"rpc: can't find method RPCServer.Version\" {\n\t\t// \"Version\" is not supported by this version of fluxd (it is old). Fail\n\t\t// gracefully.\n\t\treturn \"unknown\", nil\n\t}\n\treturn version, err\n}", "title": "" }, { "docid": "8555cbc092e49ccafecf6c69e2672651", "score": "0.5965454", "text": "func (api *API) Version() (v string, err error) {\n\t// temporary remove auth for this method to succeed\n\t// https://www.zabbix.com/documentation/2.2/manual/appendix/api/apiinfo/version\n\tauth := api.Auth\n\tapi.Auth = \"\"\n\tresponse, err := api.CallWithError(\"APIInfo.version\", Params{})\n\tapi.Auth = auth\n\n\t// despite what documentation says, Zabbix 2.2 requires auth, so we try again\n\tif e, ok := err.(*Error); ok && e.Code == -32602 {\n\t\tresponse, err = api.CallWithError(\"APIInfo.version\", Params{})\n\t}\n\tif err != nil {\n\t\treturn\n\t}\n\n\tv = response.Result.(string)\n\treturn\n}", "title": "" }, { "docid": "d7342f770d439187276453d9904a41d2", "score": "0.5965198", "text": "func (_SRTToken *SRTTokenCaller) Version(opts *bind.CallOpts) (string, error) {\n\tvar (\n\t\tret0 = new(string)\n\t)\n\tout := ret0\n\terr := _SRTToken.contract.Call(opts, out, \"version\")\n\treturn *ret0, err\n}", "title": "" }, { "docid": "6dfd2d2ad1ea630db424240f0f1cab59", "score": "0.5961963", "text": "func (t *OpenconfigSystem_System_Ntp_Servers_Server_State) GetVersion() uint8 {\n\tif t == nil || t.Version == nil {\n\t\treturn 4\n\t}\n\treturn *t.Version\n}", "title": "" }, { "docid": "dc64ebea6f580387b61e8f2b18ed1b45", "score": "0.595976", "text": "func (m *DeviceHealthStatus) GetOsVersion()(*string) {\n val, err := m.GetBackingStore().Get(\"osVersion\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "302407fc3dfc1ae0d999b1d8ec2e4109", "score": "0.59574705", "text": "func getVersion(m Message) uint16 {\n\tv, _ := binary.Uvarint(m.Payload())\n\treturn uint16(v)\n}", "title": "" }, { "docid": "38328f84f9ec09f118eac20658c38914", "score": "0.59505326", "text": "func (furr FileUploadRangeResponse) Version() string {\n\treturn furr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "5d92f5b692fc3d499bd095131211b748", "score": "0.59497523", "text": "func Get_version() ([]byte,error){\n\tvar err error = nil\n\tvar response []byte\n\tsb_mutex.Lock()\n\tfor ((err != nil) || (len(response) == 0) || (validJSON(response) == false)) {\n\t\tresponse, err = mget_version()\n\t}\n\tsb_mutex.Unlock()\n\treturn response, err\t\n}", "title": "" }, { "docid": "0017896ba36e459f778892d82fd43a4a", "score": "0.5943654", "text": "func (m *AzureNetscan) Version() int32 {\n\treturn m.versionField\n}", "title": "" }, { "docid": "a98cb08b162434351b3405079b79a5a7", "score": "0.5941711", "text": "func GetVersion() string {\n\treturn GetString(alVersion)\n}", "title": "" }, { "docid": "c95159336a1ce81daa3a0efae5175c92", "score": "0.5940337", "text": "func (s *PostgresStat) getVersion() {\n\tres, err := s.db.QueryReturnColumnDict(versionQuery)\n\tif err != nil || len(res[\"version\"]) == 0 {\n\t\ts.db.Log(errors.New(\"Couldn't get version\"))\n\t\ts.wg.Done()\n\t\treturn\n\t}\n\tversion := res[\"version\"][0]\n\tversion = strings.Split(version, \" \")[1]\n\tleading := float64(len(strings.Split(version, \".\")[0]))\n\tversion = strings.Replace(version, \".\", \"\", -1)\n\tver, err := strconv.ParseFloat(version, 64)\n\tver /= math.Pow(10.0, float64(len(version))-leading)\n\ts.Metrics.Version.Set(ver)\n\tif ver >= 9.2 {\n\t\ts.pidCol = \"pid\"\n\t\ts.queryCol = \"query\"\n\t\ts.idleCol = \"state\"\n\t\ts.idleStr = \"idle\"\n\t} else {\n\t\ts.pidCol = \"procpid\"\n\t\ts.queryCol = \"current_query\"\n\t\ts.idleCol = s.queryCol\n\t\ts.idleStr = \"<IDLE>\"\n\t}\n\tif err != nil {\n\t\ts.db.Log(err)\n\t}\n\ts.wg.Done()\n\treturn\n}", "title": "" }, { "docid": "42e080cdfef7f94e16b66d30416286d0", "score": "0.5938007", "text": "func (c *ControlPlane) Version() *string {\n\treturn &c.CCP.Spec.Version\n}", "title": "" }, { "docid": "acb03f34f7371b0d8f6dbf2b2fb7fb32", "score": "0.59365004", "text": "func (fcr FileCreateResponse) Version() string {\n\treturn fcr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "b8ae8d686db86a84bb1d6344090915d1", "score": "0.5935625", "text": "func (s *Scanner) readVersion() (uint32, error) {\n\treturn binary.ReadUint32(s.r)\n}", "title": "" }, { "docid": "b7d09b3f07fd0b00abf341de7ddce1ef", "score": "0.5933214", "text": "func (dr downloadResponse) Version() string {\n\treturn dr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "b7d09b3f07fd0b00abf341de7ddce1ef", "score": "0.5933214", "text": "func (dr downloadResponse) Version() string {\n\treturn dr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "f3eea9e795f3c4c6f16144863a3ab9eb", "score": "0.5931011", "text": "func GetLibraryVersion() uint32 {\n\t//v := C.ftdi_get_library_version()\n\t//return uint32(v.major&0xFF<<16 +\n\t//\tv.minor&0xFF<<8 +\n\t//\tv.micro&0xFF)\n\n\t// Not implemented, so we assume version 0.19.0\n\treturn 0x001900\n}", "title": "" }, { "docid": "c73ac6ed29b590dfa17b5e85c689b2a3", "score": "0.59304565", "text": "func (v GetterMock) GetVersion(_ context.Context) (string, error) {\n\treturn v.version, v.err\n}", "title": "" }, { "docid": "afff906d660e67061af6e828e1043dd5", "score": "0.59277093", "text": "func getOsxLibraryVersion(name string) (version string, err error) {\n\t_, version, err = getOsxLibraryNameAndVersion(name)\n\treturn version, err\n}", "title": "" }, { "docid": "4d6d286e8c6b5dcd4b66135a777c92af", "score": "0.59265244", "text": "func (bshhr BlobSetHTTPHeadersResponse) Version() string {\n\treturn bshhr.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "e238be05f0a84c49e93147736526daff", "score": "0.5919501", "text": "func Version() string {\n\treturn fmt.Sprintf(\"%02d.%02d.%02d\", VersionMax, VersionMid, VersionMin)\n}", "title": "" }, { "docid": "0584d883f912075466d8b0cf0a155947", "score": "0.59188646", "text": "func (this *PeerCom) GetVersion() uint32 {\n\treturn this.version\n}", "title": "" }, { "docid": "b38ebcb08b84fdc0786592d26db33416", "score": "0.5918212", "text": "func (c *Config) Version(ctx context.Context) (string, error) {\n\tc.Logger.Debugf(\"Getting version from server\")\n\n\treturn c.RunGRPCnRESTFunc(\"init\", false,\n\t\tfunc() (string, error) {\n\t\t\treturn c.versionGRPC(ctx)\n\t\t},\n\t\tfunc() (string, error) {\n\t\t\treturn c.versionHTTP()\n\t\t})\n}", "title": "" }, { "docid": "7272edd000597cc03738dda2187dbe8c", "score": "0.59165436", "text": "func GetVersion() string {\n\treturn runtime.Version()\n}", "title": "" }, { "docid": "6856d7f13968c8df02f62699a15cf25a", "score": "0.5914879", "text": "func (m *ManagedAppOperation) GetVersion()(*string) {\n return m.version\n}", "title": "" }, { "docid": "08abce02b61222cb7414608118a4ae6b", "score": "0.59140193", "text": "func (fbs FilterBlobSegment) Version() string {\n\treturn fbs.rawResponse.Header.Get(\"x-ms-version\")\n}", "title": "" }, { "docid": "0988598c191d912b2d28d75f43ff2c15", "score": "0.5911653", "text": "func Version() { DefaultClient.Version() }", "title": "" } ]
3d56fc68e3447e67939661a917c4647f
TestClientTaskQueryActionInvalidOrder tests passing an invalid order in query spec
[ { "docid": "0421303cc331411d159a3cc0543416e5", "score": "0.8665182", "text": "func (suite *taskActionsTestSuite) TestClientTaskQueryActionInvalidOrder() {\n\tc := Client{\n\t\tDebug: false,\n\t\ttaskClient: suite.mockTask,\n\t\tdispatcher: nil,\n\t\tctx: suite.ctx,\n\t}\n\n\tjobID := &peloton.JobID{\n\t\tValue: uuid.New(),\n\t}\n\n\tsuite.Error(c.TaskQueryAction(\n\t\tjobID.Value, \"RUNNING\", \"\", \"taskHost\", 10, 0, \"state\", \"ABC\"))\n}", "title": "" } ]
[ { "docid": "b3d49ea914aae7727c39b186f95a8e44", "score": "0.6142279", "text": "func (o *GetMovesQueueParams) validateOrder(formats strfmt.Registry) error {\n\n\tif err := validate.EnumCase(\"order\", \"query\", *o.Order, []interface{}{\"asc\", \"desc\"}, true); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6c420906b2ddb7d6bc55c0939f17850e", "score": "0.5936787", "text": "func (s *SmartContract) QueryOrderByorderid(ctx contractapi.TransactionContextInterface, orderId int) OrderQueryResult {\n\torderIndexKey, err := ctx.GetStub().CreateCompositeKey(orderIndexName, []string{strconv.Itoa(orderId)})\n\tif err != nil {\n\t\treturn OrderQueryResult{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t\tData: Order{\n\t\t\t\tOrderId: 0,\n\t\t\t\tGenerateTime: \"\",\n\t\t\t\tCustomerId: 0,\n\t\t\t\tTrainNumber: \"0\",\n\t\t\t\tStartingStation: \"\",\n\t\t\t\tDestinationStation: \"\",\n\t\t\t\tCarriageNumber: 0,\n\t\t\t\tPrice: 0,\n\t\t\t\tTotalTypeNum: 0,\n\t\t\t\tCargoType: []string{},\n\t\t\t\tGoodsNum: []int{},\n\t\t\t\tGoodsName: []string{},\n\t\t\t\tCheckResult: false,\n\t\t\t\tCheckDescription: \"\",\n\t\t\t},\n\t\t}\n\t}\n\n\torderJSON, err := ctx.GetStub().GetState(orderIndexKey)\n\tif err != nil {\n\t\treturn OrderQueryResult{\n\t\t\tCode: 402,\n\t\t\tMsg: fmt.Sprintf(\"failed to read from world state: %v\", err),\n\t\t\tData: Order{\n\t\t\t\tOrderId: 0,\n\t\t\t\tGenerateTime: \"\",\n\t\t\t\tCustomerId: 0,\n\t\t\t\tTrainNumber: \"0\",\n\t\t\t\tStartingStation: \"\",\n\t\t\t\tDestinationStation: \"\",\n\t\t\t\tCarriageNumber: 0,\n\t\t\t\tPrice: 0,\n\t\t\t\tTotalTypeNum: 0,\n\t\t\t\tCargoType: []string{},\n\t\t\t\tGoodsNum: []int{},\n\t\t\t\tGoodsName: []string{},\n\t\t\t\tCheckResult: false,\n\t\t\t\tCheckDescription: \"\",\n\t\t\t},\n\t\t}\n\t}\n\tif orderJSON == nil {\n\t\treturn OrderQueryResult{\n\t\t\tCode: 402,\n\t\t\tMsg: fmt.Sprintf(\"the order %d does not exist\", orderId),\n\t\t\tData: Order{\n\t\t\t\tOrderId: 0,\n\t\t\t\tGenerateTime: \"\",\n\t\t\t\tCustomerId: 0,\n\t\t\t\tTrainNumber: \"0\",\n\t\t\t\tStartingStation: \"\",\n\t\t\t\tDestinationStation: \"\",\n\t\t\t\tCarriageNumber: 0,\n\t\t\t\tPrice: 0,\n\t\t\t\tTotalTypeNum: 0,\n\t\t\t\tCargoType: []string{},\n\t\t\t\tGoodsNum: []int{},\n\t\t\t\tGoodsName: []string{},\n\t\t\t\tCheckResult: false,\n\t\t\t\tCheckDescription: \"\",\n\t\t\t},\n\t\t}\n\t}\n\n\tvar order Order\n\terr = json.Unmarshal(orderJSON, &order)\n\tif err != nil {\n\t\treturn OrderQueryResult{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t\tData: Order{\n\t\t\t\tOrderId: 0,\n\t\t\t\tGenerateTime: \"\",\n\t\t\t\tCustomerId: 0,\n\t\t\t\tTrainNumber: \"0\",\n\t\t\t\tStartingStation: \"\",\n\t\t\t\tDestinationStation: \"\",\n\t\t\t\tCarriageNumber: 0,\n\t\t\t\tPrice: 0,\n\t\t\t\tTotalTypeNum: 0,\n\t\t\t\tCargoType: []string{},\n\t\t\t\tGoodsNum: []int{},\n\t\t\t\tGoodsName: []string{},\n\t\t\t\tCheckResult: false,\n\t\t\t\tCheckDescription: \"\",\n\t\t\t},\n\t\t}\n\t}\n\n\treturn OrderQueryResult{\n\t\tCode: 200,\n\t\tMsg: \"success\",\n\t\tData: order,\n\t}\n}", "title": "" }, { "docid": "06dfff1e8086e5fced18617a2472a44f", "score": "0.5874494", "text": "func TestValidateOrder(t *testing.T) {\n\tt.Parallel()\n\n\torderStore := newMockStore()\n\torderManager := NewManager(&ManagerConfig{\n\t\tStore: orderStore,\n\t})\n\n\t// We'll now create an account with sufficient size.\n\ttestAccount := &account.Account{\n\t\tValue: btcutil.SatoshiPerBitcoin,\n\t\tTraderKey: &keychain.KeyDescriptor{\n\t\t\tPubKey: acctKeySmall,\n\t\t},\n\t}\n\n\ttestTerms := &terms.AuctioneerTerms{\n\t\tOrderExecBaseFee: 1,\n\t\tOrderExecFeeRate: 100,\n\t\tLeaseDurationBuckets: map[uint32]auctioneerrpc.DurationBucketState{\n\t\t\t144: auctioneerrpc.DurationBucketState_MARKET_OPEN,\n\t\t},\n\t}\n\n\ttestCases := []struct {\n\t\tname string\n\t\texpectedErr string\n\t\torder Order\n\t}{{\n\t\tname: \"invalid lease duration\",\n\t\texpectedErr: \"invalid lease duration, must be one of map[144\",\n\t\torder: &Ask{\n\t\t\tKit: Kit{\n\t\t\t\tLeaseDuration: 123,\n\t\t\t},\n\t\t},\n\t}, {\n\t\tname: \"invalid max batch fee rate\",\n\t\texpectedErr: \"invalid max batch fee rate 123 sat/kw, must be\",\n\t\torder: &Ask{\n\t\t\tKit: Kit{\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 123,\n\t\t\t},\n\t\t},\n\t}, {\n\t\tname: \"insufficient account balance\",\n\t\texpectedErr: \"insufficient account balance\",\n\t\torder: &Ask{\n\t\t\tKit: Kit{\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 253,\n\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\tAmt: btcutil.SatoshiPerBitcoin,\n\t\t\t\tUnitsUnfulfilled: 1_000,\n\t\t\t},\n\t\t},\n\t}, {\n\t\tname: \"invalid version for self chan balance\",\n\t\texpectedErr: \"cannot use self chan balance with old order \" +\n\t\t\t\"version\",\n\t\torder: &Bid{\n\t\t\tKit: Kit{\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 253,\n\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\tAmt: 100_000,\n\t\t\t\tUnitsUnfulfilled: 1,\n\t\t\t},\n\t\t\tSelfChanBalance: 1,\n\t\t},\n\t}, {\n\t\tname: \"invalid capacity for self chan balance\",\n\t\texpectedErr: \"channel capacity must be positive multiple of\",\n\t\torder: &Bid{\n\t\t\tKit: Kit{\n\t\t\t\tVersion: VersionSelfChanBalance,\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 253,\n\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\tAmt: 0,\n\t\t\t\tUnitsUnfulfilled: 0,\n\t\t\t},\n\t\t\tSelfChanBalance: 1,\n\t\t},\n\t}, {\n\t\tname: \"invalid self chan balance\",\n\t\texpectedErr: \"self channel balance must be smaller than \" +\n\t\t\t\"or equal to capacity\",\n\t\torder: &Bid{\n\t\t\tKit: Kit{\n\t\t\t\tVersion: VersionSelfChanBalance,\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 253,\n\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\tAmt: 100_000,\n\t\t\t\tUnitsUnfulfilled: 1,\n\t\t\t},\n\t\t\tSelfChanBalance: 100_001,\n\t\t},\n\t}, {\n\t\tname: \"min units match must equal amount\",\n\t\texpectedErr: \"to use self chan balance the min units match \" +\n\t\t\t\"must be equal to the order amount in units\",\n\t\torder: &Bid{\n\t\t\tKit: Kit{\n\t\t\t\tVersion: VersionSelfChanBalance,\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 253,\n\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\tAmt: 200_000,\n\t\t\t\tUnitsUnfulfilled: 2,\n\t\t\t},\n\t\t\tSelfChanBalance: 50_000,\n\t\t},\n\t}, {\n\t\tname: \"happy path\",\n\t\texpectedErr: \"\",\n\t\torder: &Bid{\n\t\t\tKit: Kit{\n\t\t\t\tVersion: VersionSelfChanBalance,\n\t\t\t\tLeaseDuration: 144,\n\t\t\t\tMaxBatchFeeRate: 253,\n\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\tAmt: 100_000,\n\t\t\t\tUnitsUnfulfilled: 1,\n\t\t\t\tUnits: 1,\n\t\t\t},\n\t\t\tSelfChanBalance: 10_000,\n\t\t},\n\t}}\n\n\tfor _, tc := range testCases {\n\t\ttc := tc\n\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\terr := orderManager.validateOrder(\n\t\t\t\ttc.order, testAccount, testTerms,\n\t\t\t)\n\n\t\t\tif tc.expectedErr == \"\" {\n\t\t\t\trequire.NoError(t, err)\n\t\t\t} else {\n\t\t\t\trequire.Error(t, err)\n\t\t\t\trequire.Contains(t, err.Error(), tc.expectedErr)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "2861ab4116300d548184b2b867347802", "score": "0.5845731", "text": "func orderFailed(ctx context.Context, prop *orderProperty, itemName string, price int) error {\n\tpayload := order.Request{\n\t\tItem: itemName,\n\t\tPrice: price,\n\t}\n\tpayloadBytes, _ := json.Marshal(payload)\n\n\tresp, err := http.Post(\"http://localhost:8002/order-failed\", \"application/json\", bytes.NewReader(payloadBytes))\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == 500 {\n\t\terr = errors.New(\"request error to service order\")\n\t\tlog.Println(err.Error())\n\t\treturn err\n\t}\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn err\n\t}\n\n\tvar response order.Response\n\terr = json.Unmarshal(body, &response)\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn err\n\t}\n\n\tprop.OrderID = response.OrderID\n\treturn nil\n}", "title": "" }, { "docid": "734fc56a0f33d5e91137542544132d1e", "score": "0.5782239", "text": "func TestAccessInvalidQuery_EmptyMessage(t *testing.T) {\n\trunTest(t, func(s *res.Service) {\n\t\ts.Handle(\"model\", res.Access(func(r res.AccessRequest) {\n\t\t\tr.InvalidQuery(\"\")\n\t\t}))\n\t}, func(s *restest.Session) {\n\t\ts.Access(\"test.model\", mock.QueryRequest()).\n\t\t\tResponse().\n\t\t\tAssertError(res.ErrInvalidQuery)\n\t})\n}", "title": "" }, { "docid": "037ce8f2e5eacb6421ee7c7f6f8ca31c", "score": "0.5729023", "text": "func (c *Client) QueryOrder(req *QueryOrderReq) (*QueryOrder, error) {\n\tif req == nil {\n\t\treturn nil, ErrNilRequest\n\t}\n\tif req.OrderID < 0 && req.OrigClientOrderId == \"\" {\n\t\treturn nil, ErrEmptyOrderID\n\t}\n\tres, err := c.c.do(fasthttp.MethodGet, EndpointOrder, req, true, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp := &QueryOrder{}\n\treturn resp, json.Unmarshal(res, resp)\n}", "title": "" }, { "docid": "90ca7277be1c500e2a7ee4e78306d5e1", "score": "0.5653579", "text": "func TestHandler_Query_ErrInvalidQuery(t *testing.T) {\n\th := NewHandler(false)\n\tw := httptest.NewRecorder()\n\th.ServeHTTP(w, MustNewJSONRequest(\"GET\", \"/query?q=SELECT\", nil))\n\tif w.Code != http.StatusBadRequest {\n\t\tt.Fatalf(\"unexpected status: %d\", w.Code)\n\t} else if body := strings.TrimSpace(w.Body.String()); body != `{\"error\":\"error parsing query: found EOF, expected identifier, string, number, bool at line 1, char 8\"}` {\n\t\tt.Fatalf(\"unexpected body: %s\", body)\n\t}\n}", "title": "" }, { "docid": "6e22529f9ee4083dc58677320199a381", "score": "0.5561942", "text": "func TestOrderBy_OrderEmpty(t *testing.T) {\n\torderBy := common.OrderBy{}\n\tequals(t, 2, len(orderBy.Order()))\n\tequals(t, common.OrderByUpdatedDesc, orderBy.Order()[0])\n\tequals(t, common.OrderByCreatedDesc, orderBy.Order()[1])\n}", "title": "" }, { "docid": "8bb0314f2e5d380c102bf9b8213afc5e", "score": "0.5531236", "text": "func TestOrderedMergeInvalidRequest(t *testing.T) {\n testname, _ := createTestParamValue(\"OrderedMerge\", \"name\", \"string\").(string)\n testrequest, _ := createTestParamValue(\"OrderedMerge\", \"request\", \"OrderedMergeRequest\").(IOrderedMergeRequest)\n testpassword, _ := createTestParamValue(\"OrderedMerge\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"OrderedMerge\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"OrderedMerge\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testrequest, \"OrderedMerge\", \"request\", \"OrderedMergeRequest\")\n if (invalidValue == nil) {\n testrequest = nil\n } else {\n testrequest, _ = invalidValue.(IOrderedMergeRequest)\n }\n\n e := InitializeTest(\"OrderedMerge\", \"request\", testrequest)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.OrderedMerge(testname, testrequest, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"OrderedMerge\", \"request\", \"OrderedMergeRequest\", testrequest, int32(statusCode), e)\n}", "title": "" }, { "docid": "7338979d031bd92d756c4b65b198432f", "score": "0.5467949", "text": "func TestDaoNotGrantActOrders(t *testing.T) {\n\tConvey(\"TestDaoNotGrantActOrders salary coupon\", t, func() {\n\t\tres, err := d.NotGrantActOrders(context.Background(), \"ele\", 100)\n\t\tfor _, v := range res {\n\t\t\tfmt.Println(\"res:\", v)\n\t\t}\n\t\tSo(err, ShouldBeNil)\n\t})\n}", "title": "" }, { "docid": "fa0cec878359889c7a2254b002f0c882", "score": "0.5462541", "text": "func TestOrderReservedValue(t *testing.T) {\n\tt.Parallel()\n\n\tsimpleFeeSchedule := terms.NewLinearFeeSchedule(1, 100)\n\n\ttestCases := []struct {\n\t\tname string\n\t\torder Order\n\t}{\n\t\t{\n\t\t\tname: \"bid 1 unit\",\n\t\t\torder: &Bid{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 1,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask 1 unit\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 1,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"bid 10 units\",\n\t\t\torder: &Bid{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask 10 units\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"cancelled order\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateCanceled,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"expired order\",\n\t\t\torder: &Bid{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateExpired,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"failed order\",\n\t\t\torder: &Bid{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateFailed,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask 10 units partially filled\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StatePartiallyFilled,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask 10 units cleared\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateCleared,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask massive rate\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10_000_000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask 10 units 5 min units match\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10_000_000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 5,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"bid 10 units 5 min units match\",\n\t\t\torder: &Bid{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10_000_000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 5,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"ask 10 units 4 min units match\",\n\t\t\torder: &Ask{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10_000_000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"bid 10 units 4 min units match\",\n\t\t\torder: &Bid{\n\t\t\t\tKit: Kit{\n\t\t\t\t\tState: StateSubmitted,\n\t\t\t\t\tUnitsUnfulfilled: 10,\n\t\t\t\t\tFixedRate: 10_000_000,\n\t\t\t\t\tMaxBatchFeeRate: 1000,\n\t\t\t\t\tLeaseDuration: 144,\n\t\t\t\t\tMinUnitsMatch: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, tc := range testCases {\n\t\ttc := tc\n\n\t\t// Count the worst case we will expect.\n\t\tvar expValue btcutil.Amount\n\n\t\tswitch o := tc.order.(type) {\n\t\tcase *Bid:\n\t\t\t// Expect no reseved value in these states.\n\t\t\tif o.State.Archived() {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// For bids the taker pays the most fees if the min\n\t\t\t// units get matched every block. There's an edge case\n\t\t\t// where if the units unfulfilled is not divisible by\n\t\t\t// the min units match, then the last match will consume\n\t\t\t// all the remaining units left.\n\t\t\tnumBlocks := int(o.UnitsUnfulfilled / o.MinUnitsMatch)\n\t\t\tunitsRem := o.UnitsUnfulfilled % o.MinUnitsMatch\n\t\t\tlastMatch := o.MinUnitsMatch\n\t\t\tif unitsRem != 0 {\n\t\t\t\tlastMatch += unitsRem\n\t\t\t}\n\t\t\tfor i := 0; i < numBlocks; i++ {\n\t\t\t\tamt := o.MinUnitsMatch.ToSatoshis()\n\t\t\t\tif i == numBlocks-1 {\n\t\t\t\t\tamt = lastMatch.ToSatoshis()\n\t\t\t\t}\n\n\t\t\t\tlumpSum := FixedRatePremium(o.FixedRate).\n\t\t\t\t\tLumpSumPremium(amt, o.LeaseDuration)\n\t\t\t\texeFee := executionFee(amt, simpleFeeSchedule)\n\t\t\t\tchainFee := EstimateTraderFee(\n\t\t\t\t\t1, o.MaxBatchFeeRate,\n\t\t\t\t)\n\n\t\t\t\t// For bids the lump sum, chain fee and the\n\t\t\t\t// execution fee must be reserved.\n\t\t\t\texpValue += lumpSum + chainFee + exeFee\n\t\t\t}\n\n\t\tcase *Ask:\n\t\t\t// Expect no reseved value in these states.\n\t\t\tif o.State.Archived() {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// For asks the maker pays the most fees if min units\n\t\t\t// get matched every block. There's an edge case where\n\t\t\t// if the units unfulfilled is not divisible by the min\n\t\t\t// units match, then the last match will consume all the\n\t\t\t// remaining units left.\n\t\t\tnumBlocks := int(o.UnitsUnfulfilled / o.MinUnitsMatch)\n\t\t\tunitsRem := o.UnitsUnfulfilled % o.MinUnitsMatch\n\t\t\tlastMatch := o.MinUnitsMatch\n\t\t\tif unitsRem != 0 {\n\t\t\t\tlastMatch += unitsRem\n\t\t\t}\n\t\t\tfor i := 0; i < numBlocks; i++ {\n\t\t\t\tamt := o.MinUnitsMatch.ToSatoshis()\n\t\t\t\tif i == numBlocks-1 {\n\t\t\t\t\tamt = lastMatch.ToSatoshis()\n\t\t\t\t}\n\n\t\t\t\t// In the worst case, the maker will be paid\n\t\t\t\t// only one lump sum for a 144 block duration,\n\t\t\t\t// since that is the minimum duration.\n\t\t\t\tlumpSum := FixedRatePremium(o.FixedRate).\n\t\t\t\t\tLumpSumPremium(amt, 144)\n\t\t\t\texeFee := executionFee(amt, simpleFeeSchedule)\n\t\t\t\tchainFee := EstimateTraderFee(\n\t\t\t\t\t1, o.MaxBatchFeeRate,\n\t\t\t\t)\n\n\t\t\t\t// For asks the amount itself, the chain fee\n\t\t\t\t// and the execution fee must be reserved,\n\t\t\t\t// while the lump sum the maker gets back.\n\t\t\t\texpValue += amt + chainFee + exeFee - lumpSum\n\t\t\t}\n\n\t\tdefault:\n\t\t\tt.Fatalf(\"unknown type %T\", tc.order)\n\t\t}\n\n\t\t// We don't ever expect negative reserved values.\n\t\tif expValue < 0 {\n\t\t\texpValue = 0\n\t\t}\n\n\t\t// Check the value returned.\n\t\ti := i\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tval := tc.order.ReservedValue(simpleFeeSchedule)\n\t\t\tif val < 0 {\n\t\t\t\tt.Fatalf(\"reserved value cannot be \"+\n\t\t\t\t\t\"negative: %v\", val)\n\t\t\t}\n\t\t\tif val != expValue {\n\t\t\t\tt.Fatalf(\"test #%v: expected reserved value \"+\n\t\t\t\t\t\"%v, got '%v'\", i, expValue, val)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "0b9f165c93e157cb30c48728c4ebe6b3", "score": "0.54293054", "text": "func (e OrderResultValidationError) Reason() string { return e.reason }", "title": "" }, { "docid": "3d8a9fff05b1cf241c24e8dd2af1f132", "score": "0.5399025", "text": "func (e *Equipment) QueryOrderEquipmentt() *OrderQuery {\n\treturn (&EquipmentClient{config: e.config}).QueryOrderEquipmentt(e)\n}", "title": "" }, { "docid": "d50c2fa5d7cad86c7fa3cba6dad08ca7", "score": "0.5388081", "text": "func TestBadOrderDate(t *testing.T) {\n\t// First get a copy of our structure\n\tbadDateStructure := GetExchangeMock(t)\n\t// Now set the date we're going to set the following date\n\t// Today date - 1\n\t// Today date + 1\n\tbadDateStructure.StartDate = time.Now().AddDate(0, 0, -1)\n\tbadDateStructure.EndDate = time.Now().AddDate(0, 0, 1)\n\n\t// Call our saveMock function\n\tres, _e := badDateStructure.saveMock()\n\t// Testing the exchange class using EqualError\n\t// If the saveMock function return true then the test has failed\n\tif res != false {\n\t\tassert.Fail(t, \"Test failed TestBadOrderDate\")\n\t}\n\t// assert the error and chekc if the string is the one that we input\n\tassert.EqualError(t, _e, \"start date : enter a date after or today\", \"working\")\n}", "title": "" }, { "docid": "f986e3e1a74ba16765d8626505ac5fed", "score": "0.538634", "text": "func validateOrderResponse(dc *dexConnection, result *msgjson.OrderResult, ord order.Order, msgOrder msgjson.Stampable) error {\n\tif result.ServerTime == 0 {\n\t\treturn fmt.Errorf(\"OrderResult cannot have servertime = 0\")\n\t}\n\tmsgOrder.Stamp(result.ServerTime)\n\tmsg := msgOrder.Serialize()\n\terr := dc.acct.checkSig(msg, result.Sig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"signature error. order abandoned\")\n\t}\n\tord.SetTime(time.UnixMilli(int64(result.ServerTime)))\n\tcheckID, err := order.IDFromBytes(result.OrderID)\n\tif err != nil {\n\t\treturn err\n\t}\n\toid := ord.ID()\n\tif oid != checkID {\n\t\treturn fmt.Errorf(\"failed ID match. order abandoned\")\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "844b9a4d836ce55fcfca170a3a1f90d1", "score": "0.5332479", "text": "func (d *Dao) QueryOrder(order *model.Order, pn int32, ps int32) (qor *model.QueryOrderResponse, err error) {\n\tqor = &model.QueryOrderResponse{}\n\terr = d.DB.Table(model.Order{}.TableName()).Where(model.Order{\n\t\tID: order.ID, Name: order.Name, Broker: order.Broker, Type: order.Type, TestType: order.TestType,\n\t\tProject: order.Project, Department: order.Department, App: order.App, Status: order.Status, UpdateBy: order.UpdateBy,\n\t\tActive: 1, Handler: order.Handler}).Count(&qor.TotalSize).Offset((pn - 1) * ps).Limit(ps).Order(\"id desc\").Find(&qor.Orders).Error\n\tqor.PageSize = ps\n\tqor.PageNum = pn\n\treturn\n}", "title": "" }, { "docid": "8340703508fa788fac3e65eae472f371", "score": "0.5330088", "text": "func (by *Bybit) QueryOrder(ctx context.Context, orderID, orderLinkID string) (*QueryOrderResponse, error) {\n\tif orderID == \"\" && orderLinkID == \"\" {\n\t\treturn nil, errOrderOrOrderLinkIDMissing\n\t}\n\n\tparams := url.Values{}\n\tif orderID != \"\" {\n\t\tparams.Set(\"orderId\", orderID)\n\t}\n\tif orderLinkID != \"\" {\n\t\tparams.Set(\"orderLinkId\", orderLinkID)\n\t}\n\n\tresp := struct {\n\t\tData QueryOrderResponse `json:\"result\"`\n\t\tError\n\t}{}\n\treturn &resp.Data, by.SendAuthHTTPRequest(ctx, exchange.RestSpot, http.MethodGet, bybitSpotOrder, params, nil, &resp, privateSpotRate)\n}", "title": "" }, { "docid": "b0654b332aecec495dbdafa8af76c902", "score": "0.5324273", "text": "func TestWsGetOrderDetails(t *testing.T) {\n\tsetupWsTests(t)\n\torderID := \"123\"\n\tresp, err := h.wsGetOrderDetails(orderID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif resp.ErrorCode > 0 && (orderID == \"123\" && resp.ErrorCode != 10022) {\n\t\tt.Error(resp.ErrorMessage)\n\t}\n}", "title": "" }, { "docid": "aa0b5e3f69aba176a72baea3a4b873aa", "score": "0.53127193", "text": "func TestHandler_Query_ErrQueryRequired(t *testing.T) {\n\th := NewHandler(false)\n\tw := httptest.NewRecorder()\n\th.ServeHTTP(w, MustNewJSONRequest(\"GET\", \"/query\", nil))\n\tif w.Code != http.StatusBadRequest {\n\t\tt.Fatalf(\"unexpected status: %d\", w.Code)\n\t} else if body := strings.TrimSpace(w.Body.String()); body != `{\"error\":\"missing required parameter \\\"q\\\"\"}` {\n\t\tt.Fatalf(\"unexpected body: %s\", body)\n\t}\n}", "title": "" }, { "docid": "951b0e229198deb090afb89b5c26839e", "score": "0.5303756", "text": "func TestAccessInvalidQuery_CustomMessage(t *testing.T) {\n\trunTest(t, func(s *res.Service) {\n\t\ts.Handle(\"model\", res.Access(func(r res.AccessRequest) {\n\t\t\tr.InvalidQuery(mock.ErrorMessage)\n\t\t}))\n\t}, func(s *restest.Session) {\n\t\ts.Access(\"test.model\", mock.QueryRequest()).\n\t\t\tResponse().\n\t\t\tAssertError(&res.Error{\n\t\t\t\tCode: res.CodeInvalidQuery,\n\t\t\t\tMessage: mock.ErrorMessage,\n\t\t\t})\n\t})\n}", "title": "" }, { "docid": "15e381db3d153cb3e5ad9d0f9800ce23", "score": "0.52925485", "text": "func TestOrderBy_Order_Multiple(t *testing.T) {\n\torderBy := common.OrderBy{}\n\tok(t, orderBy.Add(common.OrderByCreated))\n\tok(t, orderBy.Add(common.OrderByUpdated))\n\tequals(t, 2, len(orderBy.Order()))\n\tequals(t, common.OrderByCreated, orderBy.Order()[0])\n\tequals(t, common.OrderByUpdated, orderBy.Order()[1])\n}", "title": "" }, { "docid": "2ddf5efe67d9b6ed6aab13ba2551fd6d", "score": "0.5274651", "text": "func (m *Manager) validateOrder(order Order, acct *account.Account,\n\tterms *terms.AuctioneerTerms) error {\n\n\tduration := order.Details().LeaseDuration\n\t_, ok := terms.LeaseDurationBuckets[duration]\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid lease duration, must be one of %v\",\n\t\t\tterms.LeaseDurationBuckets)\n\t}\n\n\tif order.Details().MaxBatchFeeRate < chainfee.FeePerKwFloor {\n\t\treturn fmt.Errorf(\"invalid max batch fee rate %v, must be \"+\n\t\t\t\"greater than %v\", order.Details().MaxBatchFeeRate,\n\t\t\tchainfee.FeePerKwFloor)\n\t}\n\n\t// Check all conditions that come with the use of the self chan balance.\n\tbid, isBid := order.(*Bid)\n\tif isBid && bid.SelfChanBalance > 0 {\n\t\tif err := bid.ValidateSelfChanBalance(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Get all existing orders.\n\tdbOrders, err := m.cfg.Store.GetOrders()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Ensure the total reserved value won't be larger than the account\n\t// value when adding this order.\n\tvar acctKey [33]byte\n\tcopy(acctKey[:], acct.TraderKey.PubKey.SerializeCompressed())\n\tfeeSchedule := terms.FeeSchedule()\n\treserved := order.ReservedValue(feeSchedule)\n\tfor _, o := range dbOrders {\n\t\t// Only tally the reserved balance if this order was submitted\n\t\t// by this account.\n\t\tif o.Details().AcctKey != acctKey {\n\t\t\tcontinue\n\t\t}\n\n\t\treserved += o.ReservedValue(feeSchedule)\n\t}\n\n\tif acct.Value < reserved {\n\t\treturn ErrInsufficientBalance\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "4955df4a61879acbf282eb7ea0edad9d", "score": "0.5261672", "text": "func (s *SmartContract) QueryAllOrders(ctx contractapi.TransactionContextInterface) OrderQueryResults {\n\tvar emptyorders []Order\n\temptyorders = append(emptyorders, Order{\n\t\tOrderId: 0,\n\t\tGenerateTime: \" \",\n\t\tCustomerId: 0,\n\t\tTrainNumber: \"0\",\n\t\tStartingStation: \" \",\n\t\tDestinationStation: \" \",\n\t\tCarriageNumber: 0,\n\t\tPrice: 0,\n\t\tTotalTypeNum: 0,\n\t\tCargoType: []string{},\n\t\tGoodsNum: []int{},\n\t\tGoodsName: []string{},\n\t\tCheckResult: false,\n\t\tCheckDescription: \" \",\n\t})\n\n\torderResultsIterator, err := ctx.GetStub().GetStateByPartialCompositeKey(orderIndexName, []string{})\n\tif err != nil {\n\t\treturn OrderQueryResults{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t\tData: Orders{OrdersData: emptyorders},\n\t\t}\n\t}\n\tdefer orderResultsIterator.Close()\n\n\tvar orders []Order\n\tfor orderResultsIterator.HasNext() {\n\t\torderQueryResponse, err := orderResultsIterator.Next()\n\t\tif err != nil {\n\t\t\treturn OrderQueryResults{\n\t\t\t\tCode: 402,\n\t\t\t\tMsg: err.Error(),\n\t\t\t\tData: Orders{OrdersData: emptyorders},\n\t\t\t}\n\t\t}\n\n\t\tvar order Order\n\t\terr = json.Unmarshal(orderQueryResponse.Value, &order)\n\t\tif err != nil {\n\t\t\treturn OrderQueryResults{\n\t\t\t\tCode: 402,\n\t\t\t\tMsg: err.Error(),\n\t\t\t\tData: Orders{OrdersData: emptyorders},\n\t\t\t}\n\t\t}\n\t\torders = append(orders, order)\n\t}\n\tif orders == nil {\n\t\treturn OrderQueryResults{\n\t\t\tCode: 402,\n\t\t\tMsg: \"No order\",\n\t\t\tData: Orders{OrdersData: emptyorders},\n\t\t}\n\t}\n\n\treturn OrderQueryResults{\n\t\tCode: 200,\n\t\tMsg: \"success\",\n\t\tData: Orders{OrdersData: orders},\n\t}\n}", "title": "" }, { "docid": "4a402593bc898c0d299d4aeffeaf0903", "score": "0.52421534", "text": "func TestIssue_134(t *testing.T) {\n\tt.Parallel()\n\n\tctx, ctxCancel := th.TestContext(t)\n\tdefer ctxCancel()\n\n\tmc := minimock.NewController(t)\n\tdefer mc.Finish()\n\n\ttd := testdeep.NewT(t)\n\n\tconst testDomain = \"test.com\"\n\ttestURL := \"http://test\"\n\tclient := NewAcmeClientMock(mc)\n\tclient.AuthorizeOrderMock.Set(func(ctx context.Context, id []acme.AuthzID, opt ...acme.OrderOption) (op1 *acme.Order, err error) {\n\t\tif len(id) == 1 && id[0].Value == testDomain {\n\t\t\treturn &acme.Order{\n\t\t\t\tStatus: acme.StatusPending,\n\t\t\t\tAuthzURLs: []string{testURL},\n\t\t\t}, nil\n\t\t}\n\t\tt.Fatalf(\"Unexpected args: %#v\", id)\n\t\treturn nil, errors.New(\"Unexpected args\")\n\t})\n\n\ttestErr := xerrors.New(\"testErr\")\n\tclient.GetAuthorizationMock.Set(func(ctx context.Context, url string) (ap1 *acme.Authorization, err error) {\n\t\tif url != testURL {\n\t\t\tt.Fatalf(\"Unexpected args: %#v\", url)\n\t\t}\n\t\treturn nil, testErr\n\t})\n\n\tm := &Manager{}\n\tres, err := m.createOrderForDomains(ctx, client, testDomain)\n\ttd.Nil(res)\n\ttd.True(xerrors.Is(err, testErr))\n}", "title": "" }, { "docid": "1311e03706b5c1fd578f7cb5d29e249d", "score": "0.5232145", "text": "func TestProcessQueryNegative(t *testing.T) {\n\tnumbers := []int{1, 2, 3}\n\tendpoint := \"/foo\"\n\tu := url.URL{\n\t\tScheme: \"http\",\n\t\tHost: fmt.Sprintf(\"localhost:%s\", port1),\n\t\tPath: endpoint,\n\t}\n\n\tgo mockServer(endpoint, port1, numbers)\n\texpected, _ := json.Marshal(Results{Numbers: numbers})\n\tresp := processQuery(map[string][]string{\"uu\": []string{u.String()}})\n\n\tif len(resp) == len(expected) {\n\t\tt.Fail()\n\t}\n\n\tif len(resp) != 0 {\n\t\tt.Fail()\n\t}\n}", "title": "" }, { "docid": "257d4516cf933ebf328b49d1fc575679", "score": "0.52310914", "text": "func (o *GetAnswersFromUserAnsweredTestParams) validateOrderByAnswer(formats strfmt.Registry) error {\n\n\tif err := validate.EnumCase(\"orderByAnswer\", \"query\", *o.OrderByAnswer, []interface{}{\"newStartDate\", \"oldStartDate\", \"morePuntuacion\", \"lessPuntuacion\", \"moreDuracion\", \"lessDuracion\"}, true); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7a18d7ca03ef2ef8c51a64180c6cf7c3", "score": "0.5211563", "text": "func TestWsAuthCancelOrder(t *testing.T) {\n\tsetupWSTestAuth(t)\n\tif !canManipulateRealOrders {\n\t\tt.Skip(\"API keys set, canManipulateRealOrders false, skipping test\")\n\t}\n\tord := &WsCancelOrderParameters{\n\t\tCurrency: currency.NewPair(currency.LTC, currency.BTC),\n\t\tOrderID: 1,\n\t}\n\tresp, err := c.wsCancelOrder(ord)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(resp.Status) >= 1 && resp.Status[0] != \"OK\" {\n\t\tt.Errorf(\"Failed to cancel order\")\n\t}\n}", "title": "" }, { "docid": "7a18d7ca03ef2ef8c51a64180c6cf7c3", "score": "0.5211563", "text": "func TestWsAuthCancelOrder(t *testing.T) {\n\tsetupWSTestAuth(t)\n\tif !canManipulateRealOrders {\n\t\tt.Skip(\"API keys set, canManipulateRealOrders false, skipping test\")\n\t}\n\tord := &WsCancelOrderParameters{\n\t\tCurrency: currency.NewPair(currency.LTC, currency.BTC),\n\t\tOrderID: 1,\n\t}\n\tresp, err := c.wsCancelOrder(ord)\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif len(resp.Status) >= 1 && resp.Status[0] != \"OK\" {\n\t\tt.Errorf(\"Failed to cancel order\")\n\t}\n}", "title": "" }, { "docid": "2258ca74aa894e884cf403225cdf88d3", "score": "0.52022475", "text": "func (e OrderValidationError) Reason() string { return e.reason }", "title": "" }, { "docid": "f4a30f4bd00a3ecabe463bc1525457ba", "score": "0.51891255", "text": "func Test_IndexQuery_Range(t *testing.T) {\n\t// Set up 100 orders with increasing department, customer and shipping fee\n\t// and save\n\tvar orders []tormenta.Tormentable\n\n\tfor i := 0; i < 100; i++ {\n\t\torders = append(orders, &demo.Order{\n\t\t\tDepartment: i + 1,\n\t\t\tCustomer: fmt.Sprintf(\"customer-%v\", string((i%26)+65)),\n\t\t\tShippingFee: float64(i) + 0.99,\n\t\t})\n\t}\n\n\t// Randomise order before saving,\n\t// to ensure save order is not affecting retrieval\n\t// in some roundabout way\n\ttormenta.RandomiseTormentables(orders)\n\n\tdb, _ := tormenta.OpenTest(\"data/tests\")\n\tdefer db.Close()\n\tdb.Save(orders...)\n\n\ttestCases := []struct {\n\t\ttestName string\n\t\tindexName string\n\t\tstart, end interface{}\n\t\texpected int\n\t\texpectedError error\n\t}{\n\t\t// FORWARD\n\n\t\t// Non existent index\n\t\t{\"non existent index - no range\", \"notanindex\", nil, nil, 0, errors.New(tormenta.ErrNilInputsRangeIndexQuery)},\n\t\t{\"non existent index\", \"notanindex\", 1, 2, 0, nil},\n\n\t\t// Int\n\t\t{\"integer - no range\", \"department\", nil, nil, 0, errors.New(tormenta.ErrNilInputsRangeIndexQuery)},\n\t\t{\"integer - from 1\", \"department\", 1, nil, 100, nil},\n\t\t{\"integer - from 2\", \"department\", 2, nil, 99, nil},\n\t\t{\"integer - from 50\", \"department\", 50, nil, 51, nil},\n\t\t{\"integer - 1 to 2\", \"department\", 1, 2, 2, nil},\n\t\t{\"integer - 50 to 59\", \"department\", 50, 59, 10, nil},\n\t\t{\"integer - 1 to 100\", \"department\", 1, 100, 100, nil},\n\t\t{\"integer - to 50\", \"department\", nil, 50, 50, nil},\n\n\t\t// String\n\t\t{\"string - no range\", \"customer\", nil, nil, 0, errors.New(tormenta.ErrNilInputsRangeIndexQuery)},\n\t\t{\"string\", \"customer\", \"customer\", nil, 100, nil},\n\t\t{\"string - from A\", \"customer\", \"customer-A\", nil, 100, nil},\n\t\t{\"string - from B\", \"customer\", \"customer-B\", nil, 96, nil},\n\t\t{\"string - from Z\", \"customer\", \"customer-Z\", nil, 3, nil},\n\t\t{\"string - from A to Z\", \"customer\", \"customer-A\", \"customer-Z\", 100, nil},\n\t\t{\"string - to Z\", \"customer\", nil, \"customer-Z\", 100, nil},\n\n\t\t// Float\n\t\t{\"float - no range\", \"shippingfee\", nil, nil, 0, errors.New(tormenta.ErrNilInputsRangeIndexQuery)},\n\t\t{\"float\", \"shippingfee\", 0, nil, 100, nil},\n\t\t{\"float\", \"shippingfee\", 0.99, nil, 100, nil},\n\t\t{\"float - from 1.99\", \"shippingfee\", 1.99, nil, 99, nil},\n\t\t{\"float - from 50.99\", \"shippingfee\", 50.99, nil, 50, nil},\n\t\t{\"float - from 99.99\", \"shippingfee\", 99.99, nil, 1, nil},\n\t\t{\"float - to 20.99\", \"shippingfee\", nil, 20.99, 21, nil},\n\t}\n\n\tfor _, testCase := range testCases {\n\t\trangequeryResults := []demo.Order{}\n\t\tq := db.\n\t\t\tFind(&rangequeryResults).\n\t\t\tRange(testCase.indexName, testCase.start, testCase.end)\n\n\t\t// Forwards\n\t\tn, _, err := q.Run()\n\n\t\tif testCase.expectedError != nil && err == nil {\n\t\t\tt.Errorf(\"Testing %s. Expected error [%v] but got none\", testCase.testName, testCase.expectedError)\n\t\t}\n\n\t\tif testCase.expectedError == nil && err != nil {\n\t\t\tt.Errorf(\"Testing %s. Didn't expect error [%v]\", testCase.testName, err)\n\t\t}\n\n\t\t// Check for correct number of returned results\n\t\tif n != testCase.expected {\n\t\t\tt.Errorf(\"Testing %s (number orders retrieved). Expected %v - got %v\", testCase.testName, testCase.expected, n)\n\t\t}\n\n\t\t// Check each member of the results for nil ID, customer and shipping fee\n\t\tfor i, order := range rangequeryResults {\n\t\t\tif order.ID.IsNil() {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has nil ID\", testCase.testName, i)\n\t\t\t}\n\n\t\t\tif order.Department == 0 {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has 0 department\", testCase.testName, i)\n\t\t\t}\n\n\t\t\tif order.Customer == \"\" {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has blank customer\", testCase.testName, i)\n\t\t\t}\n\n\t\t\tif order.ShippingFee == 0.0 {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has 0 shipping fee\", testCase.testName, i)\n\t\t\t}\n\t\t}\n\n\t\t// Reverse\n\t\trn, _, err := q.Reverse().Run()\n\n\t\tif testCase.expectedError != nil && err == nil {\n\t\t\tt.Errorf(\"Testing %s. Expected error [%v] but got none\", testCase.testName, testCase.expectedError)\n\t\t}\n\n\t\tif testCase.expectedError == nil && err != nil {\n\t\t\tt.Errorf(\"Testing %s. Didn't expect error [%v]\", testCase.testName, err)\n\t\t}\n\n\t\t// Check for correct number of returned results\n\t\tif n != testCase.expected {\n\t\t\tt.Errorf(\"Testing %s (number orders retrieved). Expected %v - got %v\", testCase.testName, testCase.expected, rn)\n\t\t}\n\n\t\t// Check each member of the results for nil ID, customer and shipping fee\n\t\tfor i, order := range rangequeryResults {\n\t\t\tif order.ID.IsNil() {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has nil ID\", testCase.testName, i)\n\t\t\t}\n\n\t\t\tif order.Department == 0 {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has 0 department\", testCase.testName, i)\n\t\t\t}\n\n\t\t\tif order.Customer == \"\" {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has blank customer\", testCase.testName, i)\n\t\t\t}\n\n\t\t\tif order.ShippingFee == 0.0 {\n\t\t\t\tt.Errorf(\"Testing %s. Order no %v has 0 shipping fee\", testCase.testName, i)\n\t\t\t}\n\t\t}\n\n\t}\n\n}", "title": "" }, { "docid": "b1de9387ba3d574c92a62f2a192c7164", "score": "0.5179659", "text": "func TestExecutor_Execute_Not(t *testing.T) {\n}", "title": "" }, { "docid": "59cdc84cb806e2075538c64523670b17", "score": "0.51693636", "text": "func Test_OperationAccepted_LongRunningOperationFails(t *testing.T) {\n\tt.Parallel()\n\n\ttc := globalTestContext.ForTest(t)\n\trg := tc.CreateTestResourceGroupAndWait()\n\tacct := newStorageAccountWithInvalidKeyExpiration(tc, rg)\n\ttc.CreateResourceAndWaitForFailure(acct)\n\n\tready, ok := conditions.GetCondition(acct, conditions.ConditionTypeReady)\n\ttc.Expect(ok).To(BeTrue())\n\n\ttc.Expect(ready.Status).To(Equal(metav1.ConditionFalse))\n\ttc.Expect(ready.Severity).To(Equal(conditions.ConditionSeverityError))\n\ttc.Expect(ready.Reason).To(Equal(\"InvalidValuesForRequestParameters\"))\n\ttc.Expect(ready.Message).To(ContainSubstring(\"Values for request parameters are invalid: keyPolicy.keyExpirationPeriodInDays.\"))\n}", "title": "" }, { "docid": "d82d9f58817e84ae282d982c58e2b594", "score": "0.5152312", "text": "func TestWsGetOrderList(t *testing.T) {\n\tsetupWsTests(t)\n\tresp, err := h.wsGetOrdersList(1, currency.NewPairFromString(\"ethbtc\"))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif resp.ErrorCode > 0 {\n\t\tt.Error(resp.ErrorMessage)\n\t}\n}", "title": "" }, { "docid": "b41723fea687dd08b027455736b50f41", "score": "0.51345754", "text": "func validateQueries(args ...string) (*services.ArticleListQueryParams, error) {\n\tlimit := Limit(args[0])\n\tif err := limit.Valid(); err != nil {\n\t\treturn nil, err\n\t}\n\n\toffset := Offset(args[1])\n\tif err := offset.Valid(); err != nil {\n\t\treturn nil, err\n\t}\n\n\tsort := Sort(args[2])\n\tif err := sort.Valid(); err != nil {\n\t\treturn nil, err\n\t}\n\n\torder := Order(args[3])\n\tif err := order.Valid(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &services.ArticleListQueryParams{\n\t\tSort: sort.String(),\n\t\tOrder: order.String(),\n\t\tLimit: limit.Int(),\n\t\tOffset: offset.Int()}, nil\n}", "title": "" }, { "docid": "66a23987665fd0763fc141e8e3e5e387", "score": "0.51147324", "text": "func TestGateIO_GetOrder(t *testing.T) {\n\t//apiKey := os.Getenv(\"apiKey\")\n\t//secretKey := os.Getenv(\"secretKey\")\n\t//host := os.Getenv(\"host\")\n\tsymbol := os.Getenv(\"symbol\")\n\torderId_ := os.Getenv(\"order\")\n\tid, err := strconv.ParseUint(orderId_, 10, 64)\n\trequire.NoError(t, err)\n\t//t.Logf(\"apiKey: %s, secretKey: %s\", apiKey, secretKey)\n\t//g := New(apiKey, secretKey, host)\n\n\torder, err := g.GetOrder(id, symbol)\n\trequire.NoError(t, err)\n\tb, err := json.MarshalIndent(order, \"\", \"\\t\")\n\trequire.NoError(t, err)\n\tt.Logf(\"order is %s\", string(b))\n}", "title": "" }, { "docid": "540afcbdfe82361253a1b8fbbe996d1e", "score": "0.5111276", "text": "func (t *trade) Query_GetOneOrder(req *pty.ReqAddrAssets) (types.Message, error) {\r\n\treturn t.GetOneOrder(req)\r\n}", "title": "" }, { "docid": "76d3881869f4e01bdd76bc3508a8860b", "score": "0.5111249", "text": "func TestQueryParamsMissing(t *testing.T) {\n\t_, _, xeService, ctrl := setupTestServer(t)\n\tdefer ctrl.Finish()\n\n\tgo xeService.Run()\n\tdefer xeService.Stop()\n\n\tconvertResp := &model.ConvertResp{}\n\turlNoQueryParam := \"http://localhost:3000/convert\"\n\thttpClient := client.NewHTTPClient()\n\tresp, err := httpClient.GET(urlNoQueryParam, convertResp)\n\n\texpJSON := `{\"error\":\"invalid query parameter - currency must be provided\"}`\n\tassert.Error(t, err)\n\tassert.Equal(t, http.StatusBadRequest, resp.StatusCode())\n\tassert.Equal(t, expJSON, string(resp.Body()))\n}", "title": "" }, { "docid": "afd289bd90a31c4114d8ce5b54919e32", "score": "0.51111346", "text": "func TestWsAuthCancelOrders(t *testing.T) {\n\tsetupWSTestAuth(t)\n\tif !canManipulateRealOrders {\n\t\tt.Skip(\"API keys set, canManipulateRealOrders false, skipping test\")\n\t}\n\tord := WsCancelOrderParameters{\n\t\tCurrency: currency.NewPair(currency.LTC, currency.BTC),\n\t\tOrderID: 1,\n\t}\n\torder2 := WsCancelOrderParameters{\n\t\tCurrency: currency.NewPair(currency.LTC, currency.BTC),\n\t\tOrderID: 2,\n\t}\n\tresp, err := c.wsCancelOrders([]WsCancelOrderParameters{ord, order2})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif resp.Status[0] != \"OK\" {\n\t\tt.Error(\"Order failed to cancel\")\n\t}\n}", "title": "" }, { "docid": "afd289bd90a31c4114d8ce5b54919e32", "score": "0.51111346", "text": "func TestWsAuthCancelOrders(t *testing.T) {\n\tsetupWSTestAuth(t)\n\tif !canManipulateRealOrders {\n\t\tt.Skip(\"API keys set, canManipulateRealOrders false, skipping test\")\n\t}\n\tord := WsCancelOrderParameters{\n\t\tCurrency: currency.NewPair(currency.LTC, currency.BTC),\n\t\tOrderID: 1,\n\t}\n\torder2 := WsCancelOrderParameters{\n\t\tCurrency: currency.NewPair(currency.LTC, currency.BTC),\n\t\tOrderID: 2,\n\t}\n\tresp, err := c.wsCancelOrders([]WsCancelOrderParameters{ord, order2})\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tif resp.Status[0] != \"OK\" {\n\t\tt.Error(\"Order failed to cancel\")\n\t}\n}", "title": "" }, { "docid": "8499a8ed8ce08a099eedff1908aa4b08", "score": "0.5095737", "text": "func Test_ParseAdapterIndex_Invalid(t *testing.T) {\n\t_, err := device.ParseAdapterIndex(\"xyz1\")\n\n\tassert.NotNil(t, err)\n}", "title": "" }, { "docid": "dbdae59d11bb4543626584a2d423d787", "score": "0.5088417", "text": "func (e OrderResultValidationError) Cause() error { return e.cause }", "title": "" }, { "docid": "3808e9d87dd7fd1fe4e3f164cddf4039", "score": "0.5087863", "text": "func TestReorderSlidesInvalidOldPositions(t *testing.T) {\n testname, _ := createTestParamValue(\"ReorderSlides\", \"name\", \"string\").(string)\n testoldPositions, _ := createTestParamValue(\"ReorderSlides\", \"oldPositions\", \"[]int32\").([]int32)\n testnewPositions, _ := createTestParamValue(\"ReorderSlides\", \"newPositions\", \"[]int32\").([]int32)\n testpassword, _ := createTestParamValue(\"ReorderSlides\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReorderSlides\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReorderSlides\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testoldPositions, \"ReorderSlides\", \"oldPositions\", \"[]int32\")\n if (invalidValue == nil) {\n testoldPositions = nil\n } else {\n testoldPositions, _ = invalidValue.([]int32)\n }\n\n e := InitializeTest(\"ReorderSlides\", \"oldPositions\", testoldPositions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReorderSlides(testname, testoldPositions, testnewPositions, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReorderSlides\", \"oldPositions\", \"[]int32\", testoldPositions, int32(statusCode), e)\n}", "title": "" }, { "docid": "fdb89d5d428a51966d1759219907ef88", "score": "0.50845504", "text": "func (m *Msg) AssertQuery(query string) *Msg {\n\tm.AssertNoPath(\"error\")\n\tmr := m.PathPayload(\"result.query\")\n\tAssertEqualJSON(m.c.t, \"result query\", mr, query)\n\treturn m\n}", "title": "" }, { "docid": "7b2373433bfb6570b1114f860793bdd1", "score": "0.5071403", "text": "func TestDeleteCommentsInvalidAuthor(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteComments\", \"name\", \"string\").(string)\n testauthor, _ := createTestParamValue(\"DeleteComments\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteComments\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteComments\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteComments\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testauthor, \"DeleteComments\", \"author\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testauthor = nullValue\n } else {\n testauthor, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DeleteComments\", \"author\", testauthor)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.DeleteComments(testname, testauthor, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteComments\", \"author\", \"string\", testauthor, int32(statusCode), e)\n}", "title": "" }, { "docid": "e218ed5c5e9235d47c367fb10988a527", "score": "0.5055571", "text": "func (c *Context) HandleQueryOrder() (hasOrder bool) {\n\torders := strings.Split(c.Query.Get(\"ob\"), \".\")\n\tl := len(orders)\n\tif l < 1 || l > 2 {\n\t\treturn\n\t}\n\n\tif col, ok := c.Resource.View.HasCol(orders[0]); ok {\n\t\torder := goqu.I(col)\n\t\tif l == 2 && orders[1] == \"desc\" {\n\t\t\tc.DS = c.DS.Order(order.Desc())\n\t\t} else {\n\t\t\tc.DS = c.DS.Order(order.Asc())\n\t\t}\n\t\treturn true\n\t}\n\treturn\n}", "title": "" }, { "docid": "8afa002dd07f4f41a2707eb0b1c5cb2a", "score": "0.5047507", "text": "func Test_AskInputErrorAfterResult(t *testing.T) {\n\tinputOp := &mockQueryOp{\n\t\tcols: Columns{varS},\n\t\texec: func(_ context.Context, _ valueBinder, resCh chan<- ResultChunk) error {\n\t\t\tresCh <- ResultChunk{\n\t\t\t\tColumns: Columns{varS},\n\t\t\t\tValues: []Value{kidVal(10)},\n\t\t\t\toffsets: []uint32{0},\n\t\t\t\tFacts: []FactSet{fs(1)},\n\t\t\t}\n\t\t\tclose(resCh)\n\t\t\treturn errors.New(\"rpc failed\")\n\t\t},\n\t}\n\tres := resultsCollector{t: t}\n\taskOp := newAsk(&plandef.Ask{Out: inputOp.columns()[0]}, []queryOperator{inputOp})\n\terr := askOp.execute(ctx, new(defaultBinder), &res)\n\tassert.EqualError(t, err, \"rpc failed\")\n}", "title": "" }, { "docid": "5ab7a26932563981a458897420da6cd3", "score": "0.50471765", "text": "func (e OrderFieldValidationError) Reason() string { return e.reason }", "title": "" }, { "docid": "1103bf76c35b5c14f90d2a682e007557", "score": "0.50355715", "text": "func Test_AskCancelledErr(t *testing.T) {\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\tinputOp := &mockQueryOp{\n\t\tcols: Columns{varS},\n\t\texec: func(ctx context.Context, _ valueBinder, resCh chan<- ResultChunk) error {\n\t\t\t// once ask op is executing the input op, we cause the root context to be cancelled\n\t\t\tcancel()\n\t\t\tclose(resCh)\n\t\t\treturn ctx.Err()\n\t\t},\n\t}\n\tres := resultsCollector{t: t}\n\taskOp := newAsk(&plandef.Ask{Out: inputOp.columns()[0]}, []queryOperator{inputOp})\n\terr := askOp.execute(ctx, new(defaultBinder), &res)\n\tassert.Equal(t, context.Canceled, err, \"AskOp was cancelled by caller, AskOp should report cancelled as the error\")\n}", "title": "" }, { "docid": "db0bb09a61412ad96d002db1b2485b30", "score": "0.5034044", "text": "func TestValidateOrderAccountIsolation(t *testing.T) {\n\tt.Parallel()\n\n\torderStore := newMockStore()\n\torderManager := NewManager(&ManagerConfig{\n\t\tStore: orderStore,\n\t})\n\n\t// We'll now create two accounts, one that's 1 BTC in size, while the\n\t// other is 2 BTC.\n\taccountA := account.Account{\n\t\tValue: btcutil.SatoshiPerBitcoin,\n\t\tTraderKey: &keychain.KeyDescriptor{\n\t\t\tPubKey: acctKeySmall,\n\t\t},\n\t}\n\taccountB := account.Account{\n\t\tValue: btcutil.SatoshiPerBitcoin * 2,\n\t\tTraderKey: &keychain.KeyDescriptor{\n\t\t\tPubKey: acctKeyBig,\n\t\t},\n\t}\n\n\t// We'll now create an order that will consume at least half (1100\n\t// units is 1.1 BTC) of account B (it's an ask order).\n\tvar acctKeyB [33]byte\n\tcopy(acctKeyB[:], acctKeyBig.SerializeCompressed())\n\torderB := &Ask{\n\t\tKit: newKitFromTemplate(Nonce{0x01}, &Kit{\n\t\t\tState: StateSubmitted,\n\t\t\tUnitsUnfulfilled: 1100,\n\t\t\tFixedRate: 2_000,\n\t\t\tMaxBatchFeeRate: 1000,\n\t\t\tAcctKey: acctKeyB,\n\t\t\tLeaseDuration: 144,\n\t\t\tMinUnitsMatch: 100,\n\t\t}),\n\t}\n\n\ttestTerms := &terms.AuctioneerTerms{\n\t\tOrderExecBaseFee: 1,\n\t\tOrderExecFeeRate: 100,\n\t\tLeaseDurationBuckets: map[uint32]auctioneerrpc.DurationBucketState{\n\t\t\t144: auctioneerrpc.DurationBucketState_MARKET_OPEN,\n\t\t},\n\t}\n\n\t// Submitting this order for account B should pass validation.\n\terr := orderManager.validateOrder(orderB, &accountB, testTerms)\n\tif err != nil {\n\t\tt.Fatalf(\"order B validation failed: %v\", err)\n\t}\n\n\t// Simulating order acceptance, we'll now add this order to the order\n\t// store.\n\tif err := orderStore.SubmitOrder(orderB); err != nil {\n\t\tt.Fatalf(\"unable to submit order: %v\", err)\n\t}\n\n\t// Next, we'll create a ask that'll consume _most_ (but not all) of account\n\t// A's balance. This should pass validation as although account B can't\n\t// handle the order account A can.\n\tvar acctKeyA [33]byte\n\tcopy(acctKeyA[:], acctKeySmall.SerializeCompressed())\n\torderA := &Ask{\n\t\tKit: newKitFromTemplate(Nonce{0x01}, &Kit{\n\t\t\tState: StateSubmitted,\n\t\t\tUnitsUnfulfilled: 800,\n\t\t\tFixedRate: 2_000,\n\t\t\tMaxBatchFeeRate: 1000,\n\t\t\tAcctKey: acctKeyA,\n\t\t\tLeaseDuration: 144,\n\t\t\tMinUnitsMatch: 100,\n\t\t}),\n\t}\n\n\terr = orderManager.validateOrder(orderA, &accountA, testTerms)\n\tif err != nil {\n\t\tt.Fatalf(\"order A failed validation: %v\", err)\n\t}\n}", "title": "" }, { "docid": "0e18998d653f1ce7b65ff2b7b0e46ff9", "score": "0.5033836", "text": "func shortCircuitTestAfterQuery(query string, dbClient *binlogplayer.MockDBClient) {\n\tdbClient.ExpectRequest(query, singleRowAffected, fmt.Errorf(\"Short circuiting test\"))\n\tdbClient.ExpectRequest(\"update _vt.vdiff set state = 'error', last_error = 'Short circuiting test' where id = 1\", singleRowAffected, nil)\n\tdbClient.ExpectRequest(\"insert into _vt.vdiff_log(vdiff_id, message) values (1, 'State changed to: error')\", singleRowAffected, nil)\n\tdbClient.ExpectRequest(\"insert into _vt.vdiff_log(vdiff_id, message) values (1, 'Error: Short circuiting test')\", singleRowAffected, nil)\n}", "title": "" }, { "docid": "706a0d40867d7acb9b61df69d6000b3e", "score": "0.50312954", "text": "func TestOrderBy_AddUnknownFail(t *testing.T) {\n\torderBy := common.OrderBy{}\n\tnotOk(t, orderBy.Add(\"Unknown\"))\n}", "title": "" }, { "docid": "457a3b272f67037de4af08a602a9a0b1", "score": "0.5024562", "text": "func expecedFail(t *testing.T, contract *backend.Contract, key *ecdsa.PrivateKey, method string, arg ...interface{}) {\n\tr, err := contract.Execute(key, method, arg...)\n\tassert.NoError(t, err)\n\tassert.True(t, r.Status == 0)\n}", "title": "" }, { "docid": "eb5836cf0acf8eec0342bcd62fb5f666", "score": "0.5018479", "text": "func TestDeleteSlideCommentsOnlineInvalidAuthor(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"slideIndex\", \"int32\").(int32)\n testauthor, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testauthor, \"DeleteSlideCommentsOnline\", \"author\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testauthor = nullValue\n } else {\n testauthor, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DeleteSlideCommentsOnline\", \"author\", testauthor)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteSlideCommentsOnline(testdocument, testslideIndex, testauthor, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteSlideCommentsOnline\", \"author\", \"string\", testauthor, int32(statusCode), e)\n}", "title": "" }, { "docid": "b6110c1b37d07343be35c6e24fe23c86", "score": "0.50173587", "text": "func WrongQueryExecutor(driver neo4j.Driver) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, false, neo4j.AccessModeRead, ctx)\n\t\tdefer session.Close()\n\n\t\tresult, err := session.Run(\"RETURN wrongThing\", nil)\n\t\tExpect(err).To(BeNil())\n\n\t\t_, err = result.Consume()\n\t\tExpect(err).To(BeSyntaxError())\n\t}\n}", "title": "" }, { "docid": "3494ae0bb79fa7058e94416049a232b2", "score": "0.5016043", "text": "func XpYunQueryOrderStateTest() {\n\trequest := model.QueryOrderStateRequest{}\n\trequest.User = USER_NAME\n\trequest.UserKey = USER_KEY\n\trequest.Timestamp = util.GetMillisecond()\n\trequest.GenerateSign()\n\n\t// *Required*: The order ID is returned by the “print order” interface.\n\trequest.OrderId = \"OM20100318260450986272\"\n\n\tresult := service.XpYunQueryOrderState(&request)\n\tfmt.Println(result.HttpStatusCode)\n\tfmt.Println(result.Content.Code)\n\tfmt.Println(result.Content.Msg)\n\n\t//resp.data: True indicates return after printed and false indicates return not printed.\n\tfmt.Println(fmt.Sprintf(\"%+v\", result.Content.Data))\n}", "title": "" }, { "docid": "f30a31374a3e24c3e96dd24c7649dc33", "score": "0.49933943", "text": "func TestDeleteCommentsOnlineInvalidAuthor(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DeleteCommentsOnline\", \"document\", \"[]byte\").([]byte)\n testauthor, _ := createTestParamValue(\"DeleteCommentsOnline\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteCommentsOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testauthor, \"DeleteCommentsOnline\", \"author\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testauthor = nullValue\n } else {\n testauthor, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DeleteCommentsOnline\", \"author\", testauthor)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteCommentsOnline(testdocument, testauthor, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteCommentsOnline\", \"author\", \"string\", testauthor, int32(statusCode), e)\n}", "title": "" }, { "docid": "b989138f585441b82de73baec2a60768", "score": "0.4991902", "text": "func TestDeleteSlideCommentsInvalidAuthor(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteSlideComments\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteSlideComments\", \"slideIndex\", \"int32\").(int32)\n testauthor, _ := createTestParamValue(\"DeleteSlideComments\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteSlideComments\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteSlideComments\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteSlideComments\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testauthor, \"DeleteSlideComments\", \"author\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testauthor = nullValue\n } else {\n testauthor, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DeleteSlideComments\", \"author\", testauthor)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteSlideComments(testname, testslideIndex, testauthor, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteSlideComments\", \"author\", \"string\", testauthor, int32(statusCode), e)\n}", "title": "" }, { "docid": "8fa5670dc0b1dfa615fbab9c357ea18a", "score": "0.49866498", "text": "func TestReorderSlidesInvalidStorage(t *testing.T) {\n testname, _ := createTestParamValue(\"ReorderSlides\", \"name\", \"string\").(string)\n testoldPositions, _ := createTestParamValue(\"ReorderSlides\", \"oldPositions\", \"[]int32\").([]int32)\n testnewPositions, _ := createTestParamValue(\"ReorderSlides\", \"newPositions\", \"[]int32\").([]int32)\n testpassword, _ := createTestParamValue(\"ReorderSlides\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReorderSlides\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReorderSlides\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"ReorderSlides\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReorderSlides\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReorderSlides(testname, testoldPositions, testnewPositions, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReorderSlides\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "bc6b3e045713c3fe92c9043487657f80", "score": "0.49860823", "text": "func TestDeleteSmartArtNodeInvalidSmartArtIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteSmartArtNode\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteSmartArtNode\", \"slideIndex\", \"int32\").(int32)\n testsmartArtIndex, _ := createTestParamValue(\"DeleteSmartArtNode\", \"smartArtIndex\", \"int32\").(int32)\n testnodeIndex, _ := createTestParamValue(\"DeleteSmartArtNode\", \"nodeIndex\", \"int32\").(int32)\n testsubNode, _ := createTestParamValue(\"DeleteSmartArtNode\", \"subNode\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteSmartArtNode\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteSmartArtNode\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteSmartArtNode\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testsmartArtIndex, \"DeleteSmartArtNode\", \"smartArtIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testsmartArtIndex = nullValue\n } else {\n testsmartArtIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteSmartArtNode\", \"smartArtIndex\", testsmartArtIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteSmartArtNode(testname, testslideIndex, testsmartArtIndex, testnodeIndex, testsubNode, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteSmartArtNode\", \"smartArtIndex\", \"int32\", testsmartArtIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "23d7cd7b74b1290019cd591d14cd08e7", "score": "0.49848077", "text": "func TestReorderSlidesInvalidNewPositions(t *testing.T) {\n testname, _ := createTestParamValue(\"ReorderSlides\", \"name\", \"string\").(string)\n testoldPositions, _ := createTestParamValue(\"ReorderSlides\", \"oldPositions\", \"[]int32\").([]int32)\n testnewPositions, _ := createTestParamValue(\"ReorderSlides\", \"newPositions\", \"[]int32\").([]int32)\n testpassword, _ := createTestParamValue(\"ReorderSlides\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReorderSlides\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReorderSlides\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testnewPositions, \"ReorderSlides\", \"newPositions\", \"[]int32\")\n if (invalidValue == nil) {\n testnewPositions = nil\n } else {\n testnewPositions, _ = invalidValue.([]int32)\n }\n\n e := InitializeTest(\"ReorderSlides\", \"newPositions\", testnewPositions)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReorderSlides(testname, testoldPositions, testnewPositions, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReorderSlides\", \"newPositions\", \"[]int32\", testnewPositions, int32(statusCode), e)\n}", "title": "" }, { "docid": "64ac50d8f95c9f222bff0d3306f8f51b", "score": "0.49590328", "text": "func Test_ORD94_1ch_3ord_kafka_3kbs(t *testing.T) {\n go stopAndStartAllTargetOneAtATime(\"kafka\", 4)\n spyOnOrdererAfterSecs(1, 450)\n passResult, finalResultSummaryString := ote(\"ORD-94\", 350000, 1, 3, \"kafka\", 4, spyDefer, 1, 0 )\n if !passResult { t.Error(finalResultSummaryString) }\n}", "title": "" }, { "docid": "3c7ebdb67a4bac3727add3b128a5fb1e", "score": "0.49564305", "text": "func (v *batchVerifier) validateMatchedOrder(tally *AccountTally,\n\tourOrder Order, otherOrder *MatchedOrder, executionFee terms.FeeSchedule,\n\tclearingPrice FixedRatePremium) error {\n\n\t// Order type must be opposite.\n\tif otherOrder.Order.Type() == ourOrder.Type() {\n\t\treturn fmt.Errorf(\"order %v matched same type \"+\n\t\t\t\"orders\", ourOrder.Nonce())\n\t}\n\n\t// Make sure we weren't matched to our own order.\n\tif otherOrder.NodeKey == v.ourNodePubkey {\n\t\treturn fmt.Errorf(\"other order is an order from our node\")\n\t}\n\n\t// Verify that the durations overlap. Then tally up all the fees and\n\t// units that were paid/accrued in this matched order pair. We can\n\t// safely cast orders here because we made sure we have the right types\n\t// in the previous step.\n\tswitch ours := ourOrder.(type) {\n\tcase *Ask:\n\t\tother := otherOrder.Order.(*Bid)\n\t\tif other.LeaseDuration != ours.LeaseDuration {\n\t\t\treturn fmt.Errorf(\"order duration not overlapping \" +\n\t\t\t\t\"for our ask\")\n\t\t}\n\n\t\t// The ask's price cannot be higher than the bid's price.\n\t\tif ours.FixedRate > other.FixedRate {\n\t\t\treturn fmt.Errorf(\"ask price greater than bid price\")\n\t\t}\n\n\t\t// This match checks out, deduct it from the account's balance.\n\t\ttally.CalcMakerDelta(\n\t\t\texecutionFee, clearingPrice,\n\t\t\totherOrder.UnitsFilled.ToSatoshis(),\n\t\t\tother.LeaseDuration,\n\t\t)\n\n\tcase *Bid:\n\t\tother := otherOrder.Order.(*Ask)\n\t\tif other.LeaseDuration != ours.LeaseDuration {\n\t\t\treturn fmt.Errorf(\"order duration not overlapping \" +\n\t\t\t\t\"for our bid\")\n\t\t}\n\n\t\t// The ask's price cannot be higher than the bid's price.\n\t\tif other.FixedRate > ours.FixedRate {\n\t\t\treturn fmt.Errorf(\"ask price greater than bid price\")\n\t\t}\n\n\t\t// This match checks out, deduct it from the account's balance.\n\t\ttally.CalcTakerDelta(\n\t\t\texecutionFee, clearingPrice,\n\t\t\totherOrder.UnitsFilled.ToSatoshis(),\n\t\t\tours.SelfChanBalance, ours.LeaseDuration,\n\t\t)\n\t}\n\n\t// Everything checks out so far.\n\treturn nil\n}", "title": "" }, { "docid": "7a15b7b985c013855c48d641331ef108", "score": "0.4946454", "text": "func (api *KrakenApi) ApiQueryOrders(trades bool, userref string, txid string) (*QueryOrder, error) {\n\tparams := url.Values{}\n\tif trades {\n\t\tparams.Set(\"trades\", \"true\")\n\t}\n\tif userref != \"\" {\n\t\tparams.Set(\"userref\", userref)\n\t}\n\tparams.Set(\"txid\", txid)\n\n\tresp, err := api.Query(URL_PRIVATE_QUERY_ORDERS, params, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontent, err := parse(resp, &QueryOrder{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn content.(*QueryOrder), nil\n}", "title": "" }, { "docid": "dea6c6054bff2bb1590fe7f83130360c", "score": "0.4937726", "text": "func TestBatchInvalidTraceNumberODFI(t *testing.T) {\n\ttestBatchInvalidTraceNumberODFI(t)\n}", "title": "" }, { "docid": "8b15c5d79c31befa825ce4ce4d4a8a75", "score": "0.4937222", "text": "func TestNilQueueClient(t *testing.T) {\n\tserver := Server{nil}\n\n\tctx := context.Background()\n\torder_req := &proto.OrderRequest{UserId: \"123\", Symbol: \"BTC\", Amount: 123}\n\n\t_, err := server.CreateOrder(ctx, order_req)\n\tif err != QueueClientNilError {\n\t\tt.Errorf(\"QueueClientNilError should have been raised.\")\n\t}\n}", "title": "" }, { "docid": "9fca500151af483cdf11351617e140c8", "score": "0.49367586", "text": "func TestReorderSlidesInvalidName(t *testing.T) {\n testname, _ := createTestParamValue(\"ReorderSlides\", \"name\", \"string\").(string)\n testoldPositions, _ := createTestParamValue(\"ReorderSlides\", \"oldPositions\", \"[]int32\").([]int32)\n testnewPositions, _ := createTestParamValue(\"ReorderSlides\", \"newPositions\", \"[]int32\").([]int32)\n testpassword, _ := createTestParamValue(\"ReorderSlides\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReorderSlides\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReorderSlides\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testname, \"ReorderSlides\", \"name\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testname = nullValue\n } else {\n testname, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReorderSlides\", \"name\", testname)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReorderSlides(testname, testoldPositions, testnewPositions, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReorderSlides\", \"name\", \"string\", testname, int32(statusCode), e)\n}", "title": "" }, { "docid": "b1630d913603b7bcf1f9075233e89d9d", "score": "0.49323186", "text": "func TestDeleteSlideCommentsOnlineInvalidSlideIndex(t *testing.T) {\n testdocument, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"document\", \"[]byte\").([]byte)\n testslideIndex, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"slideIndex\", \"int32\").(int32)\n testauthor, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteSlideCommentsOnline\", \"password\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testslideIndex, \"DeleteSlideCommentsOnline\", \"slideIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testslideIndex = nullValue\n } else {\n testslideIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteSlideCommentsOnline\", \"slideIndex\", testslideIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteSlideCommentsOnline(testdocument, testslideIndex, testauthor, testpassword)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteSlideCommentsOnline\", \"slideIndex\", \"int32\", testslideIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "3c90a946ed5d191d9fe61947aba75682", "score": "0.49313265", "text": "func TestOrderedMergeInvalidName(t *testing.T) {\n testname, _ := createTestParamValue(\"OrderedMerge\", \"name\", \"string\").(string)\n testrequest, _ := createTestParamValue(\"OrderedMerge\", \"request\", \"OrderedMergeRequest\").(IOrderedMergeRequest)\n testpassword, _ := createTestParamValue(\"OrderedMerge\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"OrderedMerge\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"OrderedMerge\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testname, \"OrderedMerge\", \"name\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testname = nullValue\n } else {\n testname, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"OrderedMerge\", \"name\", testname)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.OrderedMerge(testname, testrequest, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"OrderedMerge\", \"name\", \"string\", testname, int32(statusCode), e)\n}", "title": "" }, { "docid": "2fda0c5b49bd33ec600b089ee49017b3", "score": "0.49286115", "text": "func TestOrderedMergeInvalidStorage(t *testing.T) {\n testname, _ := createTestParamValue(\"OrderedMerge\", \"name\", \"string\").(string)\n testrequest, _ := createTestParamValue(\"OrderedMerge\", \"request\", \"OrderedMergeRequest\").(IOrderedMergeRequest)\n testpassword, _ := createTestParamValue(\"OrderedMerge\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"OrderedMerge\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"OrderedMerge\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"OrderedMerge\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"OrderedMerge\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.OrderedMerge(testname, testrequest, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"OrderedMerge\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "7e5adada2c997351c4188624ab8e20a4", "score": "0.49234104", "text": "func FailingQueryInTxExecutor(driver neo4j.Driver, useBookmark bool) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, useBookmark, neo4j.AccessModeRead, ctx)\n\t\tdefer session.Close()\n\n\t\ttx := newStressTransaction(session, useBookmark, ctx)\n\t\tdefer tx.Close()\n\n\t\tresult, err := tx.Run(\"UNWIND [10, 5, 0] AS x RETURN 10 / x\", nil)\n\t\tExpect(err).To(BeNil())\n\n\t\tsummary, err := result.Consume()\n\t\tExpect(err).To(BeArithmeticError())\n\t\tExpect(summary).To(BeNil())\n\t}\n}", "title": "" }, { "docid": "bd5472c0c54133a7e7c60709acf4a248", "score": "0.49207085", "text": "func FailingQueryInTxExecutor(driver neo4j.Driver, useBookmark bool) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, useBookmark, neo4j.AccessModeRead, ctx)\n\t\tdefer session.Close()\n\n\t\ttx, err := session.BeginTransaction()\n\t\tExpectNoError(err)\n\t\tdefer tx.Close()\n\n\t\tresult, err := tx.Run(\"UNWIND [10, 5, 0] AS x RETURN 10 / x\", nil)\n\t\tExpectNoError(err)\n\n\t\tsummary, err := result.Consume()\n\t\tExpectNotNil(err)\n\t\t//Expect(err).To(BeArithmeticError())\n\t\tExpectNil(summary)\n\t}\n}", "title": "" }, { "docid": "b52d18339170a71149da12a2005ec1fe", "score": "0.4917453", "text": "func AssertOrderRequired(obj Order) error {\n\telements := map[string]interface{}{\n\t\t\"comment\": obj.Comment,\n\t}\n\tfor name, el := range elements {\n\t\tif isZero := IsZeroValue(el); isZero {\n\t\t\treturn &RequiredError{Field: name}\n\t\t}\n\t}\n\n\tif err := AssertSpecialInfoRequired(obj.SpecialInfo); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "69ff4e08510770c06ed9f1f11c2d5bfa", "score": "0.49120954", "text": "func TestDeleteSlideCommentsInvalidSlideIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteSlideComments\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteSlideComments\", \"slideIndex\", \"int32\").(int32)\n testauthor, _ := createTestParamValue(\"DeleteSlideComments\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteSlideComments\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteSlideComments\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteSlideComments\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testslideIndex, \"DeleteSlideComments\", \"slideIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testslideIndex = nullValue\n } else {\n testslideIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteSlideComments\", \"slideIndex\", testslideIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteSlideComments(testname, testslideIndex, testauthor, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteSlideComments\", \"slideIndex\", \"int32\", testslideIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "f4b6a24734ac58176ed06c2fa742c6e7", "score": "0.49071032", "text": "func Order(order int) SavGolOption {\n\tpanic(\"NYI\")\n}", "title": "" }, { "docid": "320ae7a0bd8441f24c952e21401ea79a", "score": "0.49041596", "text": "func WrongQueryInTxExecutor(driver neo4j.Driver) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, false, neo4j.AccessModeWrite, ctx)\n\t\tdefer session.Close()\n\n\t\ttx := newStressTransaction(session, false, ctx)\n\t\tdefer tx.Close()\n\n\t\tresult, err := tx.Run(\"RETURN wrongThing\", nil)\n\t\tExpect(err).To(BeNil())\n\n\t\t_, err = result.Consume()\n\t\tExpect(err).To(BeSyntaxError())\n\t}\n}", "title": "" }, { "docid": "a54581b9c94fe41a0bc61fad4e748b61", "score": "0.49009135", "text": "func TestDeleteSmartArtNodeInvalidNodeIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteSmartArtNode\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteSmartArtNode\", \"slideIndex\", \"int32\").(int32)\n testsmartArtIndex, _ := createTestParamValue(\"DeleteSmartArtNode\", \"smartArtIndex\", \"int32\").(int32)\n testnodeIndex, _ := createTestParamValue(\"DeleteSmartArtNode\", \"nodeIndex\", \"int32\").(int32)\n testsubNode, _ := createTestParamValue(\"DeleteSmartArtNode\", \"subNode\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteSmartArtNode\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteSmartArtNode\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteSmartArtNode\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testnodeIndex, \"DeleteSmartArtNode\", \"nodeIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testnodeIndex = nullValue\n } else {\n testnodeIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteSmartArtNode\", \"nodeIndex\", testnodeIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteSmartArtNode(testname, testslideIndex, testsmartArtIndex, testnodeIndex, testsubNode, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteSmartArtNode\", \"nodeIndex\", \"int32\", testnodeIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "41e4a26c5432a6a445ddb3a8ec083841", "score": "0.48992082", "text": "func Test_ORD99_1ch_3ord_kafka_4kbs(t *testing.T) {\n go kafka3kbRestart3kb(\"pause\")\n spyOnOrdererAfterSecs(1, 160)\n passResult, finalResultSummaryString := ote(\"ORD-99\", 50000, 1, 3, \"kafka\", 4, spyDefer, 1, 0 )\n if !passResult { t.Error(finalResultSummaryString) }\n}", "title": "" }, { "docid": "49d00614781d7f0f4429b7fbbdc6d545", "score": "0.489718", "text": "func TestDeleteChartCategoryInvalidCategoryIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteChartCategory\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteChartCategory\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"DeleteChartCategory\", \"shapeIndex\", \"int32\").(int32)\n testcategoryIndex, _ := createTestParamValue(\"DeleteChartCategory\", \"categoryIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"DeleteChartCategory\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteChartCategory\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteChartCategory\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testcategoryIndex, \"DeleteChartCategory\", \"categoryIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testcategoryIndex = nullValue\n } else {\n testcategoryIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteChartCategory\", \"categoryIndex\", testcategoryIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteChartCategory(testname, testslideIndex, testshapeIndex, testcategoryIndex, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteChartCategory\", \"categoryIndex\", \"int32\", testcategoryIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "de2bcbbcf1c5ffd9cbd6afc49dbd83d4", "score": "0.4895949", "text": "func (t *SimpleChaincode) initOrder(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n\t// 0 \t\t1 \t\t2 \t3\t\t4 5 \t\t6 \t\t\t\t\t7 \t\t8\t\t\t9 \n\t// \"orderId0\", \"fromAddress\", \"toAddress\", \"煤炭\", \"20\", \"4000\",\"WAIT_DRIVER_ACCEPT\",\"goodsOwnerId\",\"brokerId0\",\"driverId\"\n\tif len(args) != 10 {\n\t\treturn shim.Error(\"Incorrect number of arguments. Expecting 10\")\n\t}\n\t// ==== Input sanitation ====\n\tfmt.Println(\"- start init order\")\n\tif len(args[0]) <= 0 {\n\t\treturn shim.Error(\"1st argument must be a non-empty string\")\n\t}\n\tif len(args[1]) <= 0 {\n\t\treturn shim.Error(\"2nd argument must be a non-empty string\")\n\t}\n\tif len(args[2]) <= 0 {\n\t\treturn shim.Error(\"3rd argument must be a non-empty string\")\n\t}\n\tif len(args[3]) <= 0 {\n\t\treturn shim.Error(\"4th argument must be a non-empty string\")\n\t}\n\tif len(args[4]) <= 0 {\n\t\treturn shim.Error(\"5th argument must be a non-empty string\")\n\t}\n\tif len(args[5]) <= 0 {\n\t\treturn shim.Error(\"6th argument must be a non-empty string\")\n\t}\n\tif len(args[6]) <= 0 {\n\t\treturn shim.Error(\"7th argument must be a non-empty string\")\n\t}\n\tif len(args[7]) <= 0 {\n\t\treturn shim.Error(\"8th argument must be a non-empty string\")\n\t}\n\tif len(args[8]) <= 0 {\n\t\treturn shim.Error(\"9th argument must be a non-empty string\")\n\t}\n\tif len(args[9]) <= 0 {\n\t\treturn shim.Error(\"10th argument must be a non-empty string\")\n\t}\n\torderId := args[0]\n\tfromAddress := args[1]\n\ttoAddress := args[2]\n\tcontent := args[3]\n\torderState := args[6]\n\tgoodsOwnerId := args[7]\n\tbrokerId := args[8]\n\tdriverId := args[9]\n\tweightTon, err := strconv.ParseFloat(args[4], 64)\n \tif err != nil {\n\t\treturn shim.Error(\"5th argument must be a numeric string\")\n\t}\n\t transFee, err := strconv.ParseFloat(args[5], 64)\n\tif err != nil {\n\t\treturn shim.Error(\"6th argument must be a numeric string\")\n\t}\n\n\t// ==== Check if order already exists ====\n\torderAsBytes, err := stub.GetState(orderId)\n\tif err != nil {\n\t\treturn shim.Error(\"Failed to get order: \" + err.Error())\n\t} else if orderAsBytes != nil {\n\t\tfmt.Println(\"This order already exists: \" + orderId)\n\t\treturn shim.Error(\"This order already exists: \" + orderId)\n\t}\n\n\t// ==== Create order object and marshal to JSON ====\n\tChangeStateHistory := make(map[string]string)\n\tChangeStateHistory[\"createOrder\"] = getTimeNow()\n\t\n\t// order := &Order{\"order\",\"orderId0\", \"fromAddress\", \"toAddress\", \"coal\", 20, 4000,\"WAIT_DRIVER_ACCEPT\",\"goodsOwnerId\",\"brokerId0\",\"driverId\",getTimeNow(), true, ChangeStateHistory}\n\n\torder := &Order{\"order\", orderId, fromAddress, toAddress, content, weightTon, transFee, orderState, goodsOwnerId, brokerId, driverId, getTimeNow(), true, ChangeStateHistory}\n\t// writeToRecordsLedger(stub, order, \"createOrder\")\n\torderJSONasBytes, err := json.Marshal(order)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\t//Alternatively, build the order json string manually if you don't want to use struct marshalling\n\t//orderJSONasString := `{\"docType\":\"Order\", \"name\": \"` + orderId + `\", \"color\": \"` + color + `\", \"size\": ` + strconv.Itoa(size) + `, \"owner\": \"` + owner + `\"}`\n\t//orderJSONasBytes := []byte(str)\n\n\t// === Save order to state ===\n\terr = stub.PutState(orderId, orderJSONasBytes)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\t// ==== Index the order to enable color-based range queries, e.g. return all blue orders ====\n\t// An 'index' is a normal key/value entry in state.\n\t// The key is a composite key, with the elements that you want to range query on listed first.\n\t// In our case, the composite key is based on indexName~color~name.\n\t// This will enable very efficient state range queries based on composite keys matching indexName~color~*\n\t// indexName := \"broker~createDate\"\n\t// dateBrokerIndexKey, err := stub.CreateCompositeKey(indexName, []string{order.BrokerId, order.CreateDate})\n\t// if err != nil {\n\t//\treturn shim.Error(err.Error())\n\t// }\n\t// Save index entry to state. Only the key name is needed, no need to store a duplicate copy of the order.\n\t// Note - passing a 'nil' value will effectively delete the key from state, therefore we pass null character as value\n\t// value := []byte{0x00}\n\t// stub.PutState(dateBrokerIndexKey, value)\n\n\t// ==== Order saved and indexed. Return success ====\n\tfmt.Println(\"- end init order\")\n\treturn shim.Success(nil)\n}", "title": "" }, { "docid": "8f1b4c1d08d4ea4a0dec79e2c6435805", "score": "0.489211", "text": "func FailingQueryExecutor(driver neo4j.Driver, useBookmark bool) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, useBookmark, neo4j.AccessModeRead, ctx)\n\t\tdefer session.Close()\n\n\t\tresult, err := session.Run(\"UNWIND [10, 5, 0] AS x RETURN 10 / x\", nil)\n\t\tExpectNoError(err)\n\n\t\tsummary, err := result.Consume()\n\t\tExpectNotNil(err)\n\t\t//Expect(err).To(BeArithmeticError())\n\t\tExpectNil(summary)\n\t}\n}", "title": "" }, { "docid": "469940ad05ec3894f80c27ac8cac1292", "score": "0.48898014", "text": "func WrongQueryExecutor(driver neo4j.Driver) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, false, neo4j.AccessModeRead, ctx)\n\t\tdefer session.Close()\n\n\t\t_, err := session.Run(\"RETURN wrongThing\", nil)\n\t\tExpectNotNil(err)\n\t}\n}", "title": "" }, { "docid": "fae95f0512e7bfd878352eaeb0f903d1", "score": "0.4885115", "text": "func NewHideNonFakeMoveTaskOrdersBadRequest() *HideNonFakeMoveTaskOrdersBadRequest {\n\treturn &HideNonFakeMoveTaskOrdersBadRequest{}\n}", "title": "" }, { "docid": "4d67f496c0edb2fdc498a557945b11bf", "score": "0.4872502", "text": "func (q *requiredQueries) Assert(r *http.Request) error {\n\tqueryVals := r.URL.Query()\n\tvar missingParams []string\n\n\tfor _, key := range q.Keys {\n\t\tif value := queryVals.Get(key); len(value) == 0 {\n\t\t\tmissingParams = append(missingParams, key)\n\t\t}\n\t}\n\tif len(missingParams) > 0 {\n\t\treturn fmt.Errorf(\"missing required query parameter(s): %s\", strings.Join(missingParams, \", \"))\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "50d13ff0031438bda16664a79524d80e", "score": "0.4871612", "text": "func TestOrderBy_AddConflictingFail(t *testing.T) {\n\torderBy := common.OrderBy{}\n\tok(t, orderBy.Add(common.OrderByCreated))\n\tnotOk(t, orderBy.Add(common.OrderByCreatedDesc))\n}", "title": "" }, { "docid": "737de663461c5ff4d9ad8dbc5b443e25", "score": "0.4870109", "text": "func FailingQueryExecutor(driver neo4j.Driver, useBookmark bool) func(ctx *TestContext) {\n\treturn func(ctx *TestContext) {\n\t\tsession := newStressSession(driver, useBookmark, neo4j.AccessModeRead, ctx)\n\t\tdefer session.Close()\n\n\t\tresult, err := session.Run(\"UNWIND [10, 5, 0] AS x RETURN 10 / x\", nil)\n\t\tExpect(err).To(BeNil())\n\n\t\tsummary, err := result.Consume()\n\t\tExpect(err).To(BeArithmeticError())\n\t\tExpect(summary).To(BeNil())\n\t}\n}", "title": "" }, { "docid": "13285c1ff272d32e4f034066d9c7f864", "score": "0.48693332", "text": "func TestInvalidMultipleDaily(t *testing.T){\n\n\tentry := entryModel.Entry{}\n\tentry.ID = \"1471\"\n\tentry.CustomerID = \"441\"\n\tentry.LoadAmount = \"$2000.00\"\n\tentry.Time = \"2000-01-05T12:28:58Z\"\n\tCheckIfValidTrans(entry)\n\t\n\tentry.LoadAmount = \"$3000.00\"\n\tentry.Time = \"2000-01-05T14:28:58Z\"\n\tCheckIfValidTrans(entry)\n\t\n\tentry.LoadAmount = \"$74.12\"\n\tentry.Time = \"2000-01-05T15:28:58Z\"\n\t\n\tresult := CheckIfValidTrans(entry)\n\t\n\texpectedResult := createMsg(entry.ID, entry.CustomerID, false);\n\t\n\tif expectedResult != result {\n\t\tt.Errorf(\"failed expected %s got %s\", expectedResult, result) \n\t}\n}", "title": "" }, { "docid": "802b6b47b2420845ad4f8b980ef958b7", "score": "0.48513845", "text": "func TestDeleteChartCategoryInvalidShapeIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteChartCategory\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteChartCategory\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"DeleteChartCategory\", \"shapeIndex\", \"int32\").(int32)\n testcategoryIndex, _ := createTestParamValue(\"DeleteChartCategory\", \"categoryIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"DeleteChartCategory\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteChartCategory\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteChartCategory\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testshapeIndex, \"DeleteChartCategory\", \"shapeIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testshapeIndex = nullValue\n } else {\n testshapeIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteChartCategory\", \"shapeIndex\", testshapeIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteChartCategory(testname, testslideIndex, testshapeIndex, testcategoryIndex, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteChartCategory\", \"shapeIndex\", \"int32\", testshapeIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "ba9c38aee9de4570d078e3fa7ab90346", "score": "0.48505446", "text": "func TestOrderBy_AddDuplicateFail(t *testing.T) {\n\torderBy := common.OrderBy{}\n\tok(t, orderBy.Add(common.OrderByCreated))\n\tnotOk(t, orderBy.Add(common.OrderByCreated))\n}", "title": "" }, { "docid": "9a4b45ed38049c99765828c9256afe32", "score": "0.4847006", "text": "func TestGetSlideCommentsInvalidSlideIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"GetSlideComments\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"GetSlideComments\", \"slideIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"GetSlideComments\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"GetSlideComments\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"GetSlideComments\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testslideIndex, \"GetSlideComments\", \"slideIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testslideIndex = nullValue\n } else {\n testslideIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"GetSlideComments\", \"slideIndex\", testslideIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.GetSlideComments(testname, testslideIndex, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"GetSlideComments\", \"slideIndex\", \"int32\", testslideIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "a10daa053a929eacf4283852e872db80", "score": "0.48434904", "text": "func (s *SmartContract) DeleteOrder(ctx contractapi.TransactionContextInterface, orderId int) Result {\n\torderIndexKey, err := ctx.GetStub().CreateCompositeKey(orderIndexName, []string{strconv.Itoa(orderId)})\n\tif err != nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t}\n\t}\n\torderJSON, err := ctx.GetStub().GetState(orderIndexKey)\n\tif err != nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t}\n\t}\n\tif orderJSON == nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: fmt.Sprintf(\"the order %d does not exist\", orderId),\n\t\t}\n\t}\n\n\tvar order Order\n\terr = json.Unmarshal(orderJSON, &order)\n\tif err != nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t}\n\t}\n\n\t//recover train's carriageNumber\n\tupdateTrainResult := s.UpdateTrain(ctx, order.TrainNumber, -order.CarriageNumber)\n\tif updateTrainResult.Code != 200 {\n\t\treturn updateTrainResult\n\t}\n\n\t//delete train~order\n\ttrainorderIndexKey, err := ctx.GetStub().CreateCompositeKey(\n\t\ttrainorderIndexName, []string{order.TrainNumber, strconv.Itoa(orderId)})\n\tif err != nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t}\n\t}\n\terr = ctx.GetStub().DelState(trainorderIndexKey)\n\tif err != nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t}\n\t}\n\n\terr = ctx.GetStub().DelState(orderIndexKey)\n\tif err != nil {\n\t\treturn Result{\n\t\t\tCode: 402,\n\t\t\tMsg: err.Error(),\n\t\t}\n\t}\n\n\treturn Result{\n\t\tCode: 200,\n\t\tMsg: \"success\",\n\t}\n}", "title": "" }, { "docid": "85380dd507f640dd50013847303e5f70", "score": "0.48403177", "text": "func Test_ORD95_1ch_3ord_kafka_4kbs(t *testing.T) {\n go pauseAndUnpauseAllTargetOneAtATime(\"kafka\", 4)\n spyOnOrdererAfterSecs(1, 500)\n passResult, finalResultSummaryString := ote(\"ORD-95\", 500000, 1, 3, \"kafka\", 4, spyDefer, 1, 0 )\n if !passResult { t.Error(finalResultSummaryString) }\n}", "title": "" }, { "docid": "c1d167428720094b5a97a62b61f8b1f4", "score": "0.4835636", "text": "func Test_ORD105_1ch_3ord_kafka_4kbs(t *testing.T) {\n go pauseAndUnpauseAllTargetOneAtATime(\"kafka\", 4)\n spyOnOrdererAfterSecs(1, 650)\n passResult, finalResultSummaryString := ote(\"ORD-105\", 500000, 1, 3, \"kafka\", 4, spyDefer, 1, 0 )\n if !passResult { t.Error(finalResultSummaryString) }\n}", "title": "" }, { "docid": "1f6f4c4aedcaf9994ff252d33d30115a", "score": "0.4835168", "text": "func TestDeleteCommentsInvalidStorage(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteComments\", \"name\", \"string\").(string)\n testauthor, _ := createTestParamValue(\"DeleteComments\", \"author\", \"string\").(string)\n testpassword, _ := createTestParamValue(\"DeleteComments\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteComments\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteComments\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(teststorage, \"DeleteComments\", \"storage\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n teststorage = nullValue\n } else {\n teststorage, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"DeleteComments\", \"storage\", teststorage)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n r, e := GetTestApiClient().SlidesApi.DeleteComments(testname, testauthor, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteComments\", \"storage\", \"string\", teststorage, int32(statusCode), e)\n}", "title": "" }, { "docid": "18380b72b88af16e111d17d39c40893e", "score": "0.4829167", "text": "func testOrderStatusReconciliation(s *simulationTest) error {\n\tfor _, client := range s.clients {\n\t\tif err := s.updateBalances(client); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tclient.expectBalanceDiffs = nil // not interested in balance checks for this test case\n\t}\n\n\twaiter, ctx := errgroup.WithContext(context.Background())\n\n\ts.client1.isSeller, s.client2.isSeller = false, true\n\n\t// Record client 2's locked balance before placing trades\n\t// to determine the amount locked for the placed trades.\n\tc2Balance, err := s.client2.core.AssetBalance(s.base.id) // client 2 is seller\n\tif err != nil {\n\t\treturn fmt.Errorf(\"client 2 pre-trade balance error %w\", err)\n\t}\n\tpreTradeLockedBalance := c2Balance.Locked\n\ts.log.Infof(\"Client 2 %s available balance is %v.\", s.base.symbol, s.base.valFmt(c2Balance.Available))\n\n\trate := 100 * s.rateStep\n\n\ts.log.Infof(\"%s\\n\", `\nPlacing an order for client 1, qty=3*lotSize, rate=100*rateStep\nThis order should get matched to either or both of these client 2\nsell orders:\n- Order 2: immediate limit order, qty=2*lotSize, rate=100*rateStep,\n may not get matched if Order 3 below is matched first.\n- Order 3: standing limit order, qty=4*lotSize, rate=100*rateStep,\n will always be partially matched (3*lotSize matched or\n 1*lotSize matched, if Order 2 is matched first).`)\n\twaiter.Go(func() error {\n\t\t_, err := s.placeOrder(s.client1, 3*s.lotSize, rate, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 1 place order error: %v\", err)\n\t\t}\n\t\treturn nil\n\t})\n\n\t// forgetClient2Order deletes the passed order id from client 2's\n\t// dc.trade map, ensuring that all requests and notifications for\n\t// the order are not processed.\n\tc2dc := s.client2.dc()\n\tc2ForgottenOrders := make(map[order.OrderID]*trackedTrade)\n\tforgetClient2Order := func(oid order.OrderID) {\n\t\ts.log.Infof(\"Forcing client 2 to forget order %s.\", oid)\n\t\tc2dc.tradeMtx.Lock()\n\t\tdefer c2dc.tradeMtx.Unlock()\n\t\ttracker, found := c2dc.trades[oid]\n\t\tif !found {\n\t\t\treturn\n\t\t}\n\t\tdelete(c2dc.trades, oid)\n\t\tc2ForgottenOrders[oid] = tracker\n\t}\n\n\t// Expected order statuses before and after client 2 goes AWOL.\n\tc2OrdersBefore := make(map[order.OrderID]order.OrderStatus)\n\tc2OrdersAfter := make(map[order.OrderID]order.OrderStatus)\n\tvar statusMtx sync.Mutex\n\trecordBeforeAfterStatuses := func(oid order.OrderID, beforeStatus, afterStatus order.OrderStatus) {\n\t\tstatusMtx.Lock()\n\t\tdefer statusMtx.Unlock()\n\t\tc2OrdersBefore[oid] = beforeStatus\n\t\tc2OrdersAfter[oid] = afterStatus\n\t}\n\n\ts.log.Infof(\"%s\\n\", `\nPlacing Client 2 Order 1:\n - Standing order, preimage not revealed, \"missed\" revoke_order note.\n - Expect order status to stay at Epoch status before going AWOL and\n to become Revoked after re-connecting the DEX. Locked coins should\n be returned.`)\n\n\twaiter.Go(func() error {\n\t\t// standing limit order, qty and rate doesn't matter, preimage\n\t\t// miss prevents this order from getting matched.\n\t\torderID, err := s.placeOrder(s.client2, 1*s.lotSize, rate, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 2 place order error: %v\", err)\n\t\t}\n\t\toid, err := order.IDFromHex(orderID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 2 place order error: %v\", err)\n\t\t}\n\t\t// Foil preimage reveal by \"forgetting\" this order.\n\t\t// Also prevents processing revoke_order notes for this order.\n\t\tforgetClient2Order(oid)\n\t\trecordBeforeAfterStatuses(oid, order.OrderStatusEpoch, order.OrderStatusRevoked)\n\t\treturn nil\n\t})\n\n\ts.log.Infof(\"%s\\n\", `\nPlacing Client 2 Order 2:\n- Non-standing order, preimage revealed, \"missed\" nomatch or match\n request (if matched).\n- Expect order status to stay at Epoch status before going AWOL and\n to become Executed after re-connecting the DEX, even if the order\n was matched and the matches got revoked due to client inaction. No\n attempt is made to cause match revocation anyways.`)\n\n\twaiter.Go(func() error {\n\t\tnotes := s.client2.startNotificationReader(ctx)\n\t\t// immediate limit order, use qty=2*lotSize, rate=300*rateStep to be\n\t\t// potentially matched by client 1's order above.\n\t\torderID, err := s.placeOrder(s.client2, 2*s.lotSize, rate*3, true)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 2 place order error: %v\", err)\n\t\t}\n\t\ttracker, err := s.client2.findOrder(orderID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 2 place order error: %v\", err)\n\t\t}\n\t\toid := tracker.ID()\n\t\t// Wait a max of 2 epochs for preimage to be sent for this order.\n\t\ttwoEpochs := 2 * time.Duration(tracker.epochLen()) * time.Millisecond\n\t\ts.client2.log.Infof(\"Client 2 waiting %v for preimage reveal, order %s\", twoEpochs, tracker.token())\n\t\tpreimageRevealed := notes.find(ctx, twoEpochs, func(n Notification) bool {\n\t\t\torderNote, isOrderNote := n.(*OrderNote)\n\t\t\tif isOrderNote && n.Topic() == TopicPreimageSent && orderNote.Order.ID.String() == orderID {\n\t\t\t\tforgetClient2Order(oid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t})\n\t\tif !preimageRevealed {\n\t\t\treturn fmt.Errorf(\"preimage not revealed for order %s after %s\", tracker.token(), twoEpochs)\n\t\t}\n\t\trecordBeforeAfterStatuses(oid, order.OrderStatusEpoch, order.OrderStatusExecuted)\n\t\treturn nil\n\t})\n\n\ts.log.Infof(\"%s\\n\", `\nClient 2 placing Order 3:\n - Standing order, partially matched, booked, revoked due to inaction on\n a match.\n - Expect order status to be Booked before going AWOL and to become\n Revoked after re-connecting the DEX. Locked coins should be returned.`)\n\n\twaiter.Go(func() error {\n\t\tnotes := s.client2.startNotificationReader(ctx)\n\t\t// standing limit order, use qty=4*lotSize, rate=100*rateStep to be\n\t\t// partially matched by client 1's order above.\n\t\torderID, err := s.placeOrder(s.client2, 4*s.lotSize, rate, false)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 2 place order error: %v\", err)\n\t\t}\n\t\ttracker, err := s.client2.findOrder(orderID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client 2 place order error: %v\", err)\n\t\t}\n\t\t// Wait a max of 2 epochs for preimage to be sent for this order.\n\t\ttwoEpochs := 2 * time.Duration(tracker.epochLen()) * time.Millisecond\n\t\ts.client2.log.Infof(\"Client 2 waiting %v for preimage reveal, order %s\", twoEpochs, tracker.token())\n\t\tpreimageRevealed := notes.find(ctx, twoEpochs, func(n Notification) bool {\n\t\t\torderNote, isOrderNote := n.(*OrderNote)\n\t\t\treturn isOrderNote && n.Topic() == TopicPreimageSent && orderNote.Order.ID.String() == orderID\n\t\t})\n\t\tif !preimageRevealed {\n\t\t\treturn fmt.Errorf(\"preimage not revealed for order %s after %s\", tracker.token(), twoEpochs)\n\t\t}\n\t\t// Preimage sent, matches will be made soon. Lock wallets to prevent\n\t\t// client from sending swap when this order is matched. Particularly\n\t\t// important if we're matched as maker.\n\t\ts.client2.disableWallets()\n\t\toid := tracker.ID()\n\t\t// Wait 1 minute for order to receive match request.\n\t\tmaxMatchDuration := time.Minute\n\t\ts.client2.log.Infof(\"Client 2 waiting %v for order %s to be partially matched\", maxMatchDuration, tracker.token())\n\t\tmatched := notes.find(ctx, maxMatchDuration, func(n Notification) bool {\n\t\t\torderNote, isOrderNote := n.(*OrderNote)\n\t\t\tisMatchedTopic := n.Topic() == TopicBuyMatchesMade || n.Topic() == TopicSellMatchesMade\n\t\t\treturn isOrderNote && isMatchedTopic && orderNote.Order.ID.String() == orderID\n\t\t})\n\t\tif !matched {\n\t\t\treturn fmt.Errorf(\"order %s not matched after %s\", tracker.token(), maxMatchDuration)\n\t\t}\n\t\tif tracker.Trade().Remaining() == 0 {\n\t\t\treturn fmt.Errorf(\"order %s fully matched instead of partially\", tracker.token())\n\t\t}\n\t\tif ctx.Err() != nil {\n\t\t\treturn nil // return here if some other goroutine errored\n\t\t}\n\t\ttracker.mtx.RLock()\n\t\t// Partially matched, let's ditch the first match to trigger order\n\t\t// revocation due to match inaction.\n\t\tvar isTaker bool\n\t\tfor _, match := range tracker.matches {\n\t\t\tmatch.swapErr = fmt.Errorf(\"ditch match\")\n\t\t\tisTaker = match.Side == order.Taker\n\t\t\tbreak // only interested in first match\n\t\t}\n\t\ttracker.mtx.RUnlock()\n\t\tif isTaker {\n\t\t\t// Monitor the match till MakerSwapCast, mine a couple blocks for\n\t\t\t// maker's swap and ditch the match just when we're required to send\n\t\t\t// counter-swap.\n\t\t\t// Keep the order active to enable receiving audit request when Maker\n\t\t\t// sends swap.\n\t\t\terr = s.monitorTrackedTrade(s.client2, tracker, order.MakerSwapCast)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// Match will get revoked after lastEvent+bTimeout.\n\t\tforgetClient2Order(oid) // ensure revoke_match request is \"missed\"\n\t\trecordBeforeAfterStatuses(oid, order.OrderStatusBooked, order.OrderStatusRevoked)\n\t\treturn nil\n\t})\n\n\t// Wait for orders to be placed and forgotten or partly negotiated.\n\tif err := waiter.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\ts.log.Info(\"Orders placed and monitored to desired states.\")\n\n\t// Confirm that the order statuses are what we expect before triggering\n\t// a authDEX->connect status recovery.\n\tc2dc.tradeMtx.RLock()\n\tfor oid, expectStatus := range c2OrdersBefore {\n\t\ttracker, found := c2ForgottenOrders[oid]\n\t\tif !found {\n\t\t\ttracker, found = c2dc.trades[oid]\n\t\t}\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"missing client 2 order %v\", oid)\n\t\t}\n\t\tif tracker.metaData.Status != expectStatus {\n\t\t\treturn fmt.Errorf(\"expected pre-recovery status %v for client 2 order %v, got %v\",\n\t\t\t\texpectStatus, oid, tracker.metaData.Status)\n\t\t}\n\t\ts.client2.log.Infof(\"Client 2 order %v in expected pre-recovery status %v.\", oid, expectStatus)\n\t}\n\tc2dc.tradeMtx.RUnlock()\n\n\t// Check trade-locked amount before disconnecting.\n\tc2Balance, err = s.client2.core.AssetBalance(s.base.id) // client 2 is seller\n\tif err != nil {\n\t\treturn fmt.Errorf(\"client 2 pre-disconnect balance error %w\", err)\n\t}\n\ts.client2.log.Infof(\"Client 2 %s available balance before disconnecting is %v.\", s.base.symbol, s.base.valFmt(c2Balance.Available))\n\ttotalLockedByTrades := c2Balance.Locked - preTradeLockedBalance\n\tpreDisconnectLockedBalance := c2Balance.Locked // should reduce after funds are returned\n\tpreDisconnectAvailableBal := c2Balance.Available // should increase after funds are returned\n\n\t// Disconnect the DEX and allow some time for DEX to update order statuses.\n\ts.client2.log.Info(\"Disconnecting client 2 from the DEX server.\")\n\tc2dc.connMaster.Disconnect()\n\t// Disconnection is asynchronous, wait for confirmation of DEX disconnection.\n\tdisconnectTimeout := 10 * sleepFactor * time.Second\n\tdisconnected := s.client2.notes.find(context.Background(), disconnectTimeout, func(n Notification) bool {\n\t\tconnNote, ok := n.(*ConnEventNote)\n\t\treturn ok && connNote.Host == dexHost && connNote.ConnectionStatus != comms.Connected\n\t})\n\tif !disconnected {\n\t\treturn fmt.Errorf(\"client 2 dex not disconnected after %v\", disconnectTimeout)\n\t}\n\n\ts.client2.enableWallets()\n\t// Disconnect the wallets, they'll be reconnected when Login is called below.\n\t// Login->connectWallets will error for btc spv wallets if the wallet is not\n\t// first disconnected.\n\ts.client2.disconnectWallets()\n\n\t// Allow some time for orders to be revoked due to inaction, and\n\t// for requests pending on the server to expire (usually bTimeout).\n\tbTimeout := time.Millisecond * time.Duration(c2dc.cfg.BroadcastTimeout)\n\tdisconnectPeriod := 2 * bTimeout\n\ts.client2.log.Infof(\"Waiting %v before reconnecting client 2 to DEX.\", disconnectPeriod)\n\ttime.Sleep(disconnectPeriod)\n\n\ts.client2.log.Info(\"Reconnecting client 2 to DEX to trigger order status reconciliation.\")\n\n\t// Use core.initialize to restore client 2 orders from db, and login\n\t// to trigger dex authentication.\n\t// TODO: cannot do this anymore with built-in wallets\n\terr = s.client2.core.initialize()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"client 2 login error: %w\", err)\n\t}\n\terr = s.client2.core.Login(s.client2.appPass)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"client 2 login error: %w\", err)\n\t}\n\n\tc2dc = s.client2.dc()\n\tc2dc.tradeMtx.RLock()\n\tfor oid, expectStatus := range c2OrdersAfter {\n\t\ttracker, found := c2dc.trades[oid]\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"client 2 order %v not found after re-initializing core\", oid)\n\t\t}\n\t\tif tracker.metaData.Status != expectStatus {\n\t\t\treturn fmt.Errorf(\"status not updated for client 2 order %v, expected %v, got %v\",\n\t\t\t\toid, expectStatus, tracker.metaData.Status)\n\t\t}\n\t\ts.client2.log.Infof(\"Client 2 order %v in expected post-recovery status %v.\", oid, expectStatus)\n\t}\n\tc2dc.tradeMtx.RUnlock()\n\n\t// Wait a bit for tick cycle to trigger inactive trade retirement and funds unlocking.\n\thalfBTimeout := time.Millisecond * time.Duration(c2dc.cfg.BroadcastTimeout/2)\n\ttime.Sleep(halfBTimeout)\n\n\tc2Balance, err = s.client2.core.AssetBalance(s.base.id) // client 2 is seller\n\tif err != nil {\n\t\treturn fmt.Errorf(\"client 2 post-reconnect balance error %w\", err)\n\t}\n\ts.client2.log.Infof(\"Client 2 %s available balance after reconnecting to DEX is %v.\", s.base.symbol, s.base.valFmt(c2Balance.Available))\n\tif c2Balance.Available != preDisconnectAvailableBal+totalLockedByTrades {\n\t\treturn fmt.Errorf(\"client 2 locked funds not returned: locked before trading %v, locked after trading %v, \"+\n\t\t\t\"locked after reconnect %v\", preTradeLockedBalance, preDisconnectLockedBalance, c2Balance.Locked)\n\t}\n\tif c2Balance.Locked != preDisconnectLockedBalance-totalLockedByTrades {\n\t\treturn fmt.Errorf(\"client 2 locked funds not returned: locked before trading %v, locked after trading %v, \"+\n\t\t\t\"locked after reconnect %v\", preTradeLockedBalance, preDisconnectLockedBalance, c2Balance.Locked)\n\t}\n\ts.client2.enableWallets()\n\n\tfor _, c := range s.clients {\n\t\tif err := c.mineMedian(context.TODO(), s.quote.id); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := c.mineMedian(context.TODO(), s.base.id); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\ts.waitALittleBit()\n\n\treturn nil\n}", "title": "" }, { "docid": "538fb2634be239f76bd799d8fa48dab0", "score": "0.4827905", "text": "func TestReorderSlidesInvalidPassword(t *testing.T) {\n testname, _ := createTestParamValue(\"ReorderSlides\", \"name\", \"string\").(string)\n testoldPositions, _ := createTestParamValue(\"ReorderSlides\", \"oldPositions\", \"[]int32\").([]int32)\n testnewPositions, _ := createTestParamValue(\"ReorderSlides\", \"newPositions\", \"[]int32\").([]int32)\n testpassword, _ := createTestParamValue(\"ReorderSlides\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"ReorderSlides\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"ReorderSlides\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testpassword, \"ReorderSlides\", \"password\", \"string\")\n if (invalidValue == nil) {\n var nullValue string\n testpassword = nullValue\n } else {\n testpassword, _ = invalidValue.(string)\n }\n\n e := InitializeTest(\"ReorderSlides\", \"password\", testpassword)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.ReorderSlides(testname, testoldPositions, testnewPositions, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"ReorderSlides\", \"password\", \"string\", testpassword, int32(statusCode), e)\n}", "title": "" }, { "docid": "70ded7f098e3774a4739dda0d456d438", "score": "0.48203123", "text": "func TestSubmitOrder(t *testing.T) {\n\tt.Parallel()\n\tsharedtestvalues.SkipTestIfCannotManipulateOrders(t, c, canManipulateRealOrders)\n\n\tvar orderSubmission = &order.Submit{\n\t\tExchange: c.Name,\n\t\tPair: currency.Pair{\n\t\t\tBase: currency.BTC,\n\t\t\tQuote: currency.USD,\n\t\t},\n\t\tSide: order.Buy,\n\t\tType: order.Limit,\n\t\tPrice: 1,\n\t\tAmount: 1,\n\t\tClientID: \"123\",\n\t\tAssetType: asset.Spot,\n\t}\n\tresponse, err := c.SubmitOrder(context.Background(), orderSubmission)\n\tif sharedtestvalues.AreAPICredentialsSet(c) && (err != nil || response.Status != order.New) {\n\t\tt.Errorf(\"Order failed to be placed: %v\", err)\n\t} else if !sharedtestvalues.AreAPICredentialsSet(c) && err == nil {\n\t\tt.Error(\"Expecting an error when no keys are set\")\n\t}\n}", "title": "" }, { "docid": "758595c3173d5daa7b03924b5f429dd6", "score": "0.48186904", "text": "func TestInvalid(t *testing.T) {\n\tinitTest(t)\n\tfor _, meta := range []testMeta{\n\t\t{\n\t\t\tname: \"invalid_without_app_ports\",\n\t\t\terrorMsg: \"missing parameter appPorts (required if proxyIngressPort is provided)\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid_without_proxy_ingress_port\",\n\t\t\terrorMsg: \"missing parameter proxyIngressPort (required if appPorts are provided)\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid_without_proxy_egress_port\",\n\t\t\terrorMsg: \"missing required parameter proxyEgressPort\",\n\t\t},\n\t} {\n\t\tt.Run(meta.name, func(t *testing.T) {\n\t\t\ttestInvalid(t, meta)\n\t\t})\n\t}\n}", "title": "" }, { "docid": "3fd979f2b437b723bb9bb568cd6e8254", "score": "0.4813911", "text": "func TestDeleteChartSeriesInvalidShapeIndex(t *testing.T) {\n testname, _ := createTestParamValue(\"DeleteChartSeries\", \"name\", \"string\").(string)\n testslideIndex, _ := createTestParamValue(\"DeleteChartSeries\", \"slideIndex\", \"int32\").(int32)\n testshapeIndex, _ := createTestParamValue(\"DeleteChartSeries\", \"shapeIndex\", \"int32\").(int32)\n testseriesIndex, _ := createTestParamValue(\"DeleteChartSeries\", \"seriesIndex\", \"int32\").(int32)\n testpassword, _ := createTestParamValue(\"DeleteChartSeries\", \"password\", \"string\").(string)\n testfolder, _ := createTestParamValue(\"DeleteChartSeries\", \"folder\", \"string\").(string)\n teststorage, _ := createTestParamValue(\"DeleteChartSeries\", \"storage\", \"string\").(string)\n\n invalidValue := invalidizeTestParamValue(testshapeIndex, \"DeleteChartSeries\", \"shapeIndex\", \"int32\")\n if (invalidValue == nil) {\n var nullValue int32\n testshapeIndex = nullValue\n } else {\n testshapeIndex, _ = invalidValue.(int32)\n }\n\n e := InitializeTest(\"DeleteChartSeries\", \"shapeIndex\", testshapeIndex)\n if e != nil {\n t.Errorf(\"Error: %v.\", e)\n return\n }\n _, r, e := GetTestApiClient().SlidesApi.DeleteChartSeries(testname, testslideIndex, testshapeIndex, testseriesIndex, testpassword, testfolder, teststorage)\n statusCode := 400\n if r != nil {\n statusCode = r.StatusCode\n }\n assertError(t, \"DeleteChartSeries\", \"shapeIndex\", \"int32\", testshapeIndex, int32(statusCode), e)\n}", "title": "" }, { "docid": "4031023df2142f15dc841f3b597e72e0", "score": "0.48088086", "text": "func (e OrderValidationError) Cause() error { return e.cause }", "title": "" }, { "docid": "846bc0f66daec432a729a90ade32b92b", "score": "0.4801534", "text": "func (a *Client) OrderGet(params *OrderGetParams, authInfo runtime.ClientAuthInfoWriter) (*OrderGetOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewOrderGetParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"Order_get\",\n\t\tMethod: \"GET\",\n\t\tPathPattern: \"/order/{id}\",\n\t\tProducesMediaTypes: []string{\"application/json\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"https\"},\n\t\tParams: params,\n\t\tReader: &OrderGetReader{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\tsuccess, ok := result.(*OrderGetOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\t// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue\n\tmsg := fmt.Sprintf(\"unexpected success response for Order_get: API contract not enforced by server. Client expected to get an error, but got: %T\", result)\n\tpanic(msg)\n}", "title": "" } ]
bd1e5fe891d6a13be2e2279e35cd95fc
CreateStartupMessage creates a PG startup message. This message is used to startup all connections with a PG backend.
[ { "docid": "874e055897a0d2997183c267ce1cba15", "score": "0.75150806", "text": "func NewStartupMessage(username string, database string, options map[string]string) []byte {\n\tmessage := msgbuf.New([]byte{})\n\t// Temporarily set the message length to 0.\n\tmessage.WriteInt32(0)\n\tmessage.WriteInt32(ProtocolVersion)\n\n\t/*\n\t The protocol version number is followed by one or more pairs of\n\t parameter name and value strings. A zero byte is required as a\n\t terminator after the last name/value pair. Parameters can appear in any\n\t order. 'user' is required, others are optional.\n\t*/\n\n\t// Set the 'user' parameter. This is the only *required* parameter.\n\tmessage.WriteString(\"user\")\n\tmessage.WriteString(username)\n\n\tmessage.WriteString(\"database\")\n\tmessage.WriteString(database)\n\n\t/* Set the remaining options as specified. */\n\tfor option, value := range options {\n\t\tmessage.WriteString(option)\n\t\tmessage.WriteString(value)\n\t}\n\n\t// The message should end with a NULL byte\n\tmessage.WriteByte(0x00)\n\tmessage.ResetLength(PGMessageLengthOffsetStartup)\n\n\treturn message.Bytes()\n}", "title": "" } ]
[ { "docid": "ab1628b6e119f7560534fc1e7bb6b3bf", "score": "0.58723813", "text": "func (gc GarbageCollector) StartupMessage() string {\n\treturn \"\"\n}", "title": "" }, { "docid": "570facb4ae968886d7d7093827360976", "score": "0.580214", "text": "func (p *Proxy) handleStartup(ctx context.Context, clientConn net.Conn) (pgproto3.FrontendMessage, utils.TLSConn, *pgproto3.Backend, error) {\n\treceivedSSLRequest := false\n\treceivedGSSEncRequest := false\n\tfor {\n\t\t// Backend acts as a server for the Postgres wire protocol.\n\t\tbackend := pgproto3.NewBackend(pgproto3.NewChunkReader(clientConn), clientConn)\n\t\tstartupMessage, err := backend.ReceiveStartupMessage()\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, trace.Wrap(err)\n\t\t}\n\n\t\t// We don't want to log the cancel request secret key, so we handle\n\t\t// this case separately.\n\t\tif m, ok := startupMessage.(*pgproto3.CancelRequest); ok {\n\t\t\tp.Log.Debugf(\"Received cancel request for pid: %v.\", m.ProcessID)\n\t\t\ttlsConn, ok := clientConn.(utils.TLSConn)\n\t\t\tif !ok {\n\t\t\t\treturn nil, nil, nil, trace.BadParameter(\n\t\t\t\t\t\"expected tls connection, got %T\", clientConn)\n\t\t\t}\n\t\t\treturn m, tlsConn, backend, nil\n\t\t}\n\n\t\t// When initiating an encrypted connection, psql will first check with\n\t\t// the server whether it supports TLS by sending an SSLRequest message.\n\t\t//\n\t\t// Once the server has indicated the support (by sending 'S' in reply),\n\t\t// it will send a StartupMessage with the connection parameters such as\n\t\t// user name, database name, etc.\n\t\t//\n\t\t// https://www.postgresql.org/docs/13/protocol-flow.html#id-1.10.5.7.11\n\t\tp.Log.Debugf(\"Received startup message: %#v.\", startupMessage)\n\t\tswitch m := startupMessage.(type) {\n\t\tcase *pgproto3.SSLRequest:\n\t\t\tif receivedSSLRequest {\n\t\t\t\t// avoid receiving the same request over and over.\n\t\t\t\treturn nil, nil, nil, trace.BadParameter(\"received more than one SSLRequest\")\n\t\t\t}\n\t\t\treceivedSSLRequest = true\n\t\t\tif p.TLSConfig == nil {\n\t\t\t\t// Send 'N' back to make the client connect without TLS. Happens\n\t\t\t\t// when client connects through the local TLS proxy.\n\t\t\t\t_, err := clientConn.Write([]byte(\"N\"))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, nil, nil, trace.Wrap(err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Send 'S' back to indicate TLS support to the client.\n\t\t\t\t_, err := clientConn.Write([]byte(\"S\"))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, nil, nil, trace.Wrap(err)\n\t\t\t\t}\n\t\t\t\t// Upgrade the connection to TLS and wait for the next message\n\t\t\t\t// which should be of the StartupMessage type.\n\t\t\t\tclientConn = tls.Server(clientConn, p.TLSConfig)\n\t\t\t}\n\t\t\t// The client may then choose to either close the connection or issue\n\t\t\t// another request.\n\t\t\t// We loop again to receive another message.\n\t\t\tcontinue\n\t\tcase *pgproto3.GSSEncRequest:\n\t\t\tif receivedGSSEncRequest {\n\t\t\t\t// avoid receiving the same request over and over.\n\t\t\t\treturn nil, nil, nil, trace.BadParameter(\"received more than one GSSEncRequest\")\n\t\t\t}\n\t\t\treceivedGSSEncRequest = true\n\t\t\t// Send 'N' back to make the client connect without GSS encryption.\n\t\t\t_, err := clientConn.Write([]byte(\"N\"))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, nil, trace.Wrap(err)\n\t\t\t}\n\t\t\t// The client may then choose to either close the connection or issue\n\t\t\t// another request.\n\t\t\t// We loop again to receive another message.\n\t\t\tcontinue\n\t\tcase *pgproto3.StartupMessage:\n\t\t\t// TLS connection between the client and this proxy has been\n\t\t\t// established, just return the startup message.\n\t\t\ttlsConn, ok := clientConn.(utils.TLSConn)\n\t\t\tif !ok {\n\t\t\t\treturn nil, nil, nil, trace.BadParameter(\n\t\t\t\t\t\"expected tls connection, got %T\", clientConn)\n\t\t\t}\n\t\t\treturn m, tlsConn, backend, nil\n\t\t}\n\t\treturn nil, nil, nil, trace.BadParameter(\n\t\t\t\"unsupported startup message: %#v\", startupMessage)\n\t}\n}", "title": "" }, { "docid": "b4161861949138008ab6fc13cb245d59", "score": "0.57532305", "text": "func (a API) StartupMessage() string {\n\treturn fmt.Sprintf(\"server listening on port %d\", a.port)\n}", "title": "" }, { "docid": "120cb416dd65e2705649c8f20ed1df3f", "score": "0.534794", "text": "func ServerStartup() {\n\tlis, err := net.Listen(\"tcp\", fmt.Sprintf(\"localhost:%d\", *port))\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to listen: %v\", err)\n\t}\n\topts := []grpc.ServerOption{\n\t\tgrpc.MaxRecvMsgSize(512 * 1024 * 1024 * 1024),\n\t\tgrpc.MaxSendMsgSize(512 * 1024 * 1024 * 1024),\n\t}\n\n\tgrpcServer := grpc.NewServer(opts...)\n\tRegisterChatServiceServer(grpcServer, newServer())\n\tgrpcServer.Serve(lis)\n}", "title": "" }, { "docid": "42383b6adf2232750acaf16f6dadeae2", "score": "0.53358716", "text": "func (e *Engine) handleStartup(client *pgproto3.Backend, sessionCtx *common.Session) error {\n\tstartupMessageI, err := client.ReceiveStartupMessage()\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tswitch m := startupMessageI.(type) {\n\tcase *pgproto3.StartupMessage:\n\t\te.Log.Debugf(\"Received startup message: %#v.\", m)\n\t\t// Pass startup parameters received from the client along (this is how the\n\t\t// client sets default date style format for example), but remove database\n\t\t// name and user from them.\n\t\tfor key, value := range m.Parameters {\n\t\t\tswitch key {\n\t\t\tcase \"database\":\n\t\t\t\tsessionCtx.DatabaseName = value\n\t\t\tcase \"user\":\n\t\t\t\tsessionCtx.DatabaseUser = value\n\t\t\tdefault:\n\t\t\t\tsessionCtx.StartupParameters[key] = value\n\t\t\t}\n\t\t}\n\tcase *pgproto3.CancelRequest:\n\t\te.Log.Debugf(\"Received cancel request for PID: %v.\", m.ProcessID)\n\t\te.cancelReq = m\n\tdefault:\n\t\treturn trace.BadParameter(\"unexpected startup message type: %T\", startupMessageI)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ab697a80ec42e1c16124632fc5336988", "score": "0.5277914", "text": "func printStartupMessage(apiEndPoints []string) {\n\n\tstrippedAPIEndpoints := stripStandardPorts(apiEndPoints)\n\t// If cache layer is enabled, print cache capacity.\n\tcacheObjectAPI := newCacheObjectsFn()\n\tif cacheObjectAPI != nil {\n\t\tprintCacheStorageInfo(cacheObjectAPI.StorageInfo(context.Background()))\n\t}\n\t// Object layer is initialized then print StorageInfo.\n\tobjAPI := newObjectLayerFn()\n\tif objAPI != nil {\n\t\tprintStorageInfo(objAPI.StorageInfo(context.Background()))\n\t}\n\n\t// Prints credential, region and browser access.\n\tprintServerCommonMsg(strippedAPIEndpoints)\n\n\t// Prints `mc` cli configuration message chooses\n\t// first endpoint as default.\n\tprintCLIAccessMsg(strippedAPIEndpoints[0], \"myminio\")\n\n\t// Prints documentation message.\n\tprintObjectAPIMsg()\n\n\t// SSL is configured reads certification chain, prints\n\t// authority and expiry.\n\tif globalIsSSL {\n\t\tprintCertificateMsg(globalPublicCerts)\n\t}\n}", "title": "" }, { "docid": "7c8edd4876181264bbd0b632cdf4a4da", "score": "0.48915341", "text": "func SendStartupSession(config *SessionTrackingConfiguration) context.Context {\n\tctx := context.Background()\n\tsession := newSession()\n\tif !config.IsAutoCaptureSessions() || isApplicationProcess() {\n\t\treturn ctx\n\t}\n\tpublisher := &publisher{\n\t\tconfig: config,\n\t\tclient: &http.Client{Transport: config.Transport},\n\t}\n\tgo publisher.publish([]*Session{session})\n\treturn context.WithValue(ctx, contextSessionKey, session)\n}", "title": "" }, { "docid": "abbccbc76268cc11719553dd80d15f72", "score": "0.4775088", "text": "func (m Message) StartupArgs() (map[string]interface{}, error) {\n\tif m.Type() != 0 {\n\t\treturn nil, fmt.Errorf(\"expected untyped startup message, got: %q\", m.Type())\n\t}\n\n\tbuff := m[8:] // skip the length (4-bytes) and version (4-bytes)\n\n\t// first create a single long list of strings, combining both keys and\n\t// values alternately\n\tvar strings []string\n\tfor len(buff) > 0 {\n\n\t\t// search for the next NULL terminator\n\t\tidx := bytes.IndexByte(buff, 0)\n\t\tif idx == -1 {\n\t\t\tbreak // none found, we're done.\n\t\t}\n\n\t\t// convert it to a string and append to the list\n\t\tstrings = append(strings, string(buff[:idx]))\n\n\t\t// skip to the next terminator index for the next string\n\t\tbuff = buff[idx+1:]\n\t}\n\n\t// convert the list of strings to a map for key-value\n\t// all even indexes are keys, odd are values\n\targs := make(map[string]interface{})\n\tfor i := 0; i < len(strings)-1; i += 2 {\n\t\targs[strings[i]] = strings[i+1]\n\t}\n\n\treturn args, nil\n}", "title": "" }, { "docid": "cfab6b2ade64065b2026cf84102fe4b4", "score": "0.4770803", "text": "func (s *BaseCELListener) EnterCreateMessage(ctx *CreateMessageContext) {}", "title": "" }, { "docid": "3eca025e7ae592d021726a34d96b8973", "score": "0.47252637", "text": "func (ps *paxosStates) CreatePrepareMsg(iter int) ([]byte, error) {\n\t// generate a sequence number, ensured to be unique by\n\t// taking next multiple of numNodes and adding myID\n\tps.accingMutex.Lock()\n\tps.n_h = ps.numNodes*(1+(ps.n_h/ps.numNodes)) + ps.myID\n\tps.mySeqNum = ps.n_h\n\tmsg := &p_message{\n\t\tMtype: Prepare,\n\t\tHostPort: ps.myHostPort,\n\t\tSeqNum: ps.n_h,\n\t\tIteration: iter}\n\tps.accingMutex.Unlock()\n\tmsgB, err := json.Marshal(*msg)\n\tif err != nil {\n\t\tps.logger.Printf(\"CreatePrepareMsg: error while marshalling. %s\\n\", err)\n\t\treturn nil, err\n\t}\n\tgeneralMsg, err := ps.msgHandler.CreateMsg(message.PAXOS, string(msgB))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn generalMsg, nil\n}", "title": "" }, { "docid": "385d5b73f25c04c8bed258e591164129", "score": "0.46870026", "text": "func createSchema() error {\n\terr := pgdb.Model((*Message)(nil)).CreateTable(&orm.CreateTableOptions{\n\t\tTemp: false,\n\t})\n\treturn err\n}", "title": "" }, { "docid": "e11e85127f8095d241d1874b93229cbc", "score": "0.46496487", "text": "func (pubMgr *PubManager) CreateClient(key string, config map[string]interface{}) error {\n\n\tvar err error\n\tpubMgr.clients[key], err = eiimsgbus.NewMsgbusClient(config)\n\tif err != nil {\n\t\tglog.Errorf(\"-- Error creating context: %v\\n\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a8082e45d99a11cd7faaadd00a135ab9", "score": "0.46320292", "text": "func CreateInitialBackup(restclient *rest.RESTClient, namespace, clusterName, podName string) (*crv1.Pgtask, error) {\n\tvar params map[string]string\n\tparams = make(map[string]string)\n\tparams[config.LABEL_PGHA_BOOTSTRAP_BACKUP] = \"true\"\n\treturn CreateBackup(restclient, namespace, clusterName, podName, params, \"--type=full\")\n}", "title": "" }, { "docid": "ea345a88e483abda509753151a49647e", "score": "0.4626392", "text": "func NewMsgCreateScavenge(creator sdk.AccAddress, description, solutionHash string, reward sdk.Coins) MsgCreateScavenge {\n\treturn MsgCreateScavenge{\n\t\tCreator: creator,\n\t\tDescription: description,\n\t\tSolutionHash: solutionHash,\n\t\tReward: reward,\n\t}\n}", "title": "" }, { "docid": "8801172a45cb79248f369c4af965d3ae", "score": "0.45827004", "text": "func (protobufHandler *ProtobufHandler) CreatePingMessage() *protoMessages.PingMessage{\n\tpingMessage := &protoMessages.PingMessage{\n\t}\n\treturn pingMessage\n}", "title": "" }, { "docid": "950a9733bf0b61a79272c52e23f49774", "score": "0.45778564", "text": "func (s *Server) CreateStream(pconn *api.Connect, stream api.ConfigServer_CreateStreamServer) error {\n\tpr, ok := peer.FromContext(stream.Context())\n\tif !ok {\n\t\tserver.Logging.Warningf(\"configserver: cannot get client ip address!! %v\", pr.Addr)\n\t}\n\tserver.Logging.Debugf(\"configserver: received client connection request from ip %v\", pr.Addr)\n\t//Parsing client's ip address\n\tclientIP, _, _ := net.SplitHostPort(pr.Addr.String())\n\tclientName := pconn.Client.GetName()\n\tif clientName == \"\" {\n\t\tserver.Logging.Warnf(\"configserver: client name is empty, using client ip address:%v as its name\", clientIP)\n\t\treturn fmt.Errorf(\"configserver: client name cannot be empty\")\n\t}\n\tserver.Logging.Infof(\"configserver: registering or updating client:%v, groups:%v as ping:%v, as trace:%v, as app:%v\", pconn.Client.GetName(), pconn.Client.GetGroups(), pconn.Client.GetAddAsPingDest(), pconn.Client.GetAddAsTraceDest(), pconn.Client.GetAddAsAppDest())\n\t// may be reject client requests from the same ip address!\n\ts.Connections[clientName] = &ClientConnection{\n\t\tstream: stream,\n\t\tclient: *pconn.Client,\n\t\tnet: pr.Addr.String(),\n\t\tactive: true,\n\t\tlastactivetime: time.Now().UnixNano(),\n\t\terror: make(chan error),\n\t}\n\treturn <-s.Connections[pconn.Client.GetName()].error\n}", "title": "" }, { "docid": "39d9040c856cc3fb573797e8b3b6f889", "score": "0.45574254", "text": "func CreateInitialBackup(restclient *rest.RESTClient, namespace, clusterName, podName string) (*crv1.Pgtask, error) {\n\tvar params map[string]string\n\tparams = make(map[string]string)\n\tparams[config.LABEL_PGHA_BACKUP_TYPE] = crv1.BackupTypeBootstrap\n\treturn CreateBackup(restclient, namespace, clusterName, podName, params, \"--type=full\")\n}", "title": "" }, { "docid": "cd7c990f1d54d78fd39dd9ab6a0d68ee", "score": "0.44983786", "text": "func TestStartup(t *testing.T) {\n\tsuite.Run(t, new(StartupTest))\n}", "title": "" }, { "docid": "a917137cc9e4298ef21a730129ec49f5", "score": "0.44505975", "text": "func StartupPostgres() {\n\tif postgresURL == \"\" {\n\t\tlog.Fatalln(\"unable to connect to Postgres DB: no URL provided\")\n\t\treturn\n\t}\n\tdbHost, dbUser, dbPort, dbPw, dbName := services.GetPostgresDBSpecsFromURL(postgresURL)\n\tdbSpecs := fmt.Sprintf(\"host=%v port=%v user=%v password=%v dbname=%v sslmode=require TimeZone=Europe/Budapest\",\n\t\tdbHost, dbPort, dbUser, dbPw, dbName)\n\n\tvar err error\n\tpostgresDB, err = gorm.Open(postgres.Open(dbSpecs), &gorm.Config{})\n\tif err != nil {\n\t\ttry := 1\n\t\tfor try <= 6 && err != nil {\n\t\t\tlog.Printf(\"establishing connection to the database... %d\\nExiting after 5 tries.\", try)\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t\tpostgresDB, err = gorm.Open(postgres.Open(dbSpecs), &gorm.Config{})\n\t\t\ttry++\n\t\t\tif try == 6 {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\n\tpostgresDB.AutoMigrate(&models.User{})\n\tpostgresDB.AutoMigrate(&models.RefreshToken{})\n\tlog.Println(\"successfully connected to Postgres DB!\")\n}", "title": "" }, { "docid": "0e3b4e350b175323646ee90e1459610a", "score": "0.44394255", "text": "func (o *JsonEnclaveProcess) SetStartupTime(v string) {\n\to.StartupTime = &v\n}", "title": "" }, { "docid": "491eaf1a5cf622cdb9d78519d9dec390", "score": "0.44252968", "text": "func CreateMessage(name, greeting string) string {\n\treturn greeting + \" \" + name\n}", "title": "" }, { "docid": "dfcf0a20137606cc398f4be2ed57543f", "score": "0.43587884", "text": "func CreateSendInputMessage(inputState *shared.InputState, seq int64, dt time.Duration, playerId int64) *SendInputMessage {\n\treturn &SendInputMessage{\n\t\tSendTime: time.Now(),\n\t\tMessageType: SEND_INPUT_MESSAGE,\n\t\tInput: inputState,\n\t\tSeq: seq,\n\t\tDt: shared.MDuration{dt},\n\t\tPlayerId: playerId,\n\t}\n}", "title": "" }, { "docid": "518249cd85a794bf46b0a91cfda1ef8f", "score": "0.43357998", "text": "func (ps *paxosStates) CreateCommitMsg() ([]byte, error) {\n\t// no need to grab lock since we are the only thread reading mySeqNum\n\t// and v_a\n\tmsg := &p_message{\n\t\tMtype: Commit,\n\t\tHostPort: ps.myHostPort,\n\t\tSeqNum: ps.mySeqNum,\n\t\tVal: ps.v_a,\n\t\tIteration: ps.iteration}\n\tmsgB, err := json.Marshal(msg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgeneralMsg, err := ps.msgHandler.CreateMsg(message.PAXOS, string(msgB))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn generalMsg, nil\n}", "title": "" }, { "docid": "a99915b892e73c67a16630567931230a", "score": "0.43337026", "text": "func LogStartup(c Conf) {\n\t// startup logs\n\tlog.Printf(\"Starting up highlander API\")\n\tc.PrintConf()\n\tlog.Printf(\"ready for incoming requests ...\")\n}", "title": "" }, { "docid": "428d06af51e008ef5ed0389763c51588", "score": "0.43315122", "text": "func (sc *SocketClient) Create(a *logger.AppLogger) {\n fileName := fmt.Sprint(\"log/SocketClient/SocketClient_\", time.Now().Format(time.RFC3339), \".log\")\n logSymLink := \"log/SocketClient.log\"\n\n sc.al = a\n sc.al.SetPackageLog(sc.Identifier, fileName, logSymLink)\n\n sc.heartbeatChan = make(chan bool)\n sc.orderChan = make(chan []byte)\n\n go sc.waitForInput()\n}", "title": "" }, { "docid": "549e57f89bade423c3b540b46a98bb52", "score": "0.43125618", "text": "func CreateMessage(name, greeting string) (message string, alternate string) {\n\tmessage = greeting + \" \" + name\n\talternate = \"HEY! \" + name\n\n\treturn\n}", "title": "" }, { "docid": "c18319e7c62ccde2651ca1d98dec65cc", "score": "0.42778862", "text": "func (s *Server) Create(stream Sessions_CreateServer) error {\n\t// Receive and validate the request.\n\trequest, err := stream.Recv()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to receive request\")\n\t} else if err = request.ensureValid(true); err != nil {\n\t\treturn errors.Wrap(err, \"received invalid create request\")\n\t}\n\n\t// Wrap the stream in a prompter and register it with the prompt server.\n\tprompter, err := prompt.RegisterPrompter(&createStreamPrompter{stream})\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to register prompter\")\n\t}\n\n\t// Perform creation.\n\t// TODO: Figure out a way to monitor for cancellation.\n\tsession, err := s.manager.Create(\n\t\trequest.Alpha,\n\t\trequest.Beta,\n\t\trequest.Configuration,\n\t\trequest.ConfigurationAlpha,\n\t\trequest.ConfigurationBeta,\n\t\tprompter,\n\t)\n\n\t// Unregister the prompter.\n\tprompt.UnregisterPrompter(prompter)\n\n\t// Handle any errors.\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Signal completion.\n\tif err := stream.Send(&CreateResponse{Session: session}); err != nil {\n\t\treturn errors.Wrap(err, \"unable to send response\")\n\t}\n\n\t// Success.\n\treturn nil\n}", "title": "" }, { "docid": "072709c5720d2bfce74bf33ba2bc8bdb", "score": "0.42732593", "text": "func CreateConfigureSubscriptionInstanceRequest() (request *ConfigureSubscriptionInstanceRequest) {\n\trequest = &ConfigureSubscriptionInstanceRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Dts\", \"2018-08-01\", \"ConfigureSubscriptionInstance\", \"dts\", \"openAPI\")\n\treturn\n}", "title": "" }, { "docid": "e73fd4976343e694111b503a87c7430f", "score": "0.42660576", "text": "func (c *Client) CreateAssistantMessage(ctx context.Context, in *assist.CreateAssistantMessageRequest) error {\n\t_, err := c.grpc.CreateAssistantMessage(ctx, in)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bfbe3f75a8fcb2ca41604d227a0d9cbf", "score": "0.42593822", "text": "func (p *postgresManager) Create() error {\n\tdb := sqlx.MustConnect(\"postgres\", \"postgres://\"+p.host+\"/postgres?sslmode=disable\")\n\tdefer func() {\n\t\terr := db.Close()\n\t\tif err != nil {\n\t\t\tglog.Fatalf(\"%+v\", errors.Wrapf(err, \"failed closing db connection\"))\n\t\t}\n\t}()\n\n\tif err := p.createUser(db); err != nil {\n\t\treturn err\n\t}\n\n\tif err := p.createDatabase(db); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "0c9e78298c99e7acfb274b653d2ca898", "score": "0.42438495", "text": "func (s *BaseProsr1Listener) EnterMessageDefinition(ctx *MessageDefinitionContext) {}", "title": "" }, { "docid": "02574f8e6e82f38aac12147aaf6aa0f2", "score": "0.42424616", "text": "func (ps *paxosStates) CreateNoopMsg(iter int) ([]byte, error) {\n\tmsg := &p_message{\n\t\tMtype: NOOP,\n\t\tHostPort: ps.myHostPort,\n\t\tIteration: iter}\n\tmsgB, err := json.Marshal(*msg)\n\tif err != nil {\n\t\tps.logger.Printf(\"CreateNoopMsg: error while marshalling. %s\\n\", err)\n\t}\n\tgeneralMsg, err := ps.msgHandler.CreateMsg(message.PAXOS, string(msgB))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn generalMsg, nil\n}", "title": "" }, { "docid": "c668c6ba6d06a78818a02c0424a0e2c7", "score": "0.42397162", "text": "func New(engine Engine, crypter Crypter, params Params) *MessageProc {\n\n\tif params.MaxDuration == 0 {\n\t\tparams.MaxDuration = time.Hour * 24 * 31 // 31 days if nothing defined\n\t}\n\tif params.MaxPinAttempts == 0 {\n\t\tparams.MaxPinAttempts = 3\n\t}\n\tlog.Printf(\"[INFO] created messager with %+v\", params)\n\n\treturn &MessageProc{\n\t\tengine: engine,\n\t\tcrypt: crypter,\n\t\tParams: params,\n\t}\n}", "title": "" }, { "docid": "a5db8bbbfc7ce27c693d5627208549d0", "score": "0.42384082", "text": "func PsqlInit(options *PsqlOptions) (pgdb *PostgresStore, err error) {\n\t//postgres://<user>:<password>@<host>:<port>/<dbname>?<params>\n\tconnInfo := fmt.Sprintf(\"postgres://%s:%s@%s:%d/%s?sslmode=disable\",\n\t\toptions.UserName,\n\t\toptions.Password,\n\t\toptions.Host,\n\t\toptions.Port,\n\t\toptions.DBName)\n\tvar db *sqlx.DB\n\tdb, err = sqlx.Connect(\"postgres\", connInfo)\n\tif err != nil {\n\t\tlog.Print(err)\n\t\treturn nil, err\n\t}\n\tdefer db.Close()\n\n\tif err = db.Ping(); err == nil {\n\t\tpgdb, err = create(options, db)\n\t}\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\treturn pgdb, err\n}", "title": "" }, { "docid": "b074a1e7f8f7596c2c5d19587806be58", "score": "0.42377374", "text": "func (app *Application) CreateServer() error {\n\n\tapp.server = grpc.NewServer()\n\n\treturn nil\n}", "title": "" }, { "docid": "754848638a56870811821f3150d2ba04", "score": "0.42260048", "text": "func (client *Client) CreateStream(stream *graylog.Stream) (*ErrorInfo, error) {\n\treturn client.CreateStreamContext(context.Background(), stream)\n}", "title": "" }, { "docid": "4b98cf90d81be501f22d26a851de669e", "score": "0.42241004", "text": "func startup(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {\n\tstartupView := struct {\n\t\tOptionalHeadline bool\n\t\tSysName string\n\t\tSysNameLC string\n\t\tStoragePath string\n\t\tHomePageURL string\n\t\tSaveConfigPath string\n\t\tHomePage string\n\t\tAdmin string\n\t\tClientID string\n\t\tClientSecret string\n\t\tStorageLoc string\n\t}{\n\t\tfalse, config.SysName, config.SysNameLC, config.StdPath, config.SysURL,\n\t\tsaveConfigPath, fvHomePage, fvAdmin, fvClientID, fvClientSecret, fvStorageLoc,\n\t}\n\texecTemplate(\"startup.html\", w, startupView)\n}", "title": "" }, { "docid": "e9b5db7f9db55f0aa77524463e93023a", "score": "0.42240858", "text": "func (pb *ProcedureBuilder) Create() (string, error) {\n\tvar q strings.Builder\n\n\tq.WriteString(\"CREATE OR REPLACE\")\n\n\tqn, err := pb.QualifiedNameWithoutArguments()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tq.WriteString(fmt.Sprintf(\" PROCEDURE %v\", qn))\n\n\tq.WriteString(`(`)\n\targs := []string{}\n\tfor _, arg := range pb.args {\n\t\targs = append(args, fmt.Sprintf(`%v %v`, EscapeString(arg[\"name\"]), EscapeString(arg[\"type\"])))\n\t}\n\tq.WriteString(strings.Join(args, \", \"))\n\tq.WriteString(`)`)\n\n\tq.WriteString(fmt.Sprintf(\" RETURNS %v\", pb.returnType))\n\tq.WriteString(\" LANGUAGE javascript\")\n\tif pb.nullInputBehavior != \"\" {\n\t\tq.WriteString(fmt.Sprintf(` %v`, EscapeString(pb.nullInputBehavior)))\n\t}\n\tif pb.returnBehavior != \"\" {\n\t\tq.WriteString(fmt.Sprintf(` %v`, EscapeString(pb.returnBehavior)))\n\t}\n\tif pb.comment != \"\" {\n\t\tq.WriteString(fmt.Sprintf(\" COMMENT = '%v'\", EscapeString(pb.comment)))\n\t}\n\tq.WriteString(fmt.Sprintf(\" EXECUTE AS %v\", pb.executeAs))\n\tq.WriteString(fmt.Sprintf(\" AS $$%v$$\", pb.statement))\n\treturn q.String(), nil\n}", "title": "" }, { "docid": "16ca7dcea62f468a55206a0cc72d4999", "score": "0.422351", "text": "func (o *Phase1Options) SetStartupAction(v string) {\n\to.StartupAction = &v\n}", "title": "" }, { "docid": "09ee3c821ff30507e6c50dfc8aa2cec3", "score": "0.4222415", "text": "func (e *Edge) OnStartup() (err error) {\n\te.startReadingServices()\n\te.startListeningForTableUpdates()\n\te.site = Site{\n\t\tIP: e.ip,\n\t\tGeoCoords: e.geoCoords,\n\t}\n\tfor _, p := range e.proxies {\n\t\tp.start(e.healthCheckInterval)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4ddb97562640686944943101c7eb87a9", "score": "0.41996482", "text": "func Create(dbname string, passphrase []byte, iter int) error {\n\terr := encdb.Create(dbname, passphrase, iter, []string{\n\t\tcreateQueryKeyValue,\n\t\tcreateQueryNyms,\n\t\tcreateQueryContacts,\n\t\tcreateQueryAccounts,\n\t\tcreateQueryMessages,\n\t\tcreateQueryAttachments,\n\t\tcreateQueryChunks,\n\t\tcreateQueryOutQueue,\n\t\tcreateQueryInQueue,\n\t\tcreateMessageIDCache,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tmsgDB, err := Open(dbname, passphrase)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer msgDB.Close()\n\treturn msgDB.AddValue(DBVersion, Version)\n}", "title": "" }, { "docid": "eb837e24d58eda7f55c655c4f8242f81", "score": "0.41976976", "text": "func Init(ctx context.Context, cfg *pgx.ConnConfig) error {\n\tctx = zlog.ContextWithValues(ctx, \"component\", \"notifier/postgres/Init\")\n\tdb, err := sql.Open(\"pgx\", stdlib.RegisterConnConfig(cfg))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to open db: %w\", err)\n\t}\n\tdefer db.Close()\n\n\tzlog.Info(ctx).Msg(\"performing notifier migrations\")\n\tmigrator := migrate.NewPostgresMigrator(db)\n\tmigrator.Table = migrations.MigrationTable\n\tif err := migrator.Exec(migrate.Up, migrations.Migrations...); err != nil {\n\t\treturn fmt.Errorf(\"failed to perform migrations: %w\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b7b32ee8c2019f44dc6e5ea6072aa120", "score": "0.41957006", "text": "func CreateClientProtobufEndpoint(name string, transport ITransport, messageHandler ProtobufMessage, singleMessage bool) ProtobufEndpoint {\n\tendpoint := &ClientProtobufEndpoint{\n\t\tName: name,\n\n\t\ttransport: transport, // the transport\n\t\tMessageChannel: make(chan goproto.Message),\n\t\tmessageHandler: messageHandler, // the message parser\n\t}\n\n\tglog.Infof(\"Created Protobuf Endpoint \" + endpoint.GetName())\n\t// Start a Message Handling routine to wait for messages arriving on the transport point\n\tif singleMessage {\n\t\tgo endpoint.waitForSingleServerMessage() // TODO: redo using MessageWaiting policy\n\t} else {\n\t\tgo endpoint.waitForServerMessage()\n\t}\n\n\treturn endpoint\n}", "title": "" }, { "docid": "bcf322c28feba8f664e366d0751becdc", "score": "0.4193621", "text": "func (m Message) StartupVersion() (string, error) {\n\tif m.Type() != 0 {\n\t\treturn \"\", fmt.Errorf(\"expected untyped startup message, got: %q\", m.Type())\n\t}\n\n\tmajor := int(binary.BigEndian.Uint16(m[4:6]))\n\tminor := int(binary.BigEndian.Uint16(m[6:8]))\n\treturn fmt.Sprintf(\"%d.%d\", major, minor), nil\n}", "title": "" }, { "docid": "e552d6c6709208ee2c4a84e293656861", "score": "0.41728917", "text": "func (s *PriceBoardSocket) SendInitMessage(c *Client, data interface{}) {\n\tc.SendMessage(PriceBoardChannel, types.INIT, data)\n}", "title": "" }, { "docid": "f03ff101fe0464b2f568fd174e01bb8e", "score": "0.4164741", "text": "func CreateProtomsgCodec() MessageCodec {\n\tcodec := &ProtomsgCodec{}\n\treturn codec\n}", "title": "" }, { "docid": "bee786fd4810ba8c7c81b4bdcdf2cf23", "score": "0.415475", "text": "func ConnectPgInit() *sql.DB {\n\tclient, err := sql.Open(\"postgres\", fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\thost, port, user, pass, dbnm))\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t\treturn client\n\t}\n\treturn client\n}", "title": "" }, { "docid": "a8e772497f6291ef94be8d564ef38ac0", "score": "0.41459563", "text": "func CreateHost(req *pb.HostDefinition) (*pb.Host, error) {\n\tconn := GetConnection()\n\tdefer conn.Close()\n\tctx, cancel := GetContext(utils.TimeoutCtxHost)\n\tdefer cancel()\n\tservice := pb.NewHostServiceClient(conn)\n\thost, err := service.Create(ctx, req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create server: %v\", err)\n\t}\n\treturn host, nil\n}", "title": "" }, { "docid": "eb07ff207880dabc45b44806bfde62f5", "score": "0.4139349", "text": "func CreateMessage(req sdk.APIRequest, res sdk.APIResponder) error {\n\tvar msg model.WSInputMessage\n\n\tif err := req.GetContent(&msg); err != nil {\n\t\treturn res.Respond(&sdk.APIResponse{\n\t\t\tStatus: sdk.APIStatus.Invalid,\n\t\t\tErrorCode: \"FAIL_TO_PARSE_JSON\",\n\t\t\tMessage: \"Fail to parse JSON, please check the format. \" + err.Error(),\n\t\t})\n\t}\n\n\tif msg.Content == nil || len(msg.Topic) == 0 {\n\t\treturn res.Respond(&sdk.APIResponse{\n\t\t\tStatus: sdk.APIStatus.Invalid,\n\t\t\tErrorCode: \"INVALID_DATA\",\n\t\t\tMessage: \"INVALID data body.\",\n\t\t})\n\t}\n\n\t// Get room\n\troomResp := model.RoomDB.QueryOne(model.Room{\n\t\tID: bson.ObjectIdHex(msg.Content.ChatRoomID),\n\t})\n\n\tif roomResp.Status != sdk.APIStatus.Ok {\n\t\treturn res.Respond(roomResp)\n\t}\n\n\troomData := roomResp.Data.([]*model.Room)[0]\n\n\t// send message to client\n\tfor _, userId := range roomData.UserIds {\n\n\t\tif len(msg.Content.FromUserId) > 0 && userId == msg.Content.FromUserId {\n\t\t\tcontinue\n\t\t}\n\t\tconQResult := model.UserConnectionDB.QueryOne(model.UserConnection{\n\t\t\tUserID: userId,\n\t\t\tStatus: enum.ConStatus.ACTIVE,\n\t\t})\n\n\t\t// if offer call to offline user -> noti for user\n\t\tif conQResult.Status != sdk.APIStatus.Ok {\n\t\t\tif msg.Topic == enum.Topic.VIDEO_OFFER {\n\t\t\t\taction.FirebaseMessageQueueDB.PushWithKeys(msg.Content, &[]string{msg.Content.FromUserId})\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tuConn := conQResult.Data.([]*model.UserConnection)[0]\n\t\tgo func(con *model.UserConnection, msg model.WSInputMessage) {\n\n\t\t\t// Push message to user\n\t\t\tif con.Status == enum.ConStatus.ACTIVE {\n\t\t\t\taction.CreateNewMessage(msg.Topic, con.UserID, msg.Content)\n\t\t\t}\n\n\t\t}(uConn, msg)\n\n\t}\n\n\treturn res.Respond(&sdk.APIResponse{\n\t\tStatus: sdk.APIStatus.Ok,\n\t\tMessage: \"Create message success.\",\n\t})\n}", "title": "" }, { "docid": "bd43efa03f8a08f31c35bc1d20e73574", "score": "0.41387415", "text": "func (s *TradeSocket) SendInitMessage(c *Client, p interface{}) {\n\tc.SendMessage(TradeChannel, \"INIT\", p)\n}", "title": "" }, { "docid": "4c3ae3ca0e127e7dbcb02574d5361609", "score": "0.41359726", "text": "func (e Initiator) OnCreate(sessionID quickfix.SessionID) {\n return\n}", "title": "" }, { "docid": "6ec02a08cff316c98c2cf901004787b2", "score": "0.41357887", "text": "func (sc *ServerContext) PostStartup() {\n\t// Delay DatabaseContext processes starting up, e.g. to avoid replication reassignment churn when a Sync Gateway Cluster is being initialized\n\t// TODO: Consider sc.waitForRESTAPIs for faster startup?\n\ttime.Sleep(5 * time.Second)\n\tclose(sc.hasStarted)\n}", "title": "" }, { "docid": "89433244e915d2c7bd1d9874f2c7ec12", "score": "0.41341746", "text": "func (p *Persister) BeginCreate(\n\tctx context.Context,\n\t_ saga.Saga,\n\ttx persistence.Tx,\n\ts ax.Sender,\n\ti saga.Instance,\n) (saga.UnitOfWork, error) {\n\treturn p.newUnitOfWork(tx, s, i), nil\n}", "title": "" }, { "docid": "d027717e3ccc9f037d1272005bc2c3e3", "score": "0.4113415", "text": "func CreateApplication(language, owner, instanceURL string, data []byte) ([]byte, error) {\n\tconn, err := grpc.Dial(\n\t\tinstanceURL,\n\t\tgrpc.WithInsecure(),\n\t\tgrpc.WithPerRPCCredentials(authCredentials),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer conn.Close()\n\tclient := pb.NewApplicationFactoryClient(conn)\n\n\tctx, cancel := context.WithTimeout(context.Background(), timeout)\n\tdefer cancel()\n\n\tres, err := client.Create(ctx, &pb.RequestBody{\n\t\tLanguage: language,\n\t\tOwner: owner,\n\t\tData: data,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res.GetData(), nil\n}", "title": "" }, { "docid": "4495d2a53a984dafbba5a9ab3279bb8b", "score": "0.4098632", "text": "func CreateProducerMessage(topic, message string) *sarama.ProducerMessage {\n\treturn &sarama.ProducerMessage{\n\t\tTopic: topic,\n\t\tValue: sarama.StringEncoder(message),\n\t}\n}", "title": "" }, { "docid": "62ef1f1b506404d08ac6eab3d7cffc8a", "score": "0.409742", "text": "func (r *Resolver) CreateMessage(ctx context.Context, args *struct{ Message *types.Message }) (*model.MessageModel, error) {\n\treturn model.CreateMessage(ctx, r.store, args.Message)\n}", "title": "" }, { "docid": "6e6c5a37ab6039a03c10ad8bd7368ba4", "score": "0.4092225", "text": "func CreateGameStartedEvent() []byte {\n\tevt, _ := json.Marshal(Event{\n\t\tType: \"game_started\",\n\t})\n\n\treturn evt\n}", "title": "" }, { "docid": "a17ca7f5a4921c8cd551fce7dfac9613", "score": "0.40921938", "text": "func (recv *Window) SetStartupId(startupId string) {\n\tc_startup_id := C.CString(startupId)\n\tdefer C.free(unsafe.Pointer(c_startup_id))\n\n\tC.gdk_window_set_startup_id((*C.GdkWindow)(recv.native), c_startup_id)\n\n\treturn\n}", "title": "" }, { "docid": "5e59297b1bdb84315030991b8026e98b", "score": "0.4086212", "text": "func (a *App) StartupDatabase() *App {\n\tvar dbcontext *adapters.DbContext\n\tcontainer.Make(&dbcontext)\n\tdbcontext.Connect()\n\treturn a\n}", "title": "" }, { "docid": "dd4f3d2a26356b16366e53c146d03df5", "score": "0.40831918", "text": "func (a *Client) StartPostgreSQLShowCreateTableAction(params *StartPostgreSQLShowCreateTableActionParams) (*StartPostgreSQLShowCreateTableActionOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewStartPostgreSQLShowCreateTableActionParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"StartPostgreSQLShowCreateTableAction\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/v1/management/Actions/StartPostgreSQLShowCreateTable\",\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: &StartPostgreSQLShowCreateTableActionReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsuccess, ok := result.(*StartPostgreSQLShowCreateTableActionOK)\n\tif ok {\n\t\treturn success, nil\n\t}\n\t// unexpected success response\n\tunexpectedSuccess := result.(*StartPostgreSQLShowCreateTableActionDefault)\n\treturn nil, runtime.NewAPIError(\"unexpected success response: content available as default response in error\", unexpectedSuccess, unexpectedSuccess.Code())\n}", "title": "" }, { "docid": "e6936069d729a07d4cea6ce0e8ca4267", "score": "0.40759635", "text": "func (f *Fanout) OnStartup() (err error) {\n\tfor _, p := range f.clients {\n\t\tp.start()\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8f22496b6ab632b30a7279a40f5e12cf", "score": "0.40695694", "text": "func CreatePFlagsForK8SClient(set *pflag.FlagSet) {\n\tenv.CreatePFlags(set, &Settings{K8S: defaultClientConfiguration()})\n}", "title": "" }, { "docid": "482509a08ef113b26364baab17c0b136", "score": "0.4055594", "text": "func main() {\n\tvar host = flag.String(\"host\", defaultHost, \"service host\")\n\tvar port = flag.Int(\"port\", defaultPort, \"service port\")\n\tflag.Parse()\n\n\tfmt.Print(\"\\n\")\n\t_ = createMessage(*host, *port, \"Alice\", []string{})\n\tfmt.Print(\"\\n\")\n\t_ = createMessage(*host, *port, \"Cathy\", []string{})\n\tfmt.Print(\"\\n\")\n\t_ = createMessage(*host, *port, \"\", []string{\"123-456-789-0-1\"})\n\tfmt.Print(\"\\n\")\n}", "title": "" }, { "docid": "cb34d5a036b81f8ff67a9dc61434db8c", "score": "0.405482", "text": "func (a *App) LogStartup() {\n\t// startup logs\n\tlog.Printf(\"Starting up snoop API\")\n\ta.conf.PrintConf()\n}", "title": "" }, { "docid": "08c803436b878a8ffe9970b47fde2141", "score": "0.40524572", "text": "func Start(ctx context.Context) (_ *Server, err error) {\n\t// Prepare data directory.\n\tdir, err := ioutil.TempDir(\"\", \"postgrestest\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tos.RemoveAll(dir)\n\t\t}\n\t}()\n\tsuperuserPassword, err := randomString(16)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tpwFile := filepath.Join(dir, \"password\")\n\terr = ioutil.WriteFile(pwFile, []byte(superuserPassword), 0600)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tdataDir := filepath.Join(dir, \"data\")\n\terr = runCommand(\"initdb\",\n\t\t\"--no-sync\",\n\t\t\"--username=\"+superuserName,\n\t\t\"--pwfile=\"+pwFile,\n\t\t\"-D\", dataDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tport, err := findUnusedTCPPort()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tconst configFormat = \"\" +\n\t\t\"listen_addresses = localhost\\n\" +\n\t\t\"port = %d\\n\" +\n\t\t\"unix_socket_directories = ''\\n\" +\n\t\t\"fsync = off\\n\" +\n\t\t\"synchronous_commit = off\\n\" +\n\t\t\"full_page_writes = off\\n\"\n\terr = ioutil.WriteFile(\n\t\tfilepath.Join(dataDir, \"postgresql.conf\"),\n\t\t[]byte(fmt.Sprintf(configFormat, port)),\n\t\t0666)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\n\t// Start server process.\n\t// On Unix systems, pg_ctl runs as a daemon.\n\t// On Windows systems, pg_ctl runs in the foreground (not well-documented) and\n\t// drops privileges as needed.\n\tlogFile := filepath.Join(dir, \"log.txt\")\n\tproc, err := command(\"pg_ctl\", \"start\", \"--no-wait\", \"--pgdata=\"+dataDir, \"--log=\"+logFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tif err := proc.Start(); err != nil {\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\texited := make(chan struct{})\n\tsrv := &Server{\n\t\tdir: dir,\n\t\tbaseURL: (&url.URL{\n\t\t\tScheme: \"postgres\",\n\t\t\tHost: fmt.Sprintf(\"localhost:%d\", port),\n\t\t\tUser: url.UserPassword(superuserName, superuserPassword),\n\t\t\tPath: \"/\",\n\t\t}).String(),\n\t\texited: exited,\n\t}\n\tgo func() {\n\t\tdefer close(exited)\n\t\tsrv.waitErr = proc.Wait()\n\t}()\n\n\t// Wait for server to come up healthy.\n\tsrv.conn, err = sql.Open(\"postgres\", srv.DefaultDatabase())\n\tif err != nil {\n\t\t// Failure to open means the DSN is invalid. Connections aren't created\n\t\t// until we ping.\n\t\tsrv.stop()\n\t\treturn nil, fmt.Errorf(\"start postgres: %w\", err)\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tsrv.conn.Close()\n\t\t}\n\t}()\n\tsrv.conn.SetMaxOpenConns(1)\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tsrv.stop()\n\t\t\tlogOutput, _ := ioutil.ReadFile(logFile)\n\t\t\tif len(logOutput) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"start postgres: %w\", ctx.Err())\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"start postgres: %w\\n%s\", ctx.Err(), logOutput)\n\t\tdefault:\n\t\t\tif err := srv.conn.PingContext(ctx); err == nil {\n\t\t\t\treturn srv, nil\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4f22356d3e37e4fdb0dc762548e83f8c", "score": "0.40509284", "text": "func CreatePublisher(name string, msgSize string) (string, error) {\n\tlinks := []string{\n\t\tfmt.Sprintf(\"%s:rbmq\", rbmqContainerName),\n\t}\n\n\tenvs := []string{\n\t\tfmt.Sprintf(\"qname=%s\", name),\n\t\tfmt.Sprintf(\"msg-interval=%d\", random(1, 5)),\n\t\tfmt.Sprintf(\"msg-size=%v\", getMessageSize(msgSize)),\n\t}\n\n\tcontainerName := fmt.Sprintf(\"%s-publisher-%s\", containerNamePreix, name)\n\n\treturn createContainer(publisherImage, containerName, nil, links, envs, nil, 0)\n}", "title": "" }, { "docid": "a3f9aaaa0901ee3aedddc9ff07b3d6f4", "score": "0.40503657", "text": "func (recv *Window) ConnectCreateSurface(callback WindowSignalCreateSurfaceCallback) int {\n\tsignalWindowCreateSurfaceLock.Lock()\n\tdefer signalWindowCreateSurfaceLock.Unlock()\n\n\tsignalWindowCreateSurfaceId++\n\tinstance := C.gpointer(recv.native)\n\thandlerID := C.Window_signal_connect_create_surface(instance, C.gpointer(uintptr(signalWindowCreateSurfaceId)))\n\n\tdetail := signalWindowCreateSurfaceDetail{callback, handlerID}\n\tsignalWindowCreateSurfaceMap[signalWindowCreateSurfaceId] = detail\n\n\treturn signalWindowCreateSurfaceId\n}", "title": "" }, { "docid": "25afd9708aff5aebc3c6409ca296fd0a", "score": "0.40387478", "text": "func (shell *Shell) Create(args []string) (string, error) {\n\tif !shell.IsConnected() {\n\t\treturn \"\", ErrNotConnected\n\t}\n\treturn \"\", nil\n}", "title": "" }, { "docid": "7c9bda1a3da318e55a0dd0c59c1af17e", "score": "0.4034763", "text": "func Create(msgType string, channel string, header Header, payload string) *Message {\n\treturn &Message{\n\t\tmsgType,\n\t\tchannel,\n\t\theader,\n\t\tpayload,\n\t\tfalse,\n\t}\n}", "title": "" }, { "docid": "190911f30c7b9ef83093dfac18518eb3", "score": "0.40330708", "text": "func (r *replicatorPeer) Startup() {\n\tif r.running.CAS(false, true) {\n\t\tgo func() {\n\t\t\treplicatorLabels := pprof.Labels(\"type\", r.runner.replicatorType,\n\t\t\t\t\"replicator\", r.runner.replicator.String())\n\t\t\tpprof.Do(context.Background(), replicatorLabels, r.runner.replicaLoop)\n\t\t}()\n\t}\n}", "title": "" }, { "docid": "4e3451b21ab0d10bd1c4e6d039f8cd6e", "score": "0.40319028", "text": "func CreateAccountMessage(format string, currency string, isBalanceCheck bool) string {\n\tif isBalanceCheck {\n\t\treturn ReqCreateAccount + \" \" + format + \" \" + currency + \" t\"\n\t}\n\treturn ReqCreateAccount + \" \" + format + \" \" + currency + \" f\"\n}", "title": "" }, { "docid": "25410e78fbab97d78bed23c6299721d2", "score": "0.40314284", "text": "func (app *connectionBuilder) Create() ConnectionBuilder {\n\treturn createConnectionBuilder(\n\t\tapp.sigPKFactory,\n\t\tapp.encPKFactory,\n\t)\n}", "title": "" }, { "docid": "ad92282b8d88f5cf450a375984dddb71", "score": "0.402683", "text": "func (client SentinelOnboardingStatesClient) CreateSender(req *http.Request) (*http.Response, error) {\n\treturn client.Send(req, azure.DoRetryWithRegistration(client.Client))\n}", "title": "" }, { "docid": "86a02dff04eb1152f77279151175339f", "score": "0.40193582", "text": "func (client *ServersClient) startCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersBeginStartOptions) (*azcore.Request, error) {\n\turlPath := \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/start\"\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 serverName == \"\" {\n\t\treturn nil, errors.New(\"parameter serverName cannot be empty\")\n\t}\n\turlPath = strings.ReplaceAll(urlPath, \"{serverName}\", url.PathEscape(serverName))\n\treq, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Telemetry(telemetryInfo)\n\treqQP := req.URL.Query()\n\treqQP.Set(\"api-version\", \"2021-06-01\")\n\treq.URL.RawQuery = reqQP.Encode()\n\treq.Header.Set(\"Accept\", \"application/json\")\n\treturn req, nil\n}", "title": "" }, { "docid": "f745db654dcf54cb3d889d7f6145961b", "score": "0.4012731", "text": "func CreateCreateDBClusterRequest() (request *CreateDBClusterRequest) {\n\trequest = &CreateDBClusterRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"adb\", \"2019-03-15\", \"CreateDBCluster\", \"ads\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}", "title": "" }, { "docid": "5bae8fe5e53bb8efc80838f1d082f9ca", "score": "0.40086862", "text": "func CreateCreateBizTypeRequest() (request *CreateBizTypeRequest) {\n\trequest = &CreateBizTypeRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Green\", \"2017-08-23\", \"CreateBizType\", \"green\", \"openAPI\")\n\treturn\n}", "title": "" }, { "docid": "4c66705c8b9d09686055aa29d3bce04a", "score": "0.40055603", "text": "func (p *NATTPlugin) Startup(n libp2p.Network) {\n\tp.network = n\n\tp.peers = make(map[string]int)\n\tp.addrs = database.NewLRUCache(1000)\n\tu, _ := url.Parse(n.GetAddress())\n\tp.sid = u.User.Username()\n\tSelfAddress = n.GetAddress()\n\tp.Nodes = make(map[string]libp2p.Session)\n\tstartTime = time.Now().Unix()\n\n\tevent.RegisterConsumer(func(m event.Message) error {\n\t\tswitch msg := m.(type) {\n\t\tcase *messages.MinerInfo:\n\t\t\tminerNum = msg.Total\n\t\t}\n\t\treturn nil\n\t})\n\tGetNodes = p.GetNodes\n\tgo p.connectNodes()\n}", "title": "" }, { "docid": "9393ffe37e3549403049c706c1142294", "score": "0.40019557", "text": "func MessageBeforeCreate(\n\targMessage *types.Message,\n\targOldMessage *types.Message,\n\targChannel *types.Channel,\n) *messageBeforeCreate {\n\treturn &messageBeforeCreate{\n\t\tmessageBase: &messageBase{\n\t\t\timmutable: false,\n\t\t\tmessage: argMessage,\n\t\t\toldMessage: argOldMessage,\n\t\t\tchannel: argChannel,\n\t\t},\n\t}\n}", "title": "" }, { "docid": "d968887132201b4293e355ea61b02809", "score": "0.39969411", "text": "func (o *hasPrimary) SQLCreate() string {\n\treturn `create table if not exists teststruct (\n\t id integer,\n name text,\n kind integer,\n data text,\n created datetime\n\t);`\n}", "title": "" }, { "docid": "cf4fcfbe139275a33667ec9da24c0cd7", "score": "0.39909574", "text": "func InitializePostgresClient() error {\n\tpostgresHost := os.Getenv(\"POSTGRES_HOST\")\n\tpostgresUser := common.FallbackString(os.Getenv(\"POSTGRES_USER\"), \"postgres\")\n\tpostgresPassword := common.FallbackString(os.Getenv(\"POSTGRES_PASSWORD\"), \"postgres\")\n\tpostgresDatabase := common.FallbackString(os.Getenv(\"POSTGRES_DATABASE\"), \"postgres\")\n\n\tif len(postgresHost) == 0 {\n\t\treturn errors.New(\"[Ex 2.6+] POSTGRES_HOST env was not passed so postgres connection is not initialized\")\n\t}\n\n\tpostgresAddr := postgresHost + \":5432\"\n\n\tfmt.Println(`[Ex 2.6+] Initializing postgres connection with envs\n\t\tPOSTGRES_HOST ` + postgresHost + `,\n\t\tPOSTGRES_USER: ` + postgresUser + `,\n\t\tPOSTGRES_PASSWORD: ` + postgresPassword + `,\n\t\tPOSTGRES_DATABASE: ` + postgresDatabase + `\n\t\tto ` + postgresAddr)\n\n\tpgdb = pg.Connect(&pg.Options{\n\t\tAddr: postgresAddr,\n\t\tUser: postgresUser,\n\t\tPassword: postgresPassword,\n\t\tDatabase: postgresDatabase,\n\t})\n\n\tfor i := 0; i <= 10; i++ {\n\t\terr := pgdb.Ping(ctx)\n\t\tif err == nil {\n\t\t\tcreateSchema()\n\t\t\tmessage := &Message{\n\t\t\t\tBody: \"pong\",\n\t\t\t}\n\t\t\tpgdb.Model(message).Insert()\n\t\t\tfmt.Println(\"[Ex 2.6+] Connection to postgres initialized, ready to ping pong.\")\n\t\t\tbreak\n\t\t}\n\t\tif i < 10 {\n\t\t\tfmt.Println(\"[Ex 2.6+] Connection to postgres failed! Retrying...\")\n\t\t\ttime.Sleep(5 * time.Second)\n\t\t} else {\n\t\t\treturn errors.New(\"[Ex 2.6+] Failing to connect to postgres. The error is:\\n\" + err.Error())\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7d940056ac35477c4e11b11693c35261", "score": "0.39820912", "text": "func (ps *paxosStates) CreateAcceptMsg(val string) ([]byte, error) {\n\t// No need to grab lock since no other thread will update ps.mySeqNum\n\tmsg := &p_message{Mtype: Accept, HostPort: ps.myHostPort, SeqNum: ps.mySeqNum, Val: val}\n\tmsgB, err := json.Marshal(msg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgeneralMsg, err := ps.msgHandler.CreateMsg(message.PAXOS, string(msgB))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn generalMsg, nil\n}", "title": "" }, { "docid": "9cfc60d6971b48591577497eb880b240", "score": "0.3980233", "text": "func TestStartup(t *testing.T) {\n\n\ttempDirPath, err := getTempDirPath()\n\tif err != nil {\n\t\tt.Fatalf(\"BeforeTest: Failed to find an existing directory for testing! Error was: %v\", err)\n\t}\n\n\ttestDir := filepath.Join(tempDirPath, \"temp_dir_for_testing_startupshutdown.go\")\n\tosSenitiveTestDir := filepath.FromSlash(testDir)\n\n\texec.Command(\"rm\", \"-r\", osSenitiveTestDir).Run() // removes osSenitiveTestDir from the OS's temp directory, if the osSenitiveTestDir already exists\n\n\ttests := []struct {\n\t\tinput string\n\t\tshouldExecutionErr bool\n\t\tshouldRemoveErr bool\n\t}{\n\t\t// test case #0 tests proper functionality blocking commands\n\t\t{\"startup mkdir \" + osSenitiveTestDir, false, false},\n\n\t\t// test case #1 tests proper functionality of non-blocking commands\n\t\t{\"startup mkdir \" + osSenitiveTestDir + \" &\", false, true},\n\n\t\t// test case #2 tests handling of non-existant commands\n\t\t{\"startup \" + strconv.Itoa(int(time.Now().UnixNano())), true, true},\n\t}\n\n\tfor i, test := range tests {\n\t\tc := NewTestController(test.input)\n\t\t_, err = Startup(c)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Expected no errors, got: %v\", err)\n\t\t}\n\t\terr = c.FirstStartup[0]()\n\t\tif err != nil && !test.shouldExecutionErr {\n\t\t\tt.Errorf(\"Test %d recieved an error of:\\n%v\", i, err)\n\t\t}\n\t\terr = os.Remove(osSenitiveTestDir)\n\t\tif err != nil && !test.shouldRemoveErr {\n\t\t\tt.Errorf(\"Test %d recieved an error of:\\n%v\", i, err)\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "e2bd1f5aed4071160ad254fe630b6b5c", "score": "0.39720935", "text": "func (s *ServerConnection) InitCreatePrimaryDomain(domainName string) error {\n\tparams := struct {\n\t\tDomainName string `json:\"domainName\"`\n\t}{domainName}\n\t_, err := s.CallRaw(\"Init.createPrimaryDomain\", params)\n\treturn err\n}", "title": "" }, { "docid": "a57bb03f7b6b66d0fe5ac10515e94008", "score": "0.39663395", "text": "func CreateStartSession(ctx context.Context, cfg aws.Config, input *ssm.StartSessionInput) (*ssm.StartSessionOutput, error) {\n\tclient := ssm.NewFromConfig(cfg)\n\n\treturn client.StartSession(ctx, input)\n}", "title": "" }, { "docid": "aaf44d192bbdfd4161da9fd692c7c170", "score": "0.3961002", "text": "func (s *Server) newInstance(bs *BuilderServer) error {\n\tscmd := startupCmd // TODO: find better way to take address of const\n\tname := \"windows-builder-\" + uuid.New()\n\n\tmachineType := *bs.MachineType\n\tif machineType == \"\" {\n\t\tmachineType = \"n1-standard-1\"\n\t}\n\n\tdiskType := *bs.DiskType\n\tif diskType == \"\" {\n\t\tdiskType = \"pd-standard\"\n\t}\n\n\taccessConfigs := []*compute.AccessConfig{}\n\tif !*bs.UseInternalNet || *bs.CreateExternalIP {\n\t\taccessConfigs = []*compute.AccessConfig{\n\t\t\t&compute.AccessConfig{\n\t\t\t\tType: \"ONE_TO_ONE_NAT\",\n\t\t\t\tName: \"External NAT\",\n\t\t\t},\n\t\t}\n\t}\n\n\tinstance := &compute.Instance{\n\t\tName: name,\n\t\tMachineType: prefix + s.projectID + \"/zones/\" + *bs.Zone + \"/machineTypes/\" + machineType,\n\t\tDisks: []*compute.AttachedDisk{\n\t\t\t{\n\t\t\t\tAutoDelete: true,\n\t\t\t\tBoot: true,\n\t\t\t\tType: \"PERSISTENT\",\n\t\t\t\tInitializeParams: &compute.AttachedDiskInitializeParams{\n\t\t\t\t\tDiskName: fmt.Sprintf(\"%s-pd\", name),\n\t\t\t\t\tSourceImage: prefix + *bs.ImageUrl,\n\t\t\t\t\tDiskSizeGb: *bs.DiskSizeGb,\n\t\t\t\t\tDiskType: prefix + s.projectID + \"/zones/\" + *bs.Zone + \"/diskTypes/\" + diskType,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tMetadata: &compute.Metadata{\n\t\t\tItems: []*compute.MetadataItems{\n\t\t\t\t&compute.MetadataItems{\n\t\t\t\t\tKey: \"windows-startup-script-cmd\",\n\t\t\t\t\tValue: &scmd,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tNetworkInterfaces: []*compute.NetworkInterface{\n\t\t\t&compute.NetworkInterface{\n\t\t\t\tAccessConfigs: accessConfigs,\n\t\t\t\tNetwork: prefix + s.projectID + \"/global/networks/\" + *bs.VPC,\n\t\t\t\tSubnetwork: prefix + s.projectID + \"/regions/\" + *bs.Region + \"/subnetworks/\" + *bs.Subnet,\n\t\t\t},\n\t\t},\n\t\tServiceAccounts: []*compute.ServiceAccount{\n\t\t\t{\n\t\t\t\tEmail: bs.GetServiceAccountEmail(s.projectID),\n\t\t\t\tScopes: []string{\n\t\t\t\t\tcompute.CloudPlatformScope,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tLabels: bs.GetLabelsMap(),\n\t\tScheduling: &compute.Scheduling{\n\t\t\tPreemptible: *bs.Preemptible,\n\t\t},\n\t\tTags: &compute.Tags {\n\t\t\tItems: bs.GetTags(),\n\t\t},\n\t}\n\n\top, err := s.service.Instances.Insert(s.projectID, *bs.Zone, instance).Do()\n\tif err != nil {\n\t\tlog.Printf(\"GCE Instances insert call failed: %v\", err)\n\t\treturn err\n\t}\n\terr = s.waitForComputeOperation(op, bs)\n\tif err != nil {\n\t\tlog.Printf(\"Wait for instance start failed: %v\", err)\n\t\treturn err\n\t}\n\n\tetag := op.Header.Get(\"Etag\")\n\tinst, err := s.service.Instances.Get(s.projectID, *bs.Zone, name).IfNoneMatch(etag).Do()\n\tif err != nil {\n\t\tlog.Printf(\"Could not get GCE Instance details after creation: %v\", err)\n\t\treturn err\n\t}\n\tlog.Printf(\"Successfully created instance: %s\", inst.Name)\n\ts.instance = inst\n\treturn nil\n}", "title": "" }, { "docid": "1c4514ffc2a0791b246268835f1de581", "score": "0.39594817", "text": "func (a BrokerClient) Create(topic NewTopic) error {\n\tpanic(\"not implemented\")\n}", "title": "" }, { "docid": "009257842b8987a2f936b64434a591b3", "score": "0.3942458", "text": "func (s *CloudBackupServer) SchedCreate(\n\tctx context.Context,\n\treq *api.SdkCloudBackupSchedCreateRequest,\n) (*api.SdkCloudBackupSchedCreateResponse, error) {\n\tif s.driver(ctx) == nil {\n\t\treturn nil, status.Error(codes.Unavailable, \"Resource has not been initialized\")\n\t}\n\n\tcredId := req.GetCloudSchedInfo().GetCredentialId()\n\tvar err error\n\tif req.GetCloudSchedInfo() == nil {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"BackupSchedule object cannot be nil\")\n\t} else if len(req.GetCloudSchedInfo().GetSrcVolumeId()) == 0 {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"Must supply source volume id\")\n\t} else if len(req.GetCloudSchedInfo().GetCredentialId()) == 0 {\n\t\tcredId, err = s.defaultCloudBackupCreds(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else if req.GetCloudSchedInfo().GetSchedules() == nil ||\n\t\tlen(req.GetCloudSchedInfo().GetSchedules()) == 0 {\n\t\treturn nil, status.Error(codes.InvalidArgument, \"Must supply Schedule\")\n\t}\n\n\t// Check ownership\n\tif err := checkAccessFromDriverForVolumeIds(ctx, s.driver(ctx), []string{req.GetCloudSchedInfo().GetSrcVolumeId()}, api.Ownership_Read); err != nil {\n\t\treturn nil, err\n\t}\n\tif len(req.GetCloudSchedInfo().GetCredentialId()) != 0 {\n\t\tif err := s.checkAccessToCredential(ctx, req.GetCloudSchedInfo().GetCredentialId()); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tsched, err := sdkSchedToRetainInternalSpecYamlByte(req.GetCloudSchedInfo().GetSchedules())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbkpRequest := api.CloudBackupSchedCreateRequest{}\n\tbkpRequest.SrcVolumeID = req.GetCloudSchedInfo().GetSrcVolumeId()\n\tbkpRequest.CredentialUUID = credId\n\tbkpRequest.Schedule = string(sched)\n\tbkpRequest.MaxBackups = uint(req.GetCloudSchedInfo().GetMaxBackups())\n\tbkpRequest.RetentionDays = req.GetCloudSchedInfo().GetRetentionDays()\n\tbkpRequest.Full = req.GetCloudSchedInfo().GetFull()\n\tbkpRequest.GroupID = req.GetCloudSchedInfo().GetGroupId()\n\tbkpRequest.Labels = req.GetCloudSchedInfo().GetLabels()\n\n\t// Create the backup\n\tschedResp, err := s.driver(ctx).CloudBackupSchedCreate(&bkpRequest)\n\tif err != nil {\n\t\treturn nil, status.Errorf(codes.Internal, \"Failed to create backup: %v\", err)\n\t}\n\n\treturn &api.SdkCloudBackupSchedCreateResponse{\n\t\tBackupScheduleId: schedResp.UUID,\n\t}, nil\n\n}", "title": "" }, { "docid": "ee8dd9076eaaa34bca9a9140cca29ccd", "score": "0.39422303", "text": "func (r *mutationResolver) CreateMessage(ctx context.Context, input CreateMessageInput) (*models.Message, error) {\n\tvar message models.Message\n\tif err := message.Create(ctx, input.RequestID, input.ThreadID, input.Content); err != nil {\n\t\treturn &models.Message{}, domain.ReportError(ctx, err, \"CreateMessage\")\n\t}\n\n\treturn &message, nil\n}", "title": "" }, { "docid": "532b6292853c4b856d73453c5069bf89", "score": "0.3941815", "text": "func (o *Package) SQLCreate() string {\n\treturn `create table if not exists pkg (\n\t pkgdir text,\n name text,\n fake datetime\n\t);`\n}", "title": "" }, { "docid": "b5c535789f7a5e2ad3482683b5e38537", "score": "0.39386192", "text": "func StartPG(w rest.ResponseWriter, r *rest.Request) {\n\tlogit.Info.Println(\"cpmcontainerapi: StartPG called\")\n\treq := StartPGRequest{}\n\terr := r.DecodeJsonPayload(&req)\n\tif err != nil {\n\t\tlogit.Error.Println(err.Error())\n\t\trest.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tvar cmd *exec.Cmd\n\tcmd = exec.Command(\"startpg.sh\", req.ContainerName)\n\tvar out bytes.Buffer\n\tvar stderr bytes.Buffer\n\tcmd.Stdout = &out\n\tcmd.Stderr = &stderr\n\terr = cmd.Run()\n\tif err != nil {\n\t\tlogit.Error.Println(err.Error())\n\t\trest.Error(w, err.Error(), 400)\n\t\treturn\n\t}\n\n\tvar response StartPGResponse\n\tresponse.Output = out.String()\n\tresponse.Status = \"OK\"\n\tw.WriteJson(&response)\n}", "title": "" }, { "docid": "d5e996264075df998a00924951bdac61", "score": "0.39362365", "text": "func Init(sharedCfg *SharedCfg, flagsets FlagSets) error {\n\tshared, fs = sharedCfg, flagsets\n\n\tfromEnv := appcfg.NewFromEnv(envPrefix)\n\terr := appcfg.ProvideStruct(own, fromEnv)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tappcfg.AddPFlag(fs.GoosePostgres, &shared.XPostgresAddrHost, \"postgres.host\", \"host to connect to PostgreSQL\")\n\tappcfg.AddPFlag(fs.GoosePostgres, &shared.XPostgresAddrPort, \"postgres.port\", \"port to connect to PostgreSQL\")\n\tappcfg.AddPFlag(fs.GoosePostgres, &shared.XPostgresDBName, \"postgres.dbname\", \"PostgreSQL database name\")\n\tappcfg.AddPFlag(fs.GoosePostgres, &own.PostgresUser, \"postgres.user\", \"PostgreSQL username\")\n\tappcfg.AddPFlag(fs.GoosePostgres, &own.PostgresPass, \"postgres.pass\", \"PostgreSQL password\")\n\n\tpfx := app.ServiceName + \".\"\n\tappcfg.AddPFlag(fs.Serve, &shared.XPostgresAddrHost, \"postgres.host\", \"host to connect to PostgreSQL\")\n\tappcfg.AddPFlag(fs.Serve, &shared.XPostgresAddrPort, \"postgres.port\", \"port to connect to PostgreSQL\")\n\tappcfg.AddPFlag(fs.Serve, &shared.XPostgresDBName, \"postgres.dbname\", \"PostgreSQL database name\")\n\tappcfg.AddPFlag(fs.Serve, &own.PostgresUser, pfx+\"postgres.user\", \"PostgreSQL username\")\n\tappcfg.AddPFlag(fs.Serve, &own.PostgresPass, pfx+\"postgres.pass\", \"PostgreSQL password\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AddrHost, \"host\", \"host to serve\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AddrHostInt, \"host-int\", \"internal host to serve\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AuthAddrHost, \"auth.host\", \"ms/auth API host\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AuthAddrPort, \"auth.port\", \"ms/auth API port\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AuthAddrPortInt, \"auth.port-int\", \"ms/auth internal API port\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AuthGRPCGWAddrPort, \"auth.grpcgw.port\", \"ms/auth OpenAPI port\")\n\tappcfg.AddPFlag(fs.Serve, &shared.AuthMetricsAddrPort, \"auth.metrics.port\", \"ms/auth Prometheus metrics port\")\n\tappcfg.AddPFlag(fs.Serve, &own.Secret, pfx+\"secret\", \"secret used for hashing passwords\")\n\n\treturn nil\n}", "title": "" }, { "docid": "a8c4301ff92fa4b58957098aedc41f3a", "score": "0.39347136", "text": "func StartClients(nodeConnections map[string]net.Conn) {\n\tnumberOfClients := len(ipaddresses.GetClients())\n\t// NOTE: A full message object with a sender field is not required, since the clients will know that messages going\n\t// through this particular connection must come from the controller.\n\tstartupMessage := \"PROCEED\"\n\n\t// Send the client a start up message in the form of a string.\n\tfor i := 0; i < numberOfClients; i++ {\n\t\tgo tcp.Encode(nodeConnections[\"Client \" + string(i)], &startupMessage)\n\t}\n}", "title": "" }, { "docid": "fb3bc1d33fa5a71a14c2091d8c309efa", "score": "0.3930988", "text": "func CreatePlayground(w http.ResponseWriter, r *http.Request) {\n\tvar req createPlagroundRequest\n\n\terr := json.NewDecoder(r.Body).Decode(&req)\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// Create a bson document\n\tdocument := models.Playground{\n\t\tCells: req.Cells,\n\t\tID: primitive.NewObjectID(),\n\t\tCreatedAt: time.Now(),\n\t\tUpdatedAt: time.Now(),\n\t}\n\n\t// Go to the playground database, then to the playground collection and insert a\n\t// document within that collection\n\tplayground, err := db.Client.Database(\"playground\").Collection(\"playground\").InsertOne(db.Ctx, document)\n\n\t// Errors inserting the bson document?\n\tif err != nil {\n\t\tfmt.Println(\"some problems\", err)\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\t// At this point the playground has been created\n\t// Just send some data to the user to tell what just happend!\n\tvar resp = createPlaygroundResponse{Message: \"bundle created\", InsertedID: playground.InsertedID}\n\tjson.NewEncoder(w).Encode(&resp)\n}", "title": "" }, { "docid": "31b53d13cb35a6ff81334651118a8274", "score": "0.39288843", "text": "func start(dbDir string, km *keyManager.KeyManager, config StartConfig, client, uiUpstream UpStream) error {\n\n\tif config.EnableDebugging {\n\t\tlog.SetDebugLogging()\n\t}\n\n\t//Exit if instance was already created and not stopped\n\tif panthalassaInstance != nil {\n\t\treturn errors.New(\"call stop first in order to create a new panthalassa instance\")\n\t}\n\n\t// device api\n\tdeviceApi := api.New(client)\n\tkm.Api = deviceApi\n\n\t// create p2p network\n\tp2pNetwork, err := p2p.New()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// open database\n\tdbPath, err := db.KMToDBPath(dbDir, km)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// migrate\n\tmigrations := []db.Migration{\n\t\t&db.BoltToStormMigration{\n\t\t\tKm: km,\n\t\t},\n\t}\n\tif err := db.Migrate(dbPath, migrations); err != nil {\n\t\treturn err\n\t}\n\n\tdbInstance, err := storm.Open(dbPath, storm.BoltOptions(0644, &bolt.Options{Timeout: time.Second}))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// create signed pre key storage\n\tsignedPreKeyStorage := db.NewBoltSignedPreKeyStorage(dbInstance, km)\n\n\t// create backend\n\ttrans := backend.NewWSTransport(config.PrivChatEndpoint, config.PrivChatBearerToken, km)\n\n\tbackend, err := backend.NewBackend(trans, km, signedPreKeyStorage)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// ui api\n\tuiApi := uiapi.New(uiUpstream)\n\n\t// open message storage\n\tchatStorage := db.NewChatStorage(dbInstance, []func(db.MessagePersistedEvent){}, km)\n\n\t// queue instance\n\tjobStorage := queue.NewStorage(dbInstance)\n\tq := queue.New(jobStorage, 250, 4)\n\n\t// chat\n\tchatInstance, err := chat.NewChat(chat.Config{\n\t\tChatStorage: chatStorage,\n\t\tBackend: backend,\n\t\tSharedSecretDB: db.NewBoltSharedSecretStorage(dbInstance, km),\n\t\tKM: km,\n\t\tDRKeyStorage: db.NewBoltDRKeyStorage(dbInstance, km),\n\t\tSignedPreKeyStorage: signedPreKeyStorage,\n\t\tOneTimePreKeyStorage: db.NewBoltOneTimePreKeyStorage(dbInstance, km),\n\t\tUserStorage: db.NewBoltUserStorage(dbInstance),\n\t\tUiApi: uiApi,\n\t\tQueue: q,\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// dApp storage\n\tdAppStorage := dapp.NewDAppStorage(dbInstance, uiApi)\n\n\t// dApp registry\n\tdAppRegistry, err := dAppReg.NewDAppRegistry(p2pNetwork.Host, dAppReg.Config{\n\t\tEthWSEndpoint: config.EthWsEndpoint,\n\t}, deviceApi, km, dAppStorage, chatStorage)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// dyncall registry\n\tdcr := dyncall.New()\n\n\t// register document related calls\n\tdocStorage := documents.NewStorage(dbInstance, km)\n\tif err := RegisterDocumentCalls(dcr, docStorage, km); err != nil {\n\t\treturn err\n\t}\n\n\tethClient, err := ethclient.Dial(config.EthWsEndpoint)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnetworkID, err := ethClient.NetworkID(context.Background())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar notaryMultiAddr common.Address\n\n\tif networkID.Int64() == int64(4) {\n\t\tnotaryMultiAddr = common.HexToAddress(\"0xe4d2032fdda10d4e6f483e2dea6857abc0e3cbf8\")\n\t} else if networkID.Int64() == int64(1) {\n\t\tnotaryMultiAddr = common.HexToAddress(\"0xb54d5dcbadefe0838b3fb4cae3aa071c553aa297\")\n\t} else {\n\t\treturn errors.New(\"no notary available for network\")\n\t}\n\n\t// rinkeby addresses\n\t// @TODO Figure out if the notaryMultiAddr override of the if conditional above was done on purpose\n\t//notaryMultiAddr = common.HexToAddress(\"0xe4d2032fdda10d4e6f483e2dea6857abc0e3cbf8\")\n\n\tnotaryContract, err := documents.NewNotaryMulti(notaryMultiAddr, ethClient)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnotariseCall := documents.NewDocumentNotariseCall(docStorage, km, notaryContract)\n\tif err := dcr.Register(notariseCall); err != nil {\n\t\treturn err\n\t}\n\n\t// register contract calls\n\tif err := RegisterContactCalls(dcr, dbInstance); err != nil {\n\t\treturn err\n\t}\n\n\t//Create panthalassa instance\n\tpanthalassaInstance = &Panthalassa{\n\t\tkm: km,\n\t\tupStream: client,\n\t\tapi: deviceApi,\n\t\tp2p: p2pNetwork,\n\t\tdAppReg: dAppRegistry,\n\t\tchat: chatInstance,\n\t\tdb: dbInstance,\n\t\tdAppStorage: dAppStorage,\n\t\tdyncall: dcr,\n\t\tchatDB: chatStorage,\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d9eda28463fe48855a7193fe251b9b08", "score": "0.39240378", "text": "func StartupDB() (*reform.DB, error) {\n\thost := os.Getenv(\"DB_HOST\")\n\tport := os.Getenv(\"DB_PORT\")\n\tuser := os.Getenv(\"DB_USER\")\n\tpass := os.Getenv(\"DB_PASS\")\n\tdbname := os.Getenv(\"DB\")\n\n\tsource := fmt.Sprintf(\n\t\t\"postgres://%s:%s@%s:%s/%s?sslmode=disable\",\n\t\tuser, pass, host, port, dbname,\n\t)\n\n\tconn, err := sql.Open(\"postgres\", source)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Try ping to check connection\n\tattempts := 10\n\tfor i := 0; i < attempts; i++ {\n\t\terr = conn.Ping()\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(5 * time.Second)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdb := reform.NewDB(\n\t\tconn,\n\t\tpostgresql.Dialect,\n\t\treform.NewPrintfLogger(log.Printf),\n\t)\n\treturn db, nil\n}", "title": "" }, { "docid": "f12c56bd89936c3c943f1785e169f7a2", "score": "0.392143", "text": "func TestCreateConnection(t *testing.T) {\n\n\tfmt.Println(\"Connection creation test.\")\n\tcc := getClientConnection()\n\n\t// when done the connection will be close.\n\tdefer cc.Close()\n\n\t// Create a new client service...\n\tc := sqlpb.NewSqlServiceClient(cc)\n\n\trqst := &sqlpb.CreateConnectionRqst{\n\t\tConnection: &sqlpb.Connection{\n\t\t\tId: \"employees_db\",\n\t\t\tName: \"employees\",\n\t\t\tUser: \"test\",\n\t\t\tPassword: \"password\",\n\t\t\tPort: 3306,\n\t\t\tDriver: \"mysql\",\n\t\t\tHost: \"localhost\",\n\t\t\tCharset: \"utf8\",\n\t\t},\n\t}\n\n\t// Test with sql server.\n\t/*rqst := &sqlpb.CreateConnectionRqst{\n\t\tConnection: &sqlpb.Connection{\n\t\t\tId: \"bris_outil\",\n\t\t\tName: \"BrisOutil\",\n\t\t\tUser: \"dbprog\",\n\t\t\tPassword: \"dbprog\",\n\t\t\tPort: 1433,\n\t\t\tDriver: \"odbc\",\n\t\t\tHost: \"mon-sql-v01\",\n\t\t\tCharset: \"utf8\",\n\t\t},\n\t}*/\n\n\trsp, err := c.CreateConnection(context.Background(), rqst)\n\tif err != nil {\n\t\tlog.Fatalf(\"error while CreateConnection: %v\", err)\n\t}\n\n\tlog.Println(\"Response form CreateConnection:\", rsp.Result)\n}", "title": "" }, { "docid": "9ed97b5a5368614127d36d03f0f4c5b0", "score": "0.3921429", "text": "func CreateCreateUisConnectionRequest() (request *CreateUisConnectionRequest) {\n\trequest = &CreateUisConnectionRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Uis\", \"2018-08-21\", \"CreateUisConnection\", \"uis\", \"openAPI\")\n\treturn\n}", "title": "" }, { "docid": "929518ecb1a2ca291a8739a84b05df87", "score": "0.39151296", "text": "func (s *service) nodeStartup(ctx context.Context) error {\n\n\tif s.nodeIsInitialized {\n\t\treturn nil\n\t}\n\t// Maximum number of pending requests before overload returned\n\tnodePendingState.maxPending = 10\n\n\t// Copy the multipath.conf file from /noderoot/etc/multipath.conf (EnvISCSIChroot)to /etc/multipath.conf if present\n\t//iscsiChroot, _ := csictx.LookupEnv(context.Background(), EnvISCSIChroot)\n\t//copyMultipathConfigFile(iscsiChroot, \"\")\n\n\t// make sure we have a connection to Unisphere\n\tif s.adminClient == nil {\n\t\treturn fmt.Errorf(\"There is no Unisphere connection\")\n\t}\n\tportWWNs := make([]string, 0)\n\tIQNs := make([]string, 0)\n\tvar err error\n\n\tif !s.opts.IsVsphereEnabled {\n\n\t\t// Get fibre channel initiators\n\t\tportWWNs, err = gofsutil.GetFCHostPortWWNs(context.Background())\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"nodeStartup could not GetFCHostPortWWNs %s\", err.Error())\n\t\t}\n\n\t\t// Get iscsi initiators.\n\t\tIQNs, err = s.iscsiClient.GetInitiators(\"\")\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"nodeStartup could not GetInitiatorIQNs: %s\", err.Error())\n\t\t}\n\n\t\tlog.Infof(\"TransportProtocol %s FC portWWNs: %s ... IQNs: %s\", s.opts.TransportProtocol, portWWNs, IQNs)\n\t\t// The driver needs at least one FC or iSCSI initiator to be defined\n\t\tif len(portWWNs) == 0 && len(IQNs) == 0 {\n\t\t\treturn fmt.Errorf(\"No FC or iSCSI initiators were found and at least 1 is required\")\n\t\t}\n\t} else {\n\t\terr := s.setVMHost()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlog.Debug(\"vmhost created successfully\")\n\t}\n\n\tarrays, err := s.retryableGetSymmetrixIDList()\n\tif err != nil {\n\t\tlog.Error(\"Failed to fetch array list. Continuing without initializing node\")\n\t\treturn err\n\t}\n\tsymmetrixIDs := arrays.SymmetrixIDs\n\tlog.Debug(fmt.Sprintf(\"GetSymmetrixIDList returned: %v\", symmetrixIDs))\n\n\ts.nodeHostSetup(ctx, portWWNs, IQNs, symmetrixIDs) // #nosec G20\n\n\treturn err\n}", "title": "" }, { "docid": "466e3f204a48b2a5bd483f3b2fa6c30a", "score": "0.39128155", "text": "func (client *Client)TopicCreate(topicName string) error {\n\tencodingMsg := new(rcfUtil.Smsg)\n\tencodingMsg.Type = \"topic\"\n\tencodingMsg.Name = topicName\n\tencodingMsg.Operation = \"create\"\n\tencodingMsg.Payload = []byte{}\n\tencodedMsg, err := rcfUtil.EncodeMsg(encodingMsg)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclient.clientWriteRequestCh <- encodedMsg\n\tencodingMsg = nil\n\treturn nil\n}", "title": "" }, { "docid": "273afc043f81673cff152a8167ee60a5", "score": "0.3909291", "text": "func (protobufHandler *ProtobufHandler) CreateWrapperMessage_1(senderKademliaId *KademliaID, requestId int64, messageType protoMessages.MessageType, message *protoMessages.PingMessage, isReply bool) *protoMessages.WrapperMessage{\n\twrapperMessage := &protoMessages.WrapperMessage{\n\t\tSenderKademliaId: senderKademliaId.String(),\n\t\tMessageType:messageType,\n\t\tRequestId:requestId,\n\t\tIsReply:isReply,\n\t}\n\twrapperMessage.Msg_1 = message\n\n\treturn wrapperMessage\n}", "title": "" } ]
9729181ed4ee9c894c6ac9c476cecc74
Deprecated: Use Place.ProtoReflect.Descriptor instead.
[ { "docid": "e7748aa277e54d6fdec9b2030affd0fa", "score": "0.6480897", "text": "func (*Place) Descriptor() ([]byte, []int) {\n\treturn file_google_streetview_publish_v1_resources_proto_rawDescGZIP(), []int{4}\n}", "title": "" } ]
[ { "docid": "fb1ddb6443cdf81602d35cce82a0181d", "score": "0.6713948", "text": "func ProtoFromDescriptor(d protoreflect.Descriptor) proto.Message {\n\tswitch d := d.(type) {\n\tcase protoreflect.FileDescriptor:\n\t\treturn ProtoFromFileDescriptor(d)\n\tcase protoreflect.MessageDescriptor:\n\t\treturn ProtoFromMessageDescriptor(d)\n\tcase protoreflect.FieldDescriptor:\n\t\treturn ProtoFromFieldDescriptor(d)\n\tcase protoreflect.OneofDescriptor:\n\t\treturn ProtoFromOneofDescriptor(d)\n\tcase protoreflect.EnumDescriptor:\n\t\treturn ProtoFromEnumDescriptor(d)\n\tcase protoreflect.EnumValueDescriptor:\n\t\treturn ProtoFromEnumValueDescriptor(d)\n\tcase protoreflect.ServiceDescriptor:\n\t\treturn ProtoFromServiceDescriptor(d)\n\tcase protoreflect.MethodDescriptor:\n\t\treturn ProtoFromMethodDescriptor(d)\n\tdefault:\n\t\t// WTF??\n\t\tif res, ok := d.(DescriptorProtoWrapper); ok {\n\t\t\treturn res.AsProto()\n\t\t}\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "aa871d6ac628726e37e69ae34c259da1", "score": "0.66959655", "text": "func (*Verdict) Descriptor() ([]byte, []int) {\n\treturn file_google_maps_addressvalidation_v1_address_validation_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "16ce285993d8f24541a88b6bdcc8b52a", "score": "0.66470426", "text": "func (*Instance) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "3ab7613230c6da0ee0c1f1e5794eb804", "score": "0.66236657", "text": "func (*PatchCollectorsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{161}\n}", "title": "" }, { "docid": "9a5306f3de5b2052c3dadfbdf5c5111d", "score": "0.66177213", "text": "func (*KnownTypes) Descriptor() ([]byte, []int) {\n\treturn file_jsonpb_proto_test2_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "959ec1184a4bf161419af69002b63169", "score": "0.661083", "text": "func (*Place) Descriptor() ([]byte, []int) {\n\treturn file_google_maps_places_v1_place_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "69124f8da1b539755bd7444056c4b0d6", "score": "0.65959424", "text": "func (*AddPeerRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "04dea997fe49fa6150fb7cc07a852e25", "score": "0.65916985", "text": "func (*TraceProto) Descriptor() ([]byte, []int) {\n\treturn file_internal_tracing_extended_extended_trace_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "df9f06b1dc4ca934b99af0b32c92836c", "score": "0.6588238", "text": "func ProtoFromFileDescriptor(d protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto {\n\tif imp, ok := d.(protoreflect.FileImport); ok {\n\t\td = imp.FileDescriptor\n\t}\n\ttype canProto interface {\n\t\tFileDescriptorProto() *descriptorpb.FileDescriptorProto\n\t}\n\tif res, ok := d.(canProto); ok {\n\t\treturn res.FileDescriptorProto()\n\t}\n\tif res, ok := d.(DescriptorProtoWrapper); ok {\n\t\tif fd, ok := res.AsProto().(*descriptorpb.FileDescriptorProto); ok {\n\t\t\treturn fd\n\t\t}\n\t}\n\treturn protodesc.ToFileDescriptorProto(d)\n}", "title": "" }, { "docid": "cce87206f09ada14aadcd3f50c9fbde2", "score": "0.6575797", "text": "func (*PrivateVisibility) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_dns_v1_dns_zone_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "950b6c4a7ccab25f49fc6853d69276a4", "score": "0.6573762", "text": "func (*Type) Descriptor() ([]byte, []int) {\n\treturn file_google_api_expr_v1alpha1_checked_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "4aaca40eda3ba7e6237fb667014b02ea", "score": "0.65711576", "text": "func (*MyProto) Descriptor() ([]byte, []int) {\n\treturn file_my_proto_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "257785a623fd4c151db6000f3f5aa8c6", "score": "0.6543656", "text": "func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto {\n\tp := &descriptorpb.FileDescriptorProto{\n\t\tName: proto.String(file.Path()),\n\t\tOptions: proto.Clone(file.Options()).(*descriptorpb.FileOptions),\n\t}\n\tif file.Package() != \"\" {\n\t\tp.Package = proto.String(string(file.Package()))\n\t}\n\tfor i, imports := 0, file.Imports(); i < imports.Len(); i++ {\n\t\timp := imports.Get(i)\n\t\tp.Dependency = append(p.Dependency, imp.Path())\n\t\tif imp.IsPublic {\n\t\t\tp.PublicDependency = append(p.PublicDependency, int32(i))\n\t\t}\n\t\tif imp.IsWeak {\n\t\t\tp.WeakDependency = append(p.WeakDependency, int32(i))\n\t\t}\n\t}\n\tfor i, locs := 0, file.SourceLocations(); i < locs.Len(); i++ {\n\t\tloc := locs.Get(i)\n\t\tl := &descriptorpb.SourceCodeInfo_Location{}\n\t\tl.Path = append(l.Path, loc.Path...)\n\t\tif loc.StartLine == loc.EndLine {\n\t\t\tl.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndColumn)}\n\t\t} else {\n\t\t\tl.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndLine), int32(loc.EndColumn)}\n\t\t}\n\t\tl.LeadingDetachedComments = append([]string(nil), loc.LeadingDetachedComments...)\n\t\tif loc.LeadingComments != \"\" {\n\t\t\tl.LeadingComments = proto.String(loc.LeadingComments)\n\t\t}\n\t\tif loc.TrailingComments != \"\" {\n\t\t\tl.TrailingComments = proto.String(loc.TrailingComments)\n\t\t}\n\t\tif p.SourceCodeInfo == nil {\n\t\t\tp.SourceCodeInfo = &descriptorpb.SourceCodeInfo{}\n\t\t}\n\t\tp.SourceCodeInfo.Location = append(p.SourceCodeInfo.Location, l)\n\n\t}\n\tfor i, messages := 0, file.Messages(); i < messages.Len(); i++ {\n\t\tp.MessageType = append(p.MessageType, ToDescriptorProto(messages.Get(i)))\n\t}\n\tfor i, enums := 0, file.Enums(); i < enums.Len(); i++ {\n\t\tp.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i)))\n\t}\n\tfor i, services := 0, file.Services(); i < services.Len(); i++ {\n\t\tp.Service = append(p.Service, ToServiceDescriptorProto(services.Get(i)))\n\t}\n\tfor i, exts := 0, file.Extensions(); i < exts.Len(); i++ {\n\t\tp.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i)))\n\t}\n\tif syntax := file.Syntax(); syntax != protoreflect.Proto2 {\n\t\tp.Syntax = proto.String(file.Syntax().String())\n\t}\n\treturn p\n}", "title": "" }, { "docid": "b3f3a46ac1a7ebcb180c3ae6fa52e3be", "score": "0.65374404", "text": "func (*Reference) Descriptor() ([]byte, []int) {\n\treturn file_google_api_expr_v1alpha1_checked_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "55d6b477ce7c7cc68b36608db2bfd5f8", "score": "0.6523215", "text": "func (*StandardProtocols) Descriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_beam_runner_api_proto_rawDescGZIP(), []int{54}\n}", "title": "" }, { "docid": "efc12a107612090ba92eedc28ead9cc7", "score": "0.6505971", "text": "func (*Decl) Descriptor() ([]byte, []int) {\n\treturn file_google_api_expr_v1alpha1_checked_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "744187482a7a2b61a59bab4afed5dff3", "score": "0.64912516", "text": "func (*Preferences) Descriptor() ([]byte, []int) {\n\treturn file_google_ads_googleads_v2_services_reach_plan_service_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "e0c8d83f8174d65cb9d29ccd5e4cd7cd", "score": "0.6488184", "text": "func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto {\n\tp := &descriptorpb.DescriptorProto{\n\t\tName: proto.String(string(message.Name())),\n\t\tOptions: proto.Clone(message.Options()).(*descriptorpb.MessageOptions),\n\t}\n\tfor i, fields := 0, message.Fields(); i < fields.Len(); i++ {\n\t\tp.Field = append(p.Field, ToFieldDescriptorProto(fields.Get(i)))\n\t}\n\tfor i, exts := 0, message.Extensions(); i < exts.Len(); i++ {\n\t\tp.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i)))\n\t}\n\tfor i, messages := 0, message.Messages(); i < messages.Len(); i++ {\n\t\tp.NestedType = append(p.NestedType, ToDescriptorProto(messages.Get(i)))\n\t}\n\tfor i, enums := 0, message.Enums(); i < enums.Len(); i++ {\n\t\tp.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i)))\n\t}\n\tfor i, xranges := 0, message.ExtensionRanges(); i < xranges.Len(); i++ {\n\t\txrange := xranges.Get(i)\n\t\tp.ExtensionRange = append(p.ExtensionRange, &descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\tStart: proto.Int32(int32(xrange[0])),\n\t\t\tEnd: proto.Int32(int32(xrange[1])),\n\t\t\tOptions: proto.Clone(message.ExtensionRangeOptions(i)).(*descriptorpb.ExtensionRangeOptions),\n\t\t})\n\t}\n\tfor i, oneofs := 0, message.Oneofs(); i < oneofs.Len(); i++ {\n\t\tp.OneofDecl = append(p.OneofDecl, ToOneofDescriptorProto(oneofs.Get(i)))\n\t}\n\tfor i, ranges := 0, message.ReservedRanges(); i < ranges.Len(); i++ {\n\t\trrange := ranges.Get(i)\n\t\tp.ReservedRange = append(p.ReservedRange, &descriptorpb.DescriptorProto_ReservedRange{\n\t\t\tStart: proto.Int32(int32(rrange[0])),\n\t\t\tEnd: proto.Int32(int32(rrange[1])),\n\t\t})\n\t}\n\tfor i, names := 0, message.ReservedNames(); i < names.Len(); i++ {\n\t\tp.ReservedName = append(p.ReservedName, string(names.Get(i)))\n\t}\n\treturn p\n}", "title": "" }, { "docid": "09cc88b62624cb6546b357b3113c8e72", "score": "0.6486729", "text": "func (*PlannableLocation) Descriptor() ([]byte, []int) {\n\treturn file_google_ads_googleads_v2_services_reach_plan_service_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "f86fb18234e8b88d2015c91aa1845d8c", "score": "0.6484955", "text": "func ProtoFromMethodDescriptor(d protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto {\n\ttype canProto interface {\n\t\tMethodDescriptorProto() *descriptorpb.MethodDescriptorProto\n\t}\n\tif res, ok := d.(canProto); ok {\n\t\treturn res.MethodDescriptorProto()\n\t}\n\tif res, ok := d.(DescriptorProtoWrapper); ok {\n\t\tif md, ok := res.AsProto().(*descriptorpb.MethodDescriptorProto); ok {\n\t\t\treturn md\n\t\t}\n\t}\n\treturn protodesc.ToMethodDescriptorProto(d)\n}", "title": "" }, { "docid": "83a880b0773d018aeb43d705ac7204d2", "score": "0.64762616", "text": "func (*GetTeamByName) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "6a3988c66187a54697e53f685dec7acb", "score": "0.6472807", "text": "func (*PatchAnnotationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "71cf8dc75c880af1ed9c68525e54b448", "score": "0.6472003", "text": "func (*PublicVisibility) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_dns_v1_dns_zone_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "080e07d649df018a8b630719a75f5f16", "score": "0.6471559", "text": "func (*TokenProto) Descriptor() ([]byte, []int) {\n\treturn file_Security_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "de10e1c4e850b30de293cdba73b719aa", "score": "0.64663917", "text": "func (*Example) Descriptor() ([]byte, []int) {\n\treturn file_google_ai_generativelanguage_v1beta2_discuss_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "874c46e5cc3c912013ea1a148fe16b78", "score": "0.6454921", "text": "func (*WithWellKnownTypes) Descriptor() ([]byte, []int) {\n\treturn file_testing_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "88bd84b8275c41c64cea85df3499aedd", "score": "0.64481497", "text": "func (*Instant) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_datatypes_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "8988fb45c63a2c0c2e1de834dd0e4c4b", "score": "0.6420376", "text": "func (*Address) Descriptor() ([]byte, []int) {\n\treturn file_services_grpcPb_grpc_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "d872505919eda6d2b7cea192f43d8ac0", "score": "0.641351", "text": "func (*Module) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_cloudtrace_v2_trace_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "260a724ce10530d64e7f122d3a235d62", "score": "0.641333", "text": "func (*UpdateTeam) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "a68d12cf4961b8c3b337c7b700b9e76c", "score": "0.6408819", "text": "func (SocketAddress_Protocol) EnumDescriptor() ([]byte, []int) {\n\treturn file_envoy_config_core_v3_address_proto_rawDescGZIP(), []int{1, 0}\n}", "title": "" }, { "docid": "34f6ff93f8e98f9a2fc4429e78ada8c1", "score": "0.64082813", "text": "func (*AddPeerResponse) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{30}\n}", "title": "" }, { "docid": "36c1bbd1d6d5223e7b65c650ecadb8d0", "score": "0.6402036", "text": "func (*ValidatorUpdate) Descriptor() ([]byte, []int) {\n\treturn file_tm_replay_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "94f0395c6395ad8de90bb9249608ffc7", "score": "0.6398099", "text": "func (*Team) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{12}\n}", "title": "" }, { "docid": "1902f006ff1ca65b3f7e7ddc010be1fd", "score": "0.6398089", "text": "func (*Distance) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_datatypes_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "c7336dd8dd9000aec5972aa0ff95b712", "score": "0.63963664", "text": "func (*CoordinateRecon_Place) Descriptor() ([]byte, []int) {\n\treturn file_recon_proto_rawDescGZIP(), []int{1, 0}\n}", "title": "" }, { "docid": "01c08f908c848c1f72fa4ac68a423cd8", "score": "0.6392217", "text": "func (*GetTeamById) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "3c03d7126489add5144a65405c9afdaf", "score": "0.63723856", "text": "func (*NetProtoTalker) Descriptor() ([]byte, []int) {\n\treturn file_pkg_smgrpc_smgrpc_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "d58ff8c943f8ad8bafadee12aa7c1e27", "score": "0.6371688", "text": "func (*GetPeerInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_github_com_yahuizhan_dappley_metrics_go_api_rpc_pb_rpc_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "7f1ecf960e31ab3bf3a3821ca629a0ac", "score": "0.63637507", "text": "func (*Point) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "d8e0990c59a8fea1a03ee5d035bd2da8", "score": "0.63621426", "text": "func (*TelemetryParams) Descriptor() ([]byte, []int) {\n\treturn file_protocol_rpc_rpc_proto_rawDescGZIP(), []int{62}\n}", "title": "" }, { "docid": "369874ae6419948de21e41d5b12a85c1", "score": "0.6359368", "text": "func (*DeleteTeam) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "0b72b448d0cb268be041c97e8aa977e8", "score": "0.6355925", "text": "func (*CMsgGCPlayerInfoRequest) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_client_proto_rawDescGZIP(), []int{117}\n}", "title": "" }, { "docid": "fd7d11169007fe96a9e47eb91eb510e7", "score": "0.63487726", "text": "func (*RecogPlace) Descriptor() ([]byte, []int) {\n\treturn file_recon_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "6b3458c6707a8cb092cd4455840c6ad2", "score": "0.6341386", "text": "func (*WatchRequestTypeProto) Descriptor() ([]byte, []int) {\n\treturn file_raft_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "e00180408362be62389d2f580b27c8b3", "score": "0.63405025", "text": "func (*MoveAddressMetadata) Descriptor() ([]byte, []int) {\n\treturn file_yandex_cloud_vpc_v1_address_service_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "564dcda5c270f87efac5837a1f815115", "score": "0.63376135", "text": "func (*Listen) Descriptor() ([]byte, []int) {\n\treturn file_pkg_smgrpc_smgrpc_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "aacda3c84a2a04e1240dfd4105f73652", "score": "0.6332626", "text": "func (StandardPTransforms_DeprecatedPrimitives) EnumDescriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_beam_runner_api_proto_rawDescGZIP(), []int{4, 1}\n}", "title": "" }, { "docid": "92e2f841ccafccaff915111898364ca4", "score": "0.6325714", "text": "func (*Place_PlusCode) Descriptor() ([]byte, []int) {\n\treturn file_google_maps_places_v1_place_proto_rawDescGZIP(), []int{0, 1}\n}", "title": "" }, { "docid": "f5fc89ef834b72c11598de60fcc05ec9", "score": "0.63241315", "text": "func (*Person) Descriptor() ([]byte, []int) {\n\treturn file_protomessage_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "6ab81a10f420f302af54808ae537c5f0", "score": "0.63200015", "text": "func (*GetServiceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "fae7d3e6db90c9123f86b00006d5ef83", "score": "0.63198775", "text": "func ProtoFromFieldDescriptor(d protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto {\n\ttype canProto interface {\n\t\tFieldDescriptorProto() *descriptorpb.FieldDescriptorProto\n\t}\n\tif res, ok := d.(canProto); ok {\n\t\treturn res.FieldDescriptorProto()\n\t}\n\tif res, ok := d.(DescriptorProtoWrapper); ok {\n\t\tif fd, ok := res.AsProto().(*descriptorpb.FieldDescriptorProto); ok {\n\t\t\treturn fd\n\t\t}\n\t}\n\treturn protodesc.ToFieldDescriptorProto(d)\n}", "title": "" }, { "docid": "e726f3431301a5ceeda4f0e0c019251e", "score": "0.63196945", "text": "func (*MetadataProto) Descriptor() ([]byte, []int) {\n\treturn file_raft_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "be0eb97f34f8a60ce91fc58efa724638", "score": "0.6319285", "text": "func (*PlayerPoint) Descriptor() ([]byte, []int) {\n\treturn file_msgdata_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "d21db54a9f4ab13889e9684eba40591e", "score": "0.63147223", "text": "func (*Message6024) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_2_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "48c5b1d321f30ae723ffa7c99cd04514", "score": "0.6313907", "text": "func (*FormatMessage) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_clouddebugger_v2_data_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "8870c101b7466ca1cbbb37fd76315856", "score": "0.6312882", "text": "func (*Team) Descriptor() ([]byte, []int) {\n\treturn file_uac_Team_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "f2b6af9780e0fd8c2960c1ef279c1cf4", "score": "0.63080084", "text": "func (*Person) Descriptor() ([]byte, []int) {\n\treturn file_protos_face_recognition_service_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "74833794abd9692301acc0835072aad2", "score": "0.6307644", "text": "func (*Message5903) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_2_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "ede2a0fa69a6099bc6496b9293791352", "score": "0.63064706", "text": "func (*Modifier) Descriptor() ([]byte, []int) {\n\treturn file_FillerGame_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "b2736b99ecf2bc746fba853985135977", "score": "0.6305218", "text": "func (*DebugInstanceRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "9ffa1c4dc220d5b895467bfd13196e1b", "score": "0.6303529", "text": "func (*Embed) Descriptor() ([]byte, []int) {\n\treturn file_chat_v1_messages_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "c1496d7b44ed21b9638161cfe2ab26ea", "score": "0.63009506", "text": "func (*UpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "5f14d7f7d3d193a702dbd328fad8820f", "score": "0.62960756", "text": "func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_Params\n}", "title": "" }, { "docid": "36dca5e5cd9f6372cb9e1f8cead9e497", "score": "0.62956476", "text": "func (*Point) Descriptor() ([]byte, []int) {\n\treturn file_proto_meme_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "2df5ae7b49af895bf53388452a36c02f", "score": "0.6294508", "text": "func (*Name) Descriptor() ([]byte, []int) {\n\treturn file_examples_documents_example_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "53b318877752221c79678d103e1bb088", "score": "0.62888396", "text": "func (*VectorClock) Descriptor() ([]byte, []int) {\n\treturn file_pkg_proto_l3_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "3ec147e28a506a3f1d7abfb111f97b80", "score": "0.62852526", "text": "func (*RecogPlace_Name) Descriptor() ([]byte, []int) {\n\treturn file_recon_proto_rawDescGZIP(), []int{14, 0}\n}", "title": "" }, { "docid": "377c325944c272c17e8a1e151f1684b5", "score": "0.62823844", "text": "func (*ExternalGrpcNode) Descriptor() ([]byte, []int) {\n\treturn file_cloudprovider_externalgrpc_protos_externalgrpc_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "b640f20e26ebcf04554c487eedb41b79", "score": "0.6281298", "text": "func (*Deprecation) Descriptor() ([]byte, []int) {\n\treturn file_external_cfgmgmt_response_nodes_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "055d0b537509beac81aa192109567cdc", "score": "0.6280168", "text": "func (*Offset) Descriptor() ([]byte, []int) {\n\treturn file_game_game_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "f76317805bf7312aefdd56cc11c54911", "score": "0.62793535", "text": "func (*CreateAlterRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_exercicio_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "b9a925bff67d049a0551b652786c2e7f", "score": "0.6278913", "text": "func (StandardProtocols_Enum) EnumDescriptor() ([]byte, []int) {\n\treturn file_org_apache_beam_model_pipeline_v1_beam_runner_api_proto_rawDescGZIP(), []int{54, 0}\n}", "title": "" }, { "docid": "cf3fe68a5c493c5381a321ee6034fdd9", "score": "0.6278375", "text": "func (*ListenApiCF) Descriptor() ([]byte, []int) {\n\treturn file_pkg_kascfg_kascfg_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "c0fe245e80e4e33b4fa1b3ec9efbc009", "score": "0.627811", "text": "func (*Span) Descriptor() ([]byte, []int) {\n\treturn file_google_devtools_cloudtrace_v2_trace_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "05c25228acac92366d11307e91d4dbc4", "score": "0.62754667", "text": "func ProtoFromMessageDescriptor(d protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto {\n\ttype canProto interface {\n\t\tMessageDescriptorProto() *descriptorpb.DescriptorProto\n\t}\n\tif res, ok := d.(canProto); ok {\n\t\treturn res.MessageDescriptorProto()\n\t}\n\tif res, ok := d.(DescriptorProtoWrapper); ok {\n\t\tif md, ok := res.AsProto().(*descriptorpb.DescriptorProto); ok {\n\t\t\treturn md\n\t\t}\n\t}\n\treturn protodesc.ToDescriptorProto(d)\n}", "title": "" }, { "docid": "9c60cd0cd76202e82a8e2ec49d29b0da", "score": "0.6274416", "text": "func (*AnalysisMessageWeakSchema_ArgType) Descriptor() ([]byte, []int) {\n\treturn file_analysis_v1alpha1_message_proto_rawDescGZIP(), []int{1, 0}\n}", "title": "" }, { "docid": "6a8797cc9d4881008903fef885e4d15d", "score": "0.6273171", "text": "func (x *fastReflection_FlagOptions) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_FlagOptions\n}", "title": "" }, { "docid": "239f8ebe2b52596f4de6d709cb342808", "score": "0.6271978", "text": "func (*TrafficSplit) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f972fe9acfc7edf1e132fa566e4d7744", "score": "0.6271479", "text": "func (*DeleteRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "492c8b58d4a7be85ff6f1ed7fa647492", "score": "0.6270827", "text": "func (*Person) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "1b1f7d75d00177caac1e213e2df5a5ed", "score": "0.62686074", "text": "func (*Pong) Descriptor() ([]byte, []int) {\n\treturn file_api_protobuf_spec_example_example_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "403f816ec0a4bf1336d00b0656936d82", "score": "0.6268277", "text": "func (*Address) Descriptor() ([]byte, []int) {\n\treturn file_proto_google_fhir_proto_stu3_datatypes_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "9c5d76156f7d513db44415168da7c907", "score": "0.62665606", "text": "func (*CreateRequest) Descriptor() ([]byte, []int) {\n\treturn file_teams_v1_teams_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "df5187a7a50b46904deb2b27230469c0", "score": "0.62658125", "text": "func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateParams\n}", "title": "" }, { "docid": "77a646e80e38e98ea19039df62d3373a", "score": "0.62649685", "text": "func (*ModifyRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_engine_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "c4e0c99a41bc277d5d316a9ab5d31e89", "score": "0.6263047", "text": "func (*Message12796) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_2_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "9a8f11b489020b817c36f9e74b12657f", "score": "0.6262572", "text": "func (*RecogPlaces) Descriptor() ([]byte, []int) {\n\treturn file_recon_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "d6845b7208fffcc91de79f9d98741c1d", "score": "0.62616247", "text": "func (*Embed_EmbedField) Descriptor() ([]byte, []int) {\n\treturn file_chat_v1_messages_proto_rawDescGZIP(), []int{2, 1}\n}", "title": "" }, { "docid": "b18248167135007e75bc0daa101fd56a", "score": "0.6261556", "text": "func (*CMsgCustomGameWhitelistForEdit) Descriptor() ([]byte, []int) {\n\treturn file_dota_gcmessages_common_proto_rawDescGZIP(), []int{50}\n}", "title": "" }, { "docid": "a4a6c3c4ddbf4524026b4a14a9c8c0e5", "score": "0.6260687", "text": "func (*Message7920) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_2_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "f50b8aec5a4f810fe29c5ae69fdeeea5", "score": "0.62599844", "text": "func (*PatchConceptLanguagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_clarifai_api_service_proto_rawDescGZIP(), []int{50}\n}", "title": "" }, { "docid": "0051d17e49f6e965a899132dbdd51eba", "score": "0.62591076", "text": "func (*Message6127) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_2_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "63ec0bf04f5a33a9e2c817d5216de024", "score": "0.62586266", "text": "func (*Address) Descriptor() ([]byte, []int) {\n\treturn file_examplepb_example_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "f115eece5b72255412a147d84c1a2a9e", "score": "0.6258558", "text": "func (*Forecast) Descriptor() ([]byte, []int) {\n\treturn file_google_ads_googleads_v2_services_reach_plan_service_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "fc4b061ec4fed2850678d49d62f6087a", "score": "0.6257899", "text": "func (*ApiListener) Descriptor() ([]byte, []int) {\n\treturn file_envoy_config_listener_v2_api_listener_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "db5e45e827094f8e4e1796c0d398a633", "score": "0.6252464", "text": "func (*UpdateDomainMappingRequest) Descriptor() ([]byte, []int) {\n\treturn file_google_appengine_v1_appengine_proto_rawDescGZIP(), []int{40}\n}", "title": "" }, { "docid": "5196b28fd5e6ca92dd0a757343fbac15", "score": "0.62524563", "text": "func (*PrivateApiCF) Descriptor() ([]byte, []int) {\n\treturn file_pkg_kascfg_kascfg_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "bf4ec5cba1ddd37ed7d3436407c332c6", "score": "0.6252382", "text": "func (x *fastReflection_AddressBytesToStringRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_AddressBytesToStringRequest\n}", "title": "" }, { "docid": "2347ff293c959668dc4fca7e734a249a", "score": "0.6244618", "text": "func (*CandidateInfoProto) Descriptor() ([]byte, []int) {\n\treturn file_raft_proto_rawDescGZIP(), []int{41}\n}", "title": "" } ]
92125c0d0e3fd88c1c9b78a5b6ece0f1
GetURL returns the external url
[ { "docid": "2f7b383f4714c09fe2410baf73bda06b", "score": "0.63436514", "text": "func (e *Endpoint) GetURL() string {\n\treturn e.URL\n}", "title": "" } ]
[ { "docid": "994a73b122d441fdf6d6422b572f1684", "score": "0.7024755", "text": "func (client Client) GetURL(path string) (string, error) {\n\treturn path, nil\n}", "title": "" }, { "docid": "f2a8a81d0f115c5cb55036efe1e2b1db", "score": "0.6969146", "text": "func GetURL(name string) string {\n\tswitch name {\n\tcase \"kms\":\n\t\treturn \"https://github.com/smallstep/step-kms-plugin\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}", "title": "" }, { "docid": "4690ba533c8a493199a346f05c0ceda9", "score": "0.69560385", "text": "func (w *Workspace) GetURL(protocol, domain string) string {\n\treturn fmt.Sprintf(\"%v%v--%v.%v\", protocol, w.UID, w.Namespace, domain)\n}", "title": "" }, { "docid": "c4a6c45a7f6852f4257126ea71062ecf", "score": "0.6910573", "text": "func (l *Library) URL(asset string) string {\n\tu, err := l.TryURL(asset)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn u\n}", "title": "" }, { "docid": "f4a1eaacc1e392e5a0eabd838b46f4a6", "score": "0.6904647", "text": "func (ptr *Satellite) GetURL() string {\n\treturn ptr.URL\n}", "title": "" }, { "docid": "96f2c83f7964db4a59223489642f4931", "score": "0.6881467", "text": "func (g *getterArtifact) getURL() (string, error) {\n\tu, err := url.Parse(g.source)\n\tif err != nil {\n\t\treturn \"\", errors.Wrap(err, fmt.Sprintf(\"failed to parse source URL %q\", g.source))\n\t}\n\n\tq := u.Query()\n\tfor k, v := range g.options {\n\t\tq.Add(k, v)\n\t}\n\tu.RawQuery = q.Encode()\n\treturn u.String(), nil\n}", "title": "" }, { "docid": "7a7bc6e39b642d059cb044c031475c5f", "score": "0.6880609", "text": "func (d *Direct) URL() string {\n\treturn d.url\n}", "title": "" }, { "docid": "3a5389ef63202b9b033bc6a8cd09e453", "score": "0.6873856", "text": "func (l Links) URL() (u string) { return l.Link().URL() }", "title": "" }, { "docid": "3f4630af3cae370100df52e90cb5aa7f", "score": "0.6836838", "text": "func (e *Entry) GetURL() string {\n\treturn e.url\n}", "title": "" }, { "docid": "9dc3278dfb99a3f242e3d39ae13ebef8", "score": "0.6836167", "text": "func (e ENGGame) GetURL() string {\n\treturn e.URL\n}", "title": "" }, { "docid": "09299ffee33626afd5f3a1fe0d62e194", "score": "0.67870307", "text": "func (c *Client) URL() *url.URL {\n\treturn c.iex.url\n}", "title": "" }, { "docid": "09299ffee33626afd5f3a1fe0d62e194", "score": "0.67870307", "text": "func (c *Client) URL() *url.URL {\n\treturn c.iex.url\n}", "title": "" }, { "docid": "d34c94dd98cf23e8b7e33e2ee9ec944a", "score": "0.6779134", "text": "func (hga *HTTPGet) GetURL() string {\n\tif hga.GET.String() != \"\" {\n\t\treturn hga.GET.String()\n\t}\n\treturn hga.URL.String()\n}", "title": "" }, { "docid": "d34c94dd98cf23e8b7e33e2ee9ec944a", "score": "0.6779134", "text": "func (hga *HTTPGet) GetURL() string {\n\tif hga.GET.String() != \"\" {\n\t\treturn hga.GET.String()\n\t}\n\treturn hga.URL.String()\n}", "title": "" }, { "docid": "3b6a67205ddc5026ea5371daf158ecb2", "score": "0.6778966", "text": "func (ex *Exposer) URL() string { return ex.url }", "title": "" }, { "docid": "bcd9f13b870c7c15f53b75b8e9a774ea", "score": "0.6752055", "text": "func (q *Query) GetURL() string {\n\treturn q.censusClient.createRequestURL(q)\n}", "title": "" }, { "docid": "90805e96c01e173b8effeeee8f6d96ed", "score": "0.6750483", "text": "func GetURL(url string) (string, error) {\n\tvar client http.Client\n\n\tresponse, err := client.Get(url)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer response.Body.Close()\n\n\tif response.StatusCode != http.StatusOK {\n\t\treturn \"\", errors.New(\"invalid status code\")\n\t}\n\n\tbody, err := ioutil.ReadAll(response.Body)\n\tdoc := string(body)\n\n\treturn doc, nil\n}", "title": "" }, { "docid": "d72785e7b5400d09d13d41145070e288", "score": "0.6747995", "text": "func getURL(url string) string {\n\tresponse, e := http.Get(url)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\tdefer response.Body.Close()\n\tbytes, e := ioutil.ReadAll(response.Body)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn string(bytes)\n}", "title": "" }, { "docid": "6c5f83d12067a38f2f570d0a4e392572", "score": "0.67472076", "text": "func (d *MockDriver) GetURL() (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "6c1478c8a15db7e13a8e357c0208c20c", "score": "0.67442477", "text": "func (m *WorkforceIntegration) GetUrl()(*string) {\n val, err := m.GetBackingStore().Get(\"url\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "61b4013ecdcbbe6c56250e0076bad68b", "score": "0.67363995", "text": "func (g *Generator) URL() string {\n\tpart := func() string {\n\t\treturn g.LimitedWord(2, 8)\n\t}\n\tstart := g.OneStringOf(\"http://www.\", \"http://blog.\", \"https://www.\", \"ftp://\")\n\text := g.OneStringOf(\"html\", \"php\", \"jpg\", \"mp3\", \"txt\")\n\tvariant := g.Percent()\n\tswitch {\n\tcase variant < 20:\n\t\treturn start + part() + \".\" + g.Domain() + \"/\" + part() + \".\" + ext\n\tcase variant > 80:\n\t\treturn start + part() + \".\" + g.Domain() + \"/\" + part() + \"/\" + part() + \".\" + ext\n\tdefault:\n\t\treturn start + part() + \".\" + g.Domain()\n\t}\n}", "title": "" }, { "docid": "e8c338bca0acbac0b4eb83fa95062e95", "score": "0.67354184", "text": "func (h *HTTPProvider) GetURL() *motan.URL {\n\treturn h.url\n}", "title": "" }, { "docid": "e8c338bca0acbac0b4eb83fa95062e95", "score": "0.67354184", "text": "func (h *HTTPProvider) GetURL() *motan.URL {\n\treturn h.url\n}", "title": "" }, { "docid": "1400c505fca952142a24c56fd905f930", "score": "0.66891396", "text": "func GetUrl() string {\n\treturn getInput(\"请输入图片URL :\")\n}", "title": "" }, { "docid": "8256445b72ca72282d4a23b41dea4478", "score": "0.668442", "text": "func (f *Feed) GetURL() string {\n\treturn \"/\" //not ready\n}", "title": "" }, { "docid": "2fecb485b7b2d4ed734d6c201e43ed77", "score": "0.66785926", "text": "func (in *Meta) GetURL() string {\n\treturn in.urlStr\n}", "title": "" }, { "docid": "ae05ddb846ff43caa6dc99b315a0ba6d", "score": "0.66736645", "text": "func (s *Resource) GetURL() string {\n\treturn s.URL\n}", "title": "" }, { "docid": "ae05ddb846ff43caa6dc99b315a0ba6d", "score": "0.66736645", "text": "func (s *Resource) GetURL() string {\n\treturn s.URL\n}", "title": "" }, { "docid": "0a32f97eb35114ff64b3a638e24b1186", "score": "0.66709995", "text": "func (m *OnPremisesPublishing) GetExternalUrl()(*string) {\n val, err := m.GetBackingStore().Get(\"externalUrl\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "3162245f764662048530c192a5456596", "score": "0.6670961", "text": "func GetURL() string {\n\tt, err := GetToken()\n\tif err != nil {\n\t\treturn \"na\"\n\t}\n\n\treturn t.URL\n}", "title": "" }, { "docid": "3162245f764662048530c192a5456596", "score": "0.6670961", "text": "func GetURL() string {\n\tt, err := GetToken()\n\tif err != nil {\n\t\treturn \"na\"\n\t}\n\n\treturn t.URL\n}", "title": "" }, { "docid": "9ef94039b15efd05ea1c93b933297618", "score": "0.66608256", "text": "func (i Image) GetURL() string {\n\tif i.File != nil {\n\t\treturn i.File.URL\n\t}\n\tif i.External != nil {\n\t\treturn i.External.URL\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "7d7659a8bf62e16e9fbb47e41235459d", "score": "0.6657848", "text": "func (bi *BaseInvoker) GetURL() *common.URL {\n\treturn bi.url\n}", "title": "" }, { "docid": "4c9ff6f121b0ceef4d9a8b3d27e2ac0d", "score": "0.66560906", "text": "func (t *Tab) GetURL() (string, error) {\n\treturn t.GetDocumentCurrentURL(t.getTopNodeID())\n}", "title": "" }, { "docid": "cf30395618379853a0edac31cd22f0cd", "score": "0.66559345", "text": "func (m *AgoutiPage) URL() (string, error) {\n\treturn m.page.URL()\n}", "title": "" }, { "docid": "0b31746be6c5a1b1a09fe57296445948", "score": "0.66520625", "text": "func (ByteDocument) GetURL() url.URL { return url.URL{} }", "title": "" }, { "docid": "8bd76d19daf8f4f46337a589eb72c0e9", "score": "0.6637307", "text": "func (t Track) GetURL() string {\n\treturn t.URL\n}", "title": "" }, { "docid": "4d414f7d6697c38fe3aab62b31cc7737", "score": "0.66308844", "text": "func (h *HTTPCommunication) URL() string {\n\tif h.Host != \"\" && h.URI != \"\" {\n\t\treturn h.Host + h.URI\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "3c680b8c6427b8181901abb7ea729bbf", "score": "0.66270554", "text": "func (m *UrlEvidence) GetUrl()(*string) {\n val, err := m.GetBackingStore().Get(\"url\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "455cb573672abff1c3f48b8eb0257a21", "score": "0.6618187", "text": "func (p *Post) URL() (string, error) {\n\treturn \"\", nil\n}", "title": "" }, { "docid": "9b279baf2a07d165c50c013b5f36d1d1", "score": "0.65760154", "text": "func (d *Driver) GetURL() (string, error) {\n\tlog.Debug(\"oci.GetURL()\")\n\tip, err := d.GetIP()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif ip == \"\" {\n\t\treturn \"\", nil\n\t}\n\n\treturn fmt.Sprintf(\"tcp://%s:%d\", ip, defaultDockerPort), nil\n}", "title": "" }, { "docid": "6e1c86014e354ae55e49e03317b72e14", "score": "0.65553284", "text": "func (c *Client) URL() string {\n\treturn c.url\n}", "title": "" }, { "docid": "23205cf7b05ccc25c34f28ec5d270f1d", "score": "0.6553175", "text": "func (ep *Endpoint) GetURL() string {\r\n\treturn ep.URL\r\n}", "title": "" }, { "docid": "7025748c549a57e3f2326906874e532f", "score": "0.65522724", "text": "func (c *Client) GetURL() string {\n\tif !isLocalHarbor(c.URL) || !isInCore() {\n\t\treturn c.URL\n\t}\n\t// if the adapter is created for local Harbor and the process is running\n\t// inside core, returns the \"127.0.0.1\" as URL to avoid the issue:\n\t// https://github.com/goharbor/harbor-helm/issues/222\n\t// when harbor is deployed on Kubernetes with hairpin mode disabled\n\turl := \"http://127.0.0.1:8080\"\n\tif common_http.InternalTLSEnabled() {\n\t\turl = \"https://127.0.0.1:8443\"\n\t}\n\treturn url\n}", "title": "" }, { "docid": "5f2622ed133c96e4be4c29027331321f", "score": "0.65452534", "text": "func (d *Data) URL() string {\n\tswitch d.Exchange {\n\tcase \"twse\":\n\t\treturn fmt.Sprintf(\"%s%s\", utils.TWSEURL,\n\t\t\tfmt.Sprintf(utils.TWSESTOCK, d.Date.Year(), d.Date.Month(), d.Date.Day(), d.No))\n\t}\n\n\treturn \"\"\n}", "title": "" }, { "docid": "d179e890e8f0abce97fa446cb089f061", "score": "0.6540321", "text": "func (c *HTTPClient) GetURL() string {\r\n\treturn c.URL\r\n}", "title": "" }, { "docid": "d371b4794a9f19632046004d4f62f14a", "score": "0.6538374", "text": "func (f *File) URL() string {\n\treturn f.fsc.client.getEndpoint(fileServiceName, f.buildPath(), nil)\n}", "title": "" }, { "docid": "d24c9cc704d103457aad19dc239935eb", "score": "0.6533684", "text": "func (p AmazonCOUKParser) GetURL() string {\n\treturn p.URL\n}", "title": "" }, { "docid": "2932f02e29e353559793107d76cce952", "score": "0.65335625", "text": "func (s *Stock) URL() *url.URL {\n\treturn s.url\n}", "title": "" }, { "docid": "d0bebcdd8b8a6c026478a97a1ac89eb8", "score": "0.6505487", "text": "func (r *RaveURL) URL() string {\n\tif r.AlternateURL != \"\" {\n\t\treturn r.AlternateURL\n\t}\n\treturn r.PreferredURL\n}", "title": "" }, { "docid": "dc23365ddd3e7b62e545f1ce729e0ebd", "score": "0.6499671", "text": "func (c *Client) URL() string {\n\treturn c.hcCli.URL\n}", "title": "" }, { "docid": "dc23365ddd3e7b62e545f1ce729e0ebd", "score": "0.6499671", "text": "func (c *Client) URL() string {\n\treturn c.hcCli.URL\n}", "title": "" }, { "docid": "557ff1b904ddb9e4e3a27d498aac4174", "score": "0.6498599", "text": "func (p AmazonITParser) GetURL() string {\n\treturn p.URL\n}", "title": "" }, { "docid": "f4da28476c5511d87341f14f1381f9bf", "score": "0.6492365", "text": "func (d *Driver) GetURL() (string, error) {\n\tip, err := d.GetIP()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif ip == \"\" {\n\t\treturn \"\", nil\n\t}\n\treturn fmt.Sprintf(\"tcp://%s\", net.JoinHostPort(ip, strconv.Itoa(d.EnginePort))), nil\n}", "title": "" }, { "docid": "22681301fd8e3f6750610666fc92392f", "score": "0.6483269", "text": "func (l *Link) URL() string {\n\treturn l.url\n}", "title": "" }, { "docid": "ec564f7268ac7b94b238aa1000d70dbe", "score": "0.6464823", "text": "func (i *Item) GetURL() (string, error) {\n\tif i.Attrs == nil || i.Attrs[\"guid\"] == \"\" {\n\t\treturn \"\", fmt.Errorf(\"No guid available for item\")\n\t}\n\n\tq := url.Values{\n\t\t\"t\": {\"get\"},\n\t\t\"id\": {i.Attrs[\"guid\"]},\n\t\t\"apikey\": {config.Geek.APIKey},\n\t}\n\n\treturn fmt.Sprintf(\"%s/api?%s\", config.Geek.URL, q.Encode()), nil\n}", "title": "" }, { "docid": "2b34b39125abe7eaa12fda3412c5e076", "score": "0.64603406", "text": "func (c *Chance) Url() string {\n\tprotocol := \"http\"\n\tdomain := c.Domain()\n\tpath := c.Word()\n\treturn protocol + \"://\" + domain + \"/\" + path\n}", "title": "" }, { "docid": "4619b7e8a2d2f3ff3709f39a4b927fda", "score": "0.64585066", "text": "func (p *Provider) GetURL() string {\n\tret := []string{}\n\tif x := p.GetProjectURL(); x != \"\" {\n\t\tret = append(ret, x)\n\t\tif y := p.GetProjectPath(); y != \"\" {\n\t\t\tret = append(ret, y[1:]) //rm front /\n\t\t}\n\t}\n\treturn strings.Join(ret, \"/\")\n}", "title": "" }, { "docid": "60e1d969b738874a8c1842d0ff39bc57", "score": "0.64572394", "text": "func (w *Widget) GetURL() string {\n\tif w == nil || w.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.URL\n}", "title": "" }, { "docid": "ea51e93ac224c2a6ffb33e8118e3757b", "score": "0.64570636", "text": "func (c *HTTPClient) URL() string {\n\treturn fmt.Sprintf(\"%s%s\", c.BaseURL, c.Endpoint)\n}", "title": "" }, { "docid": "1a81b1831c03931d7db97afee816cdf8", "score": "0.64504826", "text": "func (sp *statsPusher) GetURL() url.URL {\n\treturn sp.ExplorerClient.Url()\n}", "title": "" }, { "docid": "c042c8c89f0b4c4509eb8c395eec86fb", "score": "0.64499557", "text": "func (o *SumoLogic) GetUrl() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\n\treturn o.Url\n}", "title": "" }, { "docid": "a0ba7b07cfefcfb8691870bfbe639601", "score": "0.6446177", "text": "func (e *Event) GetUrl() string {\n\tif e == nil || e.Url == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Url\n}", "title": "" }, { "docid": "ede52aad4e34cc7fd765fd68407a7690", "score": "0.6443535", "text": "func (object Object) URL() string {\n\treturn object.Property(as.PropertyURL).AsString(as.PropertyHREF)\n}", "title": "" }, { "docid": "a6115e9ea48f1dd432cb0f3342e39c85", "score": "0.6440488", "text": "func getUrl(uri string) string {\n\tvar url string\n\tif strings.HasPrefix(uri, \"https://\") {\n\t\turl = uri\n\t} else {\n\t\turl = \"https://panel.sendcloud.sc\" + uri\n\t}\n\n\treturn url\n}", "title": "" }, { "docid": "64b6710d8b6b906ce4d7ee17af476107", "score": "0.6440292", "text": "func (d *Deploy) GetURL() string {\n\treturn d.url\n}", "title": "" }, { "docid": "e52ab821505a3f36eed3abeb5dd98545", "score": "0.64281833", "text": "func (f FileURL) URL() url.URL {\n\treturn f.fileClient.URL()\n}", "title": "" }, { "docid": "55ae7b78c87d26ef141d577d8ed5fdf6", "score": "0.64260757", "text": "func (u *LinkReader) URL() string {\n\treturn u.pageURL.String()\n}", "title": "" }, { "docid": "8be45c1a49176ac273fdccad960f0a6e", "score": "0.6425084", "text": "func (p AmazonDEParser) GetURL() string {\n\treturn p.URL\n}", "title": "" }, { "docid": "f7e3e142427955a046d453c1c4c4a3ee", "score": "0.6407971", "text": "func (t *TURL) GetURL(k string) (string, error) {\n\tres, err := t.s.Get(k)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif res.IsActive() {\n\t\treturn res.url, nil\n\t}\n\treturn \"\", ErrInactiveURL\n}", "title": "" }, { "docid": "11e3ded9485554003733d4b1677b5fe1", "score": "0.64049023", "text": "func (d *Driver) GetURL() (string, error) {\n\tif err := drivers.MustBeRunning(d); err != nil {\n\t\treturn \"\", err\n\t}\n\n\tip, err := d.GetIP()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn fmt.Sprintf(\"tcp://%s:%d\", ip, engine.DefaultPort), nil\n}", "title": "" }, { "docid": "00844f0f2cbc5a17c07c9e1e6cef3f25", "score": "0.6400334", "text": "func (o *HyperflexVcenterConfigurationAllOf) GetUrl() string {\n\tif o == nil || o.Url == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn *o.Url\n}", "title": "" }, { "docid": "61b7f70a56d9979571f17f41bf4818e2", "score": "0.6394917", "text": "func (c *Client) URL(path string) (string, error) {\n\trequestURL, err := url.Parse(fmt.Sprintf(\"%s/%s\", c.BaseURL, path))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn requestURL.String(), nil\n}", "title": "" }, { "docid": "5a7f894d3ffd9b05ca4918c70e77c6d1", "score": "0.6392794", "text": "func (i *Image) URL() (string, error) {\n\tif i.url == \"\" {\n\t\treturn \"\", errors.New(\"Image URL is not populated\")\n\t}\n\treturn i.url, nil\n}", "title": "" }, { "docid": "f0d52e02584fef1ca6fafdaefa6e09f6", "score": "0.6391775", "text": "func GetURL(url string) (io.ReadCloser, error) {\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\treturn resp.Body, nil\n}", "title": "" }, { "docid": "8f964baea90243894c79e1a4ee3251ce", "score": "0.63897043", "text": "func (o SapEccLinkedServiceResponseOutput) Url() pulumi.StringOutput {\n\treturn o.ApplyT(func(v SapEccLinkedServiceResponse) string { return v.Url }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "921aa36ca8bde53d618b605a6cf34a50", "score": "0.63896614", "text": "func (es *eventSource) URL() string {\n\treturn es.url\n}", "title": "" }, { "docid": "d9a00d1497b00f18e6914a7c022298b0", "score": "0.63892776", "text": "func (view *View) GetURL() string {\n\treturn ulStrToStr(C.ulViewGetURL(view.v))\n}", "title": "" }, { "docid": "7d7e7f4d1dd044c9a763782bdef2e572", "score": "0.63874346", "text": "func (p *peer) URL() string {\n\treturn p.url\n}", "title": "" }, { "docid": "cf9ef3e1fdeaaccff25f6deddd1bd229", "score": "0.6383717", "text": "func (r *UastRepository) GetURL() string {\n\treturn r.URL\n}", "title": "" }, { "docid": "d1ddaa31e3b0b1924952ed38de398e77", "score": "0.6374999", "text": "func (o *SyntheticsTestRequestProxy) GetUrl() string {\n\tif o == nil {\n\t\tvar ret string\n\t\treturn ret\n\t}\n\treturn o.Url\n}", "title": "" }, { "docid": "395acab47b1b6185214e01308675a4e3", "score": "0.6365411", "text": "func (c *Cover) URL() string {\n\treturn c.url\n}", "title": "" }, { "docid": "0ce6fe698ff145dbc38c9e4f5b3fdc8d", "score": "0.63648415", "text": "func (s *SyntheticsRequest) GetUrl() string {\n\tif s == nil || s.Url == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Url\n}", "title": "" }, { "docid": "b9d9ea9ef709dd0365925af06583170a", "score": "0.63586855", "text": "func (s *Schema) URL() string {\n\tfor _, l := range s.Links {\n\t\tif l.Rel == \"self\" {\n\t\t\treturn l.HRef.String()\n\t\t}\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "e6d0987b46e68cc24f88ec98be4fcdb7", "score": "0.635229", "text": "func (c *Cmd) URL() *url.URL {\n\treturn c.U\n}", "title": "" }, { "docid": "3db3d8f16d725dfa24d7a2f9e26839d3", "score": "0.6351052", "text": "func GetURL(url string) (io.Reader, error) {\n\tresponse, err := http.Get(url)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif response.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"GET status: %s\", response.Status)\n\t}\n\n\treturn response.Body, nil\n}", "title": "" }, { "docid": "4cb803d5b40694ca76e9b349bbb28c6e", "score": "0.6348927", "text": "func (s *Client) URL() string {\n\treturn s.generated().Endpoint()\n}", "title": "" }, { "docid": "503fec3534e81b09525d375d12bed5fd", "score": "0.6342144", "text": "func (c *Client) GetURL(objectKey string, params map[string]string) string {\n\thost := c.Endpoint\n\n\tif host == \"\" {\n\t\thost = Endpoint[c.GetRegion()]\n\t}\n\n\turiPath := objectKey\n\n\treturn c.Client.GetURL(host, uriPath, params)\n}", "title": "" }, { "docid": "503fec3534e81b09525d375d12bed5fd", "score": "0.6342144", "text": "func (c *Client) GetURL(objectKey string, params map[string]string) string {\n\thost := c.Endpoint\n\n\tif host == \"\" {\n\t\thost = Endpoint[c.GetRegion()]\n\t}\n\n\turiPath := objectKey\n\n\treturn c.Client.GetURL(host, uriPath, params)\n}", "title": "" }, { "docid": "86ac477cc78787fc69355952d0486757", "score": "0.63314366", "text": "func (a *agentClient) URL() string {\n\treturn a.agentURL.String()\n}", "title": "" }, { "docid": "711555d2fc0f83e4276f09f3d6e74e0c", "score": "0.63288534", "text": "func (m *AccessPackageResourceScope) GetUrl()(*string) {\n val, err := m.GetBackingStore().Get(\"url\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "8a20cef3b34b39dbd47c4c0dd6eb948c", "score": "0.6328358", "text": "func (b *Blob) GetURL() string {\n\tcontainer := b.Container.Name\n\tif container == \"\" {\n\t\tcontainer = \"$root\"\n\t}\n\treturn b.Container.bsc.client.getEndpoint(blobServiceName, pathForResource(container, b.Name), nil)\n}", "title": "" }, { "docid": "fc16db247addf75779f5681afa298c37", "score": "0.63170964", "text": "func (i *Image) Url() *url.URL {\n\treturn i.utils.Downloader.Url()\n}", "title": "" }, { "docid": "b990fe4e9d7d17f376ab15ca08fbc295", "score": "0.6312031", "text": "func (r TextResource) URL() string {\n\treturn r.url\n}", "title": "" }, { "docid": "8c7e9e47babee0b742b92a0044b84b9e", "score": "0.63089883", "text": "func (c *campaignUI) GetURLViewExternal() string {\n\turl := URICampaignManage\n\tif c.ExternalID == nil {\n\t\treturn url\n\t}\n\turl, err := CreateURLRelParams(url, URLParams.ID, c.ExternalID)\n\tif err != nil {\n\t\t_, logger := GetLogger(nil)\n\t\tlogger.Errorf(\"create url\", \"url\", url)\n\t\treturn \"\"\n\t}\n\treturn url\n}", "title": "" }, { "docid": "533ffe54000dd604ba365c741ebb02b5", "score": "0.6304715", "text": "func (r *Recording) URL() (string, error) {\n\tif r.user.CanPlayRecordings() {\n\t\treturn r.url, nil\n\t} else {\n\t\treturn \"\", config.PermissionDenied\n\t}\n}", "title": "" }, { "docid": "6d6aef961061ce673361b4143116a196", "score": "0.6293429", "text": "func (c *Client) URL(file *api.File) string {\n\treturn fmt.Sprintf(\"%s%s\", c.addr, file.Name)\n}", "title": "" }, { "docid": "af041d4146580d70ab83092f613f6768", "score": "0.629079", "text": "func (bi *batchItem) GetUrl() *string {\n\treturn bi.Url\n}", "title": "" }, { "docid": "a05df3dad8bd8c525045aad092f154d4", "score": "0.6288867", "text": "func (r *reqGetDashboard) GetUrl() string {\n\tif r == nil || r.Url == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Url\n}", "title": "" }, { "docid": "3d716243318220cc43d71c2cafd6ef49", "score": "0.62864137", "text": "func (sn *SnowthNode) GetURL() *url.URL {\n\treturn sn.url\n}", "title": "" } ]
a6cb783a3be04a9e9572e3953d23517d
CreateQueryCustomerLabelResponse creates a response to parse from QueryCustomerLabel response
[ { "docid": "1aaebc8b0eb467ee490b77f28f3d042e", "score": "0.8761678", "text": "func CreateQueryCustomerLabelResponse() (response *QueryCustomerLabelResponse) {\n\tresponse = &QueryCustomerLabelResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" } ]
[ { "docid": "27da7f0ea4f360f27f911dbb06cdd3f2", "score": "0.73101074", "text": "func CreateQueryCustomerLabelRequest() (request *QueryCustomerLabelRequest) {\n\trequest = &QueryCustomerLabelRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Crm\", \"2015-04-08\", \"QueryCustomerLabel\", \"crm\", \"openAPI\")\n\treturn\n}", "title": "" }, { "docid": "f5974037ebe504f9d7716ed43ecf5254", "score": "0.68718046", "text": "func (client *Client) QueryCustomerLabel(request *QueryCustomerLabelRequest) (response *QueryCustomerLabelResponse, err error) {\n\tresponse = CreateQueryCustomerLabelResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}", "title": "" }, { "docid": "ebce7d55db078ac6d67ea9b27de34c67", "score": "0.590995", "text": "func CreateDeleteLabelResponse() (response *DeleteLabelResponse) {\n\tresponse = &DeleteLabelResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "b29518f412d457dd4851e12654556491", "score": "0.56496465", "text": "func CreateQueryDeviceCountResponse() (response *QueryDeviceCountResponse) {\n\tresponse = &QueryDeviceCountResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "34e9684cb4ebcdf4064ae7a5945e30fe", "score": "0.5324549", "text": "func CreateQueryInstanceNcdResponse() (response *QueryInstanceNcdResponse) {\n\tresponse = &QueryInstanceNcdResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "c1c5068147ba1e0af602e035d3e6406c", "score": "0.52055216", "text": "func (c *LabelClient) Query() *LabelQuery {\n\treturn &LabelQuery{\n\t\tconfig: c.config,\n\t\tctx: &QueryContext{Type: TypeLabel},\n\t\tinters: c.Interceptors(),\n\t}\n}", "title": "" }, { "docid": "29243dadeb504b1e1b5ee3fe13a10eb7", "score": "0.5181232", "text": "func CreateQueryRequestLogsResponse() (response *QueryRequestLogsResponse) {\n\tresponse = &QueryRequestLogsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "6640b948d7c131c6bd435627f704eaaa", "score": "0.51410866", "text": "func CreateDeleteLabelRequest() (request *DeleteLabelRequest) {\n\trequest = &DeleteLabelRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Crm\", \"2015-04-08\", \"DeleteLabel\", \"crm\", \"openAPI\")\n\treturn\n}", "title": "" }, { "docid": "551ca535adf0e610c25850810bcd9702", "score": "0.50422657", "text": "func (client *Client) QueryCustomerLabelWithCallback(request *QueryCustomerLabelRequest, callback func(response *QueryCustomerLabelResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *QueryCustomerLabelResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.QueryCustomerLabel(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": "3771074269a78cd22baac5a5bb5a1bbb", "score": "0.5024491", "text": "func CreateGetAppMonthlyDeviceCountResponse() (response *GetAppMonthlyDeviceCountResponse) {\n\tresponse = &GetAppMonthlyDeviceCountResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "2eb736af3da080eab5642c2a5a6348e9", "score": "0.50210893", "text": "func encodeCreateCustomerResponse(ctx context.Context, w http.ResponseWriter, response interface{}) (err error) {\n\tif f, ok := response.(endpoint.Failure); ok && f.Failed() != nil {\n\t\tErrorEncoder(ctx, f.Failed(), w)\n\t\treturn nil\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\terr = json.NewEncoder(w).Encode(response)\n\treturn\n}", "title": "" }, { "docid": "e14b7c5abc50951c89a1766da06539bd", "score": "0.4974382", "text": "func encodeGRPCCreateResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(svcendpoint.CreateResponse)\n\treturn &pb.CreateReply{V: string(resp.V), Err: err2str(resp.Err)}, nil\n}", "title": "" }, { "docid": "44d2063b085fbead5f833134c54d08f3", "score": "0.49732804", "text": "func NewKoResponse() *Response { return &Response{KO, nil} }", "title": "" }, { "docid": "e84c74c546de8e6d51e9e7c3bcae9399", "score": "0.49649364", "text": "func CreateDescribeCaptchaMinResponse() (response *DescribeCaptchaMinResponse) {\n\tresponse = &DescribeCaptchaMinResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "420cb7aa7ce9b89d8db35865e39dbfe8", "score": "0.49285692", "text": "func newResponse(query *maxmindQuery, ip net.IP, lang []string) *responseRecord {\n\trecord := &responseRecord{\n\t\tIP: ip.String(),\n\t\tCountryCode: query.Country.ISOCode,\n\t\tCountryName: localizedName(query.Country.Names, lang),\n\t\tCity: localizedName(query.City.Names, lang),\n\t\tZipCode: query.Postal.Code,\n\t\tTimeZone: query.Location.TimeZone,\n\t\tLatitude: roundFloat(query.Location.Latitude, .5, 4),\n\t\tLongitude: roundFloat(query.Location.Longitude, .5, 4),\n\t\tMetroCode: query.Location.MetroCode,\n\t}\n\tif len(query.Region) > 0 {\n\t\trecord.RegionCode = query.Region[0].ISOCode\n\t\trecord.RegionName = localizedName(query.Region[0].Names, lang)\n\t}\n\treturn record\n}", "title": "" }, { "docid": "98201b693271f329130b5fdbecbfb882", "score": "0.48666438", "text": "func WriteLabelResponseProtobuf(version loghttp.Version, l logproto.LabelResponse, w io.Writer) error {\n\tp := QueryResponse{\n\t\tResponse: &QueryResponse_Labels{\n\t\t\tLabels: &LokiLabelNamesResponse{\n\t\t\t\tStatus: \"success\",\n\t\t\t\tData: l.Values,\n\t\t\t\tVersion: uint32(version),\n\t\t\t\t// Statistics: statResult,\n\t\t\t},\n\t\t},\n\t}\n\tbuf, err := p.Marshal()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write(buf)\n\treturn err\n}", "title": "" }, { "docid": "eee91c8a52da302356e24907c789af20", "score": "0.48660865", "text": "func CreateQueryProductInfoResponse() (response *QueryProductInfoResponse) {\nresponse = &QueryProductInfoResponse{\nBaseResponse: &responses.BaseResponse{},\n}\nreturn\n}", "title": "" }, { "docid": "ea09008e5ddbcdc66293db3f333be949", "score": "0.4858584", "text": "func (client *Client) QueryCustomerLabelWithChan(request *QueryCustomerLabelRequest) (<-chan *QueryCustomerLabelResponse, <-chan error) {\n\tresponseChan := make(chan *QueryCustomerLabelResponse, 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.QueryCustomerLabel(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": "411e33f8fde927c1bd90252ddfe0d496", "score": "0.48460606", "text": "func encodeListCustomerResponse(_ context.Context, r interface{}) (interface{}, error) {\n\tresp := r.(endpoint.ListCustomerResponse)\n\treturn &pb.ListCustomerReply{Items: resp.Res.Items, Total: resp.Res.Total, Page: resp.Res.Page, Err: err2str(resp.Err)}, nil\n}", "title": "" }, { "docid": "9d3e5b341d82e3bce3d2df66e860488b", "score": "0.483269", "text": "func CreateQueryPagePerfTrendResponse() (response *QueryPagePerfTrendResponse) {\n\tresponse = &QueryPagePerfTrendResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "7434df2aa95eb4fb9cee62448d5dde1e", "score": "0.4822628", "text": "func CreateDescribeGeoipInstancesResponse() (response *DescribeGeoipInstancesResponse) {\n\tresponse = &DescribeGeoipInstancesResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "d0b4d4b8c2470b56fca6a689a3c1eee3", "score": "0.48097998", "text": "func CreateQueryTimeTemplateResponse() (response *QueryTimeTemplateResponse) {\n\tresponse = &QueryTimeTemplateResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "bbf6b43d5cb1c1a0e0824f8e5d305510", "score": "0.47992212", "text": "func CreateGetRegisterBoxNumberResponse() (response *GetRegisterBoxNumberResponse) {\n\tresponse = &GetRegisterBoxNumberResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "6e57414c72d56658f726c0b3c819b6a6", "score": "0.47544035", "text": "func CreateTranslateImageBatchResponse() (response *TranslateImageBatchResponse) {\n\tresponse = &TranslateImageBatchResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "94bf359255f7a8b983250c7e21fad240", "score": "0.47476608", "text": "func (r *OperandRequest) GenerateLabels() map[string]string {\n\tlabels := make(map[string]string)\n\tfor _, req := range r.Spec.Requests {\n\t\tregistryKey := r.GetRegistryKey(req)\n\t\tlabels[registryKey.Namespace+\".\"+registryKey.Name+\"/registry\"] = \"true\"\n\t\tlabels[registryKey.Namespace+\".\"+registryKey.Name+\"/config\"] = \"true\"\n\t}\n\treturn labels\n}", "title": "" }, { "docid": "0cfa5bb4335533478d11e29a871e1e4b", "score": "0.4740659", "text": "func CreateAudienceMemberQueryResponse() (response *AudienceMemberQueryResponse) {\n\tresponse = &AudienceMemberQueryResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "cf397927ede08cba8014759b62dbe4ee", "score": "0.47149855", "text": "func CreateDescribeUserBackupMachinesResponse() (response *DescribeUserBackupMachinesResponse) {\n\tresponse = &DescribeUserBackupMachinesResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "8002661800a8f7a8a71f564e236d8129", "score": "0.4687119", "text": "func CreateDescribeClusterOperateLogsResponse() (response *DescribeClusterOperateLogsResponse) {\n\tresponse = &DescribeClusterOperateLogsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "1bddeeb93d851cf567a1d61c0d50b106", "score": "0.46834382", "text": "func CreateRegisterCustomFaceResponse() (response *RegisterCustomFaceResponse) {\n\tresponse = &RegisterCustomFaceResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "4ba5022bef173917225a0140647b26aa", "score": "0.46694994", "text": "func CreateOperateBatchDomainResponse() (response *OperateBatchDomainResponse) {\n\tresponse = &OperateBatchDomainResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "8789303d280b0b6645e4252e4f138591", "score": "0.46692726", "text": "func NewMessageCustomerResponse(statusCode string, statusMessage string, customer *Customer) *MessageCustomerResponse {\n\treturn &MessageCustomerResponse{\n\t\tStatusCode: statusCode,\n\t\tStatusMessage: statusMessage,\n\t\tCustomer: customer,\n\t}\n}", "title": "" }, { "docid": "b24a77a6d62bb0aab2ec359dd74481b4", "score": "0.46497062", "text": "func CreateModifyQueryProcessorResponse() (response *ModifyQueryProcessorResponse) {\n\tresponse = &ModifyQueryProcessorResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "b17ec11ce52860b8dd7ab7ce63448a5d", "score": "0.46344474", "text": "func CreateGetMemberResponse() (response *GetMemberResponse) {\n\tresponse = &GetMemberResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "059b7ae710601ea79976db046900a848", "score": "0.462572", "text": "func CreateDescribeChannelUsersResponse() (response *DescribeChannelUsersResponse) {\n\tresponse = &DescribeChannelUsersResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "67c564567614e17c1e464bc46587265f", "score": "0.46238655", "text": "func (s *Server) createInvoiceResponseProtobuf(fiatValue int32, digitalValue int64, expiry int64, invoiceID string) *pb.InvoiceResponse {\n\treturn &pb.InvoiceResponse{FiatValue: fiatValue, DigitalValue: digitalValue, Expiry: expiry, InvoiceId: invoiceID}\n}", "title": "" }, { "docid": "e511131bcd58b6b80a45a4c451ffbf86", "score": "0.45967343", "text": "func CreateGetVmMetaResponse() (response *GetVmMetaResponse) {\n\tresponse = &GetVmMetaResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "2647c0635b7843fffda8e1c2fd251137", "score": "0.45805442", "text": "func CreateQueryDeviceCountRequest() (request *QueryDeviceCountRequest) {\n\trequest = &QueryDeviceCountRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Push\", \"2016-08-01\", \"QueryDeviceCount\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}", "title": "" }, { "docid": "6995f0db5632bd8929dd56f48369fc52", "score": "0.45777386", "text": "func CreateSummaryResponse() (response *SummaryResponse) {\nresponse = &SummaryResponse{\nBaseResponse: &responses.BaseResponse{},\n}\nreturn\n}", "title": "" }, { "docid": "ac13074fd633c4610243d1d580eafca5", "score": "0.45756343", "text": "func (r *Response) WithLabel(key string, values ...string) fiber.Response {\n\tr.Metadata.Append(key, values...)\n\treturn r\n}", "title": "" }, { "docid": "eb847c904d686551b3fd7b4b888b3a5a", "score": "0.45724276", "text": "func CreateListClusterNodesResponse() (response *ListClusterNodesResponse) {\n\tresponse = &ListClusterNodesResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "37e2284e96e261c944cfd3512628f2d7", "score": "0.45586362", "text": "func getTestCatalogResponse() *osb.CatalogResponse {\n\treturn &osb.CatalogResponse{\n\t\tServices: []osb.Service{\n\t\t\t{\n\t\t\t\tName: testClusterServiceClassName,\n\t\t\t\tID: testClassExternalID,\n\t\t\t\tDescription: \"a test service\",\n\t\t\t\tBindable: true,\n\t\t\t\tPlans: []osb.Plan{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: testClusterServicePlanName,\n\t\t\t\t\t\tFree: truePtr(),\n\t\t\t\t\t\tID: testPlanExternalID,\n\t\t\t\t\t\tDescription: \"a test plan\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: testNonbindableClusterServicePlanName,\n\t\t\t\t\t\tFree: truePtr(),\n\t\t\t\t\t\tID: testNonbindablePlanExternalID,\n\t\t\t\t\t\tDescription: \"an non-bindable test plan\",\n\t\t\t\t\t\tBindable: falsePtr(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "58f75dfdcc2f403897799cfb9a4cf08a", "score": "0.45503494", "text": "func CreateCapacityPlanResponse() (response *CapacityPlanResponse) {\n\tresponse = &CapacityPlanResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "d01ee046f37468eaa5687dd8b97d9c00", "score": "0.4542258", "text": "func CreateCheckZoneNameResponse() (response *CheckZoneNameResponse) {\n\tresponse = &CheckZoneNameResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "98c2abbebc80f88dbd2421bc9917d972", "score": "0.45387575", "text": "func (cr *CustomerResponse) Create(c *Customer) (statusCode int, conektaError Error) {\n\tstatusCode, response := request(\"POST\", \"/customers\", c)\n\tif statusCode != 200 {\n\t\terr := json.Unmarshal(response, &conektaError)\n\t\tcheckError(err)\n\t} else {\n\t\terr := json.Unmarshal(response, &cr)\n\t\tcheckError(err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "895e3e31e78173f9b5b7abff893231cd", "score": "0.45305526", "text": "func NewLabelCmd() *cobra.Command {\n\ts := labelCmdOptions{}\n\tc := &cobra.Command{\n\t\tUse: \"label\",\n\t\tShort: \"add label to repositories\",\n\t\tLong: `Mass add a label to multiple repositories`,\n\t\tRunE: s.RunE,\n\t}\n\tc.Flags().StringVarP(&s.Name, \"name\", \"m\", \"\", \"Name of the label\")\n\tc.Flags().StringVarP(&s.Color, \"color\", \"c\", \"\", \"Color for the label\")\n\n\tc.MarkFlagRequired(\"name\")\n\tc.MarkFlagRequired(\"color\")\n\n\tviper.BindPFlags(c.Flags())\n\n\treturn c\n}", "title": "" }, { "docid": "83981e22b3c008a470e3f22ee7154d62", "score": "0.45302823", "text": "func (o GoogleDevtoolsContaineranalysisV1alpha1SourceContextResponseOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v GoogleDevtoolsContaineranalysisV1alpha1SourceContextResponse) map[string]string {\n\t\treturn v.Labels\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "457b2e3ead82ee2b88eb147d539ef033", "score": "0.45302555", "text": "func CreateQueryItemsResponse() (response *QueryItemsResponse) {\n\tresponse = &QueryItemsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "48411610f135925d165f460877da8046", "score": "0.45208022", "text": "func CreateDescribeDataObjectsResponse() (response *DescribeDataObjectsResponse) {\n\tresponse = &DescribeDataObjectsResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "5eca6ae653af67d09bac92287ec225ee", "score": "0.45162785", "text": "func NewResponseQuery(id int64, columns []string) *Response {\n\treturn newResponse(&ResponseQuery{\n\t\tId: id,\n\t\tColumns: columns,\n\t})\n}", "title": "" }, { "docid": "cdad62351f359a3cfe28b1ea9ad9b568", "score": "0.45017564", "text": "func decodeGRPCCreateResponse(_ context.Context, grpcReply interface{}) (interface{}, error) {\n\treply := grpcReply.(*pb.CreateReply)\n\treturn svcendpoint.CreateResponse{V: string(reply.V), Err: str2err(reply.Err)}, nil\n}", "title": "" }, { "docid": "ea2a003d89eb30f3acdcddbbfdfe6483", "score": "0.449703", "text": "func CreateTestDataCustomer(ts *httptest.Server) app.CreateResponseDTO {\n\trequestBody, _ := ioutil.ReadFile(\"../data/create-request.json\")\n\tbuffer := bytes.NewBuffer(requestBody)\n\tres, _ := http.Post(ts.URL+\"/customers/\", \"application/json\", buffer)\n\tresponse, _ := ioutil.ReadAll(res.Body)\n\tresponseDTO := app.CreateResponseDTO{}\n\tUnMarshal(response, &responseDTO)\n\treturn responseDTO\n}", "title": "" }, { "docid": "7823110b2e8ca820cbc3fbb6b4c5db42", "score": "0.44944537", "text": "func CreateDescribeVsDomainTrafficDataResponse() (response *DescribeVsDomainTrafficDataResponse) {\n\tresponse = &DescribeVsDomainTrafficDataResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "20a617d40ce05fc50ecfa2e9d1de0c6a", "score": "0.44843328", "text": "func ParseCreateMssqlClusterResponse(rsp *http.Response) (*createMssqlClusterResponse, error) {\n\tbodyBytes, err := ioutil.ReadAll(rsp.Body)\n\tdefer rsp.Body.Close()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse := &createMssqlClusterResponse{\n\t\tBody: bodyBytes,\n\t\tHTTPResponse: rsp,\n\t}\n\n\tswitch {\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\") && rsp.StatusCode == 200:\n\t\tresponse.JSON200 = &struct {\n\t\t\t// Embedded struct due to allOf(#/components/schemas/Response)\n\t\t\tResponse\n\t\t\t// Embedded fields due to inline allOf schema\n\t\t\tData *map[string]interface{} `json:\"data,omitempty\"`\n\t\t}{}\n\t\tif err := json.Unmarshal(bodyBytes, response.JSON200); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\tcase strings.Contains(rsp.Header.Get(\"Content-Type\"), \"json\"):\n\t\tresponse.JSONDefault = &Error{}\n\t\tif err := json.Unmarshal(bodyBytes, response.JSONDefault); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t}\n\n\treturn response, nil\n}", "title": "" }, { "docid": "b8284c1c970eed3b6c1a06afc1ffe20b", "score": "0.44835457", "text": "func BuildResponse(status string) map[string]interface{} {\n\treturn map[string]interface{}{\"status\": status}\n}", "title": "" }, { "docid": "d67064ced4c1e65e9a97e9c28ffd490a", "score": "0.44686013", "text": "func CreateConvertK8sResourceResponse() (response *ConvertK8sResourceResponse) {\n\tresponse = &ConvertK8sResourceResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "146de4a22c7beb15ef97191d3af26d52", "score": "0.44660583", "text": "func (o MetricAlarmMetricQueryOutput) Label() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v MetricAlarmMetricQuery) *string { return v.Label }).(pulumi.StringPtrOutput)\n}", "title": "" }, { "docid": "be6358edbf2cdf6b32f15e25361a03a2", "score": "0.44620976", "text": "func CreateAddCasesResponse() (response *AddCasesResponse) {\n\tresponse = &AddCasesResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "8c07a1ac57614b86e8d9f0ded5b4416c", "score": "0.44610944", "text": "func (t *ManageCustomer) createCustomer(stub shim.ChaincodeStubInterface, args []string) ([]byte, error) {\r\n\tvar err error\r\n\tif len(args) != 10 {\r\n\t\terrMsg := \"{ \\\"message\\\" : \\\"Incorrect number of arguments. Expecting 10\\\", \\\"code\\\" : \\\"503\\\"}\"\r\n\t\terr = stub.SetEvent(\"errEvent\", []byte(errMsg))\r\n\t\tif err != nil {\r\n\t\t\treturn nil, err\r\n\t\t} \r\n\t\treturn nil, nil\r\n\t}\r\n\tfmt.Println(\"start createCustomer\")\r\n\tcustomerId := args[0]\r\n\tuserName := args[1]\r\n\tcustomerName := args[2]\r\n\twalletWorth := args[3]\r\n\tmerchantIDs := args[4]\r\n\tmerchantNames := args[5]\r\n\tmerchantColors := args[6]\r\n\tmerchantCurrencies := args[7]\r\n\tmerchantsPointsCount := args[8]\r\n\tmerchantsPointsWorth := args[9]\r\n\t\r\n\tcustomerAsBytes, err := stub.GetState(customerId)\r\n\tif err != nil {\r\n\t\treturn nil, errors.New(\"Failed to get Customer customerID\")\r\n\t}\r\n\tres := Customer{}\r\n\tjson.Unmarshal(customerAsBytes, &res)\r\n\tif res.CustomerID == customerId{\r\n\t\terrMsg := \"{ \\\"message\\\" : \\\"This Customer arleady exists\\\", \\\"code\\\" : \\\"503\\\"}\"\r\n\t\terr := stub.SetEvent(\"errEvent\", []byte(errMsg))\r\n\t\tif err != nil {\r\n\t\t\treturn nil, err\r\n\t\t} \r\n\t\treturn nil, nil\t\t\t\t//all stop a Customer by this name exists\r\n\t}\r\n\t\r\n\t//build the Customer json string manually\r\n\tcustomer_json := \t`{`+\r\n\t\t`\"customerId\": \"` + customerId + `\" , `+\r\n\t\t`\"customerName\": \"` + customerName + `\" , `+\r\n\t\t`\"userName\": \"` + userName + `\" , `+\r\n\t\t`\"walletWorth\": \"` + walletWorth + `\" , `+\r\n\t\t`\"merchantIDs\": \"` + merchantIDs + `\" , `+ \r\n\t\t`\"merchantNames\": \"` + merchantNames + `\" , `+ \r\n\t\t`\"merchantColors\": \"` + merchantColors + `\" , `+\r\n\t\t`\"merchantCurrencies\": \"` + merchantCurrencies + `\" , `+ \r\n\t\t`\"merchantsPointsCount\": \"` + merchantsPointsCount + `\" , `+ \r\n\t\t`\"merchantsPointsWorth\": \"` + merchantsPointsWorth + `\" `+ \r\n\t`}`\r\n\tfmt.Println(\"customer_json: \" + customer_json)\r\n\tfmt.Print(\"customer_json in bytes array: \")\r\n\tfmt.Println([]byte(customer_json))\r\n\terr = stub.PutState(customerId, []byte(customer_json))\t\t\t\t\t\t\t\t\t//store Customer with customerId as key\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\t//get the Customer index\r\n\tcustomerIndexAsBytes, err := stub.GetState(CustomerIndexStr)\r\n\tif err != nil {\r\n\t\treturn nil, errors.New(\"Failed to get Customer index\")\r\n\t}\r\n\tvar customerIndex []string\t\r\n\tjson.Unmarshal(customerIndexAsBytes, &customerIndex)\t\t\t\t\t\t\t//un stringify it aka JSON.parse()\r\n\t\r\n\t//append\r\n\tcustomerIndex = append(customerIndex, customerId)\t\t\t\t\t\t\t\t\t//add Customer customerID to index list\r\n\t\r\n\tjsonAsBytes, _ := json.Marshal(customerIndex)\r\n\tfmt.Print(\"jsonAsBytes: \")\r\n\tfmt.Println(jsonAsBytes)\r\n\terr = stub.PutState(CustomerIndexStr, jsonAsBytes)\t\t\t\t\t\t//store name of Customer\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\r\n\ttosend := \"{ \\\"customerID\\\" : \\\"\"+customerId+\"\\\", \\\"message\\\" : \\\"Customer created succcessfully\\\", \\\"code\\\" : \\\"200\\\"}\"\r\n\terr = stub.SetEvent(\"evtsender\", []byte(tosend))\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t} \r\n\r\n\tfmt.Println(\"end createCustomer\")\r\n\treturn nil, nil\r\n}", "title": "" }, { "docid": "e4fbebf08a34a6384c815c863f72952e", "score": "0.4456167", "text": "func CreateGetLoadBalancerAttributeResponse() (response *GetLoadBalancerAttributeResponse) {\n\tresponse = &GetLoadBalancerAttributeResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "60ddd34222349df5084cb25287adbe9f", "score": "0.44404075", "text": "func (o GoogleDevtoolsContaineranalysisV1alpha1SourceContextResponsePtrOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v *GoogleDevtoolsContaineranalysisV1alpha1SourceContextResponse) map[string]string {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Labels\n\t}).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "e2849c45c4fb206ae571f5858aba61c9", "score": "0.44393504", "text": "func createCustomer(client pb.CustomerClient, customer *pb.CustomerRequest) {\n\n\tresp, err := client.CreateCustomer(context.Background(), customer)\n\tif err != nil {\n\t\tlog.Fatalf(\"Could not create Customer: %v\", err)\n\t}\n\tif resp.Success {\n\t\tlog.Printf(\"A new Customer has been added with id: %d\", resp.Id)\n\t}\n}", "title": "" }, { "docid": "cc9317661beccdf6085b462c70c2434c", "score": "0.44339776", "text": "func (c *ClientWithResponses) CreateMssqlClusterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*createMssqlClusterResponse, error) {\n\trsp, err := c.CreateMssqlClusterWithBody(ctx, contentType, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ParseCreateMssqlClusterResponse(rsp)\n}", "title": "" }, { "docid": "7f429e92b01cc7192b51835b84202242", "score": "0.44305447", "text": "func (c *LabelClient) Create() *LabelCreate {\n\tmutation := newLabelMutation(c.config, OpCreate)\n\treturn &LabelCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "6e54871bc4b1cd0a07f0b4c3e9e42025", "score": "0.44239968", "text": "func CreateDestroyClusterResponse() (response *DestroyClusterResponse) {\n\tresponse = &DestroyClusterResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "5cc6cda8914da740ab2d61c058316144", "score": "0.4411109", "text": "func (c *PostClient) QueryLabels(po *Post) *LabelQuery {\n\tquery := (&LabelClient{config: c.config}).Query()\n\tquery.path = func(context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := po.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(post.Table, post.FieldID, id),\n\t\t\tsqlgraph.To(label.Table, label.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2M, true, post.LabelsTable, post.LabelsPrimaryKey...),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(po.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "2a8b13716946e58377c94894fee2cb59", "score": "0.44098172", "text": "func EncodeGRPCCreateUserResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tresp := response.(*pb.CreateUserResponse)\n\treturn resp, nil\n}", "title": "" }, { "docid": "03a9d630d302fa034cfe6f0c787674fb", "score": "0.44038635", "text": "func CreateOperateAxgGroupResponse() (response *OperateAxgGroupResponse) {\n\tresponse = &OperateAxgGroupResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "f7ceef8e2046b1fd80a7b5a8ebe679a1", "score": "0.4401175", "text": "func encodeGetCustomerByEmailResponse(ctx context.Context, w http.ResponseWriter, response interface{}) (err error) {\n\tif f, ok := response.(endpoint.Failure); ok && f.Failed() != nil {\n\t\tErrorEncoder(ctx, f.Failed(), w)\n\t\treturn nil\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\terr = json.NewEncoder(w).Encode(response)\n\treturn\n}", "title": "" }, { "docid": "97c649607e297b379fa2dd140b217933", "score": "0.4391036", "text": "func CreateFailoverDBClusterResponse() (response *FailoverDBClusterResponse) {\n\tresponse = &FailoverDBClusterResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "da818c160fea189b94ef950a5734c5a8", "score": "0.43752697", "text": "func CreateGetInstanceCountResponse() (response *GetInstanceCountResponse) {\n\tresponse = &GetInstanceCountResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "f672c374379d875f29be3694b339231e", "score": "0.43674892", "text": "func CreateCreateOmsMysqlDataSourceResponse() (response *CreateOmsMysqlDataSourceResponse) {\n\tresponse = &CreateOmsMysqlDataSourceResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "cd497eb85e0349f30eb82cbbd73c54c8", "score": "0.43669137", "text": "func CreateCreateMcdpEventAttributeResponse() (response *CreateMcdpEventAttributeResponse) {\n\tresponse = &CreateMcdpEventAttributeResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "083d48731eb49c2761c19ce5244c0e63", "score": "0.43646827", "text": "func CreateRestartContainerGroupResponse() (response *RestartContainerGroupResponse) {\n\tresponse = &RestartContainerGroupResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "fe01e16f708414fce7f899973c0152e1", "score": "0.43613514", "text": "func CreateGetFunctionInstanceResponse() (response *GetFunctionInstanceResponse) {\n\tresponse = &GetFunctionInstanceResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "13f1a0343b2f54fe808ee6e064ad30f2", "score": "0.43576682", "text": "func encodeCreateCandidateProjectResponse(_ context.Context, response interface{}) (interface{}, error) {\n\tres := response.(endpoints.CreateCandidateProjectResponse)\n\terr := getError(res.Err)\n\tif err == nil {\n\t\treturn &pb.CreateCandidateProjectResponse{}, nil\n\t}\n\treturn nil, err\n}", "title": "" }, { "docid": "a550e7cdc680ae26eb0f9255f13ec8cd", "score": "0.43553603", "text": "func CreateCreateCloudAccountResponse() (response *CreateCloudAccountResponse) {\n\tresponse = &CreateCloudAccountResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "1630fa85e994b1bdc532e2882b55151d", "score": "0.4355199", "text": "func CreateVnoPayCallBackNotifyResponse() (response *VnoPayCallBackNotifyResponse) {\n\tresponse = &VnoPayCallBackNotifyResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "dea92d56795fd92b7ad8352d32ede8b5", "score": "0.43490824", "text": "func newResponse(message proto.Message) *Response {\n\tvar code RequestCode\n\tswitch message.(type) {\n\tcase *ResponseOpen:\n\t\tcode = RequestCode_OPEN\n\tcase *ResponsePrepare:\n\t\tcode = RequestCode_PREPARE\n\tcase *ResponseExec:\n\t\tcode = RequestCode_EXEC\n\tcase *ResponseQuery:\n\t\tcode = RequestCode_QUERY\n\tcase *ResponseNext:\n\t\tcode = RequestCode_NEXT\n\tcase *ResponseColumnTypeScanType:\n\t\tcode = RequestCode_COLUMN_TYPE_SCAN_TYPE\n\tcase *ResponseColumnTypeDatabaseTypeName:\n\t\tcode = RequestCode_COLUMN_TYPE_DATABASE_TYPE_NAME\n\tcase *ResponseRowsClose:\n\t\tcode = RequestCode_ROWS_CLOSE\n\tcase *ResponseBegin:\n\t\tcode = RequestCode_BEGIN\n\tcase *ResponseCommit:\n\t\tcode = RequestCode_COMMIT\n\tcase *ResponseRollback:\n\t\tcode = RequestCode_ROLLBACK\n\tcase *ResponseStmtClose:\n\t\tcode = RequestCode_STMT_CLOSE\n\tcase *ResponseClose:\n\t\tcode = RequestCode_CLOSE\n\tcase *ResponseSQLError:\n\t\tcode = RequestCode_SQL_ERROR\n\tdefault:\n\t\tpanic(fmt.Errorf(\"invalid message type\"))\n\t}\n\n\tdata, err := proto.Marshal(message)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"cannot marshal %s response\", code))\n\t}\n\n\tresponse := &Response{\n\t\tCode: code,\n\t\tData: data,\n\t}\n\n\treturn response\n}", "title": "" }, { "docid": "56ab02cb3292e0c583e61546b4e82d23", "score": "0.43477333", "text": "func CreateGetMainDomainNameResponse() (response *GetMainDomainNameResponse) {\n\tresponse = &GetMainDomainNameResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "afb498461a3de7db97b7091873b14ee5", "score": "0.43457487", "text": "func CreateCreateAppResponse() (response *CreateAppResponse) {\nresponse = &CreateAppResponse{\nBaseResponse: &responses.BaseResponse{},\n}\nreturn\n}", "title": "" }, { "docid": "830deb750f452d1e4ee5aea69492eb87", "score": "0.43443725", "text": "func CreateModifyCnameReuseResponse() (response *ModifyCnameReuseResponse) {\n\tresponse = &ModifyCnameReuseResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "e1f0e2c7928fc083f8c48fe54834ed15", "score": "0.43372288", "text": "func CreateCreateLayerResponse() (response *CreateLayerResponse) {\n\tresponse = &CreateLayerResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "33050c38cab0db43d62ee14939ab4e60", "score": "0.4329422", "text": "func CreateSearchDataTrackResultResponse() (response *SearchDataTrackResultResponse) {\n\tresponse = &SearchDataTrackResultResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "a2bb762d7b7217c7ba30c17384345d04", "score": "0.43250465", "text": "func CreateDescribeBizTypeTextLibResponse() (response *DescribeBizTypeTextLibResponse) {\n\tresponse = &DescribeBizTypeTextLibResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "982e43b6e36ac0c69c3f9ca6f6a504fe", "score": "0.432207", "text": "func NewLabelCmd(context *cmd.Context) *Cmd {\n\treturn &Cmd{Context: context, labelChanges: types.LabelChanges{}}\n}", "title": "" }, { "docid": "4f1aa545955e0692f985c21261411e0a", "score": "0.43211555", "text": "func (o SourceContextResponseOutput) Labels() pulumi.StringMapOutput {\n\treturn o.ApplyT(func(v SourceContextResponse) map[string]string { return v.Labels }).(pulumi.StringMapOutput)\n}", "title": "" }, { "docid": "b1eafbc596423ae71711f4b97599adb2", "score": "0.4319151", "text": "func (c *AddLabelClient) Query(ctx context.Context, query string, ts time.Time) (model.Value, v1.Warnings, error) {\n\t// Parse out the promql query into expressions etc.\n\te, err := parser.ParseExpr(query)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Walk the expression, to filter out any LabelMatchers that match etc.\n\tfilterVisitor := NewFilterMatcherVisitor(c.Labels)\n\tif _, err := parser.Walk(ctx, filterVisitor, &parser.EvalStmt{Expr: e}, e, nil, nil); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif !filterVisitor.filterMatch {\n\t\treturn nil, nil, nil\n\t}\n\n\tval, w, err := c.API.Query(ctx, e.String(), ts)\n\tif err != nil {\n\t\treturn nil, w, err\n\t}\n\tif err := promhttputil.ValueAddLabelSet(val, c.Labels); err != nil {\n\t\treturn nil, w, err\n\t}\n\treturn val, w, nil\n}", "title": "" }, { "docid": "33ad3daf4f143de068823b6104ccc6de", "score": "0.43190315", "text": "func CreateClearFaceDeviceDBResponse() (response *ClearFaceDeviceDBResponse) {\n\tresponse = &ClearFaceDeviceDBResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "8bec55101aa4e6ba0b7b06029b48252e", "score": "0.43154806", "text": "func (m mundipagg) NewCustomer(c *Customer, indepotencyKey string) (*Response, error) {\n\n\tresp, err := MakePostRequest(c, m.BasicSecretAuthKey, indepotencyKey, CUSTOMERURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp, nil\n}", "title": "" }, { "docid": "6c30a587d8f0b418145f4ab56e106382", "score": "0.43122476", "text": "func createResponse(result Response) []byte {\n\tres, _ := json.Marshal(result)\n\treturn res\n}", "title": "" }, { "docid": "b44073dc2abb5d76870602fd6d6e61b3", "score": "0.4305732", "text": "func (s *Server) createInvoiceCheckResponseProtobuf(status string, amountToPay int64) *pb.InvoiceCheckResponse {\n\treturn &pb.InvoiceCheckResponse{Status: status, DigitalValueRemaining: amountToPay}\n}", "title": "" }, { "docid": "519c8b80a3166666502b45f5d1bf7874", "score": "0.43026048", "text": "func CreateCreateVnInstanceResponse() (response *CreateVnInstanceResponse) {\n\tresponse = &CreateVnInstanceResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "e108a594c5cf25097ae68b978218c880", "score": "0.4300092", "text": "func (*SearchNodeAndCountByCqlResponse) Descriptor() ([]byte, []int) {\n\treturn file_src_grpc_cmdb_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "7031b29aa0146f27e8bfc5d90ae9767d", "score": "0.42999148", "text": "func (o RelatedUrlResponseOutput) Label() pulumi.StringOutput {\n\treturn o.ApplyT(func(v RelatedUrlResponse) string { return v.Label }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "7031b29aa0146f27e8bfc5d90ae9767d", "score": "0.42999148", "text": "func (o RelatedUrlResponseOutput) Label() pulumi.StringOutput {\n\treturn o.ApplyT(func(v RelatedUrlResponse) string { return v.Label }).(pulumi.StringOutput)\n}", "title": "" }, { "docid": "c30d56788edf9320395b6a824dea1198", "score": "0.42962077", "text": "func CreateDescribeDcdnTagResourcesResponse() (response *DescribeDcdnTagResourcesResponse) {\n\tresponse = &DescribeDcdnTagResourcesResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "56b94569f08b5656714f2e493461f733", "score": "0.429546", "text": "func NewCustomer(c dto.CustomerRequest) Customer {\n\treturn Customer{\n\t\tID: \"\",\n\t\tName: c.Name,\n\t\tCity: c.City,\n\t\tZipcode: c.Zipcode,\n\t\tDateofBirth: c.DateofBirth,\n\t\tStatus: \"1\",\n\t}\n}", "title": "" }, { "docid": "8c136dba7a92e6e78cd5cba675389ae8", "score": "0.42933834", "text": "func CreateDescribeNamespaceResourcesResponse() (response *DescribeNamespaceResourcesResponse) {\n\tresponse = &DescribeNamespaceResourcesResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" }, { "docid": "6463965c39fac932ebfd362217d45d10", "score": "0.4292578", "text": "func queryCount(stub shim.ChaincodeStubInterface, args []string) pb.Response {\n \n shim.Success([]byte(\"###################### Entering in queryCount Method ######################\"))\n\n var queryc = args[0]\n querycBytes, _ := stub.GetState(queryc)\n if querycBytes == nil {\n return shim.Error(\"@@@@@@@@@@@@@@@@@@@ Unable to locate country @@@@@@@@@@@@@@@@@@@\")\n }\n \n return shim.Success([]byte(string(querycBytes)))\n}", "title": "" }, { "docid": "589d405de72fbf201589750480036945", "score": "0.42850074", "text": "func CreateUpgradeFabricChaincodeResponse() (response *UpgradeFabricChaincodeResponse) {\n\tresponse = &UpgradeFabricChaincodeResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}", "title": "" } ]
1d169dc7c28397ab6ccd4f57a5589717
Transform transforms a value of type T into a value of type T1. The value val must be assignable to T.
[ { "docid": "6e049b67771287539bf0a96af03177aa", "score": "0.43898827", "text": "func (m *Lens) Transform(val interface{}) (interface{}, error) {\n\tx, err := m.f(reflect.ValueOf(val))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn x.Interface(), nil\n}", "title": "" } ]
[ { "docid": "b902d5e996cb64e4722e2cf267d9e8f1", "score": "0.5778173", "text": "func Val1(stmts string, expr1 string, val1 interface{}) test {\n\treturn test([]job{\n\t\tjob{code: stmts, noval: true},\n\t\tjob{code: expr1, val: toValue(val1)},\n\t})\n}", "title": "" }, { "docid": "786826ad8cff19ef90b8cbebe79c778e", "score": "0.5742337", "text": "func ValueConvert(v reflect.Value, t reflect.Type,) reflect.Value", "title": "" }, { "docid": "f7bddc5ea9755cb7016dc02347628bd9", "score": "0.5401226", "text": "func Transform(v Value, m *Lens) (v1 Value) {\n\tif v.Type() != m.Type() {\n\t\tpanic(fmt.Sprintf(\"Value type (%v) does not match Lens type (%v)\", v.Type(), m.Type()))\n\t}\n\treturn &transformedValue{v, m}\n}", "title": "" }, { "docid": "2fb534ace1af9aa6c8416098c6de8faa", "score": "0.5024092", "text": "func (t *T) convertValue(\n\tseenPointers map[unsafe.Pointer]reflect.Value,\n\torigValue, filteredValue reflect.Value,\n) error {\n\t// If the original value is stored in an interface, we need to unwrap that\n\t// first.\n\torigType := origValue.Type()\n\tif origType.Kind() == reflect.Interface {\n\t\tif !origValue.IsNil() {\n\t\t\treturn t.convertValue(seenPointers, origValue.Elem(), filteredValue)\n\t\t}\n\t\treturn nil\n\t}\n\t// Common shortcut\n\tfilteredType := filteredValue.Type()\n\tif origType == filteredType {\n\t\tfilteredValue.Set(origValue)\n\t\treturn nil\n\t}\n\t// Avoid infinite recursion\n\tswitch origType.Kind() {\n\tcase reflect.Ptr, reflect.Slice, reflect.Map:\n\t\tseenValue, ok := seenPointers[unsafe.Pointer(origValue.Pointer())]\n\t\tif ok {\n\t\t\tfilteredValue.Set(seenValue)\n\t\t\treturn nil\n\t\t}\n\t}\n\t// The filtered type may be interface{} to avoid a recursive type definition.\n\t// In this case we need to allocate an actual value.\n\toldFilteredValue := filteredValue\n\tif filteredType.Kind() == reflect.Interface {\n\t\tvar err error\n\t\tfilteredType, err = t.mapType(origType)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfilteredValue = reflect.New(filteredType).Elem()\n\t}\n\n\tswitch origType.Kind() {\n\tcase reflect.Array:\n\t\tfor i := 0; i != origType.Len(); i++ {\n\t\t\torigIndexValue := origValue.Index(i)\n\t\t\tfilteredIndexValue := filteredValue.Index(i)\n\t\t\tif err := t.convertValue(\n\t\t\t\tseenPointers, origIndexValue, filteredIndexValue,\n\t\t\t); err != nil {\n\t\t\t\treturn fmt.Errorf(\"array[%d]: %w\", i, err)\n\t\t\t}\n\t\t}\n\tcase reflect.Struct:\n\t\tfor i := 0; i != origType.NumField(); i++ {\n\t\t\torigStructField := origType.Field(i)\n\t\t\tif _, ok := filteredType.FieldByName(origStructField.Name); !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := t.convertValue(\n\t\t\t\tseenPointers, origValue.Field(i),\n\t\t\t\tfilteredValue.FieldByName(origStructField.Name),\n\t\t\t); err != nil {\n\t\t\t\treturn fmt.Errorf(\"struct %s: %w\", origStructField.Name, err)\n\t\t\t}\n\t\t}\n\tcase reflect.Ptr, reflect.Slice, reflect.Map:\n\t\tif !origValue.IsNil() {\n\t\t\tseenPointers[unsafe.Pointer(origValue.Pointer())] = filteredValue\n\t\t\treturn t.convertPointer(seenPointers, origValue, filteredValue)\n\t\t}\n\tdefault:\n\t\tfilteredValue.Set(origValue)\n\t}\n\toldFilteredValue.Set(filteredValue)\n\treturn nil\n}", "title": "" }, { "docid": "7afc12c8bbf1449618565174d72046f6", "score": "0.4953483", "text": "func (tr *typeResolver) setValue(vt pgtype.ValueTranscoder, val interface{}) pgtype.ValueTranscoder {\n\tif err := vt.Set(val); err != nil {\n\t\tpanic(fmt.Sprintf(\"set ValueTranscoder %T to %+v: %s\", vt, val, err))\n\t}\n\treturn vt\n}", "title": "" }, { "docid": "76fcfc094c3787555b7da602867e3050", "score": "0.49531126", "text": "func Val2(stmts string, expr1 string, val1 interface{}, expr2 string, val2 interface{}) test {\n\treturn test([]job{\n\t\tjob{code: stmts, noval: true},\n\t\tjob{code: expr1, val: toValue(val1)},\n\t\tjob{code: expr2, val: toValue(val2)},\n\t})\n}", "title": "" }, { "docid": "290a93983bd53761a0348af95c9cd0f1", "score": "0.49072495", "text": "func PtrToVal[T any](ptr *T) T {\n\tif ptr == nil {\n\t\tvar t T\n\t\treturn t\n\t}\n\treturn *ptr\n}", "title": "" }, { "docid": "e37e3b0c055cb1c1f9f587845958b0b3", "score": "0.48856965", "text": "func tftypesNewValue(t tftypes.Type, val interface{}) tftypes.Value {\n\tif val == nil || val == tftypes.UnknownValue {\n\t\treturn tftypes.NewValue(t, val)\n\t}\n\n\tswitch tt := t.(type) {\n\tcase tftypes.List:\n\t\tvar elems []tftypes.Value\n\n\t\tr := reflect.ValueOf(val)\n\t\tfor i := 0; i < r.Len(); i++ {\n\t\t\telem := tftypesNewValue(tt.ElementType, r.Index(i).Interface())\n\t\t\telems = append(elems, elem)\n\t\t}\n\n\t\treturn tftypes.NewValue(t, elems)\n\tcase tftypes.Set:\n\t\tvar elems []tftypes.Value\n\n\t\tr := reflect.ValueOf(val)\n\t\tfor i := 0; i < r.Len(); i++ {\n\t\t\telem := tftypesNewValue(tt.ElementType, r.Index(i).Interface())\n\t\t\telems = append(elems, elem)\n\t\t}\n\n\t\treturn tftypes.NewValue(t, elems)\n\n\tcase tftypes.Map:\n\t\telems := map[string]tftypes.Value{}\n\t\tr := reflect.ValueOf(val)\n\t\titer := r.MapRange()\n\t\tfor iter.Next() {\n\t\t\tkey := iter.Key().Interface().(string)\n\t\t\telems[key] = tftypesNewValue(tt.ElementType, iter.Value().Interface())\n\t\t}\n\t\treturn tftypes.NewValue(t, elems)\n\tdefault:\n\t\treturn tftypes.NewValue(t, val)\n\t}\n}", "title": "" }, { "docid": "9e7b60ee0a28e53ebb8ae6e41c6e1547", "score": "0.48366112", "text": "func cvtInt(v Value, t Type) Value {\n\treturn makeInt(v.flag&flagRO, uint64(v.Int()), t)\n}", "title": "" }, { "docid": "92ec8853fd4d85151391a74cc0023470", "score": "0.47937503", "text": "func (v Value) Convert(t Type) Value {\n\tif v.flag&flagMethod != 0 {\n\t\tv = makeMethodValue(\"Convert\", v)\n\t}\n\top := convertOp(t.common(), v.typ)\n\tif op == nil {\n\t\tpanic(\"reflect.Value.Convert: value of type \" + v.typ.String() + \" cannot be converted to type \" + t.String())\n\t}\n\treturn op(v, t)\n}", "title": "" }, { "docid": "3528f16fdc8f399b06a1f959f30a9a54", "score": "0.47784534", "text": "func (d *deserialiser) assignValue(inval interface{}, outputval reflect.Value, outtype reflect.Type, pos token.Pos) (success bool) {\n\tinputval := reflect.ValueOf(inval)\n\n\tfkind := outputval.Kind()\n\tsetkind := inputval.Kind()\n\n\t// Instantiate our type if it's a pointer.\n\tif fkind == reflect.Ptr && fkind != setkind && outtype != nil {\n\t\tnewptr := reflect.New(outtype.Elem())\n\t\toutputval.Set(newptr)\n\t\toutputval = newptr.Elem()\n\t\tfkind = outputval.Kind()\n\t}\n\n\t// Recover from type setting failures.\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tsuccess = false\n\t\t\td.errors = append(d.errors,\n\t\t\t\tfmt.Sprintf(\"goon: Unable to assign %v value to %v (%v)\",\n\t\t\t\t\tsetkind, outputval.Type().Name(), d.fileset.Position(pos)))\n\t\t}\n\t}()\n\n\t// Try to assign the standard types.\n\tswitch fkind {\n\tcase reflect.Float32, reflect.Float64:\n\t\tif inputval.Kind() == reflect.Int64 {\n\t\t\toutputval.SetFloat(float64(inputval.Int()))\n\t\t} else {\n\t\t\toutputval.SetFloat(inputval.Float())\n\t\t}\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\toutputval.SetUint(uint64(inputval.Int()))\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\toutputval.SetInt(inputval.Int())\n\tcase reflect.Bool:\n\t\toutputval.SetBool(inputval.Bool())\n\tcase reflect.Struct:\n\t\toutputval.Set(inputval.Elem())\n\tcase reflect.Slice:\n\t\tslicelen := inputval.Len()\n\t\tnewslice := reflect.MakeSlice(outtype, 0, slicelen)\n\t\tfor i := 0; i < slicelen; i++ {\n\t\t\tif _inval, ok := inputval.Index(i).Interface().(*seqelement); ok {\n\t\t\t\t_outval := reflect.New(outtype.Elem()).Elem()\n\t\t\t\tif d.assignValue(_inval.item, _outval, _outval.Type(), _inval.pos) && _outval.IsValid() {\n\t\t\t\t\tnewslice = reflect.Append(newslice, _outval)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutputval.Set(newslice)\n\tcase reflect.Map:\n\t\tslicelen := inputval.Len()\n\t\tnewmap := reflect.MakeMap(outtype)\n\t\tfor i := 0; i < slicelen; i++ {\n\t\t\tif _inval, ok := inputval.Index(i).Interface().(*mapelement); ok {\n\t\t\t\t_outkey := reflect.New(outtype.Key()).Elem()\n\t\t\t\t_outval := reflect.New(outtype.Elem()).Elem()\n\t\t\t\tif d.assignValue(_inval.key, _outkey, _outkey.Type(), _inval.kpos) && _outkey.IsValid() {\n\t\t\t\t\tif d.assignValue(_inval.val, _outval, _outval.Type(), _inval.kpos) && _outval.IsValid() {\n\t\t\t\t\t\tnewmap.SetMapIndex(_outkey, _outval)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutputval.Set(newmap)\n\tdefault:\n\t\toutputval.Set(inputval)\n\t}\n\n\tsuccess = true\n\treturn\n}", "title": "" }, { "docid": "65bd4fd2c84ff9b7cd90c0dec851cb05", "score": "0.4757556", "text": "func assignAndConvertValue(srcValue, dstValue reflect.Value) error {\n\n\tsrcKind := srcValue.Kind()\n\tdstKind := dstValue.Kind()\n\n\t// The simple case\n\tif srcKind == dstKind {\n\t\tdstValue.Set(srcValue)\n\t\treturn nil\n\t}\n\n\tsrcTypeStr := srcValue.Type().String()\n\tdstTypeStr := dstValue.Type().String()\n\n\t// Otherwise convert the type\n\tswitch srcKind {\n\n\tcase reflect.Bool:\n\n\t\tboolValue := srcValue.Bool()\n\n\t\tswitch dstKind {\n\n\t\tcase reflect.Float32:\n\t\t\tresult, err := convert.BoolToFloat32(boolValue)\n\t\t\tdstValue.SetFloat(float64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Float64:\n\t\t\tresult, err := convert.BoolToFloat64(boolValue)\n\t\t\tdstValue.SetFloat(result)\n\t\t\treturn err\n\n\t\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\t\tresult, err := convert.BoolToInt(boolValue)\n\t\t\tdstValue.SetInt(result)\n\t\t\treturn err\n\n\t\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\t\tresult, err := convert.BoolToUint(boolValue)\n\t\t\tdstValue.SetUint(result)\n\t\t\treturn err\n\n\t\tcase reflect.String:\n\t\t\tresult, err := convert.BoolToString(boolValue)\n\t\t\tdstValue.SetString(result)\n\t\t\treturn err\n\n\t\tdefault:\n\n\t\t\tif dstTypeStr == timeType {\n\t\t\t\tresult, err := convert.BoolToInt(boolValue)\n\t\t\t\ttimeVal := reflect.ValueOf(time.Unix(result, 0))\n\t\t\t\tdstValue.Set(timeVal)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\n\tcase reflect.Float32, reflect.Float64:\n\n\t\tfloatValue := srcValue.Float()\n\n\t\tswitch dstKind {\n\n\t\tcase reflect.Bool:\n\t\t\tresult, err := convert.FloatToBool(floatValue)\n\t\t\tdstValue.SetBool(result)\n\t\t\treturn err\n\n\t\tcase reflect.Float32:\n\t\t\tresult, err := convert.FloatToFloat32(floatValue)\n\t\t\tdstValue.SetFloat(float64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int:\n\t\t\tresult, err := convert.FloatToInt(floatValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int8:\n\t\t\tresult, err := convert.FloatToInt8(floatValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int16:\n\t\t\tresult, err := convert.FloatToInt16(floatValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int32:\n\t\t\tresult, err := convert.FloatToInt32(floatValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int64:\n\t\t\tresult, err := convert.FloatToInt64(floatValue)\n\t\t\tdstValue.SetInt(result)\n\t\t\treturn err\n\n\t\tcase reflect.Uint:\n\t\t\tresult, err := convert.FloatToUint(floatValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint8:\n\t\t\tresult, err := convert.FloatToUint8(floatValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint16:\n\t\t\tresult, err := convert.FloatToUint16(floatValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint32:\n\t\t\tresult, err := convert.FloatToUint32(floatValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint64:\n\t\t\tresult, err := convert.FloatToUint64(floatValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.String:\n\t\t\tresult, err := convert.FloatToString(floatValue)\n\t\t\tdstValue.SetString(result)\n\t\t\treturn err\n\n\t\tdefault:\n\n\t\t\tif dstTypeStr == timeType {\n\t\t\t\tresult, err := convert.FloatToInt64(floatValue)\n\t\t\t\ttimeVal := reflect.ValueOf(time.Unix(result, 0))\n\t\t\t\tdstValue.Set(timeVal)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Struct:\n\n\t\tvar intValue int64\n\n\t\t// Time can be represented as an integer, so it can be handled using the integer logic\n\t\tif srcKind == reflect.Struct && srcTypeStr != timeType {\n\t\t\tbreak\n\t\t} else if srcKind == reflect.Struct {\n\t\t\tintValue = srcValue.Interface().(time.Time).Unix()\n\t\t} else {\n\t\t\tintValue = srcValue.Int()\n\t\t}\n\n\t\tswitch dstKind {\n\n\t\tcase reflect.Bool:\n\t\t\tresult, err := convert.IntToBool(intValue)\n\t\t\tdstValue.SetBool(result)\n\t\t\treturn err\n\n\t\tcase reflect.Float32:\n\t\t\tresult, err := convert.IntToFloat32(intValue)\n\t\t\tdstValue.SetFloat(float64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Float64:\n\t\t\tresult, err := convert.IntToFloat64(intValue)\n\t\t\tdstValue.SetFloat(result)\n\t\t\treturn err\n\n\t\tcase reflect.Int:\n\t\t\tresult, err := convert.IntToDefaultInt(intValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int8:\n\t\t\tresult, err := convert.IntToInt8(intValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int16:\n\t\t\tresult, err := convert.IntToInt16(intValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int32:\n\t\t\tresult, err := convert.IntToInt32(intValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int64:\n\t\t\tdstValue.SetInt(intValue)\n\t\t\treturn nil\n\n\t\tcase reflect.Uint:\n\t\t\tresult, err := convert.IntToUint(intValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint8:\n\t\t\tresult, err := convert.IntToUint8(intValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint16:\n\t\t\tresult, err := convert.IntToUint16(intValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint32:\n\t\t\tresult, err := convert.IntToUint32(intValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint64:\n\t\t\tresult, err := convert.IntToUint64(intValue)\n\t\t\tdstValue.SetUint(result)\n\t\t\treturn err\n\n\t\tcase reflect.String:\n\t\t\tresult, err := convert.IntToString(intValue)\n\t\t\tdstValue.SetString(result)\n\t\t\treturn err\n\n\t\tdefault:\n\n\t\t\tif dstValue.Type().String() == timeType {\n\t\t\t\ttimeVal := reflect.ValueOf(time.Unix(intValue, 0))\n\t\t\t\tdstValue.Set(timeVal)\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t}\n\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\n\t\tuintValue := srcValue.Uint()\n\n\t\tswitch dstKind {\n\n\t\tcase reflect.Bool:\n\t\t\tresult, err := convert.UintToBool(uintValue)\n\t\t\tdstValue.SetBool(result)\n\t\t\treturn err\n\n\t\tcase reflect.Float32:\n\t\t\tresult, err := convert.UintToFloat32(uintValue)\n\t\t\tdstValue.SetFloat(float64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Float64:\n\t\t\tresult, err := convert.UintToFloat64(uintValue)\n\t\t\tdstValue.SetFloat(result)\n\t\t\treturn err\n\n\t\tcase reflect.Int:\n\t\t\tresult, err := convert.UintToInt(uintValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int8:\n\t\t\tresult, err := convert.UintToInt8(uintValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int16:\n\t\t\tresult, err := convert.UintToInt16(uintValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int32:\n\t\t\tresult, err := convert.UintToInt32(uintValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int64:\n\t\t\tresult, err := convert.UintToInt64(uintValue)\n\t\t\tdstValue.SetInt(result)\n\t\t\treturn err\n\n\t\tcase reflect.Uint:\n\t\t\tresult, err := convert.UintToDefaultUint(uintValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint8:\n\t\t\tresult, err := convert.UintToUint8(uintValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint16:\n\t\t\tresult, err := convert.UintToUint16(uintValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint32:\n\t\t\tresult, err := convert.UintToUint32(uintValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint64:\n\t\t\tdstValue.SetUint(uintValue)\n\t\t\treturn nil\n\n\t\tcase reflect.String:\n\t\t\tresult, err := convert.UintToString(uintValue)\n\t\t\tdstValue.SetString(result)\n\t\t\treturn err\n\n\t\tdefault:\n\n\t\t\tif dstValue.Type().String() == timeType {\n\t\t\t\tresult, err := convert.UintToInt64(uintValue)\n\t\t\t\ttimeVal := reflect.ValueOf(time.Unix(result, 0))\n\t\t\t\tdstValue.Set(timeVal)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\n\tcase reflect.String:\n\n\t\tstringValue := srcValue.String()\n\n\t\tswitch dstKind {\n\n\t\tcase reflect.Bool:\n\t\t\tresult, err := convert.StringToBool(stringValue)\n\t\t\tdstValue.SetBool(result)\n\t\t\treturn err\n\n\t\tcase reflect.Float32:\n\t\t\tresult, err := convert.StringToFloat32(stringValue)\n\t\t\tdstValue.SetFloat(float64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Float64:\n\t\t\tresult, err := convert.StringToFloat64(stringValue)\n\t\t\tdstValue.SetFloat(result)\n\t\t\treturn err\n\n\t\tcase reflect.Int:\n\t\t\tresult, err := convert.StringToInt(stringValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int8:\n\t\t\tresult, err := convert.StringToInt8(stringValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int16:\n\t\t\tresult, err := convert.StringToInt16(stringValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int32:\n\t\t\tresult, err := convert.StringToInt32(stringValue)\n\t\t\tdstValue.SetInt(int64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Int64:\n\t\t\tresult, err := convert.StringToInt64(stringValue)\n\t\t\tdstValue.SetInt(result)\n\t\t\treturn err\n\n\t\tcase reflect.Uint:\n\t\t\tresult, err := convert.StringToUint(stringValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint8:\n\t\t\tresult, err := convert.StringToUint8(stringValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint16:\n\t\t\tresult, err := convert.StringToUint16(stringValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint32:\n\t\t\tresult, err := convert.StringToUint32(stringValue)\n\t\t\tdstValue.SetUint(uint64(result))\n\t\t\treturn err\n\n\t\tcase reflect.Uint64:\n\t\t\tresult, err := convert.StringToUint64(stringValue)\n\t\t\tdstValue.SetUint(result)\n\t\t\treturn err\n\n\t\tdefault:\n\n\t\t\tif dstValue.Type().String() == timeType {\n\t\t\t\tresult, err := convert.StringToInt64(stringValue)\n\t\t\t\ttimeVal := reflect.ValueOf(time.Unix(result, 0))\n\t\t\t\tdstValue.Set(timeVal)\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// If we got here, then something isn't right; return an error\n\treturn fmt.Errorf(\"%s cannot be converted to %s\", srcKind.String(), dstKind.String())\n}", "title": "" }, { "docid": "6f783990dc6e768f5a5f71ef7c8e9cfd", "score": "0.47568512", "text": "func (val *MultiVal) val() *Val {\n\treturn &val[0]\n}", "title": "" }, { "docid": "1262d3cf00b5f8513a9f75454d129fa1", "score": "0.4737154", "text": "func convertWithBestEffort(tv *task.Value, attr string) (types.Val, error) {\n\tv, _ := getValue(tv)\n\ttyp, err := schema.State().TypeOf(attr)\n\tsv := types.ValueForType(types.StringID)\n\tif err == nil {\n\t\t// Try to coerce types if this is an optional scalar outside an\n\t\t// object definition.\n\t\tif !typ.IsScalar() {\n\t\t\treturn sv, x.Errorf(\"Leaf predicate:'%v' must be a scalar.\", attr)\n\t\t}\n\t\tsv, err = types.Convert(v, typ)\n\t\tif bytes.Equal(tv.Val, nil) || err != nil {\n\t\t\treturn sv, ErrEmptyVal\n\t\t}\n\t} else {\n\t\tsv, err = types.Convert(v, types.StringID)\n\t\tx.Check(err)\n\t}\n\tif bytes.Equal(tv.Val, nil) {\n\t\treturn sv, ErrEmptyVal\n\t}\n\treturn sv, nil\n}", "title": "" }, { "docid": "40b1060b19830840376025f223c7e0ed", "score": "0.45634958", "text": "func conversion(val reflect.Value, from map[string]interface{}) (err error) {\n\tif val.Kind() == reflect.Ptr {\n\t\tval = val.Elem()\n\t}\n\ttyp := val.Type()\n\tfor i := 0; i < val.NumField(); i++ {\n\t\tfield := typ.Field(i)\n\t\ttag, opts := parseTag(field.Tag.Get(\"convert\"))\n\t\trv := reflect.ValueOf(field)\n\t\tv := field.Type\n\t\tif tag == \"\" || tag == \"-\" {\n\t\t\tcontinue\n\t\t}\n\t\tm, ok := val.Field(i).Interface().(Converter)\n\t\tif ok {\n\t\t\tf, err := m.Convert(from[tag], tag, opts)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tval.Field(i).Set(reflect.ValueOf(f))\n\t\t\tcontinue\n\t\t}\n\t\tif rv.Kind() == reflect.Ptr {\n\t\t\trv = rv.Elem()\n\t\t\tif err = conversion(rv, from); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif v.Kind() == reflect.Struct {\n\t\t\tif err = conversion(rv, from); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tval.Field(i).Set(reflect.ValueOf(from[tag]))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "bf73b4eeb8f0dcaf81829a67836499be", "score": "0.455344", "text": "func Value[T any](v *T) T {\n\tif v == nil {\n\t\tvar t T\n\t\treturn t\n\t}\n\n\treturn *v\n}", "title": "" }, { "docid": "4adae7fd54ac5090119a92567ea08ba8", "score": "0.4543835", "text": "func cvtT2I(v Value, typ Type) Value {\n\ttarget := unsafe_New(typ.common())\n\tx := valueInterface(v, false)\n\tif typ.NumMethod() == 0 {\n\t\t*(*interface{})(target) = x\n\t} else {\n\t\tifaceE2I(typ.(*rtype), x, target)\n\t}\n\treturn Value{typ.common(), target, v.flag&flagRO | flagIndir | flag(Interface)}\n}", "title": "" }, { "docid": "7194921d62f791bc39db330e9c38bbcd", "score": "0.45416528", "text": "func convert(val *protos.Value) (interface{}, error) {\n\tswitch val.Val.(type) {\n\tcase *protos.Value_StrVal:\n\t\treturn strings.Replace(val.GetStrVal(), \"\\\\\\\"\", \"\\\"\", -1), nil\n\tcase *protos.Value_BoolVal:\n\t\treturn val.GetBoolVal(), nil\n\tcase *protos.Value_IntVal:\n\t\treturn val.GetIntVal(), nil\n\tcase *protos.Value_UidVal:\n\t\treturn val.GetUidVal(), nil\n\tcase *protos.Value_DateVal:\n\t\tlogger.D(\"Parsing time\")\n\t\tt, err := time.Parse(\"2006-01-02 19:54:00.000000000 +0000 UTC\", string(val.GetDatetimeVal()))\n\t\tif err != nil {\n\t\t\tlogger.E(\"Error while parsing datetime\", err)\n\t\t\treturn string(val.GetDatetimeVal()), err\n\t\t}\n\t\treturn t, nil\n\tcase *protos.Value_DatetimeVal:\n\t\tlogger.D(\"Parsing time\")\n\t\tt, err := time.Parse(\"2006-01-02 19:54:00.000000000 +0000 UTC\", string(val.GetDatetimeVal()))\n\t\tif err != nil {\n\t\t\tlogger.E(\"Error while parsing datetime\", err)\n\t\t\treturn string(val.GetDatetimeVal()), err\n\t\t}\n\t\treturn t, nil\n\tdefault:\n\t\treturn val.GetDefaultVal(), nil\n\t}\n\treturn nil, nil\n}", "title": "" }, { "docid": "6525d750cc265c15de955dd7857723cd", "score": "0.45041555", "text": "func getValue(tv *task.Value) (types.Val, error) {\n\tvID := types.TypeID(tv.ValType)\n\tval := types.ValueForType(vID)\n\tval.Value = tv.Val\n\treturn val, nil\n}", "title": "" }, { "docid": "2a4ac1206ccfb25e4c2471871003f263", "score": "0.45032457", "text": "func convertValue(value interface{}, targetType reflect.Type) (interface{}, error) {\n\tif value == nil {\n\t\treturn reflect.Zero(targetType).Interface(), nil\n\t}\n\n\tvalueType := reflect.TypeOf(value)\n\tif valueType.AssignableTo(targetType) {\n\t\treturn value, nil\n\t} else if targetType == _typeOfString {\n\t\treturn fmt.Sprint(value), nil\n\t}\n\n\tswitch v := value.(type) {\n\tcase string:\n\t\ttarget := reflect.New(targetType).Interface()\n\t\tswitch t := target.(type) {\n\t\tcase *int:\n\t\t\treturn strconv.Atoi(v)\n\t\tcase *bool:\n\t\t\treturn strconv.ParseBool(v)\n\t\tcase *time.Duration:\n\t\t\treturn time.ParseDuration(v)\n\t\tcase encoding.TextUnmarshaler:\n\t\t\terr := t.UnmarshalText([]byte(v))\n\t\t\t// target should have a pointer receiver to be able to change itself based on text\n\t\t\treturn reflect.ValueOf(target).Elem().Interface(), err\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"can't convert %v to %v\", reflect.TypeOf(value).String(), targetType)\n}", "title": "" }, { "docid": "ecc5dead3e6efb72cc9bb484ecdb9d27", "score": "0.4431872", "text": "func typedCopy(t *Type, v *Value) *Value {\n\tcp := &Value{t: t}\n\treturn cp.Assign(v)\n}", "title": "" }, { "docid": "2332ba33517ccbd5bd8e5d8d0812939c", "score": "0.44199562", "text": "func FromValue(target Target, vv *Value) error {\n\ttt := vv.Type()\n\tif tt.Kind() == Any {\n\t\tif vv.IsNil() {\n\t\t\treturn target.FromNil(tt)\n\t\t}\n\t\t// Non-nil any simply converts from the elem.\n\t\tvv = vv.Elem()\n\t\ttt = vv.Type()\n\t}\n\tif tt.Kind() == Optional {\n\t\tif vv.IsNil() {\n\t\t\treturn target.FromNil(tt)\n\t\t}\n\t\t// Non-nil optional is special - we keep tt as the optional type, but use\n\t\t// the elem value for the actual value below.\n\t\tvv = vv.Elem()\n\t}\n\tif vv.Type().IsBytes() {\n\t\treturn target.FromBytes(vv.Bytes(), tt)\n\t}\n\tswitch vv.Kind() {\n\tcase Bool:\n\t\treturn target.FromBool(vv.Bool(), tt)\n\tcase Byte, Uint16, Uint32, Uint64:\n\t\treturn target.FromUint(vv.Uint(), tt)\n\tcase Int8, Int16, Int32, Int64:\n\t\treturn target.FromInt(vv.Int(), tt)\n\tcase Float32, Float64:\n\t\treturn target.FromFloat(vv.Float(), tt)\n\tcase String:\n\t\treturn target.FromString(vv.RawString(), tt)\n\tcase Enum:\n\t\treturn target.FromEnumLabel(vv.EnumLabel(), tt)\n\tcase TypeObject:\n\t\treturn target.FromTypeObject(vv.TypeObject())\n\tcase Array, List:\n\t\tlistTarget, err := target.StartList(tt, vv.Len())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor ix := 0; ix < vv.Len(); ix++ {\n\t\t\telem, err := listTarget.StartElem(ix)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := FromValue(elem, vv.Index(ix)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := listTarget.FinishElem(elem); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn target.FinishList(listTarget)\n\tcase Set:\n\t\tsetTarget, err := target.StartSet(tt, vv.Len())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, vvkey := range vv.Keys() {\n\t\t\tkey, err := setTarget.StartKey()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := FromValue(key, vvkey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tswitch err := setTarget.FinishKey(key); {\n\t\t\tcase err == ErrFieldNoExist:\n\t\t\t\tcontinue // silently drop unknown fields\n\t\t\tcase err != nil:\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn target.FinishSet(setTarget)\n\tcase Map:\n\t\tmapTarget, err := target.StartMap(tt, vv.Len())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, vvkey := range vv.Keys() {\n\t\t\tkey, err := mapTarget.StartKey()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := FromValue(key, vvkey); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfield, err := mapTarget.FinishKeyStartField(key)\n\t\t\tswitch {\n\t\t\tcase err == ErrFieldNoExist:\n\t\t\t\tcontinue // silently drop unknown fields\n\t\t\tcase err != nil:\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := FromValue(field, vv.MapIndex(vvkey)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := mapTarget.FinishField(key, field); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn target.FinishMap(mapTarget)\n\tcase Struct:\n\t\tfieldsTarget, err := target.StartFields(tt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor fx := 0; fx < vv.Type().NumField(); fx++ {\n\t\t\tif vv.StructField(fx).IsZero() {\n\t\t\t\terr := fieldsTarget.ZeroField(vv.Type().Field(fx).Name)\n\t\t\t\tif err != nil && err != ErrFieldNoExist {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tkey, field, err := fieldsTarget.StartField(vv.Type().Field(fx).Name)\n\t\t\tswitch {\n\t\t\tcase err == ErrFieldNoExist:\n\t\t\t\tcontinue // silently drop unknown fields\n\t\t\tcase err != nil:\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := FromValue(field, vv.StructField(fx)); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := fieldsTarget.FinishField(key, field); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn target.FinishFields(fieldsTarget)\n\tcase Union:\n\t\tfieldsTarget, err := target.StartFields(tt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfx, vvFieldValue := vv.UnionField()\n\t\tkey, field, err := fieldsTarget.StartField(vv.Type().Field(fx).Name)\n\t\tif err != nil {\n\t\t\treturn err // no ErrFieldNoExist special-case; union field is required\n\t\t}\n\t\tif err := FromValue(field, vvFieldValue); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := fieldsTarget.FinishField(key, field); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn target.FinishFields(fieldsTarget)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"FromValue unhandled %v %v\", vv.Kind(), tt))\n\t}\n}", "title": "" }, { "docid": "f2e91844f4eefa656c3a09266c3b3adf", "score": "0.44031534", "text": "func (s *state) newValue1(op ssa.Op, t ssa.Type, arg *ssa.Value) *ssa.Value {\n\treturn s.curBlock.NewValue1(s.peekLine(), op, t, arg)\n}", "title": "" }, { "docid": "577b0fd0aaf4ba2b90ed23988d5b1fa0", "score": "0.44028157", "text": "func (f tfunc[T]) True(val T) bool {\n\treturn f.f(val)\n}", "title": "" }, { "docid": "0742888c0d182252af51ba81fdc3a661", "score": "0.4382618", "text": "func (tvmval *Value) setValue(val interface{}) (retVal int32, err error) {\n retVal = KNull\n switch val.(type) {\n case string:\n tvmval.setVStr(val.(string))\n case uint8:\n tvmval.setVInt64(int64(val.(uint8)))\n case uint16:\n tvmval.setVInt64(int64(val.(uint16)))\n case uint32:\n tvmval.setVInt64(int64(val.(uint32)))\n case uint64:\n tvmval.setVInt64(int64(val.(uint64)))\n case int:\n tvmval.setVInt64(int64(val.(int)))\n case int8:\n tvmval.setVInt64(int64(val.(int8)))\n case int16:\n tvmval.setVInt64(int64(val.(int16)))\n case int32:\n tvmval.setVInt64(int64(val.(int32)))\n case int64:\n tvmval.setVInt64(val.(int64))\n case float32:\n tvmval.setVFloat64(float64(val.(float32)))\n case float64:\n tvmval.setVFloat64(val.(float64))\n case *Module:\n tvmval.setVMHandle(*(val.(*Module)))\n case *Function:\n tvmval.setVFHandle(*(val.(*Function)))\n case *ByteArray:\n tvmval.setVBHandle(*(val.(*ByteArray)))\n case []byte:\n barray := newByteArray(val.([]byte))\n tvmval.setVBHandle(barray)\n case *Array:\n tvmval.setVAHandle(*(val.(*Array)))\n case func (args ...*Value) (interface{}, error):\n fhandle, apierr := ConvertFunction(val)\n if apierr != nil {\n err = fmt.Errorf(\"Given value Type not defined for Value: %v : %T\", val, val);\n return\n }\n tvmval.setVFHandle(*fhandle)\n\n // Clear the finalizer as we don't need to control it anymore.\n runtime.SetFinalizer(fhandle, nil)\n case *Value:\n tvmval.moveFrom(val.(*Value))\n case Value:\n fromval := val.(Value)\n tvmval.moveFrom(&fromval)\n default:\n err = fmt.Errorf(\"Given value Type not defined for Value: %v : %T\", val, val);\n }\n retVal = tvmval.dtype\n return\n}", "title": "" }, { "docid": "c654151bde2558820f58cb71139e90ae", "score": "0.4381382", "text": "func Value(val interface{}) TValue {\n\treturn TValue{val}\n}", "title": "" }, { "docid": "0eeabf92b0333b5589b70347ba600fe7", "score": "0.4377656", "text": "func (c Const) Convert(t *vdl.Type) (Const, error) {\n\tif t == nil {\n\t\treturn Const{}, errConvertNil\n\t}\n\t// If we're trying to convert to Any or Union, or if c is already a vdl.Value,\n\t// use vdl.Convert to convert as a vdl.Value.\n\t_, isValue := c.rep.(*vdl.Value)\n\tif isValue || t.Kind() == vdl.Any || t.Kind() == vdl.Union {\n\t\tsrc, err := c.ToValue()\n\t\tif err != nil {\n\t\t\treturn Const{}, err\n\t\t}\n\t\tdst := vdl.ZeroValue(t)\n\t\tif err := vdl.Convert(dst, src); err != nil {\n\t\t\treturn Const{}, err\n\t\t}\n\t\treturn FromValue(dst), nil\n\t}\n\t// Otherwise use makeConst to convert as a Const.\n\treturn makeConst(c.rep, t)\n}", "title": "" }, { "docid": "e3d529ac43618ba508a269a9c6922666", "score": "0.43567944", "text": "func (x *Expr) asValue() func(t *vm.Thread) vm.Value {\n\tvar fct func(t *vm.Thread) vm.Value\n\tswitch ty := x.ExprType.Lit().(type) {\n\tcase *types.BoolType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\tb := values.BoolV(x.asBool()(t))\n\t\t\tvar val vm.Value = &b\n\t\t\treturn val\n\t\t}\n\tcase *types.UintType:\n\t\tv := x.asUint()\n\t\tswitch ty.Bits {\n\t\tcase 0:\n\t\t\tswitch ty.Ptr {\n\t\t\tcase true:\n\t\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\t\tvv := values.UintptrV(v(t))\n\t\t\t\t\tvar val vm.Value = &vv\n\t\t\t\t\treturn val\n\t\t\t\t}\n\t\t\tcase false:\n\t\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\t\tvv := values.UintV(v(t))\n\t\t\t\t\tvar val vm.Value = &vv\n\t\t\t\t\treturn val\n\t\t\t\t}\n\t\t\t}\n\t\tcase 8:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Uint8V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 16:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Uint16V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 32:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Uint32V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 64:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Uint64V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\t}\n\tcase *types.IntType:\n\t\tv := x.asInt()\n\t\tswitch ty.Bits {\n\t\tcase 0:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.IntV(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 8:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Int8V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 16:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Int16V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 32:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Int32V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 64:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Int64V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\t}\n\tcase *types.FloatType:\n\t\tv := x.asFloat()\n\t\tswitch ty.Bits {\n\t\tcase 32:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Float32V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\tcase 64:\n\t\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\t\tvv := values.Float64V(v(t))\n\t\t\t\treturn &vv\n\t\t\t}\n\t\t}\n\tcase *types.IdealIntType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\tv := x.asIdealInt()()\n\t\t\tvv := values.IdealIntV{V: v}\n\t\t\treturn &vv\n\t\t}\n\tcase *types.IdealFloatType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\tv := x.asIdealFloat()()\n\t\t\tvv := values.IdealFloatV{V: v}\n\t\t\treturn &vv\n\t\t}\n\tcase *types.StringType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\tv := x.asString()\n\t\t\tvv := values.StringV(v(t))\n\t\t\treturn &vv\n\t\t}\n\tcase *types.ArrayType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\tv := x.asArray()\n\t\t\tvv := v(t).Get(t)\n\t\t\treturn vv\n\t\t}\n\tcase *types.StructType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\tv := x.asStruct()\n\t\t\tvv := v(t).Get(t)\n\t\t\treturn vv\n\t\t}\n\tcase *types.PtrType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\treturn x.asPtr()(t)\n\t\t}\n\tcase *types.PackageType:\n\t\tfct = func(t *vm.Thread) vm.Value {\n\t\t\treturn x.asPackage()(t)\n\t\t}\n\tcase *types.FuncType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tcase *types.InterfaceType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tcase *types.SliceType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tcase *types.MapType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tcase *types.ChanType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tcase *types.NamedType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tcase *types.MultiType:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\tdefault:\n\t\tx.error(\"unhandled type: %v\", ty.String())\n\t}\n\treturn fct\n}", "title": "" }, { "docid": "2fb6313ad7235ad0a3a343d85f1e7a81", "score": "0.43227488", "text": "func ConvertibleTo(V, T Type) bool {\n\tx := operand{mode: value, typ: V}\n\treturn x.convertibleTo(nil, T, nil) // check not needed for non-constant x\n}", "title": "" }, { "docid": "1dea7d8e7d4434b9252a571644097f42", "score": "0.43143135", "text": "func copy(t reflect.Value, v reflect.Value) (err error) {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\t// If we paniced with an error\n\t\t\tif _, ok := r.(error); ok {\n\t\t\t\t// Cast the result to an error object\n\t\t\t\terr = r.(error)\n\t\t\t} else if _, ok := r.(string); ok {\n\t\t\t\t// Otherwise we could have paniced with a string so wrap it in an error\n\t\t\t\terr = errors.New(r.(string))\n\t\t\t}\n\t\t}\n\t}()\n\n\t// If we are copying from a string result to something else\n\tif v.Kind() == reflect.String && v.Type() != t.Type() {\n\t\tvar castVal interface{}\n\t\tvar casterr error\n\t\tvString := v.Interface().(string)\n\n\t\tswitch t.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tcastVal, casterr = strconv.ParseBool(vString)\n\t\tcase reflect.Int:\n\t\t\tcastVal, casterr = strconv.Atoi(vString)\n\t\tcase reflect.Int8:\n\t\t\tvar val64 int64\n\t\t\tval64, casterr = strconv.ParseInt(vString, 10, 8)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = int8(val64)\n\t\t\t}\n\t\tcase reflect.Int16:\n\t\t\tvar val64 int64\n\t\t\tval64, casterr = strconv.ParseInt(vString, 10, 16)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = int16(val64)\n\t\t\t}\n\t\tcase reflect.Int32:\n\t\t\tvar val64 int64\n\t\t\tval64, casterr = strconv.ParseInt(vString, 10, 32)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = int32(val64)\n\t\t\t}\n\t\tcase reflect.Int64:\n\t\t\tif t.Type() == reflect.TypeOf(time.Duration(0)) {\n\t\t\t\tcastVal, casterr = time.ParseDuration(vString)\n\t\t\t} else {\n\t\t\t\tcastVal, casterr = strconv.ParseInt(vString, 10, 64)\n\t\t\t}\n\t\tcase reflect.Uint:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 8)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint(val64)\n\t\t\t}\n\t\tcase reflect.Uint8:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 8)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint8(val64)\n\t\t\t}\n\t\tcase reflect.Uint16:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 16)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint16(val64)\n\t\t\t}\n\t\tcase reflect.Uint32:\n\t\t\tvar val64 uint64\n\t\t\tval64, casterr = strconv.ParseUint(vString, 10, 32)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = uint32(val64)\n\t\t\t}\n\t\tcase reflect.Uint64:\n\t\t\tcastVal, casterr = strconv.ParseUint(vString, 10, 64)\n\t\tcase reflect.Float32:\n\t\t\tvar val64 float64\n\t\t\tval64, casterr = strconv.ParseFloat(vString, 32)\n\t\t\tif casterr == nil {\n\t\t\t\tcastVal = float32(val64)\n\t\t\t}\n\t\tcase reflect.Float64:\n\t\t\tcastVal, casterr = strconv.ParseFloat(vString, 64)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Unable to convert from string to type %s\", t.Kind())\n\t\t}\n\n\t\tif casterr != nil {\n\t\t\treturn casterr\n\t\t}\n\n\t\tt.Set(reflect.ValueOf(castVal))\n\t\treturn\n\t}\n\n\tt.Set(v)\n\n\treturn\n}", "title": "" }, { "docid": "43b7aa487df20999ee3bab0b26549a6f", "score": "0.43110937", "text": "func convertToRawASN1(val interface{}, params string) (asn1.RawValue, error) {\n\tb, err := asn1.MarshalWithParams(val, params)\n\tif err != nil {\n\t\treturn asn1.NullRawValue, err\n\t}\n\tvar raw asn1.RawValue\n\t_, err = asn1.UnmarshalWithParams(b, &raw, params)\n\tif err != nil {\n\t\treturn asn1.NullRawValue, err\n\t}\n\treturn raw, nil\n}", "title": "" }, { "docid": "97b00f6d8cfe2da84814106da2eea5a0", "score": "0.4311083", "text": "func SingleValue[T constraints.Numeric](val T) map[string]float64 {\n\treturn map[string]float64{\n\t\tsingleValLabel: float64(val),\n\t}\n}", "title": "" }, { "docid": "b4e12afafb24cb33e7d025ae62482b04", "score": "0.43078682", "text": "func (t *T) Convert(in interface{}) (interface{}, error) {\n\torigValue := reflect.ValueOf(in)\n\tif !origValue.IsValid() {\n\t\treturn nil, nil\n\t}\n\tseenPointers := make(map[unsafe.Pointer]reflect.Value)\n\torigType := origValue.Type()\n\tfilteredType, err := t.mapType(origType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfilteredValue := reflect.New(filteredType).Elem()\n\tif err = t.convertValue(seenPointers, origValue, filteredValue); err != nil {\n\t\treturn nil, err\n\t}\n\treturn filteredValue.Interface(), nil\n}", "title": "" }, { "docid": "efeaa7be78d945195f8dbb71d8126815", "score": "0.43060738", "text": "func (c *Cfg) ValueToType(name string, result interface{}) error {\n\tif c.isEnv {\n\t\tvalue := os.Getenv(c.variablePrefix + name)\n\t\tif value == \"\" {\n\t\t\treturn nil\n\t\t}\n\n\t\terr := json.Unmarshal([]byte(value), result)\n\t\treturn errWithFile(c.FileName(), err)\n\t}\n\tvalue, ok := c.values[name]\n\tif !ok {\n\t\tif c.autoWrite {\n\t\t\tc.SetValue(name, result)\n\t\t\tc.Write()\n\t\t}\n\t\treturn nil\n\t}\n\n\t//marshall value\n\tj, err := json.Marshal(value)\n\tif err != nil {\n\t\treturn errWithFile(c.FileName(), err)\n\t}\n\n\terr = json.Unmarshal(j, result)\n\tif err != nil {\n\t\treturn errWithFile(c.FileName(), err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "30ebf1a2bbb29ba1f92bb0e9c19db44a", "score": "0.42993668", "text": "func (v Value) assignTo(context string, dst *rtype, target unsafe.Pointer) Value {\n\tif v.flag&flagMethod != 0 {\n\t\tv = makeMethodValue(context, v)\n\t}\n\n\tswitch {\n\tcase directlyAssignable(dst, v.typ):\n\t\t// Overwrite type so that they match.\n\t\t// Same memory layout, so no harm done.\n\t\tv.typ = dst\n\t\tfl := v.flag & (flagRO | flagAddr | flagIndir)\n\t\tfl |= flag(dst.Kind())\n\t\treturn Value{dst, v.ptr, fl}\n\n\tcase implements(dst, v.typ):\n\t\tif target == nil {\n\t\t\ttarget = unsafe_New(dst)\n\t\t}\n\t\tx := valueInterface(v, false)\n\t\tif dst.NumMethod() == 0 {\n\t\t\t*(*interface{})(target) = x\n\t\t} else {\n\t\t\tifaceE2I(dst, x, target)\n\t\t}\n\t\treturn Value{dst, target, flagIndir | flag(Interface)}\n\t}\n\n\t// Failed.\n\tpanic(context + \": value of type \" + v.typ.String() + \" is not assignable to type \" + dst.String())\n}", "title": "" }, { "docid": "6bbfe7eebc8bb8f8563bb94fa7ee898e", "score": "0.42965567", "text": "func ValueParseSetter[T any](value *Value[T], parse func(string) (T, error)) func(string, error) {\n\treturn func(val string, err error) {\n\t\tif err != nil {\n\t\t\t(*value) = NewErrorValue[T](err)\n\t\t} else {\n\t\t\t(*value) = NewValueFrom(parse(val))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c06ee82143a84a3fab98151e3273caf6", "score": "0.42962766", "text": "func Convert(v any, to reflect.Type) any {\n\tfrom := reflect.TypeOf(v)\n\treturn ConvertFn(from, to)(v)\n}", "title": "" }, { "docid": "19b20ca6d91ef0165642a970578a4ad9", "score": "0.4294458", "text": "func (s *state) entryNewValue1(op ssa.Op, t ssa.Type, arg *ssa.Value) *ssa.Value {\n\treturn s.f.Entry.NewValue1(s.peekLine(), op, t, arg)\n}", "title": "" }, { "docid": "2727a0dcfd2b3b04cadcaa360e5eb960", "score": "0.42698693", "text": "func (r *Rule) castValue(v interface{}) interface{} {\n\tif v == nil {\n\t\treturn nil\n\t}\n\n\tswitch r.Type {\n\tcase \"string\":\n\t\treturn toString(v)\n\tcase \"integer\":\n\t\treturn toInteger(v)\n\tcase \"double\":\n\t\treturn toDouble(v)\n\tcase \"date\":\n\t\treturn toDate(v)\n\tcase \"time\":\n\t\treturn toTime(v)\n\tcase \"datetime\":\n\t\treturn toDateTime(v)\n\tcase \"boolean\":\n\t\treturn toBoolean(v)\n\tdefault:\n\t\treturn v\n\t}\n}", "title": "" }, { "docid": "c3c3f7f52c46d15881f54cb00b842a58", "score": "0.42698234", "text": "func Value[T any](v *T) T {\n\tif v != nil {\n\t\treturn *v\n\t}\n\tvar zero T\n\treturn zero\n}", "title": "" }, { "docid": "ad7032a0fec636141e6e77bdf7497e9d", "score": "0.42239988", "text": "func valType(v reflect.Value) reflect.Type {\n\tt := v.Type()\n\tif t.Kind() == reflect.Ptr {\n\t\tt = t.Elem()\n\t}\n\treturn t\n}", "title": "" }, { "docid": "ff9d3cfd08ce75e5b47be5f5696ee34e", "score": "0.42239884", "text": "func (vt *valueType) newValue() interface{} {\n\treturn reflect.New(vt.vtype.Elem()).Interface()\n}", "title": "" }, { "docid": "f3a36265fb34e30da9f60a38b981c917", "score": "0.42214784", "text": "func (v Value) Convert(to Unit) (Value, error) {\n\t// allow converting to same unit\n\tif v.unit.Name == to.Name {\n\t\treturn v, nil\n\t}\n\n\treturn ConvertFloat(v.val, v.unit, to)\n}", "title": "" }, { "docid": "4ea193a4f5aba1e17c10281e0593df00", "score": "0.42210704", "text": "func (v *V8Context) ToValue(val interface{}) (*Value, error) {\n\tif fn, isFunction := val.(func(Loc, ...*Value) (*Value, error)); isFunction {\n\t\treturn v.CreateRawFunc(fn)\n\t}\n\tdata, err := json.Marshal(val)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Cannot marshal value as JSON: %v\\nVal: %#v\", err, val)\n\t}\n\treturn v.FromJSON(string(data))\n}", "title": "" }, { "docid": "67fc61c09338ee15c098dd8ed96208be", "score": "0.42147171", "text": "func (s *state) newValue1A(op ssa.Op, t ssa.Type, aux interface{}, arg *ssa.Value) *ssa.Value {\n\treturn s.curBlock.NewValue1A(s.peekLine(), op, t, aux, arg)\n}", "title": "" }, { "docid": "fc2dc196af5c66301b06746728949ab4", "score": "0.42014813", "text": "func (gen *Generator) AnonVal(t types.Info) Value {\n\n\tif t.Type == types.TPtr && t.ElementType == nil {\n\t\tpanic(\"pointer with nil element type\")\n\t}\n\n\tv, ok := gen.versions[anon]\n\tif !ok {\n\t\tv = Value{\n\t\t\tName: anon,\n\t\t}\n\t} else {\n\t\tv.Version = v.Version + 1\n\t}\n\tv.Type = t\n\tv.ID = gen.nextValueID()\n\tgen.versions[anon] = v\n\n\treturn v\n}", "title": "" }, { "docid": "01bfd0bdf6054a8e265ccc04d6ca5ddf", "score": "0.4195726", "text": "func tagToValue(schemaType string, v string) (interface{}, error) {\n\tswitch schemaType {\n\tcase \"integer\":\n\t\ti, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse value %s as %s:%s\", v, schemaType, err.Error())\n\t\t}\n\t\treturn i, nil\n\tcase \"number\":\n\t\tf, err := strconv.ParseFloat(v, 64)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse value %s as %s:%s\", v, schemaType, err.Error())\n\t\t}\n\t\treturn f, nil\n\tcase \"boolean\":\n\t\tswitch v {\n\t\tcase \"true\":\n\t\t\treturn true, nil\n\t\tcase \"false\":\n\t\t\treturn false, nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"failed to parse default value %s as %s\", v, schemaType)\n\t\t}\n\tcase \"string\":\n\t\treturn v, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown default value %s for type %s\", v, schemaType)\n\t}\n}", "title": "" }, { "docid": "f99cc55178afbba14beda8051c7c2201", "score": "0.41842175", "text": "func assignGenericCodecChecker(checkerVal reflect.Value, v any) {\n\tkeyVal := reflect.ValueOf(\"1\")\n\tvalPtr := reflect.ValueOf(v)\n\tval := valPtr.Elem()\n\n\tcheckerVal.Elem().Field(0).SetMapIndex(keyVal, valPtr)\n\tcheckerVal.Elem().Field(1).SetMapIndex(keyVal, val)\n\n\tcheckerVal.Elem().Field(2).Set(valPtr)\n\tcheckerVal.Elem().Field(3).Set(val)\n\n\tcheckerVal.Elem().Field(4).Index(0).Set(valPtr)\n\tcheckerVal.Elem().Field(5).Index(0).Set(val)\n\n\tcheckerVal.Elem().Field(6).Index(0).Set(valPtr)\n\tcheckerVal.Elem().Field(7).Index(0).Set(val)\n}", "title": "" }, { "docid": "e1ba9d241a044a31864c00795a8fcb5b", "score": "0.41834006", "text": "func (s *state) entryNewValue1A(op ssa.Op, t ssa.Type, aux interface{}, arg *ssa.Value) *ssa.Value {\n\treturn s.f.Entry.NewValue1A(s.peekLine(), op, t, aux, arg)\n}", "title": "" }, { "docid": "c137c889b7420e3224cd72c24a167f63", "score": "0.41822934", "text": "func coerceTo(v1, v2 sqltypes.Type) (sqltypes.Type, error) {\n\tif v1 == v2 {\n\t\treturn v1, nil\n\t}\n\tif sqltypes.IsNull(v1) || sqltypes.IsNull(v2) {\n\t\treturn sqltypes.Null, nil\n\t}\n\tif (sqltypes.IsText(v1) || sqltypes.IsBinary(v1)) && (sqltypes.IsText(v2) || sqltypes.IsBinary(v2)) {\n\t\treturn sqltypes.VarChar, nil\n\t}\n\tif sqltypes.IsDateOrTime(v1) {\n\t\treturn v1, nil\n\t}\n\tif sqltypes.IsDateOrTime(v2) {\n\t\treturn v2, nil\n\t}\n\n\tif sqltypes.IsNumber(v1) || sqltypes.IsNumber(v2) {\n\t\tswitch {\n\t\tcase sqltypes.IsText(v1) || sqltypes.IsBinary(v1) || sqltypes.IsText(v2) || sqltypes.IsBinary(v2):\n\t\t\treturn sqltypes.Float64, nil\n\t\tcase sqltypes.IsFloat(v2) || v2 == sqltypes.Decimal || sqltypes.IsFloat(v1) || v1 == sqltypes.Decimal:\n\t\t\treturn sqltypes.Float64, nil\n\t\tcase sqltypes.IsSigned(v1):\n\t\t\tswitch {\n\t\t\tcase sqltypes.IsUnsigned(v2):\n\t\t\t\treturn sqltypes.Uint64, nil\n\t\t\tcase sqltypes.IsSigned(v2):\n\t\t\t\treturn sqltypes.Int64, nil\n\t\t\tdefault:\n\t\t\t\treturn 0, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, \"types does not support hashcode yet: %v vs %v\", v1, v2)\n\t\t\t}\n\t\tcase sqltypes.IsUnsigned(v1):\n\t\t\tswitch {\n\t\t\tcase sqltypes.IsSigned(v2) || sqltypes.IsUnsigned(v2):\n\t\t\t\treturn sqltypes.Uint64, nil\n\t\t\tdefault:\n\t\t\t\treturn 0, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, \"types does not support hashcode yet: %v vs %v\", v1, v2)\n\t\t\t}\n\t\t}\n\t}\n\treturn 0, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, \"types does not support hashcode yet: %v vs %v\", v1, v2)\n}", "title": "" }, { "docid": "437fbb97df543bdbaf080696b5501c5e", "score": "0.4177047", "text": "func (r Real) Convert(v reflect.Value) error {\n\tt := v.Type()\n\tswitch {\n\tcase t.Kind() == reflect.Float64:\n\t\tif r.Valid {\n\t\t\tv.Set(reflect.ValueOf(r.Value))\n\t\t}\n\t\treturn nil\n\tcase t.ConvertibleTo(reflect.TypeOf(new(float64))):\n\t\tif r.Valid {\n\t\t\ti := &r.Value\n\t\t\tv.Set(reflect.ValueOf(i))\n\t\t}\n\t\treturn nil\n\tcase t.ConvertibleTo(reflect.TypeOf(Real{})):\n\t\tv.Set(reflect.ValueOf(r))\n\t\treturn nil\n\tcase t.ConvertibleTo(reflect.TypeOf(&Real{})):\n\t\tv.Set(reflect.ValueOf(&r))\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"Column was type Kusto.Real, receiver had base Kind %s \", t.Kind())\n}", "title": "" }, { "docid": "99064764cc7ff00eb11c9e761f301bba", "score": "0.41756985", "text": "func convertOp(dst, src *rtype) func(Value, Type) Value {\n\tswitch src.Kind() {\n\tcase Int, Int8, Int16, Int32, Int64:\n\t\tswitch dst.Kind() {\n\t\tcase Int, Int8, Int16, Int32, Int64, Uint, Uint8, Uint16, Uint32, Uint64, Uintptr:\n\t\t\treturn cvtInt\n\t\tcase Float32, Float64:\n\t\t\treturn cvtIntFloat\n\t\tcase String:\n\t\t\treturn cvtIntString\n\t\t}\n\n\tcase Uint, Uint8, Uint16, Uint32, Uint64, Uintptr:\n\t\tswitch dst.Kind() {\n\t\tcase Int, Int8, Int16, Int32, Int64, Uint, Uint8, Uint16, Uint32, Uint64, Uintptr:\n\t\t\treturn cvtUint\n\t\tcase Float32, Float64:\n\t\t\treturn cvtUintFloat\n\t\tcase String:\n\t\t\treturn cvtUintString\n\t\t}\n\n\tcase Float32, Float64:\n\t\tswitch dst.Kind() {\n\t\tcase Int, Int8, Int16, Int32, Int64:\n\t\t\treturn cvtFloatInt\n\t\tcase Uint, Uint8, Uint16, Uint32, Uint64, Uintptr:\n\t\t\treturn cvtFloatUint\n\t\tcase Float32, Float64:\n\t\t\treturn cvtFloat\n\t\t}\n\n\tcase Complex64, Complex128:\n\t\tswitch dst.Kind() {\n\t\tcase Complex64, Complex128:\n\t\t\treturn cvtComplex\n\t\t}\n\n\tcase String:\n\t\tif dst.Kind() == Slice && dst.Elem().PkgPath() == \"\" {\n\t\t\tswitch dst.Elem().Kind() {\n\t\t\tcase Uint8:\n\t\t\t\treturn cvtStringBytes\n\t\t\tcase Int32:\n\t\t\t\treturn cvtStringRunes\n\t\t\t}\n\t\t}\n\n\tcase Slice:\n\t\tif dst.Kind() == String && src.Elem().PkgPath() == \"\" {\n\t\t\tswitch src.Elem().Kind() {\n\t\t\tcase Uint8:\n\t\t\t\treturn cvtBytesString\n\t\t\tcase Int32:\n\t\t\t\treturn cvtRunesString\n\t\t\t}\n\t\t}\n\t}\n\n\t// dst and src have same underlying type.\n\tif haveIdenticalUnderlyingType(dst, src) {\n\t\treturn cvtDirect\n\t}\n\n\t// dst and src are unnamed pointer types with same underlying base type.\n\tif dst.Kind() == Ptr && dst.Name() == \"\" &&\n\t\tsrc.Kind() == Ptr && src.Name() == \"\" &&\n\t\thaveIdenticalUnderlyingType(dst.Elem().common(), src.Elem().common()) {\n\t\treturn cvtDirect\n\t}\n\n\tif implements(dst, src) {\n\t\tif src.Kind() == Interface {\n\t\t\treturn cvtI2I\n\t\t}\n\t\treturn cvtT2I\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d4f08545e5af067f952da8f2b5baf058", "score": "0.4172451", "text": "func cvtI2I(v Value, typ Type) Value {\n\tif v.IsNil() {\n\t\tret := Zero(typ)\n\t\tret.flag |= v.flag & flagRO\n\t\treturn ret\n\t}\n\treturn cvtT2I(v.Elem(), typ)\n}", "title": "" }, { "docid": "e8e070f9f2952ab565ca8215c25d0b9a", "score": "0.41547513", "text": "func Convert(val interface{}, target *FieldType) (v interface{}, err error) {\n\td := NewDatum(val)\n\tsc := new(stmtctx.StatementContext)\n\tsc.TimeZone = time.UTC\n\tret, err := d.ConvertTo(sc, target)\n\tif err != nil {\n\t\treturn ret.GetValue(), errors.Trace(err)\n\t}\n\treturn ret.GetValue(), nil\n}", "title": "" }, { "docid": "ec6dc3e4c5af601dfcc885280a5be85f", "score": "0.41477564", "text": "func Add1[T ~int | float64](a, b T) T {\n\treturn a + b\n}", "title": "" }, { "docid": "d1180fbe1fcf73d80ed0240467ba4baf", "score": "0.41413164", "text": "func (fgen *funcGen) liftValue(v value.Value) ast.Expr {\n\tswitch v := v.(type) {\n\tcase namedValue:\n\t\treturn newIdent(v)\n\tcase *constant.Int:\n\t\treturn &ast.BasicLit{Kind: token.INT, Value: v.X.String()}\n\tdefault:\n\t\tpanic(fmt.Errorf(\"support for value %T not yet implemented\", v))\n\t}\n}", "title": "" }, { "docid": "b2931d094dfc65214c2ef0e4f7ec5ed7", "score": "0.41365713", "text": "func (s *state) newValue1I(op ssa.Op, t ssa.Type, aux int64, arg *ssa.Value) *ssa.Value {\n\treturn s.curBlock.NewValue1I(s.peekLine(), op, t, aux, arg)\n}", "title": "" }, { "docid": "fd97f021e6bdf7c64b900441df55e000", "score": "0.41285416", "text": "func assignTo(rv reflect.Value, jv js.Value) (reflect.Value, error) {\n\tif jv.Equal(js.Null()) || jv.Equal(js.Undefined()) {\n\t\treturn zero, nil\n\t}\n\n\tk := rv.Kind()\n\tswitch k {\n\tcase reflect.Ptr:\n\t\treturn assignToPointer(rv, jv)\n\tcase reflect.Interface:\n\t\tif e := rv.Elem(); e != zero {\n\t\t\treturn assignToInterface(rv, e, jv)\n\t\t}\n\t}\n\n\tswitch t := jv.Type(); t {\n\tcase js.TypeBoolean:\n\t\treturn assignToBasic(rv, jv.Bool(), t)\n\tcase js.TypeNumber:\n\t\treturn assignToBasic(rv, jv.Float(), t)\n\tcase js.TypeString:\n\t\treturn assignToBasic(rv, jv.String(), t)\n\tcase js.TypeObject:\n\t\treturn assignToValue(rv, jv)\n\tdefault:\n\t\treturn zero, &InvalidAssignmentError{Type: t, Kind: k}\n\t}\n}", "title": "" }, { "docid": "9c2540d48826bf9f73f9a8a8ce54b964", "score": "0.4124825", "text": "func (tvmval *Value) moveFrom(fromval *Value) () {\n C.memcpy(unsafe.Pointer(tvmval.nativeCPtr()),\n unsafe.Pointer(fromval.nativeCPtr()),\n C.sizeof_TVMValue)\n\n // Move the dtype too.\n tvmval.dtype = fromval.dtype\n fromval.dtype = KNull\n return\n}", "title": "" }, { "docid": "b58c60ce30019d74c46cf8aa5b924b95", "score": "0.41245437", "text": "func (m *Merger) OneValue(curr []ast.Value, more ...ast.Value) (ast.Value, error) {\n\tif m == nil {\n\t\treturn nil, errs.New(\"merger strategy was nil\")\n\t}\n\n\t// escape hatch when no calculation is needed\n\tall := append(curr, more...)\n\tif n := len(all); n == 0 {\n\t\treturn nil, nil\n\t} else if n == 1 {\n\t\treturn all[0], nil\n\t}\n\n\tvar errSet error\n\n\t// merge properties\n\n\tswitch all[0].(type) {\n\tcase *ast.BooleanValue:\n\t\tvar set []*ast.BooleanValue\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.BooleanValue)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.BooleanValue but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneBooleanValue(set)\n\tcase *ast.EnumValue:\n\t\tvar set []*ast.EnumValue\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.EnumValue)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.EnumValue but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneEnumValue(set)\n\tcase *ast.FloatValue:\n\t\tvar set []*ast.FloatValue\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.FloatValue)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.FloatValue but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneFloatValue(set)\n\tcase *ast.IntValue:\n\t\tvar set []*ast.IntValue\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.IntValue)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.IntValue but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneIntValue(set)\n\tcase *ast.ObjectField:\n\t\tvar set []*ast.ObjectField\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.ObjectField)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.ObjectField but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneObjectField(set)\n\tcase *ast.ObjectValue:\n\t\tvar set []*ast.ObjectValue\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.ObjectValue)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.ObjectValue but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneObjectValue(set)\n\tcase *ast.StringValue:\n\t\tvar set []*ast.StringValue\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.StringValue)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.StringValue but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneStringValue(set)\n\tcase *ast.Variable:\n\t\tvar set []*ast.Variable\n\t\tfor _, single := range all {\n\t\t\tv, ok := single.(*ast.Variable)\n\t\t\tif !ok {\n\t\t\t\terrSet = errs.Append(errSet, errs.Newf(\"want *ast.Variable but got type %T\", single))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tset = append(set, v)\n\t\t}\n\t\treturn m.OneVariable(set)\n\tdefault:\n\t\terrSet = errs.Append(errSet, errs.Newf(\"type %T unknown\", all[0]))\n\t}\n\n\treturn nil, errSet\n\n}", "title": "" }, { "docid": "1c478acf785843d4c9296bac359c6067", "score": "0.41090262", "text": "func (tv TypedValue) Merge(pso *TypedValue) (*TypedValue, error) {\n\treturn merge(&tv, pso, ruleKeepRHS, nil)\n}", "title": "" }, { "docid": "e26f53dcb6c023c2bdc8555e3bc54775", "score": "0.41057476", "text": "func (c Const) ToValue() (*vdl.Value, error) { //nolint:gocyclo\n\tif c.rep == nil {\n\t\treturn nil, errInvalidConst\n\t}\n\t// All const defs must have a type. We implicitly assign bool and string, but\n\t// the user must explicitly assign a type for numeric consts.\n\tif c.repType == nil {\n\t\tswitch c.rep.(type) {\n\t\tcase bool:\n\t\t\tc.repType = vdl.BoolType\n\t\tcase string:\n\t\t\tc.repType = vdl.StringType\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"%s must be assigned a type\", c)\n\t\t}\n\t}\n\t// Create a value of the appropriate type.\n\tvx := vdl.ZeroValue(c.repType)\n\tswitch trep := c.rep.(type) {\n\tcase bool:\n\t\tif vx.Kind() == vdl.Bool {\n\t\t\tvx.AssignBool(trep)\n\t\t\treturn vx, nil\n\t\t}\n\tcase string:\n\t\tswitch {\n\t\tcase vx.Kind() == vdl.String:\n\t\t\tvx.AssignString(trep)\n\t\t\treturn vx, nil\n\t\tcase vx.Type().IsBytes():\n\t\t\tif vx.Kind() == vdl.Array {\n\t\t\t\tif vx.Len() != len(trep) {\n\t\t\t\t\treturn nil, fmt.Errorf(\"%s has a different length than %v\", c, vx.Type())\n\t\t\t\t}\n\t\t\t}\n\t\t\tvx.AssignBytes([]byte(trep))\n\t\t\treturn vx, nil\n\t\t}\n\tcase *big.Int:\n\t\tswitch vx.Kind() {\n\t\tcase vdl.Byte, vdl.Uint16, vdl.Uint32, vdl.Uint64:\n\t\t\tvx.AssignUint(trep.Uint64())\n\t\t\treturn vx, nil\n\t\tcase vdl.Int8, vdl.Int16, vdl.Int32, vdl.Int64:\n\t\t\tvx.AssignInt(trep.Int64())\n\t\t\treturn vx, nil\n\t\t}\n\tcase *big.Rat:\n\t\tswitch vx.Kind() {\n\t\tcase vdl.Float32, vdl.Float64:\n\t\t\tf64, _ := trep.Float64()\n\t\t\tvx.AssignFloat(f64)\n\t\t\treturn vx, nil\n\t\t}\n\tcase *vdl.Value:\n\t\treturn trep, nil\n\t}\n\t// Type mismatches shouldn't occur, since makeConst always ensures the rep and\n\t// repType are in sync. If something's wrong we want to know about it.\n\tpanic(fmt.Errorf(\"val: mismatched const rep type for %v\", c))\n}", "title": "" }, { "docid": "5bd1463ce8eb879cedaa2f15b2cce4ca", "score": "0.41023633", "text": "func realvalue(value interface{}) interface{} {\n\n\tif isnil(value) {\n\t\treturn nil\n\t}\n\n\tvar ret interface{}\n\n\tswitch t := value.(type) {\n\tcase *interface{}:\n\t\tv2 := *t\n\t\tif v2 != nil {\n\t\t\t// we stop checking the *interface{} here\n\t\t\tswitch t2 := v2.(type) {\n\t\t\tdefault:\n\t\t\t\tret = getv(t2)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tret = getv(t)\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "9c22a988a0d984d2aa6dfb58001e0988", "score": "0.40959227", "text": "func (v *Value) Assign(x *Value) *Value {\n\t// The logic here mirrors our definition of Type.AssignableFrom.\n\tswitch {\n\tcase x == nil:\n\t\t// Assign(nil) sets the zero value.\n\t\tif v.t.kind == Byte {\n\t\t\t// Use AssignUint to handle both the value and pointer cases.\n\t\t\tv.AssignUint(0)\n\t\t} else {\n\t\t\tv.rep = zeroRep(v.t)\n\t\t}\n\tcase v.t == x.t:\n\t\tif v.t.kind == Byte {\n\t\t\t// Use AssignUint to handle both the value and pointer cases.\n\t\t\tv.AssignUint(x.Uint())\n\t\t} else {\n\t\t\t// Types are identical, v is assigned a copy of the underlying rep.\n\t\t\tv.rep = copyRep(x.t, x.rep)\n\t\t}\n\tcase v.t.kind == Any:\n\t\t// Assigning into Any, v is assigned a copy of the value.\n\t\tv.rep = CopyValue(x)\n\tcase v.t.kind == Optional && x.t.kind == Any && x.IsNil():\n\t\t// Assigning into Optional from Any(nil), v is reset to nil.\n\t\tv.rep = (*Value)(nil)\n\tdefault:\n\t\tpanic(fmt.Errorf(\"vdl: value of type %q not assignable from %q\", v.t, x.t))\n\t}\n\treturn v\n}", "title": "" }, { "docid": "ac5dde474e52e147e14db82e41ceac1b", "score": "0.40882576", "text": "func convertToRefVal(outValueObj interface{}) (ref.Val, error) {\n\n\toutValueVal := reflect.ValueOf(outValueObj)\n\toutValueType := outValueVal.Type()\n\toutValueKind := outValueType.Kind()\n\tif outValueKind == reflect.Map {\n\t\treturn types.NewDynamicMap(types.DefaultTypeAdapter, outValueObj), nil\n\t} else if outValueKind == reflect.Array || outValueKind == reflect.Slice {\n\t\treturn types.NewDynamicList(types.DefaultTypeAdapter, outValueObj), nil\n\t}\n\n\tvar ret ref.Val // return value\n\tvar err error = nil\n\tswitch outValueObj.(type) {\n\tcase bool:\n\t\tret = types.Bool(outValueObj.(bool))\n\tcase int64:\n\t\tret = types.Int(outValueObj.(int64))\n\tcase float64:\n\t\tret = types.Double(outValueObj.(float64))\n\tcase string:\n\t\tret = types.String(outValueObj.(string))\n\tcase ref.Val:\n\t\tret = outValueObj.(ref.Val)\n\tdefault:\n\t\tret = nil\n\t\terr = fmt.Errorf(\"unable to convert %v of type %T to ref.Val\", outValueObj, outValueObj)\n\t}\n\treturn ret, err\n}", "title": "" }, { "docid": "8d00a3c760a2e7ae9f41f0c1f1593112", "score": "0.408709", "text": "func (c converter) ConvertValue(v interface{}) (driver.Value, error) {\n\n\tif driver.IsValue(v) {\n\t\treturn v, nil\n\t}\n\n\tif vr, ok := v.(driver.Valuer); ok {\n\t\tsv, err := callValuerValue(vr)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !driver.IsValue(sv) {\n\t\t\treturn nil, fmt.Errorf(\"non-Value type %T returned from Value\", sv)\n\t\t}\n\n\t\treturn sv, nil\n\t}\n\n\trv := reflect.ValueOf(v)\n\tswitch rv.Kind() {\n\tcase reflect.Ptr:\n\t\t// indirect pointers\n\t\tif rv.IsNil() {\n\t\t\treturn nil, nil\n\t\t} else {\n\t\t\treturn c.ConvertValue(rv.Elem().Interface())\n\t\t}\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\treturn rv.Int(), nil\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\treturn rv.Uint(), nil\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn rv.Float(), nil\n\tcase reflect.Bool:\n\t\treturn rv.Bool(), nil\n\tcase reflect.Slice:\n\t\tek := rv.Type().Elem().Kind()\n\t\tif ek == reflect.Uint8 {\n\t\t\treturn rv.Bytes(), nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"unsupported type %T, a slice of %s\", v, ek)\n\tcase reflect.String:\n\t\treturn rv.String(), nil\n\t}\n\treturn nil, fmt.Errorf(\"unsupported type %T, a %s\", v, rv.Kind())\n}", "title": "" }, { "docid": "de56310fa4860d0117ec0d5a289cbab7", "score": "0.40837806", "text": "func (b *dynValueBuilder) assign(val interface{}) error {\n\tif b.mb != nil {\n\t\treturn valueNotAssignableToType(model.MapType, val)\n\t}\n\tif b.lb != nil {\n\t\treturn valueNotAssignableToType(model.ListType, val)\n\t}\n\tvar dv interface{}\n\tswitch v := val.(type) {\n\tcase bool, float64, int64, string, uint64,\n\t\t*model.MultilineStringValue, model.PlainTextValue, types.Null, time.Time:\n\t\tdv = v\n\tdefault:\n\t\treturn valueNotAssignableToType(model.AnyType, v)\n\t}\n\treturn b.dyn.SetValue(dv)\n}", "title": "" }, { "docid": "406e09875c87a2152aafd7fca1a288f6", "score": "0.40796688", "text": "func getVal(val interface{}) *protos.Value {\n\tswitch val.(type) {\n\tcase int:\n\t\treturn &protos.Value{Val: &protos.Value_IntVal{IntVal: int64(val.(int))}}\n\tcase string:\n\t\tif val.(string) == \"\" {\n\t\t\treturn nil\n\t\t}\n\t\treturn &protos.Value{Val: &protos.Value_StrVal{StrVal: strings.Replace(val.(string), \"\\\"\", \"\\\\\\\"\", -1)}}\n\tcase float64:\n\t\treturn &protos.Value{Val: &protos.Value_DoubleVal{DoubleVal: val.(float64)}}\n\tcase time.Time:\n\t\treturn &protos.Value{Val: &protos.Value_DatetimeVal{DatetimeVal: []byte(val.(time.Time).String())}}\n\tcase bool:\n\t\treturn &protos.Value{Val: &protos.Value_BoolVal{BoolVal: val.(bool)}}\n\tcase []byte:\n\t\treturn &protos.Value{Val: &protos.Value_BytesVal{BytesVal: val.([]byte)}}\n\tcase *GeoPoint:\n\t\treturn &protos.Value{Val: &protos.Value_GeoVal{GeoVal: []byte(*(val.(*GeoPoint).Json()))}}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1b3f514e0c68b31fec9bc41106e822ba", "score": "0.40703124", "text": "func (o output) Val() interface{} { return o.value }", "title": "" }, { "docid": "43aa21d875a7c0c2c92c68fbe4c2d2cd", "score": "0.40683788", "text": "func ValPack(val interface{}) ([]byte, error) {\n\n\tbuf := new(bytes.Buffer)\n\n\tvar err error\n\n\tswitch v := val.(type) {\n\tcase int64:\n\t\tbuf.WriteByte(0x01)\n\t\terr = binary.Write(buf, binary.BigEndian, v)\n\tcase int:\n\t\tbuf.WriteByte(0x01)\n\t\terr = binary.Write(buf, binary.BigEndian, int64(v))\n\tcase float64:\n\t\tbuf.WriteByte(0x02)\n\t\terr = binary.Write(buf, binary.BigEndian, v)\n\tcase float32:\n\t\tbuf.WriteByte(0x02)\n\t\terr = binary.Write(buf, binary.BigEndian, float64(v))\n\tcase string:\n\t\tbuf.WriteByte(0x03)\n\t\t_, err = buf.WriteString(v)\n\tdefault:\n\t\terr = fmt.Errorf(\"fdb-vector unencodable element (%v, type %T)\", v, v)\n\t}\n\n\treturn buf.Bytes(), err\n}", "title": "" }, { "docid": "04f7c7c9d5feb83cf19a2e7aca0a2fcb", "score": "0.40632927", "text": "func (s *state) entryNewValue1I(op ssa.Op, t ssa.Type, auxint int64, arg *ssa.Value) *ssa.Value {\n\treturn s.f.Entry.NewValue1I(s.peekLine(), op, t, auxint, arg)\n}", "title": "" }, { "docid": "273e3ca40de841cca8e03cf0cedaf649", "score": "0.40616727", "text": "func (c *Cache) V1(v ...interface{}) interface{} {\n\tif len(v) > 0 {\n\t\tc.v1 = v[0]\n\t}\n\treturn c.v1\n}", "title": "" }, { "docid": "2dae1048cda0a9a8e208eb2d93159a04", "score": "0.40611422", "text": "func ConvertFunc(to int) Converter {\r\n\treturn func(value interface{}) (interface{}, error) {\r\n\t\tv := reflect.ValueOf(value)\r\n\t\tswitch v.Kind() {\r\n\r\n\t\tcase reflect.String:\r\n\t\t\treturn FromStringTo(value.(string), to)\r\n\r\n\t\tcase reflect.Int64:\r\n\t\t\treturn FromInt64To(value.(int64), to)\r\n\r\n\t\tcase reflect.Float64:\r\n\t\t\treturn FromFloat64To(value.(float64), to)\r\n\r\n\t\tcase reflect.Bool:\r\n\t\t\treturn FromBoolTo(value.(bool), to)\r\n\r\n\t\t}\r\n\t\treturn 0, errors.New(\"Unknown source type\")\r\n\t}\r\n}", "title": "" }, { "docid": "1abfea66ca567fe67c9439395d2c03bf", "score": "0.406077", "text": "func Ternary(vt interface{}, vf interface{}, v bool) interface{} {\n\tif v {\n\t\treturn vt\n\t}\n\treturn vf\n}", "title": "" }, { "docid": "a761b3f6d27d854e3cfa4754a1e0c68f", "score": "0.40602207", "text": "func makeValue(t hm.Type, s tensor.Shape) (retVal value.Value, err error) {\n\tvar dt tensor.Dtype\n\tif dt, err = dtypeOf(t); err != nil {\n\t\treturn\n\t}\n\n\tif s.IsScalar() {\n\t\tswitch dt {\n\t\tcase tensor.Float64:\n\t\t\treturn value.NewF64(0), nil\n\t\tcase tensor.Float32:\n\t\t\treturn value.NewF32(0), nil\n\t\tcase tensor.Int:\n\t\t\treturn value.NewI(0), nil\n\t\tcase tensor.Int64:\n\t\t\treturn value.NewI64(0), nil\n\t\tcase tensor.Int32:\n\t\t\treturn value.NewI32(0), nil\n\t\tcase tensor.Byte:\n\t\t\treturn value.NewU8(0), nil\n\t\tcase tensor.Bool:\n\t\t\treturn value.NewB(false), nil\n\t\t}\n\t}\n\n\tswitch tt := t.(type) {\n\tcase constructor.TensorType:\n\t\treturn tensor.New(tensor.Of(dt), tensor.WithShape(s...)), nil\n\tdefault:\n\t\terr = errors.Errorf(nyiTypeFail, \"MakeValue\", tt)\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "751872a230322d7857fdb4c7448d9ae9", "score": "0.4056864", "text": "func assignToBasic(b reflect.Value, i interface{}, t js.Type) (val reflect.Value, err error) {\n\tdefer func() {\n\t\tif rec := recover(); rec != nil {\n\t\t\terr = &InvalidAssignmentError{Type: t, Kind: b.Kind()}\n\t\t}\n\t}()\n\n\tv := reflect.ValueOf(i)\n\tval = v.Convert(b.Type())\n\treturn\n}", "title": "" }, { "docid": "02aa013dcef5890e6a738bdcc42aa6e3", "score": "0.4046258", "text": "func assignToValue(rv reflect.Value, jv js.Value) (reflect.Value, error) {\n\tswitch k := rv.Kind(); k {\n\tcase reflect.Struct:\n\t\treturn assignToStruct(rv, jv)\n\tcase reflect.Map:\n\t\treturn assignToMap(rv, jv)\n\tcase reflect.Slice:\n\t\treturn assignToSlice(rv, jv)\n\tdefault:\n\t\treturn zero, &InvalidAssignmentError{Type: jv.Type(), Kind: k}\n\t}\n}", "title": "" }, { "docid": "5957029a22d7ba0bbdf8f80e69e62b81", "score": "0.404475", "text": "func Get[T any](v *Value[T]) T {\n\treturn v.val\n}", "title": "" }, { "docid": "20b95bd17c48129a4a7ce2c6180e5128", "score": "0.40348765", "text": "func float64ToType(val float64, ftype FieldType) (interface{}, error) {\n\tswitch ftype {\n\tcase FieldTypeInt8:\n\t\treturn int8(val), nil\n\tcase FieldTypeNullableInt8:\n\t\tc := int8(val)\n\t\treturn &c, nil\n\tcase FieldTypeInt16:\n\t\treturn int16(val), nil\n\tcase FieldTypeNullableInt16:\n\t\tc := int16(val)\n\t\treturn &c, nil\n\tcase FieldTypeInt32:\n\t\treturn int32(val), nil\n\tcase FieldTypeNullableInt32:\n\t\tc := int32(val)\n\t\treturn &c, nil\n\tcase FieldTypeInt64:\n\t\treturn int64(val), nil\n\tcase FieldTypeNullableInt64:\n\t\tc := int64(val)\n\t\treturn &c, nil\n\tcase FieldTypeUint8:\n\t\treturn uint8(val), nil\n\tcase FieldTypeNullableUint8:\n\t\tc := uint8(val)\n\t\treturn &c, nil\n\tcase FieldTypeUint16:\n\t\treturn uint16(val), nil\n\tcase FieldTypeNullableUint16:\n\t\tc := uint16(val)\n\t\treturn &c, nil\n\tcase FieldTypeUint32:\n\t\treturn uint32(val), nil\n\tcase FieldTypeNullableUint32:\n\t\tc := uint32(val)\n\t\treturn &c, nil\n\tcase FieldTypeUint64:\n\t\treturn uint64(val), nil\n\tcase FieldTypeNullableUint64:\n\t\tc := uint64(val)\n\t\treturn &c, nil\n\tcase FieldTypeFloat32:\n\t\treturn float32(val), nil\n\tcase FieldTypeNullableFloat32:\n\t\tc := float32(val)\n\t\treturn &c, nil\n\tcase FieldTypeFloat64:\n\t\treturn val, nil\n\tcase FieldTypeNullableFloat64:\n\t\treturn &val, nil\n\t}\n\t// if field type is FieldTypeString, FieldTypeNullableString, FieldTypeBool, FieldTypeNullableBool, FieldTypeTime, FieldTypeNullableTime\n\treturn val, fmt.Errorf(\"no numeric value\")\n}", "title": "" }, { "docid": "7e0cbcd1c2d5e6c8682213cfcdfa6c3d", "score": "0.40341225", "text": "func (v *LLVMValue) convertE2V(typ types.Type) (result, success *LLVMValue) {\n\tc := v.compiler\n\tf := c.runtime.convertE2V.LLVMValue()\n\trtyp := c.types.ToRuntime(typ)\n\tstackptr := c.stacksave()\n\tptr := c.builder.CreateAlloca(c.types.ToLLVM(typ), \"\")\n\targs := []llvm.Value{\n\t\tcoerce(c.builder, v.LLVMValue(), c.runtime.eface.llvm),\n\t\tc.builder.CreatePtrToInt(rtyp, c.target.IntPtrType(), \"\"),\n\t\tc.builder.CreatePtrToInt(ptr, c.target.IntPtrType(), \"\"),\n\t}\n\tsucc := c.builder.CreateCall(f, args, \"\")\n\tres := c.builder.CreateLoad(ptr, \"\")\n\tc.stackrestore(stackptr)\n\treturn c.NewValue(res, typ), c.NewValue(succ, types.Typ[types.Bool])\n}", "title": "" }, { "docid": "e248ff06058306213b503ca4093070dd", "score": "0.40104932", "text": "func (v *Value) ToInt() (val int64, ok bool) {\n\tswitch v.vType {\n\tcase typeInt:\n\t\tval, ok = v.value.(int64)\n\tdefault:\n\t}\n\treturn\n}", "title": "" }, { "docid": "154301dded845249a154deab3236e332", "score": "0.40088275", "text": "func ReduceT(sequence ...T) (Interface, error) {\n\tif len(sequence) == 0 {\n\t\treturn nil, errors.New(\"convert me\")\n\t}\n\treturn reducer(sequence), nil\n}", "title": "" }, { "docid": "9add9fdf58df5ce1843370c3d3b98749", "score": "0.4007661", "text": "func cvtFloat(v Value, t Type) Value {\n\treturn makeFloat(v.flag&flagRO, v.Float(), t)\n}", "title": "" }, { "docid": "2055c227f32aedd6beeefb9c64c5fed9", "score": "0.40033296", "text": "func Value(v interface{}) ArgFunc { return func(a *arg) { a.v = v } }", "title": "" }, { "docid": "64a455f89290a3caf7fa01bda983847c", "score": "0.4001336", "text": "func (v *Value) AssignTypeObject(x *Type) {\n\tif v.t.kind != TypeObject {\n\t\tv.t.panicErrKind(\"AssignTypeObject\", TypeObject)\n\t}\n\tif x == nil {\n\t\tx = zeroTypeObject\n\t}\n\tv.rep = x\n}", "title": "" }, { "docid": "c9fe2fc5e6643d57b6706e206bb02dca", "score": "0.39776257", "text": "func toValue(val *big.Int) interface{} {\n\t// Let's assume a string on right padded zero's\n\tb := val.Bytes()\n\tif b[0] != 0 && b[len(b)-1] == 0x0 && b[len(b)-2] == 0x0 {\n\t\treturn string(b)\n\t}\n\n\treturn val\n}", "title": "" }, { "docid": "810053884560c87113747a17ff90fde8", "score": "0.39735", "text": "func createTypeCast(c *Compiler, in value.Value, to types.Type) value.Value {\n\tinType := in.Type()\n\tfromInt := types.IsInt(inType)\n\tfromFloat := types.IsFloat(inType)\n\n\ttoInt := types.IsInt(to)\n\ttoFloat := types.IsFloat(to)\n\n\tinSize := typeSize(inType)\n\toutSize := typeSize(to)\n\n\tif types.Equal(to, types.Void) {\n\t\treturn nil\n\t}\n\n\tif types.IsPointer(inType) && types.IsPointer(to) {\n\t\treturn c.CurrentBlock().NewBitCast(in, to)\n\t}\n\n\tif fromFloat && toInt {\n\t\treturn c.CurrentBlock().NewFPToSI(in, to)\n\t}\n\n\tif fromInt && toFloat {\n\t\treturn c.CurrentBlock().NewSIToFP(in, to)\n\t}\n\n\tif fromInt && toInt {\n\t\tif inSize < outSize {\n\t\t\treturn c.CurrentBlock().NewSExt(in, to)\n\t\t}\n\t\tif inSize == outSize {\n\t\t\treturn in\n\t\t}\n\t\treturn c.CurrentBlock().NewTrunc(in, to)\n\t}\n\n\tif fromFloat && toFloat {\n\t\tif inSize < outSize {\n\t\t\treturn c.CurrentBlock().NewFPExt(in, to)\n\t\t}\n\t\tif inSize == outSize {\n\t\t\treturn in\n\t\t}\n\t\treturn c.CurrentBlock().NewFPTrunc(in, to)\n\t}\n\n\t// If the cast would not change the type, just return the in value\n\tif types.Equal(inType, to) {\n\t\treturn in\n\t}\n\n\tlog.Fatal(\"Failed to typecast type %s to %s\\n\", inType.String(), to)\n\treturn nil\n}", "title": "" }, { "docid": "0614911e1dc81057391e2a2cf0490d4b", "score": "0.3972008", "text": "func makeConst(rep interface{}, totype *vdl.Type) (Const, error) { //nolint:gocyclo\n\tif rep == nil {\n\t\treturn Const{}, errInvalidConst\n\t}\n\tif totype == nil {\n\t\tif v, ok := rep.(*vdl.Value); ok {\n\t\t\treturn Const{}, fmt.Errorf(\"can't make typed value %s untyped\", v.Type())\n\t\t}\n\t\treturn Const{rep, nil}, nil\n\t}\n\tswitch trep := rep.(type) {\n\tcase bool:\n\t\tif totype.Kind() == vdl.Bool {\n\t\t\treturn Const{trep, totype}, nil\n\t\t}\n\tcase string:\n\t\tif totype.Kind() == vdl.String || totype.IsBytes() {\n\t\t\treturn Const{trep, totype}, nil\n\t\t}\n\tcase *big.Int:\n\t\tswitch totype.Kind() {\n\t\tcase vdl.Byte, vdl.Uint16, vdl.Uint32, vdl.Uint64, vdl.Int8, vdl.Int16, vdl.Int32, vdl.Int64:\n\t\t\tif err := checkOverflowInt(trep, totype.Kind()); err != nil {\n\t\t\t\treturn Const{}, err\n\t\t\t}\n\t\t\treturn Const{trep, totype}, nil\n\t\tcase vdl.Float32, vdl.Float64:\n\t\t\treturn makeConst(new(big.Rat).SetInt(trep), totype)\n\t\t}\n\tcase *big.Rat:\n\t\tswitch totype.Kind() {\n\t\tcase vdl.Byte, vdl.Uint16, vdl.Uint32, vdl.Uint64, vdl.Int8, vdl.Int16, vdl.Int32, vdl.Int64:\n\t\t\t// The only way we reach this conversion from big.Rat to a typed integer\n\t\t\t// is for explicit type conversions. We pass a nil Type to bigRatToInt\n\t\t\t// indicating trep is untyped, to allow all conversions from float to int\n\t\t\t// as long as trep is actually an integer.\n\t\t\tirep, err := bigRatToInt(trep, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn Const{}, err\n\t\t\t}\n\t\t\treturn makeConst(irep, totype)\n\t\tcase vdl.Float32, vdl.Float64:\n\t\t\tfrep, err := convertTypedRat(trep, totype.Kind())\n\t\t\tif err != nil {\n\t\t\t\treturn Const{}, err\n\t\t\t}\n\t\t\treturn Const{frep, totype}, nil\n\t\t}\n\t}\n\treturn Const{}, fmt.Errorf(\"can't convert %s to %v\", cRepString(rep), cRepTypeString(rep, totype))\n}", "title": "" }, { "docid": "919c9b83651e934b802234bb19df1128", "score": "0.39695132", "text": "func newValue(set string) interface{} {\n\tvt, exist := valueTypes.Load(set)\n\tif !exist {\n\t\tlogger.Panicf(\"not exist value type:%v\", set)\n\t}\n\n\treturn vt.(*valueType).newValue()\n}", "title": "" }, { "docid": "1ea71c67ea0e61e6ce74e4cd50a146d5", "score": "0.3952292", "text": "func (n nomadJsonEncodingExtensions) ConvertExt(v interface{}) interface{} {\n\tif fn, ok := extendedTypes[reflect.TypeOf(v)]; ok {\n\t\treturn fn(v)\n\t} else {\n\t\t// shouldn't get here, but returning v will probably result in an infinite loop\n\t\t// return nil and erase this field\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "81e784f54cb25bbfe9542c8b9ad9fcfa", "score": "0.39508486", "text": "func toPair(key string, val interface{}) *Pair {\n\tswitch v := val.(type) {\n\tcase string:\n\t\treturn &Pair{key, v, nil, StringVal}\n\tcase []byte:\n\t\treturn &Pair{key, string(v), nil, StringVal}\n\tcase bool:\n\t\tif val.(bool) {\n\t\t\treturn &Pair{key, \"true\", nil, BooleanVal}\n\t\t}\n\t\treturn &Pair{key, \"false\", nil, BooleanVal}\n\tcase int:\n\t\treturn &Pair{key, strconv.Itoa(v), nil, IntegerVal}\n\tcase int8:\n\t\treturn &Pair{key, strconv.FormatInt(int64(v), 10), nil, IntegerVal}\n\tcase int16:\n\t\treturn &Pair{key, strconv.FormatInt(int64(v), 10), nil, IntegerVal}\n\tcase int32:\n\t\treturn &Pair{key, strconv.FormatInt(int64(v), 10), nil, IntegerVal}\n\tcase int64:\n\t\treturn &Pair{key, strconv.FormatInt(v, 10), nil, IntegerVal}\n\tcase uint:\n\t\treturn &Pair{key, strconv.FormatUint(uint64(v), 10), nil, IntegerVal}\n\tcase uint8:\n\t\treturn &Pair{key, strconv.FormatUint(uint64(v), 10), nil, IntegerVal}\n\tcase uint16:\n\t\treturn &Pair{key, strconv.FormatUint(uint64(v), 10), nil, IntegerVal}\n\tcase uint32:\n\t\treturn &Pair{key, strconv.FormatUint(uint64(v), 10), nil, IntegerVal}\n\tcase uint64:\n\t\treturn &Pair{key, strconv.FormatUint(v, 10), nil, IntegerVal}\n\tcase float32:\n\t\treturn &Pair{key, strconv.FormatFloat(float64(v), FloatFormat, -1, 32), nil, FloatVal}\n\tcase float64:\n\t\treturn &Pair{key, strconv.FormatFloat(v, FloatFormat, -1, 64), nil, FloatVal}\n\tcase complex64:\n\t\treturn &Pair{key, fmt.Sprintf(\"%f\", v), nil, ComplexVal}\n\tcase complex128:\n\t\treturn &Pair{key, fmt.Sprintf(\"%f\", v), nil, ComplexVal}\n\tcase time.Time:\n\t\treturn &Pair{key, v.Format(TimeLayout), nil, TimeVal}\n\tcase Valuer:\n\t\tvar pairType = CustomUnquoted\n\t\tif v.IsQuoted() {\n\t\t\tpairType = CustomQuoted\n\t\t}\n\t\treturn &Pair{key, v.String(), nil, pairType}\n\tcase Stringer:\n\t\treturn &Pair{key, v.String(), nil, StringVal}\n\tcase encoding.TextMarshaler:\n\t\tdata, err := v.MarshalText()\n\t\tif err != nil {\n\t\t\treturn &Pair{key, fmt.Sprintf(\"%s\", err), nil, StringVal}\n\t\t}\n\t\treturn &Pair{key, string(data), nil, StringVal}\n\tcase func() string:\n\t\treturn &Pair{key, \"\", v, StringVal}\n\tdefault:\n\t\t// Worst case conversion that depends on reflection.\n\t\treturn &Pair{key, fmt.Sprintf(\"%+v\", val), nil, StringVal}\n\t}\n}", "title": "" }, { "docid": "87ee168e4cf62b58c4506c4e042e39ff", "score": "0.39467105", "text": "func (seq TTypeSequence) Reduce(reducer TTypeReduceFunc, init *TType) *TType {\n\t// initialize current value (first)\n\tcurr := init\n\t// go over all values\n\tfor _, val := range seq {\n\t\tcurr = reducer(curr, val)\n\t}\n\n\treturn curr\n}", "title": "" }, { "docid": "4f98ff65348699a387d9a86a6336093f", "score": "0.39460805", "text": "func CastConversion(v types.Value, path document.Path, targetType types.ValueType) (types.Value, error) {\n\treturn document.CastAs(v, targetType)\n}", "title": "" }, { "docid": "ea44498911f3aaa7845f3e33f7023282", "score": "0.3943385", "text": "func (it *chainIter) valSet(val Value) {\n\tit.b.val[it.ib] = val\n}", "title": "" }, { "docid": "e61b6710725a6865072e412121f41375", "score": "0.3942684", "text": "func OneValue(curr []ast.Value, more ...ast.Value) (ast.Value, error) {\n\treturn Basic.OneValue(curr, more...)\n}", "title": "" }, { "docid": "4c42e734b882f1aa5c0ac4949d991a50", "score": "0.39390743", "text": "func (t Tag) Value(value string) TagValue {\n\treturn tag.Upsert(tag.Key(t), value)\n}", "title": "" }, { "docid": "3ea9b18e89e30b017e1288de7c2adf83", "score": "0.39325178", "text": "func Cast(val Value, target Caster) (Value, bool) {\n\tcastedVal, err := target.Cast(val)\n\treturn castedVal, err == nil\n}", "title": "" }, { "docid": "c72726d20294215d277774546768aa3c", "score": "0.39247978", "text": "func (v Value) TypeValue() Value {\n\treturn TypeTypeVal(v.ty)\n}", "title": "" }, { "docid": "d17c7afdb935c93bb9d2a93a74f3e1df", "score": "0.39245588", "text": "func assignToStruct(s reflect.Value, val js.Value) (reflect.Value, error) {\n\tt := s.Type()\n\ts = reflect.New(t).Elem()\n\tn := s.NumField()\n\tfor i := 0; i < n; i++ {\n\t\tif f := s.Field(i); f.CanInterface() {\n\t\t\tk := nameOf(t.Field(i))\n\t\t\tjf := val.Get(k)\n\t\t\tv, err := assignTo(f, jf)\n\t\t\tif err != nil {\n\t\t\t\treturn zero, err\n\t\t\t}\n\t\t\tif v == zero {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf.Set(v)\n\t\t}\n\t}\n\treturn s, nil\n}", "title": "" }, { "docid": "b0245d34c9328fbc95035ca2b11375ce", "score": "0.392355", "text": "func (v Value) copyTo(dest *otlpcommon.AnyValue) {\n\tswitch ov := v.orig.Value.(type) {\n\tcase *otlpcommon.AnyValue_KvlistValue:\n\t\tkv, ok := dest.Value.(*otlpcommon.AnyValue_KvlistValue)\n\t\tif !ok {\n\t\t\tkv = &otlpcommon.AnyValue_KvlistValue{KvlistValue: &otlpcommon.KeyValueList{}}\n\t\t\tdest.Value = kv\n\t\t}\n\t\tif ov.KvlistValue == nil {\n\t\t\tkv.KvlistValue = nil\n\t\t\treturn\n\t\t}\n\t\t// Deep copy to dest.\n\t\tnewMap(&ov.KvlistValue.Values).CopyTo(newMap(&kv.KvlistValue.Values))\n\tcase *otlpcommon.AnyValue_ArrayValue:\n\t\tav, ok := dest.Value.(*otlpcommon.AnyValue_ArrayValue)\n\t\tif !ok {\n\t\t\tav = &otlpcommon.AnyValue_ArrayValue{ArrayValue: &otlpcommon.ArrayValue{}}\n\t\t\tdest.Value = av\n\t\t}\n\t\tif ov.ArrayValue == nil {\n\t\t\tav.ArrayValue = nil\n\t\t\treturn\n\t\t}\n\t\t// Deep copy to dest.\n\t\tnewSlice(&ov.ArrayValue.Values).CopyTo(newSlice(&av.ArrayValue.Values))\n\tcase *otlpcommon.AnyValue_BytesValue:\n\t\tbv, ok := dest.Value.(*otlpcommon.AnyValue_BytesValue)\n\t\tif !ok {\n\t\t\tbv = &otlpcommon.AnyValue_BytesValue{}\n\t\t\tdest.Value = bv\n\t\t}\n\t\tbv.BytesValue = make([]byte, len(ov.BytesValue))\n\t\tcopy(bv.BytesValue, ov.BytesValue)\n\tdefault:\n\t\t// Primitive immutable type, no need for deep copy.\n\t\tdest.Value = v.orig.Value\n\t}\n}", "title": "" } ]
bdd7f36cbd964e756343480c79ce6433
========================================================================================= DataContractType related queries =========================================================================================
[ { "docid": "47eeaf6fc4e1db4bdd66252d0e24eb8c", "score": "0.0", "text": "func GetRecommendedDataContractType(logger *shim.ChaincodeLogger, stub shim.ChaincodeStubInterface) pb.Response {\n\tqueryResults, err := getDocumentsByDocType(logger, stub, DATA_CONTRACT_TYPE_DOCTYPE)\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\tdataContractTypes := []DataContractType{}\n\terr = json.Unmarshal(queryResults, &dataContractTypes)\n\tif err != nil {\n\t\tlogger.Error(err.Error())\n\t\treturn shim.Error(err.Error())\n\t}\n\trecommendedIndex := rand.Intn(len(dataContractTypes))\n\tdataContractType := dataContractTypes[recommendedIndex]\n\n\tdataContractTypeAsbytes, err := json.Marshal(dataContractType)\n\tif err != nil {\n\t\tlogger.Error(err.Error())\n\t\treturn shim.Error(err.Error())\n\t}\n\treturn shim.Success(dataContractTypeAsbytes)\n}", "title": "" } ]
[ { "docid": "551662258cc199f6add73c0c80f7df13", "score": "0.60735244", "text": "func GetTypeData(tx *sql.Tx, id int) (string, string, bool, error) {\n\tname := \"\"\n\tvar useInTablePtr *string\n\tif err := tx.QueryRow(`SELECT name, use_in_table from type where id=$1`, id).Scan(&name, &useInTablePtr); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\treturn \"\", \"\", false, nil\n\t\t}\n\t\treturn \"\", \"\", false, errors.New(\"querying type data: \" + err.Error())\n\t}\n\tuseInTable := \"\"\n\tif useInTablePtr != nil {\n\t\tuseInTable = *useInTablePtr\n\t}\n\treturn name, useInTable, true, nil\n}", "title": "" }, { "docid": "a8e7414497662f767fe0faeb3b3ac941", "score": "0.60094786", "text": "func toDbType(typeDefinition string) (gocql.TypeInfo, error) {\n\tvar t gocql.Type\n\tswitch typeDefinition {\n\tcase gocql.TypeCustom.String():\n\t\tt = gocql.TypeCustom\n\tcase gocql.TypeAscii.String():\n\t\tt = gocql.TypeAscii\n\tcase gocql.TypeBigInt.String():\n\t\tt = gocql.TypeBigInt\n\tcase gocql.TypeBlob.String():\n\t\tt = gocql.TypeBlob\n\tcase gocql.TypeBoolean.String():\n\t\tt = gocql.TypeBoolean\n\tcase gocql.TypeCounter.String():\n\t\tt = gocql.TypeCounter\n\tcase gocql.TypeDecimal.String():\n\t\tt = gocql.TypeDecimal\n\tcase gocql.TypeDouble.String():\n\t\tt = gocql.TypeDouble\n\tcase gocql.TypeFloat.String():\n\t\tt = gocql.TypeFloat\n\tcase gocql.TypeInt.String():\n\t\tt = gocql.TypeInt\n\tcase gocql.TypeText.String():\n\t\tt = gocql.TypeText\n\tcase gocql.TypeTimestamp.String():\n\t\tt = gocql.TypeTimestamp\n\tcase gocql.TypeUUID.String():\n\t\tt = gocql.TypeUUID\n\tcase gocql.TypeVarchar.String():\n\t\tt = gocql.TypeVarchar\n\tcase gocql.TypeTimeUUID.String():\n\t\tt = gocql.TypeTimeUUID\n\tcase gocql.TypeInet.String():\n\t\tt = gocql.TypeInet\n\tcase gocql.TypeDate.String():\n\t\tt = gocql.TypeDate\n\tcase gocql.TypeDuration.String():\n\t\tt = gocql.TypeDuration\n\tcase gocql.TypeTime.String():\n\t\tt = gocql.TypeTime\n\tcase gocql.TypeSmallInt.String():\n\t\tt = gocql.TypeSmallInt\n\tcase gocql.TypeTinyInt.String():\n\t\tt = gocql.TypeTinyInt\n\tcase gocql.TypeVarint.String():\n\t\tt = gocql.TypeVarint\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"type '%s' Not supported\", typeDefinition)\n\t}\n\n\treturn gocql.NewNativeType(0, t, \"\"), nil\n}", "title": "" }, { "docid": "3df0ed5b22e86f726a0532ee9bc28b82", "score": "0.5982165", "text": "func typeFromDBType(dbType string) interface{} {\n\tswitch strings.ToLower(dbType) {\n\tcase \"varchar\", \"text\", \"nvarchar\", \"char\", \"uuid\":\n\t\treturn \"\"\n\tcase \"decimal\", \"float\", \"long\":\n\t\treturn 0.0\n\tcase \"int\", \"bigint\", \"number\":\n\t\treturn int64(0)\n\tcase \"timestamp\", \"datetime\", \"time\", \"date\":\n\t\treturn time.Time{}\n\tcase \"boolean\", \"bool\":\n\t\treturn true\n\tdefault:\n\t\treturn []byte{}\n\t}\n}", "title": "" }, { "docid": "9b1e5c0f14bdf6618ebdde70c6ddc0b8", "score": "0.59471923", "text": "func AsDatatype(e ld.Entity) Datatype { return Datatype{AsClass(e)} }", "title": "" }, { "docid": "78a97f2388b12409b8274022e3be2cfc", "score": "0.59315103", "text": "func (a *Int32Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "2b615cb1f83030d02d992d0d08d1711b", "score": "0.59209114", "text": "func (ct *ColumnType) SQLType() querypb.Type {\n\tswitch ct.Type {\n\tcase keywordStrings[TINYINT]:\n\t\tif ct.Unsigned {\n\t\t\treturn sqltypes.Uint8\n\t\t}\n\t\treturn sqltypes.Int8\n\tcase keywordStrings[SMALLINT]:\n\t\tif ct.Unsigned {\n\t\t\treturn sqltypes.Uint16\n\t\t}\n\t\treturn sqltypes.Int16\n\tcase keywordStrings[MEDIUMINT]:\n\t\tif ct.Unsigned {\n\t\t\treturn sqltypes.Uint24\n\t\t}\n\t\treturn sqltypes.Int24\n\tcase keywordStrings[INT]:\n\t\tfallthrough\n\tcase keywordStrings[INTEGER]:\n\t\tif ct.Unsigned {\n\t\t\treturn sqltypes.Uint32\n\t\t}\n\t\treturn sqltypes.Int32\n\tcase keywordStrings[BIGINT]:\n\t\tif ct.Unsigned {\n\t\t\treturn sqltypes.Uint64\n\t\t}\n\t\treturn sqltypes.Int64\n\tcase keywordStrings[TEXT]:\n\t\treturn sqltypes.Text\n\tcase keywordStrings[TINYTEXT]:\n\t\treturn sqltypes.Text\n\tcase keywordStrings[MEDIUMTEXT]:\n\t\treturn sqltypes.Text\n\tcase keywordStrings[LONGTEXT]:\n\t\treturn sqltypes.Text\n\tcase keywordStrings[BLOB]:\n\t\treturn sqltypes.Blob\n\tcase keywordStrings[TINYBLOB]:\n\t\treturn sqltypes.Blob\n\tcase keywordStrings[MEDIUMBLOB]:\n\t\treturn sqltypes.Blob\n\tcase keywordStrings[LONGBLOB]:\n\t\treturn sqltypes.Blob\n\tcase keywordStrings[CHAR]:\n\t\treturn sqltypes.Char\n\tcase keywordStrings[VARCHAR]:\n\t\treturn sqltypes.VarChar\n\tcase keywordStrings[BINARY]:\n\t\treturn sqltypes.Binary\n\tcase keywordStrings[VARBINARY]:\n\t\treturn sqltypes.VarBinary\n\tcase keywordStrings[DATE]:\n\t\treturn sqltypes.Date\n\tcase keywordStrings[TIME]:\n\t\treturn sqltypes.Time\n\tcase keywordStrings[DATETIME]:\n\t\treturn sqltypes.Datetime\n\tcase keywordStrings[TIMESTAMP]:\n\t\treturn sqltypes.Timestamp\n\tcase keywordStrings[YEAR]:\n\t\treturn sqltypes.Year\n\tcase keywordStrings[FLOAT_TYPE]:\n\t\treturn sqltypes.Float32\n\tcase keywordStrings[DOUBLE]:\n\t\treturn sqltypes.Float64\n\tcase keywordStrings[DECIMAL]:\n\t\treturn sqltypes.Decimal\n\tcase keywordStrings[BIT]:\n\t\treturn sqltypes.Bit\n\tcase keywordStrings[ENUM]:\n\t\treturn sqltypes.Enum\n\tcase keywordStrings[SET]:\n\t\treturn sqltypes.Set\n\tcase keywordStrings[JSON]:\n\t\treturn sqltypes.TypeJSON\n\tcase keywordStrings[GEOMETRY]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[POINT]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[LINESTRING]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[POLYGON]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[GEOMETRYCOLLECTION]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[MULTIPOINT]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[MULTILINESTRING]:\n\t\treturn sqltypes.Geometry\n\tcase keywordStrings[MULTIPOLYGON]:\n\t\treturn sqltypes.Geometry\n\t}\n\tpanic(\"unimplemented type \" + ct.Type)\n}", "title": "" }, { "docid": "5ee5f218e93a6ac6e24fb38ec313785f", "score": "0.5889528", "text": "func (a *Int32FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "be4beb0ed545b53bf9acb94f660656b3", "score": "0.5867766", "text": "func (a *BoolFullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "cbcb982b2a5968e79e4a59a6e00850ea", "score": "0.5836719", "text": "func (d RData) Type() Type { return d.Value().Type() }", "title": "" }, { "docid": "4bcf60d1ce413e069c4926459ad5f877", "score": "0.5830742", "text": "func (a *BoolColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "379dac3bb3c96162057d734e8ed85a30", "score": "0.57968175", "text": "func (t SystemBoolType) Type() query.Type {\n\treturn sqltypes.Int8\n}", "title": "" }, { "docid": "25efbc93af65fbefcae9d7a8c050e644", "score": "0.5792728", "text": "func IsDatatype(e ld.Entity) bool { return ld.Is(e, Class_Datatype.ID) }", "title": "" }, { "docid": "8e41ca5378f7cc6682b5e76a6cd0cbb5", "score": "0.57266164", "text": "func (a *StringColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "92bdd4de076ec3e553e4d83aa3745848", "score": "0.5716526", "text": "func (contract *Contract) querybyContractType(stub shim.ChaincodeStubInterface, args []string) peer.Response {\n\n\tif len(args) != 1 {\n\t\treturn shim.Error(\"Contract type must be one\")\n\t}\n\n\tresult, err := QueryByHistory(stub,args[0])\n\n\tif err != nil {\n\t\treturn shim.Error(err.Error())\n\t}\n\n\treturn shim.Success(result)\n}", "title": "" }, { "docid": "c1c49978314e21a5252e3e2932b4d1d6", "score": "0.5706611", "text": "func (v Value) Type() querypb.Type {\n\treturn v.typ\n}", "title": "" }, { "docid": "984b5e89be8a655e8c321a1043f78402", "score": "0.56861377", "text": "func (typeRow *TypeDicRow) sqlColumnType(dbFacet Facet) (string, error) {\r\n\r\n\t// model specific types: it must be enum\r\n\tif !typeRow.IsBuiltIn() {\r\n\t\treturn \"INT\", nil\r\n\t}\r\n\r\n\t// built-in types (ordered as in omc grammar for clarity)\r\n\tswitch strings.ToLower(typeRow.Name) {\r\n\r\n\t// C++ ambiguous integral type\r\n\t// (in C/C++, the signedness of char is not specified)\r\n\tcase \"char\":\r\n\t\treturn \"SMALLINT\", nil\r\n\r\n\t// C++ signed integral types\r\n\tcase \"schar\", \"short\":\r\n\t\treturn \"SMALLINT\", nil\r\n\r\n\t// C++ signed integral types\r\n\tcase \"int\":\r\n\t\treturn \"INT\", nil\r\n\r\n\t// C++ signed integral types\r\n\tcase \"long\", \"llong\":\r\n\t\treturn dbFacet.bigintType(), nil\r\n\r\n\t// C++ unsigned integral types (including bool)\r\n\tcase \"bool\", \"uchar\":\r\n\t\treturn \"SMALLINT\", nil\r\n\r\n\t// C++ unsigned integral types (including bool)\r\n\tcase \"ushort\":\r\n\t\treturn \"INT\", nil\r\n\r\n\t// C++ unsigned integral types (including bool)\r\n\tcase \"uint\", \"ulong\", \"ullong\":\r\n\t\treturn dbFacet.bigintType(), nil\r\n\r\n\t// C++ floating point types\r\n\tcase \"float\", \"double\", \"ldouble\":\r\n\t\treturn dbFacet.floatType(), nil\r\n\r\n\t// Changeable numeric types\r\n\tcase \"time\", \"real\":\r\n\t\treturn dbFacet.floatType(), nil\r\n\r\n\t// Changeable numeric types\r\n\tcase \"integer\", \"counter\":\r\n\t\treturn \"INT\", nil\r\n\r\n\t// path to a file (a string)\r\n\tcase \"file\":\r\n\t\treturn dbFacet.textType(4096), nil\r\n\t\t// go 1.7 max path:\r\n\t\t// linux: syscall.PathMax\r\n\t\t// win: syscall.MAX_PATH\r\n\t}\r\n\r\n\treturn \"\", errors.New(\"invalid type id: \" + strconv.Itoa(typeRow.TypeId))\r\n}", "title": "" }, { "docid": "f36f92a866fe5c35f3554be7d0c7e144", "score": "0.5666272", "text": "func (a *Uint32Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "0711d0965ea0641931c1edd257e4a6ba", "score": "0.5647752", "text": "func (sq *subquery) GetType() *types.FieldType {\n\treturn sq.Type\n}", "title": "" }, { "docid": "06e20351f61a0594f4330a2c11910364", "score": "0.56329274", "text": "func (dt *NullDate) ImplementsGraphQLType(name string) bool {\n\treturn name == \"Date\"\n}", "title": "" }, { "docid": "6f8370066a6f74cb9bdc929e0d01eced", "score": "0.5619938", "text": "func SQLType2Type(st SQLType, nnull bool) (t reflect.Type, ok bool) {\r\n\tname := strings.ToUpper(st.Name)\r\n\tisArray := strings.HasPrefix(name, \"_\") || st.Dimension > 0\r\n\tname = strings.Replace(name, \"_\", \"\", -1)\r\n\tvar res reflect.Type\r\n\r\n\tswitch name {\r\n\tcase Bit, TinyInt, SmallInt, MediumInt, Int, Integer, Serial:\r\n\t\tif nnull {\r\n\t\t\tres, ok = IntType, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullInt, true\r\n\t\t}\r\n\tcase BigInt, BigSerial:\r\n\t\tif nnull {\r\n\t\t\tres, ok = Int64Type, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullInt, true\r\n\t\t}\r\n\tcase Float, Real:\r\n\t\tif nnull {\r\n\t\t\tres, ok = Float32Type, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullFloat, true\r\n\t\t}\r\n\tcase Double:\r\n\t\tif nnull {\r\n\t\t\tres, ok = Float64Type, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullFloat, true\r\n\t\t}\r\n\tcase Char, Varchar, NVarchar, TinyText, Text, MediumText, LongText, Enum, Set, UUID, Clob:\r\n\t\tif nnull {\r\n\t\t\tres, ok = StringType, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullString, true\r\n\t\t}\r\n\tcase TinyBlob, Blob, LongBlob, Bytea, Binary, MediumBlob, VarBinary:\r\n\t\tr := []byte{}\r\n\t\tif nnull {\r\n\t\t\tres, ok = reflect.TypeOf(r), true\r\n\t\t} else {\r\n\t\t\tres, ok = reflect.TypeOf(r), true\r\n\t\t}\r\n\tcase Bool:\r\n\t\tif nnull {\r\n\t\t\tres, ok = BoolType, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullBool, true\r\n\t\t}\r\n\tcase DateTime, Date, Time, TimeStamp, TimeStampz:\r\n\t\tif nnull {\r\n\t\t\tres, ok = TimeType, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullTime, true\r\n\t\t}\r\n\tcase Decimal, Numeric:\r\n\t\tif nnull {\r\n\t\t\tres, ok = StringType, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullString, true\r\n\t\t}\r\n\tcase JSON, JSONB:\r\n\t\tif nnull {\r\n\t\t\tres, ok = JSONText, true\r\n\t\t} else {\r\n\t\t\tres, ok = NullJSONText, true\r\n\t\t}\r\n\tdefault:\r\n\t\tres, ok = SliceInt8, false\r\n\t}\r\n\r\n\tif isArray {\r\n\t\tres = makeDimensions(res, st.Dimension)\r\n\t}\r\n\r\n\treturn res, true\r\n}", "title": "" }, { "docid": "5b7125fc71dcadda50c11f79cfe90094", "score": "0.5615269", "text": "func (a *StringFullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "db3e0e8b65ec22ccdba0d810c87df93b", "score": "0.5609574", "text": "func (s *hdb) DataTypeOf(field *StructField) string {\n\tvar dataValue, sqlType, size, additionalType = ParseFieldStructForDialect(field, s)\n\n\tif sqlType == \"\" {\n\t\tswitch dataValue.Kind() {\n\t\tcase reflect.Bool:\n\t\t\tsqlType = \"boolean\"\n\t\tcase reflect.Int8:\n\t\t\tif s.fieldCanAutoIncrement(field) {\n\t\t\t\tfield.TagSettings[\"AUTO_INCREMENT\"] = \"AUTO_INCREMENT\"\n\t\t\t\tsqlType = \"smallint generated always as IDENTITY\"\n\t\t\t} else {\n\t\t\t\tsqlType = \"smallint\"\n\t\t\t}\n\t\tcase reflect.Uint8:\n\t\t\t//8-bit unsigned integer\n\t\t\tif s.fieldCanAutoIncrement(field) {\n\t\t\t\tfield.TagSettings[\"AUTO_INCREMENT\"] = \"AUTO_INCREMENT\"\n\t\t\t\tsqlType = \"tinyint generated always as IDENTITY\"\n\t\t\t} else {\n\t\t\t\tsqlType = \"tinyint\"\n\t\t\t}\n\t\tcase reflect.Int16:\n\t\t\tif s.fieldCanAutoIncrement(field) {\n\t\t\t\tfield.TagSettings[\"AUTO_INCREMENT\"] = \"AUTO_INCREMENT\"\n\t\t\t\tsqlType = \"smallint generated always as IDENTITY\"\n\t\t\t} else {\n\t\t\t\tsqlType = \"smallint\"\n\t\t\t}\n\t\tcase reflect.Uint16, reflect.Int, reflect.Int32:\n\t\t\tif s.fieldCanAutoIncrement(field) {\n\t\t\t\tfield.TagSettings[\"AUTO_INCREMENT\"] = \"AUTO_INCREMENT\"\n\t\t\t\tsqlType = \"int generated always as IDENTITY\"\n\t\t\t} else {\n\t\t\t\tsqlType = \"int\"\n\t\t\t}\n\t\tcase reflect.Uint, reflect.Uint32, reflect.Uintptr, reflect.Int64:\n\t\t\tif s.fieldCanAutoIncrement(field) {\n\t\t\t\tfield.TagSettings[\"AUTO_INCREMENT\"] = \"AUTO_INCREMENT\"\n\t\t\t\tsqlType = \"bigint generated always as IDENTITY\"\n\t\t\t} else {\n\t\t\t\tsqlType = \"bigint\"\n\t\t\t}\n\t\tcase reflect.Uint64: //18,446,744,073,709,551,615 (2^64 - 1)\n\t\t\tif s.fieldCanAutoIncrement(field) {\n\t\t\t\tfield.TagSettings[\"AUTO_INCREMENT\"] = \"AUTO_INCREMENT\"\n\t\t\t\tsqlType = \"DECIMAL(20,0) generated always as IDENTITY\"\n\t\t\t} else {\n\t\t\t\tsqlType = \"DECIMAL(20,0)\"\n\t\t\t}\n\t\tcase reflect.Float32:\n\t\t\tsqlType = \"real\"\n\t\tcase reflect.Float64:\n\t\t\tsqlType = \"double\"\n\t\tcase reflect.String:\n\t\t\tif size > 0 && size <= 5000 {\n\t\t\t\tsqlType = fmt.Sprintf(\"varchar(%d)\", size)\n\t\t\t} else {\n\t\t\t\tsqlType = \"CLOB\"\n\t\t\t}\n\t\tcase reflect.Struct:\n\t\t\tif _, ok := dataValue.Interface().(time.Time); ok {\n\t\t\t\tsqlType = \"timestamp\"\n\t\t\t}\n\t\tdefault:\n\t\t\tif IsByteArrayOrSlice(dataValue) {\n\t\t\t\tif size > 0 && size <= 5000 {\n\t\t\t\t\tsqlType = fmt.Sprintf(\"varbinary(%d)\", size)\n\t\t\t\t} else {\n\t\t\t\t\tsqlType = \"blob\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif sqlType == \"\" {\n\t\tpanic(fmt.Sprintf(\"invalid sql type %s (%s) for hdb\", dataValue.Type().Name(), dataValue.Kind().String()))\n\t}\n\n\tif strings.TrimSpace(additionalType) == \"\" {\n\t\treturn sqlType\n\t}\n\treturn fmt.Sprintf(\"%v %v\", sqlType, additionalType)\n}", "title": "" }, { "docid": "e642e4ca224eaa5af8581a236bcd3df3", "score": "0.56057304", "text": "func (ib *IsNull) Type() sql.Type {\n\treturn types.Boolean\n}", "title": "" }, { "docid": "1183f3dab8e4472732f6f7b2a06a7bed", "score": "0.5597522", "text": "func (db *Database) Type() sql.Type { return sql.Text }", "title": "" }, { "docid": "ebd3b932ebe361e7c43cb9ca7b18f83d", "score": "0.5576175", "text": "func (a *Int8Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "d420f12394ab7d82acf165bc46f3b418", "score": "0.55474484", "text": "func (l *Like) Type() sql.Type { return sql.Boolean }", "title": "" }, { "docid": "d420f12394ab7d82acf165bc46f3b418", "score": "0.55474484", "text": "func (l *Like) Type() sql.Type { return sql.Boolean }", "title": "" }, { "docid": "c409fbd030753ce30beae22787346b3f", "score": "0.5538214", "text": "func (a *Int8FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "57190d9c7b065e35625689322893c42c", "score": "0.5529331", "text": "func (t GeomCollType) Type() query.Type {\n\treturn sqltypes.Geometry\n}", "title": "" }, { "docid": "1279e478c1282d88434b45373d43ceea", "score": "0.5526334", "text": "func getAllDataTypes(t *testing.T) *[](*DataType) {\n\ttx := databaseConnection.DB.Begin()\n\tvar dataTypes [](*DataType)\n\terr := tx.Find(&dataTypes).Error\n\tif err != nil {\n\t\ttx.Rollback()\n\t\tt.Fatalf(\"An error occured during fetching of data types: %s\", err)\n\t}\n\ttx.Commit()\n\treturn &dataTypes\n}", "title": "" }, { "docid": "fffa738ee79a5f855f1b09b025ca3069", "score": "0.55252606", "text": "func (_UnitType_Interface *UnitType_InterfaceSession) ContractType() ([32]byte, error) {\n\treturn _UnitType_Interface.Contract.ContractType(&_UnitType_Interface.CallOpts)\n}", "title": "" }, { "docid": "5de9e7ecb6d9964594fa0711daaa77b0", "score": "0.55181247", "text": "func (qs OrganizationQuerySet) TypeEq(typeValue int8) OrganizationQuerySet {\n\treturn qs.w(qs.db.Where(\"type = ?\", typeValue))\n}", "title": "" }, { "docid": "780b1bef642c660b516eb127d5c6a0e1", "score": "0.5515684", "text": "func (a *Uint32FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "1c22e4e196d048fd0bf235054cb37f93", "score": "0.5515581", "text": "func (NilResult) Type() uint32 { return QueryResultTypeNil }", "title": "" }, { "docid": "832c41a05f4a96ffaf0e5074e2f2a16f", "score": "0.550949", "text": "func (d *Datastore) Type() (DatastoreType, error) {\n\ti, err := d.intAttribute(\"TYPE\")\n\treturn DatastoreType(i), err\n}", "title": "" }, { "docid": "b5acedae47604153e4fc6ca410e5f7e3", "score": "0.549802", "text": "func (a *Float32Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "e3073a6031305226cc3a348f500050ef", "score": "0.54890096", "text": "func (o *ContentUnit) Type(exec boil.Executor, mods ...qm.QueryMod) contentTypeQuery {\n\tqueryMods := []qm.QueryMod{\n\t\tqm.Where(\"id=?\", o.TypeID),\n\t}\n\n\tqueryMods = append(queryMods, mods...)\n\n\tquery := ContentTypes(exec, queryMods...)\n\tqueries.SetFrom(query.Query, \"\\\"content_types\\\"\")\n\n\treturn query\n}", "title": "" }, { "docid": "6251ab15a9880d1c21c77cbbd7b48ef5", "score": "0.5469775", "text": "func (BoolResult) Type() uint32 { return QueryResultTypeBool }", "title": "" }, { "docid": "e8cfe9089a64b5b668b772f9afe5a0a9", "score": "0.5463824", "text": "func (*SQLite) cType(c *Column) (t string) {\n\tswitch c.Type {\n\tcase field.TypeBool:\n\t\tt = \"bool\"\n\tcase field.TypeInt8, field.TypeUint8, field.TypeInt, field.TypeInt16, field.TypeInt32, field.TypeUint, field.TypeUint16, field.TypeUint32:\n\t\tt = \"integer\"\n\tcase field.TypeInt64, field.TypeUint64:\n\t\tt = \"bigint\"\n\tcase field.TypeBytes:\n\t\tt = \"blob\"\n\tcase field.TypeString, field.TypeEnum:\n\t\tsize := c.Size\n\t\tif size == 0 {\n\t\t\tsize = DefaultStringLen\n\t\t}\n\t\t// sqlite has no size limit on varchar.\n\t\tt = fmt.Sprintf(\"varchar(%d)\", size)\n\tcase field.TypeFloat32, field.TypeFloat64:\n\t\tt = \"real\"\n\tcase field.TypeTime:\n\t\tt = \"datetime\"\n\tcase field.TypeJSON:\n\t\tt = \"json\"\n\tdefault:\n\t\tpanic(\"unsupported type \" + c.Type.String())\n\t}\n\treturn t\n}", "title": "" }, { "docid": "978e4d848794a0ff7d5ea32b2809c0d5", "score": "0.546361", "text": "func (d *KVGetQuery) Type() Type {\n\treturn TypeConsul\n}", "title": "" }, { "docid": "4ca04d95d82dc2236112050baf2100ac", "score": "0.5455053", "text": "func (t numberTypeImpl) Type() query.Type {\n\treturn t.baseType\n}", "title": "" }, { "docid": "e5060cd643aca8812e3671a80aed541d", "score": "0.54315186", "text": "func (a *Int64FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "5040bac362fdf4c649b832570d67efbf", "score": "0.54166055", "text": "func (_UnitType *UnitTypeSession) ContractType() ([32]byte, error) {\n\treturn _UnitType.Contract.ContractType(&_UnitType.CallOpts)\n}", "title": "" }, { "docid": "7d446079f43901270a643a5c171b69eb", "score": "0.54134464", "text": "func (d *NVGetQuery) Type() Type {\n\treturn TypeNomad\n}", "title": "" }, { "docid": "e8d6719219c9a907cb89192c3acef4c2", "score": "0.54112536", "text": "func GetAllType() (*[]TypeInfo, error) {\n\tu := &[]TypeInfo{}\n\td := DB.Self.Find(u, \"is_coped=?\", false)\n\treturn u, d.Error\n}", "title": "" }, { "docid": "0cf2e67bf938a205663574a09f47b532", "score": "0.54076827", "text": "func (a *Int64Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "a8a23cf93b46b96a46ca7ed979447205", "score": "0.53955334", "text": "func (c *ClientType) GetAllClientType(db *sql.DB) (*sql.Rows, error) {\n\ttsql := fmt.Sprintf(\"select id,\tisnull(client_type,'') [client_type] from oa.ClientType\")\n\n\treturn db.Query(tsql)\n\n}", "title": "" }, { "docid": "283930d5114c47f84201624d2f532067", "score": "0.53808594", "text": "func (*IsTrue) Type() sql.Type {\n\treturn sql.Boolean\n}", "title": "" }, { "docid": "13f29f297a162c89839e6666c0b18f75", "score": "0.53736675", "text": "func (LOC) Type() sql.Type {\n\treturn sql.JSON\n}", "title": "" }, { "docid": "39e640e3754a701d261430aaaf458f4a", "score": "0.53723645", "text": "func (c *ContactType) GetAll() ([]bu.ContactTypeBO, error) {\n\n\tvar contactTypes []ent.TableContactType\n\tvar result []bu.ContactTypeBO\n\n\tc.Db.Find(&contactTypes)\n\tfor _, item := range contactTypes {\n\t\tresult = append(result, bu.ContactTypeBO{ContactType: item.ContactType, Id: item.ID})\n\t}\n\treturn result, nil\n\n}", "title": "" }, { "docid": "0fdb647b9242ef07320c415df2fd9ed6", "score": "0.53722614", "text": "func (db *DB) Type() DbType {\n\treturn db.header.Type\n}", "title": "" }, { "docid": "057941e298102a4d578e4357c37c84d3", "score": "0.5354922", "text": "func QueryType(t string) client.Type {\n\treturn queryTypeMap[t]\n}", "title": "" }, { "docid": "7bc7bba5c30fe28b8c669e69486acc61", "score": "0.53313583", "text": "func (c *column) Type() sif.ColumnType {\n\treturn c.accessor.Type()\n}", "title": "" }, { "docid": "1723bde9f2af93d368a6e4248627e22c", "score": "0.53288305", "text": "func (anyType) _Type() {}", "title": "" }, { "docid": "55d5e537ac1ce8c2dee977812c8f65b7", "score": "0.5322828", "text": "func (ph *PiHConnector) QueryTypes() PiHQueryTypes {\n\tbs := ph.Get(\"getQueryTypes\")\n\ts := &PiHQueryTypes{}\n\n\terr := json.Unmarshal(bs, s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn *s\n}", "title": "" }, { "docid": "85d4c32bd0d6526cad0439b9c2c8a4ca", "score": "0.53224885", "text": "func ToCQLXType(f reflect.StructField) string {\n\tswitch f.Type.String() {\n\tcase \"gocql.UUID\":\n\t\treturn \"UUID\"\n\tcase \"string\":\n\t\treturn \"TEXT\"\n\tcase \"int8\":\n\t\treturn \"TINYINT\"\n\tcase \"int16\":\n\t\treturn \"SMALLINT\"\n\tcase \"int\":\n\t\treturn \"INT\"\n\tcase \"int32\":\n\t\treturn \"INT\"\n\tcase \"int64\":\n\t\treturn \"BIGINT\"\n\tcase \"float32\":\n\t\treturn \"FLOAT\"\n\tcase \"float64\":\n\t\treturn \"DOUBLE\"\n\tcase \"bool\":\n\t\treturn \"BOOLEAN\"\n\tcase \"time.Time\":\n\t\treturn \"timestamp\"\n\tcase \"[]uint8\":\n\t\treturn \"BOLB\"\n\t}\n\treturn \"\"\n}", "title": "" }, { "docid": "3b0696efed1a340ad383a2150c4074a1", "score": "0.53213465", "text": "func (w *Within) Type() sql.Type {\n\treturn types.Boolean\n}", "title": "" }, { "docid": "116aacbf7f88676889bf2bd559dd8586", "score": "0.53210914", "text": "func (data UnknownEntryData) Type() DataType {\n\treturn data.DataType\n}", "title": "" }, { "docid": "cbacc7da247fbc2d61f5c8eefd1bae0b", "score": "0.53175217", "text": "func (RowResult) Type() uint32 { return QueryResultTypeRow }", "title": "" }, { "docid": "e7e3602dba104153f4824c3cee31b18f", "score": "0.5301233", "text": "func (g *AsGeoJSON) Type() sql.Type {\n\treturn types.JSON\n}", "title": "" }, { "docid": "fd12b5ad919d18c2209550630277ef67", "score": "0.52961487", "text": "func (a *Uint64Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "379a90d2caf66f828f64cefefde78617", "score": "0.52957374", "text": "func (_Hotel_Interface *Hotel_InterfaceSession) ContractType() ([32]byte, error) {\n\treturn _Hotel_Interface.Contract.ContractType(&_Hotel_Interface.CallOpts)\n}", "title": "" }, { "docid": "e880dc2a3c09ff169df1556d9d472a76", "score": "0.5294312", "text": "func (x *NonMarketEntityDTO_CloudServiceData_BillingData) GetType() NonMarketEntityDTO_CloudServiceData_BillingData_Type {\n\tif x != nil && x.Type != nil {\n\t\treturn *x.Type\n\t}\n\treturn Default_NonMarketEntityDTO_CloudServiceData_BillingData_Type\n}", "title": "" }, { "docid": "bed25acb31c1efa198dab9ba5c3421ec", "score": "0.529314", "text": "func (_UnitType_Interface *UnitType_InterfaceCallerSession) ContractType() ([32]byte, error) {\n\treturn _UnitType_Interface.Contract.ContractType(&_UnitType_Interface.CallOpts)\n}", "title": "" }, { "docid": "ee4528dc8932ca3ba6e22c3f508c2acb", "score": "0.52807343", "text": "func (IntResult) Type() uint32 { return QueryResultTypeUint64 }", "title": "" }, { "docid": "ff39b80bdcd1191e9511672f37a7ce96", "score": "0.5279437", "text": "func (c *Client) Type(key string) ScalarResult {\n\treturn c.getType(context.Background(), key)\n}", "title": "" }, { "docid": "bdfc89fffab313fb8b093ad3724a6291", "score": "0.527655", "text": "func (a *Uint64FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "2c9fdca12e843931469d5534e71b0d67", "score": "0.5273514", "text": "func (m *SensitiveData) GetType() SensitiveDataType {\n\tif m != nil {\n\t\treturn m.Type\n\t}\n\treturn SENSITIVE_DATA_TYPE_CCN\n}", "title": "" }, { "docid": "047a7ca0ee278da54480dd8c59c2693a", "score": "0.5272424", "text": "func FieldType(value interface{}) (typ uint8, err error) {\n\tswitch value.(type) {\n\tcase int8, int16, int32, int64, int:\n\t\ttyp = TypeLonglong\n\tcase uint8, uint16, uint32, uint64, uint:\n\t\ttyp = TypeLonglong\n\tcase float32, float64:\n\t\ttyp = TypeDouble\n\tcase string, []byte:\n\t\ttyp = TypeVarString\n\tcase nil:\n\t\ttyp = TypeNull\n\tdefault:\n\t\terr = fmt.Errorf(\"unsupport type %T for resultset\", value)\n\t}\n\treturn\n}", "title": "" }, { "docid": "55b23b0b27d3f4a052118ee646c412c2", "score": "0.52651256", "text": "func (ValCountResult) Type() uint32 { return QueryResultTypeValCount }", "title": "" }, { "docid": "8c4a296f7434b92371c21d69684edfa6", "score": "0.52635556", "text": "func (q *Query) Type(typ interface{}) (Type, error) {\n\tif typ == nil {\n\t\treturn Type{}, fmt.Errorf(\"type could not be nil\")\n\t}\n\treturn Type{typ}, nil\n}", "title": "" }, { "docid": "0a7b4903793ea8715b9d3c6d1f24ae01", "score": "0.5263383", "text": "func (i *IsClosed) Type() sql.Type {\n\treturn types.Boolean\n}", "title": "" }, { "docid": "910096b5b19f6e4defc1a2a77543ded6", "score": "0.52527535", "text": "func (d *SellAllCoinData) Type() Type {\n\treturn TypeSellAllCoin\n}", "title": "" }, { "docid": "cd7dc12d93cb716be3779d23c042cf94", "score": "0.52505", "text": "func (a *Float64Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "3c606dc6628b00a062e5963652c536dd", "score": "0.5250461", "text": "func (a *Uint8Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "d98a46a7942f4b25a761cd117e04af69", "score": "0.5249037", "text": "func (a *Float32FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "39cbda540403ea6ec458c092cb48998f", "score": "0.5248658", "text": "func (c *QueryImpl) Type() string {\n\treturn pkg.TypeOf(c.Query)\n}", "title": "" }, { "docid": "194fefa51437aeceaf071e71a88eca6e", "score": "0.52404684", "text": "func TestGetDataType(t *testing.T) {\n\tt.Log(\"Cleaning of the database ...\")\n\tcleanDatabases(t)\n\n\tt.Log(\"Writing of a new data type ...\")\n\tid := uint(25)\n\tname := \"Type01\"\n\tnetworkProtocol := 8000\n\ttransportProtocol := 45\n\tport := 8080\n\tdataType := DataType{ID: id, Name: name, Forecasting: false, NetworkProtocol: uint(networkProtocol),\n\t\tTransportProtocol: uint(transportProtocol), Port: uint(port)}\n\ttx := databaseConnection.DB.Begin()\n\terr := tx.Create(&dataType).Error\n\tif err != nil {\n\t\ttx.Rollback()\n\t\tt.Fatalf(\"Test failed while creating of a new data type: %s\", err)\n\t}\n\ttx.Commit()\n\n\tt.Log(\"Reading of the data type by id ...\")\n\ttx = databaseConnection.DB.Begin()\n\tfetchedDataType, err01 := statMachine.GetDataType(id)\n\tif err01 != nil {\n\t\tt.Errorf(\"An error occured during reading of the data type from datatabase: %s\", err)\n\t}\n\tif fetchedDataType.ID == 0 {\n\t\tt.Errorf(\"Unexpected fetched data type ID: %d\", fetchedDataType.ID)\n\t}\n\tif fetchedDataType.Port != uint(port) {\n\t\tt.Errorf(\"Expected data type port: %d; given data type port: %d\", port, fetchedDataType.Port)\n\t}\n\tif fetchedDataType.NetworkProtocol != uint(networkProtocol) {\n\t\tt.Errorf(\"Expected data type network protocol: %d; given data type network protocol: %d\",\n\t\t\tnetworkProtocol, fetchedDataType.NetworkProtocol)\n\t}\n\ttx.Commit()\n\n\tt.Log(\"Testing fetching of invalid data type (by id) ...\")\n\ttx = databaseConnection.DB.Begin()\n\tinvalidId := uint(45)\n\t_, err02 := statMachine.GetDataType(invalidId)\n\tif err02 == nil {\n\t\tt.Errorf(\"An error is expected during reading of unknown data type from database but nil \" +\n\t\t\t\"error is thrown.\")\n\t}\n\ttx.Commit()\n}", "title": "" }, { "docid": "63d5be22f8bd52ceb74ece980f1c5e42", "score": "0.5240468", "text": "func (q *Query) GetType() QueryType {\n\tif q.GetCcQuery() != nil {\n\t\treturn ChaincodeQueryType\n\t}\n\tif q.GetConfigQuery() != nil {\n\t\treturn ConfigQueryType\n\t}\n\tif q.GetPeerQuery() != nil {\n\t\treturn PeerMembershipQueryType\n\t}\n\tif q.GetLocalPeers() != nil {\n\t\treturn LocalMembershipQueryType\n\t}\n\treturn InvalidQueryType\n}", "title": "" }, { "docid": "0faaeb4d976f4fde6e4e192c94d84145", "score": "0.5239458", "text": "func (this *Field) Type() value.Type { return value.JSON }", "title": "" }, { "docid": "5a7849cbd163985e7d07650ad9acdd41", "score": "0.52348703", "text": "func Type(v int) predicate.Construction {\n\treturn predicate.Construction(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldType), v))\n\t})\n}", "title": "" }, { "docid": "6ffa1755440ee9e24a4df429929fc932", "score": "0.5234605", "text": "func (m *Measurement) QueryType() string {\n return m.data.QueryType\n}", "title": "" }, { "docid": "d8c89cb107616312575a74f587d5d76f", "score": "0.52273405", "text": "func (a *Int32FullColumn) TypeString() string { return fbs.EnumNamesTypE[int8(a.typE)] }", "title": "" }, { "docid": "76d2692da8abc508b6998b3abd7dec74", "score": "0.52183783", "text": "func (t *jsonTypeImpl) GetDBType() string {\n\treturn \"sa.Text()\"\n}", "title": "" }, { "docid": "87c2497f3a68ef4b5bf6b981e7d69f7d", "score": "0.5205863", "text": "func (m *DB) processTypeInfo(tableName string, column pgColumn, cd *db.ColumnDescription) {\n\n\tswitch column.dataType {\n\tcase \"time without time zone\":\n\t\tfallthrough\n\tcase \"time\":\n\t\tcd.GoType = ColTypeTime.GoType()\n\t\tcd.SubType = \"time\"\n\tcase \"timestamp\":\n\t\tfallthrough\n\tcase \"timestamp with time zone\":\n\t\tcd.GoType = ColTypeTime.GoType()\n\t\tcd.SubType = \"timestamp\"\n\tcase \"datetime\":\n\t\tfallthrough\n\tcase \"timestamp without time zone\":\n\t\tcd.GoType = ColTypeTime.GoType()\n\tcase \"date\":\n\t\tcd.GoType = ColTypeTime.GoType()\n\t\tcd.SubType = \"date\"\n\n\tcase \"boolean\":\n\t\tcd.GoType = ColTypeBool.GoType()\n\n\tcase \"integer\":\n\t\tfallthrough\n\tcase \"int\":\n\t\tcd.GoType = ColTypeInteger.GoType()\n\t\tcd.MinValue = int64(-2147483648)\n\t\tcd.MaxValue = int64(2147483647)\n\t\tcd.MaxCharLength = 11\n\n\tcase \"smallint\":\n\t\tcd.GoType = ColTypeInteger.GoType()\n\t\tcd.MinValue = int64(-32768)\n\t\tcd.MaxValue = int64(32767)\n\t\tcd.MaxCharLength = 6\n\n\tcase \"bigint\": // We need to be explicit about this in go, since int will be whatever the OS native int size is, but go will support int64 always.\n\t\t// Also, since Json can only be decoded into float64s, we are limited in our ability to represent large min and max numbers in the json to about 2^53\n\t\tcd.GoType = ColTypeInteger64.GoType()\n\t\tcd.MinValue = int64(math.MinInt64)\n\t\tcd.MaxValue = int64(math.MaxInt64)\n\t\tcd.MaxCharLength = 20\n\n\tcase \"real\":\n\t\tcd.GoType = ColTypeFloat32.GoType()\n\t\tcd.MinValue = -math.MaxFloat32 // float64 type\n\t\tcd.MaxValue = math.MaxFloat32\n\n\tcase \"double precision\":\n\t\tcd.GoType = ColTypeFloat64.GoType()\n\t\tcd.MinValue = -math.MaxFloat64\n\t\tcd.MaxValue = math.MaxFloat64\n\n\tcase \"character varying\":\n\t\tcd.GoType = ColTypeString.GoType()\n\t\tcd.MaxCharLength = uint64(column.characterMaxLen.Int64)\n\n\tcase \"char\":\n\t\tcd.GoType = ColTypeString.GoType()\n\t\tcd.MaxCharLength = uint64(column.characterMaxLen.Int64)\n\n\tcase \"bytea\":\n\t\tcd.GoType = ColTypeBytes.GoType()\n\t\tcd.MaxCharLength = 65535\n\n\tcase \"text\":\n\t\tcd.GoType = ColTypeString.GoType()\n\t\tcd.MaxCharLength = 65535\n\n\tcase \"numeric\":\n\t\t// No native equivalent in Go.\n\t\t// See the shopspring/decimal package for support.\n\t\t// You will need to shepherd numbers into and out of string format to move data to the database.\n\t\tcd.GoType = ColTypeString.GoType()\n\t\tcd.MaxCharLength = uint64(column.characterMaxLen.Int64) + 3\n\n\tcase \"year\":\n\t\tcd.GoType = ColTypeInteger.GoType()\n\n\tdefault:\n\t\tcd.GoType = ColTypeString.GoType()\n\t}\n\n\tcd.NativeType = column.dataType\n\tcd.DefaultValue = getDefaultValue(column.defaultValue, ColTypeFromGoTypeString(cd.GoType))\n}", "title": "" }, { "docid": "62903aabd0dd51631c56efaac7f0d8a3", "score": "0.5202913", "text": "func (c objectCollectionInfo) ObjectType() *ObjectType { return c.DataTypeInfo.ObjectType }", "title": "" }, { "docid": "d237616ed85feb5f25d30314b2b7f237", "score": "0.52005994", "text": "func (cr *CatalogResult) Type() (CatalogData, error) {\n\tif cr.Catalog.Data != nil || cr.err != nil {\n\t\treturn cr.Catalog, cr.err\n\t}\n\tres := &CatalogData{}\n\n\tcr.err = json.Unmarshal(cr.data, res)\n\tcr.Catalog.Data = res.Data\n\n\treturn cr.Catalog, cr.err\n}", "title": "" }, { "docid": "179a746de6ced274dd85b4ca11f96101", "score": "0.5200322", "text": "func (m *AccessReviewNotificationRecipientQueryScope) GetQueryType()(*string) {\n val, err := m.GetBackingStore().Get(\"queryType\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.(*string)\n }\n return nil\n}", "title": "" }, { "docid": "9bf54baecbe89adcab80f20eaa729f72", "score": "0.519454", "text": "func (d *KVKeysQuery) Type() Type {\n\treturn TypeConsul\n}", "title": "" }, { "docid": "7682789632688c749b7ae32af4bde5cc", "score": "0.5193984", "text": "func (l *Length) Type() sql.Type { return types.Int32 }", "title": "" }, { "docid": "4ee1f1c3e0827cb251f379c63b1c5138", "score": "0.51913756", "text": "func SQLType2Type(dbField DbField) reflect.Type {\n\n\tstrTypes := strings.Split(dbField.Type, \" \")\n\n\tdbType := strTypes[0]\n\n\tif i := strings.Index(dbType, \"(\"); i > 0 {\n\t\tdbType = dbType[0:i]\n\t}\n\n\tvar ret reflect.Type\n\n\tname := strings.ToUpper(dbType)\n\tswitch name {\n\tcase Bit, TinyInt, SmallInt, MediumInt, Int, Integer, Serial:\n\t\tret = reflect.TypeOf(1)\n\tcase BigInt, BigSerial:\n\t\tret = reflect.TypeOf(int64(1))\n\tcase Float, Real:\n\t\tret = reflect.TypeOf(float32(1))\n\tcase Double:\n\t\tret = reflect.TypeOf(float64(1))\n\tcase Char, Varchar, NVarchar, TinyText, Text, NText, MediumText, LongText, Enum, Set, Uuid, Clob, SysName:\n\t\tret = reflect.TypeOf(\"\")\n\tcase TinyBlob, Blob, LongBlob, Bytea, Binary, MediumBlob, VarBinary, UniqueIdentifier:\n\t\tret = reflect.TypeOf([]byte{})\n\tcase Bool:\n\t\tret = reflect.TypeOf(true)\n\tcase DateTime, Date, Time, TimeStamp, TimeStampz:\n\t\tret = reflect.TypeOf(time.Time{})\n\tcase Decimal, Numeric:\n\t\tret = reflect.TypeOf(\"\")\n\tdefault:\n\t\tret = reflect.TypeOf(\"\")\n\t}\n\n\tif dbField.Null == \"YES\" {\n\t\tret = reflect.PtrTo(ret)\n\t}\n\n\treturn ret\n}", "title": "" }, { "docid": "34f9865dc6f6b12c1059742095546dfb", "score": "0.51886773", "text": "func (m *BxhTransaction) GetType() byte {\n\treturn byte(m.Typ)\n}", "title": "" }, { "docid": "f6c795d8b2f157c1f772522acceeac2b", "score": "0.5186427", "text": "func (o *Contract) GetType() *Type {\n\tif o == nil {\n\t\treturn nil\n\t}\n\n\treturn o.Type\n\n}", "title": "" }, { "docid": "239b89cc3dbeaaea53c482db3b57900e", "score": "0.5186349", "text": "func (*Range) GormDataType() string {\n\treturn \"jsonb\"\n}", "title": "" }, { "docid": "06fbc5e097d3883ecbbe51df26224563", "score": "0.51859665", "text": "func (gl *genericLiteral) Datatype() IRI {\n\treturn gl.datatype\n}", "title": "" }, { "docid": "e828106117f79f03e59ac3be30631d71", "score": "0.5185618", "text": "func (a *Int16Column) Type() int8 { return a.typE }", "title": "" }, { "docid": "b4617acb870798bdc1af2f6161a2c9b9", "score": "0.5182881", "text": "func (a *Float64FullColumn) Type() int8 { return a.typE }", "title": "" }, { "docid": "559fa5300e659d92cc520f59ec392470", "score": "0.5181335", "text": "func (CountItem) Type() uint32 { return QueryResultTypePairField }", "title": "" }, { "docid": "5bfc2e4eddeef99640369053de6e190c", "score": "0.51800174", "text": "func (NonMarketEntityDTO_CloudServiceData_BillingData_Type) EnumDescriptor() ([]byte, []int) {\n\treturn file_NonMarketEntityDTO_proto_rawDescGZIP(), []int{0, 0, 0, 0}\n}", "title": "" }, { "docid": "bc65ae12de7da5004b2871c4940a219c", "score": "0.5177225", "text": "func (typ *gqlType) OfType() *gqlType {\n\tswitch {\n\tcase !typ.isNullable():\n\t\treturn typ.toNullable()\n\tcase typ.isList():\n\t\treturn typ.listElem\n\tdefault:\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "7344f713ba9f99dc922500baba7c5702", "score": "0.51726717", "text": "func (a *Int16FullColumn) Type() int8 { return a.typE }", "title": "" } ]
6af6fe9dad65f95e5a05f9ae25b3b7f0
Deprecated: Use GetDLQReplicationMessagesRequest.ProtoReflect.Descriptor instead.
[ { "docid": "1d2487a3fc8f547cb9d2563e286d9773", "score": "0.7831509", "text": "func (*GetDLQReplicationMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{16}\n}", "title": "" } ]
[ { "docid": "ac1d582a964d05a721f95f652f03d57d", "score": "0.74949443", "text": "func (*GetDomainReplicationMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "6156d442eee6dbeb1260130aaab2991d", "score": "0.73355556", "text": "func (*GetReplicationMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "ae3e1c0d161640d5083af4ad0282c504", "score": "0.7263937", "text": "func (*ReadDLQMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{26}\n}", "title": "" }, { "docid": "6516687a586b90dd90244c07886fac18", "score": "0.7153575", "text": "func (*GetDLQReplicationMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "cf8d13cdc633bbcc3996b1f1cafdfae8", "score": "0.68575567", "text": "func (*MergeDLQMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{30}\n}", "title": "" }, { "docid": "a7f217eeedc887e6c62cdd23485ec176", "score": "0.6807181", "text": "func (*PurgeDLQMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "68326492712a0b61a78d3f9c93f0fe4a", "score": "0.67462677", "text": "func (*GetDomainReplicationMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{19}\n}", "title": "" }, { "docid": "6f31e6c43726faeeb6d00584610e27cd", "score": "0.6681786", "text": "func (*GetReplicationMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "b3204ef96e5a020cfcb75b60e0ec1623", "score": "0.65904135", "text": "func (*ReadDLQMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "be2fb4a8053a8a386186978cd465d3da", "score": "0.6529364", "text": "func (*MessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_rpc_proto_rawDescGZIP(), []int{31}\n}", "title": "" }, { "docid": "987ccc484762ab156c860f75a8840fd9", "score": "0.6459793", "text": "func (*GetMessagesReq) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0b4aa6430955f72dabdbf417ebbdc4b2", "score": "0.63032156", "text": "func (*DeleteMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{10}\n}", "title": "" }, { "docid": "40f2f3a82a038be989ce401bb66059c1", "score": "0.6269968", "text": "func (x *fastReflection_QueryGroupsRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryGroupsRequest\n}", "title": "" }, { "docid": "3f797307e42680c0f52cc0a8fd3f4a58", "score": "0.62434846", "text": "func (*MergeDLQMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{31}\n}", "title": "" }, { "docid": "11559108ca996a11e3637fe833f153f1", "score": "0.62006783", "text": "func (*GetMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_secure_messaging_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "b9abc4f4035d7b7179e406ade05f760f", "score": "0.617882", "text": "func (*PurgeDLQMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_admin_v1_service_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "f26bdfd4ccff131669e9a1dc2ed6ee7d", "score": "0.61775637", "text": "func (x *fastReflection_QueryBatchesRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryBatchesRequest\n}", "title": "" }, { "docid": "50c748a0290861ad743d3181aa49d11d", "score": "0.61720043", "text": "func (x *fastReflection_QueryGroupMembersRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryGroupMembersRequest\n}", "title": "" }, { "docid": "b996ef7b3d33499035126f64a692a56d", "score": "0.6162521", "text": "func (*GetMyMessagesRequest) Descriptor() ([]byte, []int) {\n\treturn file_traces_api_user_user_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b942fbe85b6589ad79fcee455a2cccda", "score": "0.6139184", "text": "func (*DeleteMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_data_proto_rawDescGZIP(), []int{13}\n}", "title": "" }, { "docid": "a778ee91e98eee5816f2367fb53adc40", "score": "0.6114987", "text": "func (x *fastReflection_QueryGroupsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tcase \"cosmos.group.v1.QueryGroupsRequest.pagination\":\n\t\tvalue := x.Pagination\n\t\treturn protoreflect.ValueOfMessage(value.ProtoReflect())\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1.QueryGroupsRequest\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1.QueryGroupsRequest does not contain field %s\", descriptor.FullName()))\n\t}\n}", "title": "" }, { "docid": "06906f8737ef1c3669061470c2498c55", "score": "0.60900605", "text": "func (x *fastReflection_QueryGroupInfoRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryGroupInfoRequest\n}", "title": "" }, { "docid": "ac770a053f3d057a86874371fc2f9187", "score": "0.6078803", "text": "func (*BatchGetNotificationChannelsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_notification_channel_service_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "ab7d7fd0e865dd3205b53279635ac2d6", "score": "0.6077551", "text": "func (*Message176) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{8}\n}", "title": "" }, { "docid": "ed375884da57b0e9ea1d9cce9ce6829e", "score": "0.6067201", "text": "func (x *fastReflection_MsgUpdateCurator) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateCurator\n}", "title": "" }, { "docid": "90fe99f416e83a51c45ffed95a0197d3", "score": "0.6067065", "text": "func (*DeprecateDomainRequest) Descriptor() ([]byte, []int) {\n\treturn file_uber_cadence_api_v1_service_domain_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "c7c6b42992b37f77b73911e8d0de4c07", "score": "0.60555714", "text": "func (x *fastReflection_QueryBatchInfoRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryBatchInfoRequest\n}", "title": "" }, { "docid": "6c291696890680b8c27a40c8a21b4d4f", "score": "0.60414743", "text": "func (*Message8184) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{35}\n}", "title": "" }, { "docid": "46b62c8ac230c6a60304d05e3f60c237", "score": "0.6027588", "text": "func (x *fastReflection_QueryGroupPolicyInfoRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryGroupPolicyInfoRequest\n}", "title": "" }, { "docid": "563c42b721b24de89f5cf08488e009f9", "score": "0.6017231", "text": "func (*Message10800) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_7_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "d729d422175d4aca2871270c9f097ea3", "score": "0.60159326", "text": "func (*GetChannelListRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_chat_chat_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "6ef91cc03d076ff561b495d352270836", "score": "0.6012126", "text": "func (x *fastReflection_QueryProposalRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryProposalRequest\n}", "title": "" }, { "docid": "f9c60ea6720cb5df2cc7258d1eeaf502", "score": "0.60087615", "text": "func (*GetMessagesRes) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "329295e1870024cfab0051f719c8f738", "score": "0.60001796", "text": "func (*GetMyMessagesReply) Descriptor() ([]byte, []int) {\n\treturn file_traces_api_user_user_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "6256e7dc8dc7223d57f1dcbdcd931e78", "score": "0.5994067", "text": "func (*GetMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{6}\n}", "title": "" }, { "docid": "0b7d864004f2a795a9057b2c9296a948", "score": "0.59739274", "text": "func (x *fastReflection_MsgUpdateGroupMembers) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateGroupMembers\n}", "title": "" }, { "docid": "c46b198bdb1e9ce7dce01026a0f78f46", "score": "0.5963555", "text": "func (*Message12748) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{22}\n}", "title": "" }, { "docid": "6f467276772a99ca3fc438ecf92ef2c7", "score": "0.5956753", "text": "func (*NotifyInterviewScheduleDeletedRequest) Descriptor() ([]byte, []int) {\n\treturn file_protos_service_jobseeker_notification_service_grpc_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "17b6851d66cdfd62eae9760936679edd", "score": "0.5948639", "text": "func (*ListNotificationChannelsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_notification_channel_service_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "3046e4731bb4d9ab68cd6580fa851dce", "score": "0.59472764", "text": "func (*Message10802) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_7_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "d3513a02d65b802c223cad7bf71676d4", "score": "0.59428114", "text": "func (*Message18253_Message18254) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{18, 0}\n}", "title": "" }, { "docid": "54c44f2e22a37cc08d7c06903b2693c8", "score": "0.5939257", "text": "func (*ConfigDiffRequest) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{9}\n}", "title": "" }, { "docid": "96b7d3c52357b8238f7c4e4593f9127e", "score": "0.59325916", "text": "func (*Message18253) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "e9e5ff06f1863dbf1bfe7b588fbbdaff", "score": "0.5931304", "text": "func (*SignMessagesRequest_Message) Descriptor() ([]byte, []int) {\n\treturn file_api_proto_rawDescGZIP(), []int{79, 0}\n}", "title": "" }, { "docid": "4199704349e5fd85e7701b6786040fd2", "score": "0.5927396", "text": "func (*DTCRequest) Descriptor() ([]byte, []int) {\n\treturn file_messages_proto_rawDescGZIP(), []int{32}\n}", "title": "" }, { "docid": "6d33f67414cc9535432bc64252cb53bd", "score": "0.5924181", "text": "func (*WatchNotificationChannelsRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_notification_channel_service_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "1f27b08c202c369da7d461f887dfee01", "score": "0.59199506", "text": "func (*Message176_Message178) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{8, 0}\n}", "title": "" }, { "docid": "5f80343d0374263e8653ccd9f827c110", "score": "0.59155804", "text": "func (*Message18944) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{25}\n}", "title": "" }, { "docid": "14dacc4c05ab26e02c4cf89de34bd84a", "score": "0.5912406", "text": "func (*SendMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_secure_messaging_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "b5fa759338386a3cf8032d430dc2c4b5", "score": "0.5902318", "text": "func (*Message12910) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{18}\n}", "title": "" }, { "docid": "59c0f98a24e285a55932a0a23863a920", "score": "0.5901712", "text": "func (*MessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_twilio_twilio_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "273b822af72135882a9770bec3393ae3", "score": "0.5900997", "text": "func (*DeleteClusterAdminRequest) Descriptor() ([]byte, []int) {\n\treturn file_ras_messages_v1_admin_messages_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "00e6769e301d09c6fc3947dd49b83451", "score": "0.5886241", "text": "func (*Message3804) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "49845914eddb0ae58e0a0471681ff6c6", "score": "0.5885936", "text": "func (*GetNotificationChannelRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_notification_channel_service_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "5c83af132aed5fd05a9b45d6c3e787cc", "score": "0.58850366", "text": "func (*Messages) Descriptor() ([]byte, []int) {\n\treturn file_service_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "a0468b3054c799931302262b1745b768", "score": "0.5884018", "text": "func (x *fastReflection_MsgUpdateGroupMetadata) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgUpdateGroupMetadata\n}", "title": "" }, { "docid": "4b13404695dd9eb1e75527f6ebb510b2", "score": "0.5882727", "text": "func (*NonStandardUpdateRequest) Descriptor() ([]byte, []int) {\n\treturn file_examples_internal_proto_examplepb_non_standard_names_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "562453bcf980c97804ba6e8e3789faa5", "score": "0.5880697", "text": "func (*CGCToGCMsgRoutedReply) Descriptor() ([]byte, []int) {\n\treturn file_gcsdk_gcmessages_proto_rawDescGZIP(), []int{15}\n}", "title": "" }, { "docid": "d7443e2ee5f1eb1fa3c2a288c8bf3d0d", "score": "0.5877709", "text": "func (*ListMessagesResponse) Descriptor() ([]byte, []int) {\n\treturn file_simple_chat_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "5f765330780af5f45bf0a2c6b2f4fc2d", "score": "0.5874132", "text": "func (*RPCMsg) Descriptor() ([]byte, []int) {\n\treturn file_rpcMsg_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "67c04b8827aedd3c0d8e4626d55e82cb", "score": "0.5872183", "text": "func (*GetNotificationsRequest) Descriptor() ([]byte, []int) {\n\treturn file_notification_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "ae40efa3125b9a87679009f15fe0d53f", "score": "0.58712983", "text": "func (*Message3069) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{27}\n}", "title": "" }, { "docid": "fda867d29228be62bd4c89578b6b294e", "score": "0.58677775", "text": "func (*Message12687) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{23}\n}", "title": "" }, { "docid": "81f7c2e7ab753c1026796069e70a1338", "score": "0.58668256", "text": "func (*Message715) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_5_proto_rawDescGZIP(), []int{44}\n}", "title": "" }, { "docid": "a22f880d28319f35ffb62a731a12af88", "score": "0.5859275", "text": "func (*Message16816_Message16818) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{20, 1}\n}", "title": "" }, { "docid": "d4c522dd7b0720cf852ad93fab0df068", "score": "0.5859082", "text": "func (x *fastReflection_QueryNFTRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryNFTRequest\n}", "title": "" }, { "docid": "fa0a66a32e0ef91802d2eb04ec63b36c", "score": "0.5858824", "text": "func (x *fastReflection_QueryGroupMembersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {\n\tswitch descriptor.FullName() {\n\tcase \"cosmos.group.v1.QueryGroupMembersRequest.group_id\":\n\t\tvalue := x.GroupId\n\t\treturn protoreflect.ValueOfUint64(value)\n\tcase \"cosmos.group.v1.QueryGroupMembersRequest.pagination\":\n\t\tvalue := x.Pagination\n\t\treturn protoreflect.ValueOfMessage(value.ProtoReflect())\n\tdefault:\n\t\tif descriptor.IsExtension() {\n\t\t\tpanic(fmt.Errorf(\"proto3 declared messages do not support extensions: cosmos.group.v1.QueryGroupMembersRequest\"))\n\t\t}\n\t\tpanic(fmt.Errorf(\"message cosmos.group.v1.QueryGroupMembersRequest does not contain field %s\", descriptor.FullName()))\n\t}\n}", "title": "" }, { "docid": "04eec0fa2789d9ec8817951c34ce2059", "score": "0.58578616", "text": "func (*SendMessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_grpc_chat_chat_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "7e8067d5649e869f4ea6078f8a16cd56", "score": "0.5855831", "text": "func (*Message8449) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_5_proto_rawDescGZIP(), []int{34}\n}", "title": "" }, { "docid": "0a72a027806a00f5b05af324d121fe7f", "score": "0.5852499", "text": "func (*Message704) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_5_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "7f193e01bc04d77b174893283e628886", "score": "0.58505094", "text": "func (*Message10391) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "ee22ec0b0c6ed345d9155ba195705bad", "score": "0.58497876", "text": "func (*Message18943) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{24}\n}", "title": "" }, { "docid": "2bb0998749dba20f3ca26e3fd904ac7c", "score": "0.5849724", "text": "func (*Message12948) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{28}\n}", "title": "" }, { "docid": "1403a847a4033630e2eab5796cabbc40", "score": "0.58478653", "text": "func (*Message12908) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "f82a7617b7ac78b40c34ce78869b9636", "score": "0.5846251", "text": "func (*Message16480) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{43}\n}", "title": "" }, { "docid": "988966ea7b6247f3616b0806a44214cd", "score": "0.58452165", "text": "func (*Message24400) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_5_proto_rawDescGZIP(), []int{2}\n}", "title": "" }, { "docid": "78986150826b855ddc4c427dbb9c6416", "score": "0.58448833", "text": "func (*GetUpdatedRetrievalRecordsSinceRequest) Descriptor() ([]byte, []int) {\n\treturn file_powergate_admin_v1_admin_proto_rawDescGZIP(), []int{29}\n}", "title": "" }, { "docid": "6c6510fc0a8f36a2d3c467b8b4c72790", "score": "0.5842472", "text": "func (*Private_Message) Descriptor() ([]byte, []int) {\n\treturn file_proto_private_proto_rawDescGZIP(), []int{0, 0}\n}", "title": "" }, { "docid": "ad5b04d3eae765be6f1a15b7707741d4", "score": "0.5837423", "text": "func (*RequestMessage) Descriptor() ([]byte, []int) {\n\treturn file_pkg_dashproto_dashproto_proto_rawDescGZIP(), []int{5}\n}", "title": "" }, { "docid": "8c4a861647e5cdece81484f7a8337743", "score": "0.58322793", "text": "func (*Message24346) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "0025945200ecc8e17090df079b1d344e", "score": "0.58314705", "text": "func (*Message730) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{7}\n}", "title": "" }, { "docid": "53110634d960a2faef233b6c120e4de0", "score": "0.58274585", "text": "func (*Message12559) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{41}\n}", "title": "" }, { "docid": "e4d4bede8f8b2ec149b459f3947175a0", "score": "0.58262223", "text": "func (*Message12903) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{35}\n}", "title": "" }, { "docid": "5f8e31310944cdc36e7371a046d04ea1", "score": "0.5825613", "text": "func (*MessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{1}\n}", "title": "" }, { "docid": "aa4201a3c3df32a486dc657f34129974", "score": "0.58226883", "text": "func (*Message6024) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_5_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "22565ec53e1483a1066334c1f89764ee", "score": "0.5822519", "text": "func (*GetChangesRequest) Descriptor() ([]byte, []int) {\n\treturn file_pkg_serverpb_api_proto_rawDescGZIP(), []int{17}\n}", "title": "" }, { "docid": "8b7cba08d40901e71ff1dc5d0754eb1c", "score": "0.58188426", "text": "func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_QueryParamsRequest\n}", "title": "" }, { "docid": "f3e4b8fe947b714db3a7af3d919ef6d7", "score": "0.581576", "text": "func (*UnSubRequest) Descriptor() ([]byte, []int) {\n\treturn file_proto_message_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "ae163201a1de679d7b4097d1763fd67a", "score": "0.5814534", "text": "func (*MessageRequest) Descriptor() ([]byte, []int) {\n\treturn file_message_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "b5d3dab22a22fad97901e8bf856e8612", "score": "0.5813501", "text": "func (*DeleteNotificationChannelRequest) Descriptor() ([]byte, []int) {\n\treturn edgelq_monitoring_proto_v3_notification_channel_service_proto_rawDescGZIP(), []int{11}\n}", "title": "" }, { "docid": "e2ee75d6c9c009fadd1ee72bde4474f6", "score": "0.581243", "text": "func (*Message24379) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{3}\n}", "title": "" }, { "docid": "05068b6b8c4714fe84f18e7f22abaf02", "score": "0.5811977", "text": "func (*ContainerRemovedRequest) Descriptor() ([]byte, []int) {\n\treturn file_syncano_codebox_lb_v1_workerplug_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "fcb5e3ffb432010213cb2a7751970fef", "score": "0.5809807", "text": "func (*Message12979) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{30}\n}", "title": "" }, { "docid": "4c8bb5a0f5b3a05338c144074b3ebad6", "score": "0.5808681", "text": "func (x *fastReflection_MsgCreate) Descriptor() protoreflect.MessageDescriptor {\n\treturn md_MsgCreate\n}", "title": "" }, { "docid": "194890ad223c66350ebed21ea7a20150", "score": "0.58077514", "text": "func (*Message35506) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{16}\n}", "title": "" }, { "docid": "87286eb5a598951a942717e4acf60fd3", "score": "0.580738", "text": "func (*Message8848) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message4_benchmark_message4_proto_rawDescGZIP(), []int{14}\n}", "title": "" }, { "docid": "61e4e923e2c849ece120a4277a783508", "score": "0.580659", "text": "func (*GetAgentVersionRequest) Descriptor() ([]byte, []int) {\n\treturn file_ras_messages_v1_admin_messages_proto_rawDescGZIP(), []int{0}\n}", "title": "" }, { "docid": "3982c642e22979c2ac740b3ea089ae8c", "score": "0.58065826", "text": "func (*QueryGroupMembersRequest) Descriptor() ([]byte, []int) {\n\treturn file_cosmos_group_v1_query_proto_rawDescGZIP(), []int{4}\n}", "title": "" }, { "docid": "c25d0b09a59204db291f2b73d6aabf7b", "score": "0.5806325", "text": "func (*Message10818) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_5_proto_rawDescGZIP(), []int{20}\n}", "title": "" }, { "docid": "f93d7881302f242584aeaf1a999170d4", "score": "0.58062977", "text": "func (*Message18856) Descriptor() ([]byte, []int) {\n\treturn file_datasets_google_message3_benchmark_message3_4_proto_rawDescGZIP(), []int{26}\n}", "title": "" } ]
4634359cd4f78c536f88b29c44aa3bc9
Returns the the board array Primarily so we can compare boards
[ { "docid": "f2173f24ec7b64a9bc7fc7ffb0e174ff", "score": "0.57232034", "text": "func (board *SudokuBoard) GetBoardString() string {\n\treturn fmt.Sprintf(\"%v\", board.boardArray)\n}", "title": "" } ]
[ { "docid": "5bf0b4838c9c5ff41685ec4f8da97cab", "score": "0.7081139", "text": "func NewBoard() Board {\n\tb := make([][]Piece, 6)\n\tfor r := 0; r < 6; r++ {\n\t\tb[r] = make([]Piece, 6)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "1c07a34846e5acbe0045d1a70c9c799b", "score": "0.7065988", "text": "func NewBoard() Board {\n\tout := make([][]int, 10)\n\tfor idx, _ := range out {\n\t\tout[idx] = make([]int, 10)\n\t}\n\treturn out\n}", "title": "" }, { "docid": "38056771c44bfe5eae41e5e7501b78f4", "score": "0.70488924", "text": "func newBoard() (b Board) {\n\tb = make([][]int, 10)\n\tfor i := range b {\n\t\tb[i] = make([]int, 10)\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "aabaab8a3e35301f08107dee9d3d9fe5", "score": "0.69545245", "text": "func (field *Field) GetBoard() (board [][]Node) {\r\n\treturn field.board\r\n}", "title": "" }, { "docid": "c1f823506690d13b17373610014a849b", "score": "0.6511929", "text": "func initBoard(width, height int) [][]int {\n\tvar colors = flag.Bool(\"colors\", true, \"enable or disable colors\")\n\tau = aurora.NewAurora(*colors)\n\tboard := make([][]int, height)\n\tfor i := 0; i < len(board); i++ {\n\t\tboard[i] = make([]int, width)\n\t}\n\treturn board\n}", "title": "" }, { "docid": "9460f806faa269a89657cf19602a4c26", "score": "0.6472464", "text": "func newBoard(size int) GameBoard {\n\toutBoard := GameBoard{}\n\ta := make([][]byte, size)\n\tfor i := range a {\n\t\ta[i] = make([]byte, size)\n\t}\n\toutBoard.Positions = a\n\treturn outBoard\n}", "title": "" }, { "docid": "353cfcf698274f5e3c2b706348aec9e9", "score": "0.6471878", "text": "func GetBoards() ([]Board, error) {\n\tif len(localBoards) == 0 {\n\t\terr := loadBoards()\n\t\tif err != nil {\n\t\t\treturn []Board{}, err\n\t\t}\n\t}\n\tboardList := []Board{}\n\tfor _, board := range localBoards {\n\t\tboardList = append(boardList, board)\n\t}\n\treturn boardList, nil\n}", "title": "" }, { "docid": "bdba57792c6f68c4187f167b0b6913af", "score": "0.63635296", "text": "func NewBoard(h, w int) Board {\n\n\tif h*w == 0 {\n\t\treturn nil\n\t}\n\n\tboard := make([][]Color, h)\n\tcells := make([]Color, h*w)\n\n\tfor i := range board {\n\t\tboard[i], cells = cells[:w], cells[w:]\n\t}\n\n\th, w = Board(board).Caps()\n\n\treturn board\n}", "title": "" }, { "docid": "1aca0ed9e838b317badd11cdfb4f5927", "score": "0.6358342", "text": "func buildBoard() [][]string {\n\trows := 3\n\tcolumns := 3\n\tboard := make([][]string, rows)\n\tfor row := range board {\n\t\tboard[row] = make([]string, columns)\n\t\tfor column := range board[row] {\n\t\t\tboard[row][column] = \" \"\n\t\t}\n\t}\n\treturn board\n}", "title": "" }, { "docid": "c0eba1c5bc29058c087fb510004ca120", "score": "0.6349214", "text": "func newBoard() *board {\n\tvar b board\n\tfor i := 0; i < len(b); i++ {\n\t\tfor j := 0; j < len(b[i]); j++ {\n\t\t\tb[i][j] = \"_\"\n\t\t}\n\t}\n\n\treturn &b\n}", "title": "" }, { "docid": "3315c9135ba59a601fe6d17eaefcbaa1", "score": "0.6342105", "text": "func copyBoard(board [][]int) [][]int {\n\tnewBoard := make([][]int, len(board))\n\tfor i := 0; i < len(newBoard); i++ {\n\t\tnewBoard[i] = make([]int, len(board[i]))\n\t}\n\n\tfor i := 0; i < len(board); i++ {\n\t\tfor j := 0; j < len(board[i]); j++ {\n\t\t\tnewBoard[i][j] = board[i][j]\n\t\t}\n\t}\n\n\treturn newBoard\n}", "title": "" }, { "docid": "78ffd4edca48e89bf7b6a6cb920c7f3e", "score": "0.6339212", "text": "func NewBoard() *Board {\n\tb := Board{}\n\tfor i := 0; i < boardSize; i++ {\n\t\tvar row []Tile\n\t\tfor j := 0; j < boardSize; j++ {\n\t\t\trow = append(row, empty)\n\t\t}\n\t\tb = append(b, row)\n\t}\n\treturn &b\n}", "title": "" }, { "docid": "7ebee4b6e835ef6523d320c1e41d8dac", "score": "0.6328152", "text": "func (s square) check_row() []int {\n var nums = make([]int, 9, 9)\n\n count := 0\n for i := 0; i < 9; i++ {\n nums[count] = big_board[s.row][i].num\n count++\n }\n return nums\n}", "title": "" }, { "docid": "a3ecc9859496c2c67b88f4525ba260a5", "score": "0.6261547", "text": "func (m *Match) Board() Board {\n\treturn m.current\n}", "title": "" }, { "docid": "552bc18a644719ce14c258ed7b24968f", "score": "0.62602997", "text": "func NewBoard() *Bitboard {\n\tboard := new(Bitboard)\n\tboard.Pawns[WHITE] = RANK_2\n\tboard.Pawns[BLACK] = RANK_7\n\tboard.Knights[WHITE] = (RANK_1 & FILE_B) | (RANK_1 & FILE_G)\n\tboard.Knights[BLACK] = (RANK_8 & FILE_B) | (RANK_8 & FILE_G)\n\tboard.Bishops[WHITE] = (RANK_1 & FILE_C) | (RANK_1 & FILE_F)\n\tboard.Bishops[BLACK] = (RANK_8 & FILE_C) | (RANK_8 & FILE_F)\n\tboard.Rooks[WHITE] = (RANK_1 & FILE_A) | (RANK_1 & FILE_H)\n\tboard.Rooks[BLACK] = (RANK_8 & FILE_A) | (RANK_8 & FILE_H)\n\tboard.Queen[WHITE] = (RANK_1 & FILE_D)\n\tboard.Queen[BLACK] = (RANK_8 & FILE_D)\n\tboard.King[WHITE] = (RANK_1 & FILE_E)\n\tboard.King[BLACK] = (RANK_8 & FILE_E)\n\treturn board\n}", "title": "" }, { "docid": "96c091c680fef78080e396db19c13577", "score": "0.623393", "text": "func (s square) check_column() []int {\n var nums = make([]int, 9, 9)\n\n count := 0\n for i := 0; i < 9; i++ {\n nums[count] = big_board[i][s.col].num\n count++\n }\n return nums\n}", "title": "" }, { "docid": "fadbf1dcbe1a6b346094b8f8a103bcf5", "score": "0.6147672", "text": "func (g *State) Board() Board {\n\treturn g.History[len(g.History)-1]\n}", "title": "" }, { "docid": "c2df7a7c1345dd7c38d586bce236a163", "score": "0.61207366", "text": "func (b Board) GetPrintableBoard() string {\n\toutput := \"\"\n\tsize := len(b.Layout[0])\n\tfor r := 0; r < size; r++ {\n\t\tfor c := 0; c < size; c++ {\n\t\t\toutput += string(b.Layout[r][c]) + \" \"\n\t\t}\n\t\toutput = output[:len(output)-1] + \"\\n\"\n\t}\n\treturn output\n}", "title": "" }, { "docid": "cb62e5e34936936c392c28e766b7c7de", "score": "0.6089565", "text": "func (b board) showBoard() {\n\tfmt.Println(\"#### Game Board ####\")\n\tfor _, j := range b.tiles {\n\t\tfmt.Println(j)\n\t}\n}", "title": "" }, { "docid": "4d37681cdb6cb0af1ae2831222ce7268", "score": "0.6076746", "text": "func (g *Game) Board() interfaces.Board {\n\treturn g.board\n}", "title": "" }, { "docid": "11428b7053744e0c1251bc8b6f4c8727", "score": "0.6041768", "text": "func (sensors *Sensors) getBoardState(x int, y int) int {\n\treturn sensors.net[y+x*8]\n}", "title": "" }, { "docid": "06907755f5f56a72bcbc2c6f7dcfe52d", "score": "0.60316515", "text": "func NewBoard(width, height int) (Board, error) {\n\tif width <= 1 {\n\t\treturn nil, fmt.Errorf(\"board width must be greater than 1\")\n\t}\n\tif height <= 1 {\n\t\treturn nil, fmt.Errorf(\"board height must be greater than 1\")\n\t}\n\n\tb := make(Board, width, width)\n\tfor x := range b {\n\t\tb[x] = make([]int, height, height)\n\n\t\tfor y := range b[x] {\n\t\t\tb.resetTile(x, y)\n\t\t}\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "5d47af3470e50bac05db244f5cff6e85", "score": "0.6009224", "text": "func (p *Project) GetBoards(ctx context.Context) (BoardList, error) {\n\tboards := make([]*Board, 0, 5)\n\n\tif err := db.GetEngine(ctx).Where(\"project_id=? AND `default`=?\", p.ID, false).OrderBy(\"Sorting\").Find(&boards); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefaultB, err := p.getDefaultBoard(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn append([]*Board{defaultB}, boards...), nil\n}", "title": "" }, { "docid": "e28ce65954af9a2d41278b7c1520e720", "score": "0.5998498", "text": "func printBoard(board [][]byte) {\n\t// fmt.Println(string(board[0][1]))\n\tfmt.Println()\n\tfor _, row := range board {\n\t\tfor _, cell := range row {\n\t\t\tfmt.Print(string(cell), \" \")\n\t\t}\n\t\tfmt.Println()\n\t}\n\tfmt.Print(\"\\n\")\n}", "title": "" }, { "docid": "2b9a6dcc47fa21f0e530d47a59f3b1d4", "score": "0.5995428", "text": "func InitBoard() {\n\tfor i := 0; i < UPPERBOUND+1; i++ {\n\t\tBoard[i] = make([]string, UPPERBOUND+1)\n\t\tfor j := 0; j < UPPERBOUND+1; j++ {\n\t\t\tBoard[i][j] = \"e:e\"\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0535e6ad6bf25c8822ea61dcf29a4bec", "score": "0.59899074", "text": "func GetExample() base.Board {\n\t// true: 14\n\t//b := [base.size][base.size]int{\n\t//\t{2, 3, 6, 4},\n\t//\t{1, 5, 7, 8},\n\t//\t{9, 14, 10, 11},\n\t//\t{13, 15, 12, 0},\n\t//}\n\t// true: 20, slightly better with H3, but makes no sense since the path is so short\n\tb := [size][size]int{\n\t\t{2, 3, 7, 6},\n\t\t{1, 0, 5, 4},\n\t\t{9, 14, 10, 8},\n\t\t{13, 15, 12, 11},\n\t}\n\t// true: 30, BFS and IDDFS cannot be used from now on\n\t//b := [base.size][base.size]int{\n\t//\t{2, 7, 5, 6},\n\t//\t{1, 3, 10, 4},\n\t//\t{13, 14, 0, 8},\n\t//\t{15, 9, 12, 11},\n\t//}\n\t// true: 46\n\t//b := [base.size][base.size]int{\n\t//\t{7, 8, 5, 6},\n\t//\t{1, 3, 10, 4},\n\t//\t{14, 13, 0, 11},\n\t//\t{15, 9, 12, 2},\n\t//}\n\t// true: 78, A* search uses so much memory, can only be executed with IDA* search\n\t//b := [base.size][base.size]int{\n\t//\t{0, 15, 14, 13},\n\t//\t{12, 11, 10, 9},\n\t//\t{8, 7, 6, 5},\n\t//\t{4, 3, 2, 1},\n\t//}\n\t// true: 72, corner case for WD heuristics\n\t//b := [base.size][base.size]int{\n\t//\t{1, 5, 9, 13},\n\t//\t{2, 6, 10, 14},\n\t//\t{3, 7, 11, 15},\n\t//\t{4, 8, 12, 0},\n\t//}\n\t// true: 58\n\t//b := [base.size][base.size]int{\n\t//\t{5, 6, 10, 15},\n\t//\t{7, 9, 14, 1},\n\t//\t{2, 12, 13, 11},\n\t//\t{8, 3, 4, 0},\n\t//}\n\treturn newBoard(b)\n}", "title": "" }, { "docid": "b00cf42ce0d0c7a003ab69046d9b3b17", "score": "0.59868354", "text": "func (s square) check_local_box() []int {\n var nums = make([]int, 9, 9)\n\n start_row, start_col := (s.row / 3) * 3, (s.col / 3) * 3\n\n count := 0\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n nums[count] = big_board[start_row + i][start_col + j].num\n count++\n }\n }\n return nums\n}", "title": "" }, { "docid": "9ff241b4be4329d7ad226c5ea8d58cd6", "score": "0.5974729", "text": "func NewBoard() *Board {\n\treturn &Board{\n\t\tme: 1<<28 | 1<<35,\n\t\topp: 1<<27 | 1<<36}\n}", "title": "" }, { "docid": "b5c0fbfc71e3622cb612313264d6920e", "score": "0.5956534", "text": "func updateBoard(board [][]byte, click []int) [][]byte {\n\tif len(click) != 2 {\n\t\treturn nil\n\t}\n\n\t_update(board, click[0], click[1])\n\treturn board\n}", "title": "" }, { "docid": "7b63eda0c9c7beee694cae61c0ec0160", "score": "0.5945299", "text": "func NewBoard() Board {\n\tvar b Board\n\treturn b\n}", "title": "" }, { "docid": "4e852c01f1a8cfab0e05d2ba68214213", "score": "0.5937276", "text": "func NewBoard() Board {\n\treturn Board{\n\t\tgame: [][]string{\n\t\t\t[]string{\"-\", \"-\", \"-\"},\n\t\t\t[]string{\"-\", \"-\", \"-\"},\n\t\t\t[]string{\"-\", \"-\", \"-\"}},\n\t\tremaining: []bool{true, true, true, true, true, true, true, true, true},\n\t}\n}", "title": "" }, { "docid": "7fbb8f743b27ff1c6f85e715575a641a", "score": "0.5929341", "text": "func generateBoard(n int) [][]string {\n\tboard := make([][]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tboard[i] = make([]string, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tboard[i][j] = \"X\"\n\t\t}\n\t}\n\treturn board\n}", "title": "" }, { "docid": "c258e0c0d7cb757682509917a00d06b6", "score": "0.59118044", "text": "func (r *Resolver) Board() generated.BoardResolver { return &boardResolver{r} }", "title": "" }, { "docid": "1cf8f3f50d9d102d4b3879d49ba5ca52", "score": "0.5893688", "text": "func (g *Game) BoardFileRank() [8][8]Piece {\n\treturn g.board\n}", "title": "" }, { "docid": "9047681987b840055d9c2f93ee9eeccf", "score": "0.5892555", "text": "func NewBoard() *Board {\n\tb := Board{}\n\tb.clear()\n\treturn &b\n}", "title": "" }, { "docid": "48d5a246f0f798c6c596de0a1af365a0", "score": "0.58915657", "text": "func GetBoard(name string) (Board, error) {\n\tif len(localBoards) == 0 {\n\t\terr := loadBoards()\n\t\tif err != nil {\n\t\t\treturn Board{}, err\n\t\t}\n\t}\n\treturn localBoards[name], nil\n}", "title": "" }, { "docid": "f789d47bc1b04c1ed451a6e773fd015a", "score": "0.5884703", "text": "func (service *tablo) GetBoard(ctx context.Context, req *v1.URI) (*v1.Board, error) {\n\tboard, err := service.storage.FetchBoard(ctx, model.ID(req.GetUrn()))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp := &v1.Board{\n\t\tId: &v1.URI{\n\t\t\tValue: &v1.URI_Urn{Urn: board.ID.String()},\n\t\t},\n\t\tTitle: board.Title,\n\t\tEmoji: board.Emoji.String(),\n\t\tDescription: board.DescriptionValue(),\n\n\t\t// TODO:debt use real values\n\t\tFilters: []*v1.Filter{},\n\t\tSources: []*v1.Source{},\n\n\t\tCreatedAt: protobuf.Timestamp(board.CreatedAt),\n\t\tUpdatedAt: protobuf.Timestamp(board.UpdatedAt),\n\t}\n\tif board.Columns != nil {\n\t\tcolumns := *board.Columns\n\t\tresp.Columns = make([]*v1.Column, len(columns))\n\t\tfor i, column := range columns {\n\t\t\tresp.Columns[i] = &v1.Column{\n\t\t\t\tId: &v1.URI{\n\t\t\t\t\tValue: &v1.URI_Urn{Urn: column.ID.String()},\n\t\t\t\t},\n\t\t\t\tTitle: column.Title,\n\t\t\t\tEmoji: column.Emoji.String(),\n\t\t\t\tDescription: column.DescriptionValue(),\n\t\t\t\tCreatedAt: protobuf.Timestamp(column.CreatedAt),\n\t\t\t\tUpdatedAt: protobuf.Timestamp(column.UpdatedAt),\n\t\t\t}\n\t\t\tif column.Cards != nil {\n\t\t\t\tcards := *column.Cards\n\t\t\t\tresp.Columns[i].Cards = make([]*v1.Card, len(cards))\n\t\t\t\tfor j, card := range cards {\n\t\t\t\t\tresp.Columns[i].Cards[j] = &v1.Card{\n\t\t\t\t\t\tId: &v1.URI{\n\t\t\t\t\t\t\tValue: &v1.URI_Urn{Urn: card.ID.String()},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTitle: card.Title,\n\t\t\t\t\t\tEmoji: card.Emoji.String(),\n\t\t\t\t\t\tDescription: card.DescriptionValue(),\n\n\t\t\t\t\t\t// TODO:debt use real values\n\t\t\t\t\t\tUrl: \"https://github.com/octopot/tablo/issues/1\",\n\t\t\t\t\t\tLabels: []string{\"type:task\"},\n\n\t\t\t\t\t\tCreatedAt: protobuf.Timestamp(card.CreatedAt),\n\t\t\t\t\t\tUpdatedAt: protobuf.Timestamp(card.UpdatedAt),\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn resp, nil\n}", "title": "" }, { "docid": "33ecec3c6a8a5c9a785960cd7500b047", "score": "0.5835304", "text": "func InitialBoard() *Board {\n\tP1 := Player{Name: \"Player 1\", Direction: Right, PrevDirection: Right}\n\tP2 := Player{Name: \"Player 2\", Direction: Left, PrevDirection: Left}\n\tGrid := new(Grid)\n\n\tb := new(Board)\n\tb.P1 = &P1\n\tb.P2 = &P2\n\tb.Grid = Grid\n\n\tfor i := range b.Grid {\n\t\tfor j := range b.Grid[i] {\n\t\t\tb.Grid[i][j] = EmptyCell\n\t\t}\n\t}\n\n\tb.Grid[0][BoardHeight/2+BoardHeight%2] = P1Head\n\tb.Grid[BoardWidth-1][BoardHeight/2+BoardHeight%2] = P2Head\n\n\treturn b\n}", "title": "" }, { "docid": "cb1d1fc14e3392dff9675cc62e9e379e", "score": "0.5820506", "text": "func NewBoard(m, n int) *Board {\n\tif m <= 0 || n <= 0 {\n\t\treturn nil\n\t}\n\tb := &Board{SizeX: m, SizeY: n}\n\tb.empty = m * n\n\tb.Field = make([][]bool, m)\n\tfor i := 0; i < m; i++ {\n\t\tb.Field[i] = make([]bool, n)\n\t}\n\treturn b\n}", "title": "" }, { "docid": "bceaeb76b74edbe088f65855763488e8", "score": "0.5810632", "text": "func newBoard() *Board {\n\tboard := new(Board)\n\tboard.cells = make(ColorMap)\n\treturn board\n}", "title": "" }, { "docid": "28f5c6f2d07cd5fa6ca01c8285617609", "score": "0.5809055", "text": "func (b Board) copy() Board {\n\t// copy game\n\tgame := make([][]string, 3, 3)\n\tfor l, line := range b.game {\n\t\tgame[l] = make([]string, 3)\n\t\tfor c, item := range line {\n\t\t\tgame[l][c] = item\n\t\t}\n\t}\n\t// copy remaining\n\tremaining := make([]bool, 9)\n\tfor i, value := range b.remaining {\n\t\tremaining[i] = value\n\t}\n\treturn Board{\n\t\tgame: game,\n\t\tremaining: remaining,\n\t}\n}", "title": "" }, { "docid": "c51e56d45aec9f2e7db6926db01a9bf5", "score": "0.57995504", "text": "func (board *Scoreboard) Bytes() []byte {\n\treturn board.p\n}", "title": "" }, { "docid": "444048d3f2329e825b5416bd8c82bacf", "score": "0.57925636", "text": "func (g *Game) BoardRankFile() [8][8]Piece {\n\tvar board [8][8]Piece\n\n\tfor i, rank := range g.board {\n\t\tfor j, piece := range rank {\n\t\t\tboard[j][i] = piece\n\t\t}\n\t}\n\n\treturn board\n}", "title": "" }, { "docid": "4349cc48d14c157b9da9b27426a0f450", "score": "0.57685393", "text": "func (b Board) CheckWinner() Piece {\n\t// Check rows\n\tfor r := 0; r < 6; r++ {\n\t\tif color := b.checkSpan(Coord{r, 0}, 0, 1, 5, 6); color != Empty {\n\t\t\treturn color\n\t\t}\n\t}\n\t// Check cols\n\tfor c := 0; c < 6; c++ {\n\t\tif color := b.checkSpan(Coord{0, c}, 1, 0, 5, 6); color != Empty {\n\t\t\treturn color\n\t\t}\n\t}\n\t// Check diags\n\tif color := b.checkSpan(Coord{0, 1}, 1, 1, 5, 5); color != Empty {\n\t\treturn color\n\t}\n\tif color := b.checkSpan(Coord{1, 0}, 1, 1, 5, 5); color != Empty {\n\t\treturn color\n\t}\n\tif color := b.checkSpan(Coord{0, 0}, 1, 1, 5, 6); color != Empty {\n\t\treturn color\n\t}\n\tif color := b.checkSpan(Coord{4, 0}, -1, 1, 5, 5); color != Empty {\n\t\treturn color\n\t}\n\tif color := b.checkSpan(Coord{5, 1}, -1, 1, 5, 5); color != Empty {\n\t\treturn color\n\t}\n\tif color := b.checkSpan(Coord{5, 0}, -1, 1, 5, 6); color != Empty {\n\t\treturn color\n\t}\n\treturn Empty\n}", "title": "" }, { "docid": "ef8e0d2fa71d96b4ef45f5a11d453cd7", "score": "0.5755047", "text": "func (board Board) copy() Board {\n\tcells := make([][]Cell, board.metadata.size.y, board.metadata.size.y)\n\tfor y := range cells {\n\t\tcells[y] = make([]Cell, board.metadata.size.x, board.metadata.size.y)\n\t\tcopy(cells[y], board.cells[y])\n\t}\n\treturn Board{\n\t\tcells: cells,\n\t\tmetadata: board.metadata,\n\t}\n}", "title": "" }, { "docid": "d2c56f5eb1aba72f79b62f235a4868ab", "score": "0.57512605", "text": "func PopulateBoard() Board {\n\tdeck := CreateDeck()\n\thand1 := deck.Draw(3)\n\thand2 := deck.Draw(3)\n\n\tboard := Board{\n\t\tPlayerOne: Player{30, 0, []Card{}, hand1, []Card{}},\n\t\tPlayerTwo: Player{30, 0, []Card{}, hand2, []Card{}},\n\t}\n\n\treturn board\n}", "title": "" }, { "docid": "05c4efd8c117a2c83111bd414903130d", "score": "0.57493937", "text": "func ParseBoard(tiles []*Tile) BoardData {\n\tvar board BoardData\n\tvar base Coordinate\n\tbs := make([][][]Coordinate, len(tiles))\n\tboard.ReverseData = make([][][]Coordinate, len(tiles))\n\n\tbase.X = int(math.MaxInt32)\n\tbase.Y = int(math.MaxInt32)\n\tboard.X = int(math.MinInt32)\n\tboard.Y = int(math.MinInt32)\n\n\tfor i, tile := range tiles {\n\t\tvar min, max Coordinate\n\t\tbs[i], min, max = tile.BoardCoordinates()\n\n\t\tif min.X < base.X {\n\t\t\tbase.X = min.X\n\t\t}\n\t\tif min.Y < base.Y {\n\t\t\tbase.Y = min.Y\n\t\t}\n\t\tif max.X > board.X {\n\t\t\tboard.X = max.X\n\t\t}\n\t\tif max.Y > board.Y {\n\t\t\tboard.Y = max.Y\n\t\t}\n\t}\n\n\tboard.X -= base.X\n\tboard.Y -= base.Y\n\tboard.Data = make([][]*IndexData, board.X)\n\tfor i := range board.Data {\n\t\tboard.Data[i] = make([]*IndexData, board.Y)\n\t}\n\n\tfor i, b := range bs {\n\t\tboard.ReverseData[i] = make([][]Coordinate, len(b))\n\t\tfor x := range b {\n\t\t\tboard.ReverseData[i][x] = make([]Coordinate, len(b[x]))\n\t\t\tfor y, c := range b[x] {\n\t\t\t\tdata := &IndexData{\n\t\t\t\t\tCoordinate: Coordinate{\n\t\t\t\t\t\tX: x,\n\t\t\t\t\t\tY: y,\n\t\t\t\t\t},\n\t\t\t\t\tIndex: i,\n\t\t\t\t}\n\t\t\t\tbx := c.X - base.X\n\t\t\t\tby := c.Y - base.Y\n\n\t\t\t\tboard.Data[bx][by] = data\n\t\t\t\tboard.ReverseData[i][x][y] = Coordinate{\n\t\t\t\t\tX: bx,\n\t\t\t\t\tY: by,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn board\n}", "title": "" }, { "docid": "a0ed1252796d9c281aea46effbd8e2b0", "score": "0.5739698", "text": "func (b board) copy() *board {\n\treturn &b\n}", "title": "" }, { "docid": "21c2392b88a74cb96da77f59d52e7782", "score": "0.5724615", "text": "func (b Board) Clone() Board {\n\tb2 := NewBoard()\n\tfor r := range b {\n\t\tcopy(b2[r], b[r])\n\t}\n\treturn b2\n}", "title": "" }, { "docid": "347722edc78b46d9a1fff1b108e0b2ea", "score": "0.5722889", "text": "func ReadBoardFromFile(filename string) (CellBoard, []string) {\r\n\tboard := make(CellBoard, 0)\r\n\tfile, err := os.Open(filename)\r\n\tif err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\tdefer file.Close()\r\n\tvar parLine []string\r\n\tscanner := bufio.NewScanner(file)\r\n\tparInput := false\r\n\tfor scanner.Scan() {\r\n\t\tcurrentLine := scanner.Text()\r\n\t\tcurrentArray := make([]Cell, 0)\r\n\t\tif parInput == false {\r\n\t\t\tparLine = strings.Split(currentLine, \" \")\r\n\t\t\tparInput = true\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tfor i := range currentLine {\r\n\t\t\tval := currentLine[i : i+1]\r\n\t\t\tvar newCell Cell\r\n\t\t\tif val == \"S\" {\r\n\t\t\t\tnewCell = InitialStemCell()\r\n\t\t\t} else if val == \"D\" {\r\n\t\t\t\tnewCell = InitialDifCell()\r\n\t\t\t} else if val == \"B\" {\r\n\t\t\t\tnewCell = InitialEmptyCell()\r\n\t\t\t}\r\n\t\t\tcurrentArray = append(currentArray, newCell)\r\n\t\t}\r\n\t\tboard = append(board, currentArray)\r\n\t}\r\n\r\n\tif err := scanner.Err(); err != nil {\r\n\t\tlog.Fatal(err)\r\n\t}\r\n\r\n\treturn board,parLine\r\n}", "title": "" }, { "docid": "7a8cf20ac0fbbb638add10ec6c0ea983", "score": "0.57187444", "text": "func TestStdBoard(t *testing.T) {\n\tassert := assert.New(t)\n\n\tb := NewStdBoard(\"HELLO\", 5)\n\tassert.Equal(b.Len(), 5*5,\n\t\t\"number of cells must be square of board size\")\n\n\tfor i := range Cells(b)[:10] {\n\t\tassert.Equal(b.Get(i), 0,\n\t\t\t\"first 10 cells must be unoccupied\")\n\t}\n\tfor i := range Cells(b)[10:15] {\n\t\tassert.NotEqual(b.Get(i+10), 0,\n\t\t\t\"cells from 11 to 15 must be occupied\")\n\t}\n\tfor i := range Cells(b)[15:] {\n\t\tassert.Equal(b.Get(i+15), 0,\n\t\t\t\"rest cells must be unoccupied\")\n\t}\n\n\tassert.Equal(b.GetAdjacent(0), []int{1, 5},\n\t\t\"cell 0 must have 2 neighbours\")\n\tassert.Equal(b.GetAdjacent(4), []int{3, 9},\n\t\t\"cell 4 must have 2 neighbours\")\n\tassert.Equal(b.GetAdjacent(11), []int{10, 12, 6, 16},\n\t\t\"cell 11 must have 4 neighbours\")\n\tassert.Equal(b.GetAdjacent(20), []int{21, 15},\n\t\t\"cell 20 must have 2 neighbours\")\n\tassert.Equal(b.GetAdjacent(21), []int{20, 22, 16},\n\t\t\"cell 21 must have 3 neighbours\")\n}", "title": "" }, { "docid": "609af6a90b1500544b969049da222f34", "score": "0.57163244", "text": "func (b *Board) prepareBoard() {\n\tfor i, f := range b.coords {\n\t\tfor j, fj := range b.coords[i] {\n\t\t\tb.coords[i][j].x = i\n\t\t\tb.coords[i][j].y = j\n\t\t\tb.coords[i][j].player = PLAYER_NO\n\t\t\t_ = fj\n\t\t}\n\t\t_ = f\n\t}\n}", "title": "" }, { "docid": "a215ba17ae88cfc3772f5f47ced8a73e", "score": "0.57071775", "text": "func (board *Bitboard) ToArray() [12]uint64 {\n\tvar values [6][2]uint64\n\tvalues[0] = board.Pawns\n\tvalues[1] = board.Knights\n\tvalues[2] = board.Bishops\n\tvalues[3] = board.Rooks\n\tvalues[4] = board.Queen\n\tvalues[5] = board.King\n\n\ti := 0\n\tvar linear [12]uint64\n\tfor j := 0; j < 6; j++ {\n\t\tfor k := 0; k < 2; k++ {\n\t\t\tlinear[i] = values[j][k]\n\t\t\ti++\n\t\t}\n\t}\n\treturn linear\n}", "title": "" }, { "docid": "e4c203f7bf0c564e7b6f32a06d3e9391", "score": "0.5705938", "text": "func (b Board) GetWinner() int {\n\n\tfor i := 0; i < 3; i++ {\n\t\t// check rows\n\t\tif b[0][i] == b[1][i] && b[0][i] == b[2][i] && b[0][i] != 0 {\n\t\t\treturn b[0][i]\n\t\t}\n\t\t// check columns\n\t\tif b[i][0] == b[i][1] && b[i][0] == b[i][2] && b[i][0] != 0 {\n\t\t\treturn b[i][0]\n\t\t}\n\t}\n\n\t// Check diagonals\n\tif b[0][0] == b[1][1] && b[0][0] == b[2][2] && b[0][0] != 0 {\n\t\treturn b[0][0]\n\t} else if b[2][0] == b[1][1] && b[2][0] == b[0][2] && b[2][0] != 0 {\n\t\treturn b[2][0]\n\t}\n\n\treturn 0\n}", "title": "" }, { "docid": "13a40a7c28b592babc7675c7d30a2088", "score": "0.5698498", "text": "func CopyBoard(src Board) Board {\n\tdst := Board{src.xSize, src.ySize, make([][]Cell, len(src.value))}\n\tfor i := range src.value {\n\t\tdst.value[i] = make([]Cell, len(src.value[i]))\n\t\tcopy(dst.value[i], src.value[i])\n\t}\n\n\treturn dst\n}", "title": "" }, { "docid": "b39f932439b1384a989fbc770846b401", "score": "0.5698354", "text": "func printBoard(board [9][9]int) {\n\n\tcount := 0\n\tk := 0\n\tfmt.Println(\" * - - - - - * - - - - - * - - - - - *\")\n\tfor row := 0; row < 9; row++ {\n\t\tfor col := 0; col < 9; col++ {\n\n\t\t\tk++\n\t\t\tif col == 8 {\n\t\t\t\tfmt.Print(board[row][col], \" |\")\n\t\t\t} else if col == 0 {\n\t\t\t\tfmt.Print(\" | \", board[row][col], \" \")\n\t\t\t} else if col == 2 || col == 5 {\n\t\t\t\tfmt.Print(board[row][col], \" | \")\n\t\t\t} else {\n\t\t\t\tfmt.Print(board[row][col], \" \")\n\t\t\t}\n\t\t\tif k == 9 {\n\t\t\t\tk = 0\n\t\t\t\tfmt.Println(\" \")\n\t\t\t\tcount++\n\t\t\t\tif count != 9 {\n\t\t\t\t\tif count == 3 || count == 6 {\n\n\t\t\t\t\t\tfmt.Println(\" * - - - - - * - - - - - * - - - - - *\")\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tfmt.Println(\" | | | |\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\" * - - - - - * - - - - - * - - - - - *\")\n}", "title": "" }, { "docid": "a83e1eb3e224ccf36cf65020942803cd", "score": "0.5691391", "text": "func (service *tablo) GetBoards(ctx context.Context, req *v1.Criteria) (*v1.BoardList, error) {\n\n\t// TODO:debt use real criteria\n\tboards, err := service.storage.FetchBoards(ctx, nil)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp := &v1.BoardList{\n\t\tList: make([]*v1.Board, len(boards)),\n\t}\n\tfor i, board := range boards {\n\t\tresp.List[i] = &v1.Board{\n\t\t\tId: &v1.URI{\n\t\t\t\tValue: &v1.URI_Urn{Urn: board.ID.String()},\n\t\t\t},\n\t\t\tTitle: board.Title,\n\t\t\tEmoji: board.Emoji.String(),\n\t\t\tDescription: board.DescriptionValue(),\n\n\t\t\t// TODO:debt use real values\n\t\t\tFilters: []*v1.Filter{},\n\t\t\tSources: []*v1.Source{},\n\n\t\t\tCreatedAt: protobuf.Timestamp(board.CreatedAt),\n\t\t\tUpdatedAt: protobuf.Timestamp(board.UpdatedAt),\n\t\t}\n\t\tif board.Columns != nil {\n\t\t\tcolumns := *board.Columns\n\t\t\tresp.List[i].Columns = make([]*v1.Column, len(columns))\n\t\t\tfor j, column := range columns {\n\t\t\t\tresp.List[i].Columns[j] = &v1.Column{\n\t\t\t\t\tId: &v1.URI{\n\t\t\t\t\t\tValue: &v1.URI_Urn{Urn: column.ID.String()},\n\t\t\t\t\t},\n\t\t\t\t\tTitle: column.Title,\n\t\t\t\t\tEmoji: column.Emoji.String(),\n\t\t\t\t\tDescription: column.DescriptionValue(),\n\t\t\t\t\tCreatedAt: protobuf.Timestamp(column.CreatedAt),\n\t\t\t\t\tUpdatedAt: protobuf.Timestamp(column.UpdatedAt),\n\t\t\t\t}\n\t\t\t\tif column.Cards != nil {\n\t\t\t\t\tcards := *column.Cards\n\t\t\t\t\tresp.List[i].Columns[j].Cards = make([]*v1.Card, len(cards))\n\t\t\t\t\tfor k, card := range cards {\n\t\t\t\t\t\tresp.List[i].Columns[j].Cards[k] = &v1.Card{\n\t\t\t\t\t\t\tId: &v1.URI{\n\t\t\t\t\t\t\t\tValue: &v1.URI_Urn{Urn: card.ID.String()},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tTitle: card.Title,\n\t\t\t\t\t\t\tEmoji: card.Emoji.String(),\n\t\t\t\t\t\t\tDescription: card.DescriptionValue(),\n\n\t\t\t\t\t\t\t// TODO:debt use real values\n\t\t\t\t\t\t\tUrl: \"https://github.com/octopot/tablo/issues/1\",\n\t\t\t\t\t\t\tLabels: []string{\"type:task\"},\n\n\t\t\t\t\t\t\tCreatedAt: protobuf.Timestamp(card.CreatedAt),\n\t\t\t\t\t\t\tUpdatedAt: protobuf.Timestamp(card.UpdatedAt),\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\treturn resp, nil\n}", "title": "" }, { "docid": "cf3ffcd0cf5833882e2a0aa3f7ee09e9", "score": "0.56788623", "text": "func NewBoard(w, h, chainLen int) *Board {\n\tresult := &Board{\n\t\tboard: make([]*ttgletter.Letter, w*h),\n\t\twidth: w,\n\t\theight: h,\n\t\tchainLen: chainLen,\n\t}\n\n\tfor i := range result.board {\n\t\tresult.board[i] = ttgletter.NewLetter()\n\t}\n\n\treturn result\n}", "title": "" }, { "docid": "679b82d8d234188450784d153502be58", "score": "0.5673822", "text": "func (b *board) getAvailablePos() [][2]int {\n\tavailPos := [][2]int{}\n\tfor i := range b {\n\t\tfor j := range b[i] {\n\t\t\tif b[i][j] == \"_\" {\n\t\t\t\tavailPos = append(availPos, [2]int{i, j})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn availPos\n}", "title": "" }, { "docid": "90419d893600b6e2edebb64d90b02b5d", "score": "0.56649405", "text": "func Board(ctx context.Context, d *rpcdut.RPCDUT) (fp.BoardName, error) {\n\t// Use cros_config to get fingerprint board.\n\tout, err := d.Conn().CommandContext(ctx, \"cros_config\", \"/fingerprint\", \"board\").Output(ssh.DumpLogOnError)\n\treturn fp.BoardName(out), err\n}", "title": "" }, { "docid": "b07bb20bc41479a469960b621469d9de", "score": "0.56495297", "text": "func (js *JiraService) Board(id int) (issues []jira.Issue, err error) {\n\t// boardEndpoint := url.URL{Path: fmt.Sprintf(\"rest/agile/1.0/board/%d/issue\", id)}\n\n\treturn issues, err\n}", "title": "" }, { "docid": "4c74e15d5205ceafa52410c0efca3fb6", "score": "0.5642715", "text": "func (board *Bitboard) PrintBoard() {\n\tpieces := board.ToArray()\n\tpieceChars := \"+*nNbBrRqQkK\"\n\tvar mask uint64\n\n\tvar outBytes [64]byte\n\tfor k := 0; k < 64; k++ {\n\t\toutBytes[k] = '.'\n\t}\n\n\tfor j := 0; j < 12; j++ {\n\t\tfor mask = 1 << 63; mask > 0; mask >>= 1 {\n\t\t\tcomp := pieces[j] & mask\n\t\t\tif comp > 0 {\n\t\t\t\toutBytes[firstOne(comp)] = pieceChars[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < 64; i++ {\n\t\tif i%8 == 0 {\n\t\t\tfmt.Printf(\"\\n\")\n\t\t}\n\t\tfmt.Printf(\"%c \", outBytes[i])\n\t}\n\tfmt.Printf(\"\\n\\n\")\n}", "title": "" }, { "docid": "6c569d131e1c506c94ce5859ff9877e9", "score": "0.5642437", "text": "func NewBoard(positions ...Bitboard) (*Board, error) {\n\n\tboard := Board{Pieces: Pieces}\n\tif len(positions) > 0 && len(positions) != len(board.Pieces) {\n\t\terr := fmt.Errorf(\n\t\t\t\"Unable to determine board position, expecting %d bitboards, received %d\",\n\t\t\tlen(board.Pieces), len(positions),\n\t\t)\n\t\treturn nil, err\n\t} else if len(positions) > 0 {\n\t\tboard.Positions = make([]Bitboard, len(positions))\n\t\tcopy(board.Positions, positions)\n\t} else {\n\t\tboard.Positions = []Bitboard{\n\t\t\tinitWhiteRooks, initWhiteKnights, initWhiteBishops, initWhiteQueen, initWhiteKing, initWhitePawns,\n\t\t\tinitBlackRooks, initBlackKnights, initBlackBishops, initBlackQueen, initBlackKing, initBlackPawns,\n\t\t}\n\t}\n\n\tboard.Occupied = Union(board.Positions...)\n\n\treturn &board, nil\n}", "title": "" }, { "docid": "47952d77ff924daff2cf1db995258beb", "score": "0.5623878", "text": "func (b *Board) Copy() *Board {\n\tnewBoard := NewBoard(b.width, b.height, b.chainLen)\n\tfor i := range newBoard.board {\n\t\tnewBoard.SetIndexState(i, b.GetIndexState(i))\n\t}\n\n\treturn newBoard\n}", "title": "" }, { "docid": "ad59b99e5fbbb893a2a5e2c1c213d98c", "score": "0.5619885", "text": "func (b *BoardService) PrintBoard() string {\r\n\tmatrixString := \"\\n\\t\\t\\t\"\r\n\tboardSize := uint8(len(b.Board.Cells))\r\n\tfor i := uint8(0); i < (boardSize); i++ {\r\n\t\tmatrixString += b.Cells[i].Mark\r\n\t\tif i%(b.Size) == (b.Size)-1 {\r\n\t\t\tmatrixString += \"\\n\\t\\t\\t\"\r\n\t\t}\r\n\t}\r\n\treturn matrixString\r\n}", "title": "" }, { "docid": "64cd91802b80ffb811d240fce7c00468", "score": "0.5618134", "text": "func GetBoardStatus() BoardStatus {\n\tvar bs BoardStatus\n\tbs.TotalEmpty = 0\n\tbs.TotalDinosaur = 0\n\tbs.TotalRobot = 0\n\tbs.EmptyPosition = \"\"\n\tbs.RobotPosition = \"\"\n\tbs.DinosaurPosition = \"\"\n\n\tfor i := 0; i < UPPERBOUND+1; i++ {\n\t\tfor j := 0; j < UPPERBOUND+1; j++ {\n\t\t\tspl := strings.Split(Board[i][j], \":\")\n\t\t\tcol, _ := ReturnKeyFromValueMap(Column, j)\n\t\t\tif spl[0] == \"e\" {\n\t\t\t\tbs.TotalEmpty++\n\t\t\t\tbs.EmptyPosition += fmt.Sprintf(\"%d:%s, \", i+1, col)\n\t\t\t} else if spl[0] == \"r\" {\n\t\t\t\tbs.TotalRobot++\n\t\t\t\tbs.RobotPosition += fmt.Sprintf(\"%d:%s:%s, \", i+1, col, spl[1])\n\t\t\t} else if spl[0] == \"d\" {\n\t\t\t\tbs.TotalDinosaur++\n\t\t\t\tbs.DinosaurPosition += fmt.Sprintf(\"%d:%s, \", i+1, col)\n\t\t\t}\n\t\t}\n\t}\n\n\tbs.Msg = fmt.Sprintf(\"Total empty space %d, robot existance %d and dinosaur occupation %d\",\n\t\tbs.TotalEmpty, bs.TotalRobot, bs.TotalDinosaur)\n\n\treturn bs\n}", "title": "" }, { "docid": "32b1fa3a73513f9840f6d97ad10a6ac6", "score": "0.56131196", "text": "func (g *GameInfo) checkWin() (int, bool) {\n\tvar target [BoardSize]int\n\tfor i := 0; i < BoardSize; i++ {\n\t\tfor j := 0; j < BoardSize; j++{\n\t\t\ttarget[j] = g.board[i][j]\n\t\t}\n\t\tif allSame(target) {\n\t\t\treturn target[0], true\n\t\t}\n\t}\n\tfor j := 0; j < BoardSize; j++{\n\t\tfor i := 0; i < BoardSize; i++ {\n\t\t\ttarget[i] = g.board[i][j]\n\t\t}\n\t\tif allSame(target) {\n\t\t\treturn target[0], true\n\t\t}\n\t}\n\ttarget[0] = g.board[0][0]\n\ttarget[1] = g.board[1][1]\n\ttarget[2] = g.board[2][2]\n\tif allSame(target) {\n\t\treturn target[0], true\n\t}\n\ttarget[0] = g.board[0][2]\n\ttarget[1] = g.board[1][1]\n\ttarget[2] = g.board[2][0]\n\tif allSame(target) {\n\t\treturn target[0], true\n\t}\n\treturn EMPTY, false\n}", "title": "" }, { "docid": "f8aa7fe5448558799d88c2196bb4ff38", "score": "0.5607827", "text": "func CreateBoard() Board {\n\treturn Board{\n\t\tHeight: 4,\n\t\tWidth: 10,\n\t\tOffBoardSpaces: []Coord{\n\t\t\t{0, 3}, {1, 3}, {2, 3} /* */, {8, 3}, {9, 3},\n\t\t\t{0, 2} /* */, {9, 2},\n\t\t\t{0, 1} /* */, {9, 1},\n\t\t\t{0, 0}, {1, 0} /* */, {7, 0}, {8, 0}, {9, 0},\n\t\t},\n\t}\n}", "title": "" }, { "docid": "2f3bbcda0e66e373fda0bc9a7740080e", "score": "0.55968547", "text": "func PrintBoard(board *Board) {\n\tfor i := range *board {\n\t\tfor j := range (*board)[i] {\n\t\t\tc := (*board)[i][j]\n\t\t\tif c == \"\" {\n\t\t\t\tc = \" \"\n\t\t\t}\n\t\t\tfmt.Print(c)\n\t\t}\n\t\tfmt.Print(\"\\n\")\n\t}\n}", "title": "" }, { "docid": "8f8a6a942cab1a93891b39b59e3e7dee", "score": "0.5591751", "text": "func (b board) MarshalJSON() ([]byte, error) {\n\twidth, height := b.Dimensions()\n\tbuffer := bytes.NewBufferString(\"[\")\n\tfor x := 0; x < width; x++ {\n\t\tbuffer.WriteString(\"[\")\n\n\t\tfor y := 0; y < height; y++ {\n\t\t\tpos := Pos{y, x}\n\t\t\tITile, err := b.TileAt(pos)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tbuffer.WriteString(\"\\\"\" + strconv.Itoa(ITile.FloorCount()))\n\n\t\t\tworker := b.WorkerAt(pos)\n\t\t\tif worker != nil {\n\t\t\t\tbuffer.WriteString(worker.Name())\n\t\t\t}\n\n\t\t\tbuffer.WriteString(\"\\\"\")\n\n\t\t\tif y < height-1 {\n\t\t\t\tbuffer.WriteString(\",\")\n\t\t\t}\n\t\t}\n\t\tbuffer.WriteString(\"]\")\n\n\t\tif x < width-1 {\n\t\t\tbuffer.WriteString(\",\\n\")\n\t\t}\n\t}\n\tbuffer.WriteString(\"]\")\n\n\treturn buffer.Bytes(), nil\n}", "title": "" }, { "docid": "1f736dd1e527bae6d0f274efaed684f9", "score": "0.5579494", "text": "func validateBoard(b *codenames.Board, starter codenames.Team) error {\n\tif len(b.Cards) != codenames.Size {\n\t\treturn fmt.Errorf(\"board must contain %d codenames, found %d\", codenames.Size, len(b.Cards))\n\t}\n\n\tgot := make(map[codenames.Agent]int)\n\tfor _, cn := range b.Cards {\n\t\tgot[cn.Agent]++\n\t}\n\n\tfor ag, wc := range want(starter) {\n\t\tif gc := got[ag]; gc != wc {\n\t\t\treturn fmt.Errorf(\"got %d cards of type %q, want %d\", gc, ag, wc)\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2774e336bdd907a63a5a941a3c609eec", "score": "0.5574726", "text": "func printBoard(board []string) {\n\tprintln(topBoardOutputShell)\n\tfor i, line := range board {\n\t\tprintln(boardOutputShell[i] + line)\n\t}\n}", "title": "" }, { "docid": "7e291abdca58bca9bceac9e6540589ce", "score": "0.5572116", "text": "func (field *Field) PrintBoard() {\r\n\tfmt.Fprintln(os.Stderr, infoStr+\"Current board:\")\r\n\tfor y := field.height - 1; y >= 0; y-- {\r\n\t\tfor x := 0; x < field.width; x++ {\r\n\t\t\tfmt.Fprint(os.Stderr, field.board[x][y])\r\n\t\t}\r\n\t\tfmt.Fprintln(os.Stderr)\r\n\t}\r\n}", "title": "" }, { "docid": "a625f610da4afd6b3b4645e332d27aed", "score": "0.55685747", "text": "func createBoardState(falsePeg int, totalPegs int) *util.BoardState {\n newBoard := make([]bool, totalPegs, totalPegs + 1)\n for j := 0 ; j < totalPegs ; j++ {\n if (falsePeg == j) {\n newBoard[j] = false\n } else {\n newBoard[j] = true\n }\n }\n return util.NewBoardState(newBoard, totalPegs - 1, falsePeg)\n}", "title": "" }, { "docid": "a9e06d31388330ec5b3449937cf34e89", "score": "0.55683076", "text": "func printBoard(board [9][9]int) {\n\n\tfor i := 0; i < 9; i++ {\n\n\t\tif i == 0 || i == 3 || i == 6 || i == 9 {\n\t\t\tfmt.Println(\" - - - - - - - - - - - - - - -\")\n\t\t}\n\n\t\tfor j := 0; j < 9; j++ {\n\t\t\tif j == 3 || j == 6 {\n\t\t\t\tfmt.Print(\"|\")\n\t\t\t}\n\t\t\tvar v = board[i][j]\n\t\t\tif v == 0 {\n\t\t\t\tfmt.Printf(\" \")\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\" %d \", v)\n\t\t\t}\n\n\t\t}\n\t\tfmt.Println()\n\t}\n\n}", "title": "" }, { "docid": "ea34e428f74695490615caa757fc5d51", "score": "0.5532925", "text": "func NewBoard(rowsNumber int, columnsNumber int, bombsNumber int) Board {\n\tsquares := make([][]Square, rowsNumber)\n\tfor i := range squares {\n\t\tsquares[i] = make([]Square, columnsNumber)\n\t}\n\n\treturn Board{\n\t\tSquares: squares,\n\t\tStatus: STATUS_NEW,\n\t\tBombsPositions: &[]SquarePosition{},\n\t\tBombsNumber: bombsNumber,\n\t\tFirstMoveDone: newBool(false),\n\t}\n}", "title": "" }, { "docid": "9dda0d5c4dfc7c835c5f2a15e1e18246", "score": "0.553087", "text": "func boardFromWire(wire botapi.Board) (*Board, error) {\n\tb := EmptyBoard(int(wire.Width()), int(wire.Height()))\n\tb.Round = int(wire.Round())\n\n\tbots, err := wire.Robots()\n\tif err != nil {\n\t\treturn b, err\n\t}\n\n\tfor i := 0; i < bots.Len(); i++ {\n\t\tbot := bots.At(i)\n\t\tloc := Loc{\n\t\t\tX: int(bot.X()),\n\t\t\tY: int(bot.Y()),\n\t\t}\n\t\tb.cells[b.cellIndex(loc)] = robotFromWire(bot)\n\t}\n\n\treturn b, nil\n}", "title": "" }, { "docid": "aaa66d0b9e05efa7d31c4a5cb81820e3", "score": "0.5530362", "text": "func NewBoard(rows, cols int) *Board {\n\treturn &Board{\n\t\tRows: rows,\n\t\tCols: cols,\n\t\tentities: make(EntityMap),\n\t}\n}", "title": "" }, { "docid": "9e75acb1dbfe5260dff0e64ba45bc330", "score": "0.55214965", "text": "func CheckBoard(board []byte) bool {\n\tlength := int(math.Sqrt(float64(len(board))))\n\tfor i := 0; i < length-1; i++ {\n\t\tfor j := 0; j < length-1; j++ {\n\t\t\tfor x := 1; x < length-i; x++ {\n\t\t\t\tfor y := 0; y < length-j; y++ {\n\t\t\t\t\ttyp := board[i+j*length]\n\t\t\t\t\tif typ == 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfound := false\n\t\t\t\t\txx := x\n\t\t\t\t\tyy := y\n\t\t\t\t\tii := i + x\n\t\t\t\t\tjj := j + y\n\t\t\t\t\tfor n := 0; n < 3; n++ {\n\t\t\t\t\t\tif ii < 0 || jj < 0 || ii >= length || jj >= length {\n\t\t\t\t\t\t\tfound = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif board[ii+jj*length] != typ {\n\t\t\t\t\t\t\tfound = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttmp := xx\n\t\t\t\t\t\txx = -yy\n\t\t\t\t\t\tyy = tmp\n\t\t\t\t\t\tii = ii + xx\n\t\t\t\t\t\tjj = jj + yy\n\t\t\t\t\t}\n\t\t\t\t\tif !found {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "f8ff37864d91cc05d5aefacdb1dc29d8", "score": "0.5509262", "text": "func (b *BitBoard) ToSlice() [][]bool {\n\t// Create the new board 2d slice\n\tnewBoard := make([][]bool, b.NumRows)\n\t// Decode the RLE bits\n\tbytes := b.Bytes.Decode()\n\t// Set each cell in the new board\n\tfor row := 0; row < b.NumRows; row++ {\n\t\tnewBoard[row] = make([]bool, b.RowLength)\n\t\tfor col := 0; col < b.RowLength; col++ {\n\t\t\t// Get the index of this cell's bit in the bitarray\n\t\t\tbit := uint(row*b.RowLength + col)\n\t\t\t// Perform bitwise operations to get the byte and bit indices\n\t\t\tbyteIdx := uint(bit / 8)\n\t\t\tbitIdx := bit & 7\n\n\t\t\t// Set the cell from the value in the bit array\n\t\t\tif (bytes[byteIdx] & (1 << (bitIdx))) > 0 {\n\t\t\t\tnewBoard[row][col] = true\n\t\t\t} else {\n\t\t\t\tnewBoard[row][col] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn newBoard\n}", "title": "" }, { "docid": "48edf3cb924206e723cff287b7d0f0fc", "score": "0.5505517", "text": "func (_m *RepoMock) GetBoard(id string) (*Board, error) {\n\tret := _m.Called(id)\n\n\treturn ret.Get(0).(*Board), ret.Error(1)\n}", "title": "" }, { "docid": "a62dedbe18b477da188951bbe9a16435", "score": "0.5499164", "text": "func getAliveCells(prevWorld [][]uint8) []util.Cell {\n\talive := make([]util.Cell, 0)\n\tfor row := range prevWorld {\n\t\tfor col := range prevWorld[row] {\n\t\t\tif prevWorld[row][col] == LIVE {\n\t\t\t\talive = append(alive, util.Cell{X: col, Y: row})\n\t\t\t}\n\t\t}\n\t}\n\treturn alive\n}", "title": "" }, { "docid": "cdd38cef8675c6e098983dbc6ed40b74", "score": "0.54877204", "text": "func (b *board) String() string {\n\tstr := \" \"\n\tfor i := range b {\n\t\tfor j := range b[i] {\n\t\t\tstr += b[i][j] + \" \"\n\t\t}\n\t\tstr += \"\\n \"\n\t}\n\treturn str\n}", "title": "" }, { "docid": "f299b74e92b51c50ddabddb983781717", "score": "0.54843086", "text": "func (b Board) Clone() Board {\n\tr, c := b.Caps()\n\n\tboard := NewBoard(r, c)\n\n\tfor i, row := range b {\n\t\tboard = board[:i+1]\n\t\tcopy(board[i], row)\n\t}\n\n\treturn board\n}", "title": "" }, { "docid": "c144d4adb752b1f443cc4948badbd24e", "score": "0.5482509", "text": "func NewBoard(width, height int) *Board {\n\tplayer := player.DefaultPlayer()\n\n\tboard := new(Board)\n\n\tboard.player = player\n\tboard.width = width\n\tboard.height = height\n\tboard.aliens = alien.GetAliens()\n\n\treturn board\n}", "title": "" }, { "docid": "baec393fce74de09db29c28d16a70d50", "score": "0.54825073", "text": "func (p *gameState) printBoard() {\n\tfor i := -1; i <= len(p.board); i++ {\n\t\tfor j := -1; j <= len(p.board[0]); j++ {\n\t\t\tif i == -1 || i == len(p.board) { // upper and lower border.\n\t\t\t\tfmt.Print(\" -\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j == -1 || j == len(p.board[0]) { // left and right border.\n\t\t\t\tfmt.Print(\" |\")\n\t\t\t\tif i == -1 {\n\t\t\t\t\tfmt.Print(\"| \")\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif p.board[i][j] == 0 { // empty cells\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tif p.board[i][j] == 1 { // snake body parts\n\t\t\t\tfmt.Print(\"o \")\n\t\t\t}\n\t\t\tif p.board[i][j] == 2 { // food particle\n\t\t\t\tfmt.Print(\"X \")\n\t\t\t}\n\t\t\tif p.board[i][j] == 3 { // snake head\n\t\t\t\tfmt.Print(\"O \")\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t}\n}", "title": "" }, { "docid": "d51d97a1a05980d331588168070187d9", "score": "0.5478316", "text": "func (r *memoryRepo) GetBoard(id string) (*Board, error) {\n\tb := r.boards[id]\n\tif b == nil {\n\t\treturn nil, errors.New(\"board_not_found\")\n\t}\n\treturn b, nil\n}", "title": "" }, { "docid": "1da22dba93b4399ea1a56486384a07b6", "score": "0.54745066", "text": "func ParseBoard(boardRows []string) Board {\n\tboard := Board{}\n\n\t// Parse the board one row at a time.\n\tfor rowIndex := 0; rowIndex < len(boardRows); rowIndex++ {\n\t\trow := strings.Split(boardRows[rowIndex], \"\")\n\t\tboard.Positions = append(board.Positions, []*Position{})\n\n\t\t// Parse the row one column at a time.\n\t\tfor columnIndex := 0; columnIndex < len(row); columnIndex++ {\n\t\t\tposition := Position{Player: row[columnIndex]}\n\n\t\t\t// If this is not the leftmost column, connect to the left neighbor.\n\t\t\tif columnIndex > 0 {\n\t\t\t\tposition.Left = board.Positions[rowIndex][columnIndex-1]\n\t\t\t\tboard.Positions[rowIndex][columnIndex-1].Right = &position\n\t\t\t}\n\n\t\t\t// If this is not the topmost row, connect to the top left neighbor.\n\t\t\tif rowIndex > 0 {\n\t\t\t\tposition.TopLeft = board.Positions[rowIndex-1][columnIndex]\n\t\t\t\tboard.Positions[rowIndex-1][columnIndex].BottomRight = &position\n\n\t\t\t\t// If this is not the rightmost column, connect to the top right neighbor.\n\t\t\t\tif columnIndex < len(row)-1 {\n\t\t\t\t\tposition.TopRight = board.Positions[rowIndex-1][columnIndex+1]\n\t\t\t\t\tboard.Positions[rowIndex-1][columnIndex+1].BottomLeft = &position\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store the position in the board.\n\t\t\tboard.Positions[rowIndex] = append(board.Positions[rowIndex], &position)\n\t\t}\n\t}\n\n\treturn board\n}", "title": "" }, { "docid": "3a6b310d27d4894e3f1ccefe99a45560", "score": "0.5470137", "text": "func analyzeBoard(now state) int {\n\n\tval := 0\n\tfor y := 0; y < 8; y++ {\n\t\tfor x := 0; x < 8; x++ {\n\t\t\tif now.addr(x, y).isEmpty() == false {\n\t\t\t\tnow = now.setCur(x, y)\n\n\t\t\t\tif now.curAddr().getColor() == true {\n\t\t\t\t\tval += len(now.curAddr().possibleMoves(now))\n\t\t\t\t\tval += (now.curAddr().value() * 10)\n\t\t\t\t} else {\n\t\t\t\t\tval -= len(now.curAddr().possibleMoves(now))\n\t\t\t\t\tval -= (now.curAddr().value() * 10)\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\treturn val\n}", "title": "" }, { "docid": "a6def44832914431cf639746fe79bd17", "score": "0.5469491", "text": "func (mbc *MeBoardsController) Fetch() (*[]models.Board, error) {\n\t// Build + execute request\n\tresp := new(models.Response)\n\tresp.Data = &[]models.Board{}\n\thttpResp, err := mbc.wreckerClient.Get(\"/me/boards/\").\n\t\tURLParam(\"fields\", models.BOARD_FIELDS).\n\t\tInto(resp).\n\t\tExecute()\n\n\t// Check Error\n\tif err = models.WrapPinterestError(httpResp, resp, err); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// OK\n\treturn resp.Data.(*[]models.Board), nil\n}", "title": "" }, { "docid": "af377eb8dd08f0f5c49823c5ae6ed6d3", "score": "0.54550254", "text": "func (t *Taquin) PrintBoard(board [][]int) {\n\tvar size = len(strconv.Itoa(t.Size * t.Size))\n\tfmt.Print(\"\\n\")\n\tfor line := range board {\n\t\tfor column := range board[line] {\n\t\t\tfmt.Printf(\"%*d\", (size+1)*(-1), board[line][column])\n\t\t}\n\t\tfmt.Print(\"\\n\")\n\t}\n}", "title": "" }, { "docid": "ad393773094989d3c83248e1d02d0c21", "score": "0.54316", "text": "func (sq Square) Bitboard() Bitboard {\n\treturn 1 << uint(sq)\n}", "title": "" }, { "docid": "db85c52bb86c4f178dfa0d58cff02181", "score": "0.54279023", "text": "func (b Board) String() (str string) {\n\t// this function involves a lot of unoptimised string concatentation,\n\t// and when used to play the game, isn't the most astetically appealing.\n\t// Improvements can be made here, or ever a graphical soulution substituted here.\n\n\t// Top board; show shots by this player\n\tstr += \" 1 2 3 4 5 6 7 8 9 10\\n\"\n\t// iterate over y in reverse becuase coordinates start at the bottom left, but we print from top left.\n\tfor y := boardSize - 1; y >= 0; y-- {\n\t\tstr += string('A'+y) + \" \"\n\t\tfor x := 0; x < boardSize; x++ {\n\t\t\tswitch {\n\t\t\tcase b[x][y]&playerHit > 0:\n\t\t\t\tstr += \"X \"\n\t\t\tcase b[x][y]&playerShot > 0:\n\t\t\t\tstr += \"O \"\n\t\t\tdefault:\n\t\t\t\tstr += \" \"\n\t\t\t}\n\t\t}\n\t\tstr += \"\\n\"\n\t}\n\tstr += \"\\n\"\n\n\t// Bottom board; show player ships and opponent shots\n\tstr += \" 1 2 3 4 5 6 7 8 9 10\\n\"\n\tfor y := boardSize - 1; y >= 0; y-- {\n\t\tstr += string('A'+y) + \" \"\n\t\tfor x := 0; x < boardSize; x++ {\n\t\t\tswitch {\n\t\t\tcase b[x][y]&shipMask > 0 && b[x][y]&opponentHit > 0:\n\t\t\t\t// is a ship, and has been hit\n\t\t\t\tstr += \"X \"\n\t\t\tcase b[x][y]&shipMask == shipCarrier:\n\t\t\t\tstr += \"C \"\n\t\t\tcase b[x][y]&shipMask == shipBattleship:\n\t\t\t\tstr += \"B \"\n\t\t\tcase b[x][y]&shipMask == shipDestroyer:\n\t\t\t\tstr += \"D \"\n\t\t\tcase b[x][y]&shipMask == shipSubmarine:\n\t\t\t\tstr += \"S \"\n\t\t\tcase b[x][y]&shipMask == shipPatrolBoat:\n\t\t\t\tstr += \"P \"\n\t\t\tdefault:\n\t\t\t\tstr += \" \"\n\t\t\t}\n\t\t}\n\t\tstr += \"\\n\"\n\t}\n\n\treturn\n}", "title": "" }, { "docid": "ddb0deb4012b71657c3da5864ee3756a", "score": "0.5419009", "text": "func DrawCellBoard(board CellBoard, cellWidth int) image.Image {\r\n\theight := len(board) * cellWidth\r\n\twidth := len(board[0]) * cellWidth\r\n\tc := CreateNewCanvas(width, height)\r\n\r\n\t// declare colors\r\n\twhite := MakeColor(255, 255, 255)\r\n\tgray1 := MakeColor(200, 200, 200)\r\n\tgray2 := MakeColor(130, 130, 130)\r\n\tgray3 := MakeColor(80, 80, 80)\r\n\tgray4 := MakeColor(40, 40, 40)\r\n\tblack := MakeColor(0, 0, 0)\r\n\tpurple := MakeColor(150, 150, 255)\r\n\tlightBlue := MakeColor(100, 200, 255)\r\n\r\n\t// fill in colored squares\r\n\tfor i := range board {\r\n\t\tfor j := range board[i] {\r\n\t\t\tif board[i][j].alive == true {\r\n\t\t\t\tnumHall := NumCancerHall(board[i][j])\r\n\t\t\t\tif numHall == 0 {\r\n\t\t\t\t\tif board[i][j].types.stem == true {\r\n\t\t\t\t\t\tc.SetFillColor(purple)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tc.SetFillColor(lightBlue)\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if numHall == 1 {\r\n\t\t\t\t\tc.SetFillColor(gray1)\r\n\t\t\t\t} else if numHall == 2 {\r\n\t\t\t\t\tc.SetFillColor(gray2)\r\n\t\t\t\t} else if numHall == 3 {\r\n\t\t\t\t\tc.SetFillColor(gray3)\r\n\t\t\t\t} else if numHall == 4 {\r\n\t\t\t\t\tc.SetFillColor(gray4)\r\n\t\t\t\t} else if numHall == 5 {\r\n\t\t\t\t\tc.SetFillColor(black)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpanic(\"Error: Out of range value \" + string(numHall) + \" in board when drawing board.\")\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tc.SetFillColor(white)\r\n\t\t\t}\r\n\t\t\tx := j * cellWidth\r\n\t\t\ty := i * cellWidth\r\n\t\t\tc.ClearRect(x, y, x+cellWidth, y+cellWidth)\r\n\t\t\tc.Fill()\r\n\t\t}\r\n\t}\r\n\treturn c.img\r\n}", "title": "" }, { "docid": "0aa93bbac4e3aa677cf248a260570185", "score": "0.5406556", "text": "func (c *Client) GetBoards() ([]jira.Board, error) {\n\tvar boards []jira.Board\n\tstart := 0\n\tfor {\n\t\tsearch := jira.SearchOptions{StartAt: start}\n\t\topts := &jira.BoardListOptions{SearchOptions: search}\n\t\tlist, _, err := c.jira.Board.GetAllBoards(opts)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tstart += len(list.Values)\n\t\tboards = append(boards, list.Values...)\n\n\t\tif list.IsLast {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tsort.Slice(boards, func(i, j int) bool { return boards[i].Name < boards[j].Name })\n\n\treturn boards, nil\n}", "title": "" }, { "docid": "a924b1840ad787767432a2b3e825955d", "score": "0.54056877", "text": "func NewBoard(size int) *Board {\n\tdim := int(math.Sqrt(float64(size)))\n\ttiles := make([][]*Tile, dim)\n\tfor i:=0; i<dim; i++ {\n\t\ttiles[i] = make([]*Tile, dim)\n\t}\n\treturn &Board{tiles: tiles, dim: dim}\n}", "title": "" }, { "docid": "98d59ab096b262886fd83b8e39906c48", "score": "0.5405194", "text": "func (c *Client) GetBoardLayout(name string) ([]string, error) {\n\tlayoutKey := fmt.Sprintf(\"boards.%s.layout\", name)\n\tok := viper.IsSet(layoutKey)\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s is not defined in the configuration file\", layoutKey)\n\t}\n\n\treturn viper.GetStringSlice(layoutKey), nil\n}", "title": "" }, { "docid": "7a4b1b02b1ecc7043cbb790e6dd47ac8", "score": "0.5404041", "text": "func (c *Cache) GetBoard(bid string) (Board, error) {\n\treturn c.getBoardForKey(c.boardKeyForBoard(bid))\n}", "title": "" }, { "docid": "5c09aa8996d90e9e102332170d8ba87b", "score": "0.54025775", "text": "func (b BoardNumber) Number() uint8 { return uint8(b) }", "title": "" }, { "docid": "2751f32b95ac0cbe03033a4a3e155a8b", "score": "0.5401498", "text": "func (c *Client) GetBoard(name string) (*jira.Board, error) {\n\topts := &jira.BoardListOptions{Name: name}\n\tlist, _, err := c.jira.Board.GetAllBoards(opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, item := range list.Values {\n\t\tif item.Name == name {\n\t\t\treturn &item, nil\n\t\t}\n\t}\n\n\treturn nil, fmt.Errorf(\"unable to find board with name %s\", name)\n}", "title": "" } ]
b6a2d2831b3842c4ac8aa03c9ca077c1
WithContext adds the context to the travel expense per diem compensation search params
[ { "docid": "fbf5e0cf57a32547a16dfbd959e89592", "score": "0.69866735", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithContext(ctx context.Context) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" } ]
[ { "docid": "b177141d6ba19baa38c45224c622042a", "score": "0.59571046", "text": "func NewTravelExpensePerDiemCompensationSearchParamsWithContext(ctx context.Context) *TravelExpensePerDiemCompensationSearchParams {\n\tvar (\n\t\tcountDefault = int64(1000)\n\t\tfromDefault = int64(0)\n\t)\n\treturn &TravelExpensePerDiemCompensationSearchParams{\n\t\tCount: &countDefault,\n\t\tFrom: &fromDefault,\n\n\t\tContext: ctx,\n\t}\n}", "title": "" }, { "docid": "e0b1068c851f4ed369e411b8ed783913", "score": "0.58702314", "text": "func NewTravelExpensePerDiemCompensationSearchParamsWithHTTPClient(client *http.Client) *TravelExpensePerDiemCompensationSearchParams {\n\tvar (\n\t\tcountDefault = int64(1000)\n\t\tfromDefault = int64(0)\n\t)\n\treturn &TravelExpensePerDiemCompensationSearchParams{\n\t\tCount: &countDefault,\n\t\tFrom: &fromDefault,\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "3b214ec976ec2859d8ddde2b92cbeab7", "score": "0.56565285", "text": "func (o *TravelExpenseZoneSearchParams) WithContext(ctx context.Context) *TravelExpenseZoneSearchParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "2479f8adcd4e6735fb6d6e3f49257d64", "score": "0.5617", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "a1632f4ee49efbdbd640c7dbad72bb53", "score": "0.555553", "text": "func (f Search) WithContext(v context.Context) func(*SearchRequest) {\n\treturn func(r *SearchRequest) {\n\t\tr.ctx = v\n\t}\n}", "title": "" }, { "docid": "4bad410a164d20127edaefa5e3913054", "score": "0.5416994", "text": "func NewTravelExpensePerDiemCompensationSearchParams() *TravelExpensePerDiemCompensationSearchParams {\n\tvar (\n\t\tcountDefault = int64(1000)\n\t\tfromDefault = int64(0)\n\t)\n\treturn &TravelExpensePerDiemCompensationSearchParams{\n\t\tCount: &countDefault,\n\t\tFrom: &fromDefault,\n\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}", "title": "" }, { "docid": "cd7c4ef2ba04df867d50cfa5a26922e1", "score": "0.5363977", "text": "func (_obj *Fetcher) AddServantWithContext(imp _impFetcherWithContext, obj string) {\n\ttars.AddServantWithContext(_obj, imp, obj)\n}", "title": "" }, { "docid": "d1cac62a4a7f635b125bdffb14bd8059", "score": "0.5353855", "text": "func NewTravelExpensePerDiemCompensationSearchParamsWithTimeout(timeout time.Duration) *TravelExpensePerDiemCompensationSearchParams {\n\tvar (\n\t\tcountDefault = int64(1000)\n\t\tfromDefault = int64(0)\n\t)\n\treturn &TravelExpensePerDiemCompensationSearchParams{\n\t\tCount: &countDefault,\n\t\tFrom: &fromDefault,\n\n\t\ttimeout: timeout,\n\t}\n}", "title": "" }, { "docid": "58874753612bc57c4e2eff8a68a07419", "score": "0.53473014", "text": "func (_obj *DataService) AddServantWithContext(imp _impDataServiceWithContext, obj string) {\n\ttars.AddServantWithContext(_obj, imp, obj)\n}", "title": "" }, { "docid": "f9d119664cfae9c18153aa8a0342828c", "score": "0.5245051", "text": "func (_obj *WCache) AddServantWithContext(imp _impWCacheWithContext, obj string) {\n\ttars.AddServantWithContext(_obj, imp, obj)\n}", "title": "" }, { "docid": "c3602037d021fd40910cb246eff59e66", "score": "0.51705474", "text": "func (o *TravelExpenseZoneSearchParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "de1fd5f166eea5a486ea7b5bf2af2b34", "score": "0.51648784", "text": "func (c *ProjectsLocationsReservationGrantsListCall) Context(ctx context.Context) *ProjectsLocationsReservationGrantsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "44fe807a3c4cdc19fe77b11dae8ee260", "score": "0.51301837", "text": "func (o *SearchFirewallParams) WithContext(ctx context.Context) *SearchFirewallParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "aa03abc9afb53fb0761ded66f3a9c9bf", "score": "0.51092005", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithHTTPClient(client *http.Client) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetHTTPClient(client)\n\treturn o\n}", "title": "" }, { "docid": "2586cb5e84440ca5e94c39760614c363", "score": "0.5107087", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithFields(fields *string) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetFields(fields)\n\treturn o\n}", "title": "" }, { "docid": "74fcbdac5d303ab6f777c87d2fa8786d", "score": "0.5057327", "text": "func (c *SearchListCall) Context(ctx context.Context) *SearchListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "a382cf0ba27084eb6806a614a9f9235b", "score": "0.5044149", "text": "func (c *MobileapppanelsListCall) Context(ctx context.Context) *MobileapppanelsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "05bd6d5e0152f60397bb04dc9954ae60", "score": "0.5041171", "text": "func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "0b0fd08a492bb2a338233ccefa875585", "score": "0.5020887", "text": "func (_obj *Apistickers) AddServantWithContext(imp _impApistickersWithContext, obj string) {\n\ttars.AddServantWithContext(_obj, imp, obj)\n}", "title": "" }, { "docid": "a2b0c87e2c9ca7b95a004019d0338207", "score": "0.50198674", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithFrom(from *int64) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetFrom(from)\n\treturn o\n}", "title": "" }, { "docid": "841917ee53a8d1f7a259fe6fb67e5f42", "score": "0.50095665", "text": "func (c *ProjectsLocationsReservationsListCall) Context(ctx context.Context) *ProjectsLocationsReservationsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "c884a3aa8147d9a41e84997ee46c68ad", "score": "0.4998121", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithTimeout(timeout time.Duration) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetTimeout(timeout)\n\treturn o\n}", "title": "" }, { "docid": "076748b7dedd54a7528a8ef3d1a8715c", "score": "0.49876347", "text": "func (o *InventorySearchParams) WithContext(ctx context.Context) *InventorySearchParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "85b04d476e2eb7b3ee0280d6cf4222d7", "score": "0.49639785", "text": "func (c *EntitiesSearchCall) Context(ctx context.Context) *EntitiesSearchCall {\r\n\tc.ctx_ = ctx\r\n\treturn c\r\n}", "title": "" }, { "docid": "b09f27e2027cf3e93aff19add89472fb", "score": "0.49464956", "text": "func InfoWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tInfoWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "046534650226e596fcdf1406d96b4453", "score": "0.49240908", "text": "func (_obj *HttpRoute) AddServantWithContext(imp _impHttpRouteWithContext, obj string) {\n\ttars.AddServantWithContext(_obj, imp, obj)\n}", "title": "" }, { "docid": "d9c9afcb802d79eec609f41871c5cc0d", "score": "0.49237588", "text": "func (c *ProjectsLocationsSearchReservationGrantsCall) Context(ctx context.Context) *ProjectsLocationsSearchReservationGrantsCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "00c64ee557f307a1aa938ce3479ecca5", "score": "0.490597", "text": "func (c *CseListCall) Context(ctx context.Context) *CseListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "cbfd0928541eed0b97c738b94da59832", "score": "0.488786", "text": "func (c *CseSiterestrictListCall) Context(ctx context.Context) *CseSiterestrictListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "40b0e45465328ed23a334bce18806ca8", "score": "0.4887048", "text": "func (c *ProjectsLocationsGlossariesListCall) Context(ctx context.Context) *ProjectsLocationsGlossariesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "ffb0caa30c66e020f02afdbd1715206b", "score": "0.48631814", "text": "func (o *LocationSearchUsingGETParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "efea741ae5031d2a49a7162687f93b5c", "score": "0.48463234", "text": "func RepoWithContext(c context.Context, r *Repo) context.Context {\n\treturn context.WithValue(c, repoKey, r)\n}", "title": "" }, { "docid": "29c6dddea2f65eb964ee89d5dc47388a", "score": "0.48389092", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) 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.Address != nil {\n\n\t\t// query param address\n\t\tvar qrAddress string\n\t\tif o.Address != nil {\n\t\t\tqrAddress = *o.Address\n\t\t}\n\t\tqAddress := qrAddress\n\t\tif qAddress != \"\" {\n\t\t\tif err := r.SetQueryParam(\"address\", qAddress); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.AmountFrom != nil {\n\n\t\t// query param amountFrom\n\t\tvar qrAmountFrom string\n\t\tif o.AmountFrom != nil {\n\t\t\tqrAmountFrom = *o.AmountFrom\n\t\t}\n\t\tqAmountFrom := qrAmountFrom\n\t\tif qAmountFrom != \"\" {\n\t\t\tif err := r.SetQueryParam(\"amountFrom\", qAmountFrom); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.AmountTo != nil {\n\n\t\t// query param amountTo\n\t\tvar qrAmountTo string\n\t\tif o.AmountTo != nil {\n\t\t\tqrAmountTo = *o.AmountTo\n\t\t}\n\t\tqAmountTo := qrAmountTo\n\t\tif qAmountTo != \"\" {\n\t\t\tif err := r.SetQueryParam(\"amountTo\", qAmountTo); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Count != nil {\n\n\t\t// query param count\n\t\tvar qrCount int64\n\t\tif o.Count != nil {\n\t\t\tqrCount = *o.Count\n\t\t}\n\t\tqCount := swag.FormatInt64(qrCount)\n\t\tif qCount != \"\" {\n\t\t\tif err := r.SetQueryParam(\"count\", qCount); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CountFrom != nil {\n\n\t\t// query param countFrom\n\t\tvar qrCountFrom int32\n\t\tif o.CountFrom != nil {\n\t\t\tqrCountFrom = *o.CountFrom\n\t\t}\n\t\tqCountFrom := swag.FormatInt32(qrCountFrom)\n\t\tif qCountFrom != \"\" {\n\t\t\tif err := r.SetQueryParam(\"countFrom\", qCountFrom); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.CountTo != nil {\n\n\t\t// query param countTo\n\t\tvar qrCountTo int32\n\t\tif o.CountTo != nil {\n\t\t\tqrCountTo = *o.CountTo\n\t\t}\n\t\tqCountTo := swag.FormatInt32(qrCountTo)\n\t\tif qCountTo != \"\" {\n\t\t\tif err := r.SetQueryParam(\"countTo\", qCountTo); 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\tif o.From != nil {\n\n\t\t// query param from\n\t\tvar qrFrom int64\n\t\tif o.From != nil {\n\t\t\tqrFrom = *o.From\n\t\t}\n\t\tqFrom := swag.FormatInt64(qrFrom)\n\t\tif qFrom != \"\" {\n\t\t\tif err := r.SetQueryParam(\"from\", qFrom); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.IsDeductionForBreakfast != nil {\n\n\t\t// query param isDeductionForBreakfast\n\t\tvar qrIsDeductionForBreakfast bool\n\t\tif o.IsDeductionForBreakfast != nil {\n\t\t\tqrIsDeductionForBreakfast = *o.IsDeductionForBreakfast\n\t\t}\n\t\tqIsDeductionForBreakfast := swag.FormatBool(qrIsDeductionForBreakfast)\n\t\tif qIsDeductionForBreakfast != \"\" {\n\t\t\tif err := r.SetQueryParam(\"isDeductionForBreakfast\", qIsDeductionForBreakfast); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.IsDinnerDeduction != nil {\n\n\t\t// query param isDinnerDeduction\n\t\tvar qrIsDinnerDeduction bool\n\t\tif o.IsDinnerDeduction != nil {\n\t\t\tqrIsDinnerDeduction = *o.IsDinnerDeduction\n\t\t}\n\t\tqIsDinnerDeduction := swag.FormatBool(qrIsDinnerDeduction)\n\t\tif qIsDinnerDeduction != \"\" {\n\t\t\tif err := r.SetQueryParam(\"isDinnerDeduction\", qIsDinnerDeduction); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.IsLunchDeduction != nil {\n\n\t\t// query param isLunchDeduction\n\t\tvar qrIsLunchDeduction bool\n\t\tif o.IsLunchDeduction != nil {\n\t\t\tqrIsLunchDeduction = *o.IsLunchDeduction\n\t\t}\n\t\tqIsLunchDeduction := swag.FormatBool(qrIsLunchDeduction)\n\t\tif qIsLunchDeduction != \"\" {\n\t\t\tif err := r.SetQueryParam(\"isLunchDeduction\", qIsLunchDeduction); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Location != nil {\n\n\t\t// query param location\n\t\tvar qrLocation string\n\t\tif o.Location != nil {\n\t\t\tqrLocation = *o.Location\n\t\t}\n\t\tqLocation := qrLocation\n\t\tif qLocation != \"\" {\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\n\t}\n\n\tif o.OvernightAccommodation != nil {\n\n\t\t// query param overnightAccommodation\n\t\tvar qrOvernightAccommodation string\n\t\tif o.OvernightAccommodation != nil {\n\t\t\tqrOvernightAccommodation = *o.OvernightAccommodation\n\t\t}\n\t\tqOvernightAccommodation := qrOvernightAccommodation\n\t\tif qOvernightAccommodation != \"\" {\n\t\t\tif err := r.SetQueryParam(\"overnightAccommodation\", qOvernightAccommodation); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.RateCategoryID != nil {\n\n\t\t// query param rateCategoryId\n\t\tvar qrRateCategoryID string\n\t\tif o.RateCategoryID != nil {\n\t\t\tqrRateCategoryID = *o.RateCategoryID\n\t\t}\n\t\tqRateCategoryID := qrRateCategoryID\n\t\tif qRateCategoryID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"rateCategoryId\", qRateCategoryID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.RateFrom != nil {\n\n\t\t// query param rateFrom\n\t\tvar qrRateFrom string\n\t\tif o.RateFrom != nil {\n\t\t\tqrRateFrom = *o.RateFrom\n\t\t}\n\t\tqRateFrom := qrRateFrom\n\t\tif qRateFrom != \"\" {\n\t\t\tif err := r.SetQueryParam(\"rateFrom\", qRateFrom); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.RateTo != nil {\n\n\t\t// query param rateTo\n\t\tvar qrRateTo string\n\t\tif o.RateTo != nil {\n\t\t\tqrRateTo = *o.RateTo\n\t\t}\n\t\tqRateTo := qrRateTo\n\t\tif qRateTo != \"\" {\n\t\t\tif err := r.SetQueryParam(\"rateTo\", qRateTo); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.RateTypeID != nil {\n\n\t\t// query param rateTypeId\n\t\tvar qrRateTypeID string\n\t\tif o.RateTypeID != nil {\n\t\t\tqrRateTypeID = *o.RateTypeID\n\t\t}\n\t\tqRateTypeID := qrRateTypeID\n\t\tif qRateTypeID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"rateTypeId\", qRateTypeID); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.Sorting != nil {\n\n\t\t// query param sorting\n\t\tvar qrSorting string\n\t\tif o.Sorting != nil {\n\t\t\tqrSorting = *o.Sorting\n\t\t}\n\t\tqSorting := qrSorting\n\t\tif qSorting != \"\" {\n\t\t\tif err := r.SetQueryParam(\"sorting\", qSorting); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif o.TravelExpenseID != nil {\n\n\t\t// query param travelExpenseId\n\t\tvar qrTravelExpenseID string\n\t\tif o.TravelExpenseID != nil {\n\t\t\tqrTravelExpenseID = *o.TravelExpenseID\n\t\t}\n\t\tqTravelExpenseID := qrTravelExpenseID\n\t\tif qTravelExpenseID != \"\" {\n\t\t\tif err := r.SetQueryParam(\"travelExpenseId\", qTravelExpenseID); 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": "cefb750ade037108cb3f442d808af2eb", "score": "0.48362648", "text": "func AddParamsToContext(ctx context.Context, params map[string]string) context.Context {\n\treturn context.WithValue(ctx, paramsContextKey, params)\n}", "title": "" }, { "docid": "32bd1e91f1906679636ed7cb23570cfc", "score": "0.48344305", "text": "func (c *DirectDealsListCall) Context(ctx context.Context) *DirectDealsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "359073c9ecaf3152ccf26104a8c7e1ab", "score": "0.48178524", "text": "func (c *AttributesListCall) Context(ctx context.Context) *AttributesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "2e3ad6f353b44909efd5be18e6cc4bfa", "score": "0.4813627", "text": "func (req ReplaceRequest) Context(ctx context.Context) ReplaceRequest {\n\treq.impl = req.impl.Context(ctx)\n\n\treturn req\n}", "title": "" }, { "docid": "88448e9dfccdc9d27b69e0b272adece4", "score": "0.4809874", "text": "func (o *InventorySearchParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "a8d7a2e1c1e33ac2cca79d9a1d78433d", "score": "0.48048127", "text": "func (c *IamPoliciesSearchAllCall) Context(ctx context.Context) *IamPoliciesSearchAllCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "406487ac52babf2ed6fbc18b68b5e2c9", "score": "0.47990212", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithLocation(location *string) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetLocation(location)\n\treturn o\n}", "title": "" }, { "docid": "deaa828a4a6a5b9ab77fafb2b26ceeda", "score": "0.47976556", "text": "func (c *LocationsSearchkeywordsImpressionsMonthlyListCall) Context(ctx context.Context) *LocationsSearchkeywordsImpressionsMonthlyListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "ee9e67e5f7dfa65da86f50cf8d8f6fcb", "score": "0.47968525", "text": "func (o *TravelExpensePerDiemCompensationSearchParams) WithTravelExpenseID(travelExpenseID *string) *TravelExpensePerDiemCompensationSearchParams {\n\to.SetTravelExpenseID(travelExpenseID)\n\treturn o\n}", "title": "" }, { "docid": "edbc3990276469dd3c0eec05bfa45252", "score": "0.47894627", "text": "func (f AddressSearchSettlements) WithContext(v context.Context) func(*AddressSearchSettlementsRequest) {\n\n\treturn func(r *AddressSearchSettlementsRequest) {\n\t\tr.ctx = v\n\t}\n}", "title": "" }, { "docid": "4026044504a50f6391c33ae9253357b8", "score": "0.47866976", "text": "func (c *ProjectsLocationsAgentsEnvironmentsListCall) Context(ctx context.Context) *ProjectsLocationsAgentsEnvironmentsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "da8b51d82e938dc3b901ad0741d51ec8", "score": "0.4767372", "text": "func (c *OrganizationsProductsSearchCall) Context(ctx context.Context) *OrganizationsProductsSearchCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "753b5adf8f6b9e885a5c45bf74438964", "score": "0.47666603", "text": "func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "753b5adf8f6b9e885a5c45bf74438964", "score": "0.47666603", "text": "func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "ed064e8442a28864b83536d16287ebbb", "score": "0.47659123", "text": "func AttachWithContext(conf *axios.Config, c *elton.Context) {\n\tif c == nil || conf == nil {\n\t\treturn\n\t}\n\tconf.Set(cs.CID, c.ID)\n}", "title": "" }, { "docid": "d0b29018236a145485d27c49ef8e7fcc", "score": "0.475278", "text": "func (appCtx ApplicationContext) ExtendContext(ctx context.Context) context.Context {\n\treturn context.WithValue(ctx, ApplicationContextKey, appCtx)\n}", "title": "" }, { "docid": "d0b29018236a145485d27c49ef8e7fcc", "score": "0.475278", "text": "func (appCtx ApplicationContext) ExtendContext(ctx context.Context) context.Context {\n\treturn context.WithValue(ctx, ApplicationContextKey, appCtx)\n}", "title": "" }, { "docid": "4a519a4bed9450bb8c53e50a2aa6a9a5", "score": "0.47213748", "text": "func (o *SearchFirewallParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "4326198b09f479dbc4830c359d40cee0", "score": "0.47109443", "text": "func (o *GetAllCompletedEnvironmentsForGivenProdNVersionUsingGETParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "9ec2656a35350236f11a131e55562427", "score": "0.47094208", "text": "func (c *ProjectsLocationsAgentsEnvironmentsExperimentsListCall) Context(ctx context.Context) *ProjectsLocationsAgentsEnvironmentsExperimentsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "f194f03c46eb215dd9f556eb2121dfe1", "score": "0.469755", "text": "func (o *GetAllMarketPlaceAppsByFilterUsingGETParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "817c12e6c579c3b3d63321aed6ab7ac4", "score": "0.46896893", "text": "func (c *ProjectsLocationsAgentsListCall) Context(ctx context.Context) *ProjectsLocationsAgentsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "582afd1352c86cec260c7880be352529", "score": "0.46651053", "text": "func ContextMiddleware(next http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tvar (\n\t\t\tctx context.Context\n\t\t\tcancel context.CancelFunc\n\t\t)\n\t\ttimeout, err := time.ParseDuration(viper.GetString(\"webserver.contexttimeout\"))\n\t\t//timeout, err := time.ParseDuration(\"60s\")\n\t\tif err == nil {\n\t\t\t// The request has a timeout, so create a context that is\n\t\t\t// canceled automatically when the timeout expires.\n\t\t\tctx, cancel = context.WithTimeout(r.Context(), timeout)\n\t\t} else {\n\t\t\tctx, cancel = context.WithCancel(r.Context())\n\t\t}\n\t\tdefer cancel() // Cancel ctx as soon as handleSearch returns.\n\t\tnext.ServeHTTP(w, r.WithContext(ctx))\n\t})\n}", "title": "" }, { "docid": "0f9bb2dba61a750fb06f4cf405d767dd", "score": "0.46607816", "text": "func (resp *HTTPResponse) ExtendParams(ctx Params) *HTTPResponse {\n\tif resp.Context == nil {\n\t\tresp.Context = ctx\n\t} else {\n\t\tfor k, v := range ctx {\n\t\t\tresp.Context[k] = v\n\t\t}\n\t}\n\treturn resp\n}", "title": "" }, { "docid": "b53bb310f7367057d535c4c60abb81ac", "score": "0.46597868", "text": "func (o *PostTravelExpenseAccommodationAllowanceParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "868a4048166d88838cc821c04fad90e2", "score": "0.46586967", "text": "func (req *UpdateRequest) Context(ctx context.Context) *UpdateRequest {\n\treq.impl = req.impl.Context(ctx)\n\n\treturn req\n}", "title": "" }, { "docid": "c66d4fea69d70a8d3f0b31740123f3a9", "score": "0.465439", "text": "func LogWithContext(c context.Context, l *Log) context.Context {\n\treturn context.WithValue(c, logKey, l)\n}", "title": "" }, { "docid": "1388b238896f53b0fa200772fef49596", "score": "0.4647294", "text": "func (m *LoyaltyEventLocationFilter) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "f9fd9843bba72ce11ef51897c1f7fbdf", "score": "0.46347952", "text": "func (c *SurveysListCall) Context(ctx context.Context) *SurveysListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "701d167f261aebf58330b6673d8b6f65", "score": "0.46333143", "text": "func (req GetRequest) Context(ctx context.Context) GetRequest {\n\treq.impl = req.impl.Context(ctx)\n\n\treturn req\n}", "title": "" }, { "docid": "49530dd2bcad4bd35ebf08691f0ff43f", "score": "0.462973", "text": "func (o *GetSearchSuggestionParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "1bfb01910d640cc820f3e545c489b924", "score": "0.46292573", "text": "func (c *AccountsPaymentsListCall) Context(ctx context.Context) *AccountsPaymentsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "88747aa8c9bb702c342ea587fbac8c75", "score": "0.4625817", "text": "func (c *ProjectsLocationsPipelinesListCall) Context(ctx context.Context) *ProjectsLocationsPipelinesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "20753cce7b1830a2525ed9e308b2c6a4", "score": "0.46256062", "text": "func (c *OrganizationsSourcesFindingsListCall) Context(ctx context.Context) *OrganizationsSourcesFindingsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "14768423b5d397b22485b41ea007c557", "score": "0.46243572", "text": "func (o *PostCustomersCustomerFidSubscriptionsSubscriptionFidCancelFlowFlowSearchOptionsParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "ea3c99f5a3b3de7aadbaf9941708de4d", "score": "0.46183527", "text": "func (c *OrganizationsSimulationsAttackPathsListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackPathsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "6392ed51dd77a6d8aa152370e8b504a2", "score": "0.4610161", "text": "func injectContext(ctx context.Context, headers map[string]interface{}) map[string]interface{} {\n\totel.GetTextMapPropagator().Inject(ctx, &headerSupplier{\n\t\theaders: headers,\n\t})\n\tlog.Printf(\"Headers: %s\", headers)\n\treturn headers\n}", "title": "" }, { "docid": "3cdfe0cbc5f7071a84867d1da704750e", "score": "0.45948333", "text": "func (c *StatementsListCall) Context(ctx context.Context) *StatementsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "47bb47847090573db44176ed4c776391", "score": "0.45941448", "text": "func (c *PretargetingConfigListCall) Context(ctx context.Context) *PretargetingConfigListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "d5ba7758bdee4028bcf97f183e7f555c", "score": "0.45936117", "text": "func NewTravelExpenseZoneSearchParamsWithHTTPClient(client *http.Client) *TravelExpenseZoneSearchParams {\n\tvar (\n\t\tcountDefault = int64(1000)\n\t\tfromDefault = int64(0)\n\t)\n\treturn &TravelExpenseZoneSearchParams{\n\t\tCount: &countDefault,\n\t\tFrom: &fromDefault,\n\t\tHTTPClient: client,\n\t}\n}", "title": "" }, { "docid": "7046dbdf2e5c780ba7c09b44b35c0445", "score": "0.4593237", "text": "func ExtractWithContext(ctx context.Context, rawurl string) (*LyricsInfo, error) {\n\tu, err := url.Parse(rawurl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq := request.NewWithContext(ctx, u)\n\tdefer func() { _ = req.Close() }()\n\treturn ExtractFromRequest(req)\n}", "title": "" }, { "docid": "fab71818b6df9d71ad9d5a7c2480b691", "score": "0.45915744", "text": "func (p *EnvironmentsPaginator) NextWithContext(context context.Context) bool {\n\toptions := p.options\n\n\tif options == nil {\n\t\toptions = &EnvironmentsPageOptions{}\n\t}\n\n\tif p.CurrentPage() != nil {\n\t\tnextPage := p.CurrentPage().Meta.NextPageURL\n\n\t\tif nextPage == nil {\n\t\t\treturn false\n\t\t}\n\n\t\tparsedURL, err := url.Parse(*nextPage)\n\t\tif err != nil {\n\t\t\tp.Page.Error = err\n\t\t\treturn false\n\t\t}\n\n\t\toptions.PageToken = utils.String(parsedURL.Query().Get(\"PageToken\"))\n\n\t\tpage, pageErr := strconv.Atoi(parsedURL.Query().Get(\"Page\"))\n\t\tif pageErr != nil {\n\t\t\tp.Page.Error = pageErr\n\t\t\treturn false\n\t\t}\n\t\toptions.Page = utils.Int(page)\n\n\t\tpageSize, pageSizeErr := strconv.Atoi(parsedURL.Query().Get(\"PageSize\"))\n\t\tif pageSizeErr != nil {\n\t\t\tp.Page.Error = pageSizeErr\n\t\t\treturn false\n\t\t}\n\t\toptions.PageSize = utils.Int(pageSize)\n\t}\n\n\tresp, err := p.Page.client.PageWithContext(context, options)\n\tp.Page.CurrentPage = resp\n\tp.Page.Error = err\n\n\tif p.Page.Error == nil {\n\t\tp.Environments = append(p.Environments, resp.Environments...)\n\t}\n\n\treturn p.Page.Error == nil\n}", "title": "" }, { "docid": "5f63e23c785f701f07af35c9eb97de7f", "score": "0.45825326", "text": "func (o *GetSearchSuggestionParams) WithContext(ctx context.Context) *GetSearchSuggestionParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "2565ce247baac6bcd5e0b822941ac54e", "score": "0.45794067", "text": "func (c Client) AddWordWithContext(word, translation string, context string) ([]error, Word) {\n\treq := AddWordWithContextRequest{\n\t\tWord: word,\n\t\tTranslation: translation,\n\t\tContext: context,\n\t}\n\n\tvar result Word\n\terrs := c.get(addWordURL, req, &result)\n\tif strings.TrimSpace(result.ErrorMsg) != \"\" {\n\t\terrs = append(errs, errors.New(\"Something went wrong: \"+result.ErrorMsg))\n\t}\n\n\treturn errs, result\n}", "title": "" }, { "docid": "0671ba5dd9922889797a83bfda12de76", "score": "0.45781887", "text": "func (o *GetClinicsClinicGUIDDepartmentsParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "0acfa028d639db687bff45d12d1aa137", "score": "0.45717952", "text": "func (c *GoogleLocationsSearchCall) Context(ctx context.Context) *GoogleLocationsSearchCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "aa40ba0c9ecfd3623e3e165e681214c1", "score": "0.4569828", "text": "func (page *BuildArgumentListPage) NextWithContext(ctx context.Context) (err error) {\n\tif tracing.IsEnabled() {\n\t\tctx = tracing.StartSpan(ctx, fqdn+\"/BuildArgumentListPage.NextWithContext\")\n\t\tdefer func() {\n\t\t\tsc := -1\n\t\t\tif page.Response().Response.Response != nil {\n\t\t\t\tsc = page.Response().Response.Response.StatusCode\n\t\t\t}\n\t\t\ttracing.EndSpan(ctx, sc, err)\n\t\t}()\n\t}\n\tnext, err := page.fn(ctx, page.bal)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpage.bal = next\n\treturn nil\n}", "title": "" }, { "docid": "ba50f12ea248a0b01404b8546264125a", "score": "0.45680317", "text": "func (c *OrganizationsCatalogsSearchCall) Context(ctx context.Context) *OrganizationsCatalogsSearchCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "1e3f6811478cd9594dfe13f9ee0fe865", "score": "0.45580572", "text": "func DebugWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tDebugWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "c480378f84b1e865ad9dc20be56b24f1", "score": "0.45503902", "text": "func (m *ApplicationSearchIncludeFields) ContextValidate(ctx context.Context, formats strfmt.Registry) error {\n\treturn nil\n}", "title": "" }, { "docid": "fb5ac7d7173d39bc79e857f01df686d6", "score": "0.45479918", "text": "func updateParamsWithRequestContext(params *RequestParams, io workflow.WorkFlowData) {\n\trc, err := io.ExecContext.Get(constants.RequestContext)\n\tif err != nil { //no need to return error as its not fatal issue\n\t\tlogger.Info(fmt.Sprintf(\"err in retrieving request context : %v\", err), rc)\n\t}\n\tif v, ok := rc.(utilHttp.RequestContext); ok {\n\t\tparams.RequestContext = v\n\t}\n}", "title": "" }, { "docid": "59449716a202aa2f066fbd03180554e7", "score": "0.45478696", "text": "func Context() EndpointParam {\n\treturn contextArgument{}\n}", "title": "" }, { "docid": "97a837b3045728c528957febbe7584f8", "score": "0.45435613", "text": "func (c *ChainsSearchCall) Context(ctx context.Context) *ChainsSearchCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "06302da4c74c568f3aed954d3822f556", "score": "0.45421967", "text": "func (o *ExpressUpdateUsingGETParams) SetContext(ctx context.Context) {\n\to.Context = ctx\n}", "title": "" }, { "docid": "06ae3df36a817b7a9a6c5e83e9047313", "score": "0.45407712", "text": "func (c *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "06ae3df36a817b7a9a6c5e83e9047313", "score": "0.4539983", "text": "func (c *OrganizationsOperationsListCall) Context(ctx context.Context) *OrganizationsOperationsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "c4e90cb5524269a47e1edda79631afd5", "score": "0.45377955", "text": "func (s *SearchContext) WithLogger(log io.Writer) *SearchContext {\n\tresult := *s\n\tresult.Logging = stdlog.New(log, \"\", 0)\n\tif result.Trace == TRACE_DISABLED {\n\t\tresult.Trace = TRACE_ENABLED\n\t}\n\treturn &result\n}", "title": "" }, { "docid": "303b84a69904e8a5d725dab5d805d4c8", "score": "0.4536857", "text": "func WarnWithContext(ctx context.Context, log string, fields ...zapcore.Field) {\n\tWarnWithSpan(opentracing.SpanFromContext(ctx), log, fields...)\n}", "title": "" }, { "docid": "b0dd14eb57bbc6aa9bbdad565f83cbfa", "score": "0.4535005", "text": "func (o *GetVulnerabilitiesAdditionParams) WithContext(ctx context.Context) *GetVulnerabilitiesAdditionParams {\n\to.SetContext(ctx)\n\treturn o\n}", "title": "" }, { "docid": "1b9b367b053e07218c586cf888fdb1cd", "score": "0.45343074", "text": "func StepWithContext(c context.Context, s *Step) context.Context {\n\treturn context.WithValue(c, stepKey, s)\n}", "title": "" }, { "docid": "c271f2c738d5ddd907e7ceac9f322609", "score": "0.45303476", "text": "func (c *CasesSearchCall) Context(ctx context.Context) *CasesSearchCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "f417e68c47e3f1f6f3e51f0bf48a6409", "score": "0.45276806", "text": "func extendContext(ctx []PathElement, pe PathElement) []PathElement {\n\tnewCtx := make([]PathElement, len(ctx), len(ctx)+1)\n\tcopy(newCtx, ctx)\n\treturn append(newCtx, pe)\n}", "title": "" }, { "docid": "7b70cff47f4a3219a41b6fed303c6218", "score": "0.4523312", "text": "func StageWithContext(c context.Context, s *Stage) context.Context {\n\treturn context.WithValue(c, stageKey, s)\n}", "title": "" }, { "docid": "1516b93a2d1da6e11f6f97aacdac7fd3", "score": "0.45231828", "text": "func (c *ProjectsLocationsKeyRingsListCall) Context(ctx context.Context) *ProjectsLocationsKeyRingsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "d4db4468e5c9bd09515cc12a4c48d7b1", "score": "0.45183334", "text": "func (c *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall) Context(ctx context.Context) *OrganizationsSimulationsAttackExposureResultsValuedResourcesListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "4ba176768b263cf57fe11a541cad17bc", "score": "0.45092118", "text": "func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" }, { "docid": "4ba176768b263cf57fe11a541cad17bc", "score": "0.45092118", "text": "func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {\n\tc.ctx_ = ctx\n\treturn c\n}", "title": "" } ]
30c43b73c1174e8bac446a865ca4085f
redactSensitive replaces sensitive fields within a response with redactionStr.
[ { "docid": "03f6a2ebe695feba866142a7496e60e6", "score": "0.7072436", "text": "func (d *RoundTripper) redactSensitive(body *ordered.OrderedMap) {\n\titerator := body.EntriesIter()\n\tfor {\n\t\tpair, ok := iterator()\n\t\tif !ok {\n\t\t\tbreak\n\t\t}\n\t\tif d.redact[pair.Key] {\n\t\t\tbody.Set(pair.Key, redactedReplacement)\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "7f4de2eac68dcac9b72184375d35c7b4", "score": "0.6200287", "text": "func Redact(r interface{}) string { return safedetails.Redact(r) }", "title": "" }, { "docid": "7f4de2eac68dcac9b72184375d35c7b4", "score": "0.6200287", "text": "func Redact(r interface{}) string { return safedetails.Redact(r) }", "title": "" }, { "docid": "bef17d1d01f0b25d78b9c5776eb0c21c", "score": "0.59264123", "text": "func (f *Finding) Redact() {\n\tf.Line = strings.Replace(f.Line, f.Secret, \"REDACTED\", -1)\n\tf.Match = strings.Replace(f.Match, f.Secret, \"REDACTED\", -1)\n\tf.Secret = \"REDACTED\"\n}", "title": "" }, { "docid": "418916ca5a319fbd3d7bf8c13d3fd0ec", "score": "0.56334436", "text": "func (m *CreateResponse) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tm.Data = \"\"\n\tm.Name = \"\"\n\tm.Active = false\n\tm.ExpirationTimestamp = nil\n\n\treturn nil\n}", "title": "" }, { "docid": "301d7da29cb1438a133be1be5fdf2295", "score": "0.55310184", "text": "func FilterRedacted(str string) string {\n\tGRedactedMtx.RLock()\n\tdefer func() {\n\t\tGRedactedMtx.RUnlock()\n\t}()\n\tfor redacted := range GRedactedStrings {\n\t\tstr = strings.Replace(str, redacted, Redacted, -1)\n\t}\n\treturn str\n}", "title": "" }, { "docid": "882dd798b5dd188832fdf656693f1e44", "score": "0.5380049", "text": "func (o GrpcRouteMethodMatchResponseOutput) CaseSensitive() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GrpcRouteMethodMatchResponse) bool { return v.CaseSensitive }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "4c522fd0628ec59c218239997f0a4da6", "score": "0.53639483", "text": "func (m *SplunkReceiver) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetSplunkServerTls().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting SplunkReceiver.splunk_server_tls\")\n\t}\n\n\tif err := m.GetSplunkHecToken().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting SplunkReceiver.splunk_hec_token\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1e9e8f57734b347731d497fb6db9fc7e", "score": "0.51812667", "text": "func (m *SyslogReceiver) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetTlsServer().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting SyslogReceiver.tls_server\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "18e42ea347bc6b5dea30673b29d4b233", "score": "0.5169133", "text": "func (m *DataDogReceiver) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetDatadogApiKey().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting DataDogReceiver.datadog_api_key\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "ea8322c456ee668325ce4e7b13e68e07", "score": "0.5103739", "text": "func (m *CreateServiceCredentialsRequest) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tm.Password = \"\"\n\n\tif err := m.GetApiCertificate().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateServiceCredentialsRequest.api_certificate\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "381ee653811d7d36bc5a52d336b0606b", "score": "0.51030356", "text": "func sanitizeResponse(r *model.Response, matchers wildcard.Matchers) {\n\tsanitizeHeaders(r.Headers, matchers)\n}", "title": "" }, { "docid": "be1d348021c8cdf54c5157aedc43344e", "score": "0.50769466", "text": "func (inq *Inquiry) redactValue(data []byte) []byte {\n\tredacted := data\n\tfor _, s := range inq.SecretValues {\n\t\tif bytes.Compare(redacted, []byte(\"\")) == 0 {\n\t\t\treturn redacted\n\t\t}\n\t\tredacted = s.Redact(redacted)\n\t}\n\treturn redacted\n}", "title": "" }, { "docid": "e18bdeef18e73349398f349e34de15cb", "score": "0.50650525", "text": "func (m *ReplaceSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetSyslog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.syslog\")\n\t}\n\n\tif err := m.GetDataDog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.data_dog\")\n\t}\n\n\tif err := m.GetSplunk().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.splunk\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "de8ba1522c182d55f2cca31d41ba247a", "score": "0.5015281", "text": "func redact(obj runtime.Object) runtime.Object {\n\tswitch exposed := obj.(type) {\n\tcase *corev1.Secret:\n\t\tredacted := exposed.DeepCopy()\n\t\tredacted.Data = nil\n\t\tredacted.StringData = nil\n\t\texposed.ObjectMeta.DeepCopyInto(&redacted.ObjectMeta)\n\n\t\treturn redacted\n\tcase *corev1.ConfigMap:\n\t\tredacted := exposed.DeepCopy()\n\t\tredacted.Data = nil\n\n\t\treturn redacted\n\t}\n\n\treturn obj\n}", "title": "" }, { "docid": "2b9b16f84c3756760647177242497082", "score": "0.49761614", "text": "func (o SsisVariableResponseOutput) Sensitive() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v SsisVariableResponse) *bool { return v.Sensitive }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f1c06261a7c1f7cfe7b915b86e448cdd", "score": "0.49739757", "text": "func (m *ReplaceSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetIngressEgressGw().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.ingress_egress_gw\")\n\t}\n\n\tif err := m.GetVoltstackCluster().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.voltstack_cluster\")\n\t}\n\n\tif err := m.GetIngressEgressGwAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.ingress_egress_gw_ar\")\n\t}\n\n\tif err := m.GetVoltstackClusterAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.voltstack_cluster_ar\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a7f309e8620146c692f847ebf80f4263", "score": "0.4967068", "text": "func (c Config) RedactedString() string {\n\tname := c.Name\n\tif IsRedacted(name) {\n\t\treturn fmt.Sprintf(\n\t\t\t\"'%s':'%s'\",\n\t\t\tc.Name,\n\t\t\tRedacted,\n\t\t)\n\t}\n\treturn fmt.Sprintf(\n\t\t\"'%s':'%s'\",\n\t\tc.Name,\n\t\tc.Value,\n\t)\n}", "title": "" }, { "docid": "7444c6ec592476e01081e9b4a01ea3ed", "score": "0.49290526", "text": "func (m *ApiCertificateType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tm.Password = \"\"\n\n\treturn nil\n}", "title": "" }, { "docid": "7dcec99ecdbebd04625f04c5488abac9", "score": "0.48990032", "text": "func Sensitive(usage string) string {\n\treturn New(usage).SetSensitive().String()\n}", "title": "" }, { "docid": "191a314d63350519e0af274d60987f59", "score": "0.4897423", "text": "func TestRedactSummarySilent(t *testing.T) {\n\tconfig := &Config{AllowedKeys: []string{\"id\", \"name\", \"group\"},\n\t\tBlockedValues: []string{\"4[0-9]{12}(?:[0-9]{3})?\"},\n\t\tSummary: \"silent\"}\n\tallowed := map[string]pcommon.Value{\n\t\t\"id\": pcommon.NewValueInt(5),\n\t}\n\tmasked := map[string]pcommon.Value{\n\t\t\"name\": pcommon.NewValueStr(\"placeholder 4111111111111111\"),\n\t}\n\tredacted := map[string]pcommon.Value{\n\t\t\"credit_card\": pcommon.NewValueStr(\"4111111111111111\"),\n\t}\n\n\toutTraces := runTest(t, allowed, redacted, masked, nil, config)\n\n\tattr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes()\n\tfor k := range redacted {\n\t\t_, ok := attr.Get(k)\n\t\tassert.False(t, ok)\n\t}\n\t_, ok := attr.Get(redactedKeys)\n\tassert.False(t, ok)\n\t_, ok = attr.Get(redactedKeyCount)\n\tassert.False(t, ok)\n\t_, ok = attr.Get(maskedValues)\n\tassert.False(t, ok)\n\t_, ok = attr.Get(maskedValueCount)\n\tassert.False(t, ok)\n\tvalue, _ := attr.Get(\"name\")\n\tassert.Equal(t, \"placeholder ****\", value.Str())\n}", "title": "" }, { "docid": "bdfe6921ca45792db5fcbc518e323051", "score": "0.4886242", "text": "func (m *ReplaceSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetTlsParameters().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.tls_parameters\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6e05234effb6165c57ef503c69e65ac6", "score": "0.4819825", "text": "func TestRedactUnknownAttributes(t *testing.T) {\n\tconfig := &Config{\n\t\tAllowedKeys: []string{\"group\", \"id\", \"name\"},\n\t}\n\tallowed := map[string]pcommon.Value{\n\t\t\"group\": pcommon.NewValueStr(\"temporary\"),\n\t\t\"id\": pcommon.NewValueInt(5),\n\t\t\"name\": pcommon.NewValueStr(\"placeholder\"),\n\t}\n\tignored := map[string]pcommon.Value{\n\t\t\"safe_attribute\": pcommon.NewValueStr(\"4111111111111112\"),\n\t}\n\tredacted := map[string]pcommon.Value{\n\t\t\"credit_card\": pcommon.NewValueStr(\"4111111111111111\"),\n\t}\n\n\toutTraces := runTest(t, allowed, redacted, nil, ignored, config)\n\n\tattr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes()\n\tfor k, v := range allowed {\n\t\tval, ok := attr.Get(k)\n\t\tassert.True(t, ok)\n\t\tassert.Equal(t, v.AsRaw(), val.AsRaw())\n\t}\n\tfor k := range redacted {\n\t\t_, ok := attr.Get(k)\n\t\tassert.False(t, ok)\n\t}\n}", "title": "" }, { "docid": "d56964f8eb22bd4b8eb6bc289ff5db72", "score": "0.4752784", "text": "func (o ListenerRuleMatchHttpMatchHeaderMatchOutput) CaseSensitive() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v ListenerRuleMatchHttpMatchHeaderMatch) *bool { return v.CaseSensitive }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "a18e9b9e90e00d547081b4c50bdf7468", "score": "0.4739469", "text": "func (o SsisParameterResponseOutput) Sensitive() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v SsisParameterResponse) *bool { return v.Sensitive }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "f4cc8b7c7e52c9a7ce97fb2b71d21fa6", "score": "0.47234794", "text": "func (m *ReplaceSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetClusterWideAppList().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ReplaceSpecType.cluster_wide_app_list\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "1228756b16342aabcb9f50c325f8662f", "score": "0.47180098", "text": "func TestRedactSummaryDebug(t *testing.T) {\n\tconfig := &Config{\n\t\tAllowedKeys: []string{\"id\", \"group\", \"name\", \"group.id\", \"member (id)\"},\n\t\tBlockedValues: []string{\"4[0-9]{12}(?:[0-9]{3})?\"},\n\t\tIgnoredKeys: []string{\"safe_attribute\"},\n\t\tSummary: \"debug\",\n\t}\n\tallowed := map[string]pcommon.Value{\n\t\t\"id\": pcommon.NewValueInt(5),\n\t\t\"group.id\": pcommon.NewValueStr(\"some.valid.id\"),\n\t\t\"member (id)\": pcommon.NewValueStr(\"some other valid id\"),\n\t}\n\tmasked := map[string]pcommon.Value{\n\t\t\"name\": pcommon.NewValueStr(\"placeholder 4111111111111111\"),\n\t}\n\tignored := map[string]pcommon.Value{\n\t\t\"safe_attribute\": pcommon.NewValueStr(\"harmless 4111111111111112\"),\n\t}\n\tredacted := map[string]pcommon.Value{\n\t\t\"credit_card\": pcommon.NewValueStr(\"4111111111111111\"),\n\t}\n\n\toutTraces := runTest(t, allowed, redacted, masked, ignored, config)\n\n\tattr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes()\n\tdeleted := make([]string, 0, len(redacted))\n\tfor k := range redacted {\n\t\t_, ok := attr.Get(k)\n\t\tassert.False(t, ok)\n\t\tdeleted = append(deleted, k)\n\t}\n\tmaskedKeys, ok := attr.Get(redactedKeys)\n\tassert.True(t, ok)\n\tsort.Strings(deleted)\n\tassert.Equal(t, strings.Join(deleted, \",\"), maskedKeys.Str())\n\tmaskedKeyCount, ok := attr.Get(redactedKeyCount)\n\tassert.True(t, ok)\n\tassert.Equal(t, int64(len(deleted)), maskedKeyCount.Int())\n\n\tignoredKeyCount, ok := attr.Get(ignoredKeyCount)\n\tassert.True(t, ok)\n\tassert.Equal(t, int64(len(ignored)), ignoredKeyCount.Int())\n\n\tblockedKeys := []string{\"name\"}\n\tmaskedValues, ok := attr.Get(maskedValues)\n\tassert.True(t, ok)\n\tassert.Equal(t, strings.Join(blockedKeys, \",\"), maskedValues.Str())\n\tmaskedValueCount, ok := attr.Get(maskedValueCount)\n\tassert.True(t, ok)\n\tassert.Equal(t, int64(1), maskedValueCount.Int())\n\tvalue, _ := attr.Get(\"name\")\n\tassert.Equal(t, \"placeholder ****\", value.Str())\n}", "title": "" }, { "docid": "f8fa1e31c9737099b62e2c4ad505cee5", "score": "0.4718006", "text": "func (m *GetSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetSyslog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.syslog\")\n\t}\n\n\tif err := m.GetDataDog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.data_dog\")\n\t}\n\n\tif err := m.GetSplunk().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.splunk\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "b06f014c6ece102145ff2e6642107ccc", "score": "0.47066805", "text": "func HideSensitive(ctx context.Context, arg interface{}) string {\n\ts := ctx.Value(ContextKey(\"secrets\"))\n\tcleanVars := fmt.Sprint(arg)\n\tif s != nil && &s != nil {\n\t\tswitch reflect.TypeOf(s).Kind() {\n\t\tcase reflect.Slice:\n\t\t\tsecrets := reflect.ValueOf(s)\n\t\t\tfor i := 0; i < secrets.Len(); i++ {\n\t\t\t\tsecret := fmt.Sprint(secrets.Index(i).Interface())\n\t\t\t\tcleanVars = strings.ReplaceAll(cleanVars, secret, \"__hidden__\")\n\t\t\t}\n\t\t}\n\t}\n\treturn cleanVars\n}", "title": "" }, { "docid": "477092a41f7424f0921bb34735727de7", "score": "0.46881163", "text": "func (s *Serv) SetStringResponse(ctx *fasthttp.RequestCtx, str string) {\n\t// ctx.Response.Header.Set(\"Access-Control-Allow-Credentials\", \"true\")\n\t// ctx.Response.Header.Set(\"Access-Control-Allow-Origin\", \"*\")\n\n\tctx.SetContentType(\"application/json;charset=UTF-8\")\n\tctx.SetStatusCode(fasthttp.StatusOK)\n\tctx.SetBody([]byte(str))\n\n\tdramautils.Debug(\"dramahttp.Serv.SetStringResponse\",\n\t\tzap.String(\"RequestURI\", string(ctx.RequestURI())),\n\t\tzap.String(\"body\", str))\n}", "title": "" }, { "docid": "186b5a67931d505dc1b6e75f93f6c7d7", "score": "0.46748143", "text": "func (m *AzureHubVnetType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetExpressRouteEnabled().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting AzureHubVnetType.express_route_enabled\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d3ba027faaeaf72fa3b3310dbaf57400", "score": "0.4673547", "text": "func (m *GetSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetTlsParameters().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.tls_parameters\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7c27103be5d0ca7e45fb1b417b818dee", "score": "0.46611774", "text": "func (rv ResponseValues) SilentMode(enable bool) {\n\tv := \"0\"\n\tif enable {\n\t\tv = \"1\"\n\t}\n\trv[\"SIL\"] = v\n}", "title": "" }, { "docid": "96769e03102495ee163fbca3de092508", "score": "0.4626746", "text": "func (o ListenerRuleMatchHttpMatchPathMatchOutput) CaseSensitive() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v ListenerRuleMatchHttpMatchPathMatch) *bool { return v.CaseSensitive }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "402ac59a19a170e591e71fd26d96abe7", "score": "0.460393", "text": "func (o GoogleCloudDialogflowCxV3IntentParameterResponseOutput) Redact() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GoogleCloudDialogflowCxV3IntentParameterResponse) bool { return v.Redact }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "e91fc6ea8e0b7a79486499f2aebe279e", "score": "0.46016163", "text": "func (b *RoundTripperBuilder) Redact(value string) *RoundTripperBuilder {\n\tif b.redact == nil {\n\t\tb.redact = make(map[string]bool)\n\t}\n\tb.redact[value] = true\n\treturn b\n}", "title": "" }, { "docid": "52fd08053c804c03523de0b430c26d1b", "score": "0.4601387", "text": "func (m *ExpressRouteOtherSubscriptionConnection) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetAuthorizedKey().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ExpressRouteOtherSubscriptionConnection.authorized_key\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cdc8f12d40d95bb02a210eae2dc1b6ef", "score": "0.45924994", "text": "func (m *TLSClientConfigType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetKeyUrl().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting TLSClientConfigType.key_url\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "157f10f9014b3af5a3e416b198f2b7b0", "score": "0.45919058", "text": "func TestRedactSummaryInfo(t *testing.T) {\n\tconfig := &Config{\n\t\tAllowedKeys: []string{\"id\", \"name\", \"group\"},\n\t\tBlockedValues: []string{\"4[0-9]{12}(?:[0-9]{3})?\"},\n\t\tIgnoredKeys: []string{\"safe_attribute\"},\n\t\tSummary: \"info\"}\n\tallowed := map[string]pcommon.Value{\n\t\t\"id\": pcommon.NewValueInt(5),\n\t}\n\tignored := map[string]pcommon.Value{\n\t\t\"safe_attribute\": pcommon.NewValueStr(\"harmless but suspicious 4111111111111141\"),\n\t}\n\tmasked := map[string]pcommon.Value{\n\t\t\"name\": pcommon.NewValueStr(\"placeholder 4111111111111111\"),\n\t}\n\tredacted := map[string]pcommon.Value{\n\t\t\"credit_card\": pcommon.NewValueStr(\"4111111111111111\"),\n\t}\n\n\toutTraces := runTest(t, allowed, redacted, masked, ignored, config)\n\n\tattr := outTraces.ResourceSpans().At(0).ScopeSpans().At(0).Spans().At(0).Attributes()\n\tdeleted := make([]string, 0, len(redacted))\n\tfor k := range redacted {\n\t\t_, ok := attr.Get(k)\n\t\tassert.False(t, ok)\n\t\tdeleted = append(deleted, k)\n\t}\n\t_, ok := attr.Get(redactedKeys)\n\tassert.False(t, ok)\n\tmaskedKeyCount, ok := attr.Get(redactedKeyCount)\n\tassert.True(t, ok)\n\tassert.Equal(t, int64(len(deleted)), maskedKeyCount.Int())\n\t_, ok = attr.Get(maskedValues)\n\tassert.False(t, ok)\n\n\tmaskedValueCount, ok := attr.Get(maskedValueCount)\n\tassert.True(t, ok)\n\tassert.Equal(t, int64(1), maskedValueCount.Int())\n\tvalue, _ := attr.Get(\"name\")\n\tassert.Equal(t, \"placeholder ****\", value.Str())\n\n\tignoredKeyCount, ok := attr.Get(ignoredKeyCount)\n\tassert.True(t, ok)\n\tassert.Equal(t, int64(1), ignoredKeyCount.Int())\n\tvalue, _ = attr.Get(\"safe_attribute\")\n\tassert.Equal(t, \"harmless but suspicious 4111111111111141\", value.Str())\n}", "title": "" }, { "docid": "df052c16fa6dbf84ea0a2981d6d4aa57", "score": "0.45755374", "text": "func (m *GetSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetIngressEgressGw().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.ingress_egress_gw\")\n\t}\n\n\tif err := m.GetVoltstackCluster().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.voltstack_cluster\")\n\t}\n\n\tif err := m.GetIngressEgressGwAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.ingress_egress_gw_ar\")\n\t}\n\n\tif err := m.GetVoltstackClusterAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.voltstack_cluster_ar\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "bf28c023c19326e95fd63436a3483279", "score": "0.4568821", "text": "func respondPlain(w http.ResponseWriter, r *http.Request, resp string) {\n\t_, err := fmt.Fprint(w, resp)\n\tif err != nil {\n\t\tlogrus.WithError(err).WithField(\"route\", mux.CurrentRoute(r).GetName()).Warn(\"Could not encode response\")\n\t\thttp.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)\n\n\t\treturn\n\t}\n}", "title": "" }, { "docid": "778d6e0f332743b2d82be78e4a4b4006", "score": "0.45600864", "text": "func (o GoogleCloudDialogflowCxV3FormParameterResponseOutput) Redact() pulumi.BoolOutput {\n\treturn o.ApplyT(func(v GoogleCloudDialogflowCxV3FormParameterResponse) bool { return v.Redact }).(pulumi.BoolOutput)\n}", "title": "" }, { "docid": "b7d0b6d1aaa99a37fb55928b6bad6686", "score": "0.45571876", "text": "func (rv ResponseValues) Deny() {\n\trv[\"DENY\"] = \"\"\n}", "title": "" }, { "docid": "993f8660d4b2edd3f36ca3f2914b9edb", "score": "0.4548289", "text": "func redactedURLString(u *url.URL) string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\tru := *u\n\tif _, has := ru.User.Password(); has {\n\t\tru.User = url.UserPassword(ru.User.Username(), \"xxxxx\")\n\t}\n\treturn ru.String()\n}", "title": "" }, { "docid": "4ae5fa31506fbc95ca00f3e7712c2b2a", "score": "0.45177424", "text": "func serveString(w http.ResponseWriter, r *http.Request) {\n\tlogRequest(r)\n\tfmt.Fprint(w, \"<html><pre style=\\\"white-space: pre-wrap;\\\">\"+h.String()+\"</pre></html>\")\n}", "title": "" }, { "docid": "7d45b65c7d2badb4ffb473fd8a0bf497", "score": "0.45114392", "text": "func (m *LocalAccessArgoCDType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetPassword().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting LocalAccessArgoCDType.password\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "260f13fc0a0cac79ce20088799332fc3", "score": "0.449092", "text": "func modifyResponse(r *http.Response) error {\n\tlocation := r.Header.Get(\"Location\")\n\tif strings.Contains(location, shittyURL) {\n\t\tlocation = strings.Replace(location, shittyURL, \"\", 1)\n\t\tr.Header.Set(\"Location\", location)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "01f20364eee1bb983272fe7c16c4d56b", "score": "0.44865468", "text": "func (m *CreateRequest) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetSpec().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateRequest.spec\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "a19e06528dfd546071b4897d83aee157", "score": "0.4484691", "text": "func (s *Server) redactFields(e *pqs.Event) {\r\n\tif tables, ok := s.redactions[e.GetSchema()]; ok {\r\n\t\tif fields, ok := tables[e.GetTable()]; ok {\r\n\t\t\tfor _, rf := range fields {\r\n\t\t\t\tif _, ok := e.Payload.Fields[rf]; ok {\r\n\t\t\t\t\t//remove field from payload\r\n\t\t\t\t\tdelete(e.Payload.Fields, rf)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3d50dec8ce6f06b6f7e963c4e0ebbc8e", "score": "0.44741416", "text": "func (m *CustomCreateSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tm.Password = \"\"\n\n\treturn nil\n}", "title": "" }, { "docid": "7527752da5de10f9a222e97fd02c7574", "score": "0.4443894", "text": "func (m *GlobalSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetSyslog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.syslog\")\n\t}\n\n\tif err := m.GetDataDog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.data_dog\")\n\t}\n\n\tif err := m.GetSplunk().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.splunk\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cbe8acf4f1928d2cf973b0b8879f315d", "score": "0.44433877", "text": "func (m *GlobalSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetTlsParameters().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.tls_parameters\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cf5124b6d7c3b680ef28c57e5dcf64bb", "score": "0.44406706", "text": "func crlfFilter(payload *test.Input) error {\n\tif _, okay := payload.Headers[\"Cookie\"]; okay {\n\t\treplacer := strings.NewReplacer(\n\t\t\t\"\\n\", \" \",\n\t\t\t\"\\r\", \" \",\n\t\t)\n\t\tpayload.Headers[\"Cookie\"] = replacer.Replace(payload.Headers[\"Cookie\"].(string))\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d8a4562e1d4d5651a91293d29329e2d5", "score": "0.44374982", "text": "func (in InterfaceMap) Redact() InterfaceMap {\n\tfor k, v := range in {\n\t\tif !IsStringRedacted(k) {\n\t\t\tin[TagUD(k)] = v\n\t\t\tdelete(in, k)\n\t\t}\n\t}\n\treturn in\n}", "title": "" }, { "docid": "09d46d8334606d2fa7586a7ba367981e", "score": "0.4430209", "text": "func (m *GetSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetClusterWideAppList().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GetSpecType.cluster_wide_app_list\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e7547b536b7005a8c36545efc9595a26", "score": "0.44182122", "text": "func (inq *Inquiry) Redact(data []byte) ([]byte, error) {\n\tvar structData interface{}\n\terr := json.Unmarshal(data, &structData)\n\tif err != nil {\n\t\treturn inq.redactValue(data), nil\n\t}\n\toriginal := reflect.ValueOf(structData)\n\tcopy := reflect.New(original.Type()).Elem()\n\tinq.redact(copy, original)\n\treturn json.Marshal(copy.Interface())\n}", "title": "" }, { "docid": "0cd4e1f84b9e0aec143e4c9bedac9ea3", "score": "0.44037962", "text": "func WithFieldRedactions(r FieldRedactions) ServerOption {\r\n\treturn func(s *Server) {\r\n\t\ts.redactions = r\r\n\t}\r\n}", "title": "" }, { "docid": "eed4c58a3e31c861cd9127a624c78d09", "score": "0.4382918", "text": "func (inq *Inquiry) redact(copy, original reflect.Value) {\n\tswitch original.Kind() {\n\tcase reflect.Ptr:\n\t\toriginalValue := original.Elem()\n\t\tif !originalValue.IsValid() {\n\t\t\treturn\n\t\t}\n\t\tcopy.Set(reflect.New(originalValue.Type()))\n\t\tinq.redact(copy.Elem(), originalValue)\n\n\tcase reflect.Interface:\n\t\toriginalValue := original.Elem()\n\t\tcopyValue := reflect.New(originalValue.Type()).Elem()\n\t\tinq.redact(copyValue, originalValue)\n\t\tcopy.Set(copyValue)\n\n\tcase reflect.Struct:\n\t\tfor i := 0; i < original.NumField(); i++ {\n\t\t\tinq.redact(copy.Field(i), original.Field(i))\n\t\t}\n\n\tcase reflect.Slice:\n\t\tcopy.Set(reflect.MakeSlice(original.Type(), original.Len(), original.Cap()))\n\t\tfor i := 0; i < original.Len(); i++ {\n\t\t\tinq.redact(copy.Index(i), original.Index(i))\n\t\t}\n\n\tcase reflect.Map:\n\t\tcopy.Set(reflect.MakeMap(original.Type()))\n\t\tfor _, key := range original.MapKeys() {\n\t\t\tif inq.isSecretField(key.Interface().(string)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\toriginalValue := original.MapIndex(key)\n\t\t\tcopyValue := reflect.New(originalValue.Type()).Elem()\n\t\t\tinq.redact(copyValue, originalValue)\n\t\t\tcopy.SetMapIndex(key, copyValue)\n\t\t}\n\n\tcase reflect.String:\n\t\tredacted := inq.redactValue([]byte(original.Interface().(string)))\n\t\tcopy.SetString(string(redacted))\n\n\tdefault:\n\t\tcopy.Set(original)\n\t}\n\n}", "title": "" }, { "docid": "c263d59f01ac892e6cc8d43573c28563", "score": "0.4358369", "text": "func (m *GlobalSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetIngressEgressGw().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.ingress_egress_gw\")\n\t}\n\n\tif err := m.GetVoltstackCluster().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.voltstack_cluster\")\n\t}\n\n\tif err := m.GetIngressEgressGwAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.ingress_egress_gw_ar\")\n\t}\n\n\tif err := m.GetVoltstackClusterAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.voltstack_cluster_ar\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e7b5bd41dfd88beb8da3484517396ed5", "score": "0.43582648", "text": "func (f *Filter) ModifyResponse(res *http.Response) error {\n\tctx := martian.Context(res.Request)\n\tactx := FromContext(ctx)\n\n\tif resmod, ok := f.resmods[actx.ID()]; ok {\n\t\treturn resmod.ModifyResponse(res)\n\t}\n\n\tif err := f.requireKnownAuth(actx.ID()); err != nil {\n\t\tactx.SetError(err)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "9bebc0130698b7a9bd8709e5ff64c2c7", "score": "0.4352355", "text": "func (o GrpcRouteMethodMatchOutput) CaseSensitive() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v GrpcRouteMethodMatch) *bool { return v.CaseSensitive }).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "ac0ffe0574d1ccd2ebbb48f4e06f74d3", "score": "0.43366486", "text": "func encodeUpdateDemoResponse(ctx context.Context, w http1.ResponseWriter, response interface{}) (err error) {\n\tif f, ok := response.(endpoint.Failure); ok && f.Failed() != nil {\n\t\tErrorEncoder(ctx, f.Failed(), w)\n\t\treturn nil\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\terr = json.NewEncoder(w).Encode(response)\n\treturn\n}", "title": "" }, { "docid": "f8505b7a3b5c4900c6d34c145ae92d58", "score": "0.43358263", "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": "12ebbb897ab5fa41f679e7cf14b1530a", "score": "0.43159607", "text": "func cleanPrint(r Response) {\n fmt.Printf(\"\\n %s, %s, %s\\n\", r.Name, r.DataType, r.Declaration)\n fmt.Printf(\"\\n %s\\n\", r.Description)\n fmt.Printf(\"\\n %s\\n\", r.ExampleUsage)\n fmt.Printf(\"\\n\")\n}", "title": "" }, { "docid": "c07e7d9d7865afaece5336a3034b939f", "score": "0.4314857", "text": "func (m *ClusterWideAppType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetArgoCd().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ClusterWideAppType.argo_cd\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cd138c5554a17c7005781d88f331478d", "score": "0.43080395", "text": "func (m *CreateSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetSyslog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.syslog\")\n\t}\n\n\tif err := m.GetDataDog().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.data_dog\")\n\t}\n\n\tif err := m.GetSplunk().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.splunk\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "3de89bbec052df00b0ba12541ce5e3fd", "score": "0.42994618", "text": "func (r *SearchInContentRequest) CaseSensitive(v bool) *SearchInContentRequest {\n\tr.opts[\"caseSensitive\"] = v\n\treturn r\n}", "title": "" }, { "docid": "b105d291b3325e57e0c9f6548f48dd4c", "score": "0.42914376", "text": "func sanitizeRequest(r *model.Request, matchers wildcard.Matchers) {\n\tfor _, c := range r.Cookies {\n\t\tif !matchers.MatchAny(c.Name) {\n\t\t\tcontinue\n\t\t}\n\t\tc.Value = redacted\n\t}\n\tsanitizeHeaders(r.Headers, matchers)\n\tif r.Body != nil && r.Body.Form != nil {\n\t\tfor key := range r.Body.Form {\n\t\t\tif !matchers.MatchAny(key) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tr.Body.Form[key] = redactedValues\n\t\t}\n\t}\n}", "title": "" }, { "docid": "75015a83b9141cbe605034bea7965ac9", "score": "0.42893708", "text": "func (m *ApplicationArgoCDType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetLocalDomain().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ApplicationArgoCDType.local_domain\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "7d8087e24bc961d889a66cf3a846545f", "score": "0.42829758", "text": "func RedactClientID(clientID string) string {\n\treturn redact(clientID, \"$1##### REDACTED #####$3\")\n}", "title": "" }, { "docid": "222da1adf0e402c50be9e5e524c03105", "score": "0.42803767", "text": "func (m *TLSConfigType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetMtlsEnable().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting TLSConfigType.mtls_enable\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "13fa68d0a58abc942e79b6ad0c243e8b", "score": "0.42746842", "text": "func AccessLogField_ContextResponseOverrideStatus() *string {\n\t_init_.Initialize()\n\n\tvar returns *string\n\n\t_jsii_.StaticInvoke(\n\t\t\"monocdk.aws_apigateway.AccessLogField\",\n\t\t\"contextResponseOverrideStatus\",\n\t\tnil, // no parameters\n\t\t&returns,\n\t)\n\n\treturn returns\n}", "title": "" }, { "docid": "99df14d82605d537429f10265e9822db", "score": "0.42718795", "text": "func RenderSanitized(rawBytes []byte) ([]byte, error) {\n\tresult, err := Render(rawBytes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn sanitizer.SanitizeBytes(result), nil\n}", "title": "" }, { "docid": "aa22bf807ac3660ef0122646d61002c6", "score": "0.42381454", "text": "func (s *scrubber) scrubStr(data string) string {\n\tfor _, repl := range s.replacers {\n\t\tdata = repl.Regex.ReplaceAllString(data, repl.Repl)\n\t}\n\treturn data\n}", "title": "" }, { "docid": "b329ed35d199c226249d44fada61f1aa", "score": "0.4230798", "text": "func (sess *SessT) EffectiveStr(key string, defaultVal ...string) string {\n\n\t// Request\n\tp, ok := sess.ReqParam(key, defaultVal...)\n\tif ok {\n\t\treturn p\n\t}\n\n\t// Session\n\t// Session was set, but with empty string?\n\texists := sess.SessionManager.Exists(sess.ctx, key)\n\tif exists {\n\t\tp = sess.SessionManager.GetString(sess.ctx, key)\n\t\treturn p\n\t}\n\n\t// default\n\tdef := \"\"\n\tif len(defaultVal) > 0 {\n\t\tdef = defaultVal[0]\n\t}\n\treturn def\n}", "title": "" }, { "docid": "07a8b69a9efbe44a403f01ab1eaf1d04", "score": "0.42262116", "text": "func (ld *Ldap) good(req *http.Request) {\n\t// ...\n\tuntrusted := req.UserAgent()\n\tescapegoldap := goldap.EscapeFilter(untrusted)\n\tgoldap.NewSearchRequest(\n\t\tescapegoldap, // GOOD: sanitized dn\n\t\tgoldap.ScopeWholeSubtree, goldap.NeverDerefAliases, 0, 0, false,\n\t\t\"(&(objectClass=organizationalPerson))\"+escapegoldap, // GOOD: sanitized filter\n\t\t[]string{\"dn\", \"cn\", escapegoldap}, // GOOD: sanitized attribute\n\t\tnil,\n\t)\n\tescapegoldapv3 := goldapv3.EscapeFilter(untrusted)\n\tgoldapv3.NewSearchRequest(\n\t\tescapegoldapv3, // GOOD: sanitized dn\n\t\tgoldap.ScopeWholeSubtree, goldap.NeverDerefAliases, 0, 0, false,\n\t\t\"(&(objectClass=organizationalPerson))\"+escapegoldapv3, // GOOD: sanitized filter\n\t\t[]string{\"dn\", \"cn\", escapegoldapv3}, // GOOD: sanitized attribute\n\t\tnil,\n\t)\n\tescapegopkgv2 := gopkgldapv2.EscapeFilter(untrusted)\n\tgopkgldapv2.NewSearchRequest(\n\t\tescapegopkgv2, // GOOD: sanitized dn\n\t\tgoldap.ScopeWholeSubtree, goldap.NeverDerefAliases, 0, 0, false,\n\t\t\"(&(objectClass=organizationalPerson))\"+escapegopkgv2, // GOOD: sanitized filter\n\t\t[]string{\"dn\", \"cn\", escapegopkgv2}, // GOOD: sanitized attribute\n\t\tnil,\n\t)\n\tescapedusercustom, _ := ld.sanitizedUserQuery(untrusted) // GOOD: custom sanitized filter\n\tescapedgroupcustom, _ := ld.sanitizedGroupFilter(untrusted) // GOOD: custom sanitized filter\n\tescapeduserdncustom, _ := ld.sanitizedUserDN(untrusted) // GOOD: custom sanitized filter\n\tescapedgroupdncustom, _ := ld.sanitizedGroupDN(untrusted) // GOOD: custom sanitized filter\n\tclient := &ldapclient.LDAPClient{}\n\tclient.Authenticate(escapedusercustom, \"123456\") // GOOD: sanitized filter\n\tclient.GetGroupsOfUser(escapedgroupcustom) // GOOD: sanitized filter\n\tgopkgldapv2.NewSearchRequest(\n\t\tescapeduserdncustom, // GOOD: sanitized dn\n\t\tgoldap.ScopeWholeSubtree, goldap.NeverDerefAliases, 0, 0, false,\n\t\t\"(&(objectClass=organizationalPerson))\"+\"(uid=1)\",\n\t\t[]string{\"dn\", \"cn\"},\n\t\tnil,\n\t)\n\tgopkgldapv2.NewSearchRequest(\n\t\tescapedgroupdncustom, // GOOD: sanitized dn\n\t\tgoldap.ScopeWholeSubtree, goldap.NeverDerefAliases, 0, 0, false,\n\t\t\"(&(objectClass=organizationalPerson))\"+\"(uid=1)\",\n\t\t[]string{\"dn\", \"cn\"},\n\t\tnil,\n\t)\n\t// ...\n}", "title": "" }, { "docid": "f7d46643b7a6c74d5a17f76700a72b43", "score": "0.42243728", "text": "func (_ EntityAliases) Redact(p graphql.ResolveParams) ([]string, error) {\n\tval, err := graphql.DefaultResolver(p.Source, p.Info.FieldName)\n\tret, ok := val.([]string)\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\tif !ok {\n\t\treturn ret, errors.New(\"unable to coerce value for field 'redact'\")\n\t}\n\treturn ret, err\n}", "title": "" }, { "docid": "9864ba2b88cedf935ce4263f9d500482", "score": "0.42220113", "text": "func (m *GlobalSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetClusterWideAppList().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting GlobalSpecType.cluster_wide_app_list\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c2dbf2e2104d35900330630a3b3f90f6", "score": "0.42123702", "text": "func dogFunc(res http.ResponseWriter, req *http.Request) {\n io.WriteString(res, \"dog dog doggy\")\n}", "title": "" }, { "docid": "fa6a94f2131257e3e7e9771f5533247e", "score": "0.4208731", "text": "func HchangePassword(httpwriter http.ResponseWriter, req *http.Request) {\n\n\tdefer req.Body.Close()\n\tbodybyte, _ := ioutil.ReadAll(req.Body)\n\n\ttype dcResetPassword struct {\n\t\tEmail string // User ID/ Email\n\t\tResetCode string // Code sent via email\n\t\tNewPassword string // New Password\n\t\tRetypePassword string // New Password\n\t}\n\n\tvar objtoaction dcResetPassword\n\terr = json.Unmarshal(bodybyte, &objtoaction)\n\n\tcredentials := security.Credentials{}\n\tcredentials.UserID = strings.ToUpper(objtoaction.Email)\n\tcredentials.ResetCode = objtoaction.ResetCode\n\tcredentials.Password = security.Hashstring(objtoaction.NewPassword)\n\tcredentials.PasswordValidate = security.Hashstring(objtoaction.RetypePassword)\n\n\t// Check if code is still valid\n\t//\n\tkeyuser := \"ResetPassword\" + credentials.UserID\n\n\tcodeinredis, _ := redisclient.Get(keyuser).Result()\n\n\tfinalres := \"Password has been updated.\"\n\tif codeinredis != credentials.ResetCode {\n\t\tlog.Println(\"Code has expired.\")\n\t\tfinalres = \"Code has expired.\"\n\t\tjson.NewEncoder(httpwriter).Encode(&finalres)\n\t\treturn\n\t}\n\n\t// Update Password\n\n\tusercredentials, resfind := security.Find(credentials.UserID)\n\tif resfind == \"200 OK\" {\n\t\t// User exists\n\t\t// Update password\n\n\t\tusercredentials.Password = security.Hashstring(objtoaction.NewPassword)\n\t\tusercredentials.PasswordValidate = security.Hashstring(objtoaction.RetypePassword)\n\n\t\tresultado := security.Userupdate(usercredentials)\n\t\tif resultado.IsSuccessful == \"Y\" {\n\t\t\tlog.Println(\"All good, in theory.\")\n\t\t\tfinalres = \"Password has been updated.\"\n\t\t} else {\n\t\t\tlog.Println(\"not good\")\n\t\t\tfinalres = \"not good\"\n\t\t}\n\n\t}\n\n\tjson.NewEncoder(httpwriter).Encode(&finalres)\n\treturn\n\n}", "title": "" }, { "docid": "608f9f69c0676d05c566d8707bf124e3", "score": "0.42075676", "text": "func dnsRecordSetRrefsDiffSuppress(_, old, new string, _ *schema.ResourceData) bool {\n\treturn strings.ToLower(strings.Trim(old, `\"`)) == strings.ToLower(strings.Trim(new, `\"`))\n}", "title": "" }, { "docid": "188e2a18fbc98e2d66aaefb87ad88d66", "score": "0.41977823", "text": "func (o *Auditqueryexecutionresultsresponse) String() string {\n \n \n \n o.Entities = []Auditlogmessage{{}} \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": "6c9020a5c8f4ba08d152eacd304a0386", "score": "0.4197115", "text": "func resourceVolterraMaliciousUserMitigationUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_malicious_user_mitigation.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_malicious_user_mitigation.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"mitigation_type\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\tmitigationType := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationType{}\n\t\tupdateSpec.MitigationType = mitigationType\n\t\tfor _, set := range sl {\n\t\t\tmitigationTypeMapStrToI := set.(map[string]interface{})\n\n\t\t\tif v, ok := mitigationTypeMapStrToI[\"rules\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trules := make([]*ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationRule, len(sl))\n\t\t\t\tmitigationType.Rules = rules\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\trules[i] = &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationRule{}\n\t\t\t\t\trulesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"mitigation_action\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tmitigationAction := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationAction{}\n\t\t\t\t\t\trules[i].MitigationAction = mitigationAction\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tmitigationActionMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tmitigationActionTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := mitigationActionMapStrToI[\"alert_only\"]; ok && !isIntfNil(v) && !mitigationActionTypeFound {\n\n\t\t\t\t\t\t\t\tmitigationActionTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tmitigationActionInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationAction_AlertOnly{}\n\t\t\t\t\t\t\t\t\tmitigationActionInt.AlertOnly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tmitigationAction.MitigationAction = mitigationActionInt\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\tif v, ok := mitigationActionMapStrToI[\"block_temporarily\"]; ok && !isIntfNil(v) && !mitigationActionTypeFound {\n\n\t\t\t\t\t\t\t\tmitigationActionTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tmitigationActionInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationAction_BlockTemporarily{}\n\t\t\t\t\t\t\t\t\tmitigationActionInt.BlockTemporarily = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tmitigationAction.MitigationAction = mitigationActionInt\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\tif v, ok := mitigationActionMapStrToI[\"captcha_challenge\"]; ok && !isIntfNil(v) && !mitigationActionTypeFound {\n\n\t\t\t\t\t\t\t\tmitigationActionTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tmitigationActionInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationAction_CaptchaChallenge{}\n\t\t\t\t\t\t\t\t\tmitigationActionInt.CaptchaChallenge = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tmitigationAction.MitigationAction = mitigationActionInt\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\tif v, ok := mitigationActionMapStrToI[\"javascript_challenge\"]; ok && !isIntfNil(v) && !mitigationActionTypeFound {\n\n\t\t\t\t\t\t\t\tmitigationActionTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tmitigationActionInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationAction_JavascriptChallenge{}\n\t\t\t\t\t\t\t\t\tmitigationActionInt.JavascriptChallenge = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tmitigationAction.MitigationAction = mitigationActionInt\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\tif v, ok := mitigationActionMapStrToI[\"none\"]; ok && !isIntfNil(v) && !mitigationActionTypeFound {\n\n\t\t\t\t\t\t\t\tmitigationActionTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tmitigationActionInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserMitigationAction_None{}\n\t\t\t\t\t\t\t\t\tmitigationActionInt.None = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tmitigationAction.MitigationAction = mitigationActionInt\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}\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"threat_level\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tthreatLevel := &ves_io_schema_malicious_user_mitigation.MaliciousUserThreatLevel{}\n\t\t\t\t\t\trules[i].ThreatLevel = threatLevel\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tthreatLevelMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tthreatLevelTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := threatLevelMapStrToI[\"high\"]; ok && !isIntfNil(v) && !threatLevelTypeFound {\n\n\t\t\t\t\t\t\t\tthreatLevelTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tthreatLevelInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserThreatLevel_High{}\n\t\t\t\t\t\t\t\t\tthreatLevelInt.High = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tthreatLevel.ThreatLevel = threatLevelInt\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\tif v, ok := threatLevelMapStrToI[\"low\"]; ok && !isIntfNil(v) && !threatLevelTypeFound {\n\n\t\t\t\t\t\t\t\tthreatLevelTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tthreatLevelInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserThreatLevel_Low{}\n\t\t\t\t\t\t\t\t\tthreatLevelInt.Low = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tthreatLevel.ThreatLevel = threatLevelInt\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\tif v, ok := threatLevelMapStrToI[\"medium\"]; ok && !isIntfNil(v) && !threatLevelTypeFound {\n\n\t\t\t\t\t\t\t\tthreatLevelTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tthreatLevelInt := &ves_io_schema_malicious_user_mitigation.MaliciousUserThreatLevel_Medium{}\n\t\t\t\t\t\t\t\t\tthreatLevelInt.Medium = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tthreatLevel.ThreatLevel = threatLevelInt\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}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra MaliciousUserMitigation obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_malicious_user_mitigation.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating MaliciousUserMitigation: %s\", err)\n\t}\n\n\treturn resourceVolterraMaliciousUserMitigationRead(d, meta)\n}", "title": "" }, { "docid": "14c572fd62836d1bbb8d559ab2f457b8", "score": "0.41929898", "text": "func (d *RoundTripper) dumpForm(what string, data []byte) {\n\t// Parse the form:\n\tform, err := url.ParseQuery(string(data))\n\tif err != nil {\n\t\td.dumpBytes(what, data)\n\t\treturn\n\t}\n\n\t// Redact values corresponding to security sensitive fields:\n\tfor name, values := range form {\n\t\tif d.redact[name] {\n\t\t\tfor i := range values {\n\t\t\t\tvalues[i] = redactedReplacement\n\t\t\t}\n\t\t}\n\t}\n\n\t// Get and sort the names of the fields of the form, so that the generated output will be\n\t// predictable:\n\tnames := make([]string, 0, len(form))\n\tfor name := range form {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\n\t// Write the names and values to the buffer while redacting the sensitive fields:\n\tbuffer := &bytes.Buffer{}\n\tfor _, name := range names {\n\t\tkey := url.QueryEscape(name)\n\t\tvalues := form[name]\n\t\tfor _, value := range values {\n\t\t\tvar redacted string\n\t\t\tif d.redact[name] {\n\t\t\t\tredacted = redactedReplacement\n\t\t\t\td.logger.Debugf(\"%s field '%s' is redacted\", what, name)\n\t\t\t} else {\n\t\t\t\tredacted = url.QueryEscape(value)\n\t\t\t\td.logger.Debugf(\"%s field '%s' is '%s'\", what, name, value)\n\t\t\t}\n\t\t\tif buffer.Len() > 0 {\n\t\t\t\tbuffer.WriteByte('&') // #nosec G104\n\t\t\t}\n\t\t\tbuffer.WriteString(key) // #nosec G104\n\t\t\tbuffer.WriteByte('=') // #nosec G104\n\t\t\tbuffer.WriteString(redacted) // #nosec G104\n\t\t}\n\t}\n\n\t// Send the redactedReplacement data to the log:\n\td.dumpBytes(what, buffer.Bytes())\n}", "title": "" }, { "docid": "79ee469a1ff9fb502d23e51a0ad81d99", "score": "0.41713777", "text": "func (m *ExpressRouteConnectionType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetOtherSubscription().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting ExpressRouteConnectionType.other_subscription\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "6e89d2dfb32efabe67438eaebf68795e", "score": "0.41597918", "text": "func (m *CreateSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetIngressEgressGw().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.ingress_egress_gw\")\n\t}\n\n\tif err := m.GetVoltstackCluster().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.voltstack_cluster\")\n\t}\n\n\tif err := m.GetIngressEgressGwAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.ingress_egress_gw_ar\")\n\t}\n\n\tif err := m.GetVoltstackClusterAr().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.voltstack_cluster_ar\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "c195e83748ba574024adb245cfcaa541", "score": "0.41558987", "text": "func ProtectedHandler(w http.ResponseWriter, r *http.Request) {\n\n\tresponse := Response{\"Gained access to protected resource\"}\n\tJSONResponse(response, w)\n}", "title": "" }, { "docid": "69202e104e1923b45431478081383d4e", "score": "0.41516924", "text": "func JSONResponseFixer(content []byte) []byte {\n\tc := string(content)\n\tre := regexp.MustCompile(`(,\"request uri\":)\"(.*?)\"(,\"content length\":)`)\n\tmatches := re.FindAllStringSubmatch(c, -1)\n\n\tfor _, match := range matches {\n\t\trequestURI, _ := json.Marshal(match[2])\n\n\t\tsold := match[0]\n\t\tsnew := match[1] + string(requestURI) + match[3]\n\n\t\tc = strings.ReplaceAll(c, sold, snew)\n\t}\n\n\treturn []byte(c)\n}", "title": "" }, { "docid": "b78cbce13188ce15178e8297ecf0e3f8", "score": "0.41478574", "text": "func (c *Result) OutputSanitized() string {\n\treturn strings.TrimSpace(stripansi.Strip(c.output))\n}", "title": "" }, { "docid": "4fcad1a3e63963ce4c454a17806f1b17", "score": "0.4147754", "text": "func (s *Sensu) ClearSilenced(payload interface{}) (map[string]interface{}, error) {\n\tpayloadstr, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Silence parsing error: %q returned: %v\", err, err)\n\t}\n\treturn s.postPayload(fmt.Sprintf(\"silenced/clear\"), string(payloadstr[:]))\n}", "title": "" }, { "docid": "b40cebb726bb8a0792368a76fbded0b5", "score": "0.41400674", "text": "func DenyInvalid(field *field.Path, msg string) admission.Response {\n\t// We need to set the custom message in both Details and Message fields.\n\t//\n\t// When manipulating the HNC configuration object via kubectl directly, kubectl\n\t// ignores the Message field and displays the Details field if an error is\n\t// StatusReasonInvalid (see implementation here: https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/util/helpers.go#L145-L160).\n\t//\n\t// When manipulating the HNC configuration object via the hns kubectl plugin,\n\t// if an error is StatusReasonInvalid, only the Message field will be displayed. This is because\n\t// the Error method (https://github.com/kubernetes/client-go/blob/cb664d40f84c27bee45c193e4acb0fcd549b0305/rest/request.go#L1273)\n\t// calls FromObject (https://github.com/kubernetes/apimachinery/blob/7e441e0f246a2db6cf1855e4110892d1623a80cf/pkg/api/errors/errors.go#L100),\n\t// which generates a StatusError (https://github.com/kubernetes/apimachinery/blob/7e441e0f246a2db6cf1855e4110892d1623a80cf/pkg/api/errors/errors.go#L35) object.\n\t// *StatusError implements the Error interface using only the Message\n\t// field (https://github.com/kubernetes/apimachinery/blob/7e441e0f246a2db6cf1855e4110892d1623a80cf/pkg/api/errors/errors.go#L49)).\n\t// Therefore, when displaying the error, only the Message field will be available.\n\tresp := Deny(metav1.StatusReasonInvalid, msg)\n\tresp.Result.Details = &metav1.StatusDetails{\n\t\tCauses: []metav1.StatusCause{{\n\t\t\tMessage: msg,\n\t\t\tField: field.String(),\n\t\t}},\n\t}\n\n\treturn resp\n}", "title": "" }, { "docid": "87935805b7119999b729321efb4aa03d", "score": "0.41370368", "text": "func (m *AzureVnetIngressEgressGwARReplaceType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetGlobalNetworkList().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting AzureVnetIngressEgressGwARReplaceType.global_network_list\")\n\t}\n\n\tif err := m.GetHub().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting AzureVnetIngressEgressGwARReplaceType.hub\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "547aeb1084a578b2689de7651775c589", "score": "0.41346228", "text": "func FilterHtmlAttribute(s string) string {\n if FilterHtmlAttributeInstance.ValueFilter().MatchString(s) {\n return s\n }\n return INNOCUOUS_OUTPUT\n}", "title": "" }, { "docid": "95b67e0d7411a1db72407a4986d8d114", "score": "0.4129673", "text": "func (fp *WatchRecoveryStoreShardingInfosResponse_FieldTerminalPath) JSONString() string {\n\treturn strcase.ToLowerCamel(fp.String())\n}", "title": "" }, { "docid": "25dc2426b5176952cc7ff2690efd298f", "score": "0.4129231", "text": "func (m *CreateSpecType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetTlsParameters().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting CreateSpecType.tls_parameters\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "e27c334b657f70d27ed077d841883e34", "score": "0.41291955", "text": "func (f *Filter) ModifyResponse(ctx *martian.Context, res *http.Response) error {\n\tif f.matches(res.Request) && f.resmod != nil {\n\t\treturn f.resmod.ModifyResponse(ctx, res)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d45bb4576ac810f1dd0138b9107637ca", "score": "0.41219658", "text": "func (fp *ListRecoveryStoreShardingInfosResponse_FieldTerminalPath) JSONString() string {\n\treturn strcase.ToLowerCamel(fp.String())\n}", "title": "" }, { "docid": "c7772bbf49b74ccb3609d3bf1d86ea95", "score": "0.41141066", "text": "func (m *AzureVnetIngressEgressGwReplaceType) Redact(ctx context.Context) error {\n\t// clear fields with confidential option set (at message or field level)\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\tif err := m.GetGlobalNetworkList().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting AzureVnetIngressEgressGwReplaceType.global_network_list\")\n\t}\n\n\tif err := m.GetHub().Redact(ctx); err != nil {\n\t\treturn errors.Wrapf(err, \"Redacting AzureVnetIngressEgressGwReplaceType.hub\")\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "f55a9210000ce35334d8d571dac1d3d4", "score": "0.41080284", "text": "func RedString(s string) string {\n\treturn colorRed + s + colorNone\n}", "title": "" }, { "docid": "06c329bd69470b50b074eaaf9e49edfe", "score": "0.41068932", "text": "func IsRedacted(name string) bool {\n\tif name == APIToken || name == Email || name == User || name == SSHKey || name == BackendUser || name == BackendPassword || name == Password || name == UserID {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "f32dd163d8e3f8b57efa134f10bf1902", "score": "0.41054517", "text": "func (hd *HD) SanitizedString() string {\n\treturn SanitizeString(hd.String())\n}", "title": "" } ]
b21c4cb12bee8c645f5dda1954c44207
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
[ { "docid": "35c1209474ca17713647476ce4cdfad6", "score": "0.0", "text": "func (in *ResourcePolicyList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
[ { "docid": "66c858c5a04c2e7cdc141127bd4c825d", "score": "0.7160505", "text": "func (in *ServingRuntime) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "59fdd3dce4255f57ec3ca6d3e315914c", "score": "0.7108815", "text": "func (in *Keevakind) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8bea899071433eee30c261819694a176", "score": "0.71011364", "text": "func (in *Console) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "85e4e872acf2e92b11c9f68a94872b42", "score": "0.70879734", "text": "func (in *RhodsQuickStart) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d2f7a961faaeef6a9de57222e011aa9d", "score": "0.7070891", "text": "func (in *ClusterServingRuntime) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "28991285572b29ec8043d71294be45ee", "score": "0.7066576", "text": "func (in *Main) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "91461b983030f0600f48767a420dbd3a", "score": "0.70637286", "text": "func (in *ChaosEngine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8494701d2b3ddcb31d6826c7675c4c16", "score": "0.7020881", "text": "func (in *KnativeServing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "92334c3f674342ee45d4712097fcf341", "score": "0.7004201", "text": "func (in *KnativeEventing) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "46b35489480414630c524158deaade1e", "score": "0.7002782", "text": "func (in *Guestbook1) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "a1d4c6527b916e54ba0777a054d7629a", "score": "0.6971575", "text": "func (in *Extension) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b13b2703e1976f046ef0241cba49e4ae", "score": "0.69668126", "text": "func (in *FluentBit) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f0c55dfab4bb060a6057768fbf012e1b", "score": "0.6965262", "text": "func (in *Standalone) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e144da484c55af3b4cfe5ff4ceaa6a22", "score": "0.6957034", "text": "func (in *Bind) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "550df47f57cdc21858b01025458e4bff", "score": "0.6929499", "text": "func (in *Factory) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "01ef96db7917035031e8bed9f7b74205", "score": "0.6899822", "text": "func (in *GitWebHookExecution) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "600aee3f4563fb84d75e16c7e775a7e2", "score": "0.6899141", "text": "func (in *PortworxDiag) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6cb74617a09be9f3338a3bdb9d3cdb83", "score": "0.6890036", "text": "func (in *InferenceGraph) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3d42ab18ae40e54c7422a11811ff2f36", "score": "0.6878831", "text": "func (in *ServingRuntimeList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "cbc31a686da825609fd27147c13f829e", "score": "0.68773943", "text": "func (in *RedisEnterprise) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0249183ef78021948d332a0d989d980e", "score": "0.68663865", "text": "func (in *InferenceGraphList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5735f86d576a39ee2ea96ed92fba38e1", "score": "0.68580633", "text": "func (in *ConsoleList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c24abbbefc380719850233987e33d48b", "score": "0.6849067", "text": "func (in *KeevakindList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ea82358155777abdf38773019a61e781", "score": "0.68447083", "text": "func (in *ExtensionService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ea82358155777abdf38773019a61e781", "score": "0.68447083", "text": "func (in *ExtensionService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "47873f0593624111dc977964e679e6b1", "score": "0.6839067", "text": "func (in *Build) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c72afeca328c02929e4d8bb188968fa", "score": "0.682988", "text": "func (in *ClusterServingRuntimeList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8f0071200be47b1f0f6fde00c08a250e", "score": "0.68262964", "text": "func (l *Probe) DeepCopyObject() runtime.Object {\n\treturn l.DeepCopy()\n}", "title": "" }, { "docid": "d2063f0cf80710e8ffaa7e724e00c0eb", "score": "0.68237567", "text": "func (in *ViewerList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4cdab0bba85848fc15be79234c35688a", "score": "0.68182397", "text": "func (in *ApigeeInstance) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0b4fafdee82c8479e1c138e12b86e9d0", "score": "0.68179506", "text": "func (in *Chaos) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8d5d152a593a99ea90af376730162fcf", "score": "0.68041486", "text": "func (in *BindList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c63dc406d086ea370f35c8fa2f7c0ee8", "score": "0.67997634", "text": "func (in *Vegeta) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c61d50424f2607139a96ccec62ab594e", "score": "0.67959714", "text": "func (in *GitWebHookReceiver) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67935103", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "08851f577beff8b9a55605234a10b571", "score": "0.67935103", "text": "func (in *Machine) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e8d3edbc4aafe3a0e94ec1c46a354361", "score": "0.6793294", "text": "func (in *ExtensionList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6c4f46eaaf04f1cda74c04527cdb85a6", "score": "0.67906356", "text": "func (in *Guestbook2) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f43dde222339bc0b3c8ec6d9b642cf43", "score": "0.67898595", "text": "func (in *EtcdPeer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b68f3ad14af0ee0f11a07fdf2f29db29", "score": "0.67888254", "text": "func (in *Klusterlet) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e1a132b4af7f55528161a0f94f124617", "score": "0.6786765", "text": "func (in *FluentBitList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "811dda0f712d36728336f022bc8897b4", "score": "0.67843574", "text": "func (in *Knitnet) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "880089d476c187e64a772669ef59fa8e", "score": "0.67771965", "text": "func (in *RocketMQ) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "07d9da029e9402a018d87711fc34b0af", "score": "0.67770416", "text": "func (in *ValidationRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "e5da032983accd49b14799931f45e84e", "score": "0.67756796", "text": "func (in *Viewer) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9972aac50af351456afa6324513785e8", "score": "0.67755926", "text": "func (in *Guestbook1List) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b0afdd2d9be69d6d612fd6a4c62b4229", "score": "0.677529", "text": "func (in *MyCRD) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "71be996d37cf4ff464659ad96488ac08", "score": "0.67731404", "text": "func (in *KnativeEventingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5884cf4be95f33abeb1548f45b0d68ae", "score": "0.6771563", "text": "func (in *VirtualService) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1f60de7c2237fcd3da66839454caca47", "score": "0.6770473", "text": "func (in *ServiceBridge) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "9ed0103cc745185178096a80d4451454", "score": "0.6770152", "text": "func (in *DockerImage) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0cf547b72e9447f118ba83789cd54d36", "score": "0.6768971", "text": "func (in *Cannalop) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b350a4dccaf174f4bb2430e67a01b82e", "score": "0.67673624", "text": "func (in *PortworxDiagList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c08b8dc3c5b8fadccf9f4f5c1484c666", "score": "0.6765033", "text": "func (in *DependencyProxy) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f695ffe3817626b2877bed58e35bef8", "score": "0.6764067", "text": "func (in *TrustedPipelineRun) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0cba259650095753d3251fce10a9bc04", "score": "0.67597693", "text": "func (in *Export) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b9bf2018dd1742acae181927d71d2bac", "score": "0.67546415", "text": "func (in *DialogflowAgent) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "c78f75caaa730c54594a38a4c529cf7f", "score": "0.6752558", "text": "func (in *Builder) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "05c4256b5dd70484f99b222d961b6e18", "score": "0.6751731", "text": "func (in *GlobalRoleBinding) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "5ddf5bb930952de1e4d7a9f725acee2a", "score": "0.6746392", "text": "func (in *ChaosEngineList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3f2dd49e3ed7a4fdfa66fe027d426b06", "score": "0.67445356", "text": "func (in *Guestbook) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1116939cd98b8af08f6a0101105a585e", "score": "0.674199", "text": "func (in *AtomixBenchmark) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.6741906", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.6741906", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.6741906", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6ffb7ee075d003d884c6708fc7694c95", "score": "0.6741906", "text": "func (in *User) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0fee46fa5ef16fc6e7e86181afbf893c", "score": "0.6739916", "text": "func (in *ReachabilityTest) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6b56f8b027a7da0e338ea1eb6a71992b", "score": "0.67383647", "text": "func (x *TestRun) DeepCopyObject() runtime.Object {\n\tif c := x.DeepCopy(); c != nil {\n\t\treturn c\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "6abdf10b546b7d1cdcc0f9042300e2ae", "score": "0.6730703", "text": "func (in *GitWebHookExecutionList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "8a272e0205c0a055fd18df513c0f8e5c", "score": "0.67303616", "text": "func (in *MonitoringConsole) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b7d61866a9f4e887e7bc8d427c980526", "score": "0.67302895", "text": "func (in *Wallclock) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7e28013d9cc47c56785eff8f0b240cdd", "score": "0.67279226", "text": "func (in *RedisCache) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6eee2597b2462e4f67c734ce910bbbea", "score": "0.6726292", "text": "func (in *KeyVaultKey) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f4460f5abc32dc3d41b20f9bcad8780f", "score": "0.6726067", "text": "func (in *Distcc) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "3453d4c20c15e5a98700d5691c54ba94", "score": "0.6723331", "text": "func (in *Registry) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1746193aac6a72f3726631358659446d", "score": "0.6719304", "text": "func (in *KnativeServingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d3c987be849ce76c59d274d86a26493c", "score": "0.6716281", "text": "func (in *AndroidDevice) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "1681968fd5361476e1683ea08510c6f4", "score": "0.6712834", "text": "func (in *GhostAppList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ca3be7174aebbc452f4763df794547b5", "score": "0.67113185", "text": "func (in *ChaosExperiment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "75341b0685a2616293dd072a9cbc95b4", "score": "0.67110324", "text": "func (in *Framework) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6672ed36d6c8d72a7bc795833abf8015", "score": "0.670848", "text": "func (in *GhostApp) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b367deffb70835c91f4cf890f7225f74", "score": "0.67046416", "text": "func (in *FlowTest) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f866f8856491c1d409aac815c4798b97", "score": "0.6703559", "text": "func (in *CassandraDataCenter) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "411147d71e616356763b422dfeb51884", "score": "0.67011166", "text": "func (in *Output) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "12f21084293a1c77f92a114ae6542986", "score": "0.670027", "text": "func (in *Sub) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ddba609633487e3d90719e1fe87e218d", "score": "0.6699182", "text": "func (in *ServiceExport) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "f2ef6ee7ef954954bfe18fb327bf9096", "score": "0.6695691", "text": "func (in *Miner) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "11c34634e0ea9e8950f42a04aed6ad50", "score": "0.6694407", "text": "func (in *Download) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "dab88b1abac0dfc9a48e58667fcdc8c7", "score": "0.6693374", "text": "func (in *Target) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "7bc35209300b66932c3fd54634ee9d30", "score": "0.66930246", "text": "func (in *Parser) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "04eb776f01123d8623c48b8d67c66b84", "score": "0.6691221", "text": "func (in *BuildList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4118bd8073119aa039006d23cc15293d", "score": "0.669101", "text": "func (in *Environment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "4118bd8073119aa039006d23cc15293d", "score": "0.669101", "text": "func (in *Environment) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "0f784600e4c632e01d5c57377189f247", "score": "0.6684655", "text": "func (in *LDAPConnector) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b6b4d924940ddb68cd4704b2afc8ff46", "score": "0.6683486", "text": "func (l *Alertmanager) DeepCopyObject() runtime.Object {\n\treturn l.DeepCopy()\n}", "title": "" }, { "docid": "b6b4d924940ddb68cd4704b2afc8ff46", "score": "0.6683486", "text": "func (l *Alertmanager) DeepCopyObject() runtime.Object {\n\treturn l.DeepCopy()\n}", "title": "" }, { "docid": "1f53d5cb381d2d1791f4ccc2a211c5f6", "score": "0.6683101", "text": "func (in *Redis) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t} else {\n\t\treturn nil\n\t}\n}", "title": "" }, { "docid": "7674ad4472578d751c4a03ac97b8bd00", "score": "0.6675649", "text": "func (in *GlobalRoleBindingList) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "17ac5eec779578c81c180c8703a5bdc4", "score": "0.66746193", "text": "func (in *Bale) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "aaf0582ce0373c3746f5d6c99601edde", "score": "0.66717696", "text": "func (in *Domain) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "d44ce7aca6a62f80d4610b76348b7925", "score": "0.6668685", "text": "func (in *PeanutPipelineExecution) DeepCopyObject() runtime.Object {\n\tif c := in.DeepCopy(); c != nil {\n\t\treturn c\n\t}\n\treturn nil\n}", "title": "" } ]
2fdab7536a69fad6ff01e08337910547
nonLocalOverride returns wether a change should be applied to the member. This function assumes that the address of the member and the change are equal.
[ { "docid": "ad8db39375ea1d8b00031af43b48cb04", "score": "0.83206713", "text": "func (m *Member) nonLocalOverride(change Change) bool {\n\t// change is younger than current member\n\tif change.Incarnation > m.Incarnation {\n\t\treturn true\n\t}\n\n\t// change is older than current member\n\tif change.Incarnation < m.Incarnation {\n\t\treturn false\n\t}\n\n\t// If the incarnation numbers are equal, we look at the state to\n\t// determine wether the change overrides this member.\n\treturn statePrecedence(change.Status) > statePrecedence(m.Status)\n}", "title": "" } ]
[ { "docid": "8f134f3f3d6d624e06d365f27abf13e8", "score": "0.76490754", "text": "func (m *Member) localOverride(local string, change Change) bool {\n\tif m.Address != local {\n\t\treturn false\n\t}\n\n\t// if the incarnation number of the change is smaller than the current\n\t// incarnation number it is not overriding the change\n\tif change.Incarnation < m.Incarnation {\n\t\treturn false\n\t}\n\n\treturn change.Status == Faulty || change.Status == Suspect || change.Status == Tombstone\n}", "title": "" }, { "docid": "b4dc37c60c9cfb9c091211191c118158", "score": "0.54087526", "text": "func (c *Change) None() bool {\n\treturn c.Before == c.After\n}", "title": "" }, { "docid": "0bafda792568b8238fdad2b3982c7ce3", "score": "0.53823286", "text": "func assertOverride(a px.AnnotatedMember, parentMembers hash.StringHash) {\n\tif parentMember, ok := parentMembers.Get(a.Name()); ok {\n\t\tassertCanBeOverridden(parentMember.(px.AnnotatedMember), a)\n\t} else {\n\t\tif a.Override() {\n\t\t\tpanic(px.Error(px.OverriddenNotFound, issue.H{`label`: a.Label(), `feature_type`: a.FeatureType()}))\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4c7ffda450edbc596acb340a1a2892cd", "score": "0.5327158", "text": "func (in *StackObject) ShouldOverride() bool { return true }", "title": "" }, { "docid": "b884662dc1cb7cf805c62443921c9105", "score": "0.5279589", "text": "func IsNonUpdatableField(f string) bool {\n\treturn defaultNonUpdatableColumns[f]\n}", "title": "" }, { "docid": "36f9f5ce00e5ddca554ba7b05d052539", "score": "0.52792525", "text": "func (memb *Member) IsLocal() bool {\n\treturn memb.local\n}", "title": "" }, { "docid": "edb42af18ff0e9b179ca488efbbff983", "score": "0.526647", "text": "func IsChangeSafe(prev, next *netv1.NetworkConfigSpec) error {\n\tif prev == nil {\n\t\treturn nil\n\t}\n\n\t// Easy way out: nothing changed.\n\tif reflect.DeepEqual(prev, next) {\n\t\treturn nil\n\t}\n\n\terrs := []error{}\n\n\t// TODO: implement cluster network / service network expansion\n\t// We don't support cluster network changes\n\tif !reflect.DeepEqual(prev.ClusterNetworks, next.ClusterNetworks) {\n\t\terrs = append(errs, errors.Errorf(\"cannot change ClusterNetworks\"))\n\t}\n\n\t// Nor can you change service network\n\tif prev.ServiceNetwork != next.ServiceNetwork {\n\t\terrs = append(errs, errors.Errorf(\"cannot change ServiceNetwork\"))\n\t}\n\n\t// Check the default network\n\terrs = append(errs, IsDefaultNetworkChangeSafe(prev, next)...)\n\n\t// Changing KubeProxyConfig and DeployKubeProxy is allowed, so we don't check that\n\n\tif len(errs) > 0 {\n\t\treturn errors.Errorf(\"invalid configuration: %v\", errs)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "732534dc7737ae74821dd4eef2c332c8", "score": "0.51914334", "text": "func overrideIsFixUp(config boardgame.PropertyCollection, defaultIsFixUp bool) bool {\n\toverrideIsFixUp, hasOverrideIsFixUp := config[configPropIsFixUp]\n\n\tif hasOverrideIsFixUp {\n\t\tboolOverrideIsFixUp, ok := overrideIsFixUp.(bool)\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t\treturn boolOverrideIsFixUp\n\t}\n\n\treturn defaultIsFixUp\n}", "title": "" }, { "docid": "71a96ac0fb3f763cf6aaadb500af6a61", "score": "0.51633334", "text": "func (am *AutogitManager) LocalChange(\n\tctx context.Context, node libkbfs.Node, wr libkbfs.WriteRange) {\n\t// Do nothing.\n}", "title": "" }, { "docid": "21a5f4796b0449b9248f319842424f62", "score": "0.5087116", "text": "func (NilResult) Changed() bool { return false }", "title": "" }, { "docid": "c8156a4fa3e374e571c142edbf57cba1", "score": "0.50806284", "text": "func hasChangedImmutableField(oldObject, cd *hiveext.AgentClusterInstallSpec, mutableFields []string) (bool, string) {\n\tr := &diffReporter{}\n\topts := cmp.Options{\n\t\tcmpopts.EquateEmpty(),\n\t\tcmpopts.IgnoreFields(hiveext.AgentClusterInstallSpec{}, mutableFields...),\n\t\tcmp.Reporter(r),\n\t}\n\treturn !cmp.Equal(oldObject, cd, opts), r.String()\n}", "title": "" }, { "docid": "66d41aa22c218bef9486ae672bcd567c", "score": "0.5063742", "text": "func (s *companyServer) noChange(s1 *pb.Shift, s2 *pb.Shift) bool {\n\tif s1.CompanyUuid != s2.CompanyUuid {\n\t\treturn false\n\t}\n\n\tif s1.TeamUuid != s2.TeamUuid {\n\t\treturn false\n\t}\n\n\tif s1.Start != s2.Start {\n\t\treturn false\n\t}\n\n\tif s1.Stop != s2.Stop {\n\t\treturn false\n\t}\n\n\tif s1.JobUuid != s2.JobUuid {\n\t\treturn false\n\t}\n\n\tif s1.UserUuid != s2.UserUuid {\n\t\treturn false\n\t}\n\n\tif s1.Published != s2.Published {\n\t\treturn false\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "9a5a0554ee29ae8ef454f94e2ca2f7b8", "score": "0.50351477", "text": "func AddrOverNonLocalIP(a ma.Multiaddr) bool {\n\tsplit := ma.Split(a)\n\tif len(split) < 1 {\n\t\treturn false\n\t}\n\tif manet.IsIP6LinkLocal(split[0]) {\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "3b634d089489ae55228f7b8885909a9e", "score": "0.49898678", "text": "func TestChangeNotEquivIfDiffField(t *testing.T) {\r\n\tchange1 := NewChange(\"insert\", 0, \"a\")\r\n\tchange2 := NewChange(\"insert\", 1, \"a\")\r\n\r\n\tif change1.Equals(change2) == true {\r\n\t\tt.Errorf(\"Change %v and Change %v should NOT be considered equal.\", change1, change2)\r\n\t}\r\n}", "title": "" }, { "docid": "7a10aa0c21003ec864d0bdd3cf5b72da", "score": "0.4980424", "text": "func (p *referenceModifiedPredicate) Update(e event.UpdateEvent) bool {\n\tif e.ObjectNew.GetName() == p.ObjectReference.Name && e.ObjectNew.GetNamespace() == p.ObjectReference.Namespace {\n\t\treturn !compareObjectsWithoutIgnoredFields(e.ObjectNew, e.ObjectOld)\n\t}\n\treturn false\n}", "title": "" }, { "docid": "d9a5a69f7d6381645a1372860051b4a9", "score": "0.49795392", "text": "func (f *File) vldOverrideDecl(node ast.Node) bool {\n\tfdecl, ok := node.(*ast.FuncDecl)\n\tif !ok {\n\t\t// We only care about func declarations.\n\t\treturn true\n\t}\n\t// fmt.Printf(\"%+v\\n\", fdecl)\n\n\tident := fdecl.Name\n\tfname := ident.Name\n\n\tfrecv := fdecl.Recv\n\tif frecv == nil {\n\t\treturn true\n\t}\n\tfor _, p := range frecv.List {\n\t\tptype := p.Type.(*ast.StarExpr)\n\n\t\tident := ptype.X.(*ast.Ident)\n\t\ttyp := ident.Name\n\n\t\t// Ignore type we are not looking for\n\t\tif typ != f.typeName {\n\t\t\treturn true\n\t\t}\n\n\t\t// Ignore func we are not looking for\n\t\tif strings.TrimSpace(fname) != FN_OVERRIDE {\n\t\t\treturn true\n\t\t}\n\t\tf.overrideExist = validateOverride(f, fname, typ)\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b40a92823506db85fa49df3ad69b0578", "score": "0.49755752", "text": "func (n *Node) OnlySelfUpdate() bool {\n\treturn bitflag.HasAtomic(&n.Flag, int(OnlySelfUpdate))\n}", "title": "" }, { "docid": "2e541f518848af1cddcebbd41a9a7f39", "score": "0.49256906", "text": "func (m *Mapping) CopyOnWrite() bool {\n\treturn m.origF != nil\n}", "title": "" }, { "docid": "61cf458390ea716f6b7f4db5a598691e", "score": "0.4914365", "text": "func (m *Membership) isLocal(member serf.Member) bool {\n\treturn m.serf.LocalMember().Name == member.Name\n}", "title": "" }, { "docid": "c5214c6b97c633eb93a137f05df573cc", "score": "0.49098194", "text": "func (d *Default) IsFixUp() bool {\n\tconfig := d.CustomConfiguration()\n\treturn overrideIsFixUp(config, false)\n}", "title": "" }, { "docid": "53f6476f611e61130c77677cfdde288f", "score": "0.49067533", "text": "func (memb *Member) setLocal(local bool) {\n\tmemb.local = local\n}", "title": "" }, { "docid": "62561b47d7b6ae5724362912b534bad6", "score": "0.48857662", "text": "func TestChangeNotEquivIfDiffFields(t *testing.T) {\r\n\tchange1 := NewChange(\"insert\", 0, \"a\")\r\n\tchange2 := NewChange(\"insert\", 1, \"z\")\r\n\r\n\tif change1.Equals(change2) == true {\r\n\t\tt.Errorf(\"Change %v and Change %v should NOT be considered equal.\", change1, change2)\r\n\t}\r\n}", "title": "" }, { "docid": "d098a30583d46443fd6dada3475e4b89", "score": "0.48492295", "text": "func (sm *subscriptionManager) LocalChange(ctx context.Context,\n\tnode Node, write WriteRange) {\n\tsm.lock.RLock()\n\tdefer sm.lock.RUnlock()\n\t// TODO HOTPOT-416: check topics\n\tsm.nodeChangeLocked(node)\n}", "title": "" }, { "docid": "1da45299289634dff2f73bdcc1a8b8e5", "score": "0.48422116", "text": "func preventChange(val interface{}) bool {\n\treturn false\n}", "title": "" }, { "docid": "03ad600868c9207eff5bbb3544930585", "score": "0.483519", "text": "func (ref LocatedRef) IsLocal() bool {\n\treturn ref.isLocal\n}", "title": "" }, { "docid": "00cc58e47e8963ce5a05db9860632fe0", "score": "0.48249677", "text": "func (o *GvmVM) HasRefLocal() bool {\n\tif o != nil && o.RefLocal.IsSet() {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "9efa1d1bad667e85ed1541ea609cf595", "score": "0.4779205", "text": "func IsNotModified(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tif e, ok := err.(ErrNotModified); ok {\n\t\treturn e.NotModified()\n\t}\n\n\tif e, ok := err.(causal); ok {\n\t\treturn IsNotModified(e.Cause())\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "b00c4694fed6d5f9e7967782cf382bf9", "score": "0.47558784", "text": "func IsNotModified(err error) bool {\n\t_, ok := getImplementer(err).(ErrNotModified)\n\treturn ok\n}", "title": "" }, { "docid": "25b0761dbae9a5fb7242e4b0925e0c71", "score": "0.47427762", "text": "func (current StatefulSetUpdate) Changed(update StatefulSetUpdate) bool {\n\treturn current.Replicas != update.Replicas\n}", "title": "" }, { "docid": "ea6369fdbd168e420dc1c495fe242847", "score": "0.47410434", "text": "func TestAndSetRelaxed(addr *bool) bool", "title": "" }, { "docid": "7dc955e4b1e8b92df76273f3072ab696", "score": "0.4735428", "text": "func (o *Human) Changed() bool {\n return o.diff.X != nil ||\n\t\to.diff.Y != nil ||\n\t\to.diff.CY != nil ||\n\t\to.diff.CX != nil ||\n\t\to.diff.CI != nil ||\n\t\to.diff.MapID != nil\n}", "title": "" }, { "docid": "f61bca52be6da223f6b52e74be827d29", "score": "0.47349894", "text": "func (p *PathImpl) IsLocal() bool {\r\n\treturn !p.unc\r\n}", "title": "" }, { "docid": "0e28f6ab72bad3bd225dfbb1003a30e6", "score": "0.4730288", "text": "func MatchNotLocal(r EventRegistry) EventMatcher {\n\treturn func(e *Event) bool {\n\t\tl, err := r.IsLocal(e.Type)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn !l\n\t}\n}", "title": "" }, { "docid": "51b499ad156b188215198b21814b0179", "score": "0.47269022", "text": "func (info *BaseServiceInfo) NodeLocalInternal() bool {\n\treturn info.nodeLocalInternal\n}", "title": "" }, { "docid": "09928338e0054dcc95888e25cf4682af", "score": "0.47267157", "text": "func (h *HostActionMute) HasOverride() bool {\n\tif h != nil && h.Override != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "216da577d18ee4082fb3e396c5c0cfd0", "score": "0.47176784", "text": "func IsMutable(fld *descriptor.Field) bool {\n\tv, err := reg.GetExtension(\"venice.mutable\", fld)\n\tif err != nil {\n\t\treturn true\n\t}\n\tif !fld.IsScalar() && !fld.IsString() {\n\t\tglog.Fatalf(\"Flag venice.mutable specified for non-scalar field %+v\", fld)\n\t}\n\treturn v.(bool)\n}", "title": "" }, { "docid": "e2d4ebf3901b66d719d844d529dbf6ef", "score": "0.47110435", "text": "func (i *ICMPv6NeighborAdvertisement) Override() bool {\n\treturn i.Flags&0x20 != 0\n}", "title": "" }, { "docid": "a2a67b677024352314af6a84cb7a0da0", "score": "0.46997252", "text": "func (o *ModifyOptions) Changed(fieldName string) bool {\n\treturn util.Changed(o, fieldName)\n}", "title": "" }, { "docid": "4721bdf13b4c175d19b70aa62e0f162f", "score": "0.4690195", "text": "func (c *Change) Updated() bool {\n\treturn c.Before != nil && c.After != nil\n}", "title": "" }, { "docid": "dd640c7f117150d63dff877c1a29822e", "score": "0.4679035", "text": "func (o *WorkbookRange) HasAddressLocal() bool {\n\tif o != nil && o.AddressLocal != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "074703fb021884c5de53b14e7640fcd4", "score": "0.46755642", "text": "func IsNotModified(err error) bool {\n\treturn errors.Is(err, ErrNotModified)\n}", "title": "" }, { "docid": "69b2d639d46338a96c5b7d8fd95a4b91", "score": "0.46731853", "text": "func (m *Method) M__ne__(other Object) (Object, error) {\n\tif otherMethod, ok := other.(*Method); ok && m == otherMethod {\n\t\treturn False, nil\n\t}\n\treturn True, nil\n}", "title": "" }, { "docid": "469eeb968adc786b266e6eaab8a86499", "score": "0.46674082", "text": "func checkChange(n *ContextCallSite) (bool, error) {\n\tchange, err := n.GetIn().Equal(n.GetOut())\n\tif err != nil {\n\t\treturn false, errors.Wrapf(err, \"equal failed with \\n %s\\n %s\", n.GetIn().String(), n.GetOut().String())\n\t}\n\treturn !change, nil\n}", "title": "" }, { "docid": "8054c83a81dd5b313b953be692f9024d", "score": "0.46650907", "text": "func (m *Move) IsFixUp() bool {\n\treturn false\n}", "title": "" }, { "docid": "93b19af19c36f7b04888983fefe16616", "score": "0.4664796", "text": "func (cfg *Config) OnLocal() bool {\n return cfg.Env == env.Local\n}", "title": "" }, { "docid": "0990c030f301620168bbf3963ff796c0", "score": "0.46578574", "text": "func (a Attribute) REFLECTMETHOD() bool { return (a & REFLECTMETHOD) != 0 }", "title": "" }, { "docid": "8981974a90903766ab8bbd273c0fadcf", "score": "0.46473223", "text": "func (a *Info) Internal() bool {\n\treturn a.RoleObj == nil\n}", "title": "" }, { "docid": "c32bf74d34042c5908efea77956637ec", "score": "0.4626669", "text": "func (d *rootWalker) handleOverride(s *ir.FunctionCallExpr) bool {\n\tif len(s.Args) != 2 {\n\t\treturn true\n\t}\n\n\targ0 := s.Arg(0)\n\targ1 := s.Arg(1)\n\n\tfc0, ok := arg0.Expr.(*ir.FunctionCallExpr)\n\tif !ok {\n\t\treturn true\n\t}\n\n\tfc1, ok := arg1.Expr.(*ir.FunctionCallExpr)\n\tif !ok {\n\t\treturn true\n\t}\n\n\tfnNameNode, ok := fc0.Function.(*ir.Name)\n\tif !ok || !fnNameNode.IsFullyQualified() {\n\t\treturn true\n\t}\n\n\toverrideNameNode, ok := fc1.Function.(*ir.Name)\n\tif !ok {\n\t\treturn true\n\t}\n\n\tif len(fc1.Args) != 1 {\n\t\treturn true\n\t}\n\n\tfc1Arg0 := fc1.Arg(0)\n\n\targNumNode, ok := fc1Arg0.Expr.(*ir.Lnumber)\n\tif !ok {\n\t\treturn true\n\t}\n\n\targNum, err := strconv.Atoi(argNumNode.Value)\n\tif err != nil {\n\t\treturn true\n\t}\n\n\tvar overrideTyp meta.OverrideType\n\tswitch {\n\tcase overrideNameNode.Value == `type`:\n\t\toverrideTyp = meta.OverrideArgType\n\tcase overrideNameNode.Value == `elementType`:\n\t\toverrideTyp = meta.OverrideElementType\n\tdefault:\n\t\treturn true\n\t}\n\n\tfnName := fnNameNode.Value\n\n\tif d.meta.FunctionOverrides == nil {\n\t\td.meta.FunctionOverrides = make(meta.FunctionsOverrideMap)\n\t}\n\n\td.meta.FunctionOverrides[fnName] = meta.FuncInfoOverride{\n\t\tOverrideType: overrideTyp,\n\t\tArgNum: argNum,\n\t}\n\n\treturn true\n}", "title": "" }, { "docid": "4483bdb2681897bd7e2f648b075fa3be", "score": "0.46164832", "text": "func (in *CRD) ShouldOverride() bool { return true }", "title": "" }, { "docid": "bed1ae24253162d1bf6bf70666b48e73", "score": "0.46113375", "text": "func TransitionFunction(original, desired *v1.Proxy) (bool, error) {\n\tif len(original.Listeners) != len(desired.Listeners) {\n\t\treturn true, nil\n\t}\n\tfor i := range original.Listeners {\n\t\tif !original.Listeners[i].Equal(desired.Listeners[i]) {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}", "title": "" }, { "docid": "6b0f09944fd7681b6147062e44d601ff", "score": "0.46087688", "text": "func (o APISpecPtrOutput) Override() pulumi.BoolPtrOutput {\n\treturn o.ApplyT(func(v *APISpec) *bool {\n\t\tif v == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn v.Override\n\t}).(pulumi.BoolPtrOutput)\n}", "title": "" }, { "docid": "ac0a667ebc3805661fa8b48d0179e9a3", "score": "0.46039274", "text": "func (f *FakeTransactionRepo) UpdateNotCalled() bool {\n\treturn len(f.UpdateCalls) == 0\n}", "title": "" }, { "docid": "7fb298aec45c0029b9f26a1d4b0680df", "score": "0.46003574", "text": "func (b *Board) HasModifiedAt() bool {\n\tif b != nil && b.ModifiedAt != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "1162ee0a2acf6293f91a435d5941f7c4", "score": "0.45853478", "text": "func isModified(p *Page) bool {\n\treturn p[0]&1 != 0\n}", "title": "" }, { "docid": "e254aef33d6cac7d6aa545d1b7444eb6", "score": "0.45819253", "text": "func (c Coordinate) shouldNotMutate() {\n\tc.x = 100\n\tc.y = 200\n}", "title": "" }, { "docid": "e05a74eb43244fda1a939f9f10e7fb61", "score": "0.4579013", "text": "func TestChangeEquivIfSameFields(t *testing.T) {\r\n\tchange1 := NewChange(\"insert\", 0, \"a\")\r\n\tchange2 := NewChange(\"insert\", 0, \"a\")\r\n\r\n\tif change1.Equals(change2) == false {\r\n\t\tt.Errorf(\"Change %v and Change %v should be considered equal.\", change1, change2)\r\n\t}\r\n}", "title": "" }, { "docid": "bb281d441c27d1908b7b5ba87b038915", "score": "0.45742613", "text": "func (o *CheckpointOptions) Changed(fieldName string) bool {\n\treturn util.Changed(o, fieldName)\n}", "title": "" }, { "docid": "ccd39c488086b8811bcd222e259c8d30", "score": "0.45740858", "text": "func (c Commit) HasNonVendoredCodeChanges() bool {\n\tfor _, file := range c.Files {\n\t\tif !file.HasVendoredCodeChanges() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "11c459cb6e472e5aa7ecc2a5a8fe47c5", "score": "0.45690688", "text": "func (a *AttributeChange) IsNoOp() bool {\n\treturn a.UpdateType == NoOpResource\n}", "title": "" }, { "docid": "b0c1c7b990ec18d40b508db3b25705c5", "score": "0.45617446", "text": "func (b *BoardLite) HasModifiedAt() bool {\n\tif b != nil && b.ModifiedAt != nil {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "06e45d5e8d841dc0c51de4403c83cbdd", "score": "0.45594126", "text": "func TestOverrideSecurity(t *testing.T) {\n\t// Disable detection of local IPs\n\tlocalipv4 = []string{}\n\tlocalipv6 = []string{}\n\t//None of these should be security issue\n\tcases_private := []string{\"127.0.0.1\", \"10.5.6.4\", \"192.168.5.99\", \"100.66.55.66\", \"fd07:a47c:3742:823e:3b02:76:982b:463\", \"::1\"}\n\tfor _, ipstr := range cases_private {\n\t\tif islocalip(net.ParseIP(ipstr)) {\n\t\t\tt.Errorf(\"Should be false for %s because we blanked it\", ipstr)\n\t\t}\n\t}\n\t//Restore original behaviour\n\tlocalipv4 = nil\n\tlocalipv6 = nil\n\t//Test again to see if we could restore it\n\tfor _, ipstr := range cases_private {\n\t\tif !islocalip(net.ParseIP(ipstr)) {\n\t\t\tt.Error(\"Should be true for \" + ipstr)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5f1e13eb44e021166e19e5d82cc7210b", "score": "0.45567942", "text": "func IsLocal() bool {\n\treturn local\n}", "title": "" }, { "docid": "a511fdefbbd55823d882938ddaa27d19", "score": "0.45566508", "text": "func (ChangePredicate) Update(e event.UpdateEvent) bool {\n\tif e.MetaOld == nil || e.MetaNew == nil {\n\t\t// ignore objects without metadata\n\t\treturn false\n\t}\n\tif e.MetaNew.GetGeneration() != e.MetaOld.GetGeneration() {\n\t\t// reconcile on spec changes\n\t\treturn true\n\t}\n\n\t// handle force sync\n\tif val, ok := metav1.ReconcileAnnotationValue(e.MetaNew.GetAnnotations()); ok {\n\t\tif valOld, okOld := metav1.ReconcileAnnotationValue(e.MetaOld.GetAnnotations()); okOld {\n\t\t\treturn val != valOld\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c52a0510a09f56d6687fb982e035767b", "score": "0.4544836", "text": "func (v *SourceFile) IsExternallyModified() bool {\n\treturn gobool(C.gtk_source_file_is_externally_modified(v.native()))\n}", "title": "" }, { "docid": "e8da175fe86b9a6bd4cd83027e3fecff", "score": "0.45447466", "text": "func (pi *StatusInfo) IsModified() bool {\n\treturn pi.Unstaged.hasChanged()\n}", "title": "" }, { "docid": "ed3f8c9ee33b64d54750d5bd68618ea8", "score": "0.45396852", "text": "func (f PublishFlags) Retain() bool { return f&0x1 == 0x1 }", "title": "" }, { "docid": "f322e5ffd9ae9147c245ef5a6a02b3a2", "score": "0.45375213", "text": "func needsUpdate(current, desired network.VirtualNetworkGatewayConnection) bool {\n\tif desired.Name == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1 == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2 == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID == nil {\n\t\treturn false\n\t}\n\n\tif current.Name == nil ||\n\t\t*current.Name != *desired.Name {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat == nil {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionType !=\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionType {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1 == nil ||\n\t\tcurrent.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID == nil ||\n\t\t*current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID !=\n\t\t\t*desired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2 == nil ||\n\t\tcurrent.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID == nil ||\n\t\t*current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID !=\n\t\t\t*desired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionStatus == network.VirtualNetworkGatewayConnectionStatusNotConnected {\n\t\treturn true\n\t}\n\n\treturn false\n}", "title": "" }, { "docid": "d01510e0327d2d2a2ddd6a2bb2177796", "score": "0.45354438", "text": "func IsLocalOutdated(dontRemindFor string) bool {\n\tif GetLatestRemoteVersion() == \"\" || GetLatestRemoteVersion() == dontRemindFor {\n\t\treturn false\n\t}\n\n\treturn isCurrentOlder(Version, GetLatestRemoteVersion())\n}", "title": "" }, { "docid": "2c2f5c914543b38508439bfb0f2f780f", "score": "0.45353302", "text": "func (dm *DagModifier) HasChanges() bool {\n\treturn dm.wrBuf != nil\n}", "title": "" }, { "docid": "84ec990fbe7b0b92db1e00a2570d1b23", "score": "0.45346755", "text": "func (o *Board) IsMutable() bool {\n\treturn false\n}", "title": "" }, { "docid": "820b8b0fa1680a6b1a80a7f8f4c6b012", "score": "0.45344755", "text": "func useRefspecOverrides() bool {\n\treturn len(refspecOverrides) > 0\n}", "title": "" }, { "docid": "288df12a3131ed2ae05a89c326847f54", "score": "0.45327795", "text": "func (a Attribute) NOPROF() bool { return (a & NOPROF) != 0 }", "title": "" }, { "docid": "f9b78d539bb2675e1a65943318f421a6", "score": "0.45296028", "text": "func (o *Commit) IsMutable() bool {\n\treturn false\n}", "title": "" }, { "docid": "2443a5b2817b4eb571ea49cf80485922", "score": "0.45295802", "text": "func (d *FakeResourceData) HasChange(string) bool { return false }", "title": "" }, { "docid": "afbdad7bc4121bbcfb917c38897c1cad", "score": "0.45295733", "text": "func (ap *Approvers) shouldNotOverrideApproval(login string, noIssue bool) bool {\n\tlogin = strings.ToLower(login)\n\tapproval, alreadyApproved := ap.approvers[login]\n\n\treturn alreadyApproved && approval.NoIssue && !noIssue\n}", "title": "" }, { "docid": "9748023c8af0bf9133a8f6821966e068", "score": "0.452822", "text": "func (f *FakeIdentifier) InvocationSetterNotCalled() bool {\n\treturn len(f.InvocationSetterCalls) == 0\n}", "title": "" }, { "docid": "8fb043a12c1086e22de3f1f2ddbb9133", "score": "0.45273685", "text": "func (ip IP) IsLinkLocalUnicast() bool {}", "title": "" }, { "docid": "8af710dd414f14f12374e739680a055f", "score": "0.45244014", "text": "func CompareAndSwapWeakUint32RelaxedRelaxed(addr *uint32, old, new uint32) bool", "title": "" }, { "docid": "8145ae1e12b4733c1c6f830e529d176e", "score": "0.4524325", "text": "func HasBlockContentFieldRevisionViaChanged(iChanged int) bool {\n\tif has, err := Engine.Where(\"changed = ?\", iChanged).Get(new(BlockContentFieldRevision)); err != nil {\n\t\treturn false\n\t} else {\n\t\tif has {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "58c1fcec22ab9ce72d5d1f227a97f8b2", "score": "0.45208764", "text": "func (fs *fsDev) haveNotBeenModified(paths ...I.PathInfo) error {\n\tfor _, p := range paths {\n\t\tif hasBeenModified(p, fs.Dev) {\n\t\t\treturn fmt.Errorf(\"Detected modified file before linking: %v\", p.Pathsplit.Join())\n\t\t}\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "6f51646a53b4fe4399ab892ab74a5b4e", "score": "0.45161447", "text": "func (m *Manager) isPrivate(val reflect.StructField) bool {\n\treturn strings.ToLower(val.Name[0:1]) == val.Name[0:1]\n}", "title": "" }, { "docid": "00084d7bb5ebb28cbc7f2b762f142f84", "score": "0.45096847", "text": "func (m *PropertyTypeMutation) OldEditable(ctx context.Context) (v bool, err error) {\n\tif !m.op.Is(OpUpdateOne) {\n\t\treturn v, fmt.Errorf(\"OldEditable is allowed only on UpdateOne operations\")\n\t}\n\tif m.id == nil || m.oldValue == nil {\n\t\treturn v, fmt.Errorf(\"OldEditable 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 OldEditable: %w\", err)\n\t}\n\treturn oldValue.Editable, nil\n}", "title": "" }, { "docid": "00084d7bb5ebb28cbc7f2b762f142f84", "score": "0.45096847", "text": "func (m *PropertyTypeMutation) OldEditable(ctx context.Context) (v bool, err error) {\n\tif !m.op.Is(OpUpdateOne) {\n\t\treturn v, fmt.Errorf(\"OldEditable is allowed only on UpdateOne operations\")\n\t}\n\tif m.id == nil || m.oldValue == nil {\n\t\treturn v, fmt.Errorf(\"OldEditable 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 OldEditable: %w\", err)\n\t}\n\treturn oldValue.Editable, nil\n}", "title": "" }, { "docid": "3770d73e868c71b73b08a7daf8bb86c5", "score": "0.4505689", "text": "func (o *Export) IsMutable() bool {\n\treturn false\n}", "title": "" }, { "docid": "2e2362caa4223615e55f4435cfe55468", "score": "0.4489242", "text": "func (Call) Equal(_ data.Value) bool {\n\treturn false\n}", "title": "" }, { "docid": "a786a4cc3239aaf98121eb82b1315201", "score": "0.44881994", "text": "func (d DefaultStrategy) AllowUnconditionalUpdate() bool {\n\tif d.Object == nil {\n\t\treturn false\n\t}\n\tif n, ok := d.Object.(resourcestrategy.AllowUnconditionalUpdater); ok {\n\t\treturn n.AllowUnconditionalUpdate()\n\t}\n\treturn false\n}", "title": "" }, { "docid": "1fd5ba7cb3ebd392a76ec7ffdb409bba", "score": "0.44854861", "text": "func CompareAndSwapWeakUintptrRelaxedRelaxed(addr *uintptr, old, new uintptr) bool", "title": "" }, { "docid": "f27909e8bbac75445cca1a267e45d0c3", "score": "0.44823277", "text": "func CompareAndSwapWeakPointerRelaxedRelaxed(addr *unsafe.Pointer, old, new unsafe.Pointer) bool", "title": "" }, { "docid": "b03a2eec8cf5541c46a6d21b2f4b9d58", "score": "0.44799188", "text": "func pOpIsLocalArg(op uint16) bool {\n\treturn op >= pOpLocal0 && op <= pOpLocal7\n}", "title": "" }, { "docid": "04d2aa1b4b8cdddd77df26255cc1e8bf", "score": "0.4478531", "text": "func (ip IP) IsGlobalUnicast() bool {}", "title": "" }, { "docid": "540abb3caddbe9e6a3972da0a26fc38a", "score": "0.44761074", "text": "func (t *Trigger) Ignore(_ notify.EventInfo) bool {\n\treturn false\n}", "title": "" }, { "docid": "a0308fc36fa8b876d1d5357e33e5c420", "score": "0.44687068", "text": "func (m *MockChecker) Overloaded() bool {\n\treturn false\n}", "title": "" }, { "docid": "727b074851bdcdc1a8f4e3ea065302c2", "score": "0.4464845", "text": "func (tax *Taxon) isConsistentUp(correct bool, rank biodv.Rank) bool {\n\tif rank == biodv.Unranked {\n\t\treturn true\n\t}\n\tif tax.Rank() == biodv.Unranked {\n\t\tfor _, c := range tax.children {\n\t\t\tif !c.isConsistentUp(correct, rank) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\tif tax.Rank() > rank {\n\t\treturn true\n\t}\n\tif tax.Rank() == rank && !correct {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "3c25ebf73bc95d97ed108d1b3376f447", "score": "0.44590843", "text": "func (r Resource) Updatable() bool {\n\tfor _, p := range r.SchemaProperties() {\n\t\tif !p.ForceNew && !(!p.Optional && p.Computed) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "title": "" }, { "docid": "727c370dd84db0bbea3b756e9d7ac6ee", "score": "0.44578218", "text": "func needUpdateAttribute(oldAttr, newAttr *networkextensionv1.IngressListenerAttribute) bool {\n\tif newAttr == nil {\n\t\treturn false\n\t}\n\tif oldAttr == nil {\n\t\treturn true\n\t}\n\tif (len(newAttr.LbPolicy) != 0 && newAttr.LbPolicy != oldAttr.LbPolicy) ||\n\t\tnewAttr.SessionTime != oldAttr.SessionTime {\n\t\treturn true\n\t}\n\tif newAttr.HealthCheck == nil {\n\t\treturn false\n\t}\n\tif oldAttr.HealthCheck == nil {\n\t\treturn true\n\t}\n\tnewHealth := newAttr.HealthCheck\n\toldHealth := oldAttr.HealthCheck\n\tif newHealth.Enabled != oldHealth.Enabled {\n\t\treturn true\n\t}\n\tif (len(newHealth.HTTPCheckMethod) != 0 && newHealth.HTTPCheckMethod != oldHealth.HTTPCheckMethod) ||\n\t\t(len(newHealth.HTTPCheckPath) != 0 && newHealth.HTTPCheckPath != oldHealth.HTTPCheckPath) ||\n\t\t(newHealth.HTTPCode != 0 && newHealth.HTTPCode != oldHealth.HTTPCode) ||\n\t\t(newHealth.HealthNum != 0 && newHealth.HealthNum != oldHealth.HealthNum) ||\n\t\t(newHealth.UnHealthNum != 0 && newHealth.UnHealthNum != oldHealth.UnHealthNum) ||\n\t\t(newHealth.IntervalTime != 0 && newHealth.IntervalTime != oldHealth.IntervalTime) ||\n\t\t(newHealth.Timeout != 0 && newHealth.Timeout != oldHealth.Timeout) {\n\t\treturn true\n\t}\n\treturn false\n}", "title": "" }, { "docid": "c5909e1e83522f21fddf95bbd8710e11", "score": "0.4451445", "text": "func (t TalkToMe) ReplyOnChange() bool {\n\treturn t&(1<<1) > 0\n}", "title": "" }, { "docid": "25a9ad8aca9668cd276c2af36b188512", "score": "0.44496685", "text": "func (b BoolResult) Changed() bool { return bool(b) }", "title": "" }, { "docid": "d8e4423cc94cd8b7989bd9073ed70d27", "score": "0.44490322", "text": "func (ua *UserAPI) modifiable() bool {\n\tif ua.AuthMode == common.DBAuth {\n\t\t// When the auth mode is local DB, admin can modify anyone, non-admin can modify himself.\n\t\treturn ua.IsAdmin || ua.userID == ua.currentUserID\n\t}\n\t// When the auth mode is external IDM backend, only the super user can modify himself,\n\t// because he's the only one whose information is stored in local DB.\n\treturn ua.userID == 1 && ua.userID == ua.currentUserID\n\n}", "title": "" }, { "docid": "afe08663037f4b3cd544554edae7cf53", "score": "0.4448998", "text": "func isNodeBeingUpdateByMCO(currentConfig, desiredConfig, mcdState string) bool {\n\treturn currentConfig != desiredConfig && mcdState == mcfgconst.MachineConfigDaemonStateWorking\n}", "title": "" }, { "docid": "9062c11c9eb8f85c9fb8d6dc607d2e13", "score": "0.44415957", "text": "func (t *targetrunner) changedMountpath(fqn string) (bool, string, error) {\n\tparsedFQN, err := fs.Mountpaths.FQN2Info(fqn)\n\tif err != nil {\n\t\treturn false, \"\", err\n\t}\n\tbucket, objName, isLocal := parsedFQN.Bucket, parsedFQN.Objname, parsedFQN.IsLocal\n\tnewFQN, errstr := cluster.FQN(bucket, objName, isLocal)\n\tif errstr != \"\" {\n\t\treturn false, \"\", errors.New(errstr)\n\t}\n\treturn fqn != newFQN, newFQN, nil\n}", "title": "" } ]
18866673c9edc22dc0b683d800602a03
Create returns a query builder for CarRepairrecord.
[ { "docid": "a61940482114c864a9dba2bb937fb145", "score": "0.6237695", "text": "func (c *CarRepairrecordClient) Query() *CarRepairrecordQuery {\n\treturn &CarRepairrecordQuery{config: c.config}\n}", "title": "" } ]
[ { "docid": "3f08d3686f354bd0dab869cbe9304b70", "score": "0.6751564", "text": "func (c *CarRepairrecordClient) Create() *CarRepairrecordCreate {\n\tmutation := newCarRepairrecordMutation(c.config, OpCreate)\n\treturn &CarRepairrecordCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "1008c231f60a74127f786c014b3b9304", "score": "0.5786798", "text": "func (q *queryBuilder) Create(creatable storage.Creatable) string {\n\tquery := fmt.Sprintf(createQuery, creatable.Table(), strings.Join(creatable.Fields(), \", \"), getPlaceholders(len(creatable.Values())))\n\tq.log.Debugf(\"Create query: %q\\n\", query)\n\treturn query\n}", "title": "" }, { "docid": "46eb38a8b3308c2f89c9d0608588b9a1", "score": "0.55214113", "text": "func (c *CarInspectionClient) QueryCarrepairrecords(ci *CarInspection) *CarRepairrecordQuery {\n\tquery := &CarRepairrecordQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := ci.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(carinspection.Table, carinspection.FieldID, id),\n\t\t\tsqlgraph.To(carrepairrecord.Table, carrepairrecord.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, carinspection.CarrepairrecordsTable, carinspection.CarrepairrecordsColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(ci.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "8bb6c4956030a438761d6000501c6ce1", "score": "0.5438599", "text": "func (c *CarInspectionClient) Create() *CarInspectionCreate {\n\tmutation := newCarInspectionMutation(c.config, OpCreate)\n\treturn &CarInspectionCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "f84d8b0e54c1e880bd2fcb9a65e1ab9b", "score": "0.5353721", "text": "func (c *BarRecordClient) Create() *BarRecordCreate {\n\tmutation := newBarRecordMutation(c.config, OpCreate)\n\treturn &BarRecordCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "7d635cad63ffbf1c84ead9a1eb13ea6e", "score": "0.52332526", "text": "func (c *CarbrandClient) Create() *CarbrandCreate {\n\tmutation := newCarbrandMutation(c.config, OpCreate)\n\treturn &CarbrandCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "8891012de28c5b09a6a4a2cdf31fc137", "score": "0.5227141", "text": "func NewCarRepairrecordClient(c config) *CarRepairrecordClient {\n\treturn &CarRepairrecordClient{config: c}\n}", "title": "" }, { "docid": "d6a129e34c9c7e2aa677c00142627ba0", "score": "0.51923025", "text": "func (c *CarClient) Create() *CarCreate {\n\tmutation := newCarMutation(c.config, OpCreate)\n\treturn &CarCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "f8d12f21cf4f8257a8bd63325491b260", "score": "0.5117423", "text": "func (c *UserClient) QueryCarrepairrecords(u *User) *CarRepairrecordQuery {\n\tquery := &CarRepairrecordQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := u.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(user.Table, user.FieldID, id),\n\t\t\tsqlgraph.To(carrepairrecord.Table, carrepairrecord.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, user.CarrepairrecordsTable, user.CarrepairrecordsColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(u.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "773c7ee838f70cf814df583506f2f1b6", "score": "0.51047903", "text": "func (c *QueryController) Create(ctx *app.CreateQueryContext) error {\n\tcurrentUserIdentityID, err := login.ContextIdentity(ctx)\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))\n\t}\n\tvar q query.Query\n\terr = application.Transactional(c.db, func(appl application.Application) error {\n\t\terr = appl.Spaces().CheckExists(ctx, ctx.SpaceID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tq = query.Query{\n\t\t\tSpaceID: ctx.SpaceID,\n\t\t\tFields: ctx.Payload.Data.Attributes.Fields,\n\t\t\tTitle: strings.TrimSpace(ctx.Payload.Data.Attributes.Title),\n\t\t\tCreator: *currentUserIdentityID,\n\t\t}\n\t\terr = appl.Queries().Create(ctx, &q)\n\t\treturn errs.WithStack(err)\n\t})\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, err)\n\t}\n\tres := &app.QuerySingle{\n\t\tData: ConvertQuery(ctx.Request, q),\n\t}\n\tctx.ResponseData.Header().Set(\"Location\", rest.AbsoluteURL(ctx.Request, app.QueryHref(ctx.SpaceID, res.Data.ID)))\n\treturn ctx.Created(res)\n}", "title": "" }, { "docid": "5c837605a7ce9f5a78a0a4b022c821f5", "score": "0.5102832", "text": "func (c *RepairingClient) Create() *RepairingCreate {\n\tmutation := newRepairingMutation(c.config, OpCreate)\n\treturn &RepairingCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "5ee305fe555bc1c194b38babb39f3b89", "score": "0.5037684", "text": "func (c *TradeRecordClient) Create() *TradeRecordCreate {\n\tmutation := newTradeRecordMutation(c.config, OpCreate)\n\treturn &TradeRecordCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "c61f6947638ade26472a31fb2027d06e", "score": "0.5025691", "text": "func (c *TradeCorrectionClient) QueryRecord(tc *TradeCorrection) *TradeRecordQuery {\n\tquery := (&TradeRecordClient{config: c.config}).Query()\n\tquery.path = func(context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := tc.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(tradecorrection.Table, tradecorrection.FieldID, id),\n\t\t\tsqlgraph.To(traderecord.Table, traderecord.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2M, true, tradecorrection.RecordTable, tradecorrection.RecordPrimaryKey...),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(tc.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "8bcbafe7b38603ce5ba1a94caca699b1", "score": "0.4955646", "text": "func (v *cityTableType) NewRecord() reform.Record {\n\treturn new(City)\n}", "title": "" }, { "docid": "d8c1fe47c95f6db0783158edbb3032c0", "score": "0.4919241", "text": "func (c *CarserviceClient) Create() *CarserviceCreate {\n\tmutation := newCarserviceMutation(c.config, OpCreate)\n\treturn &CarserviceCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "e270a5d5df9d7ddaf53c478161eff12b", "score": "0.49092218", "text": "func (c *CarbrandClient) Query() *CarbrandQuery {\n\treturn &CarbrandQuery{config: c.config}\n}", "title": "" }, { "docid": "fc29465b63098e3528b4ad5103f2b224", "score": "0.49087673", "text": "func (s *Service) Create(rs app.RequestScope, model *models.ContactUs) (*models.ContactUs, error) {\n\t// if err := model.Validate(); err != nil {\n\t// \treturn nil, err\n\t// }\n\terr := s.dao.Create(rs, model)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.dao.GetOne(rs, model.ID)\n}", "title": "" }, { "docid": "64ad0047e8a7968a6185df9631ab6283", "score": "0.48953098", "text": "func (table *Table) NewRecord() (adapters.Model) {\n\treturn &Model{\n\t\ttable: table,\n\t\tdata: make(map[string]interface{}),\n\t}\n}", "title": "" }, { "docid": "e723a7fd8169ae748e4082a2e50ec092", "score": "0.48886636", "text": "func (app *databaseBuilder) Create() DatabaseBuilder {\n\treturn createDatabaseBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "21d5b479b6ed226bc9bf721923eb1d1b", "score": "0.48735425", "text": "func (build *builder) Create() metadata.Builder {\n\tbuild.id = nil\n\tbuild.crOn = nil\n\tbuild.lstUpOn = nil\n\treturn build\n}", "title": "" }, { "docid": "3516b7783ee34c126cdd1ffec49e70ba", "score": "0.48709488", "text": "func (c *TradeConditionClient) QueryRecord(tc *TradeCondition) *TradeRecordQuery {\n\tquery := (&TradeRecordClient{config: c.config}).Query()\n\tquery.path = func(context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := tc.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(tradecondition.Table, tradecondition.FieldID, id),\n\t\t\tsqlgraph.To(traderecord.Table, traderecord.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.M2M, true, tradecondition.RecordTable, tradecondition.RecordPrimaryKey...),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(tc.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "302105515c52fa2b6ea7ae4835b97437", "score": "0.48607165", "text": "func (l *LookerSDK) CreateQuery(\n body WriteQuery,\n fields string,\n options *rtl.ApiSettings) (Query, error) {\n var result Query\n err := l.session.Do(&result, \"POST\", \"/4.0\", \"/queries\", map[string]interface{}{\"fields\": fields}, body, options)\n return result, err\n\n}", "title": "" }, { "docid": "7820fd273915b65af97688508797a637", "score": "0.48546964", "text": "func (c *TradeRecordClient) Query() *TradeRecordQuery {\n\treturn &TradeRecordQuery{\n\t\tconfig: c.config,\n\t\tinters: c.Interceptors(),\n\t}\n}", "title": "" }, { "docid": "3d9321139aca89d52ba7c2163685ee64", "score": "0.48401117", "text": "func (c *CarRepairrecordClient) Get(ctx context.Context, id int) (*CarRepairrecord, error) {\n\treturn c.Query().Where(carrepairrecord.ID(id)).Only(ctx)\n}", "title": "" }, { "docid": "661415378a27a785cea0580b3d593a9a", "score": "0.48386693", "text": "func (call *EnterprisesRepositoryImpl) Create(enterprises *models.Enterprises) (*models.Enterprises, error) {\n\n\t//driver.CreatePgDb(enterprises.CompanyTag)\n\n\tautocreatedb := call.database.Exec(\"create database \" + enterprises.CompanyTag)\n\tlog.Println(\"Output: %q\\n\", autocreatedb)\n\n\tdb := driver.ConfigSchema(enterprises.CompanyTag)\n\n\tdefer func() {\n\t\terr := db.Close()\n\t\tif err != nil {\n\t\t\tlog.Fatalln(err)\n\t\t}\n\t}()\n\n\tautocreateschema := db.Exec(\"create schema \" + enterprises.CompanyTag)\n\tlog.Println(\"Output: %q\\n\", autocreateschema)\n\n\n\terr := call.database.Table(\"enterprises\").Create(&enterprises).Error\n\tif err != nil {\n\t\tcommon.LogError(\"Create\", \"Error wehn trying to create use error is =>\", err)\n\t\treturn nil, err\n\t}\n\treturn enterprises, nil\n}", "title": "" }, { "docid": "edfedca8d1f98bfe18776e445fe34c3a", "score": "0.48322535", "text": "func (service RecordService) Create(record interface{}) error {\n\tsliceType := reflect.SliceOf(reflect.TypeOf(record))\n\tslice := reflect.MakeSlice(sliceType, 0, 1)\n\tslice = reflect.Append(slice, reflect.ValueOf(record))\n\treturn service.delegate.createAll(slice.Interface())\n}", "title": "" }, { "docid": "f8a59e8ad83845c4a064f7b9b1c2f177", "score": "0.48156336", "text": "func (c *CarClient) Query() *CarQuery {\n\treturn &CarQuery{\n\t\tconfig: c.config,\n\t}\n}", "title": "" }, { "docid": "280d42aeaa2fb5c0288704e29010a14d", "score": "0.48084068", "text": "func (c *RepairingClient) Query() *RepairingQuery {\n\treturn &RepairingQuery{config: c.config}\n}", "title": "" }, { "docid": "39cd240d0624d481886bcb6f06030d80", "score": "0.4806647", "text": "func (q *Qr) Create(qr *models.Qr) error {\n\ttableName := \"CreditQr\"\n\tav, err := dynamodbattribute.MarshalMap(&qr)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tinput := &dynamodb.PutItemInput{\n\t\tItem: av,\n\t\tTableName: aws.String(tableName),\n\t}\n\n\t_, err = q.DB.PutItem(input)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "54e2ab6b6a657be2dfff022bed76897e", "score": "0.4804475", "text": "func (app *rowBuilder) Create() RowBuilder {\n\treturn createRowBuilder(\n\t\tapp.hashAdapter,\n\t\tapp.resourceBuilder,\n\t\tapp.elementsBuilder,\n\t)\n}", "title": "" }, { "docid": "1e2531a56e86e935cd63452c6ff258b0", "score": "0.4803385", "text": "func createQuery(consulta Params) string {\n\tqs, _ := query.Values(consulta)\n\n\treturn qs.Encode()\n}", "title": "" }, { "docid": "44ba3c077c6bd6b8d2f28f084c6ea58f", "score": "0.4797308", "text": "func (c *BarRecordClient) Query() *BarRecordQuery {\n\treturn &BarRecordQuery{\n\t\tconfig: c.config,\n\t\tinters: c.Interceptors(),\n\t}\n}", "title": "" }, { "docid": "a076dbc0e376b2fe43fa51b761677b37", "score": "0.4763779", "text": "func (app *validTransactionBuilder) Create() ValidTransactionBuilder {\n return createValidTransactionBuilder()\n}", "title": "" }, { "docid": "ab1a8d69b50170f949aa23dad9689082", "score": "0.47512925", "text": "func (c *MedicalCareClient) Create() *MedicalCareCreate {\n\tmutation := newMedicalCareMutation(c.config, OpCreate)\n\treturn &MedicalCareCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "8094ec8316f4366cf0ac884ddc9384d6", "score": "0.47431707", "text": "func (c *RepairingClient) QueryRepairs(r *Repairing) *CarRepairrecordQuery {\n\tquery := &CarRepairrecordQuery{config: c.config}\n\tquery.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {\n\t\tid := r.ID\n\t\tstep := sqlgraph.NewStep(\n\t\t\tsqlgraph.From(repairing.Table, repairing.FieldID, id),\n\t\t\tsqlgraph.To(carrepairrecord.Table, carrepairrecord.FieldID),\n\t\t\tsqlgraph.Edge(sqlgraph.O2M, false, repairing.RepairsTable, repairing.RepairsColumn),\n\t\t)\n\t\tfromV = sqlgraph.Neighbors(r.driver.Dialect(), step)\n\t\treturn fromV, nil\n\t}\n\treturn query\n}", "title": "" }, { "docid": "908754a84b51d4ab2302e04bea9998c7", "score": "0.47418863", "text": "func CreateRecord(action Action, operation Operation) *Record {\n\tr := NewRecord()\n\tr.action = action\n\tr.operation = operation\n\tr.targets = []*Target{}\n\tr.filters = []*Filter{}\n\n\treturn r\n}", "title": "" }, { "docid": "9a562a8cc5c419024db192729eaba7aa", "score": "0.47385442", "text": "func (c *CarregisterClient) Create() *CarregisterCreate {\n\tmutation := newCarregisterMutation(c.config, OpCreate)\n\treturn &CarregisterCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "37a6ba38cd89355aadeb2cd7b63745f4", "score": "0.47260407", "text": "func (r *ReservationReport) Create(db *sql.DB) error {\n\tif err := db.QueryRow(`INSERT INTO reservation_report(beneficiary_id,area,\n\t\tsource_iris_code,dest_iris_code,dest_date) VALUES ($1,$2,$3,$4,$5) RETURNING id`,\n\t\tr.BeneficiaryID, r.Area, r.SourceIRISCode, r.DestIRISCode, r.DestDate).\n\t\tScan(&r.ID); err != nil {\n\t\treturn fmt.Errorf(\"insert %v\", err)\n\t}\n\treturn db.QueryRow(`SELECT name from beneficiary WHERE id=$1`, r.BeneficiaryID).\n\t\tScan(&r.Beneficiary)\n}", "title": "" }, { "docid": "e40875705f10ad1e11748a15f348f282", "score": "0.47008908", "text": "func (db *Database) Create(r primitives.Record) error {\n\tq, err := queryFromRecord(ins, r, \"id\")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tquery := fmt.Sprintf(\"INSERT INTO %s (%s) VALUES (%s);\", q.Table(), q.Columns(),\n\t\tq.Placeholders())\n\n\tres, err := db.Exec(query, q.addrs...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tid, err := res.LastInsertId()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tr.SetID(int(id))\n\n\treturn nil\n}", "title": "" }, { "docid": "ea798f9fab9f7b4c4659c1d63481fd93", "score": "0.46781966", "text": "func (c *CarCheckInOutClient) Create() *CarCheckInOutCreate {\n\tmutation := newCarCheckInOutMutation(c.config, OpCreate)\n\treturn &CarCheckInOutCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "85c9c6a609b5c1573d19684df1463e67", "score": "0.46531737", "text": "func (c *CarInspectionClient) Query() *CarInspectionQuery {\n\treturn &CarInspectionQuery{config: c.config}\n}", "title": "" }, { "docid": "6828d4ce616ae74d31a4309cc535e813", "score": "0.46510792", "text": "func Create(ctx context.Context, data *GoogleBooksAPI) (*model.Books, error) {\n\tbook := &model.Books{\n\t\tTitle: data.Items[0].VolumeInfo.Title,\n\t\tIsbn: data.Items[0].VolumeInfo.IndustryIdentifiers[0].Identifier,\n\t}\n\n\terr := db.Mysql.Create(&book).Error\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, err\n\t}\n\n\terr = db.Mysql.Where(\"ID=?\", book.ID).First(&book).Error\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn nil, err\n\t}\n\treturn book, err\n}", "title": "" }, { "docid": "29e80c1458aee376f61c9cbfc3de1e80", "score": "0.46454334", "text": "func (build *aggregatedTransactionsBuilder) Create() aggregated.TransactionsBuilder {\n\tbuild.id = nil\n\tbuild.met = nil\n\tbuild.trs = nil\n\tbuild.atomicTrs = nil\n\tbuild.createdOn = nil\n\treturn build\n}", "title": "" }, { "docid": "4a281dd95d7d0e22cd86410ca031eb55", "score": "0.46448323", "text": "func (b *repositoryServiceBuilder) Create() *repositoryService {\n\tif b.queryRepository == nil {\n\t\tpanic(\"queryRepository adapter is required\")\n\t}\n\n\tif b.commandRepository == nil {\n\t\tpanic(\"commandRepository adapter is required\")\n\t}\n\n\tinstance := &repositoryService{\n\t\ttableName: b.tableName,\n\t\tuserIdKey: b.userIdKey,\n\t\tqueryRepository: b.queryRepository,\n\t\tcommandRepository: b.commandRepository,\n\t\tsettings: b.settings,\n\t}\n\n\tinstance.cb = b.cbSettings.ToCircuitBreaker(b.tableName+\"-repository\", instance.onCircuitOpen)\n\n\tinstance.initialize()\n\n\treturn instance\n}", "title": "" }, { "docid": "84c259ed7fbc5af8f8ff76100179984e", "score": "0.46173313", "text": "func (s *BarService) Create(rs app.RequestScope, model *models.Bar) (*models.Bar, error) {\n\tif err := model.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := s.dao.Create(rs, model); err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.dao.Get(rs, model.ID)\n}", "title": "" }, { "docid": "49dee7ec0d183fdc770ac45b2340c2c4", "score": "0.46144876", "text": "func (c *TrackerqueryController) Create(ctx *app.CreateTrackerqueryContext) error {\n\t_, err := login.ContextIdentity(ctx)\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))\n\t}\n\n\terr = validateCreateTrackerQueryPayload(ctx)\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, err)\n\t}\n\n\t// check if user has contribute scope\n\terr = c.authService.RequireScope(ctx, ctx.Payload.Data.Relationships.Space.Data.ID.String(), \"contribute\")\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, err)\n\t}\n\n\terr = application.Transactional(c.db, func(appl application.Application) error {\n\t\terr = appl.Spaces().CheckExists(ctx, *ctx.Payload.Data.Relationships.Space.Data.ID)\n\t\tif err != nil {\n\t\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\t\"err\": err,\n\t\t\t\t\"space_id\": ctx.Payload.Data.Relationships.Space.Data.ID,\n\t\t\t}, \"unable to load space\")\n\t\t\treturn errors.NewBadParameterError(\"space\", ctx.Payload.Data.Relationships.Space.Data.ID.String()).Expected(\"valid space ID\")\n\t\t}\n\n\t\terr = appl.Trackers().CheckExists(ctx, ctx.Payload.Data.Relationships.Tracker.Data.ID)\n\t\tif err != nil {\n\t\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\t\"err\": err,\n\t\t\t\t\"tracker_id\": ctx.Payload.Data.Relationships.Tracker.Data.ID,\n\t\t\t}, \"unable to load tracker\")\n\t\t\treturn errors.NewBadParameterError(\"tracker\", ctx.Payload.Data.Relationships.Tracker.Data.ID.String()).Expected(\"valid tracker ID\")\n\t\t}\n\t\tif ctx.Payload.Data.ID != nil {\n\t\t\t// check if tracker query id exists\n\t\t\terr = appl.TrackerQueries().CheckExists(ctx, *ctx.Payload.Data.ID)\n\t\t\tif err == nil {\n\t\t\t\tlog.Error(ctx, map[string]interface{}{\n\t\t\t\t\t\"err\": err,\n\t\t\t\t\t\"trackerquery_id\": ctx.Payload.Data.Relationships.Tracker.Data.ID,\n\t\t\t\t}, \"unable to load trackerquery\")\n\t\t\t\treturn errors.NewBadParameterError(\"trackerquery\", ctx.Payload.Data.ID.String()).Expected(\"valid trackerquery ID\")\n\t\t\t}\n\n\t\t\t// check if tracker query id is uuid.Nil\n\t\t\tif *ctx.Payload.Data.ID == uuid.Nil {\n\t\t\t\treturn errors.NewBadParameterError(\"trackerquery\", ctx.Payload.Data.ID.String()).Expected(\"valid trackerquery ID\")\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, err)\n\t}\n\terr = application.Transactional(c.db, func(appl application.Application) error {\n\t\ttrackerQuery := remoteworkitem.TrackerQuery{\n\t\t\tQuery: ctx.Payload.Data.Attributes.Query,\n\t\t\tSchedule: ctx.Payload.Data.Attributes.Schedule,\n\t\t\tTrackerID: ctx.Payload.Data.Relationships.Tracker.Data.ID,\n\t\t\tSpaceID: *ctx.Payload.Data.Relationships.Space.Data.ID,\n\t\t\tWorkItemTypeID: ctx.Payload.Data.Relationships.WorkItemType.Data.ID,\n\t\t}\n\t\tif ctx.Payload.Data.ID != nil {\n\t\t\ttrackerQuery.ID = *ctx.Payload.Data.ID\n\t\t}\n\t\ttq, err := appl.TrackerQueries().Create(ctx.Context, trackerQuery)\n\t\tif err != nil {\n\t\t\treturn errs.Wrapf(err, \"failed to create tracker query %s\", ctx.Payload.Data)\n\t\t}\n\t\tres := &app.TrackerQuerySingle{\n\t\t\tData: convertTrackerQueryToApp(appl, ctx.Request, *tq),\n\t\t}\n\t\tctx.ResponseData.Header().Set(\"Location\", app.TrackerqueryHref(tq.ID))\n\t\treturn ctx.Created(res)\n\t})\n\tif err != nil {\n\t\treturn jsonapi.JSONErrorResponse(ctx, err)\n\t}\n\taccessTokens := getAccessTokensForTrackerQuery(c.configuration) //configuration.GetGithubAuthToken()\n\tc.scheduler.ScheduleAllQueries(ctx, accessTokens)\n\treturn nil\n}", "title": "" }, { "docid": "f1528ac098d4eedea055632658dfb7f5", "score": "0.46112552", "text": "func (u *ContactRepository) Create(model *models.Contact) error {\n\tquery := u.ContactTable().Create(model)\n\tif err := query.Error; err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "d70f180d2c8f88943f93e3721e9bb695", "score": "0.46062663", "text": "func New(startment string, args ...interface{}) *Query {\n\treturn &Query{query: startment, args: args}\n}", "title": "" }, { "docid": "b4760dbcd3f76ba6c958a56c8687d2e5", "score": "0.4601296", "text": "func newRecord(dsearch string, esearch uint, funcF Enum) *Record {\n\treturn &Record{key: Key{dsearch, esearch}, fnc: FunctionField{funcF}}\n}", "title": "" }, { "docid": "71a25f6d8625a0157f00a1d3088d41f3", "score": "0.45896292", "text": "func NewRecord(fields map[string]interface{}) *Record {\n\treturn &Record{0, -1, fields}\n}", "title": "" }, { "docid": "2fdf1d77e10a94bf020eff531d7305d7", "score": "0.45888132", "text": "func (c *CarserviceClient) Query() *CarserviceQuery {\n\treturn &CarserviceQuery{config: c.config}\n}", "title": "" }, { "docid": "3df3ea6fb8f2d24124c2207194ebf372", "score": "0.45861474", "text": "func (c *CarregisterClient) Query() *CarregisterQuery {\n\treturn &CarregisterQuery{config: c.config}\n}", "title": "" }, { "docid": "2bcdd3bb17375e471e4bcee7b7dd5e3c", "score": "0.45769826", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter, app.pkAdapter, app.immutableBuilder)\n}", "title": "" }, { "docid": "35b7e742612e813404fbe2200d96248b", "score": "0.45738578", "text": "func (c *Collection) NewQuery(filter *Filter) *Query {\n\treturn &Query{\n\t\tcol: c,\n\t\tfilter: filter,\n\t}\n}", "title": "" }, { "docid": "601d4aa9446d42f8b47b2b240c0a0c8a", "score": "0.45699903", "text": "func (repo *PqRepository) Create(taxObj *taxobj.TaxObject) (err error) {\n\t//Lazy init for preparing statement\n\tif repo.statement.insert == nil {\n\t\tstmt, err := repo.pool.Prepare(queryInsert)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trepo.statement.insert = stmt\n\t}\n\trow := repo.statement.insert.QueryRow(taxObj.Name, taxObj.TaxCode, taxObj.Price)\n\n\terr = row.Scan(\n\t\t&taxObj.ID,\n\t)\n\n\treturn\n}", "title": "" }, { "docid": "2fd8dd66c62ee7af87b76a653ac743bb", "score": "0.45562875", "text": "func NewRecord() *Record {\n\treturn new(Record)\n}", "title": "" }, { "docid": "ccc86ab6a68ca7d190d780594e95193f", "score": "0.45519856", "text": "func (s *Service) Create(conn *gorm.DB) error {\n\treturn conn.Create(s).Error\n}", "title": "" }, { "docid": "12375ab3a38d561dcc8a79667a6c9458", "score": "0.45344448", "text": "func (m *CarManager) Create(car *Car) (*Car, error) {\n\tif err := ValidateCar(car); err != nil {\n\t\treturn nil, err\n\t}\n\n\tcar.ID = bson.NewObjectId().Hex()\n\n\terr := m.Repo.Insert(car)\n\n\tif m.Repo.IsAlreadyExistErr(err) {\n\t\treturn m.Create(car)\n\t}\n\n\tif err != nil {\n\t\tm.Logger.Error(err.Error())\n\t\treturn nil, err\n\t}\n\n\treturn car, nil\n}", "title": "" }, { "docid": "5cc21b25104c40190c24b4f23c29049e", "score": "0.4533453", "text": "func New(db *sqlx.DB) *Conveyor {\n\treturn &Conveyor{db: db}\n}", "title": "" }, { "docid": "5cc21b25104c40190c24b4f23c29049e", "score": "0.4533453", "text": "func New(db *sqlx.DB) *Conveyor {\n\treturn &Conveyor{db: db}\n}", "title": "" }, { "docid": "91645e8e5d33323c76754e65037134b3", "score": "0.45249867", "text": "func (c *CarRepairrecordClient) Delete() *CarRepairrecordDelete {\n\tmutation := newCarRepairrecordMutation(c.config, OpDelete)\n\treturn &CarRepairrecordDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "91740cd4022c38c5f30a9aff4a786a7b", "score": "0.45208424", "text": "func New(c *gin.Context) (*Query, error) {\n\tquery := Query{Logging: true, Limit: -1}\n\terr := c.ShouldBind(&query)\n\treturn &query, err\n}", "title": "" }, { "docid": "1f20d577d9b248395ff549ab59ec7a79", "score": "0.45191026", "text": "func (tr *TenantRecord) Create() error {\n\terr := db.Debug().Model(&tr).Create(&tr).Error\n\treturn err\n}", "title": "" }, { "docid": "a716975df8dbf6977b5a2ad49ee81d77", "score": "0.4516", "text": "func Create(b *Book, e *engine.Engine) error {\n\tvar (\n\t\tcolumns, placeholders []string\n\n\t\t// The blank columns with default values\n\t\tcv []string\n\t)\n\tfds, err := scope.Fields(e, e.Scope.Value)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, field := range fds {\n\t\tif scope.ChangeableField(e, field) {\n\t\t\tif field.IsNormal {\n\t\t\t\tif field.IsBlank && field.HasDefaultValue {\n\t\t\t\t\tcv = append(cv, scope.Quote(e, field.DBName))\n\t\t\t\t\te.Scope.Set(model.BlankColWithValue, cv)\n\t\t\t\t} else if !field.IsPrimaryKey || !field.IsBlank {\n\t\t\t\t\tcolumns = append(columns, scope.Quote(e, field.DBName))\n\t\t\t\t\tplaceholders = append(placeholders, scope.AddToVars(e, field.Field.Interface()))\n\t\t\t\t}\n\t\t\t} else if field.Relationship != nil && field.Relationship.Kind == \"belongs_to\" {\n\t\t\t\tfor _, foreignKey := range field.Relationship.ForeignDBNames {\n\t\t\t\t\tforeignField, err := scope.FieldByName(e, e.Scope.Value, foreignKey)\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 !scope.ChangeableField(e, foreignField) {\n\t\t\t\t\t\tcolumns = append(columns, scope.Quote(e, foreignField.DBName))\n\t\t\t\t\t\tplaceholders = append(placeholders, scope.AddToVars(e, foreignField.Field.Interface()))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tvar (\n\t\treturningColumn = \"*\"\n\t\ttableName = scope.QuotedTableName(e, e.Scope.Value)\n\n\t\textraOption string\n\t)\n\n\tprimaryField, err := scope.PrimaryField(e, e.Scope.Value)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif str, ok := e.Scope.Get(model.InsertOptions); ok {\n\t\textraOption = fmt.Sprint(str)\n\t}\n\n\tif primaryField != nil {\n\t\treturningColumn = scope.Quote(e, primaryField.DBName)\n\t}\n\n\tlastInsertIDReturningSuffix :=\n\t\te.Dialect.LastInsertIDReturningSuffix(tableName, returningColumn)\n\n\tif len(columns) == 0 {\n\t\tsql := fmt.Sprintf(\n\t\t\t\"INSERT INTO %v DEFAULT VALUES%v%v\",\n\t\t\ttableName,\n\t\t\tutil.AddExtraSpaceIfExist(extraOption),\n\t\t\tutil.AddExtraSpaceIfExist(lastInsertIDReturningSuffix),\n\t\t)\n\t\te.Scope.SQL = strings.Replace(sql, \"$$\", \"?\", -1)\n\t} else {\n\t\tsql := fmt.Sprintf(\n\t\t\t\"INSERT INTO %v (%v) VALUES (%v)%v%v\",\n\t\t\tscope.QuotedTableName(e, e.Scope.Value),\n\t\t\tstrings.Join(columns, \",\"),\n\t\t\tstrings.Join(placeholders, \",\"),\n\t\t\tutil.AddExtraSpaceIfExist(extraOption),\n\t\t\tutil.AddExtraSpaceIfExist(lastInsertIDReturningSuffix),\n\t\t)\n\t\te.Scope.SQL = strings.Replace(sql, \"$$\", \"?\", -1)\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "2132ffd40410e23fbcd42ecbdcbad7a2", "score": "0.45061132", "text": "func (repo *cardTypeRepository) Create(cardType *model.CardType) (*model.CardType, error) {\n\tif err := repo.db.Create(cardType).Error; err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn cardType, nil\n}", "title": "" }, { "docid": "a77de2e66634e4ceb79679ae31a049bb", "score": "0.44996563", "text": "func (c CarResource) Create(obj interface{}, r api2go.Request) (api2go.Responder, error) {\n\tcar, ok := obj.(model.Car)\n\tif !ok {\n\t\treturn &Response{}, api2go.NewHTTPError(fmt.Errorf(\"invalid instance given\"), \"invalid instance given\", http.StatusBadRequest)\n\t}\n\tvalid, err := govalidator.ValidateStruct(car)\n\n\tif !valid || err != nil {\n\t\treturn &Response{}, api2go.NewHTTPError(fmt.Errorf(\"vendor and model is required\"), \"vendor and model is required\", http.StatusBadRequest)\n\t}\n\n\tid, err := c.Storage.Insert(&car)\n\tif err != nil {\n\t\treturn &Response{}, fmt.Errorf(\"insert car failed: %s\", err)\n\t}\n\tcar.SetID(id)\n\n\treturn &Response{Res: car, Code: http.StatusCreated}, nil\n}", "title": "" }, { "docid": "865c303ea1c16905a86272822c5598dc", "score": "0.4498324", "text": "func (b ContractBucket) Build(db weave.KVStore, c *Contract) orm.Object {\n\tkey := b.idSeq.NextVal(db)\n\treturn orm.NewSimpleObj(key, c)\n}", "title": "" }, { "docid": "594c1db27a73ed19d3c26514254ae6c7", "score": "0.4482033", "text": "func (db Schema) Create() error {\n\treturn Tx(db.DB, func(tx *sql.Tx) error {\n\t\tif query, err := createSchema(tx); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to execute query:\\n%s\\nReason: %v\", query, err)\n\t\t}\n\t\treturn nil\n\t})\n}", "title": "" }, { "docid": "f4741b26f8053486e3b6218bf5cffd48", "score": "0.4474774", "text": "func (c *CarCheckInOutClient) Query() *CarCheckInOutQuery {\n\treturn &CarCheckInOutQuery{config: c.config}\n}", "title": "" }, { "docid": "c401039a05568a1dd8cdb97f710a1634", "score": "0.4466802", "text": "func (myf *MySQLFlavor) Create(ent interface{}) error {\n\n\tvar info CrudInfo\n\tinfo.ent = ent\n\tinfo.log = false\n\tinfo.mode = \"C\"\n\n\terr := myf.BuildComponents(&info)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// build the mysql insert query\n\tinsQuery := \"INSERT INTO \" + info.tn + \" \" + info.fList + \" VALUES \" + info.vList + \";\"\n\tmyf.QsLog(insQuery)\n\n\t// clear the source data - deals with non-persistet columns\n\te := reflect.ValueOf(info.ent).Elem()\n\te.Set(reflect.Zero(e.Type()))\n\n\t// attempt the insert and read the result back into info.resultMap\n\tresult, err := myf.db.Exec(insQuery)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlastID, err := result.LastInsertId()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tselQuery := \"SELECT * FROM \" + info.tn + \" WHERE \" + info.incKeyName + \" = \" + strconv.FormatInt(lastID, 10) + \" LIMIT 1;\"\n\tmyf.QsLog(selQuery)\n\n\terr = myf.db.QueryRowx(selQuery).StructScan(info.ent) // .MapScan(info.resultMap) // SliceScan\n\tif err != nil {\n\t\treturn err\n\t}\n\tinfo.entValue = reflect.ValueOf(info.ent)\n\treturn nil\n}", "title": "" }, { "docid": "96beeb7922d76340357f9ac5a11e7f76", "score": "0.446516", "text": "func New() *Query {\n\treturn &Query{\n\t\tdelimiterIN: \",\",\n\t\tdelimiterOR: \"|\",\n\t}\n}", "title": "" }, { "docid": "f50b354997ae4d4dc016c363c2684b04", "score": "0.44638783", "text": "func (s *Show) Create() error {\n\treturn s.CreateQ(db.Writer)\n}", "title": "" }, { "docid": "6385683bd56e56c6db1227e07ecf5e90", "score": "0.44624162", "text": "func NewBuild(inputCar car) Builder {\n\treturn &builder{\n\t\tcar: inputCar,\n\t}\n}", "title": "" }, { "docid": "55c09247ffa74c5947461bea25cba280", "score": "0.44570345", "text": "func (build *transactionBuilder) Create() trs.TransactionBuilder {\n\tbuild.id = nil\n\tbuild.meta = nil\n\tbuild.js = nil\n\tbuild.createdOn = nil\n\treturn build\n}", "title": "" }, { "docid": "f9ccae9c6d000d2027539944511f4708", "score": "0.4456514", "text": "func newRecords(db *sql.DB) *records {\n\tif db == nil {\n\t\tdb = getDb()\n\t}\n\trecords := &records{\n\t\tdb: db,\n\t}\n\treturn records\n}", "title": "" }, { "docid": "3ec16c65c9c08eb264ce969a593dc139", "score": "0.4450391", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.encPKAdapter, app.hashAdapter)\n}", "title": "" }, { "docid": "9a18c1f8ba678643b40b1db47ea279d6", "score": "0.44476935", "text": "func Create(client *gophercloud.ServiceClient, instanceID string, opts CreateOptsBuilder) CreateResult {\n\tvar res CreateResult\n\n\treqBody, err := opts.ToDBCreateMap()\n\tif err != nil {\n\t\tres.Err = err\n\t\treturn res\n\t}\n\n\t_, res.Err = client.Request(\"POST\", baseURL(client, instanceID), gophercloud.RequestOpts{\n\t\tJSONBody: &reqBody,\n\t\tOkCodes: []int{202},\n\t})\n\n\treturn res\n}", "title": "" }, { "docid": "8d4b190637636be381707db7eda777da", "score": "0.44438395", "text": "func newRecord(prefix string, i int) record.Record {\n\tkey, value := getKV(prefix, i)\n\treturn record.NewRecordStr(key, value)\n}", "title": "" }, { "docid": "5c61c7bc2b96d34fe2ca8e680ed38121", "score": "0.4442663", "text": "func NewRecord(options ...RecordOption) (*Record, error) {\n\n\t// create the base record\n\tx := &Record{\n\t\tUuid: uuid.New().String(),\n\t\tPreviousCID: \"\",\n\t\tHistory: []*RecordComment{},\n\t\tLinkedSamples: make(map[string]string),\n\t\tLinkedLibraries: make(map[string]string),\n\t\tBarcodes: make(map[string]int32),\n\t}\n\n\t// start the Record history\n\tx.AddComment(\"record created.\")\n\n\t// add the user provided options\n\tfor _, option := range options {\n\t\terr := option(x)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn x, nil\n}", "title": "" }, { "docid": "e7ea1e4f6764437aa1d602f834220927", "score": "0.4441053", "text": "func (o *Orm) Create() *Orm {\n\tc := o.clone()\n\tc.operator = OperatorCreate\n\treturn c\n}", "title": "" }, { "docid": "ab02eec358b8bef6d865b97dbb51c6dc", "score": "0.4437413", "text": "func (db *DB) Create(target Item, source Item) error {\n\tfmt.Println(\"DB: RUNNING CREATE\")\n\tparams := source.CreateParams()\n\treturn db.conn.Get(target, source.CreateQuery(), params...)\n}", "title": "" }, { "docid": "93babbc8f145a6b072d7be6aee10c471", "score": "0.44343054", "text": "func (q *queryBuilder) make() (string, error) {\n\tif err := q.validateQuery(); err != nil {\n\t\treturn \"\", err\n\t}\n\tqueryReq := \"SELECT \"\n\tswitch q.aq.Type() {\n\tcase AggregationQueryType:\n\t\taction, err := q.checkAction()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tqueryReq += fmt.Sprintf(\"%s(values[indexOf(names, '%s')]) \", action, q.aq.GetLabel())\n\tcase ListQueryType:\n\t\tqueryReq += fmt.Sprintf(\"values[indexOf(names, '%s')] \", q.aq.GetLabel())\n\t}\n\tqueryReq += fmt.Sprintf(\"AS result FROM %s \", q.c.DBName)\n\tif len(q.aq.GetEntities()) > 0 {\n\t\tqueryReq += q.makeEntitiesQuery()\n\t}\n\tif q.aq.GetRange() != \"\" {\n\t\tqueryReq += q.makeRangeQuery()\n\t}\n\treturn queryReq, nil\n}", "title": "" }, { "docid": "32ad42d05c31d365fb6713736137cff1", "score": "0.4433522", "text": "func (app *remainingOperationBuilder) Create() RemainingOperationBuilder {\n\treturn createRemainingOperationBuilder()\n}", "title": "" }, { "docid": "7414d0918f9be4c54815818bcf03fb4d", "score": "0.44256514", "text": "func Create(tx *gorm.DB, record interface{}) error {\n\tres := tx.Debug().Create(record)\n\tif res.Error != nil {\n\t\treturn Translate(res.Error)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "06b307ff3441c8d847e26c7eb4a474b8", "score": "0.44223002", "text": "func (v *candleTableType) NewRecord() reform.Record {\n\treturn new(Candle)\n}", "title": "" }, { "docid": "13eb0cbad78b041b75ef3ef4206562ec", "score": "0.44214123", "text": "func (c *InspectionResultClient) Create() *InspectionResultCreate {\n\tmutation := newInspectionResultMutation(c.config, OpCreate)\n\treturn &InspectionResultCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" }, { "docid": "00f97a197f009b81ac40d661b273fe68", "score": "0.4411743", "text": "func (lkp *lookup) Create(vcursor planbuilder.VCursor, id interface{}, ksid []byte) error {\n\tval, err := vunhash(ksid)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"lookup.Create: %v\", err)\n\t}\n\tbq := &querytypes.BoundQuery{\n\t\tSql: lkp.ins,\n\t\tBindVariables: map[string]interface{}{\n\t\t\tlkp.From: id,\n\t\t\tlkp.To: val,\n\t\t},\n\t}\n\tif _, err := vcursor.Execute(bq); err != nil {\n\t\treturn fmt.Errorf(\"lookup.Create: %v\", err)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "33bfcf9574ecdb6bd4461549780c7023", "score": "0.44096354", "text": "func Builder(\n\tcrossid *field.CrossIDField,\n\torigcrossid *field.OrigCrossIDField,\n\tcrosstype *field.CrossTypeField,\n\tcrossprioritization *field.CrossPrioritizationField,\n\tnosides *field.NoSidesField,\n\ttransacttime *field.TransactTimeField,\n\tordtype *field.OrdTypeField) MessageBuilder {\n\tvar builder MessageBuilder\n\tbuilder.MessageBuilder = quickfix.NewMessageBuilder()\n\tbuilder.Header().Set(field.NewBeginString(fix.BeginString_FIXT11))\n\tbuilder.Header().Set(field.NewDefaultApplVerID(enum.ApplVerID_FIX50SP2))\n\tbuilder.Header().Set(field.NewMsgType(\"t\"))\n\tbuilder.Body().Set(crossid)\n\tbuilder.Body().Set(origcrossid)\n\tbuilder.Body().Set(crosstype)\n\tbuilder.Body().Set(crossprioritization)\n\tbuilder.Body().Set(nosides)\n\tbuilder.Body().Set(transacttime)\n\tbuilder.Body().Set(ordtype)\n\treturn builder\n}", "title": "" }, { "docid": "41b06bdb1515eefed09287d860b33fb7", "score": "0.44049165", "text": "func New(quotereqid field.QuoteReqIDField, symbol field.SymbolField) (m QuoteRequest) {\n\tm.Message = quickfix.NewMessage()\n\tm.Header = fix41.NewHeader(&m.Message.Header)\n\tm.Body = &m.Message.Body\n\tm.Trailer.Trailer = &m.Message.Trailer\n\n\tm.Header.Set(field.NewMsgType(\"R\"))\n\tm.Set(quotereqid)\n\tm.Set(symbol)\n\n\treturn\n}", "title": "" }, { "docid": "f9321bac726c6cdebc0db0cabc6ea352", "score": "0.4402873", "text": "func (brq *BarRecordQuery) Clone() *BarRecordQuery {\n\tif brq == nil {\n\t\treturn nil\n\t}\n\treturn &BarRecordQuery{\n\t\tconfig: brq.config,\n\t\tlimit: brq.limit,\n\t\toffset: brq.offset,\n\t\torder: append([]OrderFunc{}, brq.order...),\n\t\tinters: append([]Interceptor{}, brq.inters...),\n\t\tpredicates: append([]predicate.BarRecord{}, brq.predicates...),\n\t\twithGroup: brq.withGroup.Clone(),\n\t\t// clone intermediate query.\n\t\tsql: brq.sql.Clone(),\n\t\tpath: brq.path,\n\t\tunique: brq.unique,\n\t}\n}", "title": "" }, { "docid": "484902bc413991f63f42ce1b5d50c65d", "score": "0.44012433", "text": "func (m Match) GenCreateQuery() string {\n\treturn fmt.Sprintf(\"INSERT INTO matchs (season_id,date,url_result,index,date_unix) VALUES (%d,'%s','%s',%d,%d)\",\n\t\tm.SeasonID, m.Date.Format(\"2006-01-02 15:04:00\"), m.URLResult, m.Index, m.Date.Unix())\n}", "title": "" }, { "docid": "ac2cb45f314df8d5634dbe8821345c9f", "score": "0.44005686", "text": "func (app *codeMatchBuilder) Create() CodeMatchBuilder {\n\treturn createCodeMatchBuilder()\n}", "title": "" }, { "docid": "8e5d13fefedda6ea08574739df09b702", "score": "0.44003403", "text": "func New(quotereqid field.QuoteReqIDField, symbol field.SymbolField) (m QuoteRequest) {\n\tm.Message = quickfix.NewMessage()\n\tm.Header = fix40.NewHeader(&m.Message.Header)\n\tm.Body = &m.Message.Body\n\tm.Trailer.Trailer = &m.Message.Trailer\n\n\tm.Header.Set(field.NewMsgType(\"R\"))\n\tm.Set(quotereqid)\n\tm.Set(symbol)\n\n\treturn\n}", "title": "" }, { "docid": "d50c7e5054015e6719e71fc58d66a5ec", "score": "0.43994555", "text": "func (co *Connection) NewRecord(name string, values ...map[string]interface{}) (*record, error) {\n\toi, err := co.DescribeSObject(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn oi.NewRecord(values...)\n}", "title": "" }, { "docid": "ef487099424a137694aed380ad1ebe03", "score": "0.43989375", "text": "func New(srv *services.RabbitService, db *sql.DB) (d Dao, cf func(), err error) {\n\treturn newDao(srv, db)\n}", "title": "" }, { "docid": "ed4e7c69755bb19818de4d6dbfe666cc", "score": "0.43982062", "text": "func (s QueryHistoryService) createQuery(ctx context.Context, user *user.SignedInUser, cmd CreateQueryInQueryHistoryCommand) (QueryHistoryDTO, error) {\n\tqueryHistory := QueryHistory{\n\t\tOrgID: user.OrgID,\n\t\tUID: util.GenerateShortUID(),\n\t\tQueries: cmd.Queries,\n\t\tDatasourceUID: cmd.DatasourceUID,\n\t\tCreatedBy: user.UserID,\n\t\tCreatedAt: s.now().Unix(),\n\t\tComment: \"\",\n\t}\n\n\terr := s.store.WithDbSession(ctx, func(session *db.Session) error {\n\t\t_, err := session.Insert(&queryHistory)\n\t\treturn err\n\t})\n\tif err != nil {\n\t\treturn QueryHistoryDTO{}, err\n\t}\n\n\tdto := QueryHistoryDTO{\n\t\tUID: queryHistory.UID,\n\t\tDatasourceUID: queryHistory.DatasourceUID,\n\t\tCreatedBy: queryHistory.CreatedBy,\n\t\tCreatedAt: queryHistory.CreatedAt,\n\t\tComment: queryHistory.Comment,\n\t\tQueries: queryHistory.Queries,\n\t\tStarred: false,\n\t}\n\n\treturn dto, nil\n}", "title": "" }, { "docid": "c6c27f81196c6b2d63d982132cba6b2a", "score": "0.4397463", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "c6c27f81196c6b2d63d982132cba6b2a", "score": "0.4397463", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "c6c27f81196c6b2d63d982132cba6b2a", "score": "0.4397463", "text": "func (app *builder) Create() Builder {\n\treturn createBuilder(app.hashAdapter)\n}", "title": "" }, { "docid": "eb2d7989f27040b3d2a83e332550b2db", "score": "0.43800822", "text": "func (c *HospitalClient) Create() *HospitalCreate {\n\tmutation := newHospitalMutation(c.config, OpCreate)\n\treturn &HospitalCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}\n}", "title": "" } ]
7606cb97dac0d95353cf2a316a52b532
UpdateContent provides a mock function with given fields: update
[ { "docid": "2d20baa98ec3c2abc0791b553ab47de1", "score": "0.7352344", "text": "func (_m *Bloodlines) UpdateContent(update *models.Content) (*models.Content, error) {\n\tret := _m.Called(update)\n\n\tvar r0 *models.Content\n\tif rf, ok := ret.Get(0).(func(*models.Content) *models.Content); ok {\n\t\tr0 = rf(update)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.Content)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*models.Content) error); ok {\n\t\tr1 = rf(update)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" } ]
[ { "docid": "778460803d02656bccd82cecd0ded32b", "score": "0.6845433", "text": "func (_m *Service) Update(post model.BlogPost) globalmodel.Response {\n\tret := _m.Called(post)\n\n\tvar r0 globalmodel.Response\n\tif rf, ok := ret.Get(0).(func(model.BlogPost) globalmodel.Response); ok {\n\t\tr0 = rf(post)\n\t} else {\n\t\tr0 = ret.Get(0).(globalmodel.Response)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "cf12cdb4591f7d74ff91362a75e2a9ad", "score": "0.68276954", "text": "func (_m *Repository) Update(bl *schemas.Block) error {\n\tret := _m.Called(bl)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*schemas.Block) error); ok {\n\t\tr0 = rf(bl)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "5123a1750b8904648f2bde960baf3408", "score": "0.67480135", "text": "func (_m *TombstoneService) Update(ctx context.Context, resourceType resource.Type, id string, in model.TombstoneInput) error {\n\tret := _m.Called(ctx, resourceType, id, in)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, resource.Type, string, model.TombstoneInput) error); ok {\n\t\tr0 = rf(ctx, resourceType, id, in)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "48af2b31c3d2f1905223cf6d6264cca2", "score": "0.6689044", "text": "func (_m VirtualHostRepository) Update(host *domain.VirtualHost) error {\n\tret := _m.Called(host)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*domain.VirtualHost) error); ok {\n\t\tr0 = rf(host)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "ec2bee2d70690a6e7d281ee4d66d6b1d", "score": "0.66042334", "text": "func (_m *UsersGateway) Update(user *entity.User) error {\n\tret := _m.Called(user)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*entity.User) error); ok {\n\t\tr0 = rf(user)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "3b962c5a3adf1d188a02148160798155", "score": "0.6603653", "text": "func TestMockUpdateFileContentModifiesFileContent(t *testing.T) {\r\n\tfileID := 1\r\n\tfileContent := \"oldContent\"\r\n\tnewContent := \"newContent\"\r\n\tm := MockDB{fileID, fileContent, []obj.Change{}}\r\n\r\n\tm.UpdateFileContent(fileID, newContent)\r\n\tif m.FileContent != newContent {\r\n\t\tt.Errorf(\"Expected UpdateFileContent to update FileContent to %v, but it got updated to %v.\", newContent, m.FileContent)\r\n\t}\r\n}", "title": "" }, { "docid": "14a86389a0e3005085339c81dc32f2f9", "score": "0.6597992", "text": "func (_m *RunTestRepository) Update(_a0 *models.RunTest) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*models.RunTest) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "74ee11f9430bcf3e7a4bdbbe0c052af6", "score": "0.65936655", "text": "func (_m *Repository) Update(ctx context.Context, url models.Url) error {\n\tret := _m.Called(ctx, url)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, models.Url) error); ok {\n\t\tr0 = rf(ctx, url)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "7fef51fb702737c9daa1f9fc5ef55a91", "score": "0.65902185", "text": "func (_m *TransactionQuerier) Update(model *domains.Transaction) error {\n\tret := _m.Called(model)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*domains.Transaction) error); ok {\n\t\tr0 = rf(model)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "6cb8d2336ddcc6fd261d4123f52aad30", "score": "0.65862596", "text": "func (_m *Repository) Update(model domain.IModel) error {\n\tret := _m.Called(model)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(domain.IModel) error); ok {\n\t\tr0 = rf(model)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "50e8c8933eee41fad24f71af18f99c6a", "score": "0.656246", "text": "func (_m *ObjectStore) Update(key string, store string, src interface{}) error {\n\tret := _m.Called(key, store, src)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, string, interface{}) error); ok {\n\t\tr0 = rf(key, store, src)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "be12e7f3163e6a4a145a40cc043c45d7", "score": "0.6531398", "text": "func (_m *OrderI) Update(_a0 *models.Order) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*models.Order) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "c5d7436e6fb0bfdc7ee73c09e035c887", "score": "0.6503133", "text": "func (_m *AppealRepository) Update(_a0 *domain.Appeal) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*domain.Appeal) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "5db64ec30a3a27950440731cb2ef1b55", "score": "0.648304", "text": "func (_m *Client) ASUpdate(name string, addrs []string, external_ids map[string]string) (*goovn.OvnCommand, error) {\n\tret := _m.Called(name, addrs, external_ids)\n\n\tvar r0 *goovn.OvnCommand\n\tif rf, ok := ret.Get(0).(func(string, []string, map[string]string) *goovn.OvnCommand); ok {\n\t\tr0 = rf(name, addrs, external_ids)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*goovn.OvnCommand)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string, []string, map[string]string) error); ok {\n\t\tr1 = rf(name, addrs, external_ids)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "b7aef34ba825bb10012f4739b686ece4", "score": "0.6454993", "text": "func (_m *MockClient) Update(ctx context.Context, groupID string, name string, parentID string, individual bool) error {\n\tret := _m.Called(ctx, groupID, name, parentID, individual)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, string, string, string, bool) error); ok {\n\t\tr0 = rf(ctx, groupID, name, parentID, individual)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "bfece1391ce733f6ac78bd31b65b192e", "score": "0.64533967", "text": "func (m *MockRepository) UpdateField(where []contractModel.Contract, fields ...string) error {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{where}\n\tfor _, a := range fields {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateField\", varargs...)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "6bbc27288c0d591b42bccf8e80f956f3", "score": "0.6433739", "text": "func (_m *Repo) Update(revision int64, post model.BlogPost) (model.BlogPost, error) {\n\tret := _m.Called(revision, post)\n\n\tvar r0 model.BlogPost\n\tif rf, ok := ret.Get(0).(func(int64, model.BlogPost) model.BlogPost); ok {\n\t\tr0 = rf(revision, post)\n\t} else {\n\t\tr0 = ret.Get(0).(model.BlogPost)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(int64, model.BlogPost) error); ok {\n\t\tr1 = rf(revision, post)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "c2d033a16db64b8d1288c88c19425e6f", "score": "0.6428572", "text": "func (_m *Users) Update(user *gonextcloud.UserDetails) error {\n\tret := _m.Called(user)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*gonextcloud.UserDetails) error); ok {\n\t\tr0 = rf(user)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "f5cbdbca9391461268aeef98f95d3a4f", "score": "0.64278513", "text": "func (_m *Database) Update(_a0 func(*bbolt.Tx) error) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(func(*bbolt.Tx) error) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "72fe4b0ac1afb46e5612a24f619c9a36", "score": "0.6413978", "text": "func (_m *Repository) Update(ctx context.Context, value db_repo.ModelBased) error {\n\tret := _m.Called(ctx, value)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, db_repo.ModelBased) error); ok {\n\t\tr0 = rf(ctx, value)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "d0c1307b9125de13ead9e66d47ef99f2", "score": "0.64105064", "text": "func (_m *MockService) Update(_a0 *User) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*User) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "a7036e5f381750261f8811c4f9a2941f", "score": "0.6405154", "text": "func (_m *ClientRepo) Update(newClient *model.Client) error {\n\tret := _m.Called(newClient)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*model.Client) error); ok {\n\t\tr0 = rf(newClient)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "9abd71b827e423b1c8daf9d68052bfb5", "score": "0.63922834", "text": "func (_m *TodoUsecase) Update(_a0 *domain.Todo) *domain.RestErr {\n\tret := _m.Called(_a0)\n\n\tvar r0 *domain.RestErr\n\tif rf, ok := ret.Get(0).(func(*domain.Todo) *domain.RestErr); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*domain.RestErr)\n\t\t}\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "7c41a5597f8d50dc47148849a88d6673", "score": "0.638566", "text": "func (_m *Record) Update(address common.Address, account api.Account) error {\n\tret := _m.Called(address, account)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(common.Address, api.Account) error); ok {\n\t\tr0 = rf(address, account)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "6d7daf8c939e5eeb10169a824fba0a0c", "score": "0.6373121", "text": "func (_m *ITenantService) Update(form *model.TenantForm, id int) (*model.TenantDto, error) {\n\tret := _m.Called(form, id)\n\n\tvar r0 *model.TenantDto\n\tif rf, ok := ret.Get(0).(func(*model.TenantForm, int) *model.TenantDto); ok {\n\t\tr0 = rf(form, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*model.TenantDto)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*model.TenantForm, int) error); ok {\n\t\tr1 = rf(form, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "0109c205521be073abf00d8045259346", "score": "0.63392526", "text": "func (_m *Usecase) Update(ctx context.Context, ar *models.Transaction) error {\n\tret := _m.Called(ctx, ar)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *models.Transaction) error); ok {\n\t\tr0 = rf(ctx, ar)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "f169c2382ff3c5d70e5e9d98538157cf", "score": "0.62946963", "text": "func TestUpdateMetaField(t *testing.T) {\n\t//Initialize Global Variables (Mocks)\n\tmockCtrl := gomock.NewController(t)\n\tdefer mockCtrl.Finish()\n\tormerMock := beego.NewMockOrmer(mockCtrl)\n\tquerySeterMock := beego.NewMockQuerySeter(mockCtrl)\n\tdbm.DBAccess = ormerMock\n\n\tcases := []struct {\n\t\t// name is name of the testcase\n\t\tname string\n\t\t// filterReturn is the return of mock interface querySeterMock's filter function\n\t\tfilterReturn orm.QuerySeter\n\t\t// updateReturnInt is the first return of mock interface querySeterMock's update function\n\t\tupdateReturnInt int64\n\t\t// updateReturnErr is the second return of mock interface querySeterMocks's update function also expected error\n\t\tupdateReturnErr error\n\t\t// queryTableReturn is the return of mock interface ormerMock's QueryTable function\n\t\tqueryTableReturn orm.QuerySeter\n\t}{{\n\t\t// Success Case\n\t\tname: \"SuccessCase\",\n\t\tfilterReturn: querySeterMock,\n\t\tupdateReturnInt: int64(1),\n\t\tupdateReturnErr: nil,\n\t\tqueryTableReturn: querySeterMock,\n\t}, {\n\t\t// Failure Case\n\t\tname: \"FailureCase\",\n\t\tfilterReturn: querySeterMock,\n\t\tupdateReturnInt: int64(0),\n\t\tupdateReturnErr: errFailedDBOperation,\n\t\tqueryTableReturn: querySeterMock,\n\t},\n\t}\n\n\t// run the test cases\n\tfor _, test := range cases {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tquerySeterMock.EXPECT().Filter(gomock.Any(), gomock.Any()).Return(test.filterReturn).Times(1)\n\t\t\tquerySeterMock.EXPECT().Update(gomock.Any()).Return(test.updateReturnInt, test.updateReturnErr).Times(1)\n\t\t\tormerMock.EXPECT().QueryTable(gomock.Any()).Return(test.queryTableReturn).Times(1)\n\t\t\terr := UpdateMetaField(\"test\", \"test\", \"test\")\n\t\t\tif test.updateReturnErr != err {\n\t\t\t\tt.Errorf(\"Update Meta Field Case failed : wanted %v and got %v\", test.updateReturnErr, err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "11c948a43e5011574f1145254b41bf8d", "score": "0.62940675", "text": "func (_m *MockWidgetsServer) Update(_a0 context.Context, _a1 *UpdateRequest) (*Widget, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *Widget\n\tif rf, ok := ret.Get(0).(func(context.Context, *UpdateRequest) *Widget); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*Widget)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *UpdateRequest) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "a2135b84e7a20f67c2b33d1e9a647486", "score": "0.627439", "text": "func (_m *MockService) Update(user *User) (*User, error) {\n\tret := _m.Called(user)\n\n\tvar r0 *User\n\tif rf, ok := ret.Get(0).(func(*User) *User); ok {\n\t\tr0 = rf(user)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*User)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*User) error); ok {\n\t\tr1 = rf(user)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "40318134f777817f9f58f52d6609d50a", "score": "0.62725466", "text": "func (_m *FileProcessingService) UpdateFileMetadata(ctx context.Context, metadata map[string]interface{}, id string) error {\n\tret := _m.Called(ctx, metadata, id)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}, string) error); ok {\n\t\tr0 = rf(ctx, metadata, id)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "80928d66dc4b6f20cff6389b35c504c2", "score": "0.6259495", "text": "func (m *ManagerMock) Update(ctx context.Context, r *hub.Repository) error {\n\targs := m.Called(ctx, r)\n\treturn args.Error(0)\n}", "title": "" }, { "docid": "0b46381240a3e3f601efabca3126d7fb", "score": "0.624918", "text": "func (m *MockMethodRepo) Update(ctx context.Context, id uint64, value string) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", ctx, id, value)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "5d055081fdae311c1db5e70446eac53e", "score": "0.62382054", "text": "func (m *MockGenreDB) Update(id uuid.UUID, fields []string, values ...interface{}) error {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{id, fields}\n\tfor _, a := range values {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"Update\", varargs...)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "5086128a18cb4b868342103a49e06088", "score": "0.6209513", "text": "func (_m *ITenantRepo) Update(form *model.TenantForm, id int) (*model.Tenant, error) {\n\tret := _m.Called(form, id)\n\n\tvar r0 *model.Tenant\n\tif rf, ok := ret.Get(0).(func(*model.TenantForm, int) *model.Tenant); ok {\n\t\tr0 = rf(form, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*model.Tenant)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*model.TenantForm, int) error); ok {\n\t\tr1 = rf(form, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "d600f119f8ad6c01588d5cbce40321ed", "score": "0.62063146", "text": "func (_m *DataStore) Update(ctx context.Context, image *model.Image) (bool, error) {\n\tret := _m.Called(ctx, image)\n\n\tvar r0 bool\n\tif rf, ok := ret.Get(0).(func(context.Context, *model.Image) bool); ok {\n\t\tr0 = rf(ctx, image)\n\t} else {\n\t\tr0 = ret.Get(0).(bool)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *model.Image) error); ok {\n\t\tr1 = rf(ctx, image)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "b48da60ffda7963960a87425091eee1f", "score": "0.6199223", "text": "func (_m *BaseClientAPI) UpdateAcrRepositoryMetadata(ctx context.Context, name string, metadata string, value *interface{}) (autorest.Response, error) {\n\tret := _m.Called(ctx, name, metadata, value)\n\n\tvar r0 autorest.Response\n\tif rf, ok := ret.Get(0).(func(context.Context, string, string, *interface{}) autorest.Response); ok {\n\t\tr0 = rf(ctx, name, metadata, value)\n\t} else {\n\t\tr0 = ret.Get(0).(autorest.Response)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string, string, *interface{}) error); ok {\n\t\tr1 = rf(ctx, name, metadata, value)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "7cd86e4b3b678bd4e1d810a8bc1561c0", "score": "0.61884314", "text": "func (_m *ApplicationService) Update(ctx context.Context, id string, in model.ApplicationUpdateInput) error {\n\tret := _m.Called(ctx, id, in)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, string, model.ApplicationUpdateInput) error); ok {\n\t\tr0 = rf(ctx, id, in)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "6ed71c800e2ba3b72d1ea9f6b8087751", "score": "0.6186669", "text": "func (m *MockClientInterface) UpdateMigrationWithBody(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, userId, contentType, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateMigrationWithBody\", varargs...)\n\tret0, _ := ret[0].(*http.Response)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d796be6f146fa7cfdf936103c898129d", "score": "0.6176318", "text": "func (m *MockArticleUsecase) Update(arg0 *article.Article) (*article.Article, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(*article.Article)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "ac74d6157e5f5b2b423dbdef7370814b", "score": "0.6174247", "text": "func (_m *OperationService) Update(ctx context.Context, input *model.Operation) error {\n\tret := _m.Called(ctx, input)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *model.Operation) error); ok {\n\t\tr0 = rf(ctx, input)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "4e51ca508ead49a70943db58fa8e0510", "score": "0.6168368", "text": "func (m *MockClientWithResponsesInterface) UpdateMigrationWithBodyWithResponse(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, userId, contentType, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateMigrationWithBodyWithResponse\", varargs...)\n\tret0, _ := ret[0].(*UpdateMigrationResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "9caf2f8a0d3e0dbf10e4892a9db92ec1", "score": "0.6166923", "text": "func (_m *MockAPIInterface) updateObject(dn string, classes []string, added map[string][]string, changed map[string][]string, removed map[string][]string) error {\n\tret := _m.Called(dn, classes, added, changed, removed)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, []string, map[string][]string, map[string][]string, map[string][]string) error); ok {\n\t\tr0 = rf(dn, classes, added, changed, removed)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "caa171f5377ee31426097baa1ac9f82f", "score": "0.6145345", "text": "func TestUpdateMetaFields(t *testing.T) {\n\t//Initialize Global Variables (Mocks)\n\tmockCtrl := gomock.NewController(t)\n\tdefer mockCtrl.Finish()\n\tormerMock := beego.NewMockOrmer(mockCtrl)\n\tquerySeterMock := beego.NewMockQuerySeter(mockCtrl)\n\tdbm.DBAccess = ormerMock\n\n\tcases := []struct {\n\t\t// name is name of the testcase\n\t\tname string\n\t\t// filterReturn is the return of mock interface querySeterMock's filter function\n\t\tfilterReturn orm.QuerySeter\n\t\t// updateReturnInt is the first return of mock interface querySeterMock's update function\n\t\tupdateReturnInt int64\n\t\t// updateReturnErr is the second return of mock interface querySeterMocks's update function also expected error\n\t\tupdateReturnErr error\n\t\t// queryTableReturn is the return of mock interface ormerMock's QueryTable function\n\t\tqueryTableReturn orm.QuerySeter\n\t}{{\n\t\t// Success Case\n\t\tname: \"SuccessCase\",\n\t\tfilterReturn: querySeterMock,\n\t\tupdateReturnInt: int64(1),\n\t\tupdateReturnErr: nil,\n\t\tqueryTableReturn: querySeterMock,\n\t}, {\n\t\t// Failure Case\n\t\tname: \"FailureCase\",\n\t\tfilterReturn: querySeterMock,\n\t\tupdateReturnInt: int64(0),\n\t\tupdateReturnErr: errFailedDBOperation,\n\t\tqueryTableReturn: querySeterMock,\n\t},\n\t}\n\n\t// run the test cases\n\tfor _, test := range cases {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tquerySeterMock.EXPECT().Filter(gomock.Any(), gomock.Any()).Return(test.filterReturn).Times(1)\n\t\t\tquerySeterMock.EXPECT().Update(gomock.Any()).Return(test.updateReturnInt, test.updateReturnErr).Times(1)\n\t\t\tormerMock.EXPECT().QueryTable(gomock.Any()).Return(test.queryTableReturn).Times(1)\n\t\t\terr := UpdateMetaFields(\"test\", nil)\n\n\t\t\tif test.updateReturnErr != err {\n\t\t\t\tt.Errorf(\"Update Meta Fields Case failed : wanted %v and got %v\", test.updateReturnErr, err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "a50dee704a70f887d5f10f1a5f4eb166", "score": "0.6133774", "text": "func (_m *Handler) PromiseUpdate(ctx context.Context, id uuid.UUID, fieldsToUpdate map[domain.PromiseUpdateProperty]interface{}) (*domain.Promise, error) {\n\tret := _m.Called(ctx, id, fieldsToUpdate)\n\n\tvar r0 *domain.Promise\n\tif rf, ok := ret.Get(0).(func(context.Context, uuid.UUID, map[domain.PromiseUpdateProperty]interface{}) *domain.Promise); ok {\n\t\tr0 = rf(ctx, id, fieldsToUpdate)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*domain.Promise)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, uuid.UUID, map[domain.PromiseUpdateProperty]interface{}) error); ok {\n\t\tr1 = rf(ctx, id, fieldsToUpdate)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "4abce565ba20ddb242140ce4db778de1", "score": "0.61325294", "text": "func (m *MockDatastore) Update(arg0 string, arg1 *dao.Post) (*dao.Post, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1)\n\tret0, _ := ret[0].(*dao.Post)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "575ac467d01b6f1b41bbd11243be59e8", "score": "0.6128391", "text": "func (_m *Repository) Update(product *products.Domain, id int) (*products.Domain, error) {\n\tret := _m.Called(product, id)\n\n\tvar r0 *products.Domain\n\tif rf, ok := ret.Get(0).(func(*products.Domain, int) *products.Domain); ok {\n\t\tr0 = rf(product, id)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*products.Domain)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*products.Domain, int) error); ok {\n\t\tr1 = rf(product, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "ff39997270e7672e839aecd242f67d77", "score": "0.61208665", "text": "func (m *MockPostRepository) UpdateByPrimaryKey(postID int, content string) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"UpdateByPrimaryKey\", postID, content)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "4bd902924cf66bdd64e132a33ab0c3e2", "score": "0.61179924", "text": "func (_m *SessionStorage) Update(ctx context.Context, session *model.Session) error {\n\tret := _m.Called(ctx, session)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *model.Session) error); ok {\n\t\tr0 = rf(ctx, session)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "c9fe216e458dd1b33904ca5dc2236f5c", "score": "0.61108845", "text": "func (_m *IRateExtranetRepository) Update(data *models.RateExtranet, m *models.RateExtranet) (*models.RateExtranet, error) {\n\tret := _m.Called(data, m)\n\n\tvar r0 *models.RateExtranet\n\tif rf, ok := ret.Get(0).(func(*models.RateExtranet, *models.RateExtranet) *models.RateExtranet); ok {\n\t\tr0 = rf(data, m)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.RateExtranet)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*models.RateExtranet, *models.RateExtranet) error); ok {\n\t\tr1 = rf(data, m)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "0d599fde0c758174e97fc79087dc6b87", "score": "0.609041", "text": "func (_m *UserRepository) Update(ctx context.Context, _a1 user.User) error {\n\tret := _m.Called(ctx, _a1)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, user.User) error); ok {\n\t\tr0 = rf(ctx, _a1)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "a31cfb5acae021c8bc748fb492286377", "score": "0.6087486", "text": "func (_m *AlbumServiceServer) Update(_a0 context.Context, _a1 *proto.AlbumRequest) (*proto.AlbumResponse, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *proto.AlbumResponse\n\tif rf, ok := ret.Get(0).(func(context.Context, *proto.AlbumRequest) *proto.AlbumResponse); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*proto.AlbumResponse)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *proto.AlbumRequest) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "057db1a6c52b4db28152194a7753e324", "score": "0.6083703", "text": "func (m *MockStore) Update(arg0 Contact) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "8fc750a467b7f6b1ba163093a0973acb", "score": "0.6079038", "text": "func (_m *ReacjiStore) Update(prev *reacji.List, new *reacji.List) error {\n\tret := _m.Called(prev, new)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*reacji.List, *reacji.List) error); ok {\n\t\tr0 = rf(prev, new)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "072258a1e1b26231f9b3574591535973", "score": "0.60775745", "text": "func (m *MockImpl) Update(arg0 context.Context, arg1, arg2 string, arg3 []byte, arg4 topo.Version) (topo.Version, error) {\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1, arg2, arg3, arg4)\n\tret0, _ := ret[0].(topo.Version)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "072258a1e1b26231f9b3574591535973", "score": "0.60775745", "text": "func (m *MockImpl) Update(arg0 context.Context, arg1, arg2 string, arg3 []byte, arg4 topo.Version) (topo.Version, error) {\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1, arg2, arg3, arg4)\n\tret0, _ := ret[0].(topo.Version)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "69e5ccd9ddd4239514d89cb9f5545ca4", "score": "0.6060058", "text": "func (_m *Servicer) Update(ID string, data *account.Account) (*account.Account, error) {\n\tret := _m.Called(ID, data)\n\n\tvar r0 *account.Account\n\tif rf, ok := ret.Get(0).(func(string, *account.Account) *account.Account); ok {\n\t\tr0 = rf(ID, data)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*account.Account)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(string, *account.Account) error); ok {\n\t\tr1 = rf(ID, data)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "5764542e0b88b28d6a4da8cce5f6452e", "score": "0.60564435", "text": "func (_m *UseCase) UpdateById(_a0 uint, _a1 *entities.User) (*entities.User, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *entities.User\n\tif rf, ok := ret.Get(0).(func(uint, *entities.User) *entities.User); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*entities.User)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(uint, *entities.User) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "a5e1fffd9461dc67fca15ec707eb1eb9", "score": "0.60522383", "text": "func (_m *Repository) Update(_a0 *model.Profile) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(*model.Profile) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "709b6d20493761adcaac8ab29330363f", "score": "0.6049855", "text": "func (m *MockClientWithResponsesInterface) UpdateMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, userId, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateMigrationWithResponse\", varargs...)\n\tret0, _ := ret[0].(*UpdateMigrationResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "5375f4670abb39cb364a035a7277b3dc", "score": "0.6048628", "text": "func TestUpdateMeta(t *testing.T) {\n\t//Initialize Global Variables (Mocks)\n\tmockCtrl := gomock.NewController(t)\n\tdefer mockCtrl.Finish()\n\tormerMock := beego.NewMockOrmer(mockCtrl)\n\tdbm.DBAccess = ormerMock\n\n\tcases := []struct {\n\t\t// name is name of the testcase\n\t\tname string\n\t\t// returnInt is first return of mock interface ormerMock\n\t\treturnInt int64\n\t\t// returnErr is second return of mock interface ormerMock which is also expected error\n\t\treturnErr error\n\t}{{\n\t\t// Success Case\n\t\tname: \"SuccessCase\",\n\t\treturnInt: int64(1),\n\t\treturnErr: nil,\n\t}, {\n\t\t// Failure Case\n\t\tname: \"FailureCase\",\n\t\treturnInt: int64(0),\n\t\treturnErr: errFailedDBOperation,\n\t},\n\t}\n\n\t// run the test cases\n\tfor _, test := range cases {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tormerMock.EXPECT().Update(gomock.Any(), gomock.Any()).Return(test.returnInt, test.returnErr).Times(1)\n\t\t\terr := UpdateMeta(&meta)\n\t\t\tif test.returnErr != err {\n\t\t\t\tt.Errorf(\"Update Meta Case failed : wanted %v and got %v\", test.returnErr, err)\n\t\t\t}\n\t\t})\n\t}\n}", "title": "" }, { "docid": "14353d21ff5d9ec58757507f628de456", "score": "0.6045448", "text": "func (_m *BannerGateway) UpdateBanner(ctx context.Context, _a1 model.Banner) (int64, error) {\n\tret := _m.Called(ctx, _a1)\n\n\tvar r0 int64\n\tif rf, ok := ret.Get(0).(func(context.Context, model.Banner) int64); ok {\n\t\tr0 = rf(ctx, _a1)\n\t} else {\n\t\tr0 = ret.Get(0).(int64)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, model.Banner) error); ok {\n\t\tr1 = rf(ctx, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "a2c8a5ccd69b18457b82a2949f53342a", "score": "0.60299474", "text": "func (_m *MockSKUDataAccess) Update(_param0 string, _param1 int) error {\n\tret := _m.ctrl.Call(_m, \"Update\", _param0, _param1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "5ab5b5945f9fa904e1ecb989e9d3b262", "score": "0.6026527", "text": "func (_e *Repository_Expecter) Update(ctx interface{}, value interface{}) *Repository_Update_Call {\n\treturn &Repository_Update_Call{Call: _e.mock.On(\"Update\", ctx, value)}\n}", "title": "" }, { "docid": "1f7ecde79274fd44e2340713b653856f", "score": "0.60258645", "text": "func (_m *IProductRepository) Update(ctx context.Context, product *model.Product) error {\n\tret := _m.Called(ctx, product)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *model.Product) error); ok {\n\t\tr0 = rf(ctx, product)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "4eead5c4b197ba06ed041654efd7a648", "score": "0.60172695", "text": "func (m *MockQuerySet) Update(arg0 interface{}) error {\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "cebc0971459180e3b41dd65dd6294b66", "score": "0.6013151", "text": "func (m *MockStore) Update(arg0 *models.Rec) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "bb90ce6b666c7aa9bcef31f5a4ce2e86", "score": "0.6010515", "text": "func (m *MockQuerySeter) Update(arg0 orm.Params) (int64, error) {\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(int64)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "d435355f1fb25aeb988f14c7e319c0a7", "score": "0.6007641", "text": "func (_m *Users) UpdateWebSite(name string, website string) error {\n\tret := _m.Called(name, website)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(string, string) error); ok {\n\t\tr0 = rf(name, website)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "94b859040eded774d2f3e0f5e7305df9", "score": "0.60030925", "text": "func (_m *MetaDAO) Update(ctx context.Context, oidcUser *models.OIDCUser, props ...string) error {\n\t_va := make([]interface{}, len(props))\n\tfor _i := range props {\n\t\t_va[_i] = props[_i]\n\t}\n\tvar _ca []interface{}\n\t_ca = append(_ca, ctx, oidcUser)\n\t_ca = append(_ca, _va...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *models.OIDCUser, ...string) error); ok {\n\t\tr0 = rf(ctx, oidcUser, props...)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "d3db2516791c67fb2f51409ffa4c876b", "score": "0.5999316", "text": "func (m *MockForUsecase) Update(arg0 uint, arg1 *model_of_person.PersonRequest) int {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1)\n\tret0, _ := ret[0].(int)\n\treturn ret0\n}", "title": "" }, { "docid": "250bd676529dea770f4ea67cc677d13b", "score": "0.5994276", "text": "func (_m *ServiceInterface) UpdateDocument(filterObject interface{}, operation string, update map[string]interface{}) (int64, error) {\n\tret := _m.Called(filterObject, operation, update)\n\n\tvar r0 int64\n\tif rf, ok := ret.Get(0).(func(interface{}, string, map[string]interface{}) int64); ok {\n\t\tr0 = rf(filterObject, operation, update)\n\t} else {\n\t\tr0 = ret.Get(0).(int64)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(interface{}, string, map[string]interface{}) error); ok {\n\t\tr1 = rf(filterObject, operation, update)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "255aa4523ab9c3b2cd58d527c5fc2e91", "score": "0.5986248", "text": "func (_m *ArticlesRepository) UpdateArticle(_a0 *models.Article) (*models.Article, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 *models.Article\n\tif rf, ok := ret.Get(0).(func(*models.Article) *models.Article); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.Article)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*models.Article) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "3cb78cd8207a6b4532dbcf4d552e53d1", "score": "0.5970783", "text": "func (_m *GdbcTemplate) Update(sqlstr string, args ...interface{}) (sql.Result, error) {\n\tvar _ca []interface{}\n\t_ca = append(_ca, sqlstr)\n\t_ca = append(_ca, args...)\n\tret := _m.Called(_ca...)\n\n\tvar r0 sql.Result\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func(string, ...interface{}) (sql.Result, error)); ok {\n\t\treturn rf(sqlstr, args...)\n\t}\n\tif rf, ok := ret.Get(0).(func(string, ...interface{}) sql.Result); ok {\n\t\tr0 = rf(sqlstr, args...)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(sql.Result)\n\t\t}\n\t}\n\n\tif rf, ok := ret.Get(1).(func(string, ...interface{}) error); ok {\n\t\tr1 = rf(sqlstr, args...)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "038b8829796ff2fe1fa16eec513e3710", "score": "0.59669316", "text": "func (_m *BaseClientAPI) UpdateAcrManifestMetadata(ctx context.Context, name string, reference string, metadata string, value *interface{}) (autorest.Response, error) {\n\tret := _m.Called(ctx, name, reference, metadata, value)\n\n\tvar r0 autorest.Response\n\tif rf, ok := ret.Get(0).(func(context.Context, string, string, string, *interface{}) autorest.Response); ok {\n\t\tr0 = rf(ctx, name, reference, metadata, value)\n\t} else {\n\t\tr0 = ret.Get(0).(autorest.Response)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, string, string, string, *interface{}) error); ok {\n\t\tr1 = rf(ctx, name, reference, metadata, value)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "50c68d1229c887c9b17e6674ae30cdcf", "score": "0.5959726", "text": "func (_m *PowerControllerServiceI) Update(_a0 service.ToggleApplianceRequest) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(service.ToggleApplianceRequest) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "307d5e4953f4da923485f6d3745bf594", "score": "0.59561694", "text": "func (_m *Repository) UpdateSurveyTemplate(ctx context.Context, _a1 string, id int) error {\n\tret := _m.Called(ctx, _a1, id)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, string, int) error); ok {\n\t\tr0 = rf(ctx, _a1, id)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "f99cc38d9b346d8b6b41a8fb6c9e1c9e", "score": "0.5953472", "text": "func (_m *Usecase) Update(ctx context.Context, domain *users.Domain, id uint) (users.Domain, error) {\n\tret := _m.Called(ctx, domain, id)\n\n\tvar r0 users.Domain\n\tif rf, ok := ret.Get(0).(func(context.Context, *users.Domain, uint) users.Domain); ok {\n\t\tr0 = rf(ctx, domain, id)\n\t} else {\n\t\tr0 = ret.Get(0).(users.Domain)\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *users.Domain, uint) error); ok {\n\t\tr1 = rf(ctx, domain, id)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "307f2e22caf476d4698a69571e8e9c93", "score": "0.5943616", "text": "func (_m *ILogVoucher) Update(voucher entities.LogUserVoucher) error {\n\tret := _m.Called(voucher)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(entities.LogUserVoucher) error); ok {\n\t\tr0 = rf(voucher)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "ebbac7f99e3a2ccbdf0f2d3ebab80b8a", "score": "0.594235", "text": "func (m *MockClientWithResponsesInterface) UpdateEHRSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, contentType, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateEHRSettingsWithBodyWithResponse\", varargs...)\n\tret0, _ := ret[0].(*UpdateEHRSettingsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "7b1bb90a7ec07c56d516435aa5c34b7e", "score": "0.5938327", "text": "func (_m *Usecase) Update(ctx context.Context, f *models.NewCommandInclude,token string)(*models.ResponseDelete,error) {\n\tret := _m.Called(ctx, f,token)\n\n\tvar r0 *models.ResponseDelete\n\tif rf, ok := ret.Get(0).(func(context.Context, *models.NewCommandInclude,string) *models.ResponseDelete); ok {\n\t\tr0 = rf(ctx, f,token)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.ResponseDelete)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *models.NewCommandInclude,string) error); ok {\n\t\tr1 = rf(ctx, f,token)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "1d7ee06723871e32542c98ec1c0d0e67", "score": "0.59308004", "text": "func (m *MockClientWithResponsesInterface) UpdateEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateEHRSettingsWithResponse\", varargs...)\n\tret0, _ := ret[0].(*UpdateEHRSettingsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "21cb2462ee504d45a51a33a4d625d1ed", "score": "0.5929147", "text": "func (_m *Delivery) UpdateItem(_a0 echo.Context) error {\n\tret := _m.Called(_a0)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(echo.Context) error); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "946599132e3e0cedadb4743ad856e9ea", "score": "0.59288967", "text": "func (_m *TenantServiceServer) Update(_a0 context.Context, _a1 *v1.TenantUpdateRequest) (*v1.TenantResponse, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *v1.TenantResponse\n\tvar r1 error\n\tif rf, ok := ret.Get(0).(func(context.Context, *v1.TenantUpdateRequest) (*v1.TenantResponse, error)); ok {\n\t\treturn rf(_a0, _a1)\n\t}\n\tif rf, ok := ret.Get(0).(func(context.Context, *v1.TenantUpdateRequest) *v1.TenantResponse); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*v1.TenantResponse)\n\t\t}\n\t}\n\n\tif rf, ok := ret.Get(1).(func(context.Context, *v1.TenantUpdateRequest) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "ecb75beb9cf58b740e06113670a82df5", "score": "0.5928196", "text": "func (_m *MongoCollection) Update(selector interface{}, update interface{}) error {\n\tret := _m.Called(selector, update)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(interface{}, interface{}) error); ok {\n\t\tr0 = rf(selector, update)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "5a90e7963eec7cd412988baf491c5782", "score": "0.5924898", "text": "func (m *MockEntityRepository) Update(arg0 database.Base) (int, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(int)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "4ef9f7fb60b557538f092be4054d1b4e", "score": "0.5923187", "text": "func (_m *Service) Update(_a0 *waste.DomainWaste) (*waste.DomainWaste, error) {\n\tret := _m.Called(_a0)\n\n\tvar r0 *waste.DomainWaste\n\tif rf, ok := ret.Get(0).(func(*waste.DomainWaste) *waste.DomainWaste); ok {\n\t\tr0 = rf(_a0)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*waste.DomainWaste)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(*waste.DomainWaste) error); ok {\n\t\tr1 = rf(_a0)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "96201999a73ecb425e73107f84144e6d", "score": "0.59208375", "text": "func (m *MockTableAble) Update(arg0 RowFilter, arg1 map[string]interface{}) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "724cc070f5e5d95457f8a60bba33b9d9", "score": "0.5914502", "text": "func (m *MockMessageUseCase) Update(ctx context.Context, entity *model.Message) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", ctx, entity)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "dcfba0a23090edfea8baf7ca1336d334", "score": "0.5911862", "text": "func (m *MockTransaction) Update(arg0 *schema.Resource) error {\n\tret := m.ctrl.Call(m, \"Update\", arg0)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "0354adfbff1aa8bcd1d640193e8b94a5", "score": "0.5909691", "text": "func (_m *MockCollection) UpdateOne(_a0 context.Context, _a1 interface{}, _a2 interface{}) error {\n\tret := _m.Called(_a0, _a1, _a2)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(context.Context, interface{}, interface{}) error); ok {\n\t\tr0 = rf(_a0, _a1, _a2)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "1b5c0e1662d3251a315c252304b3f881", "score": "0.59082836", "text": "func (_m *Client) UpdateBuildFileAvailability(buildFileID int32, availability string) (*models.BuildFile, error) {\n\tret := _m.Called(buildFileID, availability)\n\n\tvar r0 *models.BuildFile\n\tif rf, ok := ret.Get(0).(func(int32, string) *models.BuildFile); ok {\n\t\tr0 = rf(buildFileID, availability)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*models.BuildFile)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(int32, string) error); ok {\n\t\tr1 = rf(buildFileID, availability)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "84ea790c61e3d6b5f912edf4d72495ae", "score": "0.5900638", "text": "func (_m *UsersServer) Update(_a0 context.Context, _a1 *userspb.UpdateRequest) (*userspb.UpdateResponse, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *userspb.UpdateResponse\n\tif rf, ok := ret.Get(0).(func(context.Context, *userspb.UpdateRequest) *userspb.UpdateResponse); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*userspb.UpdateResponse)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(context.Context, *userspb.UpdateRequest) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "51de2ec6c3131bae353566272c9e0ca1", "score": "0.58987606", "text": "func (m *MockRepository) Update(rest *models.Restaurant) error {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", rest)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" }, { "docid": "7f2423af357708e76a21e46816917bb1", "score": "0.5895523", "text": "func (_m *MockClient) UpdateOrganization(_a0 int64, _a1 *Organization) (*Organization, error) {\n\tret := _m.Called(_a0, _a1)\n\n\tvar r0 *Organization\n\tif rf, ok := ret.Get(0).(func(int64, *Organization) *Organization); ok {\n\t\tr0 = rf(_a0, _a1)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*Organization)\n\t\t}\n\t}\n\n\tvar r1 error\n\tif rf, ok := ret.Get(1).(func(int64, *Organization) error); ok {\n\t\tr1 = rf(_a0, _a1)\n\t} else {\n\t\tr1 = ret.Error(1)\n\t}\n\n\treturn r0, r1\n}", "title": "" }, { "docid": "98edf9f79459c57cca4eb2ca25bf17dd", "score": "0.58908117", "text": "func (m *MockClientInterface) UpdateMigration(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, userId, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateMigration\", varargs...)\n\tret0, _ := ret[0].(*http.Response)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "072b9e812ba173593e52eebc653abb1c", "score": "0.5884578", "text": "func (_m *Service) UpdateUser(id int, name string, modifiedBy string, currentVersion int) error {\n\tret := _m.Called(id, name, modifiedBy, currentVersion)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(int, string, string, int) error); ok {\n\t\tr0 = rf(id, name, modifiedBy, currentVersion)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "0ec901f4068b9beb37a81afa5b8ae18e", "score": "0.58785677", "text": "func (m *MockCustomResourceDefinitionInterface) Update(arg0 context.Context, arg1 *v1.CustomResourceDefinition, arg2 v10.UpdateOptions) (*v1.CustomResourceDefinition, error) {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1, arg2)\n\tret0, _ := ret[0].(*v1.CustomResourceDefinition)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "cf42c5f47eea97e67095fa98238a637f", "score": "0.58680207", "text": "func (_m *Manager) Update(policy ladon.Policy) error {\n\tret := _m.Called(policy)\n\n\tvar r0 error\n\tif rf, ok := ret.Get(0).(func(ladon.Policy) error); ok {\n\t\tr0 = rf(policy)\n\t} else {\n\t\tr0 = ret.Error(0)\n\t}\n\n\treturn r0\n}", "title": "" }, { "docid": "8b9f242db44d1875522b895d479615c7", "score": "0.5865142", "text": "func (m *MockClientWithResponsesInterface) UpdateMRNSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) {\n\tm.ctrl.T.Helper()\n\tvarargs := []interface{}{ctx, clinicId, contentType, body}\n\tfor _, a := range reqEditors {\n\t\tvarargs = append(varargs, a)\n\t}\n\tret := m.ctrl.Call(m, \"UpdateMRNSettingsWithBodyWithResponse\", varargs...)\n\tret0, _ := ret[0].(*UpdateMRNSettingsResponse)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}", "title": "" }, { "docid": "0cab6f6a6b65735559db706038d0376d", "score": "0.58565897", "text": "func (m *MockIBaseDb) Update(arg0, arg1 interface{}) error {\n\tret := m.ctrl.Call(m, \"Update\", arg0, arg1)\n\tret0, _ := ret[0].(error)\n\treturn ret0\n}", "title": "" } ]
194ee7758bb37ea8a07ca139f5b39dfa
Init initializes a connection to the database
[ { "docid": "45875e195bc166a052966a78b12ecea3", "score": "0.0", "text": "func Init(url string) {\r\n\tvar err error\r\n\tsession, err = r.Connect(r.ConnectOpts{\r\n\t\tAddress: url,\r\n\t\tDatabase: \"recipes\",\r\n\t})\r\n\r\n\tif err != nil {\r\n\t\tfmt.Println(err)\r\n\t}\r\n}", "title": "" } ]
[ { "docid": "391352e68a3183a99de73a270c23a9c0", "score": "0.8042722", "text": "func init() {\n\tdatabaseConnection()\n}", "title": "" }, { "docid": "0af947833eeb24fcfea61d8bc217d631", "score": "0.801814", "text": "func InitDbConnection() {\n\t// when this method is called first time\n\t// the db variable will be set by init() function\n}", "title": "" }, { "docid": "91658830cf7e407b4bfe713ebbf7245c", "score": "0.7853759", "text": "func Init() {\n\n\t// Attempt to load and store the environment variables. Failure here will\n\t// cause a panic - the server can not function if the database's environment variables are not\n\t// present, or could not be loaded properly.\n\terr := envvars.Load()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Based on the environment variables that were loaded above, construct all of the prepared statements that\n\t// the database will use.\n\tpstatements.Construct(&envvars)\n\n\t// Construct the connection string for the database connection.\n\tvar connString = fmt.Sprintf(\"%v:%v@(%v:%v)/%v?tls=skip-verify&parseTime=true\", envvars.DBUsername, envvars.DBPass, envvars.DBURL, envvars.DBPort, envvars.DBName)\n\n\t// Attempt to open the connection based on the connection string above. Failure here will\n\t// cause a panic, as the server cannot function is the database instance is not valid.\n\t// The resultant database object when successful is stored in the instance variable for this package.\n\tdb, err = sql.Open(\"mysql\", connString)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tlog.Println(\"Database connection initiated successfully\")\n}", "title": "" }, { "docid": "903fc23fac089f7fb7d2dfd7ca4ecbc4", "score": "0.7812636", "text": "func Init() {\n\tconnectionString = makeConnectionString()\n\tvar dbErr error\n\tdb, dbErr = gorm.Open(postgres.Open(connectionString), &gorm.Config{\n\t\tLogger: logger.Default.LogMode(logger.Info),\n\t})\n\tif dbErr != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": dbErr.Error(),\n\t\t}).Fatalln(\"failed to connect to the database\")\n\t}\n\n}", "title": "" }, { "docid": "84871c18b76ccb3c961374a6f833f57e", "score": "0.7651583", "text": "func init() {\n\tconfig.Read()\n\n\tdatabase.Server = config.Server\n\tdatabase.Database = config.Database\n\tdatabase.Connect()\n}", "title": "" }, { "docid": "0c6b80c66c607075515540cd58893d92", "score": "0.76294214", "text": "func Init() {\n\tconnectionString := getConnectionString()\n\tdbConnection := os.Getenv(\"DB_CONNECTION\")\n\tdb, err = gorm.Open(dbConnection, connectionString)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.76147956", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.76147956", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "63e21f3de0b462d134abb393364eeb52", "score": "0.76147956", "text": "func init() {\n\tconfig.Read()\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "74d6d372b383c4878eca9c8b130c819e", "score": "0.7529922", "text": "func Initialization(ebus *evbus.EventBus) {\n\treadDBAccountFromDisk(ebus)\n\tlog.Debugln(\"Start connecting to database...\")\n\tdbconn, dberr := sql.Open(\"mysql\", dbaccount.toDSN())\n\tif dberr != nil {\n\t\tlog.FailLn(\"Failed to connect to database:\", dberr.Error())\n\t\tebus.PublishEvent(candies.NewEvent(\"DBConnectFail:\" + dberr.Error()).Type(candies.EventTypeUnrecoverableFail).Fin())\n\t}\n\tDb = dbconn\n\tlog.Debugln(\"Starting database PING...\")\n\tdberr = Db.Ping()\n\tif dberr != nil {\n\t\tlog.FailLn(\"Failed to connect to database:\", dberr.Error())\n\t\tebus.PublishEvent(candies.NewEvent(\"DBConnectFail:\" + dberr.Error()).Type(candies.EventTypeUnrecoverableFail).Fin())\n\t}\n\tlog.Succln(\"Successfully connected to database!\")\n\tlog.Succln(\"Initialization OK\")\n}", "title": "" }, { "docid": "ad65f0cc340819cecfd021e2092cee29", "score": "0.7519949", "text": "func init() {\n\tconf.Read()\n\n\tdao.Server = conf.Server\n\tdao.Database = conf.Database\n\tdao.Connection()\n}", "title": "" }, { "docid": "e502f387a0195c817e567c2e9b0387f1", "score": "0.74893886", "text": "func init() {\n\t// username, password, host, schema name\n\t// this allows us to connect to our mysql db\n\t// may need to make this 127.0.0.1:3006\n\tdataSourceName := fmt.Sprintf(\"%s:%s@tcp(%s)/%s?charset=utf8\", username, password, host, schema)\n\t// we go ahead and make Client and err early, since we only want to create it one time, and to just use it\n\t// everywhere in this file\n\tvar err error\n\tClient, err = sql.Open(\"mysql\", dataSourceName)\n\n\tif err != nil {\n\t\t// this will prevent the app from starting up (as we need this db to make anything in the server to work)\n\t\tpanic(err)\n\t}\n\n\t// pings our db\n\tif err = Client.Ping(); err != nil {\n\t\tpanic(err)\n\t}\n\n\tlog.Println(\"Database successfully configured\")\n}", "title": "" }, { "docid": "b8091c92b7c4f9c1ca7cbe5b9f08dc63", "score": "0.74872077", "text": "func InitConnection() *sql.DB {\n\t// Initializing DB Connection\n\tfmt.Println(\"Initializing DB Connection...\")\n\n\t// Establishing SQLite Connection\n\tdbConnection, _ = sql.Open(\"sqlite3\", \"./storage.sqlite?cache=shared&mode=rwc\")\n\n\t// Returns DB Connection\n\treturn dbConnection\n}", "title": "" }, { "docid": "05299d6a67d2a5605ff0381388e4097e", "score": "0.74779576", "text": "func Init() error {\n\tif database == \"\" {\n\t\treturn ErrNoDatabaseSelected\n\t}\n\terr := Set()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn DefaultDb.Init()\n}", "title": "" }, { "docid": "05299d6a67d2a5605ff0381388e4097e", "score": "0.74779576", "text": "func Init() error {\n\tif database == \"\" {\n\t\treturn ErrNoDatabaseSelected\n\t}\n\terr := Set()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn DefaultDb.Init()\n}", "title": "" }, { "docid": "e6a5d1ef89d21e104e8b9ef5cda68d7c", "score": "0.74629545", "text": "func Init() {\n\tlog.Sugar.Infof(\"Initializing database...\")\n\n\tvar err error\n\tconnStr := fmt.Sprintf(\"postgres://%s:%s@%s:%s/%s?sslmode=disable&binary_parameters=yes\", dbUser, dbPassword, dbNetloc, dbPort, dbName)\n\tif db, err = sql.Open(\"postgres\", connStr); err != nil {\n\t\tlog.Sugar.Errorf(\"Error opening database: %v\", err)\n\t\tpanic(err)\n\t}\n\n\tif err = db.Ping(); err != nil {\n\t\tlog.Sugar.Errorf(\"Error pinging database: %v\", err)\n\t\tpanic(err)\n\t}\n\n\tif dbMaxOpenConnsStr != \"\" {\n\t\tdbMaxOpenConns, err = strconv.Atoi(dbMaxOpenConnsStr)\n\t\tif err != nil {\n\t\t\tlog.Sugar.Errorf(\"Error converting max_open_conns: %v\", err)\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tdb.SetMaxOpenConns(dbMaxOpenConns)\n\n\tif dbMaxIdleConnsStr != \"\" {\n\t\tdbMaxIdleConns, err = strconv.Atoi(dbMaxIdleConnsStr)\n\t\tif err != nil {\n\t\t\tlog.Sugar.Errorf(\"Error converting max_idle_conns: %v\", err)\n\t\t\tpanic(err)\n\t\t}\n\t}\n\tdb.SetMaxIdleConns(dbMaxIdleConns)\n\n\tif dbMaxConnLifetimeStr != \"\" {\n\t\tdbMaxConnLifetimeMin, err := strconv.Atoi(dbMaxConnLifetimeStr)\n\t\tif err != nil {\n\t\t\tlog.Sugar.Errorf(\"Error converting max_conn_lifetime: %v\", err)\n\t\t\tpanic(err)\n\t\t}\n\n\t\tdbMaxConnLifetime = time.Duration(dbMaxConnLifetimeMin) * time.Minute\n\t}\n\tdb.SetConnMaxLifetime(dbMaxConnLifetime)\n}", "title": "" }, { "docid": "f9360b04ba049df9fe945114aab0faf7", "score": "0.74612856", "text": "func Init(config *util.Config) (*DAO, error) {\n\tconnStr := fmt.Sprintf(\"user=%s dbname=%s host=%s sslmode=%s\", config.User, config.DBName, config.Host, config.SSLMode)\n\tdb, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DAO{db}, nil\n}", "title": "" }, { "docid": "f9360b04ba049df9fe945114aab0faf7", "score": "0.74612856", "text": "func Init(config *util.Config) (*DAO, error) {\n\tconnStr := fmt.Sprintf(\"user=%s dbname=%s host=%s sslmode=%s\", config.User, config.DBName, config.Host, config.SSLMode)\n\tdb, err := sql.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DAO{db}, nil\n}", "title": "" }, { "docid": "f51dafc3f798cfd338fe628fc02f208b", "score": "0.74594134", "text": "func init() {\n\tvar err error\n\tconnString := fmt.Sprintf(\"host=%s port=%s user=%s password=%s database=%s\",\n\t\tserver, port, user, password, database)\n\tconnString += \" sslmode=disable\"\n\tfmt.Println(connString)\n\tDb, err = sql.Open(\"postgres\", connString)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\terr = Db.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Successfully connected!\")\n}", "title": "" }, { "docid": "7c5ffb9f5c9161dc5955d08d4b477b5a", "score": "0.74347025", "text": "func (dbO *DatabaseOutput) Init() error {\n\tnumChannels := len(dbO.DataInput)\n\tdbO.wg.Add(numChannels)\n\n\tdb, err := util.GetDBConnection()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdbO.db = db\n\n\tdbO.tables = make(map[string]bool)\n\n\treturn nil\n}", "title": "" }, { "docid": "53a336ce2db400658571b262635a897b", "score": "0.7432187", "text": "func InitDbConnection() * DatabaseContext {\n\tdb, err:= OpenConnection()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable connect to the database, error: %v\", err)\n\t}\n\treturn &DatabaseContext{sqlDb: db}\n}", "title": "" }, { "docid": "ecfb4f3ab911673df57f6e6f911d3a33", "score": "0.7423535", "text": "func Init() *gorm.DB {\n\tpsqlConnectionString := dbURL\n\tif psqlConnectionString == \"\" {\n\t\tpsqlTemplate := \"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\"\n\t\tpsqlConnectionString = fmt.Sprintf(psqlTemplate, host, port, user, password, dbname)\n\t}\n\n\tvar db, err = gorm.Open(\"postgres\", psqlConnectionString)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdb.DB().SetMaxIdleConns(10)\n\n\tDB = db\n\treturn DB\n}", "title": "" }, { "docid": "7100b6d5e1ded9e64bca9084c8e600e2", "score": "0.740185", "text": "func Init(d *sql.DB) {\n\tdb = sqlx.NewDb(d, \"postgres\")\n}", "title": "" }, { "docid": "ef2fb01b50393e2e1e4722727bee4e75", "score": "0.73997194", "text": "func init() {\n\tconfig.Read()\n\n\tdbContext.Server = config.Server\n\tdbContext.Database = config.Database\n\tdbContext.DbUser = config.DbUser\n\tdbContext.DbPassword = config.DbPassword\n\n\tdbContext.Connect()\n}", "title": "" }, { "docid": "02703616cdca2d02773c8bcf5f3e49b9", "score": "0.7389037", "text": "func InitDb(connection string) {\n\tvar err error\n\tdb, err = sql.Open(\"postgres\", connection)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}", "title": "" }, { "docid": "16d682ffe06b60897f5ac59e9c84ec45", "score": "0.73847985", "text": "func init() {\n\tconfig := readConfigs()\n\tserver, database := config[0], config[1]\n\n\tdao.Server = server\n\tdao.Database = database\n\tdao.Connect()\n}", "title": "" }, { "docid": "8ab93ea6b778ff8f2f36406d2e629b82", "score": "0.7322044", "text": "func Init() {\n\tif DB != nil {\n\t\treturn\n\t}\n\tConnect(0)\n\tcore.AutoMigrate(DB)\n}", "title": "" }, { "docid": "32749181978e75e3dbb04addd04b49c0", "score": "0.7316786", "text": "func Init() {\n\t// var err error\n\n\t// db, err = sql.Open(\"postgres\", os.Getenv(\"CONNECTION_STRING\"))\n\t// util.CheckError(err)\n}", "title": "" }, { "docid": "01cf0af1f63a5d7597bc60fdeb910b0e", "score": "0.72972625", "text": "func (db *Database) Init() {\n\n\tdb.CurrentAccount = Account{\n\t\tUser: dbUser,\n\t\tPassword: dbPassword,\n\t}\n\n\tconn := fmt.Sprintf(\"%s:%s@tcp(%s)/%s\",\n\t\tdb.CurrentAccount.User, db.CurrentAccount.Password, dbAddress, dbName)\n\n\th, err := sql.Open(\"mysql\", conn)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdb.Handle = h\n\n\t// prepare statements\n\tdb.stmtCoinPairs, err = db.Handle.Prepare(\n\t\t\"SELECT from_coin, to_coin, exchange_rate, start_date, end_date FROM coin2coin WHERE ? >= start_date && ? <= end_date\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdb.stmtOrders, err = db.Handle.Prepare(\n\t\t`INSERT INTO c2corders (coin_from, coin_to, depositing_c_address, receiving_c_address, i_name, i_mobile, i_m_address, date_placed) \n\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?)`)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}", "title": "" }, { "docid": "3ec7a6a0bf2db97f2c7f734e0b6e61b9", "score": "0.72910106", "text": "func DatabaseInit() *sql.DB {\n\n\terr := godotenv.Load()\n\tif err != nil {\n\t\t// log.Fatal(\"Error loading .env file\")\n\t\tfmt.Println(err)\n\t}\n\tdbDsn := os.Getenv(\"dbDsn\")\n\tDB, err := sql.Open(\"postgres\", dbDsn)\n\n\terr = DB.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Connected to DB\")\n\treturn DB\n}", "title": "" }, { "docid": "37dc8195d903acf43a2bc69056fa9a35", "score": "0.72795045", "text": "func InitConn(params ConnParams) *Connection {\n\tc := &Connection{\n\t\tdialect: \"postgres\",\n\t\tlogger: monitor.NewModuleLogger(\"storage\"),\n\t\tparams: params,\n\t}\n\treturn c\n}", "title": "" }, { "docid": "2d7c3b0e885c942c4109a00d1a593a4a", "score": "0.724648", "text": "func Init(conf *Config) (err error) {\n\tdb, err = sql.Open(\"postgres\", conf.String())\n\tif err != nil {\n\t\treturn\n\t}\n\n\tdb.SetMaxOpenConns(2)\n\tdb.SetMaxIdleConns(2)\n\tdb.SetConnMaxLifetime(0)\n\n\treturn db.Ping()\n}", "title": "" }, { "docid": "953c973dfaa05dcff98ab862bff2b172", "score": "0.72423226", "text": "func InitDataBaseConnect() {\n\tvar err error\n\tvar env string = viper.GetString(\"env\")\n\tvar databaseInfo map[string]string = viper.GetStringMapString(env + \".database.mysql\")\n\tDB_HOST := databaseInfo[\"db_host\"]\n\tDB_PORT := databaseInfo[\"db_port\"]\n\tDB_USER := databaseInfo[\"db_user\"]\n\tDB_PASSWORD := databaseInfo[\"db_password\"]\n\tDB_NAME := databaseInfo[\"db_name\"]\n\n\t//default connection will using utf8 encode.\n\tdbinfo := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8\", DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)\n\tDb, err = sql.Open(\"mysql\", dbinfo)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tlog.Printf(\"SQL Connection Success(%s:%s)\\n\", DB_HOST, DB_PORT)\n\t}\n\n\terr = Db.Ping()\n\tif err != nil {\n\t\tlog.Fatal(\"Error: Could not establish a connection with the database\", err)\n\t}\n\treturn\n}", "title": "" }, { "docid": "f795b6011398e6fb35d68c83dcb053a8", "score": "0.7233243", "text": "func Init() (err error) {\n\t// Create test database if it doesn't already exist\n\tq := client.NewQuery(\"CREATE DATABASE \"+db, \"\", \"\")\n\tres, err := c.Query(q)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res.Error() != nil {\n\t\tlog.Println(\"dbhelper db initialize failed\")\n\t\treturn res.Error()\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cdd668f3630a2636d82965de2dc4f142", "score": "0.72322273", "text": "func init() {\n\terr := config.Read(\"config.toml\")\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdao.Server = config.Server\n\tdao.Database = config.Database\n\tdao.Connect()\n}", "title": "" }, { "docid": "0dc5dd01a4af42f9caa5d753bc2e7dec", "score": "0.723086", "text": "func init() {\n\n\tdb := new(Config)\n\n\tavailable_db := Available()\n\n\tdb.Host = available_db.Host\n\tdb.User = available_db.User\n\tdb.Password = available_db.Password\n\tdb.Database = available_db.Database\n\t\n\tconn, err := gorm.Open(\"mysql\", db.User+\":\"+db.Password+\n\t\t\"@/\"+db.Database+\"?charset=utf8\")\n\tif err != nil {\n\t\tpanic(err)\n\n\t}\n\n\t\n\t m := conn.AutoMigrate(&model.Category{})\n\t \n\t if m.Error != nil {\n\n\t\tpanic(err)\n\n\t }\n\t\n\t if err != nil {\n\t\tpanic(err)\n\n\t}\n\n\tConn = conn\n}", "title": "" }, { "docid": "2352742d87b9dfbb5ad75c7be81b296f", "score": "0.7206365", "text": "func Init() {\n\tlogrus.Debug(\"starting the usage of the database\")\n\tdb.Init()\n}", "title": "" }, { "docid": "b891d2b56eb29f8eab8edb327846012a", "score": "0.72035116", "text": "func (w *Wrapper) Initialize(cs *ConnectionString) error {\n\tvar err error\n\tw.DB, err = sql.Open(SQLDriverName, cs.String())\n\tif err != nil {\n\t\treturn errors.WrapBySourceMsg(err, ErrDBOpenFailed)\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "ca2941d497eaf81c4bf1a2e0fe99f432", "score": "0.7190435", "text": "func init() {\n\tpsqlInfo := fmt.Sprintf(\"host=%s port=%d user=%s \"+\n\t\t\"dbname=%s sslmode=disable\",\n\t\thost, port, user, dbname)\n\n\tdb, err := sql.Open(\"postgres\", psqlInfo)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t//defer db.Close()\n\n\terr = db.Ping()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tDB = db\n\tlog.Printf(\"Successfully connected to Postgres!\")\n}", "title": "" }, { "docid": "123ecccc588cace73f5d430877743ac7", "score": "0.7158571", "text": "func init() {\n\tconfig.Read()\n\n\tgallery_dao.Server = config.Server\n\tgallery_dao.Database = config.Database\n\tgallery_dao.Connect()\n}", "title": "" }, { "docid": "598dd4ac431d759ad809efebcfadeb60", "score": "0.71572965", "text": "func Init() {\n\tvar err error\n\tDb, err = gorm.Open(\"postgres\", \"dbname=tallyup sslmode=disable\")\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tDb.DB()\n}", "title": "" }, { "docid": "516c3e00ab6a7a02e02402b5cd9e2bab", "score": "0.71454924", "text": "func InitDB() {\n\t// Connect to the database\n\tconnStr := fmt.Sprintf(\"user=%s dbname=%s password=%s\", viper.Get(\"database.user\"), viper.Get(\"database.database\"), viper.Get(\"database.password\"))\n\tdb, connErr = sql.Open(\"postgres\", connStr)\n\tif connErr != nil {\n\t\tlog.Fatal(connErr)\n\t}\n\tlogger.Log.Println(\"Connected to database\")\n}", "title": "" }, { "docid": "e64701a614a46d118bd553c33afa66b6", "score": "0.71386236", "text": "func Initialize(connectionString string) {\n\tvar err error\n\n\tDatabase, err = sql.Open(\"postgres\", connectionString)\n\n\tCheck(err)\n\n\tpingErr := Database.Ping()\n\n\tCheck(pingErr)\n}", "title": "" }, { "docid": "9a023cd26c265b443388017ef648b1b4", "score": "0.71379614", "text": "func Init(url string) {\n\tDB, _ = sqlx.Open(\"mysql\", url)\n\tif DB.Ping() != nil {\n\t\tlog.Fatal(\"Error connecting to database\")\n\t}\n}", "title": "" }, { "docid": "a2051f07c626e4809fa661de30a99781", "score": "0.7136649", "text": "func init() {\n\tdatabase = cfg.GetString(\"connections/database\", \"postgres\")\n\n\t// Start Connections\n\tif *database == \"postgres\" {\n\t\tpostgres.New()\n\t\tconnSQLite = postgres.GetConn()\n\t} else if *database == \"mysql\" {\n\t\tmysql.New()\n\t\tconnSQLite = mysql.GetConn()\n\t} else if *database == \"sqlite\" {\n\t\tpath := cfg.GetString(\"connections/sqlite/path\", filepath.Join(os.TempDir(), \"testing.db\"))\n\t\tsqlite.New(path)\n\t\tconnSQLite = sqlite.GetConn()\n\t}\n}", "title": "" }, { "docid": "c31427c001b2b2fe988f4d23143ac8f9", "score": "0.71271056", "text": "func DatabaseInit() {\n\tvar err error\n\n\t// First argument \"mysql\" is the name of our driver\n\t// Second argument concatenation of : user name: root, password: ,\n\t//protocol:tcp, IP adress: 127.0.0.1:3306, name of the data base: garage\n\tdb, err = sql.Open(\"mysql\", \"root:@tcp(127.0.0.1:3306)/garage?parseTime=true\")\n\t// If we cannot connect to the database\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\t// Creates Table cars if not exists\n\tcreateCarsTable()\n\n\t// Creates Table customers (owners of the cars) if not exists\n\tcreateCustomersTable()\n\n\t// Creates Table users (people using the API) if not exists\n\tcreateUsersTable()\n}", "title": "" }, { "docid": "34f815690e86174eed88ad793e54a913", "score": "0.71221626", "text": "func (d *DB) Initialize(host Host) {\n d.connLock.Lock()\n defer d.connLock.Unlock()\n\n d.conns = make(map[Host]*gorm.DB)\n\n dialect := \"host=localhost user=gorm password=gorm dbname=gorm port=15432 sslmode=disable\"\n db, err := d.conn(dialect, Default)\n if err != nil {\n fmt.Printf(\"Dial failed %v\", err)\n\t\tpanic(err)\n }\n\n d.conns[Default] = db\n\n dbName := \"test dcard\"\n err = d.conns[Default].Exec(\"CREATE DATABASE \" + dbName).Error\n if err != nil {\n fmt.Printf(\"create database: %v\", err)\n }\n fmt.Printf(\"sdfdsf\")\n\n for key, db := range d.conns {\n if db != nil {\n db.Close()\n delete(d.conns, key)\n }\n }\n\n}", "title": "" }, { "docid": "9d88518dc4a9882224780db9a613ad8b", "score": "0.7117731", "text": "func Init() (*gorm.DB, error) {\n\n\tdb, err := gorm.Open(\"postgres\", viper.Get(\"Connection\"))\n\n\tif err != nil {\n\t\tlog.Panic(err)\n\t\treturn nil, err\n\t}\n\n\terr = migrate(db)\n\n\tif err != nil {\n\t\tlog.Panic(err)\n\t\treturn nil, err\n\t}\n\n\treturn db, nil\n}", "title": "" }, { "docid": "9132d8c03d2d483df58fac8de5aaf034", "score": "0.7113851", "text": "func InitDatabase(driverName, connectionString string) (*sql.DB, error) {\n\tif connectionString == \"\" {\n\t\treturn nil, fmt.Errorf(\"no ConnectionString, please add db ConnectionString\")\n\t}\n\tdb, err := sql.Open(driverName, connectionString)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Open database\")\n\t}\n\terr = db.Ping()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"Ping database\")\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "c129bab11e0cd6a1cdb5f49b56c3036d", "score": "0.71135986", "text": "func InitDB() {\n\tvar err error\n\tvar dia gorm.Dialector\n\tcfg := config.Get()\n\n\tif cfg.Database != nil {\n\t\tdsn := fmt.Sprintf(\"host=%s user=%s password=%s dbname=%s port=%d\",\n\t\t\tcfg.Database.Hostname,\n\t\t\tcfg.Database.User,\n\t\t\tcfg.Database.Password,\n\t\t\tcfg.Database.Name,\n\t\t\tcfg.Database.Port,\n\t\t)\n\t\tdia = postgres.Open(dsn)\n\t} else {\n\t\tdia = sqlite.Open(\"test.db\")\n\t}\n\n\tDB, err = gorm.Open(dia, &gorm.Config{})\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"failed to connect database: %s\", err.Error()))\n\t}\n}", "title": "" }, { "docid": "a65665f562285429935df277fa8f745a", "score": "0.7107127", "text": "func (db *DatabaseConnections) Initialize() error {\n\tsqlite, e := sql.Open(\"sqlite3\", db.Config.SQLite.Filename)\n\n\tif e != nil {\n\t\treturn e\n\t}\n\n\tschema, e := data.Asset(\"data/sqlite.sql\")\n\n\tif e != nil {\n\t\treturn e\n\t}\n\n\tr, e := sqlite.Exec(string(schema))\n\tif r == nil || e != nil {\n\t\treturn fmt.Errorf(\"unable to load sqlite schema (e %v)\", e)\n\t}\n\n\tdb.sqlite = sqlite\n\n\tconstr := fmt.Sprintf(\n\t\tpsqlConnectionString,\n\t\tdb.Config.Postgres.Username,\n\t\tdb.Config.Postgres.Database,\n\t\tdb.Config.Postgres.Port,\n\t\tdb.Config.Postgres.Password,\n\t)\n\n\tpostgres, e := sql.Open(\"postgres\", constr)\n\n\tif e != nil {\n\t\treturn fmt.Errorf(\"postgres connection error (e %s)\", e.Error())\n\t}\n\n\tschema, e = data.Asset(\"data/postgres.sql\")\n\n\tif e != nil {\n\t\treturn fmt.Errorf(\"unable to load postgres schema (e %s)\", e.Error())\n\t}\n\n\tif _, e := postgres.Exec(string(schema)); e != nil {\n\t\treturn fmt.Errorf(\"unable to seed postgres db (e %s)\", e.Error())\n\t}\n\n\tdb.postgres = postgres\n\n\treturn nil\n}", "title": "" }, { "docid": "6e0f932906721b1d0ee2685e19b85731", "score": "0.7101165", "text": "func Init(conf Config) {\r\n\tctx, _ := context.WithTimeout(context.Background(), initContextTimeout)\r\n\tclient, err := mongo.Connect(ctx, options.Client().ApplyURI(conf.URI))\r\n\tif err != nil {\r\n\t\tlog.Fatalf(\"Unable to initialise database client: %s\", err)\r\n\t}\r\n\r\n\t// Test connection has established\r\n\tctx, _ = context.WithTimeout(context.Background(), initContextTimeout)\r\n\tif err = client.Ping(ctx, readpref.Primary()); err != nil {\r\n\t\tlog.Fatalf(\"Unable to establish database connection: %s\", err)\r\n\t}\r\n\r\n\tdatabase = client.Database(conf.Database)\r\n}", "title": "" }, { "docid": "29712c5c38ecc9fad1579135fb9d86ea", "score": "0.70989513", "text": "func init() {\n\n\t//load in environment variables from .env\n\terr := godotenv.Load(\"../.env\")\n\tif err != nil {\n\t\tlog.Fatalln(\"Error loading .env: \", err)\n\t}\n\n\tvar server = os.Getenv(\"DB_SERVER\")\n\tvar port = os.Getenv(\"DB_PORT\")\n\tvar dbUser = os.Getenv(\"DB_USER\")\n\tvar dbPass = os.Getenv(\"DB_PASS\")\n\tvar db = os.Getenv(\"DB_NAME\")\n\n\t// Build connection string\n\tconnString := fmt.Sprintf(\"server=%s;user id=%s;password=%s;port=%s;database=%s;\", server, dbUser, dbPass, port, db)\n\n\t// Create connection pool\n\tdatabase, err = sql.Open(\"sqlserver\", connString)\n\tif err != nil {\n\t\tlog.Fatal(\"Error creating connection pool: \", err.Error())\n\t}\n\tctx := context.Background()\n\terr = database.PingContext(ctx)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}", "title": "" }, { "docid": "46346eeef93c7018c1ebd652b9e4668f", "score": "0.7083138", "text": "func InitDBConn() {\n\tif mysqlConn == nil {\n\t\tmysqlConn = connectMysql()\n\t}\n\n\terr := mysqlConn.Ping()\n\tif err != nil {\n\t\tlogger.Logger.Fatal(\"Error on connecting to database\", zap.String(\"error\", err.Error()))\n\t}\n\n\tlogger.Logger.Info(\"Success in connecting to database\")\n}", "title": "" }, { "docid": "84a61096b5c7ec6bc8d2119eac1787e7", "score": "0.7071957", "text": "func Init(config config.DB) (*OsmDB, error) {\n\tpool, err := pgx.NewConnPool(pgx.ConnPoolConfig{\n\t\tConnConfig: pgx.ConnConfig{\n\t\t\tHost: config.Host,\n\t\t\tPort: config.Port,\n\t\t\tUser: config.User,\n\t\t\tPassword: config.Password,\n\t\t\tDatabase: config.DBName,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tsts, err := initStatements(pool)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdbinfo := fmt.Sprintf(\"host=%v port=%v user=%v password=%v dbname=%v sslmode=disable\",\n\t\tconfig.Host, config.Port, config.User, config.Password, config.DBName)\n\tconn, err := sqlx.Open(\"postgres\", dbinfo)\n\treturn &OsmDB{\n\t\tpool: pool,\n\t\tdb: conn,\n\t\tstatements: sts,\n\t}, err\n}", "title": "" }, { "docid": "676e7c34733dfe4769ceb7e01b982712", "score": "0.70634615", "text": "func Init() *gorm.DB {\n\tdb, err := gorm.Open(\"mysql\", DbURL(BuildDBConfig()))\n\tif err != nil {\n\t\tfmt.Println(\"db err: \", err)\n\t}\n\tdb.DB().SetMaxIdleConns(10)\n\t// db.LogMode(true)\n\tDB = db\n\treturn DB\n}", "title": "" }, { "docid": "6e7b44b1089a538a498aba5acef698ee", "score": "0.70585954", "text": "func Init(c *configuration.Config) error {\n\tm, err := mgo.Dial(c.Database.URI)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmongo = m\n\tcfg = c\n\treturn nil\n}", "title": "" }, { "docid": "145e7da0c66b53f9bff5028200607748", "score": "0.705133", "text": "func (repository *MetricsRepository) Init() {\n\thost := os.Getenv(\"DB_HOST\")\n\tport, _ := strconv.Atoi(os.Getenv(\"DB_PORT\"))\n\tuser := os.Getenv(\"DB_USERNAME\")\n\tpassword := os.Getenv(\"DB_PASSWORD\")\n\tdbName := os.Getenv(\"DB_DATABASE\")\n\n\tvar connectionString = fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s\", user, password, host, port, dbName)\n\tdb, err := sql.Open(\"mysql\", connectionString)\n\tif err != nil {\n\t\tlog.Panic(err.Error())\n\t}\n\n\trepository.db = db\n}", "title": "" }, { "docid": "92a35c9841542963bb1dc0e43a038007", "score": "0.7042873", "text": "func (db *DBInterface) Init() {\n\tclientOptions := options.Client().ApplyURI(\"mongodb://typelias.se:27017\").SetAuth(options.Credential{\n\t\tAuthSource: \"DnDDB\", Username: os.Getenv(\"MongoUser\"), Password: os.Getenv(\"MongoPassword\"),\n\t})\n\n\tclient, err := mongo.Connect(context.TODO(), clientOptions)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdb.client = client\n\n\tdb.users = client.Database(\"DnDDB\").Collection(\"users\")\n\tdb.campains = client.Database(\"DnDDB\").Collection(\"campains\")\n\tdb.characters = client.Database(\"DnDDB\").Collection(\"characters\")\n}", "title": "" }, { "docid": "40b3237a5c8bfb52727f608f05ec4d61", "score": "0.704232", "text": "func Init() {\r\n\tUser := \"admin\"\r\n\tPass := \"admin321\"\r\n\tHost := \"toppr-task.cedq4jsw4e39.us-east-2.rds.amazonaws.com\"\r\n\tport := \"3306\"\r\n\tdbName := \"mydb2\"\r\n\tdesc := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s\", User, Pass, Host, port, dbName)\r\n\tDb, err = sql.Open(\"mysql\", desc)\r\n\tif err != nil {\r\n\t\tfmt.Print(err.Error())\r\n\t}\r\n\t// connection availability check\r\n\terr = Db.Ping()\r\n\tif err != nil {\r\n\t\tfmt.Print(err.Error())\r\n\t}\r\n}", "title": "" }, { "docid": "019900d680804329cad39c2490d5f7f6", "score": "0.7036259", "text": "func Init() {\n\tdb, err := sql.Open(\"mysql\", \"root:secret@tcp(127.0.0.1:3306)/imperial\") // Should make this a flag to insert when running for details...\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\tDBCon = db\n\tinitTables() // Start creation of tables, should just make a flag if new tables needs to be created like in Laravel\n}", "title": "" }, { "docid": "2c1d6d7e6b16c3787b8b22a9fd919f42", "score": "0.70360696", "text": "func Init(configFilePath string) error {\n\n\tsqlOnce.Do(func() {\n\t\tconfigmdl.InitConfig(configFilePath, &connectionConfig)\n\t\tparamsString := strings.Builder{}\n\n\t\tif len(connectionConfig.Parameters) > 0 {\n\t\t\tfor paramIndex, param := range connectionConfig.Parameters {\n\t\t\t\tif paramsString.String() == \"\" {\n\t\t\t\t\tparamsString.WriteString(\"?\")\n\t\t\t\t}\n\t\t\t\tparamsString.WriteString(param.ParamKey)\n\t\t\t\tparamsString.WriteString(\"=\")\n\t\t\t\tparamsString.WriteString(param.ParamValue)\n\n\t\t\t\thasNextParam := paramIndex+1 < len(connectionConfig.Parameters)\n\t\t\t\tif hasNextParam {\n\t\t\t\t\tparamsString.WriteString(\"&\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconStr := strings.Builder{}\n\t\tconStr.WriteString(connectionConfig.Username)\n\t\tconStr.WriteString(\":\")\n\t\tconStr.WriteString(connectionConfig.Password)\n\t\tconStr.WriteString(\"@\")\n\t\tconStr.WriteString(connectionConfig.Protocol)\n\t\tconStr.WriteString(\"(\")\n\t\tconStr.WriteString(connectionConfig.Server)\n\t\tif connectionConfig.Port <= 0 || strings.TrimSpace(strconv.Itoa(connectionConfig.Port)) == \"\" {\n\t\t\tconStr.WriteString(\":3306\") // mysql default port is 3306\n\t\t} else {\n\t\t\tconStr.WriteString(\":\")\n\t\t\tconStr.WriteString(strconv.Itoa(connectionConfig.Port))\n\t\t}\n\t\tconStr.WriteString(\")/\")\n\t\tconStr.WriteString(connectionConfig.Database)\n\t\tconStr.WriteString(paramsString.String())\n\t\tconnectionInstance, connectionError := dbr.Open(\"mysql\", conStr.String(), nil)\n\t\tif errormdl.CheckErr1(connectionError) != nil {\n\t\t\tloggermdl.LogError(\"Init dbr.Open Err : \", connectionError)\n\t\t\treturn\n\t\t}\n\t\tif connectionConfig.MaxIdleConns == 0 {\n\t\t\tconnectionConfig.MaxIdleConns = constantmdl.MAX_IDLE_CONNECTIONS // default is 2\n\t\t}\n\t\tif connectionConfig.MaxOpenConns == 0 {\n\t\t\tconnectionConfig.MaxOpenConns = constantmdl.MAX_OPEN_CONNECTIONS // default there's no limit\n\t\t}\n\t\tif connectionConfig.ConnMaxLifetime == 0 {\n\t\t\tconnectionConfig.ConnMaxLifetime = constantmdl.CONNECTION_MAX_LIFETIME\n\t\t}\n\t\tconnectionInstance.SetMaxIdleConns(connectionConfig.MaxIdleConns)\n\t\tconnectionInstance.SetMaxOpenConns(connectionConfig.MaxOpenConns)\n\t\tconnectionInstance.SetConnMaxLifetime(connectionConfig.ConnMaxLifetime)\n\t})\n\treturn connectionError\n}", "title": "" }, { "docid": "d1155244cc3573088362eba417a664de", "score": "0.7029717", "text": "func DBInit(dbhost, dbport, dbuser, dbname string) (*gorm.DB, error) {\n\tvar (\n\t\tconfigDB = fmt.Sprintf(\n\t\t\t\"postgresql://%s@%s:%s/%s?sslmode=disable\",\n\t\t\tdbuser, dbhost, dbport, dbname)\n\t)\n\n\tDB, err := gorm.Open(\"postgres\", configDB)\n\tif err != nil {\n\t\tlog.Println(fmt.Sprintf(\"failed to connect to database: %v\", err))\n\t\treturn nil, err\n\t}\n\treturn DB, nil\n}", "title": "" }, { "docid": "cc691ad575ddfc188177c3abcfb1147c", "score": "0.70292497", "text": "func Init() error {\n\ttemp, err := db.NewDB()\n\tif err != nil {\n\t\tlog.Error(\"Cannot create database\")\n\t} else {\n\t\tworkloadDatabase = temp\n\t}\n\treturn err\n}", "title": "" }, { "docid": "0e36a76d695a7dbd3074bdb70fc3bb08", "score": "0.7028831", "text": "func InitDB(driver, connString string) (*DB, error) {\n\tdb, err := sql.Open(driver, connString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &DB{db}, nil\n}", "title": "" }, { "docid": "7de9ee27cb0728d2f5e195b0de1f2a4d", "score": "0.70176554", "text": "func InitDatabase() {\n\tconnStr := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=disable\",\n\thost, port, user, password, dbname)\n\n\tdatabase, err := gorm.Open(\"postgres\", connStr)\n\thelpers.HandleErr(err)\n\n\t// Setup connection pool\n\t// Setup idle connections as 20\n\tdatabase.DB().SetMaxIdleConns(20)\n\t// max connections as 200\n\tdatabase.DB().SetMaxOpenConns(200)\n\n\tDB = database\n}", "title": "" }, { "docid": "ed854deb2cea56b263bce352ecbb7a13", "score": "0.70157146", "text": "func Initialize(databaseUrl string) error {\n\tvar err error\n\tdb, err = sql.Open(\"postgres\", databaseUrl)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err = db.Ping(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}", "title": "" }, { "docid": "b777e9551c052da07f39945848855381", "score": "0.70102113", "text": "func (c *Connector) InitConnection(def *conf.DataSourceDefinition) {\n\tvar connectionString string\n\tvar exist bool\n\n\t// if connectionString is provided then use it\n\tif connectionString, exist = def.Settings[optionalFields[\"connectionString\"]]; exist {\n\t\tlog.Println(\"Using provided connection string\")\n\t} else {\n\t\tlog.Println(\"No connection string, building from mandatory fields\")\n\t\t// todo: mongo connection string varies a lot, maybe just pass the whole string from a secret rather than composing it here??\n\t\tconnectionString = fmt.Sprintf(\n\t\t\t\"mongodb://%s:%s@%s\",\n\t\t\tdef.Settings[optionalFields[\"username\"]],\n\t\t\tdef.Settings[optionalFields[\"password\"]],\n\t\t\tdef.Settings[optionalFields[\"host\"]],\n\t\t)\n\t}\n\n\tvar err error\n\tctx := context.Background()\n\t//c.DBCLient, err = mongo.NewClient(options.Client().ApplyURI(connectionString))\n\t//err = c.DBCLient.Connect(context.Background())\n\tc.Client, err = mongo.Connect(ctx, options.Client().ApplyURI(connectionString))\n\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tif err = c.Client.Ping(ctx, readpref.Primary()); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t} else {\n\t\t\tlog.Println(\"Successfully connected to db\")\n\t\t}\n\t}\n\n\t// set target db and connections\n\tc.Database = c.Client.Database(def.Settings[requiredFields[\"database\"]])\n\tc.Collection = c.Database.Collection(def.Settings[requiredFields[\"collection\"]])\n}", "title": "" }, { "docid": "26b75361f9174336755d8923d5690486", "score": "0.7006872", "text": "func InitializeDBConnection() (*gorm.DB, error) {\n\tstring2 := ParameterDbConnection()\n\tdb, err := postgre.NewDBConnection(string2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "e8a9690a12b190d7515d7a72cd0f976b", "score": "0.69820213", "text": "func (serv *Server) Initialize(host string, user string, password string, port int, dbname string) {\r\n connectionString := fmt.Sprintf(\"host=%s user=%s password=%s port=%d dbname=%s sslmode=disable\", host, user, password, port, dbname)\r\n\r\n var err error\r\n serv.DB, err = sql.Open(\"postgres\", connectionString)\r\n if err != nil {\r\n log.Fatal(err)\r\n }\r\n\r\n err = serv.DB.Ping()\r\n if err != nil {\r\n panic(err)\r\n }\r\n\r\n serv.Router = mux.NewRouter().StrictSlash(true)\r\n serv.initializeRoutes()\r\n}", "title": "" }, { "docid": "4f59ae4558a04234739b13459dd447e2", "score": "0.69762397", "text": "func (repository *EntitiesRepository) Init() {\n\trepository.Server = \"localhost:27017\"\n\trepository.Database = \"darwin\"\n\trepository.Connect()\n}", "title": "" }, { "docid": "34fe890e90eaa6ea88d884fa878941c1", "score": "0.6969253", "text": "func InitDatabase() {\n\tvar url string\n\taddress := revel.Config.StringDefault(\"mongo.address\", \"127.0.0.1\")\n\tport := revel.Config.StringDefault(\"mongo.port\", \"27017\")\n\turl = fmt.Sprintf(\"mongodb://%s:%s\", address, port)\n\n\tsess, err := mgo.Dial(url)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tsess.SetSocketTimeout(1 * time.Hour)\n\tdb = revel.Config.StringDefault(\"mongo.database\", \"RPGit\")\n\t//\tdb := session.DB(revel.Config.StringDefault(\"mongo.database\", \"RPGithub\"))\n\n\tDatabase = &Mongo{}\n}", "title": "" }, { "docid": "34825e10d3eef46107f28ed17d38b271", "score": "0.69544107", "text": "func (d *DTO) Init(dataSourceName string) {\n\tif len(dataSourceName) == 0 {\n\t\tdataSourceName = \"root@/loa\"\n\t}\n\tdb, err := sql.Open(\"mysql\", dataSourceName)\n\td.Status = \"Initialised\"\n\td.Error = err\n\td.DB = db\n}", "title": "" }, { "docid": "4ca7829e06753db21dbe3e0f37dcadc9", "score": "0.69481397", "text": "func Initialise(ctx context.Context) {\n\tenv := config.InitEnvironment()\n\n\tdbEndpoint := env.DBEndpoint\n\tdbPort := env.DBPort\n\tdbUser := env.DBUser\n\tdbPassword := env.DBPassword\n\tdbName := env.DBName\n\n\tif env.IsTestMode {\n\t\t// display the line and file in the logs\n\t\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n\t}\n\n\tnewDB, err := connectToMySQL(ctx, dbEndpoint, dbUser, dbPassword, dbName, dbPort)\n\tif err != nil {\n\t\tlog.Fatalf(\"Couldn't initialise the DB\")\n\t}\n\n\tlogs.Log(ctx, \"Database started!\")\n\n\tConnected = true\n\tDB = newDB.DB\n}", "title": "" }, { "docid": "2919bd3a8b7fd194fa8e0076ade1e3c0", "score": "0.6943612", "text": "func InitiateDB(db *pg.DB) {\n\tdbConnect = db\n}", "title": "" }, { "docid": "773b1b67266aa93a529e16e8289b7aa8", "score": "0.69369245", "text": "func (self *Database) Init() {\n\n\t// start commit log\n\tgo self.StartCommitLog()\n\n\tself.DB.Init()\n\n\tconn := self.DB.Connect()\n\tdefer conn.Close()\n\n\terr := self.DB.CreateTable(conn, self.getTable())\n\tif nil != err {\n\t\tpanic(err)\n\t}\n\n\terr = self.DB.CreateTable(conn, self.getTable()+\"Timeseries\")\n\tif nil != err {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "2fa6995d70cc821787c6d2ca402a7319", "score": "0.693265", "text": "func Init() {\n\tDBPG := \"postgres\"\n\tCONNECT := \"host=\" + os.Getenv(\"DB_HOST\") + \" port=\" + os.Getenv(\"DB_PORT\") + \" user=\" + os.Getenv(\"DB_USER\") + \" dbname=\" + os.Getenv(\"DB_NAME\") + \" password=\" + os.Getenv(\"DB_PASSWORD\") + \" sslmode=disable\"\n\tdb, err = gorm.Open(DBPG, CONNECT)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tseed.Load(db)\n}", "title": "" }, { "docid": "05873cf1594c2a46f34eae98d06b8337", "score": "0.6926528", "text": "func InitDB() {\n\tdb, err := sql.Open(\"mysql\", \"PLACEHOLDER\")\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\n\tdefer db.Close()\n\n\terr = db.Ping()\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t} else {\n\t\tlog.Printf(\"Connection established\")\n\t}\n}", "title": "" }, { "docid": "1e83ac188652a8f98e462856ed0baaa1", "score": "0.6926134", "text": "func InitDB(connection string) (*gorm.DB, error) {\n\tdb, err := gorm.Open(\"postgres\", connection)\n\treturn db, err\n}", "title": "" }, { "docid": "b2fc7b9f9d0b495d9104f1f1a1fdd639", "score": "0.6921883", "text": "func InitDatabase(options DatabaseOptions) *sql.DB {\n\t// connection string\n\tpsqlconn := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=disable\", options.host, options.port, options.user, options.password, options.dbname)\n\tlog.Printf(\"Connecting to host %s\\n\", options.host)\n\n\t// open database\n\tdb, err := sql.Open(\"postgres\", psqlconn)\n\tCheckError(err, \"Open Database Error\")\n\n\t// check db\n\terr = db.Ping()\n\tCheckError(err, \"Database Ping Error\")\n\n\tfmt.Println(\"Connected!\")\n\n\treturn db\n}", "title": "" }, { "docid": "461703d67894175edd2e1836c326ddfa", "score": "0.6916734", "text": "func InitDatabaseCon(ip string, port string, username string, password string) error {\n\tlog.SetFlags(log.LstdFlags | log.Lshortfile)\n\n\tif db == nil {\n\t\tsrc := username + \":\" + password + \"@tcp(\" + ip + \":\" + port + \")/\" + DataBase\n\t\tvar err error\n\t\tdb, err = sql.Open(\"mysql\", src)\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\treturn err\n\t\t}\n\t\terr = db.Ping()\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t\tdb.Close()\n\t\t\tdb = nil\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "479e3b31878f778790d08076c21c70f6", "score": "0.6908281", "text": "func (a *App) Initialize(config *config.Config) {\n\tdbURI := fmt.Sprintf(\"%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=True\",\n\t\tconfig.DB.Username,\n\t\tconfig.DB.Password,\n\t\tconfig.DB.Host,\n\t\tconfig.DB.Port,\n\t\tconfig.DB.Name,\n\t\tconfig.DB.Charset)\n\n\tdb, err := gorm.Open(config.DB.Dialect, dbURI)\n\tif err != nil {\n\t\tlog.Fatal(\"Could not connect database\")\n\t\tpanic(err.Error())\n\t}\n\tlog.Println(\"DB Connection was successful!!\")\n\n\ta.DB = model.DBMigrate(db)\n\ta.Router = mux.NewRouter()\n\ta.setRouters()\n}", "title": "" }, { "docid": "a1e2cad3abed61853158a03910f33a59", "score": "0.6906894", "text": "func (a *App) InitializeDB() {\n\tconnectionString := config.DBConfig[\"user\"] + \":\" + config.DBConfig[\"password\"] +\n\t\t\"@/\" + config.DBConfig[\"dbName\"]\n\n\tdb, err := sql.Open(config.DBConfig[\"driver\"], connectionString)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\ta.DB = db\n}", "title": "" }, { "docid": "8bc621b3fb4e1c6ac329a8b632ba2216", "score": "0.690635", "text": "func init() {\n\tdb, err := sql.Open(\"mysql\", mysql_connect)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t} else {\n\t\tlog.Println(\"Successfully connected to mysql database\")\n\t}\n\tdefer db.Close()\n\n}", "title": "" }, { "docid": "3d015ec656a583c0ba9889781ca3df63", "score": "0.690017", "text": "func (db *MongoDB) Init() error {\n\tlog.Infoln(\"Connecting to the mongo database ...\")\n\tdb.DbName = common.Config.DbName\n\t// mongodb connection options\n\tclientOptions := options.Client().ApplyURI(fmt.Sprintf(\"mongodb://%s\", common.Config.DbAddr))\n\n\tctx, _ := context.WithTimeout(context.Background(), 10*time.Second)\n\n\t// connect to MongoDB\n\tclient, err := mongo.Connect(ctx, clientOptions)\n\tif err != nil {\n\t\tlog.Errorf(\"Couldn't connect to the mongo database, err: %v\", err)\n\t\treturn err\n\t}\n\n\t// check the connection\n\t// FIXME: when using this with docker it doesn't wait 10 sec\n\t/*\n\t\tif err := client.Ping(ctx, nil); err != nil {\n\t\t\tlog.Errorf(\"Unable to connect to the MongoDB; err: %v\", err)\n\t\t\treturn err\n\t\t}\n\t*/\n\n\t// create session\n\tsession, err := client.StartSession()\n\tif err != nil {\n\t\tlog.Errorf(\"Couldn't create mongo session, err: %v\", err)\n\t\treturn err\n\t}\n\tlog.Infoln(\"Successfuly connected to the Mongo database\")\n\n\tdb.Session = session\n\treturn nil\n}", "title": "" }, { "docid": "908341e351e79c2eec8734497c30b88f", "score": "0.68809414", "text": "func initDB(c dbConfig.Config) {\n\tdb, err = sql.Open(\"mysql\", c.DatabaseUrl)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdb.SetMaxOpenConns(100)\n\n\tif err := db.Ping(); err != nil {\n\t\tlog.Panicf(\"open database fail: %v\", err)\n\t\treturn\n\t}\n\tfmt.Println(\"connect success\")\n}", "title": "" }, { "docid": "17bf71227274ef935d8f2e673f7be472", "score": "0.6872429", "text": "func (g *implGorm) InitDBConnection(dsn string, logLevel string) (err error) {\n\tvar gormLogConfig = gormlog.Config{\n\t\tSlowThreshold: 200 * time.Millisecond,\n\t\tLogLevel: gormlog.Info,\n\t\tColorful: false,\n\t}\n\n\t// create db log\n\tswitch logLevel {\n\tcase \"WARN\":\n\t\tgormLogConfig.LogLevel = gormlog.Warn\n\tcase \"ERROR\":\n\t\tgormLogConfig.LogLevel = gormlog.Error\n\tcase \"SILENT\":\n\t\tgormLogConfig.LogLevel = gormlog.Silent\n\tdefault:\n\t\tlog.Println(\"START GORM LOG WITH DEFAULT CONFIG: INFO\")\n\t}\n\n\tvar (\n\t\tgormConfig = &gorm.Config{\n\t\t\tLogger: gormlog.New(log.New(os.Stdout, \"\\r\\n\", log.LstdFlags), gormLogConfig),\n\t\t\tNamingStrategy: schema.NamingStrategy{\n\t\t\t\tSingularTable: true,\n\t\t\t},\n\t\t}\n\t)\n\n\tgDB, err = gorm.Open(postgres.Open(dsn), gormConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := GetGormDB().AutoMigrate(context.Background(), usrmanrpc.Team{}, usrmanrpc.Project{}, usrmanrpc.User{}); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}", "title": "" }, { "docid": "cd8e3639a7f99054a22b05db36677b7d", "score": "0.6871616", "text": "func InitDatabase(config *Configuration) (*sql.DB, error) {\n\tconnString := fmt.Sprintf(\"host=%s port=%s user=%s password=%s dbname=%s sslmode=disable\",\n\t\tconfig.Database.Host, config.Database.Port, config.Database.User, config.Database.Password, config.Database.DBName)\n\tdb, err := connectDB(connString)\n\n\tif err != nil {\n\t\tlog.Error(\"failed to connect to database: \", err)\n\t}\n\treturn db, nil\n}", "title": "" }, { "docid": "c073911b9a54c6cac17185ca8e334bc4", "score": "0.68665606", "text": "func (a *App) Initialize(DbHost, DbPort, DbUser, DbName, DbPassword string) {\n\tvar err error\n\tDBURI := fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s sslmode=disable password=%s\", DbHost, DbPort, DbUser, DbName, DbPassword)\n\n\ta.DB, err = gorm.Open(\"postgres\", DBURI)\n\tif err != nil {\n\t\tfmt.Printf(\"\\n Cant connect to the DB %s\", DbName)\n\t\tlog.Fatal(\"This is the error\", err)\n\n\t} else {\n\t\tfmt.Printf(\"We are connected to the database %s\", DbName)\n\t}\n\tgorm.DefaultTableNameHandler = func(db *gorm.DB, defaultTableName string) string {\n\t\treturn \"main.\" + defaultTableName\n\t}\n\ta.DB.Debug().AutoMigrate(&models.Movie{}) //database migration\n\n\ta.Router = mux.NewRouter().StrictSlash(true)\n\ta.initializeRoutes()\n}", "title": "" }, { "docid": "f19e476610bf7a843b684fc2dde80960", "score": "0.68602955", "text": "func (s *DB0) Init(cfg *gmcconfig.Config) error {\n\treturn gmcdbhelper.Init(cfg)\n}", "title": "" }, { "docid": "5e89722c0bbd4ab235bd3cc3154ed97a", "score": "0.6857501", "text": "func (db *MongoDB) Init() error {\n\tutil.TypeLogger.Debug(\"%s: Call for Init\", packageName)\n\tdefer util.TypeLogger.Debug(\"%s: Ended Call for Init\", packageName)\n\n\t// Setup session with database\n\tutil.TypeLogger.Info(\"%s: Dialing database, setting up session\", packageName)\n\tsession, err := mgo.Dial(db.DatabaseURL)\n\n\t// Check for session error\n\tif err != nil {\n\t\tutil.TypeLogger.Fatal(\"%s: Failed to dial database\", packageName)\n\t\treturn err\n\t}\n\n\t// Set up currency collation indexing\n\tindex := mgo.Index{\n\t\tKey: []string{\"uri\"},\n\t\tUnique: true,\n\t\tDropDups: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\n\t// Ensure collation follows the index\n\tutil.TypeLogger.Info(\"%s: Creating collection %s Ensure \\\"index\\\"\", packageName, db.RepoColl)\n\terr = session.DB(db.DatabaseName).C(db.RepoColl).EnsureIndex(index)\n\tif err != nil {\n\t\tutil.TypeLogger.Fatal(\"%s: Failed to ensure \\\"index\\\" on collection %s: %s\", packageName, db.RepoColl, err.Error())\n\t\treturn err\n\t}\n\n\t// Postpone closing connection until we return\n\tdefer session.Close()\n\n\tutil.TypeLogger.Info(\"%s: Initializing successfull\", packageName)\n\t// Nothing bad happened!\n\treturn nil\n}", "title": "" }, { "docid": "0c3ae611a68242b09084681eff3e80fd", "score": "0.6853327", "text": "func init() {\n\t//TODO(load config from config file)\n\t//\tinclude: user password host port dbname\n\tdsn := \"root:test@tcp(127.0.0.1:3306)/forum?charset=utf8mb4&parseTime=True&loc=Local\"\n\ttemDB,err := gorm.Open(mysql.Open(dsn),&gorm.Config{})\n\tif err!=nil{\n\t\tpanic(err)\n\t}else {\n\t\tdb = temDB\n\t}\n\n\t//restoreDB()\n\tcheckAndCreateTable()\n\t//insertTestData1()\n\t//insertTestData()\n\t//test()\n}", "title": "" }, { "docid": "fac38f833ab0b15e5ac3eb1fc32a8176", "score": "0.6849927", "text": "func (db *Database) Init() {\n\tsession, err := mgo.Dial(db.HostURL)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer session.Close()\n\n\tindex := mgo.Index{\n\t\tKey: []string{\"icao24\"},\n\t\tUnique: true,\n\t\tDropDups: true,\n\t\tBackground: true,\n\t\tSparse: true,\n\t}\n\n\terr = session.DB(db.DatabaseName).C(db.CollectionState).EnsureIndex(index)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}", "title": "" }, { "docid": "c67a84e0583ef5d42d63f3cbaac16b05", "score": "0.6845726", "text": "func Init() {\n\tconfig := config.GetConfig()\n\t// host=myhost port=myport user=gorm dbname=gorm password=mypassword\n\tconnectionString := fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s password=%s\", config.DB_HOST, config.DB_PORT, config.DB_USERNAME, config.DB_NAME, config.DB_PASSWORD)\n\tdb, _ = gorm.Open(\"postgres\", connectionString)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(db)\n\tdb.AutoMigrate(&models.User{})\n}", "title": "" }, { "docid": "13ef76276588333ab986d24435983af8", "score": "0.68441683", "text": "func (s *Storage) Init() error {\n\n\tvar err error\n\n\tdriver, err := neo4j.NewDriver(s.URI, neo4j.BasicAuth(s.Username, s.Password, \"\"))\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn err\n\t}\n\n\tif s.Database == \"\" {\n\t\tfmt.Println(\"Database is not defined, using: neo4j\")\n\t\ts.Database = \"neo4j\"\n\t}\n\n\ts.driver = &driver\n\n\treturn err\n}", "title": "" }, { "docid": "c8e70cfec22f98ceb99e8988935c9709", "score": "0.6842598", "text": "func Init() {\n\t// Read configuration.\n\tvar found bool\n\tif Driver, found = revel.Config.String(\"db.driver\"); !found {\n\t\trevel.RevelLog.Fatal(\"db.driver not configured\")\n\t}\n\tif Spec, found = revel.Config.String(\"db.spec\"); !found {\n\t\trevel.RevelLog.Fatal(\"db.spec not configured\")\n\t}\n\n\t// Open a connection.\n\tvar err error\n\tDb, err = sql.Open(Driver, Spec)\n\tif err != nil {\n\t\trevel.RevelLog.Fatal(\"Open database connection error\", \"error\", err, \"driver\", Driver, \"spec\", Spec)\n\t}\n\n\trevel.OnAppStop(func() {\n\t\trevel.RevelLog.Info(\"Closing the database (from module)\")\n\t\tif err := Db.Close(); err != nil {\n\t\t\trevel.AppLog.Error(\"Failed to close the database\", \"error\", err)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "89fa1324ded882ebb5db11d9c01f0a71", "score": "0.68359333", "text": "func (s *Server) Initialize(DbUser, DbPassword, DbPort, DbHost, DbName string) {\n\tvar err error\n\n\tDbURI := fmt.Sprintf(\"%s:%s@tcp(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local\", DbUser, DbPassword, DbHost, DbPort, DbName)\n\ts.DB, err = gorm.Open(\"mysql\", DbURI)\n\tif err != nil {\n\t\tfmt.Printf(\"Cannot connect to mysql database\")\n\t\tlog.Fatal(\"This is the error:\", err)\n\t} else {\n\t\tfmt.Printf(\"Successfully connected to database\\n\")\n\t}\n\n\t//database migration\n\ts.DB.Debug().AutoMigrate(&models.User{}, &models.PasswordReset{}, &models.Wallet{}, &models.WalletTransaction{})\n\n\ts.Router = mux.NewRouter()\n\ts.LoadRoutes()\n}", "title": "" }, { "docid": "008a5cf0a819a873327157be35df1b4d", "score": "0.68301827", "text": "func InitDatabase(config DBConfig) *Database {\n\t// make sure this code only gets executed once\n\tsingleton.Do(func() {\n\t\tvar database *sql.DB\n\t\tvar err error = ErrNotFound // just to make sure, it is not nil in the first loop iteration\n\t\ttries := 0\n\n\t\tfor err != nil && tries < 5 {\n\t\t\tdatabase, err = sql.Open(config.Driver,\n\t\t\t\tconfig.Username+\":\"+config.Password+\"@tcp(\"+config.Host+\")/\"+config.Name+\"?parseTime=true\")\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(err)\n\t\t\t\tlog.Println(\"Trying again\")\n\t\t\t\ttime.Sleep(time.Second * 2)\n\t\t\t}\n\t\t\ttries++\n\t\t}\n\n\t\t// optimize connection pool\n\t\tdatabase.SetConnMaxLifetime(time.Minute * 20)\n\t\tdatabase.SetMaxOpenConns(10)\n\t\tdatabase.SetMaxIdleConns(4)\n\n\t\t// check if database is available\n\t\tif err := database.Ping(); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\tdb = Database{\n\t\t\tdatabase,\n\t\t}\n\t})\n\n\treturn &db\n}", "title": "" }, { "docid": "c349d2f8836ab0d99fddc20b138b627b", "score": "0.68210435", "text": "func (server *Server) Initialize(dbUser, dbPassword, dbPort, dbHost, dbName string) {\n\n\tvar err error\n\n\tDBURL := fmt.Sprintf(\"host=%s port=%s user=%s dbname=%s sslmode=disable password=%s\", dbHost, dbPort, dbUser, dbName, dbPassword)\n\tserver.DB, err = gorm.Open(\"postgres\", DBURL)\n\tif err != nil {\n\t\tfmt.Printf(\"Cannot connect to postgres database\")\n\t\tlog.Fatal(\"This is the error connecting to postgres:\", err)\n\t} else {\n\t\tfmt.Printf(\"We are connected to the postgres database\")\n\t}\n\n\tvalidations.RegisterCallbacks(server.DB)\n\n\t// database migration\n\tserver.DB.Debug().AutoMigrate(\n\t\t&models.User{},\n\t\t&models.Profiles{},\n\t\t&models.Events{},\n\t\t&models.Post{},\n\t\t&models.Upvote{},\n\t\t&models.Event_Comment{},\n\t)\n\n\tserver.Router = gin.Default()\n\tserver.Router.Use(middlewares.CORSMiddleware())\n\n\tserver.intializeRoutes()\n\n}", "title": "" }, { "docid": "f685a1ebc2864d48caf54206e121cc96", "score": "0.68136895", "text": "func (server *Server) InitializeDB(host string, dbname string, collection string) {\n\tif host == \"\" || dbname == \"\" || collection == \"\" {\n\t\tlog.Fatal(\"You must specify a valid host, database name and collection\")\n\t}\n\n\tsession, err := mgo.Dial(host)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tsession.SetMode(mgo.Monotonic, true)\n\tCOLLECTION = collection\n\tserver.Session = session\n\tserver.DB = session.DB(dbname)\n\tserver.Dispatch = mux.NewRouter()\n\tserver.initializeRoutes()\n}", "title": "" }, { "docid": "4c8d2af9b611332f3ea27a5281d68835", "score": "0.6800287", "text": "func (p *MysqlProvider) Init(expire int64, connStr string) (err error) {\n\tp.expire = expire\n\n\tp.c, err = sql.Open(\"mysql\", connStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn p.c.Ping()\n}", "title": "" } ]